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.
 
 
 

13651 lines
482 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package games provides access to the Google Play Game Services API.
  6. //
  7. // For product documentation, see: https://developers.google.com/games/services/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/games/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // gamesService, err := games.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // gamesService, err := games.NewService(ctx, option.WithScopes(games.PlusMeScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // gamesService, err := games.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // gamesService, err := games.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package games // import "google.golang.org/api/games/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "games:v1"
  71. const apiName = "games"
  72. const apiVersion = "v1"
  73. const basePath = "https://www.googleapis.com/games/v1/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // View and manage its own configuration data in your Google Drive
  77. DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"
  78. // Create, edit, and delete your Google Play Games activity
  79. GamesScope = "https://www.googleapis.com/auth/games"
  80. // Know who you are on Google
  81. PlusMeScope = "https://www.googleapis.com/auth/plus.me"
  82. )
  83. // NewService creates a new Service.
  84. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  85. scopesOption := option.WithScopes(
  86. "https://www.googleapis.com/auth/drive.appdata",
  87. "https://www.googleapis.com/auth/games",
  88. "https://www.googleapis.com/auth/plus.me",
  89. )
  90. // NOTE: prepend, so we don't override user-specified scopes.
  91. opts = append([]option.ClientOption{scopesOption}, opts...)
  92. client, endpoint, err := htransport.NewClient(ctx, opts...)
  93. if err != nil {
  94. return nil, err
  95. }
  96. s, err := New(client)
  97. if err != nil {
  98. return nil, err
  99. }
  100. if endpoint != "" {
  101. s.BasePath = endpoint
  102. }
  103. return s, nil
  104. }
  105. // New creates a new Service. It uses the provided http.Client for requests.
  106. //
  107. // Deprecated: please use NewService instead.
  108. // To provide a custom HTTP client, use option.WithHTTPClient.
  109. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  110. func New(client *http.Client) (*Service, error) {
  111. if client == nil {
  112. return nil, errors.New("client is nil")
  113. }
  114. s := &Service{client: client, BasePath: basePath}
  115. s.AchievementDefinitions = NewAchievementDefinitionsService(s)
  116. s.Achievements = NewAchievementsService(s)
  117. s.Applications = NewApplicationsService(s)
  118. s.Events = NewEventsService(s)
  119. s.Leaderboards = NewLeaderboardsService(s)
  120. s.Metagame = NewMetagameService(s)
  121. s.Players = NewPlayersService(s)
  122. s.Pushtokens = NewPushtokensService(s)
  123. s.QuestMilestones = NewQuestMilestonesService(s)
  124. s.Quests = NewQuestsService(s)
  125. s.Revisions = NewRevisionsService(s)
  126. s.Rooms = NewRoomsService(s)
  127. s.Scores = NewScoresService(s)
  128. s.Snapshots = NewSnapshotsService(s)
  129. s.TurnBasedMatches = NewTurnBasedMatchesService(s)
  130. return s, nil
  131. }
  132. type Service struct {
  133. client *http.Client
  134. BasePath string // API endpoint base URL
  135. UserAgent string // optional additional User-Agent fragment
  136. AchievementDefinitions *AchievementDefinitionsService
  137. Achievements *AchievementsService
  138. Applications *ApplicationsService
  139. Events *EventsService
  140. Leaderboards *LeaderboardsService
  141. Metagame *MetagameService
  142. Players *PlayersService
  143. Pushtokens *PushtokensService
  144. QuestMilestones *QuestMilestonesService
  145. Quests *QuestsService
  146. Revisions *RevisionsService
  147. Rooms *RoomsService
  148. Scores *ScoresService
  149. Snapshots *SnapshotsService
  150. TurnBasedMatches *TurnBasedMatchesService
  151. }
  152. func (s *Service) userAgent() string {
  153. if s.UserAgent == "" {
  154. return googleapi.UserAgent
  155. }
  156. return googleapi.UserAgent + " " + s.UserAgent
  157. }
  158. func NewAchievementDefinitionsService(s *Service) *AchievementDefinitionsService {
  159. rs := &AchievementDefinitionsService{s: s}
  160. return rs
  161. }
  162. type AchievementDefinitionsService struct {
  163. s *Service
  164. }
  165. func NewAchievementsService(s *Service) *AchievementsService {
  166. rs := &AchievementsService{s: s}
  167. return rs
  168. }
  169. type AchievementsService struct {
  170. s *Service
  171. }
  172. func NewApplicationsService(s *Service) *ApplicationsService {
  173. rs := &ApplicationsService{s: s}
  174. return rs
  175. }
  176. type ApplicationsService struct {
  177. s *Service
  178. }
  179. func NewEventsService(s *Service) *EventsService {
  180. rs := &EventsService{s: s}
  181. return rs
  182. }
  183. type EventsService struct {
  184. s *Service
  185. }
  186. func NewLeaderboardsService(s *Service) *LeaderboardsService {
  187. rs := &LeaderboardsService{s: s}
  188. return rs
  189. }
  190. type LeaderboardsService struct {
  191. s *Service
  192. }
  193. func NewMetagameService(s *Service) *MetagameService {
  194. rs := &MetagameService{s: s}
  195. return rs
  196. }
  197. type MetagameService struct {
  198. s *Service
  199. }
  200. func NewPlayersService(s *Service) *PlayersService {
  201. rs := &PlayersService{s: s}
  202. return rs
  203. }
  204. type PlayersService struct {
  205. s *Service
  206. }
  207. func NewPushtokensService(s *Service) *PushtokensService {
  208. rs := &PushtokensService{s: s}
  209. return rs
  210. }
  211. type PushtokensService struct {
  212. s *Service
  213. }
  214. func NewQuestMilestonesService(s *Service) *QuestMilestonesService {
  215. rs := &QuestMilestonesService{s: s}
  216. return rs
  217. }
  218. type QuestMilestonesService struct {
  219. s *Service
  220. }
  221. func NewQuestsService(s *Service) *QuestsService {
  222. rs := &QuestsService{s: s}
  223. return rs
  224. }
  225. type QuestsService struct {
  226. s *Service
  227. }
  228. func NewRevisionsService(s *Service) *RevisionsService {
  229. rs := &RevisionsService{s: s}
  230. return rs
  231. }
  232. type RevisionsService struct {
  233. s *Service
  234. }
  235. func NewRoomsService(s *Service) *RoomsService {
  236. rs := &RoomsService{s: s}
  237. return rs
  238. }
  239. type RoomsService struct {
  240. s *Service
  241. }
  242. func NewScoresService(s *Service) *ScoresService {
  243. rs := &ScoresService{s: s}
  244. return rs
  245. }
  246. type ScoresService struct {
  247. s *Service
  248. }
  249. func NewSnapshotsService(s *Service) *SnapshotsService {
  250. rs := &SnapshotsService{s: s}
  251. return rs
  252. }
  253. type SnapshotsService struct {
  254. s *Service
  255. }
  256. func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService {
  257. rs := &TurnBasedMatchesService{s: s}
  258. return rs
  259. }
  260. type TurnBasedMatchesService struct {
  261. s *Service
  262. }
  263. // AchievementDefinition: This is a JSON template for an achievement
  264. // definition object.
  265. type AchievementDefinition struct {
  266. // AchievementType: The type of the achievement.
  267. // Possible values are:
  268. // - "STANDARD" - Achievement is either locked or unlocked.
  269. // - "INCREMENTAL" - Achievement is incremental.
  270. AchievementType string `json:"achievementType,omitempty"`
  271. // Description: The description of the achievement.
  272. Description string `json:"description,omitempty"`
  273. // ExperiencePoints: Experience points which will be earned when
  274. // unlocking this achievement.
  275. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  276. // FormattedTotalSteps: The total steps for an incremental achievement
  277. // as a string.
  278. FormattedTotalSteps string `json:"formattedTotalSteps,omitempty"`
  279. // Id: The ID of the achievement.
  280. Id string `json:"id,omitempty"`
  281. // InitialState: The initial state of the achievement.
  282. // Possible values are:
  283. // - "HIDDEN" - Achievement is hidden.
  284. // - "REVEALED" - Achievement is revealed.
  285. // - "UNLOCKED" - Achievement is unlocked.
  286. InitialState string `json:"initialState,omitempty"`
  287. // IsRevealedIconUrlDefault: Indicates whether the revealed icon image
  288. // being returned is a default image, or is provided by the game.
  289. IsRevealedIconUrlDefault bool `json:"isRevealedIconUrlDefault,omitempty"`
  290. // IsUnlockedIconUrlDefault: Indicates whether the unlocked icon image
  291. // being returned is a default image, or is game-provided.
  292. IsUnlockedIconUrlDefault bool `json:"isUnlockedIconUrlDefault,omitempty"`
  293. // Kind: Uniquely identifies the type of this resource. Value is always
  294. // the fixed string games#achievementDefinition.
  295. Kind string `json:"kind,omitempty"`
  296. // Name: The name of the achievement.
  297. Name string `json:"name,omitempty"`
  298. // RevealedIconUrl: The image URL for the revealed achievement icon.
  299. RevealedIconUrl string `json:"revealedIconUrl,omitempty"`
  300. // TotalSteps: The total steps for an incremental achievement.
  301. TotalSteps int64 `json:"totalSteps,omitempty"`
  302. // UnlockedIconUrl: The image URL for the unlocked achievement icon.
  303. UnlockedIconUrl string `json:"unlockedIconUrl,omitempty"`
  304. // ForceSendFields is a list of field names (e.g. "AchievementType") to
  305. // unconditionally include in API requests. By default, fields with
  306. // empty values are omitted from API requests. However, any non-pointer,
  307. // non-interface field appearing in ForceSendFields will be sent to the
  308. // server regardless of whether the field is empty or not. This may be
  309. // used to include empty fields in Patch requests.
  310. ForceSendFields []string `json:"-"`
  311. // NullFields is a list of field names (e.g. "AchievementType") to
  312. // include in API requests with the JSON null value. By default, fields
  313. // with empty values are omitted from API requests. However, any field
  314. // with an empty value appearing in NullFields will be sent to the
  315. // server as null. It is an error if a field in this list has a
  316. // non-empty value. This may be used to include null fields in Patch
  317. // requests.
  318. NullFields []string `json:"-"`
  319. }
  320. func (s *AchievementDefinition) MarshalJSON() ([]byte, error) {
  321. type NoMethod AchievementDefinition
  322. raw := NoMethod(*s)
  323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  324. }
  325. // AchievementDefinitionsListResponse: This is a JSON template for a
  326. // list of achievement definition objects.
  327. type AchievementDefinitionsListResponse struct {
  328. // Items: The achievement definitions.
  329. Items []*AchievementDefinition `json:"items,omitempty"`
  330. // Kind: Uniquely identifies the type of this resource. Value is always
  331. // the fixed string games#achievementDefinitionsListResponse.
  332. Kind string `json:"kind,omitempty"`
  333. // NextPageToken: Token corresponding to the next page of results.
  334. NextPageToken string `json:"nextPageToken,omitempty"`
  335. // ServerResponse contains the HTTP response code and headers from the
  336. // server.
  337. googleapi.ServerResponse `json:"-"`
  338. // ForceSendFields is a list of field names (e.g. "Items") to
  339. // unconditionally include in API requests. By default, fields with
  340. // empty values are omitted from API requests. However, any non-pointer,
  341. // non-interface field appearing in ForceSendFields will be sent to the
  342. // server regardless of whether the field is empty or not. This may be
  343. // used to include empty fields in Patch requests.
  344. ForceSendFields []string `json:"-"`
  345. // NullFields is a list of field names (e.g. "Items") to include in API
  346. // requests with the JSON null value. By default, fields with empty
  347. // values are omitted from API requests. However, any field with an
  348. // empty value appearing in NullFields will be sent to the server as
  349. // null. It is an error if a field in this list has a non-empty value.
  350. // This may be used to include null fields in Patch requests.
  351. NullFields []string `json:"-"`
  352. }
  353. func (s *AchievementDefinitionsListResponse) MarshalJSON() ([]byte, error) {
  354. type NoMethod AchievementDefinitionsListResponse
  355. raw := NoMethod(*s)
  356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  357. }
  358. // AchievementIncrementResponse: This is a JSON template for an
  359. // achievement increment response
  360. type AchievementIncrementResponse struct {
  361. // CurrentSteps: The current steps recorded for this incremental
  362. // achievement.
  363. CurrentSteps int64 `json:"currentSteps,omitempty"`
  364. // Kind: Uniquely identifies the type of this resource. Value is always
  365. // the fixed string games#achievementIncrementResponse.
  366. Kind string `json:"kind,omitempty"`
  367. // NewlyUnlocked: Whether the current steps for the achievement has
  368. // reached the number of steps required to unlock.
  369. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  370. // ServerResponse contains the HTTP response code and headers from the
  371. // server.
  372. googleapi.ServerResponse `json:"-"`
  373. // ForceSendFields is a list of field names (e.g. "CurrentSteps") to
  374. // unconditionally include in API requests. By default, fields with
  375. // empty values are omitted from API requests. However, any non-pointer,
  376. // non-interface field appearing in ForceSendFields will be sent to the
  377. // server regardless of whether the field is empty or not. This may be
  378. // used to include empty fields in Patch requests.
  379. ForceSendFields []string `json:"-"`
  380. // NullFields is a list of field names (e.g. "CurrentSteps") to include
  381. // in API requests with the JSON null value. By default, fields with
  382. // empty values are omitted from API requests. However, any field with
  383. // an empty value appearing in NullFields will be sent to the server as
  384. // null. It is an error if a field in this list has a non-empty value.
  385. // This may be used to include null fields in Patch requests.
  386. NullFields []string `json:"-"`
  387. }
  388. func (s *AchievementIncrementResponse) MarshalJSON() ([]byte, error) {
  389. type NoMethod AchievementIncrementResponse
  390. raw := NoMethod(*s)
  391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  392. }
  393. // AchievementRevealResponse: This is a JSON template for an achievement
  394. // reveal response
  395. type AchievementRevealResponse struct {
  396. // CurrentState: The current state of the achievement for which a reveal
  397. // was attempted. This might be UNLOCKED if the achievement was already
  398. // unlocked.
  399. // Possible values are:
  400. // - "REVEALED" - Achievement is revealed.
  401. // - "UNLOCKED" - Achievement is unlocked.
  402. CurrentState string `json:"currentState,omitempty"`
  403. // Kind: Uniquely identifies the type of this resource. Value is always
  404. // the fixed string games#achievementRevealResponse.
  405. Kind string `json:"kind,omitempty"`
  406. // ServerResponse contains the HTTP response code and headers from the
  407. // server.
  408. googleapi.ServerResponse `json:"-"`
  409. // ForceSendFields is a list of field names (e.g. "CurrentState") to
  410. // unconditionally include in API requests. By default, fields with
  411. // empty values are omitted from API requests. However, any non-pointer,
  412. // non-interface field appearing in ForceSendFields will be sent to the
  413. // server regardless of whether the field is empty or not. This may be
  414. // used to include empty fields in Patch requests.
  415. ForceSendFields []string `json:"-"`
  416. // NullFields is a list of field names (e.g. "CurrentState") to include
  417. // in API requests with the JSON null value. By default, fields with
  418. // empty values are omitted from API requests. However, any field with
  419. // an empty value appearing in NullFields will be sent to the server as
  420. // null. It is an error if a field in this list has a non-empty value.
  421. // This may be used to include null fields in Patch requests.
  422. NullFields []string `json:"-"`
  423. }
  424. func (s *AchievementRevealResponse) MarshalJSON() ([]byte, error) {
  425. type NoMethod AchievementRevealResponse
  426. raw := NoMethod(*s)
  427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  428. }
  429. // AchievementSetStepsAtLeastResponse: This is a JSON template for an
  430. // achievement set steps at least response.
  431. type AchievementSetStepsAtLeastResponse struct {
  432. // CurrentSteps: The current steps recorded for this incremental
  433. // achievement.
  434. CurrentSteps int64 `json:"currentSteps,omitempty"`
  435. // Kind: Uniquely identifies the type of this resource. Value is always
  436. // the fixed string games#achievementSetStepsAtLeastResponse.
  437. Kind string `json:"kind,omitempty"`
  438. // NewlyUnlocked: Whether the the current steps for the achievement has
  439. // reached the number of steps required to unlock.
  440. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  441. // ServerResponse contains the HTTP response code and headers from the
  442. // server.
  443. googleapi.ServerResponse `json:"-"`
  444. // ForceSendFields is a list of field names (e.g. "CurrentSteps") to
  445. // unconditionally include in API requests. By default, fields with
  446. // empty values are omitted from API requests. However, any non-pointer,
  447. // non-interface field appearing in ForceSendFields will be sent to the
  448. // server regardless of whether the field is empty or not. This may be
  449. // used to include empty fields in Patch requests.
  450. ForceSendFields []string `json:"-"`
  451. // NullFields is a list of field names (e.g. "CurrentSteps") to include
  452. // in API requests with the JSON null value. By default, fields with
  453. // empty values are omitted from API requests. However, any field with
  454. // an empty value appearing in NullFields will be sent to the server as
  455. // null. It is an error if a field in this list has a non-empty value.
  456. // This may be used to include null fields in Patch requests.
  457. NullFields []string `json:"-"`
  458. }
  459. func (s *AchievementSetStepsAtLeastResponse) MarshalJSON() ([]byte, error) {
  460. type NoMethod AchievementSetStepsAtLeastResponse
  461. raw := NoMethod(*s)
  462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  463. }
  464. // AchievementUnlockResponse: This is a JSON template for an achievement
  465. // unlock response
  466. type AchievementUnlockResponse struct {
  467. // Kind: Uniquely identifies the type of this resource. Value is always
  468. // the fixed string games#achievementUnlockResponse.
  469. Kind string `json:"kind,omitempty"`
  470. // NewlyUnlocked: Whether this achievement was newly unlocked (that is,
  471. // whether the unlock request for the achievement was the first for the
  472. // player).
  473. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  474. // ServerResponse contains the HTTP response code and headers from the
  475. // server.
  476. googleapi.ServerResponse `json:"-"`
  477. // ForceSendFields is a list of field names (e.g. "Kind") to
  478. // unconditionally include in API requests. By default, fields with
  479. // empty values are omitted from API requests. However, any non-pointer,
  480. // non-interface field appearing in ForceSendFields will be sent to the
  481. // server regardless of whether the field is empty or not. This may be
  482. // used to include empty fields in Patch requests.
  483. ForceSendFields []string `json:"-"`
  484. // NullFields is a list of field names (e.g. "Kind") to include in API
  485. // requests with the JSON null value. By default, fields with empty
  486. // values are omitted from API requests. However, any field with an
  487. // empty value appearing in NullFields will be sent to the server as
  488. // null. It is an error if a field in this list has a non-empty value.
  489. // This may be used to include null fields in Patch requests.
  490. NullFields []string `json:"-"`
  491. }
  492. func (s *AchievementUnlockResponse) MarshalJSON() ([]byte, error) {
  493. type NoMethod AchievementUnlockResponse
  494. raw := NoMethod(*s)
  495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  496. }
  497. // AchievementUpdateMultipleRequest: This is a JSON template for a list
  498. // of achievement update requests.
  499. type AchievementUpdateMultipleRequest struct {
  500. // Kind: Uniquely identifies the type of this resource. Value is always
  501. // the fixed string games#achievementUpdateMultipleRequest.
  502. Kind string `json:"kind,omitempty"`
  503. // Updates: The individual achievement update requests.
  504. Updates []*AchievementUpdateRequest `json:"updates,omitempty"`
  505. // ForceSendFields is a list of field names (e.g. "Kind") to
  506. // unconditionally include in API requests. By default, fields with
  507. // empty values are omitted from API requests. However, any non-pointer,
  508. // non-interface field appearing in ForceSendFields will be sent to the
  509. // server regardless of whether the field is empty or not. This may be
  510. // used to include empty fields in Patch requests.
  511. ForceSendFields []string `json:"-"`
  512. // NullFields is a list of field names (e.g. "Kind") to include in API
  513. // requests with the JSON null value. By default, fields with empty
  514. // values are omitted from API requests. However, any field with an
  515. // empty value appearing in NullFields will be sent to the server as
  516. // null. It is an error if a field in this list has a non-empty value.
  517. // This may be used to include null fields in Patch requests.
  518. NullFields []string `json:"-"`
  519. }
  520. func (s *AchievementUpdateMultipleRequest) MarshalJSON() ([]byte, error) {
  521. type NoMethod AchievementUpdateMultipleRequest
  522. raw := NoMethod(*s)
  523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  524. }
  525. // AchievementUpdateMultipleResponse: This is a JSON template for an
  526. // achievement unlock response.
  527. type AchievementUpdateMultipleResponse struct {
  528. // Kind: Uniquely identifies the type of this resource. Value is always
  529. // the fixed string games#achievementUpdateListResponse.
  530. Kind string `json:"kind,omitempty"`
  531. // UpdatedAchievements: The updated state of the achievements.
  532. UpdatedAchievements []*AchievementUpdateResponse `json:"updatedAchievements,omitempty"`
  533. // ServerResponse contains the HTTP response code and headers from the
  534. // server.
  535. googleapi.ServerResponse `json:"-"`
  536. // ForceSendFields is a list of field names (e.g. "Kind") to
  537. // unconditionally include in API requests. By default, fields with
  538. // empty values are omitted from API requests. However, any non-pointer,
  539. // non-interface field appearing in ForceSendFields will be sent to the
  540. // server regardless of whether the field is empty or not. This may be
  541. // used to include empty fields in Patch requests.
  542. ForceSendFields []string `json:"-"`
  543. // NullFields is a list of field names (e.g. "Kind") to include in API
  544. // requests with the JSON null value. By default, fields with empty
  545. // values are omitted from API requests. However, any field with an
  546. // empty value appearing in NullFields will be sent to the server as
  547. // null. It is an error if a field in this list has a non-empty value.
  548. // This may be used to include null fields in Patch requests.
  549. NullFields []string `json:"-"`
  550. }
  551. func (s *AchievementUpdateMultipleResponse) MarshalJSON() ([]byte, error) {
  552. type NoMethod AchievementUpdateMultipleResponse
  553. raw := NoMethod(*s)
  554. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  555. }
  556. // AchievementUpdateRequest: This is a JSON template for a request to
  557. // update an achievement.
  558. type AchievementUpdateRequest struct {
  559. // AchievementId: The achievement this update is being applied to.
  560. AchievementId string `json:"achievementId,omitempty"`
  561. // IncrementPayload: The payload if an update of type INCREMENT was
  562. // requested for the achievement.
  563. IncrementPayload *GamesAchievementIncrement `json:"incrementPayload,omitempty"`
  564. // Kind: Uniquely identifies the type of this resource. Value is always
  565. // the fixed string games#achievementUpdateRequest.
  566. Kind string `json:"kind,omitempty"`
  567. // SetStepsAtLeastPayload: The payload if an update of type
  568. // SET_STEPS_AT_LEAST was requested for the achievement.
  569. SetStepsAtLeastPayload *GamesAchievementSetStepsAtLeast `json:"setStepsAtLeastPayload,omitempty"`
  570. // UpdateType: The type of update being applied.
  571. // Possible values are:
  572. // - "REVEAL" - Achievement is revealed.
  573. // - "UNLOCK" - Achievement is unlocked.
  574. // - "INCREMENT" - Achievement is incremented.
  575. // - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the
  576. // passed value.
  577. UpdateType string `json:"updateType,omitempty"`
  578. // ForceSendFields is a list of field names (e.g. "AchievementId") to
  579. // unconditionally include in API requests. By default, fields with
  580. // empty values are omitted from API requests. However, any non-pointer,
  581. // non-interface field appearing in ForceSendFields will be sent to the
  582. // server regardless of whether the field is empty or not. This may be
  583. // used to include empty fields in Patch requests.
  584. ForceSendFields []string `json:"-"`
  585. // NullFields is a list of field names (e.g. "AchievementId") to include
  586. // in API requests with the JSON null value. By default, fields with
  587. // empty values are omitted from API requests. However, any field with
  588. // an empty value appearing in NullFields will be sent to the server as
  589. // null. It is an error if a field in this list has a non-empty value.
  590. // This may be used to include null fields in Patch requests.
  591. NullFields []string `json:"-"`
  592. }
  593. func (s *AchievementUpdateRequest) MarshalJSON() ([]byte, error) {
  594. type NoMethod AchievementUpdateRequest
  595. raw := NoMethod(*s)
  596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  597. }
  598. // AchievementUpdateResponse: This is a JSON template for an achievement
  599. // update response.
  600. type AchievementUpdateResponse struct {
  601. // AchievementId: The achievement this update is was applied to.
  602. AchievementId string `json:"achievementId,omitempty"`
  603. // CurrentState: The current state of the achievement.
  604. // Possible values are:
  605. // - "HIDDEN" - Achievement is hidden.
  606. // - "REVEALED" - Achievement is revealed.
  607. // - "UNLOCKED" - Achievement is unlocked.
  608. CurrentState string `json:"currentState,omitempty"`
  609. // CurrentSteps: The current steps recorded for this achievement if it
  610. // is incremental.
  611. CurrentSteps int64 `json:"currentSteps,omitempty"`
  612. // Kind: Uniquely identifies the type of this resource. Value is always
  613. // the fixed string games#achievementUpdateResponse.
  614. Kind string `json:"kind,omitempty"`
  615. // NewlyUnlocked: Whether this achievement was newly unlocked (that is,
  616. // whether the unlock request for the achievement was the first for the
  617. // player).
  618. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  619. // UpdateOccurred: Whether the requested updates actually affected the
  620. // achievement.
  621. UpdateOccurred bool `json:"updateOccurred,omitempty"`
  622. // ForceSendFields is a list of field names (e.g. "AchievementId") to
  623. // unconditionally include in API requests. By default, fields with
  624. // empty values are omitted from API requests. However, any non-pointer,
  625. // non-interface field appearing in ForceSendFields will be sent to the
  626. // server regardless of whether the field is empty or not. This may be
  627. // used to include empty fields in Patch requests.
  628. ForceSendFields []string `json:"-"`
  629. // NullFields is a list of field names (e.g. "AchievementId") to include
  630. // in API requests with the JSON null value. By default, fields with
  631. // empty values are omitted from API requests. However, any field with
  632. // an empty value appearing in NullFields will be sent to the server as
  633. // null. It is an error if a field in this list has a non-empty value.
  634. // This may be used to include null fields in Patch requests.
  635. NullFields []string `json:"-"`
  636. }
  637. func (s *AchievementUpdateResponse) MarshalJSON() ([]byte, error) {
  638. type NoMethod AchievementUpdateResponse
  639. raw := NoMethod(*s)
  640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  641. }
  642. // AggregateStats: This is a JSON template for aggregate stats.
  643. type AggregateStats struct {
  644. // Count: The number of messages sent between a pair of peers.
  645. Count int64 `json:"count,omitempty,string"`
  646. // Kind: Uniquely identifies the type of this resource. Value is always
  647. // the fixed string games#aggregateStats.
  648. Kind string `json:"kind,omitempty"`
  649. // Max: The maximum amount.
  650. Max int64 `json:"max,omitempty,string"`
  651. // Min: The minimum amount.
  652. Min int64 `json:"min,omitempty,string"`
  653. // Sum: The total number of bytes sent for messages between a pair of
  654. // peers.
  655. Sum int64 `json:"sum,omitempty,string"`
  656. // ForceSendFields is a list of field names (e.g. "Count") to
  657. // unconditionally include in API requests. By default, fields with
  658. // empty values are omitted from API requests. However, any non-pointer,
  659. // non-interface field appearing in ForceSendFields will be sent to the
  660. // server regardless of whether the field is empty or not. This may be
  661. // used to include empty fields in Patch requests.
  662. ForceSendFields []string `json:"-"`
  663. // NullFields is a list of field names (e.g. "Count") to include in API
  664. // requests with the JSON null value. By default, fields with empty
  665. // values are omitted from API requests. However, any field with an
  666. // empty value appearing in NullFields will be sent to the server as
  667. // null. It is an error if a field in this list has a non-empty value.
  668. // This may be used to include null fields in Patch requests.
  669. NullFields []string `json:"-"`
  670. }
  671. func (s *AggregateStats) MarshalJSON() ([]byte, error) {
  672. type NoMethod AggregateStats
  673. raw := NoMethod(*s)
  674. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  675. }
  676. // AnonymousPlayer: This is a JSON template for an anonymous player
  677. type AnonymousPlayer struct {
  678. // AvatarImageUrl: The base URL for the image to display for the
  679. // anonymous player.
  680. AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
  681. // DisplayName: The name to display for the anonymous player.
  682. DisplayName string `json:"displayName,omitempty"`
  683. // Kind: Uniquely identifies the type of this resource. Value is always
  684. // the fixed string games#anonymousPlayer.
  685. Kind string `json:"kind,omitempty"`
  686. // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
  687. // unconditionally include in API requests. By default, fields with
  688. // empty values are omitted from API requests. However, any non-pointer,
  689. // non-interface field appearing in ForceSendFields will be sent to the
  690. // server regardless of whether the field is empty or not. This may be
  691. // used to include empty fields in Patch requests.
  692. ForceSendFields []string `json:"-"`
  693. // NullFields is a list of field names (e.g. "AvatarImageUrl") to
  694. // include in API requests with the JSON null value. By default, fields
  695. // with empty values are omitted from API requests. However, any field
  696. // with an empty value appearing in NullFields will be sent to the
  697. // server as null. It is an error if a field in this list has a
  698. // non-empty value. This may be used to include null fields in Patch
  699. // requests.
  700. NullFields []string `json:"-"`
  701. }
  702. func (s *AnonymousPlayer) MarshalJSON() ([]byte, error) {
  703. type NoMethod AnonymousPlayer
  704. raw := NoMethod(*s)
  705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  706. }
  707. // Application: This is a JSON template for the Application resource.
  708. type Application struct {
  709. // AchievementCount: The number of achievements visible to the currently
  710. // authenticated player.
  711. AchievementCount int64 `json:"achievement_count,omitempty"`
  712. // Assets: The assets of the application.
  713. Assets []*ImageAsset `json:"assets,omitempty"`
  714. // Author: The author of the application.
  715. Author string `json:"author,omitempty"`
  716. // Category: The category of the application.
  717. Category *ApplicationCategory `json:"category,omitempty"`
  718. // Description: The description of the application.
  719. Description string `json:"description,omitempty"`
  720. // EnabledFeatures: A list of features that have been enabled for the
  721. // application.
  722. // Possible values are:
  723. // - "SNAPSHOTS" - Snapshots has been enabled
  724. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  725. // Id: The ID of the application.
  726. Id string `json:"id,omitempty"`
  727. // Instances: The instances of the application.
  728. Instances []*Instance `json:"instances,omitempty"`
  729. // Kind: Uniquely identifies the type of this resource. Value is always
  730. // the fixed string games#application.
  731. Kind string `json:"kind,omitempty"`
  732. // LastUpdatedTimestamp: The last updated timestamp of the application.
  733. LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"`
  734. // LeaderboardCount: The number of leaderboards visible to the currently
  735. // authenticated player.
  736. LeaderboardCount int64 `json:"leaderboard_count,omitempty"`
  737. // Name: The name of the application.
  738. Name string `json:"name,omitempty"`
  739. // ThemeColor: A hint to the client UI for what color to use as an
  740. // app-themed color. The color is given as an RGB triplet (e.g.
  741. // "E0E0E0").
  742. ThemeColor string `json:"themeColor,omitempty"`
  743. // ServerResponse contains the HTTP response code and headers from the
  744. // server.
  745. googleapi.ServerResponse `json:"-"`
  746. // ForceSendFields is a list of field names (e.g. "AchievementCount") to
  747. // unconditionally include in API requests. By default, fields with
  748. // empty values are omitted from API requests. However, any non-pointer,
  749. // non-interface field appearing in ForceSendFields will be sent to the
  750. // server regardless of whether the field is empty or not. This may be
  751. // used to include empty fields in Patch requests.
  752. ForceSendFields []string `json:"-"`
  753. // NullFields is a list of field names (e.g. "AchievementCount") to
  754. // include in API requests with the JSON null value. By default, fields
  755. // with empty values are omitted from API requests. However, any field
  756. // with an empty value appearing in NullFields will be sent to the
  757. // server as null. It is an error if a field in this list has a
  758. // non-empty value. This may be used to include null fields in Patch
  759. // requests.
  760. NullFields []string `json:"-"`
  761. }
  762. func (s *Application) MarshalJSON() ([]byte, error) {
  763. type NoMethod Application
  764. raw := NoMethod(*s)
  765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  766. }
  767. // ApplicationCategory: This is a JSON template for an application
  768. // category object.
  769. type ApplicationCategory struct {
  770. // Kind: Uniquely identifies the type of this resource. Value is always
  771. // the fixed string games#applicationCategory.
  772. Kind string `json:"kind,omitempty"`
  773. // Primary: The primary category.
  774. Primary string `json:"primary,omitempty"`
  775. // Secondary: The secondary category.
  776. Secondary string `json:"secondary,omitempty"`
  777. // ForceSendFields is a list of field names (e.g. "Kind") to
  778. // unconditionally include in API requests. By default, fields with
  779. // empty values are omitted from API requests. However, any non-pointer,
  780. // non-interface field appearing in ForceSendFields will be sent to the
  781. // server regardless of whether the field is empty or not. This may be
  782. // used to include empty fields in Patch requests.
  783. ForceSendFields []string `json:"-"`
  784. // NullFields is a list of field names (e.g. "Kind") to include in API
  785. // requests with the JSON null value. By default, fields with empty
  786. // values are omitted from API requests. However, any field with an
  787. // empty value appearing in NullFields will be sent to the server as
  788. // null. It is an error if a field in this list has a non-empty value.
  789. // This may be used to include null fields in Patch requests.
  790. NullFields []string `json:"-"`
  791. }
  792. func (s *ApplicationCategory) MarshalJSON() ([]byte, error) {
  793. type NoMethod ApplicationCategory
  794. raw := NoMethod(*s)
  795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  796. }
  797. // ApplicationVerifyResponse: This is a JSON template for a third party
  798. // application verification response resource.
  799. type ApplicationVerifyResponse struct {
  800. // AlternatePlayerId: An alternate ID that was once used for the player
  801. // that was issued the auth token used in this request. (This field is
  802. // not normally populated.)
  803. AlternatePlayerId string `json:"alternate_player_id,omitempty"`
  804. // Kind: Uniquely identifies the type of this resource. Value is always
  805. // the fixed string games#applicationVerifyResponse.
  806. Kind string `json:"kind,omitempty"`
  807. // PlayerId: The ID of the player that was issued the auth token used in
  808. // this request.
  809. PlayerId string `json:"player_id,omitempty"`
  810. // ServerResponse contains the HTTP response code and headers from the
  811. // server.
  812. googleapi.ServerResponse `json:"-"`
  813. // ForceSendFields is a list of field names (e.g. "AlternatePlayerId")
  814. // to unconditionally include in API requests. By default, fields with
  815. // empty values are omitted from API requests. However, any non-pointer,
  816. // non-interface field appearing in ForceSendFields will be sent to the
  817. // server regardless of whether the field is empty or not. This may be
  818. // used to include empty fields in Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "AlternatePlayerId") to
  821. // include in API requests with the JSON null value. By default, fields
  822. // with empty values are omitted from API requests. However, any field
  823. // with an empty value appearing in NullFields will be sent to the
  824. // server as null. It is an error if a field in this list has a
  825. // non-empty value. This may be used to include null fields in Patch
  826. // requests.
  827. NullFields []string `json:"-"`
  828. }
  829. func (s *ApplicationVerifyResponse) MarshalJSON() ([]byte, error) {
  830. type NoMethod ApplicationVerifyResponse
  831. raw := NoMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  833. }
  834. // Category: This is a JSON template for data related to individual game
  835. // categories.
  836. type Category struct {
  837. // Category: The category name.
  838. Category string `json:"category,omitempty"`
  839. // ExperiencePoints: Experience points earned in this category.
  840. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  841. // Kind: Uniquely identifies the type of this resource. Value is always
  842. // the fixed string games#category.
  843. Kind string `json:"kind,omitempty"`
  844. // ForceSendFields is a list of field names (e.g. "Category") to
  845. // unconditionally include in API requests. By default, fields with
  846. // empty values are omitted from API requests. However, any non-pointer,
  847. // non-interface field appearing in ForceSendFields will be sent to the
  848. // server regardless of whether the field is empty or not. This may be
  849. // used to include empty fields in Patch requests.
  850. ForceSendFields []string `json:"-"`
  851. // NullFields is a list of field names (e.g. "Category") to include in
  852. // API requests with the JSON null value. By default, fields with empty
  853. // values are omitted from API requests. However, any field with an
  854. // empty value appearing in NullFields will be sent to the server as
  855. // null. It is an error if a field in this list has a non-empty value.
  856. // This may be used to include null fields in Patch requests.
  857. NullFields []string `json:"-"`
  858. }
  859. func (s *Category) MarshalJSON() ([]byte, error) {
  860. type NoMethod Category
  861. raw := NoMethod(*s)
  862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  863. }
  864. // CategoryListResponse: This is a JSON template for a list of category
  865. // data objects.
  866. type CategoryListResponse struct {
  867. // Items: The list of categories with usage data.
  868. Items []*Category `json:"items,omitempty"`
  869. // Kind: Uniquely identifies the type of this resource. Value is always
  870. // the fixed string games#categoryListResponse.
  871. Kind string `json:"kind,omitempty"`
  872. // NextPageToken: Token corresponding to the next page of results.
  873. NextPageToken string `json:"nextPageToken,omitempty"`
  874. // ServerResponse contains the HTTP response code and headers from the
  875. // server.
  876. googleapi.ServerResponse `json:"-"`
  877. // ForceSendFields is a list of field names (e.g. "Items") to
  878. // unconditionally include in API requests. By default, fields with
  879. // empty values are omitted from API requests. However, any non-pointer,
  880. // non-interface field appearing in ForceSendFields will be sent to the
  881. // server regardless of whether the field is empty or not. This may be
  882. // used to include empty fields in Patch requests.
  883. ForceSendFields []string `json:"-"`
  884. // NullFields is a list of field names (e.g. "Items") to include in API
  885. // requests with the JSON null value. By default, fields with empty
  886. // values are omitted from API requests. However, any field with an
  887. // empty value appearing in NullFields will be sent to the server as
  888. // null. It is an error if a field in this list has a non-empty value.
  889. // This may be used to include null fields in Patch requests.
  890. NullFields []string `json:"-"`
  891. }
  892. func (s *CategoryListResponse) MarshalJSON() ([]byte, error) {
  893. type NoMethod CategoryListResponse
  894. raw := NoMethod(*s)
  895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  896. }
  897. // EventBatchRecordFailure: This is a JSON template for a batch update
  898. // failure resource.
  899. type EventBatchRecordFailure struct {
  900. // FailureCause: The cause for the update failure.
  901. // Possible values are:
  902. // - "TOO_LARGE": A batch request was issued with more events than are
  903. // allowed in a single batch.
  904. // - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the
  905. // past to record.
  906. // - "TIME_PERIOD_SHORT": A batch was sent with a time range that was
  907. // too short.
  908. // - "TIME_PERIOD_LONG": A batch was sent with a time range that was too
  909. // long.
  910. // - "ALREADY_UPDATED": An attempt was made to record a batch of data
  911. // which was already seen.
  912. // - "RECORD_RATE_HIGH": An attempt was made to record data faster than
  913. // the server will apply updates.
  914. FailureCause string `json:"failureCause,omitempty"`
  915. // Kind: Uniquely identifies the type of this resource. Value is always
  916. // the fixed string games#eventBatchRecordFailure.
  917. Kind string `json:"kind,omitempty"`
  918. // Range: The time range which was rejected; empty for a request-wide
  919. // failure.
  920. Range *EventPeriodRange `json:"range,omitempty"`
  921. // ForceSendFields is a list of field names (e.g. "FailureCause") to
  922. // unconditionally include in API requests. By default, fields with
  923. // empty values are omitted from API requests. However, any non-pointer,
  924. // non-interface field appearing in ForceSendFields will be sent to the
  925. // server regardless of whether the field is empty or not. This may be
  926. // used to include empty fields in Patch requests.
  927. ForceSendFields []string `json:"-"`
  928. // NullFields is a list of field names (e.g. "FailureCause") to include
  929. // in API requests with the JSON null value. By default, fields with
  930. // empty values are omitted from API requests. However, any field with
  931. // an empty value appearing in NullFields will be sent to the server as
  932. // null. It is an error if a field in this list has a non-empty value.
  933. // This may be used to include null fields in Patch requests.
  934. NullFields []string `json:"-"`
  935. }
  936. func (s *EventBatchRecordFailure) MarshalJSON() ([]byte, error) {
  937. type NoMethod EventBatchRecordFailure
  938. raw := NoMethod(*s)
  939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  940. }
  941. // EventChild: This is a JSON template for an event child relationship
  942. // resource.
  943. type EventChild struct {
  944. // ChildId: The ID of the child event.
  945. ChildId string `json:"childId,omitempty"`
  946. // Kind: Uniquely identifies the type of this resource. Value is always
  947. // the fixed string games#eventChild.
  948. Kind string `json:"kind,omitempty"`
  949. // ForceSendFields is a list of field names (e.g. "ChildId") to
  950. // unconditionally include in API requests. By default, fields with
  951. // empty values are omitted from API requests. However, any non-pointer,
  952. // non-interface field appearing in ForceSendFields will be sent to the
  953. // server regardless of whether the field is empty or not. This may be
  954. // used to include empty fields in Patch requests.
  955. ForceSendFields []string `json:"-"`
  956. // NullFields is a list of field names (e.g. "ChildId") to include in
  957. // API requests with the JSON null value. By default, fields with empty
  958. // values are omitted from API requests. However, any field with an
  959. // empty value appearing in NullFields will be sent to the server as
  960. // null. It is an error if a field in this list has a non-empty value.
  961. // This may be used to include null fields in Patch requests.
  962. NullFields []string `json:"-"`
  963. }
  964. func (s *EventChild) MarshalJSON() ([]byte, error) {
  965. type NoMethod EventChild
  966. raw := NoMethod(*s)
  967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  968. }
  969. // EventDefinition: This is a JSON template for an event definition
  970. // resource.
  971. type EventDefinition struct {
  972. // ChildEvents: A list of events that are a child of this event.
  973. ChildEvents []*EventChild `json:"childEvents,omitempty"`
  974. // Description: Description of what this event represents.
  975. Description string `json:"description,omitempty"`
  976. // DisplayName: The name to display for the event.
  977. DisplayName string `json:"displayName,omitempty"`
  978. // Id: The ID of the event.
  979. Id string `json:"id,omitempty"`
  980. // ImageUrl: The base URL for the image that represents the event.
  981. ImageUrl string `json:"imageUrl,omitempty"`
  982. // IsDefaultImageUrl: Indicates whether the icon image being returned is
  983. // a default image, or is game-provided.
  984. IsDefaultImageUrl bool `json:"isDefaultImageUrl,omitempty"`
  985. // Kind: Uniquely identifies the type of this resource. Value is always
  986. // the fixed string games#eventDefinition.
  987. Kind string `json:"kind,omitempty"`
  988. // Visibility: The visibility of event being tracked in this
  989. // definition.
  990. // Possible values are:
  991. // - "REVEALED": This event should be visible to all users.
  992. // - "HIDDEN": This event should only be shown to users that have
  993. // recorded this event at least once.
  994. Visibility string `json:"visibility,omitempty"`
  995. // ForceSendFields is a list of field names (e.g. "ChildEvents") to
  996. // unconditionally include in API requests. By default, fields with
  997. // empty values are omitted from API requests. However, any non-pointer,
  998. // non-interface field appearing in ForceSendFields will be sent to the
  999. // server regardless of whether the field is empty or not. This may be
  1000. // used to include empty fields in Patch requests.
  1001. ForceSendFields []string `json:"-"`
  1002. // NullFields is a list of field names (e.g. "ChildEvents") to include
  1003. // in API requests with the JSON null value. By default, fields with
  1004. // empty values are omitted from API requests. However, any field with
  1005. // an empty value appearing in NullFields will be sent to the server as
  1006. // null. It is an error if a field in this list has a non-empty value.
  1007. // This may be used to include null fields in Patch requests.
  1008. NullFields []string `json:"-"`
  1009. }
  1010. func (s *EventDefinition) MarshalJSON() ([]byte, error) {
  1011. type NoMethod EventDefinition
  1012. raw := NoMethod(*s)
  1013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1014. }
  1015. // EventDefinitionListResponse: This is a JSON template for a
  1016. // ListDefinitions response.
  1017. type EventDefinitionListResponse struct {
  1018. // Items: The event definitions.
  1019. Items []*EventDefinition `json:"items,omitempty"`
  1020. // Kind: Uniquely identifies the type of this resource. Value is always
  1021. // the fixed string games#eventDefinitionListResponse.
  1022. Kind string `json:"kind,omitempty"`
  1023. // NextPageToken: The pagination token for the next page of results.
  1024. NextPageToken string `json:"nextPageToken,omitempty"`
  1025. // ServerResponse contains the HTTP response code and headers from the
  1026. // server.
  1027. googleapi.ServerResponse `json:"-"`
  1028. // ForceSendFields is a list of field names (e.g. "Items") to
  1029. // unconditionally include in API requests. By default, fields with
  1030. // empty values are omitted from API requests. However, any non-pointer,
  1031. // non-interface field appearing in ForceSendFields will be sent to the
  1032. // server regardless of whether the field is empty or not. This may be
  1033. // used to include empty fields in Patch requests.
  1034. ForceSendFields []string `json:"-"`
  1035. // NullFields is a list of field names (e.g. "Items") to include in API
  1036. // requests with the JSON null value. By default, fields with empty
  1037. // values are omitted from API requests. However, any field with an
  1038. // empty value appearing in NullFields will be sent to the server as
  1039. // null. It is an error if a field in this list has a non-empty value.
  1040. // This may be used to include null fields in Patch requests.
  1041. NullFields []string `json:"-"`
  1042. }
  1043. func (s *EventDefinitionListResponse) MarshalJSON() ([]byte, error) {
  1044. type NoMethod EventDefinitionListResponse
  1045. raw := NoMethod(*s)
  1046. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1047. }
  1048. // EventPeriodRange: This is a JSON template for an event period time
  1049. // range.
  1050. type EventPeriodRange struct {
  1051. // Kind: Uniquely identifies the type of this resource. Value is always
  1052. // the fixed string games#eventPeriodRange.
  1053. Kind string `json:"kind,omitempty"`
  1054. // PeriodEndMillis: The time when this update period ends, in millis,
  1055. // since 1970 UTC (Unix Epoch).
  1056. PeriodEndMillis int64 `json:"periodEndMillis,omitempty,string"`
  1057. // PeriodStartMillis: The time when this update period begins, in
  1058. // millis, since 1970 UTC (Unix Epoch).
  1059. PeriodStartMillis int64 `json:"periodStartMillis,omitempty,string"`
  1060. // ForceSendFields is a list of field names (e.g. "Kind") to
  1061. // unconditionally include in API requests. By default, fields with
  1062. // empty values are omitted from API requests. However, any non-pointer,
  1063. // non-interface field appearing in ForceSendFields will be sent to the
  1064. // server regardless of whether the field is empty or not. This may be
  1065. // used to include empty fields in Patch requests.
  1066. ForceSendFields []string `json:"-"`
  1067. // NullFields is a list of field names (e.g. "Kind") to include in API
  1068. // requests with the JSON null value. By default, fields with empty
  1069. // values are omitted from API requests. However, any field with an
  1070. // empty value appearing in NullFields will be sent to the server as
  1071. // null. It is an error if a field in this list has a non-empty value.
  1072. // This may be used to include null fields in Patch requests.
  1073. NullFields []string `json:"-"`
  1074. }
  1075. func (s *EventPeriodRange) MarshalJSON() ([]byte, error) {
  1076. type NoMethod EventPeriodRange
  1077. raw := NoMethod(*s)
  1078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1079. }
  1080. // EventPeriodUpdate: This is a JSON template for an event period update
  1081. // resource.
  1082. type EventPeriodUpdate struct {
  1083. // Kind: Uniquely identifies the type of this resource. Value is always
  1084. // the fixed string games#eventPeriodUpdate.
  1085. Kind string `json:"kind,omitempty"`
  1086. // TimePeriod: The time period being covered by this update.
  1087. TimePeriod *EventPeriodRange `json:"timePeriod,omitempty"`
  1088. // Updates: The updates being made for this time period.
  1089. Updates []*EventUpdateRequest `json:"updates,omitempty"`
  1090. // ForceSendFields is a list of field names (e.g. "Kind") to
  1091. // unconditionally include in API requests. By default, fields with
  1092. // empty values are omitted from API requests. However, any non-pointer,
  1093. // non-interface field appearing in ForceSendFields will be sent to the
  1094. // server regardless of whether the field is empty or not. This may be
  1095. // used to include empty fields in Patch requests.
  1096. ForceSendFields []string `json:"-"`
  1097. // NullFields is a list of field names (e.g. "Kind") to include in API
  1098. // requests with the JSON null value. By default, fields with empty
  1099. // values are omitted from API requests. However, any field with an
  1100. // empty value appearing in NullFields will be sent to the server as
  1101. // null. It is an error if a field in this list has a non-empty value.
  1102. // This may be used to include null fields in Patch requests.
  1103. NullFields []string `json:"-"`
  1104. }
  1105. func (s *EventPeriodUpdate) MarshalJSON() ([]byte, error) {
  1106. type NoMethod EventPeriodUpdate
  1107. raw := NoMethod(*s)
  1108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1109. }
  1110. // EventRecordFailure: This is a JSON template for an event update
  1111. // failure resource.
  1112. type EventRecordFailure struct {
  1113. // EventId: The ID of the event that was not updated.
  1114. EventId string `json:"eventId,omitempty"`
  1115. // FailureCause: The cause for the update failure.
  1116. // Possible values are:
  1117. // - "NOT_FOUND" - An attempt was made to set an event that was not
  1118. // defined.
  1119. // - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event
  1120. // by a non-positive value.
  1121. FailureCause string `json:"failureCause,omitempty"`
  1122. // Kind: Uniquely identifies the type of this resource. Value is always
  1123. // the fixed string games#eventRecordFailure.
  1124. Kind string `json:"kind,omitempty"`
  1125. // ForceSendFields is a list of field names (e.g. "EventId") to
  1126. // unconditionally include in API requests. By default, fields with
  1127. // empty values are omitted from API requests. However, any non-pointer,
  1128. // non-interface field appearing in ForceSendFields will be sent to the
  1129. // server regardless of whether the field is empty or not. This may be
  1130. // used to include empty fields in Patch requests.
  1131. ForceSendFields []string `json:"-"`
  1132. // NullFields is a list of field names (e.g. "EventId") to include in
  1133. // API requests with the JSON null value. By default, fields with empty
  1134. // values are omitted from API requests. However, any field with an
  1135. // empty value appearing in NullFields will be sent to the server as
  1136. // null. It is an error if a field in this list has a non-empty value.
  1137. // This may be used to include null fields in Patch requests.
  1138. NullFields []string `json:"-"`
  1139. }
  1140. func (s *EventRecordFailure) MarshalJSON() ([]byte, error) {
  1141. type NoMethod EventRecordFailure
  1142. raw := NoMethod(*s)
  1143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1144. }
  1145. // EventRecordRequest: This is a JSON template for an event period
  1146. // update resource.
  1147. type EventRecordRequest struct {
  1148. // CurrentTimeMillis: The current time when this update was sent, in
  1149. // milliseconds, since 1970 UTC (Unix Epoch).
  1150. CurrentTimeMillis int64 `json:"currentTimeMillis,omitempty,string"`
  1151. // Kind: Uniquely identifies the type of this resource. Value is always
  1152. // the fixed string games#eventRecordRequest.
  1153. Kind string `json:"kind,omitempty"`
  1154. // RequestId: The request ID used to identify this attempt to record
  1155. // events.
  1156. RequestId int64 `json:"requestId,omitempty,string"`
  1157. // TimePeriods: A list of the time period updates being made in this
  1158. // request.
  1159. TimePeriods []*EventPeriodUpdate `json:"timePeriods,omitempty"`
  1160. // ForceSendFields is a list of field names (e.g. "CurrentTimeMillis")
  1161. // to unconditionally include in API requests. By default, fields with
  1162. // empty values are omitted from API requests. However, any non-pointer,
  1163. // non-interface field appearing in ForceSendFields will be sent to the
  1164. // server regardless of whether the field is empty or not. This may be
  1165. // used to include empty fields in Patch requests.
  1166. ForceSendFields []string `json:"-"`
  1167. // NullFields is a list of field names (e.g. "CurrentTimeMillis") to
  1168. // include in API requests with the JSON null value. By default, fields
  1169. // with empty values are omitted from API requests. However, any field
  1170. // with an empty value appearing in NullFields will be sent to the
  1171. // server as null. It is an error if a field in this list has a
  1172. // non-empty value. This may be used to include null fields in Patch
  1173. // requests.
  1174. NullFields []string `json:"-"`
  1175. }
  1176. func (s *EventRecordRequest) MarshalJSON() ([]byte, error) {
  1177. type NoMethod EventRecordRequest
  1178. raw := NoMethod(*s)
  1179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1180. }
  1181. // EventUpdateRequest: This is a JSON template for an event period
  1182. // update resource.
  1183. type EventUpdateRequest struct {
  1184. // DefinitionId: The ID of the event being modified in this update.
  1185. DefinitionId string `json:"definitionId,omitempty"`
  1186. // Kind: Uniquely identifies the type of this resource. Value is always
  1187. // the fixed string games#eventUpdateRequest.
  1188. Kind string `json:"kind,omitempty"`
  1189. // UpdateCount: The number of times this event occurred in this time
  1190. // period.
  1191. UpdateCount int64 `json:"updateCount,omitempty,string"`
  1192. // ForceSendFields is a list of field names (e.g. "DefinitionId") to
  1193. // unconditionally include in API requests. By default, fields with
  1194. // empty values are omitted from API requests. However, any non-pointer,
  1195. // non-interface field appearing in ForceSendFields will be sent to the
  1196. // server regardless of whether the field is empty or not. This may be
  1197. // used to include empty fields in Patch requests.
  1198. ForceSendFields []string `json:"-"`
  1199. // NullFields is a list of field names (e.g. "DefinitionId") to include
  1200. // in API requests with the JSON null value. By default, fields with
  1201. // empty values are omitted from API requests. However, any field with
  1202. // an empty value appearing in NullFields will be sent to the server as
  1203. // null. It is an error if a field in this list has a non-empty value.
  1204. // This may be used to include null fields in Patch requests.
  1205. NullFields []string `json:"-"`
  1206. }
  1207. func (s *EventUpdateRequest) MarshalJSON() ([]byte, error) {
  1208. type NoMethod EventUpdateRequest
  1209. raw := NoMethod(*s)
  1210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1211. }
  1212. // EventUpdateResponse: This is a JSON template for an event period
  1213. // update resource.
  1214. type EventUpdateResponse struct {
  1215. // BatchFailures: Any batch-wide failures which occurred applying
  1216. // updates.
  1217. BatchFailures []*EventBatchRecordFailure `json:"batchFailures,omitempty"`
  1218. // EventFailures: Any failures updating a particular event.
  1219. EventFailures []*EventRecordFailure `json:"eventFailures,omitempty"`
  1220. // Kind: Uniquely identifies the type of this resource. Value is always
  1221. // the fixed string games#eventUpdateResponse.
  1222. Kind string `json:"kind,omitempty"`
  1223. // PlayerEvents: The current status of any updated events
  1224. PlayerEvents []*PlayerEvent `json:"playerEvents,omitempty"`
  1225. // ServerResponse contains the HTTP response code and headers from the
  1226. // server.
  1227. googleapi.ServerResponse `json:"-"`
  1228. // ForceSendFields is a list of field names (e.g. "BatchFailures") to
  1229. // unconditionally include in API requests. By default, fields with
  1230. // empty values are omitted from API requests. However, any non-pointer,
  1231. // non-interface field appearing in ForceSendFields will be sent to the
  1232. // server regardless of whether the field is empty or not. This may be
  1233. // used to include empty fields in Patch requests.
  1234. ForceSendFields []string `json:"-"`
  1235. // NullFields is a list of field names (e.g. "BatchFailures") to include
  1236. // in API requests with the JSON null value. By default, fields with
  1237. // empty values are omitted from API requests. However, any field with
  1238. // an empty value appearing in NullFields will be sent to the server as
  1239. // null. It is an error if a field in this list has a non-empty value.
  1240. // This may be used to include null fields in Patch requests.
  1241. NullFields []string `json:"-"`
  1242. }
  1243. func (s *EventUpdateResponse) MarshalJSON() ([]byte, error) {
  1244. type NoMethod EventUpdateResponse
  1245. raw := NoMethod(*s)
  1246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1247. }
  1248. // GamesAchievementIncrement: This is a JSON template for the payload to
  1249. // request to increment an achievement.
  1250. type GamesAchievementIncrement struct {
  1251. // Kind: Uniquely identifies the type of this resource. Value is always
  1252. // the fixed string games#GamesAchievementIncrement.
  1253. Kind string `json:"kind,omitempty"`
  1254. // RequestId: The requestId associated with an increment to an
  1255. // achievement.
  1256. RequestId int64 `json:"requestId,omitempty,string"`
  1257. // Steps: The number of steps to be incremented.
  1258. Steps int64 `json:"steps,omitempty"`
  1259. // ForceSendFields is a list of field names (e.g. "Kind") to
  1260. // unconditionally include in API requests. By default, fields with
  1261. // empty values are omitted from API requests. However, any non-pointer,
  1262. // non-interface field appearing in ForceSendFields will be sent to the
  1263. // server regardless of whether the field is empty or not. This may be
  1264. // used to include empty fields in Patch requests.
  1265. ForceSendFields []string `json:"-"`
  1266. // NullFields is a list of field names (e.g. "Kind") to include in API
  1267. // requests with the JSON null value. By default, fields with empty
  1268. // values are omitted from API requests. However, any field with an
  1269. // empty value appearing in NullFields will be sent to the server as
  1270. // null. It is an error if a field in this list has a non-empty value.
  1271. // This may be used to include null fields in Patch requests.
  1272. NullFields []string `json:"-"`
  1273. }
  1274. func (s *GamesAchievementIncrement) MarshalJSON() ([]byte, error) {
  1275. type NoMethod GamesAchievementIncrement
  1276. raw := NoMethod(*s)
  1277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1278. }
  1279. // GamesAchievementSetStepsAtLeast: This is a JSON template for the
  1280. // payload to request to increment an achievement.
  1281. type GamesAchievementSetStepsAtLeast struct {
  1282. // Kind: Uniquely identifies the type of this resource. Value is always
  1283. // the fixed string games#GamesAchievementSetStepsAtLeast.
  1284. Kind string `json:"kind,omitempty"`
  1285. // Steps: The minimum number of steps for the achievement to be set to.
  1286. Steps int64 `json:"steps,omitempty"`
  1287. // ForceSendFields is a list of field names (e.g. "Kind") to
  1288. // unconditionally include in API requests. By default, fields with
  1289. // empty values are omitted from API requests. However, any non-pointer,
  1290. // non-interface field appearing in ForceSendFields will be sent to the
  1291. // server regardless of whether the field is empty or not. This may be
  1292. // used to include empty fields in Patch requests.
  1293. ForceSendFields []string `json:"-"`
  1294. // NullFields is a list of field names (e.g. "Kind") to include in API
  1295. // requests with the JSON null value. By default, fields with empty
  1296. // values are omitted from API requests. However, any field with an
  1297. // empty value appearing in NullFields will be sent to the server as
  1298. // null. It is an error if a field in this list has a non-empty value.
  1299. // This may be used to include null fields in Patch requests.
  1300. NullFields []string `json:"-"`
  1301. }
  1302. func (s *GamesAchievementSetStepsAtLeast) MarshalJSON() ([]byte, error) {
  1303. type NoMethod GamesAchievementSetStepsAtLeast
  1304. raw := NoMethod(*s)
  1305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1306. }
  1307. // ImageAsset: This is a JSON template for an image asset object.
  1308. type ImageAsset struct {
  1309. // Height: The height of the asset.
  1310. Height int64 `json:"height,omitempty"`
  1311. // Kind: Uniquely identifies the type of this resource. Value is always
  1312. // the fixed string games#imageAsset.
  1313. Kind string `json:"kind,omitempty"`
  1314. // Name: The name of the asset.
  1315. Name string `json:"name,omitempty"`
  1316. // Url: The URL of the asset.
  1317. Url string `json:"url,omitempty"`
  1318. // Width: The width of the asset.
  1319. Width int64 `json:"width,omitempty"`
  1320. // ForceSendFields is a list of field names (e.g. "Height") to
  1321. // unconditionally include in API requests. By default, fields with
  1322. // empty values are omitted from API requests. However, any non-pointer,
  1323. // non-interface field appearing in ForceSendFields will be sent to the
  1324. // server regardless of whether the field is empty or not. This may be
  1325. // used to include empty fields in Patch requests.
  1326. ForceSendFields []string `json:"-"`
  1327. // NullFields is a list of field names (e.g. "Height") to include in API
  1328. // requests with the JSON null value. By default, fields with empty
  1329. // values are omitted from API requests. However, any field with an
  1330. // empty value appearing in NullFields will be sent to the server as
  1331. // null. It is an error if a field in this list has a non-empty value.
  1332. // This may be used to include null fields in Patch requests.
  1333. NullFields []string `json:"-"`
  1334. }
  1335. func (s *ImageAsset) MarshalJSON() ([]byte, error) {
  1336. type NoMethod ImageAsset
  1337. raw := NoMethod(*s)
  1338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1339. }
  1340. // Instance: This is a JSON template for the Instance resource.
  1341. type Instance struct {
  1342. // AcquisitionUri: URI which shows where a user can acquire this
  1343. // instance.
  1344. AcquisitionUri string `json:"acquisitionUri,omitempty"`
  1345. // AndroidInstance: Platform dependent details for Android.
  1346. AndroidInstance *InstanceAndroidDetails `json:"androidInstance,omitempty"`
  1347. // IosInstance: Platform dependent details for iOS.
  1348. IosInstance *InstanceIosDetails `json:"iosInstance,omitempty"`
  1349. // Kind: Uniquely identifies the type of this resource. Value is always
  1350. // the fixed string games#instance.
  1351. Kind string `json:"kind,omitempty"`
  1352. // Name: Localized display name.
  1353. Name string `json:"name,omitempty"`
  1354. // PlatformType: The platform type.
  1355. // Possible values are:
  1356. // - "ANDROID" - Instance is for Android.
  1357. // - "IOS" - Instance is for iOS
  1358. // - "WEB_APP" - Instance is for Web App.
  1359. PlatformType string `json:"platformType,omitempty"`
  1360. // RealtimePlay: Flag to show if this game instance supports realtime
  1361. // play.
  1362. RealtimePlay bool `json:"realtimePlay,omitempty"`
  1363. // TurnBasedPlay: Flag to show if this game instance supports turn based
  1364. // play.
  1365. TurnBasedPlay bool `json:"turnBasedPlay,omitempty"`
  1366. // WebInstance: Platform dependent details for Web.
  1367. WebInstance *InstanceWebDetails `json:"webInstance,omitempty"`
  1368. // ForceSendFields is a list of field names (e.g. "AcquisitionUri") to
  1369. // unconditionally include in API requests. By default, fields with
  1370. // empty values are omitted from API requests. However, any non-pointer,
  1371. // non-interface field appearing in ForceSendFields will be sent to the
  1372. // server regardless of whether the field is empty or not. This may be
  1373. // used to include empty fields in Patch requests.
  1374. ForceSendFields []string `json:"-"`
  1375. // NullFields is a list of field names (e.g. "AcquisitionUri") to
  1376. // include in API requests with the JSON null value. By default, fields
  1377. // with empty values are omitted from API requests. However, any field
  1378. // with an empty value appearing in NullFields will be sent to the
  1379. // server as null. It is an error if a field in this list has a
  1380. // non-empty value. This may be used to include null fields in Patch
  1381. // requests.
  1382. NullFields []string `json:"-"`
  1383. }
  1384. func (s *Instance) MarshalJSON() ([]byte, error) {
  1385. type NoMethod Instance
  1386. raw := NoMethod(*s)
  1387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1388. }
  1389. // InstanceAndroidDetails: This is a JSON template for the Android
  1390. // instance details resource.
  1391. type InstanceAndroidDetails struct {
  1392. // EnablePiracyCheck: Flag indicating whether the anti-piracy check is
  1393. // enabled.
  1394. EnablePiracyCheck bool `json:"enablePiracyCheck,omitempty"`
  1395. // Kind: Uniquely identifies the type of this resource. Value is always
  1396. // the fixed string games#instanceAndroidDetails.
  1397. Kind string `json:"kind,omitempty"`
  1398. // PackageName: Android package name which maps to Google Play URL.
  1399. PackageName string `json:"packageName,omitempty"`
  1400. // Preferred: Indicates that this instance is the default for new
  1401. // installations.
  1402. Preferred bool `json:"preferred,omitempty"`
  1403. // ForceSendFields is a list of field names (e.g. "EnablePiracyCheck")
  1404. // to unconditionally include in API requests. By default, fields with
  1405. // empty values are omitted from API requests. However, any non-pointer,
  1406. // non-interface field appearing in ForceSendFields will be sent to the
  1407. // server regardless of whether the field is empty or not. This may be
  1408. // used to include empty fields in Patch requests.
  1409. ForceSendFields []string `json:"-"`
  1410. // NullFields is a list of field names (e.g. "EnablePiracyCheck") to
  1411. // include in API requests with the JSON null value. By default, fields
  1412. // with empty values are omitted from API requests. However, any field
  1413. // with an empty value appearing in NullFields will be sent to the
  1414. // server as null. It is an error if a field in this list has a
  1415. // non-empty value. This may be used to include null fields in Patch
  1416. // requests.
  1417. NullFields []string `json:"-"`
  1418. }
  1419. func (s *InstanceAndroidDetails) MarshalJSON() ([]byte, error) {
  1420. type NoMethod InstanceAndroidDetails
  1421. raw := NoMethod(*s)
  1422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1423. }
  1424. // InstanceIosDetails: This is a JSON template for the iOS details
  1425. // resource.
  1426. type InstanceIosDetails struct {
  1427. // BundleIdentifier: Bundle identifier.
  1428. BundleIdentifier string `json:"bundleIdentifier,omitempty"`
  1429. // ItunesAppId: iTunes App ID.
  1430. ItunesAppId string `json:"itunesAppId,omitempty"`
  1431. // Kind: Uniquely identifies the type of this resource. Value is always
  1432. // the fixed string games#instanceIosDetails.
  1433. Kind string `json:"kind,omitempty"`
  1434. // PreferredForIpad: Indicates that this instance is the default for new
  1435. // installations on iPad devices.
  1436. PreferredForIpad bool `json:"preferredForIpad,omitempty"`
  1437. // PreferredForIphone: Indicates that this instance is the default for
  1438. // new installations on iPhone devices.
  1439. PreferredForIphone bool `json:"preferredForIphone,omitempty"`
  1440. // SupportIpad: Flag to indicate if this instance supports iPad.
  1441. SupportIpad bool `json:"supportIpad,omitempty"`
  1442. // SupportIphone: Flag to indicate if this instance supports iPhone.
  1443. SupportIphone bool `json:"supportIphone,omitempty"`
  1444. // ForceSendFields is a list of field names (e.g. "BundleIdentifier") to
  1445. // unconditionally include in API requests. By default, fields with
  1446. // empty values are omitted from API requests. However, any non-pointer,
  1447. // non-interface field appearing in ForceSendFields will be sent to the
  1448. // server regardless of whether the field is empty or not. This may be
  1449. // used to include empty fields in Patch requests.
  1450. ForceSendFields []string `json:"-"`
  1451. // NullFields is a list of field names (e.g. "BundleIdentifier") to
  1452. // include in API requests with the JSON null value. By default, fields
  1453. // with empty values are omitted from API requests. However, any field
  1454. // with an empty value appearing in NullFields will be sent to the
  1455. // server as null. It is an error if a field in this list has a
  1456. // non-empty value. This may be used to include null fields in Patch
  1457. // requests.
  1458. NullFields []string `json:"-"`
  1459. }
  1460. func (s *InstanceIosDetails) MarshalJSON() ([]byte, error) {
  1461. type NoMethod InstanceIosDetails
  1462. raw := NoMethod(*s)
  1463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1464. }
  1465. // InstanceWebDetails: This is a JSON template for the Web details
  1466. // resource.
  1467. type InstanceWebDetails struct {
  1468. // Kind: Uniquely identifies the type of this resource. Value is always
  1469. // the fixed string games#instanceWebDetails.
  1470. Kind string `json:"kind,omitempty"`
  1471. // LaunchUrl: Launch URL for the game.
  1472. LaunchUrl string `json:"launchUrl,omitempty"`
  1473. // Preferred: Indicates that this instance is the default for new
  1474. // installations.
  1475. Preferred bool `json:"preferred,omitempty"`
  1476. // ForceSendFields is a list of field names (e.g. "Kind") to
  1477. // unconditionally include in API requests. By default, fields with
  1478. // empty values are omitted from API requests. However, any non-pointer,
  1479. // non-interface field appearing in ForceSendFields will be sent to the
  1480. // server regardless of whether the field is empty or not. This may be
  1481. // used to include empty fields in Patch requests.
  1482. ForceSendFields []string `json:"-"`
  1483. // NullFields is a list of field names (e.g. "Kind") to include in API
  1484. // requests with the JSON null value. By default, fields with empty
  1485. // values are omitted from API requests. However, any field with an
  1486. // empty value appearing in NullFields will be sent to the server as
  1487. // null. It is an error if a field in this list has a non-empty value.
  1488. // This may be used to include null fields in Patch requests.
  1489. NullFields []string `json:"-"`
  1490. }
  1491. func (s *InstanceWebDetails) MarshalJSON() ([]byte, error) {
  1492. type NoMethod InstanceWebDetails
  1493. raw := NoMethod(*s)
  1494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1495. }
  1496. // Leaderboard: This is a JSON template for the Leaderboard resource.
  1497. type Leaderboard struct {
  1498. // IconUrl: The icon for the leaderboard.
  1499. IconUrl string `json:"iconUrl,omitempty"`
  1500. // Id: The leaderboard ID.
  1501. Id string `json:"id,omitempty"`
  1502. // IsIconUrlDefault: Indicates whether the icon image being returned is
  1503. // a default image, or is game-provided.
  1504. IsIconUrlDefault bool `json:"isIconUrlDefault,omitempty"`
  1505. // Kind: Uniquely identifies the type of this resource. Value is always
  1506. // the fixed string games#leaderboard.
  1507. Kind string `json:"kind,omitempty"`
  1508. // Name: The name of the leaderboard.
  1509. Name string `json:"name,omitempty"`
  1510. // Order: How scores are ordered.
  1511. // Possible values are:
  1512. // - "LARGER_IS_BETTER" - Larger values are better; scores are sorted in
  1513. // descending order.
  1514. // - "SMALLER_IS_BETTER" - Smaller values are better; scores are sorted
  1515. // in ascending order.
  1516. Order string `json:"order,omitempty"`
  1517. // ServerResponse contains the HTTP response code and headers from the
  1518. // server.
  1519. googleapi.ServerResponse `json:"-"`
  1520. // ForceSendFields is a list of field names (e.g. "IconUrl") to
  1521. // unconditionally include in API requests. By default, fields with
  1522. // empty values are omitted from API requests. However, any non-pointer,
  1523. // non-interface field appearing in ForceSendFields will be sent to the
  1524. // server regardless of whether the field is empty or not. This may be
  1525. // used to include empty fields in Patch requests.
  1526. ForceSendFields []string `json:"-"`
  1527. // NullFields is a list of field names (e.g. "IconUrl") to include in
  1528. // API requests with the JSON null value. By default, fields with empty
  1529. // values are omitted from API requests. However, any field with an
  1530. // empty value appearing in NullFields will be sent to the server as
  1531. // null. It is an error if a field in this list has a non-empty value.
  1532. // This may be used to include null fields in Patch requests.
  1533. NullFields []string `json:"-"`
  1534. }
  1535. func (s *Leaderboard) MarshalJSON() ([]byte, error) {
  1536. type NoMethod Leaderboard
  1537. raw := NoMethod(*s)
  1538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1539. }
  1540. // LeaderboardEntry: This is a JSON template for the Leaderboard Entry
  1541. // resource.
  1542. type LeaderboardEntry struct {
  1543. // FormattedScore: The localized string for the numerical value of this
  1544. // score.
  1545. FormattedScore string `json:"formattedScore,omitempty"`
  1546. // FormattedScoreRank: The localized string for the rank of this score
  1547. // for this leaderboard.
  1548. FormattedScoreRank string `json:"formattedScoreRank,omitempty"`
  1549. // Kind: Uniquely identifies the type of this resource. Value is always
  1550. // the fixed string games#leaderboardEntry.
  1551. Kind string `json:"kind,omitempty"`
  1552. // Player: The player who holds this score.
  1553. Player *Player `json:"player,omitempty"`
  1554. // ScoreRank: The rank of this score for this leaderboard.
  1555. ScoreRank int64 `json:"scoreRank,omitempty,string"`
  1556. // ScoreTag: Additional information about the score. Values must contain
  1557. // no more than 64 URI-safe characters as defined by section 2.3 of RFC
  1558. // 3986.
  1559. ScoreTag string `json:"scoreTag,omitempty"`
  1560. // ScoreValue: The numerical value of this score.
  1561. ScoreValue int64 `json:"scoreValue,omitempty,string"`
  1562. // TimeSpan: The time span of this high score.
  1563. // Possible values are:
  1564. // - "ALL_TIME" - The score is an all-time high score.
  1565. // - "WEEKLY" - The score is a weekly high score.
  1566. // - "DAILY" - The score is a daily high score.
  1567. TimeSpan string `json:"timeSpan,omitempty"`
  1568. // WriteTimestampMillis: The timestamp at which this score was recorded,
  1569. // in milliseconds since the epoch in UTC.
  1570. WriteTimestampMillis int64 `json:"writeTimestampMillis,omitempty,string"`
  1571. // ForceSendFields is a list of field names (e.g. "FormattedScore") to
  1572. // unconditionally include in API requests. By default, fields with
  1573. // empty values are omitted from API requests. However, any non-pointer,
  1574. // non-interface field appearing in ForceSendFields will be sent to the
  1575. // server regardless of whether the field is empty or not. This may be
  1576. // used to include empty fields in Patch requests.
  1577. ForceSendFields []string `json:"-"`
  1578. // NullFields is a list of field names (e.g. "FormattedScore") to
  1579. // include in API requests with the JSON null value. By default, fields
  1580. // with empty values are omitted from API requests. However, any field
  1581. // with an empty value appearing in NullFields will be sent to the
  1582. // server as null. It is an error if a field in this list has a
  1583. // non-empty value. This may be used to include null fields in Patch
  1584. // requests.
  1585. NullFields []string `json:"-"`
  1586. }
  1587. func (s *LeaderboardEntry) MarshalJSON() ([]byte, error) {
  1588. type NoMethod LeaderboardEntry
  1589. raw := NoMethod(*s)
  1590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1591. }
  1592. // LeaderboardListResponse: This is a JSON template for a list of
  1593. // leaderboard objects.
  1594. type LeaderboardListResponse struct {
  1595. // Items: The leaderboards.
  1596. Items []*Leaderboard `json:"items,omitempty"`
  1597. // Kind: Uniquely identifies the type of this resource. Value is always
  1598. // the fixed string games#leaderboardListResponse.
  1599. Kind string `json:"kind,omitempty"`
  1600. // NextPageToken: Token corresponding to the next page of results.
  1601. NextPageToken string `json:"nextPageToken,omitempty"`
  1602. // ServerResponse contains the HTTP response code and headers from the
  1603. // server.
  1604. googleapi.ServerResponse `json:"-"`
  1605. // ForceSendFields is a list of field names (e.g. "Items") to
  1606. // unconditionally include in API requests. By default, fields with
  1607. // empty values are omitted from API requests. However, any non-pointer,
  1608. // non-interface field appearing in ForceSendFields will be sent to the
  1609. // server regardless of whether the field is empty or not. This may be
  1610. // used to include empty fields in Patch requests.
  1611. ForceSendFields []string `json:"-"`
  1612. // NullFields is a list of field names (e.g. "Items") to include in API
  1613. // requests with the JSON null value. By default, fields with empty
  1614. // values are omitted from API requests. However, any field with an
  1615. // empty value appearing in NullFields will be sent to the server as
  1616. // null. It is an error if a field in this list has a non-empty value.
  1617. // This may be used to include null fields in Patch requests.
  1618. NullFields []string `json:"-"`
  1619. }
  1620. func (s *LeaderboardListResponse) MarshalJSON() ([]byte, error) {
  1621. type NoMethod LeaderboardListResponse
  1622. raw := NoMethod(*s)
  1623. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1624. }
  1625. // LeaderboardScoreRank: This is a JSON template for a score rank in a
  1626. // leaderboard.
  1627. type LeaderboardScoreRank struct {
  1628. // FormattedNumScores: The number of scores in the leaderboard as a
  1629. // string.
  1630. FormattedNumScores string `json:"formattedNumScores,omitempty"`
  1631. // FormattedRank: The rank in the leaderboard as a string.
  1632. FormattedRank string `json:"formattedRank,omitempty"`
  1633. // Kind: Uniquely identifies the type of this resource. Value is always
  1634. // the fixed string games#leaderboardScoreRank.
  1635. Kind string `json:"kind,omitempty"`
  1636. // NumScores: The number of scores in the leaderboard.
  1637. NumScores int64 `json:"numScores,omitempty,string"`
  1638. // Rank: The rank in the leaderboard.
  1639. Rank int64 `json:"rank,omitempty,string"`
  1640. // ForceSendFields is a list of field names (e.g. "FormattedNumScores")
  1641. // to unconditionally include in API requests. By default, fields with
  1642. // empty values are omitted from API requests. However, any non-pointer,
  1643. // non-interface field appearing in ForceSendFields will be sent to the
  1644. // server regardless of whether the field is empty or not. This may be
  1645. // used to include empty fields in Patch requests.
  1646. ForceSendFields []string `json:"-"`
  1647. // NullFields is a list of field names (e.g. "FormattedNumScores") to
  1648. // include in API requests with the JSON null value. By default, fields
  1649. // with empty values are omitted from API requests. However, any field
  1650. // with an empty value appearing in NullFields will be sent to the
  1651. // server as null. It is an error if a field in this list has a
  1652. // non-empty value. This may be used to include null fields in Patch
  1653. // requests.
  1654. NullFields []string `json:"-"`
  1655. }
  1656. func (s *LeaderboardScoreRank) MarshalJSON() ([]byte, error) {
  1657. type NoMethod LeaderboardScoreRank
  1658. raw := NoMethod(*s)
  1659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1660. }
  1661. // LeaderboardScores: This is a JSON template for a ListScores response.
  1662. type LeaderboardScores struct {
  1663. // Items: The scores in the leaderboard.
  1664. Items []*LeaderboardEntry `json:"items,omitempty"`
  1665. // Kind: Uniquely identifies the type of this resource. Value is always
  1666. // the fixed string games#leaderboardScores.
  1667. Kind string `json:"kind,omitempty"`
  1668. // NextPageToken: The pagination token for the next page of results.
  1669. NextPageToken string `json:"nextPageToken,omitempty"`
  1670. // NumScores: The total number of scores in the leaderboard.
  1671. NumScores int64 `json:"numScores,omitempty,string"`
  1672. // PlayerScore: The score of the requesting player on the leaderboard.
  1673. // The player's score may appear both here and in the list of scores
  1674. // above. If you are viewing a public leaderboard and the player is not
  1675. // sharing their gameplay information publicly, the scoreRank and
  1676. // formattedScoreRank values will not be present.
  1677. PlayerScore *LeaderboardEntry `json:"playerScore,omitempty"`
  1678. // PrevPageToken: The pagination token for the previous page of results.
  1679. PrevPageToken string `json:"prevPageToken,omitempty"`
  1680. // ServerResponse contains the HTTP response code and headers from the
  1681. // server.
  1682. googleapi.ServerResponse `json:"-"`
  1683. // ForceSendFields is a list of field names (e.g. "Items") to
  1684. // unconditionally include in API requests. By default, fields with
  1685. // empty values are omitted from API requests. However, any non-pointer,
  1686. // non-interface field appearing in ForceSendFields will be sent to the
  1687. // server regardless of whether the field is empty or not. This may be
  1688. // used to include empty fields in Patch requests.
  1689. ForceSendFields []string `json:"-"`
  1690. // NullFields is a list of field names (e.g. "Items") to include in API
  1691. // requests with the JSON null value. By default, fields with empty
  1692. // values are omitted from API requests. However, any field with an
  1693. // empty value appearing in NullFields will be sent to the server as
  1694. // null. It is an error if a field in this list has a non-empty value.
  1695. // This may be used to include null fields in Patch requests.
  1696. NullFields []string `json:"-"`
  1697. }
  1698. func (s *LeaderboardScores) MarshalJSON() ([]byte, error) {
  1699. type NoMethod LeaderboardScores
  1700. raw := NoMethod(*s)
  1701. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1702. }
  1703. // MetagameConfig: This is a JSON template for the metagame config
  1704. // resource
  1705. type MetagameConfig struct {
  1706. // CurrentVersion: Current version of the metagame configuration data.
  1707. // When this data is updated, the version number will be increased by
  1708. // one.
  1709. CurrentVersion int64 `json:"currentVersion,omitempty"`
  1710. // Kind: Uniquely identifies the type of this resource. Value is always
  1711. // the fixed string games#metagameConfig.
  1712. Kind string `json:"kind,omitempty"`
  1713. // PlayerLevels: The list of player levels.
  1714. PlayerLevels []*PlayerLevel `json:"playerLevels,omitempty"`
  1715. // ServerResponse contains the HTTP response code and headers from the
  1716. // server.
  1717. googleapi.ServerResponse `json:"-"`
  1718. // ForceSendFields is a list of field names (e.g. "CurrentVersion") to
  1719. // unconditionally include in API requests. By default, fields with
  1720. // empty values are omitted from API requests. However, any non-pointer,
  1721. // non-interface field appearing in ForceSendFields will be sent to the
  1722. // server regardless of whether the field is empty or not. This may be
  1723. // used to include empty fields in Patch requests.
  1724. ForceSendFields []string `json:"-"`
  1725. // NullFields is a list of field names (e.g. "CurrentVersion") to
  1726. // include in API requests with the JSON null value. By default, fields
  1727. // with empty values are omitted from API requests. However, any field
  1728. // with an empty value appearing in NullFields will be sent to the
  1729. // server as null. It is an error if a field in this list has a
  1730. // non-empty value. This may be used to include null fields in Patch
  1731. // requests.
  1732. NullFields []string `json:"-"`
  1733. }
  1734. func (s *MetagameConfig) MarshalJSON() ([]byte, error) {
  1735. type NoMethod MetagameConfig
  1736. raw := NoMethod(*s)
  1737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1738. }
  1739. // NetworkDiagnostics: This is a JSON template for network diagnostics
  1740. // reported for a client.
  1741. type NetworkDiagnostics struct {
  1742. // AndroidNetworkSubtype: The Android network subtype.
  1743. AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"`
  1744. // AndroidNetworkType: The Android network type.
  1745. AndroidNetworkType int64 `json:"androidNetworkType,omitempty"`
  1746. // IosNetworkType: iOS network type as defined in Reachability.h.
  1747. IosNetworkType int64 `json:"iosNetworkType,omitempty"`
  1748. // Kind: Uniquely identifies the type of this resource. Value is always
  1749. // the fixed string games#networkDiagnostics.
  1750. Kind string `json:"kind,omitempty"`
  1751. // NetworkOperatorCode: The MCC+MNC code for the client's network
  1752. // connection. On Android:
  1753. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see:
  1754. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
  1755. NetworkOperatorCode string `json:"networkOperatorCode,omitempty"`
  1756. // NetworkOperatorName: The name of the carrier of the client's network
  1757. // connection. On Android:
  1758. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS:
  1759. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
  1760. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  1761. // RegistrationLatencyMillis: The amount of time in milliseconds it took
  1762. // for the client to establish a connection with the XMPP server.
  1763. RegistrationLatencyMillis int64 `json:"registrationLatencyMillis,omitempty"`
  1764. // ForceSendFields is a list of field names (e.g.
  1765. // "AndroidNetworkSubtype") to unconditionally include in API requests.
  1766. // By default, fields with empty values are omitted from API requests.
  1767. // However, any non-pointer, non-interface field appearing in
  1768. // ForceSendFields will be sent to the server regardless of whether the
  1769. // field is empty or not. This may be used to include empty fields in
  1770. // Patch requests.
  1771. ForceSendFields []string `json:"-"`
  1772. // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to
  1773. // include in API requests with the JSON null value. By default, fields
  1774. // with empty values are omitted from API requests. However, any field
  1775. // with an empty value appearing in NullFields will be sent to the
  1776. // server as null. It is an error if a field in this list has a
  1777. // non-empty value. This may be used to include null fields in Patch
  1778. // requests.
  1779. NullFields []string `json:"-"`
  1780. }
  1781. func (s *NetworkDiagnostics) MarshalJSON() ([]byte, error) {
  1782. type NoMethod NetworkDiagnostics
  1783. raw := NoMethod(*s)
  1784. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1785. }
  1786. // ParticipantResult: This is a JSON template for a result for a match
  1787. // participant.
  1788. type ParticipantResult struct {
  1789. // Kind: Uniquely identifies the type of this resource. Value is always
  1790. // the fixed string games#participantResult.
  1791. Kind string `json:"kind,omitempty"`
  1792. // ParticipantId: The ID of the participant.
  1793. ParticipantId string `json:"participantId,omitempty"`
  1794. // Placing: The placement or ranking of the participant in the match
  1795. // results; a number from one to the number of participants in the
  1796. // match. Multiple participants may have the same placing value in case
  1797. // of a type.
  1798. Placing int64 `json:"placing,omitempty"`
  1799. // Result: The result of the participant for this match.
  1800. // Possible values are:
  1801. // - "MATCH_RESULT_WIN" - The participant won the match.
  1802. // - "MATCH_RESULT_LOSS" - The participant lost the match.
  1803. // - "MATCH_RESULT_TIE" - The participant tied the match.
  1804. // - "MATCH_RESULT_NONE" - There was no winner for the match (nobody
  1805. // wins or loses this kind of game.)
  1806. // - "MATCH_RESULT_DISCONNECT" - The participant disconnected / left
  1807. // during the match.
  1808. // - "MATCH_RESULT_DISAGREED" - Different clients reported different
  1809. // results for this participant.
  1810. Result string `json:"result,omitempty"`
  1811. // ForceSendFields is a list of field names (e.g. "Kind") to
  1812. // unconditionally include in API requests. By default, fields with
  1813. // empty values are omitted from API requests. However, any non-pointer,
  1814. // non-interface field appearing in ForceSendFields will be sent to the
  1815. // server regardless of whether the field is empty or not. This may be
  1816. // used to include empty fields in Patch requests.
  1817. ForceSendFields []string `json:"-"`
  1818. // NullFields is a list of field names (e.g. "Kind") to include in API
  1819. // requests with the JSON null value. By default, fields with empty
  1820. // values are omitted from API requests. However, any field with an
  1821. // empty value appearing in NullFields will be sent to the server as
  1822. // null. It is an error if a field in this list has a non-empty value.
  1823. // This may be used to include null fields in Patch requests.
  1824. NullFields []string `json:"-"`
  1825. }
  1826. func (s *ParticipantResult) MarshalJSON() ([]byte, error) {
  1827. type NoMethod ParticipantResult
  1828. raw := NoMethod(*s)
  1829. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1830. }
  1831. // PeerChannelDiagnostics: This is a JSON template for peer channel
  1832. // diagnostics.
  1833. type PeerChannelDiagnostics struct {
  1834. // BytesReceived: Number of bytes received.
  1835. BytesReceived *AggregateStats `json:"bytesReceived,omitempty"`
  1836. // BytesSent: Number of bytes sent.
  1837. BytesSent *AggregateStats `json:"bytesSent,omitempty"`
  1838. // Kind: Uniquely identifies the type of this resource. Value is always
  1839. // the fixed string games#peerChannelDiagnostics.
  1840. Kind string `json:"kind,omitempty"`
  1841. // NumMessagesLost: Number of messages lost.
  1842. NumMessagesLost int64 `json:"numMessagesLost,omitempty"`
  1843. // NumMessagesReceived: Number of messages received.
  1844. NumMessagesReceived int64 `json:"numMessagesReceived,omitempty"`
  1845. // NumMessagesSent: Number of messages sent.
  1846. NumMessagesSent int64 `json:"numMessagesSent,omitempty"`
  1847. // NumSendFailures: Number of send failures.
  1848. NumSendFailures int64 `json:"numSendFailures,omitempty"`
  1849. // RoundtripLatencyMillis: Roundtrip latency stats in milliseconds.
  1850. RoundtripLatencyMillis *AggregateStats `json:"roundtripLatencyMillis,omitempty"`
  1851. // ForceSendFields is a list of field names (e.g. "BytesReceived") to
  1852. // unconditionally include in API requests. By default, fields with
  1853. // empty values are omitted from API requests. However, any non-pointer,
  1854. // non-interface field appearing in ForceSendFields will be sent to the
  1855. // server regardless of whether the field is empty or not. This may be
  1856. // used to include empty fields in Patch requests.
  1857. ForceSendFields []string `json:"-"`
  1858. // NullFields is a list of field names (e.g. "BytesReceived") to include
  1859. // in API requests with the JSON null value. By default, fields with
  1860. // empty values are omitted from API requests. However, any field with
  1861. // an empty value appearing in NullFields will be sent to the server as
  1862. // null. It is an error if a field in this list has a non-empty value.
  1863. // This may be used to include null fields in Patch requests.
  1864. NullFields []string `json:"-"`
  1865. }
  1866. func (s *PeerChannelDiagnostics) MarshalJSON() ([]byte, error) {
  1867. type NoMethod PeerChannelDiagnostics
  1868. raw := NoMethod(*s)
  1869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1870. }
  1871. // PeerSessionDiagnostics: This is a JSON template for peer session
  1872. // diagnostics.
  1873. type PeerSessionDiagnostics struct {
  1874. // ConnectedTimestampMillis: Connected time in milliseconds.
  1875. ConnectedTimestampMillis int64 `json:"connectedTimestampMillis,omitempty,string"`
  1876. // Kind: Uniquely identifies the type of this resource. Value is always
  1877. // the fixed string games#peerSessionDiagnostics.
  1878. Kind string `json:"kind,omitempty"`
  1879. // ParticipantId: The participant ID of the peer.
  1880. ParticipantId string `json:"participantId,omitempty"`
  1881. // ReliableChannel: Reliable channel diagnostics.
  1882. ReliableChannel *PeerChannelDiagnostics `json:"reliableChannel,omitempty"`
  1883. // UnreliableChannel: Unreliable channel diagnostics.
  1884. UnreliableChannel *PeerChannelDiagnostics `json:"unreliableChannel,omitempty"`
  1885. // ForceSendFields is a list of field names (e.g.
  1886. // "ConnectedTimestampMillis") to unconditionally include in API
  1887. // requests. By default, fields with empty values are omitted from API
  1888. // requests. However, any non-pointer, non-interface field appearing in
  1889. // ForceSendFields will be sent to the server regardless of whether the
  1890. // field is empty or not. This may be used to include empty fields in
  1891. // Patch requests.
  1892. ForceSendFields []string `json:"-"`
  1893. // NullFields is a list of field names (e.g. "ConnectedTimestampMillis")
  1894. // to include in API requests with the JSON null value. By default,
  1895. // fields with empty values are omitted from API requests. However, any
  1896. // field with an empty value appearing in NullFields will be sent to the
  1897. // server as null. It is an error if a field in this list has a
  1898. // non-empty value. This may be used to include null fields in Patch
  1899. // requests.
  1900. NullFields []string `json:"-"`
  1901. }
  1902. func (s *PeerSessionDiagnostics) MarshalJSON() ([]byte, error) {
  1903. type NoMethod PeerSessionDiagnostics
  1904. raw := NoMethod(*s)
  1905. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1906. }
  1907. // Played: This is a JSON template for metadata about a player playing a
  1908. // game with the currently authenticated user.
  1909. type Played struct {
  1910. // AutoMatched: True if the player was auto-matched with the currently
  1911. // authenticated user.
  1912. AutoMatched bool `json:"autoMatched,omitempty"`
  1913. // Kind: Uniquely identifies the type of this resource. Value is always
  1914. // the fixed string games#played.
  1915. Kind string `json:"kind,omitempty"`
  1916. // TimeMillis: The last time the player played the game in milliseconds
  1917. // since the epoch in UTC.
  1918. TimeMillis int64 `json:"timeMillis,omitempty,string"`
  1919. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  1920. // unconditionally include in API requests. By default, fields with
  1921. // empty values are omitted from API requests. However, any non-pointer,
  1922. // non-interface field appearing in ForceSendFields will be sent to the
  1923. // server regardless of whether the field is empty or not. This may be
  1924. // used to include empty fields in Patch requests.
  1925. ForceSendFields []string `json:"-"`
  1926. // NullFields is a list of field names (e.g. "AutoMatched") to include
  1927. // in API requests with the JSON null value. By default, fields with
  1928. // empty values are omitted from API requests. However, any field with
  1929. // an empty value appearing in NullFields will be sent to the server as
  1930. // null. It is an error if a field in this list has a non-empty value.
  1931. // This may be used to include null fields in Patch requests.
  1932. NullFields []string `json:"-"`
  1933. }
  1934. func (s *Played) MarshalJSON() ([]byte, error) {
  1935. type NoMethod Played
  1936. raw := NoMethod(*s)
  1937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1938. }
  1939. // Player: This is a JSON template for a Player resource.
  1940. type Player struct {
  1941. // AvatarImageUrl: The base URL for the image that represents the
  1942. // player.
  1943. AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
  1944. // BannerUrlLandscape: The url to the landscape mode player banner
  1945. // image.
  1946. BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"`
  1947. // BannerUrlPortrait: The url to the portrait mode player banner image.
  1948. BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"`
  1949. // DisplayName: The name to display for the player.
  1950. DisplayName string `json:"displayName,omitempty"`
  1951. // ExperienceInfo: An object to represent Play Game experience
  1952. // information for the player.
  1953. ExperienceInfo *PlayerExperienceInfo `json:"experienceInfo,omitempty"`
  1954. // Kind: Uniquely identifies the type of this resource. Value is always
  1955. // the fixed string games#player.
  1956. Kind string `json:"kind,omitempty"`
  1957. // LastPlayedWith: Details about the last time this player played a
  1958. // multiplayer game with the currently authenticated player. Populated
  1959. // for PLAYED_WITH player collection members.
  1960. LastPlayedWith *Played `json:"lastPlayedWith,omitempty"`
  1961. // Name: An object representation of the individual components of the
  1962. // player's name. For some players, these fields may not be present.
  1963. Name *PlayerName `json:"name,omitempty"`
  1964. // OriginalPlayerId: The player ID that was used for this player the
  1965. // first time they signed into the game in question. This is only
  1966. // populated for calls to player.get for the requesting player, only if
  1967. // the player ID has subsequently changed, and only to clients that
  1968. // support remapping player IDs.
  1969. OriginalPlayerId string `json:"originalPlayerId,omitempty"`
  1970. // PlayerId: The ID of the player.
  1971. PlayerId string `json:"playerId,omitempty"`
  1972. // ProfileSettings: The player's profile settings. Controls whether or
  1973. // not the player's profile is visible to other players.
  1974. ProfileSettings *ProfileSettings `json:"profileSettings,omitempty"`
  1975. // Title: The player's title rewarded for their game activities.
  1976. Title string `json:"title,omitempty"`
  1977. // ServerResponse contains the HTTP response code and headers from the
  1978. // server.
  1979. googleapi.ServerResponse `json:"-"`
  1980. // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
  1981. // unconditionally include in API requests. By default, fields with
  1982. // empty values are omitted from API requests. However, any non-pointer,
  1983. // non-interface field appearing in ForceSendFields will be sent to the
  1984. // server regardless of whether the field is empty or not. This may be
  1985. // used to include empty fields in Patch requests.
  1986. ForceSendFields []string `json:"-"`
  1987. // NullFields is a list of field names (e.g. "AvatarImageUrl") to
  1988. // include in API requests with the JSON null value. By default, fields
  1989. // with empty values are omitted from API requests. However, any field
  1990. // with an empty value appearing in NullFields will be sent to the
  1991. // server as null. It is an error if a field in this list has a
  1992. // non-empty value. This may be used to include null fields in Patch
  1993. // requests.
  1994. NullFields []string `json:"-"`
  1995. }
  1996. func (s *Player) MarshalJSON() ([]byte, error) {
  1997. type NoMethod Player
  1998. raw := NoMethod(*s)
  1999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2000. }
  2001. // PlayerName: An object representation of the individual components of
  2002. // the player's name. For some players, these fields may not be present.
  2003. type PlayerName struct {
  2004. // FamilyName: The family name of this player. In some places, this is
  2005. // known as the last name.
  2006. FamilyName string `json:"familyName,omitempty"`
  2007. // GivenName: The given name of this player. In some places, this is
  2008. // known as the first name.
  2009. GivenName string `json:"givenName,omitempty"`
  2010. // ForceSendFields is a list of field names (e.g. "FamilyName") to
  2011. // unconditionally include in API requests. By default, fields with
  2012. // empty values are omitted from API requests. However, any non-pointer,
  2013. // non-interface field appearing in ForceSendFields will be sent to the
  2014. // server regardless of whether the field is empty or not. This may be
  2015. // used to include empty fields in Patch requests.
  2016. ForceSendFields []string `json:"-"`
  2017. // NullFields is a list of field names (e.g. "FamilyName") to include in
  2018. // API requests with the JSON null value. By default, fields with empty
  2019. // values are omitted from API requests. However, any field with an
  2020. // empty value appearing in NullFields will be sent to the server as
  2021. // null. It is an error if a field in this list has a non-empty value.
  2022. // This may be used to include null fields in Patch requests.
  2023. NullFields []string `json:"-"`
  2024. }
  2025. func (s *PlayerName) MarshalJSON() ([]byte, error) {
  2026. type NoMethod PlayerName
  2027. raw := NoMethod(*s)
  2028. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2029. }
  2030. // PlayerAchievement: This is a JSON template for an achievement object.
  2031. type PlayerAchievement struct {
  2032. // AchievementState: The state of the achievement.
  2033. // Possible values are:
  2034. // - "HIDDEN" - Achievement is hidden.
  2035. // - "REVEALED" - Achievement is revealed.
  2036. // - "UNLOCKED" - Achievement is unlocked.
  2037. AchievementState string `json:"achievementState,omitempty"`
  2038. // CurrentSteps: The current steps for an incremental achievement.
  2039. CurrentSteps int64 `json:"currentSteps,omitempty"`
  2040. // ExperiencePoints: Experience points earned for the achievement. This
  2041. // field is absent for achievements that have not yet been unlocked and
  2042. // 0 for achievements that have been unlocked by testers but that are
  2043. // unpublished.
  2044. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  2045. // FormattedCurrentStepsString: The current steps for an incremental
  2046. // achievement as a string.
  2047. FormattedCurrentStepsString string `json:"formattedCurrentStepsString,omitempty"`
  2048. // Id: The ID of the achievement.
  2049. Id string `json:"id,omitempty"`
  2050. // Kind: Uniquely identifies the type of this resource. Value is always
  2051. // the fixed string games#playerAchievement.
  2052. Kind string `json:"kind,omitempty"`
  2053. // LastUpdatedTimestamp: The timestamp of the last modification to this
  2054. // achievement's state.
  2055. LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"`
  2056. // ForceSendFields is a list of field names (e.g. "AchievementState") to
  2057. // unconditionally include in API requests. By default, fields with
  2058. // empty values are omitted from API requests. However, any non-pointer,
  2059. // non-interface field appearing in ForceSendFields will be sent to the
  2060. // server regardless of whether the field is empty or not. This may be
  2061. // used to include empty fields in Patch requests.
  2062. ForceSendFields []string `json:"-"`
  2063. // NullFields is a list of field names (e.g. "AchievementState") to
  2064. // include in API requests with the JSON null value. By default, fields
  2065. // with empty values are omitted from API requests. However, any field
  2066. // with an empty value appearing in NullFields will be sent to the
  2067. // server as null. It is an error if a field in this list has a
  2068. // non-empty value. This may be used to include null fields in Patch
  2069. // requests.
  2070. NullFields []string `json:"-"`
  2071. }
  2072. func (s *PlayerAchievement) MarshalJSON() ([]byte, error) {
  2073. type NoMethod PlayerAchievement
  2074. raw := NoMethod(*s)
  2075. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2076. }
  2077. // PlayerAchievementListResponse: This is a JSON template for a list of
  2078. // achievement objects.
  2079. type PlayerAchievementListResponse struct {
  2080. // Items: The achievements.
  2081. Items []*PlayerAchievement `json:"items,omitempty"`
  2082. // Kind: Uniquely identifies the type of this resource. Value is always
  2083. // the fixed string games#playerAchievementListResponse.
  2084. Kind string `json:"kind,omitempty"`
  2085. // NextPageToken: Token corresponding to the next page of results.
  2086. NextPageToken string `json:"nextPageToken,omitempty"`
  2087. // ServerResponse contains the HTTP response code and headers from the
  2088. // server.
  2089. googleapi.ServerResponse `json:"-"`
  2090. // ForceSendFields is a list of field names (e.g. "Items") to
  2091. // unconditionally include in API requests. By default, fields with
  2092. // empty values are omitted from API requests. However, any non-pointer,
  2093. // non-interface field appearing in ForceSendFields will be sent to the
  2094. // server regardless of whether the field is empty or not. This may be
  2095. // used to include empty fields in Patch requests.
  2096. ForceSendFields []string `json:"-"`
  2097. // NullFields is a list of field names (e.g. "Items") to include in API
  2098. // requests with the JSON null value. By default, fields with empty
  2099. // values are omitted from API requests. However, any field with an
  2100. // empty value appearing in NullFields will be sent to the server as
  2101. // null. It is an error if a field in this list has a non-empty value.
  2102. // This may be used to include null fields in Patch requests.
  2103. NullFields []string `json:"-"`
  2104. }
  2105. func (s *PlayerAchievementListResponse) MarshalJSON() ([]byte, error) {
  2106. type NoMethod PlayerAchievementListResponse
  2107. raw := NoMethod(*s)
  2108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2109. }
  2110. // PlayerEvent: This is a JSON template for an event status resource.
  2111. type PlayerEvent struct {
  2112. // DefinitionId: The ID of the event definition.
  2113. DefinitionId string `json:"definitionId,omitempty"`
  2114. // FormattedNumEvents: The current number of times this event has
  2115. // occurred, as a string. The formatting of this string depends on the
  2116. // configuration of your event in the Play Games Developer Console.
  2117. FormattedNumEvents string `json:"formattedNumEvents,omitempty"`
  2118. // Kind: Uniquely identifies the type of this resource. Value is always
  2119. // the fixed string games#playerEvent.
  2120. Kind string `json:"kind,omitempty"`
  2121. // NumEvents: The current number of times this event has occurred.
  2122. NumEvents int64 `json:"numEvents,omitempty,string"`
  2123. // PlayerId: The ID of the player.
  2124. PlayerId string `json:"playerId,omitempty"`
  2125. // ForceSendFields is a list of field names (e.g. "DefinitionId") to
  2126. // unconditionally include in API requests. By default, fields with
  2127. // empty values are omitted from API requests. However, any non-pointer,
  2128. // non-interface field appearing in ForceSendFields will be sent to the
  2129. // server regardless of whether the field is empty or not. This may be
  2130. // used to include empty fields in Patch requests.
  2131. ForceSendFields []string `json:"-"`
  2132. // NullFields is a list of field names (e.g. "DefinitionId") to include
  2133. // in API requests with the JSON null value. By default, fields with
  2134. // empty values are omitted from API requests. However, any field with
  2135. // an empty value appearing in NullFields will be sent to the server as
  2136. // null. It is an error if a field in this list has a non-empty value.
  2137. // This may be used to include null fields in Patch requests.
  2138. NullFields []string `json:"-"`
  2139. }
  2140. func (s *PlayerEvent) MarshalJSON() ([]byte, error) {
  2141. type NoMethod PlayerEvent
  2142. raw := NoMethod(*s)
  2143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2144. }
  2145. // PlayerEventListResponse: This is a JSON template for a ListByPlayer
  2146. // response.
  2147. type PlayerEventListResponse struct {
  2148. // Items: The player events.
  2149. Items []*PlayerEvent `json:"items,omitempty"`
  2150. // Kind: Uniquely identifies the type of this resource. Value is always
  2151. // the fixed string games#playerEventListResponse.
  2152. Kind string `json:"kind,omitempty"`
  2153. // NextPageToken: The pagination token for the next page of results.
  2154. NextPageToken string `json:"nextPageToken,omitempty"`
  2155. // ServerResponse contains the HTTP response code and headers from the
  2156. // server.
  2157. googleapi.ServerResponse `json:"-"`
  2158. // ForceSendFields is a list of field names (e.g. "Items") to
  2159. // unconditionally include in API requests. By default, fields with
  2160. // empty values are omitted from API requests. However, any non-pointer,
  2161. // non-interface field appearing in ForceSendFields will be sent to the
  2162. // server regardless of whether the field is empty or not. This may be
  2163. // used to include empty fields in Patch requests.
  2164. ForceSendFields []string `json:"-"`
  2165. // NullFields is a list of field names (e.g. "Items") to include in API
  2166. // requests with the JSON null value. By default, fields with empty
  2167. // values are omitted from API requests. However, any field with an
  2168. // empty value appearing in NullFields will be sent to the server as
  2169. // null. It is an error if a field in this list has a non-empty value.
  2170. // This may be used to include null fields in Patch requests.
  2171. NullFields []string `json:"-"`
  2172. }
  2173. func (s *PlayerEventListResponse) MarshalJSON() ([]byte, error) {
  2174. type NoMethod PlayerEventListResponse
  2175. raw := NoMethod(*s)
  2176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2177. }
  2178. // PlayerExperienceInfo: This is a JSON template for 1P/3P metadata
  2179. // about the player's experience.
  2180. type PlayerExperienceInfo struct {
  2181. // CurrentExperiencePoints: The current number of experience points for
  2182. // the player.
  2183. CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"`
  2184. // CurrentLevel: The current level of the player.
  2185. CurrentLevel *PlayerLevel `json:"currentLevel,omitempty"`
  2186. // Kind: Uniquely identifies the type of this resource. Value is always
  2187. // the fixed string games#playerExperienceInfo.
  2188. Kind string `json:"kind,omitempty"`
  2189. // LastLevelUpTimestampMillis: The timestamp when the player was leveled
  2190. // up, in millis since Unix epoch UTC.
  2191. LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"`
  2192. // NextLevel: The next level of the player. If the current level is the
  2193. // maximum level, this should be same as the current level.
  2194. NextLevel *PlayerLevel `json:"nextLevel,omitempty"`
  2195. // ForceSendFields is a list of field names (e.g.
  2196. // "CurrentExperiencePoints") to unconditionally include in API
  2197. // requests. By default, fields with empty values are omitted from API
  2198. // requests. However, any non-pointer, non-interface field appearing in
  2199. // ForceSendFields will be sent to the server regardless of whether the
  2200. // field is empty or not. This may be used to include empty fields in
  2201. // Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "CurrentExperiencePoints")
  2204. // to include in API requests with the JSON null value. By default,
  2205. // fields with empty values are omitted from API requests. However, any
  2206. // field with an empty value appearing in NullFields will be sent to the
  2207. // server as null. It is an error if a field in this list has a
  2208. // non-empty value. This may be used to include null fields in Patch
  2209. // requests.
  2210. NullFields []string `json:"-"`
  2211. }
  2212. func (s *PlayerExperienceInfo) MarshalJSON() ([]byte, error) {
  2213. type NoMethod PlayerExperienceInfo
  2214. raw := NoMethod(*s)
  2215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2216. }
  2217. // PlayerLeaderboardScore: This is a JSON template for a player
  2218. // leaderboard score object.
  2219. type PlayerLeaderboardScore struct {
  2220. // Kind: Uniquely identifies the type of this resource. Value is always
  2221. // the fixed string games#playerLeaderboardScore.
  2222. Kind string `json:"kind,omitempty"`
  2223. // LeaderboardId: The ID of the leaderboard this score is in.
  2224. LeaderboardId string `json:"leaderboard_id,omitempty"`
  2225. // PublicRank: The public rank of the score in this leaderboard. This
  2226. // object will not be present if the user is not sharing their scores
  2227. // publicly.
  2228. PublicRank *LeaderboardScoreRank `json:"publicRank,omitempty"`
  2229. // ScoreString: The formatted value of this score.
  2230. ScoreString string `json:"scoreString,omitempty"`
  2231. // ScoreTag: Additional information about the score. Values must contain
  2232. // no more than 64 URI-safe characters as defined by section 2.3 of RFC
  2233. // 3986.
  2234. ScoreTag string `json:"scoreTag,omitempty"`
  2235. // ScoreValue: The numerical value of this score.
  2236. ScoreValue int64 `json:"scoreValue,omitempty,string"`
  2237. // SocialRank: The social rank of the score in this leaderboard.
  2238. SocialRank *LeaderboardScoreRank `json:"socialRank,omitempty"`
  2239. // TimeSpan: The time span of this score.
  2240. // Possible values are:
  2241. // - "ALL_TIME" - The score is an all-time score.
  2242. // - "WEEKLY" - The score is a weekly score.
  2243. // - "DAILY" - The score is a daily score.
  2244. TimeSpan string `json:"timeSpan,omitempty"`
  2245. // WriteTimestamp: The timestamp at which this score was recorded, in
  2246. // milliseconds since the epoch in UTC.
  2247. WriteTimestamp int64 `json:"writeTimestamp,omitempty,string"`
  2248. // ForceSendFields is a list of field names (e.g. "Kind") to
  2249. // unconditionally include in API requests. By default, fields with
  2250. // empty values are omitted from API requests. However, any non-pointer,
  2251. // non-interface field appearing in ForceSendFields will be sent to the
  2252. // server regardless of whether the field is empty or not. This may be
  2253. // used to include empty fields in Patch requests.
  2254. ForceSendFields []string `json:"-"`
  2255. // NullFields is a list of field names (e.g. "Kind") to include in API
  2256. // requests with the JSON null value. By default, fields with empty
  2257. // values are omitted from API requests. However, any field with an
  2258. // empty value appearing in NullFields will be sent to the server as
  2259. // null. It is an error if a field in this list has a non-empty value.
  2260. // This may be used to include null fields in Patch requests.
  2261. NullFields []string `json:"-"`
  2262. }
  2263. func (s *PlayerLeaderboardScore) MarshalJSON() ([]byte, error) {
  2264. type NoMethod PlayerLeaderboardScore
  2265. raw := NoMethod(*s)
  2266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2267. }
  2268. // PlayerLeaderboardScoreListResponse: This is a JSON template for a
  2269. // list of player leaderboard scores.
  2270. type PlayerLeaderboardScoreListResponse struct {
  2271. // Items: The leaderboard scores.
  2272. Items []*PlayerLeaderboardScore `json:"items,omitempty"`
  2273. // Kind: Uniquely identifies the type of this resource. Value is always
  2274. // the fixed string games#playerLeaderboardScoreListResponse.
  2275. Kind string `json:"kind,omitempty"`
  2276. // NextPageToken: The pagination token for the next page of results.
  2277. NextPageToken string `json:"nextPageToken,omitempty"`
  2278. // Player: The Player resources for the owner of this score.
  2279. Player *Player `json:"player,omitempty"`
  2280. // ServerResponse contains the HTTP response code and headers from the
  2281. // server.
  2282. googleapi.ServerResponse `json:"-"`
  2283. // ForceSendFields is a list of field names (e.g. "Items") to
  2284. // unconditionally include in API requests. By default, fields with
  2285. // empty values are omitted from API requests. However, any non-pointer,
  2286. // non-interface field appearing in ForceSendFields will be sent to the
  2287. // server regardless of whether the field is empty or not. This may be
  2288. // used to include empty fields in Patch requests.
  2289. ForceSendFields []string `json:"-"`
  2290. // NullFields is a list of field names (e.g. "Items") to include in API
  2291. // requests with the JSON null value. By default, fields with empty
  2292. // values are omitted from API requests. However, any field with an
  2293. // empty value appearing in NullFields will be sent to the server as
  2294. // null. It is an error if a field in this list has a non-empty value.
  2295. // This may be used to include null fields in Patch requests.
  2296. NullFields []string `json:"-"`
  2297. }
  2298. func (s *PlayerLeaderboardScoreListResponse) MarshalJSON() ([]byte, error) {
  2299. type NoMethod PlayerLeaderboardScoreListResponse
  2300. raw := NoMethod(*s)
  2301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2302. }
  2303. // PlayerLevel: This is a JSON template for 1P/3P metadata about a
  2304. // user's level.
  2305. type PlayerLevel struct {
  2306. // Kind: Uniquely identifies the type of this resource. Value is always
  2307. // the fixed string games#playerLevel.
  2308. Kind string `json:"kind,omitempty"`
  2309. // Level: The level for the user.
  2310. Level int64 `json:"level,omitempty"`
  2311. // MaxExperiencePoints: The maximum experience points for this level.
  2312. MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"`
  2313. // MinExperiencePoints: The minimum experience points for this level.
  2314. MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"`
  2315. // ForceSendFields is a list of field names (e.g. "Kind") to
  2316. // unconditionally include in API requests. By default, fields with
  2317. // empty values are omitted from API requests. However, any non-pointer,
  2318. // non-interface field appearing in ForceSendFields will be sent to the
  2319. // server regardless of whether the field is empty or not. This may be
  2320. // used to include empty fields in Patch requests.
  2321. ForceSendFields []string `json:"-"`
  2322. // NullFields is a list of field names (e.g. "Kind") to include in API
  2323. // requests with the JSON null value. By default, fields with empty
  2324. // values are omitted from API requests. However, any field with an
  2325. // empty value appearing in NullFields will be sent to the server as
  2326. // null. It is an error if a field in this list has a non-empty value.
  2327. // This may be used to include null fields in Patch requests.
  2328. NullFields []string `json:"-"`
  2329. }
  2330. func (s *PlayerLevel) MarshalJSON() ([]byte, error) {
  2331. type NoMethod PlayerLevel
  2332. raw := NoMethod(*s)
  2333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2334. }
  2335. // PlayerListResponse: This is a JSON template for a third party player
  2336. // list response.
  2337. type PlayerListResponse struct {
  2338. // Items: The players.
  2339. Items []*Player `json:"items,omitempty"`
  2340. // Kind: Uniquely identifies the type of this resource. Value is always
  2341. // the fixed string games#playerListResponse.
  2342. Kind string `json:"kind,omitempty"`
  2343. // NextPageToken: Token corresponding to the next page of results.
  2344. NextPageToken string `json:"nextPageToken,omitempty"`
  2345. // ServerResponse contains the HTTP response code and headers from the
  2346. // server.
  2347. googleapi.ServerResponse `json:"-"`
  2348. // ForceSendFields is a list of field names (e.g. "Items") to
  2349. // unconditionally include in API requests. By default, fields with
  2350. // empty values are omitted from API requests. However, any non-pointer,
  2351. // non-interface field appearing in ForceSendFields will be sent to the
  2352. // server regardless of whether the field is empty or not. This may be
  2353. // used to include empty fields in Patch requests.
  2354. ForceSendFields []string `json:"-"`
  2355. // NullFields is a list of field names (e.g. "Items") to include in API
  2356. // requests with the JSON null value. By default, fields with empty
  2357. // values are omitted from API requests. However, any field with an
  2358. // empty value appearing in NullFields will be sent to the server as
  2359. // null. It is an error if a field in this list has a non-empty value.
  2360. // This may be used to include null fields in Patch requests.
  2361. NullFields []string `json:"-"`
  2362. }
  2363. func (s *PlayerListResponse) MarshalJSON() ([]byte, error) {
  2364. type NoMethod PlayerListResponse
  2365. raw := NoMethod(*s)
  2366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2367. }
  2368. // PlayerScore: This is a JSON template for a player score.
  2369. type PlayerScore struct {
  2370. // FormattedScore: The formatted score for this player score.
  2371. FormattedScore string `json:"formattedScore,omitempty"`
  2372. // Kind: Uniquely identifies the type of this resource. Value is always
  2373. // the fixed string games#playerScore.
  2374. Kind string `json:"kind,omitempty"`
  2375. // Score: The numerical value for this player score.
  2376. Score int64 `json:"score,omitempty,string"`
  2377. // ScoreTag: Additional information about this score. Values will
  2378. // contain no more than 64 URI-safe characters as defined by section 2.3
  2379. // of RFC 3986.
  2380. ScoreTag string `json:"scoreTag,omitempty"`
  2381. // TimeSpan: The time span for this player score.
  2382. // Possible values are:
  2383. // - "ALL_TIME" - The score is an all-time score.
  2384. // - "WEEKLY" - The score is a weekly score.
  2385. // - "DAILY" - The score is a daily score.
  2386. TimeSpan string `json:"timeSpan,omitempty"`
  2387. // ForceSendFields is a list of field names (e.g. "FormattedScore") to
  2388. // unconditionally include in API requests. By default, fields with
  2389. // empty values are omitted from API requests. However, any non-pointer,
  2390. // non-interface field appearing in ForceSendFields will be sent to the
  2391. // server regardless of whether the field is empty or not. This may be
  2392. // used to include empty fields in Patch requests.
  2393. ForceSendFields []string `json:"-"`
  2394. // NullFields is a list of field names (e.g. "FormattedScore") to
  2395. // include in API requests with the JSON null value. By default, fields
  2396. // with empty values are omitted from API requests. However, any field
  2397. // with an empty value appearing in NullFields will be sent to the
  2398. // server as null. It is an error if a field in this list has a
  2399. // non-empty value. This may be used to include null fields in Patch
  2400. // requests.
  2401. NullFields []string `json:"-"`
  2402. }
  2403. func (s *PlayerScore) MarshalJSON() ([]byte, error) {
  2404. type NoMethod PlayerScore
  2405. raw := NoMethod(*s)
  2406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2407. }
  2408. // PlayerScoreListResponse: This is a JSON template for a list of score
  2409. // submission statuses.
  2410. type PlayerScoreListResponse struct {
  2411. // Kind: Uniquely identifies the type of this resource. Value is always
  2412. // the fixed string games#playerScoreListResponse.
  2413. Kind string `json:"kind,omitempty"`
  2414. // SubmittedScores: The score submissions statuses.
  2415. SubmittedScores []*PlayerScoreResponse `json:"submittedScores,omitempty"`
  2416. // ServerResponse contains the HTTP response code and headers from the
  2417. // server.
  2418. googleapi.ServerResponse `json:"-"`
  2419. // ForceSendFields is a list of field names (e.g. "Kind") to
  2420. // unconditionally include in API requests. By default, fields with
  2421. // empty values are omitted from API requests. However, any non-pointer,
  2422. // non-interface field appearing in ForceSendFields will be sent to the
  2423. // server regardless of whether the field is empty or not. This may be
  2424. // used to include empty fields in Patch requests.
  2425. ForceSendFields []string `json:"-"`
  2426. // NullFields is a list of field names (e.g. "Kind") to include in API
  2427. // requests with the JSON null value. By default, fields with empty
  2428. // values are omitted from API requests. However, any field with an
  2429. // empty value appearing in NullFields will be sent to the server as
  2430. // null. It is an error if a field in this list has a non-empty value.
  2431. // This may be used to include null fields in Patch requests.
  2432. NullFields []string `json:"-"`
  2433. }
  2434. func (s *PlayerScoreListResponse) MarshalJSON() ([]byte, error) {
  2435. type NoMethod PlayerScoreListResponse
  2436. raw := NoMethod(*s)
  2437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2438. }
  2439. // PlayerScoreResponse: This is a JSON template for a list of
  2440. // leaderboard entry resources.
  2441. type PlayerScoreResponse struct {
  2442. // BeatenScoreTimeSpans: The time spans where the submitted score is
  2443. // better than the existing score for that time span.
  2444. // Possible values are:
  2445. // - "ALL_TIME" - The score is an all-time score.
  2446. // - "WEEKLY" - The score is a weekly score.
  2447. // - "DAILY" - The score is a daily score.
  2448. BeatenScoreTimeSpans []string `json:"beatenScoreTimeSpans,omitempty"`
  2449. // FormattedScore: The formatted value of the submitted score.
  2450. FormattedScore string `json:"formattedScore,omitempty"`
  2451. // Kind: Uniquely identifies the type of this resource. Value is always
  2452. // the fixed string games#playerScoreResponse.
  2453. Kind string `json:"kind,omitempty"`
  2454. // LeaderboardId: The leaderboard ID that this score was submitted to.
  2455. LeaderboardId string `json:"leaderboardId,omitempty"`
  2456. // ScoreTag: Additional information about this score. Values will
  2457. // contain no more than 64 URI-safe characters as defined by section 2.3
  2458. // of RFC 3986.
  2459. ScoreTag string `json:"scoreTag,omitempty"`
  2460. // UnbeatenScores: The scores in time spans that have not been beaten.
  2461. // As an example, the submitted score may be better than the player's
  2462. // DAILY score, but not better than the player's scores for the WEEKLY
  2463. // or ALL_TIME time spans.
  2464. UnbeatenScores []*PlayerScore `json:"unbeatenScores,omitempty"`
  2465. // ServerResponse contains the HTTP response code and headers from the
  2466. // server.
  2467. googleapi.ServerResponse `json:"-"`
  2468. // ForceSendFields is a list of field names (e.g.
  2469. // "BeatenScoreTimeSpans") to unconditionally include in API requests.
  2470. // By default, fields with empty values are omitted from API requests.
  2471. // However, any non-pointer, non-interface field appearing in
  2472. // ForceSendFields will be sent to the server regardless of whether the
  2473. // field is empty or not. This may be used to include empty fields in
  2474. // Patch requests.
  2475. ForceSendFields []string `json:"-"`
  2476. // NullFields is a list of field names (e.g. "BeatenScoreTimeSpans") to
  2477. // include in API requests with the JSON null value. By default, fields
  2478. // with empty values are omitted from API requests. However, any field
  2479. // with an empty value appearing in NullFields will be sent to the
  2480. // server as null. It is an error if a field in this list has a
  2481. // non-empty value. This may be used to include null fields in Patch
  2482. // requests.
  2483. NullFields []string `json:"-"`
  2484. }
  2485. func (s *PlayerScoreResponse) MarshalJSON() ([]byte, error) {
  2486. type NoMethod PlayerScoreResponse
  2487. raw := NoMethod(*s)
  2488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2489. }
  2490. // PlayerScoreSubmissionList: This is a JSON template for a list of
  2491. // score submission requests
  2492. type PlayerScoreSubmissionList struct {
  2493. // Kind: Uniquely identifies the type of this resource. Value is always
  2494. // the fixed string games#playerScoreSubmissionList.
  2495. Kind string `json:"kind,omitempty"`
  2496. // Scores: The score submissions.
  2497. Scores []*ScoreSubmission `json:"scores,omitempty"`
  2498. // ForceSendFields is a list of field names (e.g. "Kind") to
  2499. // unconditionally include in API requests. By default, fields with
  2500. // empty values are omitted from API requests. However, any non-pointer,
  2501. // non-interface field appearing in ForceSendFields will be sent to the
  2502. // server regardless of whether the field is empty or not. This may be
  2503. // used to include empty fields in Patch requests.
  2504. ForceSendFields []string `json:"-"`
  2505. // NullFields is a list of field names (e.g. "Kind") to include in API
  2506. // requests with the JSON null value. By default, fields with empty
  2507. // values are omitted from API requests. However, any field with an
  2508. // empty value appearing in NullFields will be sent to the server as
  2509. // null. It is an error if a field in this list has a non-empty value.
  2510. // This may be used to include null fields in Patch requests.
  2511. NullFields []string `json:"-"`
  2512. }
  2513. func (s *PlayerScoreSubmissionList) MarshalJSON() ([]byte, error) {
  2514. type NoMethod PlayerScoreSubmissionList
  2515. raw := NoMethod(*s)
  2516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2517. }
  2518. // ProfileSettings: This is a JSON template for profile settings
  2519. type ProfileSettings struct {
  2520. // Kind: Uniquely identifies the type of this resource. Value is always
  2521. // the fixed string games#profileSettings.
  2522. Kind string `json:"kind,omitempty"`
  2523. // ProfileVisible: The player's current profile visibility. This field
  2524. // is visible to both 1P and 3P APIs.
  2525. ProfileVisible bool `json:"profileVisible,omitempty"`
  2526. // ForceSendFields is a list of field names (e.g. "Kind") to
  2527. // unconditionally include in API requests. By default, fields with
  2528. // empty values are omitted from API requests. However, any non-pointer,
  2529. // non-interface field appearing in ForceSendFields will be sent to the
  2530. // server regardless of whether the field is empty or not. This may be
  2531. // used to include empty fields in Patch requests.
  2532. ForceSendFields []string `json:"-"`
  2533. // NullFields is a list of field names (e.g. "Kind") to include in API
  2534. // requests with the JSON null value. By default, fields with empty
  2535. // values are omitted from API requests. However, any field with an
  2536. // empty value appearing in NullFields will be sent to the server as
  2537. // null. It is an error if a field in this list has a non-empty value.
  2538. // This may be used to include null fields in Patch requests.
  2539. NullFields []string `json:"-"`
  2540. }
  2541. func (s *ProfileSettings) MarshalJSON() ([]byte, error) {
  2542. type NoMethod ProfileSettings
  2543. raw := NoMethod(*s)
  2544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2545. }
  2546. // PushToken: This is a JSON template for a push token resource.
  2547. type PushToken struct {
  2548. // ClientRevision: The revision of the client SDK used by your
  2549. // application, in the same format that's used by revisions.check. Used
  2550. // to send backward compatible messages. Format:
  2551. // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE
  2552. // are:
  2553. // - IOS - Push token is for iOS
  2554. ClientRevision string `json:"clientRevision,omitempty"`
  2555. // Id: Unique identifier for this push token.
  2556. Id *PushTokenId `json:"id,omitempty"`
  2557. // Kind: Uniquely identifies the type of this resource. Value is always
  2558. // the fixed string games#pushToken.
  2559. Kind string `json:"kind,omitempty"`
  2560. // Language: The preferred language for notifications that are sent
  2561. // using this token.
  2562. Language string `json:"language,omitempty"`
  2563. // ForceSendFields is a list of field names (e.g. "ClientRevision") to
  2564. // unconditionally include in API requests. By default, fields with
  2565. // empty values are omitted from API requests. However, any non-pointer,
  2566. // non-interface field appearing in ForceSendFields will be sent to the
  2567. // server regardless of whether the field is empty or not. This may be
  2568. // used to include empty fields in Patch requests.
  2569. ForceSendFields []string `json:"-"`
  2570. // NullFields is a list of field names (e.g. "ClientRevision") to
  2571. // include in API requests with the JSON null value. By default, fields
  2572. // with empty values are omitted from API requests. However, any field
  2573. // with an empty value appearing in NullFields will be sent to the
  2574. // server as null. It is an error if a field in this list has a
  2575. // non-empty value. This may be used to include null fields in Patch
  2576. // requests.
  2577. NullFields []string `json:"-"`
  2578. }
  2579. func (s *PushToken) MarshalJSON() ([]byte, error) {
  2580. type NoMethod PushToken
  2581. raw := NoMethod(*s)
  2582. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2583. }
  2584. // PushTokenId: This is a JSON template for a push token ID resource.
  2585. type PushTokenId struct {
  2586. // Ios: A push token ID for iOS devices.
  2587. Ios *PushTokenIdIos `json:"ios,omitempty"`
  2588. // Kind: Uniquely identifies the type of this resource. Value is always
  2589. // the fixed string games#pushTokenId.
  2590. Kind string `json:"kind,omitempty"`
  2591. // ForceSendFields is a list of field names (e.g. "Ios") to
  2592. // unconditionally include in API requests. By default, fields with
  2593. // empty values are omitted from API requests. However, any non-pointer,
  2594. // non-interface field appearing in ForceSendFields will be sent to the
  2595. // server regardless of whether the field is empty or not. This may be
  2596. // used to include empty fields in Patch requests.
  2597. ForceSendFields []string `json:"-"`
  2598. // NullFields is a list of field names (e.g. "Ios") to include in API
  2599. // requests with the JSON null value. By default, fields with empty
  2600. // values are omitted from API requests. However, any field with an
  2601. // empty value appearing in NullFields will be sent to the server as
  2602. // null. It is an error if a field in this list has a non-empty value.
  2603. // This may be used to include null fields in Patch requests.
  2604. NullFields []string `json:"-"`
  2605. }
  2606. func (s *PushTokenId) MarshalJSON() ([]byte, error) {
  2607. type NoMethod PushTokenId
  2608. raw := NoMethod(*s)
  2609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2610. }
  2611. // PushTokenIdIos: A push token ID for iOS devices.
  2612. type PushTokenIdIos struct {
  2613. // ApnsDeviceToken: Device token supplied by an iOS system call to
  2614. // register for remote notifications. Encode this field as web-safe
  2615. // base64.
  2616. ApnsDeviceToken string `json:"apns_device_token,omitempty"`
  2617. // ApnsEnvironment: Indicates whether this token should be used for the
  2618. // production or sandbox APNS server.
  2619. ApnsEnvironment string `json:"apns_environment,omitempty"`
  2620. // ForceSendFields is a list of field names (e.g. "ApnsDeviceToken") to
  2621. // unconditionally include in API requests. By default, fields with
  2622. // empty values are omitted from API requests. However, any non-pointer,
  2623. // non-interface field appearing in ForceSendFields will be sent to the
  2624. // server regardless of whether the field is empty or not. This may be
  2625. // used to include empty fields in Patch requests.
  2626. ForceSendFields []string `json:"-"`
  2627. // NullFields is a list of field names (e.g. "ApnsDeviceToken") to
  2628. // include in API requests with the JSON null value. By default, fields
  2629. // with empty values are omitted from API requests. However, any field
  2630. // with an empty value appearing in NullFields will be sent to the
  2631. // server as null. It is an error if a field in this list has a
  2632. // non-empty value. This may be used to include null fields in Patch
  2633. // requests.
  2634. NullFields []string `json:"-"`
  2635. }
  2636. func (s *PushTokenIdIos) MarshalJSON() ([]byte, error) {
  2637. type NoMethod PushTokenIdIos
  2638. raw := NoMethod(*s)
  2639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2640. }
  2641. // Quest: This is a JSON template for a Quest resource.
  2642. type Quest struct {
  2643. // AcceptedTimestampMillis: The timestamp at which the user accepted the
  2644. // quest in milliseconds since the epoch in UTC. Only present if the
  2645. // player has accepted the quest.
  2646. AcceptedTimestampMillis int64 `json:"acceptedTimestampMillis,omitempty,string"`
  2647. // ApplicationId: The ID of the application this quest is part of.
  2648. ApplicationId string `json:"applicationId,omitempty"`
  2649. // BannerUrl: The banner image URL for the quest.
  2650. BannerUrl string `json:"bannerUrl,omitempty"`
  2651. // Description: The description of the quest.
  2652. Description string `json:"description,omitempty"`
  2653. // EndTimestampMillis: The timestamp at which the quest ceases to be
  2654. // active in milliseconds since the epoch in UTC.
  2655. EndTimestampMillis int64 `json:"endTimestampMillis,omitempty,string"`
  2656. // IconUrl: The icon image URL for the quest.
  2657. IconUrl string `json:"iconUrl,omitempty"`
  2658. // Id: The ID of the quest.
  2659. Id string `json:"id,omitempty"`
  2660. // IsDefaultBannerUrl: Indicates whether the banner image being returned
  2661. // is a default image, or is game-provided.
  2662. IsDefaultBannerUrl bool `json:"isDefaultBannerUrl,omitempty"`
  2663. // IsDefaultIconUrl: Indicates whether the icon image being returned is
  2664. // a default image, or is game-provided.
  2665. IsDefaultIconUrl bool `json:"isDefaultIconUrl,omitempty"`
  2666. // Kind: Uniquely identifies the type of this resource. Value is always
  2667. // the fixed string games#quest.
  2668. Kind string `json:"kind,omitempty"`
  2669. // LastUpdatedTimestampMillis: The timestamp at which the quest was last
  2670. // updated by the user in milliseconds since the epoch in UTC. Only
  2671. // present if the player has accepted the quest.
  2672. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  2673. // Milestones: The quest milestones.
  2674. Milestones []*QuestMilestone `json:"milestones,omitempty"`
  2675. // Name: The name of the quest.
  2676. Name string `json:"name,omitempty"`
  2677. // NotifyTimestampMillis: The timestamp at which the user should be
  2678. // notified that the quest will end soon in milliseconds since the epoch
  2679. // in UTC.
  2680. NotifyTimestampMillis int64 `json:"notifyTimestampMillis,omitempty,string"`
  2681. // StartTimestampMillis: The timestamp at which the quest becomes active
  2682. // in milliseconds since the epoch in UTC.
  2683. StartTimestampMillis int64 `json:"startTimestampMillis,omitempty,string"`
  2684. // State: The state of the quest.
  2685. // Possible values are:
  2686. // - "UPCOMING": The quest is upcoming. The user can see the quest, but
  2687. // cannot accept it until it is open.
  2688. // - "OPEN": The quest is currently open and may be accepted at this
  2689. // time.
  2690. // - "ACCEPTED": The user is currently participating in this quest.
  2691. // - "COMPLETED": The user has completed the quest.
  2692. // - "FAILED": The quest was attempted but was not completed before the
  2693. // deadline expired.
  2694. // - "EXPIRED": The quest has expired and was not accepted.
  2695. // - "DELETED": The quest should be deleted from the local database.
  2696. State string `json:"state,omitempty"`
  2697. // ServerResponse contains the HTTP response code and headers from the
  2698. // server.
  2699. googleapi.ServerResponse `json:"-"`
  2700. // ForceSendFields is a list of field names (e.g.
  2701. // "AcceptedTimestampMillis") to unconditionally include in API
  2702. // requests. By default, fields with empty values are omitted from API
  2703. // requests. However, any non-pointer, non-interface field appearing in
  2704. // ForceSendFields will be sent to the server regardless of whether the
  2705. // field is empty or not. This may be used to include empty fields in
  2706. // Patch requests.
  2707. ForceSendFields []string `json:"-"`
  2708. // NullFields is a list of field names (e.g. "AcceptedTimestampMillis")
  2709. // to include in API requests with the JSON null value. By default,
  2710. // fields with empty values are omitted from API requests. However, any
  2711. // field with an empty value appearing in NullFields will be sent to the
  2712. // server as null. It is an error if a field in this list has a
  2713. // non-empty value. This may be used to include null fields in Patch
  2714. // requests.
  2715. NullFields []string `json:"-"`
  2716. }
  2717. func (s *Quest) MarshalJSON() ([]byte, error) {
  2718. type NoMethod Quest
  2719. raw := NoMethod(*s)
  2720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2721. }
  2722. // QuestContribution: This is a JSON template for a Quest Criterion
  2723. // Contribution resource.
  2724. type QuestContribution struct {
  2725. // FormattedValue: The formatted value of the contribution as a string.
  2726. // Format depends on the configuration for the associated event
  2727. // definition in the Play Games Developer Console.
  2728. FormattedValue string `json:"formattedValue,omitempty"`
  2729. // Kind: Uniquely identifies the type of this resource. Value is always
  2730. // the fixed string games#questContribution.
  2731. Kind string `json:"kind,omitempty"`
  2732. // Value: The value of the contribution.
  2733. Value int64 `json:"value,omitempty,string"`
  2734. // ForceSendFields is a list of field names (e.g. "FormattedValue") to
  2735. // unconditionally include in API requests. By default, fields with
  2736. // empty values are omitted from API requests. However, any non-pointer,
  2737. // non-interface field appearing in ForceSendFields will be sent to the
  2738. // server regardless of whether the field is empty or not. This may be
  2739. // used to include empty fields in Patch requests.
  2740. ForceSendFields []string `json:"-"`
  2741. // NullFields is a list of field names (e.g. "FormattedValue") to
  2742. // include in API requests with the JSON null value. By default, fields
  2743. // with empty values are omitted from API requests. However, any field
  2744. // with an empty value appearing in NullFields will be sent to the
  2745. // server as null. It is an error if a field in this list has a
  2746. // non-empty value. This may be used to include null fields in Patch
  2747. // requests.
  2748. NullFields []string `json:"-"`
  2749. }
  2750. func (s *QuestContribution) MarshalJSON() ([]byte, error) {
  2751. type NoMethod QuestContribution
  2752. raw := NoMethod(*s)
  2753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2754. }
  2755. // QuestCriterion: This is a JSON template for a Quest Criterion
  2756. // resource.
  2757. type QuestCriterion struct {
  2758. // CompletionContribution: The total number of times the associated
  2759. // event must be incremented for the player to complete this quest.
  2760. CompletionContribution *QuestContribution `json:"completionContribution,omitempty"`
  2761. // CurrentContribution: The number of increments the player has made
  2762. // toward the completion count event increments required to complete the
  2763. // quest. This value will not exceed the completion contribution.
  2764. // There will be no currentContribution until the player has accepted
  2765. // the quest.
  2766. CurrentContribution *QuestContribution `json:"currentContribution,omitempty"`
  2767. // EventId: The ID of the event the criterion corresponds to.
  2768. EventId string `json:"eventId,omitempty"`
  2769. // InitialPlayerProgress: The value of the event associated with this
  2770. // quest at the time that the quest was accepted. This value may change
  2771. // if event increments that took place before the start of quest are
  2772. // uploaded after the quest starts.
  2773. // There will be no initialPlayerProgress until the player has accepted
  2774. // the quest.
  2775. InitialPlayerProgress *QuestContribution `json:"initialPlayerProgress,omitempty"`
  2776. // Kind: Uniquely identifies the type of this resource. Value is always
  2777. // the fixed string games#questCriterion.
  2778. Kind string `json:"kind,omitempty"`
  2779. // ForceSendFields is a list of field names (e.g.
  2780. // "CompletionContribution") to unconditionally include in API requests.
  2781. // By default, fields with empty values are omitted from API requests.
  2782. // However, any non-pointer, non-interface field appearing in
  2783. // ForceSendFields will be sent to the server regardless of whether the
  2784. // field is empty or not. This may be used to include empty fields in
  2785. // Patch requests.
  2786. ForceSendFields []string `json:"-"`
  2787. // NullFields is a list of field names (e.g. "CompletionContribution")
  2788. // to include in API requests with the JSON null value. By default,
  2789. // fields with empty values are omitted from API requests. However, any
  2790. // field with an empty value appearing in NullFields will be sent to the
  2791. // server as null. It is an error if a field in this list has a
  2792. // non-empty value. This may be used to include null fields in Patch
  2793. // requests.
  2794. NullFields []string `json:"-"`
  2795. }
  2796. func (s *QuestCriterion) MarshalJSON() ([]byte, error) {
  2797. type NoMethod QuestCriterion
  2798. raw := NoMethod(*s)
  2799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2800. }
  2801. // QuestListResponse: This is a JSON template for a list of quest
  2802. // objects.
  2803. type QuestListResponse struct {
  2804. // Items: The quests.
  2805. Items []*Quest `json:"items,omitempty"`
  2806. // Kind: Uniquely identifies the type of this resource. Value is always
  2807. // the fixed string games#questListResponse.
  2808. Kind string `json:"kind,omitempty"`
  2809. // NextPageToken: Token corresponding to the next page of results.
  2810. NextPageToken string `json:"nextPageToken,omitempty"`
  2811. // ServerResponse contains the HTTP response code and headers from the
  2812. // server.
  2813. googleapi.ServerResponse `json:"-"`
  2814. // ForceSendFields is a list of field names (e.g. "Items") to
  2815. // unconditionally include in API requests. By default, fields with
  2816. // empty values are omitted from API requests. However, any non-pointer,
  2817. // non-interface field appearing in ForceSendFields will be sent to the
  2818. // server regardless of whether the field is empty or not. This may be
  2819. // used to include empty fields in Patch requests.
  2820. ForceSendFields []string `json:"-"`
  2821. // NullFields is a list of field names (e.g. "Items") to include in API
  2822. // requests with the JSON null value. By default, fields with empty
  2823. // values are omitted from API requests. However, any field with an
  2824. // empty value appearing in NullFields will be sent to the server as
  2825. // null. It is an error if a field in this list has a non-empty value.
  2826. // This may be used to include null fields in Patch requests.
  2827. NullFields []string `json:"-"`
  2828. }
  2829. func (s *QuestListResponse) MarshalJSON() ([]byte, error) {
  2830. type NoMethod QuestListResponse
  2831. raw := NoMethod(*s)
  2832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2833. }
  2834. // QuestMilestone: This is a JSON template for a Quest Milestone
  2835. // resource.
  2836. type QuestMilestone struct {
  2837. // CompletionRewardData: The completion reward data of the milestone,
  2838. // represented as a Base64-encoded string. This is a developer-specified
  2839. // binary blob with size between 0 and 2 KB before encoding.
  2840. CompletionRewardData string `json:"completionRewardData,omitempty"`
  2841. // Criteria: The criteria of the milestone.
  2842. Criteria []*QuestCriterion `json:"criteria,omitempty"`
  2843. // Id: The milestone ID.
  2844. Id string `json:"id,omitempty"`
  2845. // Kind: Uniquely identifies the type of this resource. Value is always
  2846. // the fixed string games#questMilestone.
  2847. Kind string `json:"kind,omitempty"`
  2848. // State: The current state of the milestone.
  2849. // Possible values are:
  2850. // - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not
  2851. // yet been claimed.
  2852. // - "CLAIMED" - The milestone is complete and has been claimed.
  2853. // - "NOT_COMPLETED" - The milestone has not yet been completed.
  2854. // - "NOT_STARTED" - The milestone is for a quest that has not yet been
  2855. // accepted.
  2856. State string `json:"state,omitempty"`
  2857. // ForceSendFields is a list of field names (e.g.
  2858. // "CompletionRewardData") to unconditionally include in API requests.
  2859. // By default, fields with empty values are omitted from API requests.
  2860. // However, any non-pointer, non-interface field appearing in
  2861. // ForceSendFields will be sent to the server regardless of whether the
  2862. // field is empty or not. This may be used to include empty fields in
  2863. // Patch requests.
  2864. ForceSendFields []string `json:"-"`
  2865. // NullFields is a list of field names (e.g. "CompletionRewardData") to
  2866. // include in API requests with the JSON null value. By default, fields
  2867. // with empty values are omitted from API requests. However, any field
  2868. // with an empty value appearing in NullFields will be sent to the
  2869. // server as null. It is an error if a field in this list has a
  2870. // non-empty value. This may be used to include null fields in Patch
  2871. // requests.
  2872. NullFields []string `json:"-"`
  2873. }
  2874. func (s *QuestMilestone) MarshalJSON() ([]byte, error) {
  2875. type NoMethod QuestMilestone
  2876. raw := NoMethod(*s)
  2877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2878. }
  2879. // RevisionCheckResponse: This is a JSON template for the result of
  2880. // checking a revision.
  2881. type RevisionCheckResponse struct {
  2882. // ApiVersion: The version of the API this client revision should use
  2883. // when calling API methods.
  2884. ApiVersion string `json:"apiVersion,omitempty"`
  2885. // Kind: Uniquely identifies the type of this resource. Value is always
  2886. // the fixed string games#revisionCheckResponse.
  2887. Kind string `json:"kind,omitempty"`
  2888. // RevisionStatus: The result of the revision check.
  2889. // Possible values are:
  2890. // - "OK" - The revision being used is current.
  2891. // - "DEPRECATED" - There is currently a newer version available, but
  2892. // the revision being used still works.
  2893. // - "INVALID" - The revision being used is not supported in any
  2894. // released version.
  2895. RevisionStatus string `json:"revisionStatus,omitempty"`
  2896. // ServerResponse contains the HTTP response code and headers from the
  2897. // server.
  2898. googleapi.ServerResponse `json:"-"`
  2899. // ForceSendFields is a list of field names (e.g. "ApiVersion") to
  2900. // unconditionally include in API requests. By default, fields with
  2901. // empty values are omitted from API requests. However, any non-pointer,
  2902. // non-interface field appearing in ForceSendFields will be sent to the
  2903. // server regardless of whether the field is empty or not. This may be
  2904. // used to include empty fields in Patch requests.
  2905. ForceSendFields []string `json:"-"`
  2906. // NullFields is a list of field names (e.g. "ApiVersion") to include in
  2907. // API requests with the JSON null value. By default, fields with empty
  2908. // values are omitted from API requests. However, any field with an
  2909. // empty value appearing in NullFields will be sent to the server as
  2910. // null. It is an error if a field in this list has a non-empty value.
  2911. // This may be used to include null fields in Patch requests.
  2912. NullFields []string `json:"-"`
  2913. }
  2914. func (s *RevisionCheckResponse) MarshalJSON() ([]byte, error) {
  2915. type NoMethod RevisionCheckResponse
  2916. raw := NoMethod(*s)
  2917. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2918. }
  2919. // Room: This is a JSON template for a room resource object.
  2920. type Room struct {
  2921. // ApplicationId: The ID of the application being played.
  2922. ApplicationId string `json:"applicationId,omitempty"`
  2923. // AutoMatchingCriteria: Criteria for auto-matching players into this
  2924. // room.
  2925. AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  2926. // AutoMatchingStatus: Auto-matching status for this room. Not set if
  2927. // the room is not currently in the auto-matching queue.
  2928. AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"`
  2929. // CreationDetails: Details about the room creation.
  2930. CreationDetails *RoomModification `json:"creationDetails,omitempty"`
  2931. // Description: This short description is generated by our servers and
  2932. // worded relative to the player requesting the room. It is intended to
  2933. // be displayed when the room is shown in a list (that is, an invitation
  2934. // to a room.)
  2935. Description string `json:"description,omitempty"`
  2936. // InviterId: The ID of the participant that invited the user to the
  2937. // room. Not set if the user was not invited to the room.
  2938. InviterId string `json:"inviterId,omitempty"`
  2939. // Kind: Uniquely identifies the type of this resource. Value is always
  2940. // the fixed string games#room.
  2941. Kind string `json:"kind,omitempty"`
  2942. // LastUpdateDetails: Details about the last update to the room.
  2943. LastUpdateDetails *RoomModification `json:"lastUpdateDetails,omitempty"`
  2944. // Participants: The participants involved in the room, along with their
  2945. // statuses. Includes participants who have left or declined
  2946. // invitations.
  2947. Participants []*RoomParticipant `json:"participants,omitempty"`
  2948. // RoomId: Globally unique ID for a room.
  2949. RoomId string `json:"roomId,omitempty"`
  2950. // RoomStatusVersion: The version of the room status: an increasing
  2951. // counter, used by the client to ignore out-of-order updates to room
  2952. // status.
  2953. RoomStatusVersion int64 `json:"roomStatusVersion,omitempty"`
  2954. // Status: The status of the room.
  2955. // Possible values are:
  2956. // - "ROOM_INVITING" - One or more players have been invited and not
  2957. // responded.
  2958. // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by
  2959. // auto-matching.
  2960. // - "ROOM_CONNECTING" - Players have joined and are connecting to each
  2961. // other (either before or after auto-matching).
  2962. // - "ROOM_ACTIVE" - All players have joined and connected to each
  2963. // other.
  2964. // - "ROOM_DELETED" - The room should no longer be shown on the client.
  2965. // Returned in sync calls when a player joins a room (as a tombstone),
  2966. // or for rooms where all joined participants have left.
  2967. Status string `json:"status,omitempty"`
  2968. // Variant: The variant / mode of the application being played; can be
  2969. // any integer value, or left blank.
  2970. Variant int64 `json:"variant,omitempty"`
  2971. // ServerResponse contains the HTTP response code and headers from the
  2972. // server.
  2973. googleapi.ServerResponse `json:"-"`
  2974. // ForceSendFields is a list of field names (e.g. "ApplicationId") to
  2975. // unconditionally include in API requests. By default, fields with
  2976. // empty values are omitted from API requests. However, any non-pointer,
  2977. // non-interface field appearing in ForceSendFields will be sent to the
  2978. // server regardless of whether the field is empty or not. This may be
  2979. // used to include empty fields in Patch requests.
  2980. ForceSendFields []string `json:"-"`
  2981. // NullFields is a list of field names (e.g. "ApplicationId") to include
  2982. // in API requests with the JSON null value. By default, fields with
  2983. // empty values are omitted from API requests. However, any field with
  2984. // an empty value appearing in NullFields will be sent to the server as
  2985. // null. It is an error if a field in this list has a non-empty value.
  2986. // This may be used to include null fields in Patch requests.
  2987. NullFields []string `json:"-"`
  2988. }
  2989. func (s *Room) MarshalJSON() ([]byte, error) {
  2990. type NoMethod Room
  2991. raw := NoMethod(*s)
  2992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2993. }
  2994. // RoomAutoMatchStatus: This is a JSON template for status of room
  2995. // automatching that is in progress.
  2996. type RoomAutoMatchStatus struct {
  2997. // Kind: Uniquely identifies the type of this resource. Value is always
  2998. // the fixed string games#roomAutoMatchStatus.
  2999. Kind string `json:"kind,omitempty"`
  3000. // WaitEstimateSeconds: An estimate for the amount of time (in seconds)
  3001. // that auto-matching is expected to take to complete.
  3002. WaitEstimateSeconds int64 `json:"waitEstimateSeconds,omitempty"`
  3003. // ForceSendFields is a list of field names (e.g. "Kind") to
  3004. // unconditionally include in API requests. By default, fields with
  3005. // empty values are omitted from API requests. However, any non-pointer,
  3006. // non-interface field appearing in ForceSendFields will be sent to the
  3007. // server regardless of whether the field is empty or not. This may be
  3008. // used to include empty fields in Patch requests.
  3009. ForceSendFields []string `json:"-"`
  3010. // NullFields is a list of field names (e.g. "Kind") to include in API
  3011. // requests with the JSON null value. By default, fields with empty
  3012. // values are omitted from API requests. However, any field with an
  3013. // empty value appearing in NullFields will be sent to the server as
  3014. // null. It is an error if a field in this list has a non-empty value.
  3015. // This may be used to include null fields in Patch requests.
  3016. NullFields []string `json:"-"`
  3017. }
  3018. func (s *RoomAutoMatchStatus) MarshalJSON() ([]byte, error) {
  3019. type NoMethod RoomAutoMatchStatus
  3020. raw := NoMethod(*s)
  3021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3022. }
  3023. // RoomAutoMatchingCriteria: This is a JSON template for a room
  3024. // auto-match criteria object.
  3025. type RoomAutoMatchingCriteria struct {
  3026. // ExclusiveBitmask: A bitmask indicating when auto-matches are valid.
  3027. // When ANDed with other exclusive bitmasks, the result must be zero.
  3028. // Can be used to support exclusive roles within a game.
  3029. ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"`
  3030. // Kind: Uniquely identifies the type of this resource. Value is always
  3031. // the fixed string games#roomAutoMatchingCriteria.
  3032. Kind string `json:"kind,omitempty"`
  3033. // MaxAutoMatchingPlayers: The maximum number of players that should be
  3034. // added to the room by auto-matching.
  3035. MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"`
  3036. // MinAutoMatchingPlayers: The minimum number of players that should be
  3037. // added to the room by auto-matching.
  3038. MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"`
  3039. // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to
  3040. // unconditionally include in API requests. By default, fields with
  3041. // empty values are omitted from API requests. However, any non-pointer,
  3042. // non-interface field appearing in ForceSendFields will be sent to the
  3043. // server regardless of whether the field is empty or not. This may be
  3044. // used to include empty fields in Patch requests.
  3045. ForceSendFields []string `json:"-"`
  3046. // NullFields is a list of field names (e.g. "ExclusiveBitmask") to
  3047. // include in API requests with the JSON null value. By default, fields
  3048. // with empty values are omitted from API requests. However, any field
  3049. // with an empty value appearing in NullFields will be sent to the
  3050. // server as null. It is an error if a field in this list has a
  3051. // non-empty value. This may be used to include null fields in Patch
  3052. // requests.
  3053. NullFields []string `json:"-"`
  3054. }
  3055. func (s *RoomAutoMatchingCriteria) MarshalJSON() ([]byte, error) {
  3056. type NoMethod RoomAutoMatchingCriteria
  3057. raw := NoMethod(*s)
  3058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3059. }
  3060. // RoomClientAddress: This is a JSON template for the client address
  3061. // when setting up a room.
  3062. type RoomClientAddress struct {
  3063. // Kind: Uniquely identifies the type of this resource. Value is always
  3064. // the fixed string games#roomClientAddress.
  3065. Kind string `json:"kind,omitempty"`
  3066. // XmppAddress: The XMPP address of the client on the Google Games XMPP
  3067. // network.
  3068. XmppAddress string `json:"xmppAddress,omitempty"`
  3069. // ForceSendFields is a list of field names (e.g. "Kind") to
  3070. // unconditionally include in API requests. By default, fields with
  3071. // empty values are omitted from API requests. However, any non-pointer,
  3072. // non-interface field appearing in ForceSendFields will be sent to the
  3073. // server regardless of whether the field is empty or not. This may be
  3074. // used to include empty fields in Patch requests.
  3075. ForceSendFields []string `json:"-"`
  3076. // NullFields is a list of field names (e.g. "Kind") to include in API
  3077. // requests with the JSON null value. By default, fields with empty
  3078. // values are omitted from API requests. However, any field with an
  3079. // empty value appearing in NullFields will be sent to the server as
  3080. // null. It is an error if a field in this list has a non-empty value.
  3081. // This may be used to include null fields in Patch requests.
  3082. NullFields []string `json:"-"`
  3083. }
  3084. func (s *RoomClientAddress) MarshalJSON() ([]byte, error) {
  3085. type NoMethod RoomClientAddress
  3086. raw := NoMethod(*s)
  3087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3088. }
  3089. // RoomCreateRequest: This is a JSON template for a room creation
  3090. // request.
  3091. type RoomCreateRequest struct {
  3092. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3093. // room.
  3094. AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3095. // Capabilities: The capabilities that this client supports for realtime
  3096. // communication.
  3097. Capabilities []string `json:"capabilities,omitempty"`
  3098. // ClientAddress: Client address for the player creating the room.
  3099. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  3100. // InvitedPlayerIds: The player IDs to invite to the room.
  3101. InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"`
  3102. // Kind: Uniquely identifies the type of this resource. Value is always
  3103. // the fixed string games#roomCreateRequest.
  3104. Kind string `json:"kind,omitempty"`
  3105. // NetworkDiagnostics: Network diagnostics for the client creating the
  3106. // room.
  3107. NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"`
  3108. // RequestId: A randomly generated numeric ID. This number is used at
  3109. // the server to ensure that the request is handled correctly across
  3110. // retries.
  3111. RequestId int64 `json:"requestId,omitempty,string"`
  3112. // Variant: The variant / mode of the application to be played. This can
  3113. // be any integer value, or left blank. You should use a small number of
  3114. // variants to keep the auto-matching pool as large as possible.
  3115. Variant int64 `json:"variant,omitempty"`
  3116. // ForceSendFields is a list of field names (e.g.
  3117. // "AutoMatchingCriteria") to unconditionally include in API requests.
  3118. // By default, fields with empty values are omitted from API requests.
  3119. // However, any non-pointer, non-interface field appearing in
  3120. // ForceSendFields will be sent to the server regardless of whether the
  3121. // field is empty or not. This may be used to include empty fields in
  3122. // Patch requests.
  3123. ForceSendFields []string `json:"-"`
  3124. // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to
  3125. // include in API requests with the JSON null value. By default, fields
  3126. // with empty values are omitted from API requests. However, any field
  3127. // with an empty value appearing in NullFields will be sent to the
  3128. // server as null. It is an error if a field in this list has a
  3129. // non-empty value. This may be used to include null fields in Patch
  3130. // requests.
  3131. NullFields []string `json:"-"`
  3132. }
  3133. func (s *RoomCreateRequest) MarshalJSON() ([]byte, error) {
  3134. type NoMethod RoomCreateRequest
  3135. raw := NoMethod(*s)
  3136. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3137. }
  3138. // RoomJoinRequest: This is a JSON template for a join room request.
  3139. type RoomJoinRequest struct {
  3140. // Capabilities: The capabilities that this client supports for realtime
  3141. // communication.
  3142. Capabilities []string `json:"capabilities,omitempty"`
  3143. // ClientAddress: Client address for the player joining the room.
  3144. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  3145. // Kind: Uniquely identifies the type of this resource. Value is always
  3146. // the fixed string games#roomJoinRequest.
  3147. Kind string `json:"kind,omitempty"`
  3148. // NetworkDiagnostics: Network diagnostics for the client joining the
  3149. // room.
  3150. NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"`
  3151. // ForceSendFields is a list of field names (e.g. "Capabilities") to
  3152. // unconditionally include in API requests. By default, fields with
  3153. // empty values are omitted from API requests. However, any non-pointer,
  3154. // non-interface field appearing in ForceSendFields will be sent to the
  3155. // server regardless of whether the field is empty or not. This may be
  3156. // used to include empty fields in Patch requests.
  3157. ForceSendFields []string `json:"-"`
  3158. // NullFields is a list of field names (e.g. "Capabilities") to include
  3159. // in API requests with the JSON null value. By default, fields with
  3160. // empty values are omitted from API requests. However, any field with
  3161. // an empty value appearing in NullFields will be sent to the server as
  3162. // null. It is an error if a field in this list has a non-empty value.
  3163. // This may be used to include null fields in Patch requests.
  3164. NullFields []string `json:"-"`
  3165. }
  3166. func (s *RoomJoinRequest) MarshalJSON() ([]byte, error) {
  3167. type NoMethod RoomJoinRequest
  3168. raw := NoMethod(*s)
  3169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3170. }
  3171. // RoomLeaveDiagnostics: This is a JSON template for room leave
  3172. // diagnostics.
  3173. type RoomLeaveDiagnostics struct {
  3174. // AndroidNetworkSubtype: Android network subtype.
  3175. // http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype()
  3176. AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"`
  3177. // AndroidNetworkType: Android network type.
  3178. // http://developer.android.com/reference/android/net/NetworkInfo.html#getType()
  3179. AndroidNetworkType int64 `json:"androidNetworkType,omitempty"`
  3180. // IosNetworkType: iOS network type as defined in Reachability.h.
  3181. IosNetworkType int64 `json:"iosNetworkType,omitempty"`
  3182. // Kind: Uniquely identifies the type of this resource. Value is always
  3183. // the fixed string games#roomLeaveDiagnostics.
  3184. Kind string `json:"kind,omitempty"`
  3185. // NetworkOperatorCode: The MCC+MNC code for the client's network
  3186. // connection. On Android:
  3187. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see:
  3188. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
  3189. NetworkOperatorCode string `json:"networkOperatorCode,omitempty"`
  3190. // NetworkOperatorName: The name of the carrier of the client's network
  3191. // connection. On Android:
  3192. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS:
  3193. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
  3194. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  3195. // PeerSession: Diagnostics about all peer sessions.
  3196. PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"`
  3197. // SocketsUsed: Whether or not sockets were used.
  3198. SocketsUsed bool `json:"socketsUsed,omitempty"`
  3199. // ForceSendFields is a list of field names (e.g.
  3200. // "AndroidNetworkSubtype") to unconditionally include in API requests.
  3201. // By default, fields with empty values are omitted from API requests.
  3202. // However, any non-pointer, non-interface field appearing in
  3203. // ForceSendFields will be sent to the server regardless of whether the
  3204. // field is empty or not. This may be used to include empty fields in
  3205. // Patch requests.
  3206. ForceSendFields []string `json:"-"`
  3207. // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to
  3208. // include in API requests with the JSON null value. By default, fields
  3209. // with empty values are omitted from API requests. However, any field
  3210. // with an empty value appearing in NullFields will be sent to the
  3211. // server as null. It is an error if a field in this list has a
  3212. // non-empty value. This may be used to include null fields in Patch
  3213. // requests.
  3214. NullFields []string `json:"-"`
  3215. }
  3216. func (s *RoomLeaveDiagnostics) MarshalJSON() ([]byte, error) {
  3217. type NoMethod RoomLeaveDiagnostics
  3218. raw := NoMethod(*s)
  3219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3220. }
  3221. // RoomLeaveRequest: This is a JSON template for a leave room request.
  3222. type RoomLeaveRequest struct {
  3223. // Kind: Uniquely identifies the type of this resource. Value is always
  3224. // the fixed string games#roomLeaveRequest.
  3225. Kind string `json:"kind,omitempty"`
  3226. // LeaveDiagnostics: Diagnostics for a player leaving the room.
  3227. LeaveDiagnostics *RoomLeaveDiagnostics `json:"leaveDiagnostics,omitempty"`
  3228. // Reason: Reason for leaving the match.
  3229. // Possible values are:
  3230. // - "PLAYER_LEFT" - The player chose to leave the room..
  3231. // - "GAME_LEFT" - The game chose to remove the player from the room.
  3232. // - "REALTIME_ABANDONED" - The player switched to another application
  3233. // and abandoned the room.
  3234. // - "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to
  3235. // establish a connection to other peer(s).
  3236. // - "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to
  3237. // communicate with the server.
  3238. // - "REALTIME_SERVER_ERROR" - The client received an error response
  3239. // when it tried to communicate with the server.
  3240. // - "REALTIME_TIMEOUT" - The client timed out while waiting for a room.
  3241. //
  3242. // - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without
  3243. // first calling Leave.
  3244. // - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room.
  3245. //
  3246. // - "REALTIME_GAME_CRASHED" - The game crashed.
  3247. // - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed.
  3248. // - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is
  3249. // trying to enter a room.
  3250. // - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying
  3251. // to enter a new room.
  3252. Reason string `json:"reason,omitempty"`
  3253. // ForceSendFields is a list of field names (e.g. "Kind") to
  3254. // unconditionally include in API requests. By default, fields with
  3255. // empty values are omitted from API requests. However, any non-pointer,
  3256. // non-interface field appearing in ForceSendFields will be sent to the
  3257. // server regardless of whether the field is empty or not. This may be
  3258. // used to include empty fields in Patch requests.
  3259. ForceSendFields []string `json:"-"`
  3260. // NullFields is a list of field names (e.g. "Kind") to include in API
  3261. // requests with the JSON null value. By default, fields with empty
  3262. // values are omitted from API requests. However, any field with an
  3263. // empty value appearing in NullFields will be sent to the server as
  3264. // null. It is an error if a field in this list has a non-empty value.
  3265. // This may be used to include null fields in Patch requests.
  3266. NullFields []string `json:"-"`
  3267. }
  3268. func (s *RoomLeaveRequest) MarshalJSON() ([]byte, error) {
  3269. type NoMethod RoomLeaveRequest
  3270. raw := NoMethod(*s)
  3271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3272. }
  3273. // RoomList: This is a JSON template for a list of rooms.
  3274. type RoomList struct {
  3275. // Items: The rooms.
  3276. Items []*Room `json:"items,omitempty"`
  3277. // Kind: Uniquely identifies the type of this resource. Value is always
  3278. // the fixed string games#roomList.
  3279. Kind string `json:"kind,omitempty"`
  3280. // NextPageToken: The pagination token for the next page of results.
  3281. NextPageToken string `json:"nextPageToken,omitempty"`
  3282. // ServerResponse contains the HTTP response code and headers from the
  3283. // server.
  3284. googleapi.ServerResponse `json:"-"`
  3285. // ForceSendFields is a list of field names (e.g. "Items") to
  3286. // unconditionally include in API requests. By default, fields with
  3287. // empty values are omitted from API requests. However, any non-pointer,
  3288. // non-interface field appearing in ForceSendFields will be sent to the
  3289. // server regardless of whether the field is empty or not. This may be
  3290. // used to include empty fields in Patch requests.
  3291. ForceSendFields []string `json:"-"`
  3292. // NullFields is a list of field names (e.g. "Items") to include in API
  3293. // requests with the JSON null value. By default, fields with empty
  3294. // values are omitted from API requests. However, any field with an
  3295. // empty value appearing in NullFields will be sent to the server as
  3296. // null. It is an error if a field in this list has a non-empty value.
  3297. // This may be used to include null fields in Patch requests.
  3298. NullFields []string `json:"-"`
  3299. }
  3300. func (s *RoomList) MarshalJSON() ([]byte, error) {
  3301. type NoMethod RoomList
  3302. raw := NoMethod(*s)
  3303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3304. }
  3305. // RoomModification: This is a JSON template for room modification
  3306. // metadata.
  3307. type RoomModification struct {
  3308. // Kind: Uniquely identifies the type of this resource. Value is always
  3309. // the fixed string games#roomModification.
  3310. Kind string `json:"kind,omitempty"`
  3311. // ModifiedTimestampMillis: The timestamp at which they modified the
  3312. // room, in milliseconds since the epoch in UTC.
  3313. ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"`
  3314. // ParticipantId: The ID of the participant that modified the room.
  3315. ParticipantId string `json:"participantId,omitempty"`
  3316. // ForceSendFields is a list of field names (e.g. "Kind") to
  3317. // unconditionally include in API requests. By default, fields with
  3318. // empty values are omitted from API requests. However, any non-pointer,
  3319. // non-interface field appearing in ForceSendFields will be sent to the
  3320. // server regardless of whether the field is empty or not. This may be
  3321. // used to include empty fields in Patch requests.
  3322. ForceSendFields []string `json:"-"`
  3323. // NullFields is a list of field names (e.g. "Kind") to include in API
  3324. // requests with the JSON null value. By default, fields with empty
  3325. // values are omitted from API requests. However, any field with an
  3326. // empty value appearing in NullFields will be sent to the server as
  3327. // null. It is an error if a field in this list has a non-empty value.
  3328. // This may be used to include null fields in Patch requests.
  3329. NullFields []string `json:"-"`
  3330. }
  3331. func (s *RoomModification) MarshalJSON() ([]byte, error) {
  3332. type NoMethod RoomModification
  3333. raw := NoMethod(*s)
  3334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3335. }
  3336. // RoomP2PStatus: This is a JSON template for an update on the status of
  3337. // a peer in a room.
  3338. type RoomP2PStatus struct {
  3339. // ConnectionSetupLatencyMillis: The amount of time in milliseconds it
  3340. // took to establish connections with this peer.
  3341. ConnectionSetupLatencyMillis int64 `json:"connectionSetupLatencyMillis,omitempty"`
  3342. // Error: The error code in event of a failure.
  3343. // Possible values are:
  3344. // - "P2P_FAILED" - The client failed to establish a P2P connection with
  3345. // the peer.
  3346. // - "PRESENCE_FAILED" - The client failed to register to receive P2P
  3347. // connections.
  3348. // - "RELAY_SERVER_FAILED" - The client received an error when trying to
  3349. // use the relay server to establish a P2P connection with the peer.
  3350. Error string `json:"error,omitempty"`
  3351. // ErrorReason: More detailed diagnostic message returned in event of a
  3352. // failure.
  3353. ErrorReason string `json:"error_reason,omitempty"`
  3354. // Kind: Uniquely identifies the type of this resource. Value is always
  3355. // the fixed string games#roomP2PStatus.
  3356. Kind string `json:"kind,omitempty"`
  3357. // ParticipantId: The ID of the participant.
  3358. ParticipantId string `json:"participantId,omitempty"`
  3359. // Status: The status of the peer in the room.
  3360. // Possible values are:
  3361. // - "CONNECTION_ESTABLISHED" - The client established a P2P connection
  3362. // with the peer.
  3363. // - "CONNECTION_FAILED" - The client failed to establish directed
  3364. // presence with the peer.
  3365. Status string `json:"status,omitempty"`
  3366. // UnreliableRoundtripLatencyMillis: The amount of time in milliseconds
  3367. // it took to send packets back and forth on the unreliable channel with
  3368. // this peer.
  3369. UnreliableRoundtripLatencyMillis int64 `json:"unreliableRoundtripLatencyMillis,omitempty"`
  3370. // ForceSendFields is a list of field names (e.g.
  3371. // "ConnectionSetupLatencyMillis") to unconditionally include in API
  3372. // requests. By default, fields with empty values are omitted from API
  3373. // requests. However, any non-pointer, non-interface field appearing in
  3374. // ForceSendFields will be sent to the server regardless of whether the
  3375. // field is empty or not. This may be used to include empty fields in
  3376. // Patch requests.
  3377. ForceSendFields []string `json:"-"`
  3378. // NullFields is a list of field names (e.g.
  3379. // "ConnectionSetupLatencyMillis") to include in API requests with the
  3380. // JSON null value. By default, fields with empty values are omitted
  3381. // from API requests. However, any field with an empty value appearing
  3382. // in NullFields will be sent to the server as null. It is an error if a
  3383. // field in this list has a non-empty value. This may be used to include
  3384. // null fields in Patch requests.
  3385. NullFields []string `json:"-"`
  3386. }
  3387. func (s *RoomP2PStatus) MarshalJSON() ([]byte, error) {
  3388. type NoMethod RoomP2PStatus
  3389. raw := NoMethod(*s)
  3390. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3391. }
  3392. // RoomP2PStatuses: This is a JSON template for an update on the status
  3393. // of peers in a room.
  3394. type RoomP2PStatuses struct {
  3395. // Kind: Uniquely identifies the type of this resource. Value is always
  3396. // the fixed string games#roomP2PStatuses.
  3397. Kind string `json:"kind,omitempty"`
  3398. // Updates: The updates for the peers.
  3399. Updates []*RoomP2PStatus `json:"updates,omitempty"`
  3400. // ForceSendFields is a list of field names (e.g. "Kind") to
  3401. // unconditionally include in API requests. By default, fields with
  3402. // empty values are omitted from API requests. However, any non-pointer,
  3403. // non-interface field appearing in ForceSendFields will be sent to the
  3404. // server regardless of whether the field is empty or not. This may be
  3405. // used to include empty fields in Patch requests.
  3406. ForceSendFields []string `json:"-"`
  3407. // NullFields is a list of field names (e.g. "Kind") to include in API
  3408. // requests with the JSON null value. By default, fields with empty
  3409. // values are omitted from API requests. However, any field with an
  3410. // empty value appearing in NullFields will be sent to the server as
  3411. // null. It is an error if a field in this list has a non-empty value.
  3412. // This may be used to include null fields in Patch requests.
  3413. NullFields []string `json:"-"`
  3414. }
  3415. func (s *RoomP2PStatuses) MarshalJSON() ([]byte, error) {
  3416. type NoMethod RoomP2PStatuses
  3417. raw := NoMethod(*s)
  3418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3419. }
  3420. // RoomParticipant: This is a JSON template for a participant in a room.
  3421. type RoomParticipant struct {
  3422. // AutoMatched: True if this participant was auto-matched with the
  3423. // requesting player.
  3424. AutoMatched bool `json:"autoMatched,omitempty"`
  3425. // AutoMatchedPlayer: Information about a player that has been
  3426. // anonymously auto-matched against the requesting player. (Either
  3427. // player or autoMatchedPlayer will be set.)
  3428. AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"`
  3429. // Capabilities: The capabilities which can be used when communicating
  3430. // with this participant.
  3431. Capabilities []string `json:"capabilities,omitempty"`
  3432. // ClientAddress: Client address for the participant.
  3433. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  3434. // Connected: True if this participant is in the fully connected set of
  3435. // peers in the room.
  3436. Connected bool `json:"connected,omitempty"`
  3437. // Id: An identifier for the participant in the scope of the room.
  3438. // Cannot be used to identify a player across rooms or in other
  3439. // contexts.
  3440. Id string `json:"id,omitempty"`
  3441. // Kind: Uniquely identifies the type of this resource. Value is always
  3442. // the fixed string games#roomParticipant.
  3443. Kind string `json:"kind,omitempty"`
  3444. // LeaveReason: The reason the participant left the room; populated if
  3445. // the participant status is PARTICIPANT_LEFT.
  3446. // Possible values are:
  3447. // - "PLAYER_LEFT" - The player explicitly chose to leave the room.
  3448. // - "GAME_LEFT" - The game chose to remove the player from the room.
  3449. // - "ABANDONED" - The player switched to another application and
  3450. // abandoned the room.
  3451. // - "PEER_CONNECTION_FAILURE" - The client was unable to establish or
  3452. // maintain a connection to other peer(s) in the room.
  3453. // - "SERVER_ERROR" - The client received an error response when it
  3454. // tried to communicate with the server.
  3455. // - "TIMEOUT" - The client timed out while waiting for players to join
  3456. // and connect.
  3457. // - "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly.
  3458. LeaveReason string `json:"leaveReason,omitempty"`
  3459. // Player: Information about the player. Not populated if this player
  3460. // was anonymously auto-matched against the requesting player. (Either
  3461. // player or autoMatchedPlayer will be set.)
  3462. Player *Player `json:"player,omitempty"`
  3463. // Status: The status of the participant with respect to the
  3464. // room.
  3465. // Possible values are:
  3466. // - "PARTICIPANT_INVITED" - The participant has been invited to join
  3467. // the room, but has not yet responded.
  3468. // - "PARTICIPANT_JOINED" - The participant has joined the room (either
  3469. // after creating it or accepting an invitation.)
  3470. // - "PARTICIPANT_DECLINED" - The participant declined an invitation to
  3471. // join the room.
  3472. // - "PARTICIPANT_LEFT" - The participant joined the room and then left
  3473. // it.
  3474. Status string `json:"status,omitempty"`
  3475. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  3476. // unconditionally include in API requests. By default, fields with
  3477. // empty values are omitted from API requests. However, any non-pointer,
  3478. // non-interface field appearing in ForceSendFields will be sent to the
  3479. // server regardless of whether the field is empty or not. This may be
  3480. // used to include empty fields in Patch requests.
  3481. ForceSendFields []string `json:"-"`
  3482. // NullFields is a list of field names (e.g. "AutoMatched") to include
  3483. // in API requests with the JSON null value. By default, fields with
  3484. // empty values are omitted from API requests. However, any field with
  3485. // an empty value appearing in NullFields will be sent to the server as
  3486. // null. It is an error if a field in this list has a non-empty value.
  3487. // This may be used to include null fields in Patch requests.
  3488. NullFields []string `json:"-"`
  3489. }
  3490. func (s *RoomParticipant) MarshalJSON() ([]byte, error) {
  3491. type NoMethod RoomParticipant
  3492. raw := NoMethod(*s)
  3493. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3494. }
  3495. // RoomStatus: This is a JSON template for the status of a room that the
  3496. // player has joined.
  3497. type RoomStatus struct {
  3498. // AutoMatchingStatus: Auto-matching status for this room. Not set if
  3499. // the room is not currently in the automatching queue.
  3500. AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"`
  3501. // Kind: Uniquely identifies the type of this resource. Value is always
  3502. // the fixed string games#roomStatus.
  3503. Kind string `json:"kind,omitempty"`
  3504. // Participants: The participants involved in the room, along with their
  3505. // statuses. Includes participants who have left or declined
  3506. // invitations.
  3507. Participants []*RoomParticipant `json:"participants,omitempty"`
  3508. // RoomId: Globally unique ID for a room.
  3509. RoomId string `json:"roomId,omitempty"`
  3510. // Status: The status of the room.
  3511. // Possible values are:
  3512. // - "ROOM_INVITING" - One or more players have been invited and not
  3513. // responded.
  3514. // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by
  3515. // auto-matching.
  3516. // - "ROOM_CONNECTING" - Players have joined are connecting to each
  3517. // other (either before or after auto-matching).
  3518. // - "ROOM_ACTIVE" - All players have joined and connected to each
  3519. // other.
  3520. // - "ROOM_DELETED" - All joined players have left.
  3521. Status string `json:"status,omitempty"`
  3522. // StatusVersion: The version of the status for the room: an increasing
  3523. // counter, used by the client to ignore out-of-order updates to room
  3524. // status.
  3525. StatusVersion int64 `json:"statusVersion,omitempty"`
  3526. // ServerResponse contains the HTTP response code and headers from the
  3527. // server.
  3528. googleapi.ServerResponse `json:"-"`
  3529. // ForceSendFields is a list of field names (e.g. "AutoMatchingStatus")
  3530. // to unconditionally include in API requests. By default, fields with
  3531. // empty values are omitted from API requests. However, any non-pointer,
  3532. // non-interface field appearing in ForceSendFields will be sent to the
  3533. // server regardless of whether the field is empty or not. This may be
  3534. // used to include empty fields in Patch requests.
  3535. ForceSendFields []string `json:"-"`
  3536. // NullFields is a list of field names (e.g. "AutoMatchingStatus") to
  3537. // include in API requests with the JSON null value. By default, fields
  3538. // with empty values are omitted from API requests. However, any field
  3539. // with an empty value appearing in NullFields will be sent to the
  3540. // server as null. It is an error if a field in this list has a
  3541. // non-empty value. This may be used to include null fields in Patch
  3542. // requests.
  3543. NullFields []string `json:"-"`
  3544. }
  3545. func (s *RoomStatus) MarshalJSON() ([]byte, error) {
  3546. type NoMethod RoomStatus
  3547. raw := NoMethod(*s)
  3548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3549. }
  3550. // ScoreSubmission: This is a JSON template for a request to submit a
  3551. // score to leaderboards.
  3552. type ScoreSubmission struct {
  3553. // Kind: Uniquely identifies the type of this resource. Value is always
  3554. // the fixed string games#scoreSubmission.
  3555. Kind string `json:"kind,omitempty"`
  3556. // LeaderboardId: The leaderboard this score is being submitted to.
  3557. LeaderboardId string `json:"leaderboardId,omitempty"`
  3558. // Score: The new score being submitted.
  3559. Score int64 `json:"score,omitempty,string"`
  3560. // ScoreTag: Additional information about this score. Values will
  3561. // contain no more than 64 URI-safe characters as defined by section 2.3
  3562. // of RFC 3986.
  3563. ScoreTag string `json:"scoreTag,omitempty"`
  3564. // Signature: Signature Values will contain URI-safe characters as
  3565. // defined by section 2.3 of RFC 3986.
  3566. Signature string `json:"signature,omitempty"`
  3567. // ForceSendFields is a list of field names (e.g. "Kind") to
  3568. // unconditionally include in API requests. By default, fields with
  3569. // empty values are omitted from API requests. However, any non-pointer,
  3570. // non-interface field appearing in ForceSendFields will be sent to the
  3571. // server regardless of whether the field is empty or not. This may be
  3572. // used to include empty fields in Patch requests.
  3573. ForceSendFields []string `json:"-"`
  3574. // NullFields is a list of field names (e.g. "Kind") to include in API
  3575. // requests with the JSON null value. By default, fields with empty
  3576. // values are omitted from API requests. However, any field with an
  3577. // empty value appearing in NullFields will be sent to the server as
  3578. // null. It is an error if a field in this list has a non-empty value.
  3579. // This may be used to include null fields in Patch requests.
  3580. NullFields []string `json:"-"`
  3581. }
  3582. func (s *ScoreSubmission) MarshalJSON() ([]byte, error) {
  3583. type NoMethod ScoreSubmission
  3584. raw := NoMethod(*s)
  3585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3586. }
  3587. // Snapshot: This is a JSON template for an snapshot object.
  3588. type Snapshot struct {
  3589. // CoverImage: The cover image of this snapshot. May be absent if there
  3590. // is no image.
  3591. CoverImage *SnapshotImage `json:"coverImage,omitempty"`
  3592. // Description: The description of this snapshot.
  3593. Description string `json:"description,omitempty"`
  3594. // DriveId: The ID of the file underlying this snapshot in the Drive
  3595. // API. Only present if the snapshot is a view on a Drive file and the
  3596. // file is owned by the caller.
  3597. DriveId string `json:"driveId,omitempty"`
  3598. // DurationMillis: The duration associated with this snapshot, in
  3599. // millis.
  3600. DurationMillis int64 `json:"durationMillis,omitempty,string"`
  3601. // Id: The ID of the snapshot.
  3602. Id string `json:"id,omitempty"`
  3603. // Kind: Uniquely identifies the type of this resource. Value is always
  3604. // the fixed string games#snapshot.
  3605. Kind string `json:"kind,omitempty"`
  3606. // LastModifiedMillis: The timestamp (in millis since Unix epoch) of the
  3607. // last modification to this snapshot.
  3608. LastModifiedMillis int64 `json:"lastModifiedMillis,omitempty,string"`
  3609. // ProgressValue: The progress value (64-bit integer set by developer)
  3610. // associated with this snapshot.
  3611. ProgressValue int64 `json:"progressValue,omitempty,string"`
  3612. // Title: The title of this snapshot.
  3613. Title string `json:"title,omitempty"`
  3614. // Type: The type of this snapshot.
  3615. // Possible values are:
  3616. // - "SAVE_GAME" - A snapshot representing a save game.
  3617. Type string `json:"type,omitempty"`
  3618. // UniqueName: The unique name provided when the snapshot was created.
  3619. UniqueName string `json:"uniqueName,omitempty"`
  3620. // ServerResponse contains the HTTP response code and headers from the
  3621. // server.
  3622. googleapi.ServerResponse `json:"-"`
  3623. // ForceSendFields is a list of field names (e.g. "CoverImage") to
  3624. // unconditionally include in API requests. By default, fields with
  3625. // empty values are omitted from API requests. However, any non-pointer,
  3626. // non-interface field appearing in ForceSendFields will be sent to the
  3627. // server regardless of whether the field is empty or not. This may be
  3628. // used to include empty fields in Patch requests.
  3629. ForceSendFields []string `json:"-"`
  3630. // NullFields is a list of field names (e.g. "CoverImage") to include in
  3631. // API requests with the JSON null value. By default, fields with empty
  3632. // values are omitted from API requests. However, any field with an
  3633. // empty value appearing in NullFields will be sent to the server as
  3634. // null. It is an error if a field in this list has a non-empty value.
  3635. // This may be used to include null fields in Patch requests.
  3636. NullFields []string `json:"-"`
  3637. }
  3638. func (s *Snapshot) MarshalJSON() ([]byte, error) {
  3639. type NoMethod Snapshot
  3640. raw := NoMethod(*s)
  3641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3642. }
  3643. // SnapshotImage: This is a JSON template for an image of a snapshot.
  3644. type SnapshotImage struct {
  3645. // Height: The height of the image.
  3646. Height int64 `json:"height,omitempty"`
  3647. // Kind: Uniquely identifies the type of this resource. Value is always
  3648. // the fixed string games#snapshotImage.
  3649. Kind string `json:"kind,omitempty"`
  3650. // MimeType: The MIME type of the image.
  3651. MimeType string `json:"mime_type,omitempty"`
  3652. // Url: The URL of the image. This URL may be invalidated at any time
  3653. // and should not be cached.
  3654. Url string `json:"url,omitempty"`
  3655. // Width: The width of the image.
  3656. Width int64 `json:"width,omitempty"`
  3657. // ForceSendFields is a list of field names (e.g. "Height") to
  3658. // unconditionally include in API requests. By default, fields with
  3659. // empty values are omitted from API requests. However, any non-pointer,
  3660. // non-interface field appearing in ForceSendFields will be sent to the
  3661. // server regardless of whether the field is empty or not. This may be
  3662. // used to include empty fields in Patch requests.
  3663. ForceSendFields []string `json:"-"`
  3664. // NullFields is a list of field names (e.g. "Height") to include in API
  3665. // requests with the JSON null value. By default, fields with empty
  3666. // values are omitted from API requests. However, any field with an
  3667. // empty value appearing in NullFields will be sent to the server as
  3668. // null. It is an error if a field in this list has a non-empty value.
  3669. // This may be used to include null fields in Patch requests.
  3670. NullFields []string `json:"-"`
  3671. }
  3672. func (s *SnapshotImage) MarshalJSON() ([]byte, error) {
  3673. type NoMethod SnapshotImage
  3674. raw := NoMethod(*s)
  3675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3676. }
  3677. // SnapshotListResponse: This is a JSON template for a list of snapshot
  3678. // objects.
  3679. type SnapshotListResponse struct {
  3680. // Items: The snapshots.
  3681. Items []*Snapshot `json:"items,omitempty"`
  3682. // Kind: Uniquely identifies the type of this resource. Value is always
  3683. // the fixed string games#snapshotListResponse.
  3684. Kind string `json:"kind,omitempty"`
  3685. // NextPageToken: Token corresponding to the next page of results. If
  3686. // there are no more results, the token is omitted.
  3687. NextPageToken string `json:"nextPageToken,omitempty"`
  3688. // ServerResponse contains the HTTP response code and headers from the
  3689. // server.
  3690. googleapi.ServerResponse `json:"-"`
  3691. // ForceSendFields is a list of field names (e.g. "Items") to
  3692. // unconditionally include in API requests. By default, fields with
  3693. // empty values are omitted from API requests. However, any non-pointer,
  3694. // non-interface field appearing in ForceSendFields will be sent to the
  3695. // server regardless of whether the field is empty or not. This may be
  3696. // used to include empty fields in Patch requests.
  3697. ForceSendFields []string `json:"-"`
  3698. // NullFields is a list of field names (e.g. "Items") to include in API
  3699. // requests with the JSON null value. By default, fields with empty
  3700. // values are omitted from API requests. However, any field with an
  3701. // empty value appearing in NullFields will be sent to the server as
  3702. // null. It is an error if a field in this list has a non-empty value.
  3703. // This may be used to include null fields in Patch requests.
  3704. NullFields []string `json:"-"`
  3705. }
  3706. func (s *SnapshotListResponse) MarshalJSON() ([]byte, error) {
  3707. type NoMethod SnapshotListResponse
  3708. raw := NoMethod(*s)
  3709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3710. }
  3711. // TurnBasedAutoMatchingCriteria: This is a JSON template for an
  3712. // turn-based auto-match criteria object.
  3713. type TurnBasedAutoMatchingCriteria struct {
  3714. // ExclusiveBitmask: A bitmask indicating when auto-matches are valid.
  3715. // When ANDed with other exclusive bitmasks, the result must be zero.
  3716. // Can be used to support exclusive roles within a game.
  3717. ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"`
  3718. // Kind: Uniquely identifies the type of this resource. Value is always
  3719. // the fixed string games#turnBasedAutoMatchingCriteria.
  3720. Kind string `json:"kind,omitempty"`
  3721. // MaxAutoMatchingPlayers: The maximum number of players that should be
  3722. // added to the match by auto-matching.
  3723. MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"`
  3724. // MinAutoMatchingPlayers: The minimum number of players that should be
  3725. // added to the match by auto-matching.
  3726. MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"`
  3727. // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to
  3728. // unconditionally include in API requests. By default, fields with
  3729. // empty values are omitted from API requests. However, any non-pointer,
  3730. // non-interface field appearing in ForceSendFields will be sent to the
  3731. // server regardless of whether the field is empty or not. This may be
  3732. // used to include empty fields in Patch requests.
  3733. ForceSendFields []string `json:"-"`
  3734. // NullFields is a list of field names (e.g. "ExclusiveBitmask") to
  3735. // include in API requests with the JSON null value. By default, fields
  3736. // with empty values are omitted from API requests. However, any field
  3737. // with an empty value appearing in NullFields will be sent to the
  3738. // server as null. It is an error if a field in this list has a
  3739. // non-empty value. This may be used to include null fields in Patch
  3740. // requests.
  3741. NullFields []string `json:"-"`
  3742. }
  3743. func (s *TurnBasedAutoMatchingCriteria) MarshalJSON() ([]byte, error) {
  3744. type NoMethod TurnBasedAutoMatchingCriteria
  3745. raw := NoMethod(*s)
  3746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3747. }
  3748. // TurnBasedMatch: This is a JSON template for a turn-based match
  3749. // resource object.
  3750. type TurnBasedMatch struct {
  3751. // ApplicationId: The ID of the application being played.
  3752. ApplicationId string `json:"applicationId,omitempty"`
  3753. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3754. // match.
  3755. AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3756. // CreationDetails: Details about the match creation.
  3757. CreationDetails *TurnBasedMatchModification `json:"creationDetails,omitempty"`
  3758. // Data: The data / game state for this match.
  3759. Data *TurnBasedMatchData `json:"data,omitempty"`
  3760. // Description: This short description is generated by our servers based
  3761. // on turn state and is localized and worded relative to the player
  3762. // requesting the match. It is intended to be displayed when the match
  3763. // is shown in a list.
  3764. Description string `json:"description,omitempty"`
  3765. // InviterId: The ID of the participant that invited the user to the
  3766. // match. Not set if the user was not invited to the match.
  3767. InviterId string `json:"inviterId,omitempty"`
  3768. // Kind: Uniquely identifies the type of this resource. Value is always
  3769. // the fixed string games#turnBasedMatch.
  3770. Kind string `json:"kind,omitempty"`
  3771. // LastUpdateDetails: Details about the last update to the match.
  3772. LastUpdateDetails *TurnBasedMatchModification `json:"lastUpdateDetails,omitempty"`
  3773. // MatchId: Globally unique ID for a turn-based match.
  3774. MatchId string `json:"matchId,omitempty"`
  3775. // MatchNumber: The number of the match in a chain of rematches. Will be
  3776. // set to 1 for the first match and incremented by 1 for each rematch.
  3777. MatchNumber int64 `json:"matchNumber,omitempty"`
  3778. // MatchVersion: The version of this match: an increasing counter, used
  3779. // to avoid out-of-date updates to the match.
  3780. MatchVersion int64 `json:"matchVersion,omitempty"`
  3781. // Participants: The participants involved in the match, along with
  3782. // their statuses. Includes participants who have left or declined
  3783. // invitations.
  3784. Participants []*TurnBasedMatchParticipant `json:"participants,omitempty"`
  3785. // PendingParticipantId: The ID of the participant that is taking a
  3786. // turn.
  3787. PendingParticipantId string `json:"pendingParticipantId,omitempty"`
  3788. // PreviousMatchData: The data / game state for the previous match; set
  3789. // for the first turn of rematches only.
  3790. PreviousMatchData *TurnBasedMatchData `json:"previousMatchData,omitempty"`
  3791. // RematchId: The ID of a rematch of this match. Only set for completed
  3792. // matches that have been rematched.
  3793. RematchId string `json:"rematchId,omitempty"`
  3794. // Results: The results reported for this match.
  3795. Results []*ParticipantResult `json:"results,omitempty"`
  3796. // Status: The status of the match.
  3797. // Possible values are:
  3798. // - "MATCH_AUTO_MATCHING" - One or more slots need to be filled by
  3799. // auto-matching; the match cannot be established until they are filled.
  3800. //
  3801. // - "MATCH_ACTIVE" - The match has started.
  3802. // - "MATCH_COMPLETE" - The match has finished.
  3803. // - "MATCH_CANCELED" - The match was canceled.
  3804. // - "MATCH_EXPIRED" - The match expired due to inactivity.
  3805. // - "MATCH_DELETED" - The match should no longer be shown on the
  3806. // client. Returned only for tombstones for matches when sync is called.
  3807. Status string `json:"status,omitempty"`
  3808. // UserMatchStatus: The status of the current user in the match. Derived
  3809. // from the match type, match status, the user's participant status, and
  3810. // the pending participant for the match.
  3811. // Possible values are:
  3812. // - "USER_INVITED" - The user has been invited to join the match and
  3813. // has not responded yet.
  3814. // - "USER_AWAITING_TURN" - The user is waiting for their turn.
  3815. // - "USER_TURN" - The user has an action to take in the match.
  3816. // - "USER_MATCH_COMPLETED" - The match has ended (it is completed,
  3817. // canceled, or expired.)
  3818. UserMatchStatus string `json:"userMatchStatus,omitempty"`
  3819. // Variant: The variant / mode of the application being played; can be
  3820. // any integer value, or left blank.
  3821. Variant int64 `json:"variant,omitempty"`
  3822. // WithParticipantId: The ID of another participant in the match that
  3823. // can be used when describing the participants the user is playing
  3824. // with.
  3825. WithParticipantId string `json:"withParticipantId,omitempty"`
  3826. // ServerResponse contains the HTTP response code and headers from the
  3827. // server.
  3828. googleapi.ServerResponse `json:"-"`
  3829. // ForceSendFields is a list of field names (e.g. "ApplicationId") to
  3830. // unconditionally include in API requests. By default, fields with
  3831. // empty values are omitted from API requests. However, any non-pointer,
  3832. // non-interface field appearing in ForceSendFields will be sent to the
  3833. // server regardless of whether the field is empty or not. This may be
  3834. // used to include empty fields in Patch requests.
  3835. ForceSendFields []string `json:"-"`
  3836. // NullFields is a list of field names (e.g. "ApplicationId") to include
  3837. // in API requests with the JSON null value. By default, fields with
  3838. // empty values are omitted from API requests. However, any field with
  3839. // an empty value appearing in NullFields will be sent to the server as
  3840. // null. It is an error if a field in this list has a non-empty value.
  3841. // This may be used to include null fields in Patch requests.
  3842. NullFields []string `json:"-"`
  3843. }
  3844. func (s *TurnBasedMatch) MarshalJSON() ([]byte, error) {
  3845. type NoMethod TurnBasedMatch
  3846. raw := NoMethod(*s)
  3847. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3848. }
  3849. // TurnBasedMatchCreateRequest: This is a JSON template for a turn-based
  3850. // match creation request.
  3851. type TurnBasedMatchCreateRequest struct {
  3852. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3853. // match.
  3854. AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3855. // InvitedPlayerIds: The player ids to invite to the match.
  3856. InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"`
  3857. // Kind: Uniquely identifies the type of this resource. Value is always
  3858. // the fixed string games#turnBasedMatchCreateRequest.
  3859. Kind string `json:"kind,omitempty"`
  3860. // RequestId: A randomly generated numeric ID. This number is used at
  3861. // the server to ensure that the request is handled correctly across
  3862. // retries.
  3863. RequestId int64 `json:"requestId,omitempty,string"`
  3864. // Variant: The variant / mode of the application to be played. This can
  3865. // be any integer value, or left blank. You should use a small number of
  3866. // variants to keep the auto-matching pool as large as possible.
  3867. Variant int64 `json:"variant,omitempty"`
  3868. // ForceSendFields is a list of field names (e.g.
  3869. // "AutoMatchingCriteria") to unconditionally include in API requests.
  3870. // By default, fields with empty values are omitted from API requests.
  3871. // However, any non-pointer, non-interface field appearing in
  3872. // ForceSendFields will be sent to the server regardless of whether the
  3873. // field is empty or not. This may be used to include empty fields in
  3874. // Patch requests.
  3875. ForceSendFields []string `json:"-"`
  3876. // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to
  3877. // include in API requests with the JSON null value. By default, fields
  3878. // with empty values are omitted from API requests. However, any field
  3879. // with an empty value appearing in NullFields will be sent to the
  3880. // server as null. It is an error if a field in this list has a
  3881. // non-empty value. This may be used to include null fields in Patch
  3882. // requests.
  3883. NullFields []string `json:"-"`
  3884. }
  3885. func (s *TurnBasedMatchCreateRequest) MarshalJSON() ([]byte, error) {
  3886. type NoMethod TurnBasedMatchCreateRequest
  3887. raw := NoMethod(*s)
  3888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3889. }
  3890. // TurnBasedMatchData: This is a JSON template for a turn-based match
  3891. // data object.
  3892. type TurnBasedMatchData struct {
  3893. // Data: The byte representation of the data (limited to 128 kB), as a
  3894. // Base64-encoded string with the URL_SAFE encoding option.
  3895. Data string `json:"data,omitempty"`
  3896. // DataAvailable: True if this match has data available but it wasn't
  3897. // returned in a list response; fetching the match individually will
  3898. // retrieve this data.
  3899. DataAvailable bool `json:"dataAvailable,omitempty"`
  3900. // Kind: Uniquely identifies the type of this resource. Value is always
  3901. // the fixed string games#turnBasedMatchData.
  3902. Kind string `json:"kind,omitempty"`
  3903. // ForceSendFields is a list of field names (e.g. "Data") to
  3904. // unconditionally include in API requests. By default, fields with
  3905. // empty values are omitted from API requests. However, any non-pointer,
  3906. // non-interface field appearing in ForceSendFields will be sent to the
  3907. // server regardless of whether the field is empty or not. This may be
  3908. // used to include empty fields in Patch requests.
  3909. ForceSendFields []string `json:"-"`
  3910. // NullFields is a list of field names (e.g. "Data") to include in API
  3911. // requests with the JSON null value. By default, fields with empty
  3912. // values are omitted from API requests. However, any field with an
  3913. // empty value appearing in NullFields will be sent to the server as
  3914. // null. It is an error if a field in this list has a non-empty value.
  3915. // This may be used to include null fields in Patch requests.
  3916. NullFields []string `json:"-"`
  3917. }
  3918. func (s *TurnBasedMatchData) MarshalJSON() ([]byte, error) {
  3919. type NoMethod TurnBasedMatchData
  3920. raw := NoMethod(*s)
  3921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3922. }
  3923. // TurnBasedMatchDataRequest: This is a JSON template for sending a
  3924. // turn-based match data object.
  3925. type TurnBasedMatchDataRequest struct {
  3926. // Data: The byte representation of the data (limited to 128 kB), as a
  3927. // Base64-encoded string with the URL_SAFE encoding option.
  3928. Data string `json:"data,omitempty"`
  3929. // Kind: Uniquely identifies the type of this resource. Value is always
  3930. // the fixed string games#turnBasedMatchDataRequest.
  3931. Kind string `json:"kind,omitempty"`
  3932. // ForceSendFields is a list of field names (e.g. "Data") to
  3933. // unconditionally include in API requests. By default, fields with
  3934. // empty values are omitted from API requests. However, any non-pointer,
  3935. // non-interface field appearing in ForceSendFields will be sent to the
  3936. // server regardless of whether the field is empty or not. This may be
  3937. // used to include empty fields in Patch requests.
  3938. ForceSendFields []string `json:"-"`
  3939. // NullFields is a list of field names (e.g. "Data") to include in API
  3940. // requests with the JSON null value. By default, fields with empty
  3941. // values are omitted from API requests. However, any field with an
  3942. // empty value appearing in NullFields will be sent to the server as
  3943. // null. It is an error if a field in this list has a non-empty value.
  3944. // This may be used to include null fields in Patch requests.
  3945. NullFields []string `json:"-"`
  3946. }
  3947. func (s *TurnBasedMatchDataRequest) MarshalJSON() ([]byte, error) {
  3948. type NoMethod TurnBasedMatchDataRequest
  3949. raw := NoMethod(*s)
  3950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3951. }
  3952. // TurnBasedMatchList: This is a JSON template for a list of turn-based
  3953. // matches.
  3954. type TurnBasedMatchList struct {
  3955. // Items: The matches.
  3956. Items []*TurnBasedMatch `json:"items,omitempty"`
  3957. // Kind: Uniquely identifies the type of this resource. Value is always
  3958. // the fixed string games#turnBasedMatchList.
  3959. Kind string `json:"kind,omitempty"`
  3960. // NextPageToken: The pagination token for the next page of results.
  3961. NextPageToken string `json:"nextPageToken,omitempty"`
  3962. // ServerResponse contains the HTTP response code and headers from the
  3963. // server.
  3964. googleapi.ServerResponse `json:"-"`
  3965. // ForceSendFields is a list of field names (e.g. "Items") to
  3966. // unconditionally include in API requests. By default, fields with
  3967. // empty values are omitted from API requests. However, any non-pointer,
  3968. // non-interface field appearing in ForceSendFields will be sent to the
  3969. // server regardless of whether the field is empty or not. This may be
  3970. // used to include empty fields in Patch requests.
  3971. ForceSendFields []string `json:"-"`
  3972. // NullFields is a list of field names (e.g. "Items") to include in API
  3973. // requests with the JSON null value. By default, fields with empty
  3974. // values are omitted from API requests. However, any field with an
  3975. // empty value appearing in NullFields will be sent to the server as
  3976. // null. It is an error if a field in this list has a non-empty value.
  3977. // This may be used to include null fields in Patch requests.
  3978. NullFields []string `json:"-"`
  3979. }
  3980. func (s *TurnBasedMatchList) MarshalJSON() ([]byte, error) {
  3981. type NoMethod TurnBasedMatchList
  3982. raw := NoMethod(*s)
  3983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3984. }
  3985. // TurnBasedMatchModification: This is a JSON template for turn-based
  3986. // match modification metadata.
  3987. type TurnBasedMatchModification struct {
  3988. // Kind: Uniquely identifies the type of this resource. Value is always
  3989. // the fixed string games#turnBasedMatchModification.
  3990. Kind string `json:"kind,omitempty"`
  3991. // ModifiedTimestampMillis: The timestamp at which they modified the
  3992. // match, in milliseconds since the epoch in UTC.
  3993. ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"`
  3994. // ParticipantId: The ID of the participant that modified the match.
  3995. ParticipantId string `json:"participantId,omitempty"`
  3996. // ForceSendFields is a list of field names (e.g. "Kind") to
  3997. // unconditionally include in API requests. By default, fields with
  3998. // empty values are omitted from API requests. However, any non-pointer,
  3999. // non-interface field appearing in ForceSendFields will be sent to the
  4000. // server regardless of whether the field is empty or not. This may be
  4001. // used to include empty fields in Patch requests.
  4002. ForceSendFields []string `json:"-"`
  4003. // NullFields is a list of field names (e.g. "Kind") to include in API
  4004. // requests with the JSON null value. By default, fields with empty
  4005. // values are omitted from API requests. However, any field with an
  4006. // empty value appearing in NullFields will be sent to the server as
  4007. // null. It is an error if a field in this list has a non-empty value.
  4008. // This may be used to include null fields in Patch requests.
  4009. NullFields []string `json:"-"`
  4010. }
  4011. func (s *TurnBasedMatchModification) MarshalJSON() ([]byte, error) {
  4012. type NoMethod TurnBasedMatchModification
  4013. raw := NoMethod(*s)
  4014. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4015. }
  4016. // TurnBasedMatchParticipant: This is a JSON template for a participant
  4017. // in a turn-based match.
  4018. type TurnBasedMatchParticipant struct {
  4019. // AutoMatched: True if this participant was auto-matched with the
  4020. // requesting player.
  4021. AutoMatched bool `json:"autoMatched,omitempty"`
  4022. // AutoMatchedPlayer: Information about a player that has been
  4023. // anonymously auto-matched against the requesting player. (Either
  4024. // player or autoMatchedPlayer will be set.)
  4025. AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"`
  4026. // Id: An identifier for the participant in the scope of the match.
  4027. // Cannot be used to identify a player across matches or in other
  4028. // contexts.
  4029. Id string `json:"id,omitempty"`
  4030. // Kind: Uniquely identifies the type of this resource. Value is always
  4031. // the fixed string games#turnBasedMatchParticipant.
  4032. Kind string `json:"kind,omitempty"`
  4033. // Player: Information about the player. Not populated if this player
  4034. // was anonymously auto-matched against the requesting player. (Either
  4035. // player or autoMatchedPlayer will be set.)
  4036. Player *Player `json:"player,omitempty"`
  4037. // Status: The status of the participant with respect to the
  4038. // match.
  4039. // Possible values are:
  4040. // - "PARTICIPANT_NOT_INVITED_YET" - The participant is slated to be
  4041. // invited to the match, but the invitation has not been sent; the
  4042. // invite will be sent when it becomes their turn.
  4043. // - "PARTICIPANT_INVITED" - The participant has been invited to join
  4044. // the match, but has not yet responded.
  4045. // - "PARTICIPANT_JOINED" - The participant has joined the match (either
  4046. // after creating it or accepting an invitation.)
  4047. // - "PARTICIPANT_DECLINED" - The participant declined an invitation to
  4048. // join the match.
  4049. // - "PARTICIPANT_LEFT" - The participant joined the match and then left
  4050. // it.
  4051. // - "PARTICIPANT_FINISHED" - The participant finished playing in the
  4052. // match.
  4053. // - "PARTICIPANT_UNRESPONSIVE" - The participant did not take their
  4054. // turn in the allotted time.
  4055. Status string `json:"status,omitempty"`
  4056. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  4057. // unconditionally include in API requests. By default, fields with
  4058. // empty values are omitted from API requests. However, any non-pointer,
  4059. // non-interface field appearing in ForceSendFields will be sent to the
  4060. // server regardless of whether the field is empty or not. This may be
  4061. // used to include empty fields in Patch requests.
  4062. ForceSendFields []string `json:"-"`
  4063. // NullFields is a list of field names (e.g. "AutoMatched") to include
  4064. // in API requests with the JSON null value. By default, fields with
  4065. // empty values are omitted from API requests. However, any field with
  4066. // an empty value appearing in NullFields will be sent to the server as
  4067. // null. It is an error if a field in this list has a non-empty value.
  4068. // This may be used to include null fields in Patch requests.
  4069. NullFields []string `json:"-"`
  4070. }
  4071. func (s *TurnBasedMatchParticipant) MarshalJSON() ([]byte, error) {
  4072. type NoMethod TurnBasedMatchParticipant
  4073. raw := NoMethod(*s)
  4074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4075. }
  4076. // TurnBasedMatchRematch: This is a JSON template for a rematch
  4077. // response.
  4078. type TurnBasedMatchRematch struct {
  4079. // Kind: Uniquely identifies the type of this resource. Value is always
  4080. // the fixed string games#turnBasedMatchRematch.
  4081. Kind string `json:"kind,omitempty"`
  4082. // PreviousMatch: The old match that the rematch was created from; will
  4083. // be updated such that the rematchId field will point at the new match.
  4084. PreviousMatch *TurnBasedMatch `json:"previousMatch,omitempty"`
  4085. // Rematch: The newly created match; a rematch of the old match with the
  4086. // same participants.
  4087. Rematch *TurnBasedMatch `json:"rematch,omitempty"`
  4088. // ServerResponse contains the HTTP response code and headers from the
  4089. // server.
  4090. googleapi.ServerResponse `json:"-"`
  4091. // ForceSendFields is a list of field names (e.g. "Kind") to
  4092. // unconditionally include in API requests. By default, fields with
  4093. // empty values are omitted from API requests. However, any non-pointer,
  4094. // non-interface field appearing in ForceSendFields will be sent to the
  4095. // server regardless of whether the field is empty or not. This may be
  4096. // used to include empty fields in Patch requests.
  4097. ForceSendFields []string `json:"-"`
  4098. // NullFields is a list of field names (e.g. "Kind") to include in API
  4099. // requests with the JSON null value. By default, fields with empty
  4100. // values are omitted from API requests. However, any field with an
  4101. // empty value appearing in NullFields will be sent to the server as
  4102. // null. It is an error if a field in this list has a non-empty value.
  4103. // This may be used to include null fields in Patch requests.
  4104. NullFields []string `json:"-"`
  4105. }
  4106. func (s *TurnBasedMatchRematch) MarshalJSON() ([]byte, error) {
  4107. type NoMethod TurnBasedMatchRematch
  4108. raw := NoMethod(*s)
  4109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4110. }
  4111. // TurnBasedMatchResults: This is a JSON template for a turn-based match
  4112. // results object.
  4113. type TurnBasedMatchResults struct {
  4114. // Data: The final match data.
  4115. Data *TurnBasedMatchDataRequest `json:"data,omitempty"`
  4116. // Kind: Uniquely identifies the type of this resource. Value is always
  4117. // the fixed string games#turnBasedMatchResults.
  4118. Kind string `json:"kind,omitempty"`
  4119. // MatchVersion: The version of the match being updated.
  4120. MatchVersion int64 `json:"matchVersion,omitempty"`
  4121. // Results: The match results for the participants in the match.
  4122. Results []*ParticipantResult `json:"results,omitempty"`
  4123. // ForceSendFields is a list of field names (e.g. "Data") to
  4124. // unconditionally include in API requests. By default, fields with
  4125. // empty values are omitted from API requests. However, any non-pointer,
  4126. // non-interface field appearing in ForceSendFields will be sent to the
  4127. // server regardless of whether the field is empty or not. This may be
  4128. // used to include empty fields in Patch requests.
  4129. ForceSendFields []string `json:"-"`
  4130. // NullFields is a list of field names (e.g. "Data") to include in API
  4131. // requests with the JSON null value. By default, fields with empty
  4132. // values are omitted from API requests. However, any field with an
  4133. // empty value appearing in NullFields will be sent to the server as
  4134. // null. It is an error if a field in this list has a non-empty value.
  4135. // This may be used to include null fields in Patch requests.
  4136. NullFields []string `json:"-"`
  4137. }
  4138. func (s *TurnBasedMatchResults) MarshalJSON() ([]byte, error) {
  4139. type NoMethod TurnBasedMatchResults
  4140. raw := NoMethod(*s)
  4141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4142. }
  4143. // TurnBasedMatchSync: This is a JSON template for a list of turn-based
  4144. // matches returned from a sync.
  4145. type TurnBasedMatchSync struct {
  4146. // Items: The matches.
  4147. Items []*TurnBasedMatch `json:"items,omitempty"`
  4148. // Kind: Uniquely identifies the type of this resource. Value is always
  4149. // the fixed string games#turnBasedMatchSync.
  4150. Kind string `json:"kind,omitempty"`
  4151. // MoreAvailable: True if there were more matches available to fetch at
  4152. // the time the response was generated (which were not returned due to
  4153. // page size limits.)
  4154. MoreAvailable bool `json:"moreAvailable,omitempty"`
  4155. // NextPageToken: The pagination token for the next page of results.
  4156. NextPageToken string `json:"nextPageToken,omitempty"`
  4157. // ServerResponse contains the HTTP response code and headers from the
  4158. // server.
  4159. googleapi.ServerResponse `json:"-"`
  4160. // ForceSendFields is a list of field names (e.g. "Items") to
  4161. // unconditionally include in API requests. By default, fields with
  4162. // empty values are omitted from API requests. However, any non-pointer,
  4163. // non-interface field appearing in ForceSendFields will be sent to the
  4164. // server regardless of whether the field is empty or not. This may be
  4165. // used to include empty fields in Patch requests.
  4166. ForceSendFields []string `json:"-"`
  4167. // NullFields is a list of field names (e.g. "Items") to include in API
  4168. // requests with the JSON null value. By default, fields with empty
  4169. // values are omitted from API requests. However, any field with an
  4170. // empty value appearing in NullFields will be sent to the server as
  4171. // null. It is an error if a field in this list has a non-empty value.
  4172. // This may be used to include null fields in Patch requests.
  4173. NullFields []string `json:"-"`
  4174. }
  4175. func (s *TurnBasedMatchSync) MarshalJSON() ([]byte, error) {
  4176. type NoMethod TurnBasedMatchSync
  4177. raw := NoMethod(*s)
  4178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4179. }
  4180. // TurnBasedMatchTurn: This is a JSON template for the object
  4181. // representing a turn.
  4182. type TurnBasedMatchTurn struct {
  4183. // Data: The shared game state data after the turn is over.
  4184. Data *TurnBasedMatchDataRequest `json:"data,omitempty"`
  4185. // Kind: Uniquely identifies the type of this resource. Value is always
  4186. // the fixed string games#turnBasedMatchTurn.
  4187. Kind string `json:"kind,omitempty"`
  4188. // MatchVersion: The version of this match: an increasing counter, used
  4189. // to avoid out-of-date updates to the match.
  4190. MatchVersion int64 `json:"matchVersion,omitempty"`
  4191. // PendingParticipantId: The ID of the participant who should take their
  4192. // turn next. May be set to the current player's participant ID to
  4193. // update match state without changing the turn. If not set, the match
  4194. // will wait for other player(s) to join via automatching; this is only
  4195. // valid if automatch criteria is set on the match with remaining slots
  4196. // for automatched players.
  4197. PendingParticipantId string `json:"pendingParticipantId,omitempty"`
  4198. // Results: The match results for the participants in the match.
  4199. Results []*ParticipantResult `json:"results,omitempty"`
  4200. // ForceSendFields is a list of field names (e.g. "Data") to
  4201. // unconditionally include in API requests. By default, fields with
  4202. // empty values are omitted from API requests. However, any non-pointer,
  4203. // non-interface field appearing in ForceSendFields will be sent to the
  4204. // server regardless of whether the field is empty or not. This may be
  4205. // used to include empty fields in Patch requests.
  4206. ForceSendFields []string `json:"-"`
  4207. // NullFields is a list of field names (e.g. "Data") to include in API
  4208. // requests with the JSON null value. By default, fields with empty
  4209. // values are omitted from API requests. However, any field with an
  4210. // empty value appearing in NullFields will be sent to the server as
  4211. // null. It is an error if a field in this list has a non-empty value.
  4212. // This may be used to include null fields in Patch requests.
  4213. NullFields []string `json:"-"`
  4214. }
  4215. func (s *TurnBasedMatchTurn) MarshalJSON() ([]byte, error) {
  4216. type NoMethod TurnBasedMatchTurn
  4217. raw := NoMethod(*s)
  4218. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4219. }
  4220. // method id "games.achievementDefinitions.list":
  4221. type AchievementDefinitionsListCall struct {
  4222. s *Service
  4223. urlParams_ gensupport.URLParams
  4224. ifNoneMatch_ string
  4225. ctx_ context.Context
  4226. header_ http.Header
  4227. }
  4228. // List: Lists all the achievement definitions for your application.
  4229. func (r *AchievementDefinitionsService) List() *AchievementDefinitionsListCall {
  4230. c := &AchievementDefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4231. return c
  4232. }
  4233. // Language sets the optional parameter "language": The preferred
  4234. // language to use for strings returned by this method.
  4235. func (c *AchievementDefinitionsListCall) Language(language string) *AchievementDefinitionsListCall {
  4236. c.urlParams_.Set("language", language)
  4237. return c
  4238. }
  4239. // MaxResults sets the optional parameter "maxResults": The maximum
  4240. // number of achievement resources to return in the response, used for
  4241. // paging. For any response, the actual number of achievement resources
  4242. // returned may be less than the specified maxResults.
  4243. func (c *AchievementDefinitionsListCall) MaxResults(maxResults int64) *AchievementDefinitionsListCall {
  4244. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4245. return c
  4246. }
  4247. // PageToken sets the optional parameter "pageToken": The token returned
  4248. // by the previous request.
  4249. func (c *AchievementDefinitionsListCall) PageToken(pageToken string) *AchievementDefinitionsListCall {
  4250. c.urlParams_.Set("pageToken", pageToken)
  4251. return c
  4252. }
  4253. // Fields allows partial responses to be retrieved. See
  4254. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4255. // for more information.
  4256. func (c *AchievementDefinitionsListCall) Fields(s ...googleapi.Field) *AchievementDefinitionsListCall {
  4257. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4258. return c
  4259. }
  4260. // IfNoneMatch sets the optional parameter which makes the operation
  4261. // fail if the object's ETag matches the given value. This is useful for
  4262. // getting updates only after the object has changed since the last
  4263. // request. Use googleapi.IsNotModified to check whether the response
  4264. // error from Do is the result of In-None-Match.
  4265. func (c *AchievementDefinitionsListCall) IfNoneMatch(entityTag string) *AchievementDefinitionsListCall {
  4266. c.ifNoneMatch_ = entityTag
  4267. return c
  4268. }
  4269. // Context sets the context to be used in this call's Do method. Any
  4270. // pending HTTP request will be aborted if the provided context is
  4271. // canceled.
  4272. func (c *AchievementDefinitionsListCall) Context(ctx context.Context) *AchievementDefinitionsListCall {
  4273. c.ctx_ = ctx
  4274. return c
  4275. }
  4276. // Header returns an http.Header that can be modified by the caller to
  4277. // add HTTP headers to the request.
  4278. func (c *AchievementDefinitionsListCall) Header() http.Header {
  4279. if c.header_ == nil {
  4280. c.header_ = make(http.Header)
  4281. }
  4282. return c.header_
  4283. }
  4284. func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, error) {
  4285. reqHeaders := make(http.Header)
  4286. for k, v := range c.header_ {
  4287. reqHeaders[k] = v
  4288. }
  4289. reqHeaders.Set("User-Agent", c.s.userAgent())
  4290. if c.ifNoneMatch_ != "" {
  4291. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4292. }
  4293. var body io.Reader = nil
  4294. c.urlParams_.Set("alt", alt)
  4295. c.urlParams_.Set("prettyPrint", "false")
  4296. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements")
  4297. urls += "?" + c.urlParams_.Encode()
  4298. req, err := http.NewRequest("GET", urls, body)
  4299. if err != nil {
  4300. return nil, err
  4301. }
  4302. req.Header = reqHeaders
  4303. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4304. }
  4305. // Do executes the "games.achievementDefinitions.list" call.
  4306. // Exactly one of *AchievementDefinitionsListResponse or error will be
  4307. // non-nil. Any non-2xx status code is an error. Response headers are in
  4308. // either *AchievementDefinitionsListResponse.ServerResponse.Header or
  4309. // (if a response was returned at all) in
  4310. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4311. // whether the returned error was because http.StatusNotModified was
  4312. // returned.
  4313. func (c *AchievementDefinitionsListCall) Do(opts ...googleapi.CallOption) (*AchievementDefinitionsListResponse, error) {
  4314. gensupport.SetOptions(c.urlParams_, opts...)
  4315. res, err := c.doRequest("json")
  4316. if res != nil && res.StatusCode == http.StatusNotModified {
  4317. if res.Body != nil {
  4318. res.Body.Close()
  4319. }
  4320. return nil, &googleapi.Error{
  4321. Code: res.StatusCode,
  4322. Header: res.Header,
  4323. }
  4324. }
  4325. if err != nil {
  4326. return nil, err
  4327. }
  4328. defer googleapi.CloseBody(res)
  4329. if err := googleapi.CheckResponse(res); err != nil {
  4330. return nil, err
  4331. }
  4332. ret := &AchievementDefinitionsListResponse{
  4333. ServerResponse: googleapi.ServerResponse{
  4334. Header: res.Header,
  4335. HTTPStatusCode: res.StatusCode,
  4336. },
  4337. }
  4338. target := &ret
  4339. if err := gensupport.DecodeResponse(target, res); err != nil {
  4340. return nil, err
  4341. }
  4342. return ret, nil
  4343. // {
  4344. // "description": "Lists all the achievement definitions for your application.",
  4345. // "httpMethod": "GET",
  4346. // "id": "games.achievementDefinitions.list",
  4347. // "parameters": {
  4348. // "language": {
  4349. // "description": "The preferred language to use for strings returned by this method.",
  4350. // "location": "query",
  4351. // "type": "string"
  4352. // },
  4353. // "maxResults": {
  4354. // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.",
  4355. // "format": "int32",
  4356. // "location": "query",
  4357. // "maximum": "200",
  4358. // "minimum": "1",
  4359. // "type": "integer"
  4360. // },
  4361. // "pageToken": {
  4362. // "description": "The token returned by the previous request.",
  4363. // "location": "query",
  4364. // "type": "string"
  4365. // }
  4366. // },
  4367. // "path": "achievements",
  4368. // "response": {
  4369. // "$ref": "AchievementDefinitionsListResponse"
  4370. // },
  4371. // "scopes": [
  4372. // "https://www.googleapis.com/auth/games",
  4373. // "https://www.googleapis.com/auth/plus.me"
  4374. // ]
  4375. // }
  4376. }
  4377. // Pages invokes f for each page of results.
  4378. // A non-nil error returned from f will halt the iteration.
  4379. // The provided context supersedes any context provided to the Context method.
  4380. func (c *AchievementDefinitionsListCall) Pages(ctx context.Context, f func(*AchievementDefinitionsListResponse) error) error {
  4381. c.ctx_ = ctx
  4382. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4383. for {
  4384. x, err := c.Do()
  4385. if err != nil {
  4386. return err
  4387. }
  4388. if err := f(x); err != nil {
  4389. return err
  4390. }
  4391. if x.NextPageToken == "" {
  4392. return nil
  4393. }
  4394. c.PageToken(x.NextPageToken)
  4395. }
  4396. }
  4397. // method id "games.achievements.increment":
  4398. type AchievementsIncrementCall struct {
  4399. s *Service
  4400. achievementId string
  4401. urlParams_ gensupport.URLParams
  4402. ctx_ context.Context
  4403. header_ http.Header
  4404. }
  4405. // Increment: Increments the steps of the achievement with the given ID
  4406. // for the currently authenticated player.
  4407. func (r *AchievementsService) Increment(achievementId string, stepsToIncrement int64) *AchievementsIncrementCall {
  4408. c := &AchievementsIncrementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4409. c.achievementId = achievementId
  4410. c.urlParams_.Set("stepsToIncrement", fmt.Sprint(stepsToIncrement))
  4411. return c
  4412. }
  4413. // RequestId sets the optional parameter "requestId": A randomly
  4414. // generated numeric ID for each request specified by the caller. This
  4415. // number is used at the server to ensure that the request is handled
  4416. // correctly across retries.
  4417. func (c *AchievementsIncrementCall) RequestId(requestId int64) *AchievementsIncrementCall {
  4418. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  4419. return c
  4420. }
  4421. // Fields allows partial responses to be retrieved. See
  4422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4423. // for more information.
  4424. func (c *AchievementsIncrementCall) Fields(s ...googleapi.Field) *AchievementsIncrementCall {
  4425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4426. return c
  4427. }
  4428. // Context sets the context to be used in this call's Do method. Any
  4429. // pending HTTP request will be aborted if the provided context is
  4430. // canceled.
  4431. func (c *AchievementsIncrementCall) Context(ctx context.Context) *AchievementsIncrementCall {
  4432. c.ctx_ = ctx
  4433. return c
  4434. }
  4435. // Header returns an http.Header that can be modified by the caller to
  4436. // add HTTP headers to the request.
  4437. func (c *AchievementsIncrementCall) Header() http.Header {
  4438. if c.header_ == nil {
  4439. c.header_ = make(http.Header)
  4440. }
  4441. return c.header_
  4442. }
  4443. func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) {
  4444. reqHeaders := make(http.Header)
  4445. for k, v := range c.header_ {
  4446. reqHeaders[k] = v
  4447. }
  4448. reqHeaders.Set("User-Agent", c.s.userAgent())
  4449. var body io.Reader = nil
  4450. c.urlParams_.Set("alt", alt)
  4451. c.urlParams_.Set("prettyPrint", "false")
  4452. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment")
  4453. urls += "?" + c.urlParams_.Encode()
  4454. req, err := http.NewRequest("POST", urls, body)
  4455. if err != nil {
  4456. return nil, err
  4457. }
  4458. req.Header = reqHeaders
  4459. googleapi.Expand(req.URL, map[string]string{
  4460. "achievementId": c.achievementId,
  4461. })
  4462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4463. }
  4464. // Do executes the "games.achievements.increment" call.
  4465. // Exactly one of *AchievementIncrementResponse or error will be
  4466. // non-nil. Any non-2xx status code is an error. Response headers are in
  4467. // either *AchievementIncrementResponse.ServerResponse.Header or (if a
  4468. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4469. // googleapi.IsNotModified to check whether the returned error was
  4470. // because http.StatusNotModified was returned.
  4471. func (c *AchievementsIncrementCall) Do(opts ...googleapi.CallOption) (*AchievementIncrementResponse, error) {
  4472. gensupport.SetOptions(c.urlParams_, opts...)
  4473. res, err := c.doRequest("json")
  4474. if res != nil && res.StatusCode == http.StatusNotModified {
  4475. if res.Body != nil {
  4476. res.Body.Close()
  4477. }
  4478. return nil, &googleapi.Error{
  4479. Code: res.StatusCode,
  4480. Header: res.Header,
  4481. }
  4482. }
  4483. if err != nil {
  4484. return nil, err
  4485. }
  4486. defer googleapi.CloseBody(res)
  4487. if err := googleapi.CheckResponse(res); err != nil {
  4488. return nil, err
  4489. }
  4490. ret := &AchievementIncrementResponse{
  4491. ServerResponse: googleapi.ServerResponse{
  4492. Header: res.Header,
  4493. HTTPStatusCode: res.StatusCode,
  4494. },
  4495. }
  4496. target := &ret
  4497. if err := gensupport.DecodeResponse(target, res); err != nil {
  4498. return nil, err
  4499. }
  4500. return ret, nil
  4501. // {
  4502. // "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.",
  4503. // "httpMethod": "POST",
  4504. // "id": "games.achievements.increment",
  4505. // "parameterOrder": [
  4506. // "achievementId",
  4507. // "stepsToIncrement"
  4508. // ],
  4509. // "parameters": {
  4510. // "achievementId": {
  4511. // "description": "The ID of the achievement used by this method.",
  4512. // "location": "path",
  4513. // "required": true,
  4514. // "type": "string"
  4515. // },
  4516. // "requestId": {
  4517. // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.",
  4518. // "format": "int64",
  4519. // "location": "query",
  4520. // "type": "string"
  4521. // },
  4522. // "stepsToIncrement": {
  4523. // "description": "The number of steps to increment.",
  4524. // "format": "int32",
  4525. // "location": "query",
  4526. // "minimum": "1",
  4527. // "required": true,
  4528. // "type": "integer"
  4529. // }
  4530. // },
  4531. // "path": "achievements/{achievementId}/increment",
  4532. // "response": {
  4533. // "$ref": "AchievementIncrementResponse"
  4534. // },
  4535. // "scopes": [
  4536. // "https://www.googleapis.com/auth/games",
  4537. // "https://www.googleapis.com/auth/plus.me"
  4538. // ]
  4539. // }
  4540. }
  4541. // method id "games.achievements.list":
  4542. type AchievementsListCall struct {
  4543. s *Service
  4544. playerId string
  4545. urlParams_ gensupport.URLParams
  4546. ifNoneMatch_ string
  4547. ctx_ context.Context
  4548. header_ http.Header
  4549. }
  4550. // List: Lists the progress for all your application's achievements for
  4551. // the currently authenticated player.
  4552. func (r *AchievementsService) List(playerId string) *AchievementsListCall {
  4553. c := &AchievementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4554. c.playerId = playerId
  4555. return c
  4556. }
  4557. // Language sets the optional parameter "language": The preferred
  4558. // language to use for strings returned by this method.
  4559. func (c *AchievementsListCall) Language(language string) *AchievementsListCall {
  4560. c.urlParams_.Set("language", language)
  4561. return c
  4562. }
  4563. // MaxResults sets the optional parameter "maxResults": The maximum
  4564. // number of achievement resources to return in the response, used for
  4565. // paging. For any response, the actual number of achievement resources
  4566. // returned may be less than the specified maxResults.
  4567. func (c *AchievementsListCall) MaxResults(maxResults int64) *AchievementsListCall {
  4568. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4569. return c
  4570. }
  4571. // PageToken sets the optional parameter "pageToken": The token returned
  4572. // by the previous request.
  4573. func (c *AchievementsListCall) PageToken(pageToken string) *AchievementsListCall {
  4574. c.urlParams_.Set("pageToken", pageToken)
  4575. return c
  4576. }
  4577. // State sets the optional parameter "state": Tells the server to return
  4578. // only achievements with the specified state. If this parameter isn't
  4579. // specified, all achievements are returned.
  4580. //
  4581. // Possible values:
  4582. // "ALL" - List all achievements. This is the default.
  4583. // "HIDDEN" - List only hidden achievements.
  4584. // "REVEALED" - List only revealed achievements.
  4585. // "UNLOCKED" - List only unlocked achievements.
  4586. func (c *AchievementsListCall) State(state string) *AchievementsListCall {
  4587. c.urlParams_.Set("state", state)
  4588. return c
  4589. }
  4590. // Fields allows partial responses to be retrieved. See
  4591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4592. // for more information.
  4593. func (c *AchievementsListCall) Fields(s ...googleapi.Field) *AchievementsListCall {
  4594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4595. return c
  4596. }
  4597. // IfNoneMatch sets the optional parameter which makes the operation
  4598. // fail if the object's ETag matches the given value. This is useful for
  4599. // getting updates only after the object has changed since the last
  4600. // request. Use googleapi.IsNotModified to check whether the response
  4601. // error from Do is the result of In-None-Match.
  4602. func (c *AchievementsListCall) IfNoneMatch(entityTag string) *AchievementsListCall {
  4603. c.ifNoneMatch_ = entityTag
  4604. return c
  4605. }
  4606. // Context sets the context to be used in this call's Do method. Any
  4607. // pending HTTP request will be aborted if the provided context is
  4608. // canceled.
  4609. func (c *AchievementsListCall) Context(ctx context.Context) *AchievementsListCall {
  4610. c.ctx_ = ctx
  4611. return c
  4612. }
  4613. // Header returns an http.Header that can be modified by the caller to
  4614. // add HTTP headers to the request.
  4615. func (c *AchievementsListCall) Header() http.Header {
  4616. if c.header_ == nil {
  4617. c.header_ = make(http.Header)
  4618. }
  4619. return c.header_
  4620. }
  4621. func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) {
  4622. reqHeaders := make(http.Header)
  4623. for k, v := range c.header_ {
  4624. reqHeaders[k] = v
  4625. }
  4626. reqHeaders.Set("User-Agent", c.s.userAgent())
  4627. if c.ifNoneMatch_ != "" {
  4628. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4629. }
  4630. var body io.Reader = nil
  4631. c.urlParams_.Set("alt", alt)
  4632. c.urlParams_.Set("prettyPrint", "false")
  4633. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements")
  4634. urls += "?" + c.urlParams_.Encode()
  4635. req, err := http.NewRequest("GET", urls, body)
  4636. if err != nil {
  4637. return nil, err
  4638. }
  4639. req.Header = reqHeaders
  4640. googleapi.Expand(req.URL, map[string]string{
  4641. "playerId": c.playerId,
  4642. })
  4643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4644. }
  4645. // Do executes the "games.achievements.list" call.
  4646. // Exactly one of *PlayerAchievementListResponse or error will be
  4647. // non-nil. Any non-2xx status code is an error. Response headers are in
  4648. // either *PlayerAchievementListResponse.ServerResponse.Header or (if a
  4649. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4650. // googleapi.IsNotModified to check whether the returned error was
  4651. // because http.StatusNotModified was returned.
  4652. func (c *AchievementsListCall) Do(opts ...googleapi.CallOption) (*PlayerAchievementListResponse, error) {
  4653. gensupport.SetOptions(c.urlParams_, opts...)
  4654. res, err := c.doRequest("json")
  4655. if res != nil && res.StatusCode == http.StatusNotModified {
  4656. if res.Body != nil {
  4657. res.Body.Close()
  4658. }
  4659. return nil, &googleapi.Error{
  4660. Code: res.StatusCode,
  4661. Header: res.Header,
  4662. }
  4663. }
  4664. if err != nil {
  4665. return nil, err
  4666. }
  4667. defer googleapi.CloseBody(res)
  4668. if err := googleapi.CheckResponse(res); err != nil {
  4669. return nil, err
  4670. }
  4671. ret := &PlayerAchievementListResponse{
  4672. ServerResponse: googleapi.ServerResponse{
  4673. Header: res.Header,
  4674. HTTPStatusCode: res.StatusCode,
  4675. },
  4676. }
  4677. target := &ret
  4678. if err := gensupport.DecodeResponse(target, res); err != nil {
  4679. return nil, err
  4680. }
  4681. return ret, nil
  4682. // {
  4683. // "description": "Lists the progress for all your application's achievements for the currently authenticated player.",
  4684. // "httpMethod": "GET",
  4685. // "id": "games.achievements.list",
  4686. // "parameterOrder": [
  4687. // "playerId"
  4688. // ],
  4689. // "parameters": {
  4690. // "language": {
  4691. // "description": "The preferred language to use for strings returned by this method.",
  4692. // "location": "query",
  4693. // "type": "string"
  4694. // },
  4695. // "maxResults": {
  4696. // "description": "The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults.",
  4697. // "format": "int32",
  4698. // "location": "query",
  4699. // "maximum": "200",
  4700. // "minimum": "1",
  4701. // "type": "integer"
  4702. // },
  4703. // "pageToken": {
  4704. // "description": "The token returned by the previous request.",
  4705. // "location": "query",
  4706. // "type": "string"
  4707. // },
  4708. // "playerId": {
  4709. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  4710. // "location": "path",
  4711. // "required": true,
  4712. // "type": "string"
  4713. // },
  4714. // "state": {
  4715. // "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.",
  4716. // "enum": [
  4717. // "ALL",
  4718. // "HIDDEN",
  4719. // "REVEALED",
  4720. // "UNLOCKED"
  4721. // ],
  4722. // "enumDescriptions": [
  4723. // "List all achievements. This is the default.",
  4724. // "List only hidden achievements.",
  4725. // "List only revealed achievements.",
  4726. // "List only unlocked achievements."
  4727. // ],
  4728. // "location": "query",
  4729. // "type": "string"
  4730. // }
  4731. // },
  4732. // "path": "players/{playerId}/achievements",
  4733. // "response": {
  4734. // "$ref": "PlayerAchievementListResponse"
  4735. // },
  4736. // "scopes": [
  4737. // "https://www.googleapis.com/auth/games",
  4738. // "https://www.googleapis.com/auth/plus.me"
  4739. // ]
  4740. // }
  4741. }
  4742. // Pages invokes f for each page of results.
  4743. // A non-nil error returned from f will halt the iteration.
  4744. // The provided context supersedes any context provided to the Context method.
  4745. func (c *AchievementsListCall) Pages(ctx context.Context, f func(*PlayerAchievementListResponse) error) error {
  4746. c.ctx_ = ctx
  4747. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4748. for {
  4749. x, err := c.Do()
  4750. if err != nil {
  4751. return err
  4752. }
  4753. if err := f(x); err != nil {
  4754. return err
  4755. }
  4756. if x.NextPageToken == "" {
  4757. return nil
  4758. }
  4759. c.PageToken(x.NextPageToken)
  4760. }
  4761. }
  4762. // method id "games.achievements.reveal":
  4763. type AchievementsRevealCall struct {
  4764. s *Service
  4765. achievementId string
  4766. urlParams_ gensupport.URLParams
  4767. ctx_ context.Context
  4768. header_ http.Header
  4769. }
  4770. // Reveal: Sets the state of the achievement with the given ID to
  4771. // REVEALED for the currently authenticated player.
  4772. func (r *AchievementsService) Reveal(achievementId string) *AchievementsRevealCall {
  4773. c := &AchievementsRevealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4774. c.achievementId = achievementId
  4775. return c
  4776. }
  4777. // Fields allows partial responses to be retrieved. See
  4778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4779. // for more information.
  4780. func (c *AchievementsRevealCall) Fields(s ...googleapi.Field) *AchievementsRevealCall {
  4781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4782. return c
  4783. }
  4784. // Context sets the context to be used in this call's Do method. Any
  4785. // pending HTTP request will be aborted if the provided context is
  4786. // canceled.
  4787. func (c *AchievementsRevealCall) Context(ctx context.Context) *AchievementsRevealCall {
  4788. c.ctx_ = ctx
  4789. return c
  4790. }
  4791. // Header returns an http.Header that can be modified by the caller to
  4792. // add HTTP headers to the request.
  4793. func (c *AchievementsRevealCall) Header() http.Header {
  4794. if c.header_ == nil {
  4795. c.header_ = make(http.Header)
  4796. }
  4797. return c.header_
  4798. }
  4799. func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) {
  4800. reqHeaders := make(http.Header)
  4801. for k, v := range c.header_ {
  4802. reqHeaders[k] = v
  4803. }
  4804. reqHeaders.Set("User-Agent", c.s.userAgent())
  4805. var body io.Reader = nil
  4806. c.urlParams_.Set("alt", alt)
  4807. c.urlParams_.Set("prettyPrint", "false")
  4808. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal")
  4809. urls += "?" + c.urlParams_.Encode()
  4810. req, err := http.NewRequest("POST", urls, body)
  4811. if err != nil {
  4812. return nil, err
  4813. }
  4814. req.Header = reqHeaders
  4815. googleapi.Expand(req.URL, map[string]string{
  4816. "achievementId": c.achievementId,
  4817. })
  4818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4819. }
  4820. // Do executes the "games.achievements.reveal" call.
  4821. // Exactly one of *AchievementRevealResponse or error will be non-nil.
  4822. // Any non-2xx status code is an error. Response headers are in either
  4823. // *AchievementRevealResponse.ServerResponse.Header or (if a response
  4824. // was returned at all) in error.(*googleapi.Error).Header. Use
  4825. // googleapi.IsNotModified to check whether the returned error was
  4826. // because http.StatusNotModified was returned.
  4827. func (c *AchievementsRevealCall) Do(opts ...googleapi.CallOption) (*AchievementRevealResponse, error) {
  4828. gensupport.SetOptions(c.urlParams_, opts...)
  4829. res, err := c.doRequest("json")
  4830. if res != nil && res.StatusCode == http.StatusNotModified {
  4831. if res.Body != nil {
  4832. res.Body.Close()
  4833. }
  4834. return nil, &googleapi.Error{
  4835. Code: res.StatusCode,
  4836. Header: res.Header,
  4837. }
  4838. }
  4839. if err != nil {
  4840. return nil, err
  4841. }
  4842. defer googleapi.CloseBody(res)
  4843. if err := googleapi.CheckResponse(res); err != nil {
  4844. return nil, err
  4845. }
  4846. ret := &AchievementRevealResponse{
  4847. ServerResponse: googleapi.ServerResponse{
  4848. Header: res.Header,
  4849. HTTPStatusCode: res.StatusCode,
  4850. },
  4851. }
  4852. target := &ret
  4853. if err := gensupport.DecodeResponse(target, res); err != nil {
  4854. return nil, err
  4855. }
  4856. return ret, nil
  4857. // {
  4858. // "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.",
  4859. // "httpMethod": "POST",
  4860. // "id": "games.achievements.reveal",
  4861. // "parameterOrder": [
  4862. // "achievementId"
  4863. // ],
  4864. // "parameters": {
  4865. // "achievementId": {
  4866. // "description": "The ID of the achievement used by this method.",
  4867. // "location": "path",
  4868. // "required": true,
  4869. // "type": "string"
  4870. // }
  4871. // },
  4872. // "path": "achievements/{achievementId}/reveal",
  4873. // "response": {
  4874. // "$ref": "AchievementRevealResponse"
  4875. // },
  4876. // "scopes": [
  4877. // "https://www.googleapis.com/auth/games",
  4878. // "https://www.googleapis.com/auth/plus.me"
  4879. // ]
  4880. // }
  4881. }
  4882. // method id "games.achievements.setStepsAtLeast":
  4883. type AchievementsSetStepsAtLeastCall struct {
  4884. s *Service
  4885. achievementId string
  4886. urlParams_ gensupport.URLParams
  4887. ctx_ context.Context
  4888. header_ http.Header
  4889. }
  4890. // SetStepsAtLeast: Sets the steps for the currently authenticated
  4891. // player towards unlocking an achievement. If the steps parameter is
  4892. // less than the current number of steps that the player already gained
  4893. // for the achievement, the achievement is not modified.
  4894. func (r *AchievementsService) SetStepsAtLeast(achievementId string, steps int64) *AchievementsSetStepsAtLeastCall {
  4895. c := &AchievementsSetStepsAtLeastCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4896. c.achievementId = achievementId
  4897. c.urlParams_.Set("steps", fmt.Sprint(steps))
  4898. return c
  4899. }
  4900. // Fields allows partial responses to be retrieved. See
  4901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4902. // for more information.
  4903. func (c *AchievementsSetStepsAtLeastCall) Fields(s ...googleapi.Field) *AchievementsSetStepsAtLeastCall {
  4904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4905. return c
  4906. }
  4907. // Context sets the context to be used in this call's Do method. Any
  4908. // pending HTTP request will be aborted if the provided context is
  4909. // canceled.
  4910. func (c *AchievementsSetStepsAtLeastCall) Context(ctx context.Context) *AchievementsSetStepsAtLeastCall {
  4911. c.ctx_ = ctx
  4912. return c
  4913. }
  4914. // Header returns an http.Header that can be modified by the caller to
  4915. // add HTTP headers to the request.
  4916. func (c *AchievementsSetStepsAtLeastCall) Header() http.Header {
  4917. if c.header_ == nil {
  4918. c.header_ = make(http.Header)
  4919. }
  4920. return c.header_
  4921. }
  4922. func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) {
  4923. reqHeaders := make(http.Header)
  4924. for k, v := range c.header_ {
  4925. reqHeaders[k] = v
  4926. }
  4927. reqHeaders.Set("User-Agent", c.s.userAgent())
  4928. var body io.Reader = nil
  4929. c.urlParams_.Set("alt", alt)
  4930. c.urlParams_.Set("prettyPrint", "false")
  4931. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast")
  4932. urls += "?" + c.urlParams_.Encode()
  4933. req, err := http.NewRequest("POST", urls, body)
  4934. if err != nil {
  4935. return nil, err
  4936. }
  4937. req.Header = reqHeaders
  4938. googleapi.Expand(req.URL, map[string]string{
  4939. "achievementId": c.achievementId,
  4940. })
  4941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4942. }
  4943. // Do executes the "games.achievements.setStepsAtLeast" call.
  4944. // Exactly one of *AchievementSetStepsAtLeastResponse or error will be
  4945. // non-nil. Any non-2xx status code is an error. Response headers are in
  4946. // either *AchievementSetStepsAtLeastResponse.ServerResponse.Header or
  4947. // (if a response was returned at all) in
  4948. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4949. // whether the returned error was because http.StatusNotModified was
  4950. // returned.
  4951. func (c *AchievementsSetStepsAtLeastCall) Do(opts ...googleapi.CallOption) (*AchievementSetStepsAtLeastResponse, error) {
  4952. gensupport.SetOptions(c.urlParams_, opts...)
  4953. res, err := c.doRequest("json")
  4954. if res != nil && res.StatusCode == http.StatusNotModified {
  4955. if res.Body != nil {
  4956. res.Body.Close()
  4957. }
  4958. return nil, &googleapi.Error{
  4959. Code: res.StatusCode,
  4960. Header: res.Header,
  4961. }
  4962. }
  4963. if err != nil {
  4964. return nil, err
  4965. }
  4966. defer googleapi.CloseBody(res)
  4967. if err := googleapi.CheckResponse(res); err != nil {
  4968. return nil, err
  4969. }
  4970. ret := &AchievementSetStepsAtLeastResponse{
  4971. ServerResponse: googleapi.ServerResponse{
  4972. Header: res.Header,
  4973. HTTPStatusCode: res.StatusCode,
  4974. },
  4975. }
  4976. target := &ret
  4977. if err := gensupport.DecodeResponse(target, res); err != nil {
  4978. return nil, err
  4979. }
  4980. return ret, nil
  4981. // {
  4982. // "description": "Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.",
  4983. // "httpMethod": "POST",
  4984. // "id": "games.achievements.setStepsAtLeast",
  4985. // "parameterOrder": [
  4986. // "achievementId",
  4987. // "steps"
  4988. // ],
  4989. // "parameters": {
  4990. // "achievementId": {
  4991. // "description": "The ID of the achievement used by this method.",
  4992. // "location": "path",
  4993. // "required": true,
  4994. // "type": "string"
  4995. // },
  4996. // "steps": {
  4997. // "description": "The minimum value to set the steps to.",
  4998. // "format": "int32",
  4999. // "location": "query",
  5000. // "minimum": "1",
  5001. // "required": true,
  5002. // "type": "integer"
  5003. // }
  5004. // },
  5005. // "path": "achievements/{achievementId}/setStepsAtLeast",
  5006. // "response": {
  5007. // "$ref": "AchievementSetStepsAtLeastResponse"
  5008. // },
  5009. // "scopes": [
  5010. // "https://www.googleapis.com/auth/games",
  5011. // "https://www.googleapis.com/auth/plus.me"
  5012. // ]
  5013. // }
  5014. }
  5015. // method id "games.achievements.unlock":
  5016. type AchievementsUnlockCall struct {
  5017. s *Service
  5018. achievementId string
  5019. urlParams_ gensupport.URLParams
  5020. ctx_ context.Context
  5021. header_ http.Header
  5022. }
  5023. // Unlock: Unlocks this achievement for the currently authenticated
  5024. // player.
  5025. func (r *AchievementsService) Unlock(achievementId string) *AchievementsUnlockCall {
  5026. c := &AchievementsUnlockCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5027. c.achievementId = achievementId
  5028. return c
  5029. }
  5030. // BuiltinGameId sets the optional parameter "builtinGameId": Override
  5031. // used only by built-in games in Play Games application.
  5032. func (c *AchievementsUnlockCall) BuiltinGameId(builtinGameId string) *AchievementsUnlockCall {
  5033. c.urlParams_.Set("builtinGameId", builtinGameId)
  5034. return c
  5035. }
  5036. // Fields allows partial responses to be retrieved. See
  5037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5038. // for more information.
  5039. func (c *AchievementsUnlockCall) Fields(s ...googleapi.Field) *AchievementsUnlockCall {
  5040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5041. return c
  5042. }
  5043. // Context sets the context to be used in this call's Do method. Any
  5044. // pending HTTP request will be aborted if the provided context is
  5045. // canceled.
  5046. func (c *AchievementsUnlockCall) Context(ctx context.Context) *AchievementsUnlockCall {
  5047. c.ctx_ = ctx
  5048. return c
  5049. }
  5050. // Header returns an http.Header that can be modified by the caller to
  5051. // add HTTP headers to the request.
  5052. func (c *AchievementsUnlockCall) Header() http.Header {
  5053. if c.header_ == nil {
  5054. c.header_ = make(http.Header)
  5055. }
  5056. return c.header_
  5057. }
  5058. func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) {
  5059. reqHeaders := make(http.Header)
  5060. for k, v := range c.header_ {
  5061. reqHeaders[k] = v
  5062. }
  5063. reqHeaders.Set("User-Agent", c.s.userAgent())
  5064. var body io.Reader = nil
  5065. c.urlParams_.Set("alt", alt)
  5066. c.urlParams_.Set("prettyPrint", "false")
  5067. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock")
  5068. urls += "?" + c.urlParams_.Encode()
  5069. req, err := http.NewRequest("POST", urls, body)
  5070. if err != nil {
  5071. return nil, err
  5072. }
  5073. req.Header = reqHeaders
  5074. googleapi.Expand(req.URL, map[string]string{
  5075. "achievementId": c.achievementId,
  5076. })
  5077. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5078. }
  5079. // Do executes the "games.achievements.unlock" call.
  5080. // Exactly one of *AchievementUnlockResponse or error will be non-nil.
  5081. // Any non-2xx status code is an error. Response headers are in either
  5082. // *AchievementUnlockResponse.ServerResponse.Header or (if a response
  5083. // was returned at all) in error.(*googleapi.Error).Header. Use
  5084. // googleapi.IsNotModified to check whether the returned error was
  5085. // because http.StatusNotModified was returned.
  5086. func (c *AchievementsUnlockCall) Do(opts ...googleapi.CallOption) (*AchievementUnlockResponse, error) {
  5087. gensupport.SetOptions(c.urlParams_, opts...)
  5088. res, err := c.doRequest("json")
  5089. if res != nil && res.StatusCode == http.StatusNotModified {
  5090. if res.Body != nil {
  5091. res.Body.Close()
  5092. }
  5093. return nil, &googleapi.Error{
  5094. Code: res.StatusCode,
  5095. Header: res.Header,
  5096. }
  5097. }
  5098. if err != nil {
  5099. return nil, err
  5100. }
  5101. defer googleapi.CloseBody(res)
  5102. if err := googleapi.CheckResponse(res); err != nil {
  5103. return nil, err
  5104. }
  5105. ret := &AchievementUnlockResponse{
  5106. ServerResponse: googleapi.ServerResponse{
  5107. Header: res.Header,
  5108. HTTPStatusCode: res.StatusCode,
  5109. },
  5110. }
  5111. target := &ret
  5112. if err := gensupport.DecodeResponse(target, res); err != nil {
  5113. return nil, err
  5114. }
  5115. return ret, nil
  5116. // {
  5117. // "description": "Unlocks this achievement for the currently authenticated player.",
  5118. // "httpMethod": "POST",
  5119. // "id": "games.achievements.unlock",
  5120. // "parameterOrder": [
  5121. // "achievementId"
  5122. // ],
  5123. // "parameters": {
  5124. // "achievementId": {
  5125. // "description": "The ID of the achievement used by this method.",
  5126. // "location": "path",
  5127. // "required": true,
  5128. // "type": "string"
  5129. // },
  5130. // "builtinGameId": {
  5131. // "description": "Override used only by built-in games in Play Games application.",
  5132. // "location": "query",
  5133. // "type": "string"
  5134. // }
  5135. // },
  5136. // "path": "achievements/{achievementId}/unlock",
  5137. // "response": {
  5138. // "$ref": "AchievementUnlockResponse"
  5139. // },
  5140. // "scopes": [
  5141. // "https://www.googleapis.com/auth/games",
  5142. // "https://www.googleapis.com/auth/plus.me"
  5143. // ]
  5144. // }
  5145. }
  5146. // method id "games.achievements.updateMultiple":
  5147. type AchievementsUpdateMultipleCall struct {
  5148. s *Service
  5149. achievementupdatemultiplerequest *AchievementUpdateMultipleRequest
  5150. urlParams_ gensupport.URLParams
  5151. ctx_ context.Context
  5152. header_ http.Header
  5153. }
  5154. // UpdateMultiple: Updates multiple achievements for the currently
  5155. // authenticated player.
  5156. func (r *AchievementsService) UpdateMultiple(achievementupdatemultiplerequest *AchievementUpdateMultipleRequest) *AchievementsUpdateMultipleCall {
  5157. c := &AchievementsUpdateMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5158. c.achievementupdatemultiplerequest = achievementupdatemultiplerequest
  5159. return c
  5160. }
  5161. // BuiltinGameId sets the optional parameter "builtinGameId": Override
  5162. // used only by built-in games in Play Games application.
  5163. func (c *AchievementsUpdateMultipleCall) BuiltinGameId(builtinGameId string) *AchievementsUpdateMultipleCall {
  5164. c.urlParams_.Set("builtinGameId", builtinGameId)
  5165. return c
  5166. }
  5167. // Fields allows partial responses to be retrieved. See
  5168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5169. // for more information.
  5170. func (c *AchievementsUpdateMultipleCall) Fields(s ...googleapi.Field) *AchievementsUpdateMultipleCall {
  5171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5172. return c
  5173. }
  5174. // Context sets the context to be used in this call's Do method. Any
  5175. // pending HTTP request will be aborted if the provided context is
  5176. // canceled.
  5177. func (c *AchievementsUpdateMultipleCall) Context(ctx context.Context) *AchievementsUpdateMultipleCall {
  5178. c.ctx_ = ctx
  5179. return c
  5180. }
  5181. // Header returns an http.Header that can be modified by the caller to
  5182. // add HTTP headers to the request.
  5183. func (c *AchievementsUpdateMultipleCall) Header() http.Header {
  5184. if c.header_ == nil {
  5185. c.header_ = make(http.Header)
  5186. }
  5187. return c.header_
  5188. }
  5189. func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, error) {
  5190. reqHeaders := make(http.Header)
  5191. for k, v := range c.header_ {
  5192. reqHeaders[k] = v
  5193. }
  5194. reqHeaders.Set("User-Agent", c.s.userAgent())
  5195. var body io.Reader = nil
  5196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest)
  5197. if err != nil {
  5198. return nil, err
  5199. }
  5200. reqHeaders.Set("Content-Type", "application/json")
  5201. c.urlParams_.Set("alt", alt)
  5202. c.urlParams_.Set("prettyPrint", "false")
  5203. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/updateMultiple")
  5204. urls += "?" + c.urlParams_.Encode()
  5205. req, err := http.NewRequest("POST", urls, body)
  5206. if err != nil {
  5207. return nil, err
  5208. }
  5209. req.Header = reqHeaders
  5210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5211. }
  5212. // Do executes the "games.achievements.updateMultiple" call.
  5213. // Exactly one of *AchievementUpdateMultipleResponse or error will be
  5214. // non-nil. Any non-2xx status code is an error. Response headers are in
  5215. // either *AchievementUpdateMultipleResponse.ServerResponse.Header or
  5216. // (if a response was returned at all) in
  5217. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5218. // whether the returned error was because http.StatusNotModified was
  5219. // returned.
  5220. func (c *AchievementsUpdateMultipleCall) Do(opts ...googleapi.CallOption) (*AchievementUpdateMultipleResponse, error) {
  5221. gensupport.SetOptions(c.urlParams_, opts...)
  5222. res, err := c.doRequest("json")
  5223. if res != nil && res.StatusCode == http.StatusNotModified {
  5224. if res.Body != nil {
  5225. res.Body.Close()
  5226. }
  5227. return nil, &googleapi.Error{
  5228. Code: res.StatusCode,
  5229. Header: res.Header,
  5230. }
  5231. }
  5232. if err != nil {
  5233. return nil, err
  5234. }
  5235. defer googleapi.CloseBody(res)
  5236. if err := googleapi.CheckResponse(res); err != nil {
  5237. return nil, err
  5238. }
  5239. ret := &AchievementUpdateMultipleResponse{
  5240. ServerResponse: googleapi.ServerResponse{
  5241. Header: res.Header,
  5242. HTTPStatusCode: res.StatusCode,
  5243. },
  5244. }
  5245. target := &ret
  5246. if err := gensupport.DecodeResponse(target, res); err != nil {
  5247. return nil, err
  5248. }
  5249. return ret, nil
  5250. // {
  5251. // "description": "Updates multiple achievements for the currently authenticated player.",
  5252. // "httpMethod": "POST",
  5253. // "id": "games.achievements.updateMultiple",
  5254. // "parameters": {
  5255. // "builtinGameId": {
  5256. // "description": "Override used only by built-in games in Play Games application.",
  5257. // "location": "query",
  5258. // "type": "string"
  5259. // }
  5260. // },
  5261. // "path": "achievements/updateMultiple",
  5262. // "request": {
  5263. // "$ref": "AchievementUpdateMultipleRequest"
  5264. // },
  5265. // "response": {
  5266. // "$ref": "AchievementUpdateMultipleResponse"
  5267. // },
  5268. // "scopes": [
  5269. // "https://www.googleapis.com/auth/games",
  5270. // "https://www.googleapis.com/auth/plus.me"
  5271. // ]
  5272. // }
  5273. }
  5274. // method id "games.applications.get":
  5275. type ApplicationsGetCall struct {
  5276. s *Service
  5277. applicationId string
  5278. urlParams_ gensupport.URLParams
  5279. ifNoneMatch_ string
  5280. ctx_ context.Context
  5281. header_ http.Header
  5282. }
  5283. // Get: Retrieves the metadata of the application with the given ID. If
  5284. // the requested application is not available for the specified
  5285. // platformType, the returned response will not include any instance
  5286. // data.
  5287. func (r *ApplicationsService) Get(applicationId string) *ApplicationsGetCall {
  5288. c := &ApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5289. c.applicationId = applicationId
  5290. return c
  5291. }
  5292. // Language sets the optional parameter "language": The preferred
  5293. // language to use for strings returned by this method.
  5294. func (c *ApplicationsGetCall) Language(language string) *ApplicationsGetCall {
  5295. c.urlParams_.Set("language", language)
  5296. return c
  5297. }
  5298. // PlatformType sets the optional parameter "platformType": Restrict
  5299. // application details returned to the specific platform.
  5300. //
  5301. // Possible values:
  5302. // "ANDROID" - Retrieve applications that can be played on Android.
  5303. // "IOS" - Retrieve applications that can be played on iOS.
  5304. // "WEB_APP" - Retrieve applications that can be played on desktop
  5305. // web.
  5306. func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall {
  5307. c.urlParams_.Set("platformType", platformType)
  5308. return c
  5309. }
  5310. // Fields allows partial responses to be retrieved. See
  5311. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5312. // for more information.
  5313. func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall {
  5314. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5315. return c
  5316. }
  5317. // IfNoneMatch sets the optional parameter which makes the operation
  5318. // fail if the object's ETag matches the given value. This is useful for
  5319. // getting updates only after the object has changed since the last
  5320. // request. Use googleapi.IsNotModified to check whether the response
  5321. // error from Do is the result of In-None-Match.
  5322. func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall {
  5323. c.ifNoneMatch_ = entityTag
  5324. return c
  5325. }
  5326. // Context sets the context to be used in this call's Do method. Any
  5327. // pending HTTP request will be aborted if the provided context is
  5328. // canceled.
  5329. func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall {
  5330. c.ctx_ = ctx
  5331. return c
  5332. }
  5333. // Header returns an http.Header that can be modified by the caller to
  5334. // add HTTP headers to the request.
  5335. func (c *ApplicationsGetCall) Header() http.Header {
  5336. if c.header_ == nil {
  5337. c.header_ = make(http.Header)
  5338. }
  5339. return c.header_
  5340. }
  5341. func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) {
  5342. reqHeaders := make(http.Header)
  5343. for k, v := range c.header_ {
  5344. reqHeaders[k] = v
  5345. }
  5346. reqHeaders.Set("User-Agent", c.s.userAgent())
  5347. if c.ifNoneMatch_ != "" {
  5348. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5349. }
  5350. var body io.Reader = nil
  5351. c.urlParams_.Set("alt", alt)
  5352. c.urlParams_.Set("prettyPrint", "false")
  5353. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}")
  5354. urls += "?" + c.urlParams_.Encode()
  5355. req, err := http.NewRequest("GET", urls, body)
  5356. if err != nil {
  5357. return nil, err
  5358. }
  5359. req.Header = reqHeaders
  5360. googleapi.Expand(req.URL, map[string]string{
  5361. "applicationId": c.applicationId,
  5362. })
  5363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5364. }
  5365. // Do executes the "games.applications.get" call.
  5366. // Exactly one of *Application or error will be non-nil. Any non-2xx
  5367. // status code is an error. Response headers are in either
  5368. // *Application.ServerResponse.Header or (if a response was returned at
  5369. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5370. // to check whether the returned error was because
  5371. // http.StatusNotModified was returned.
  5372. func (c *ApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) {
  5373. gensupport.SetOptions(c.urlParams_, opts...)
  5374. res, err := c.doRequest("json")
  5375. if res != nil && res.StatusCode == http.StatusNotModified {
  5376. if res.Body != nil {
  5377. res.Body.Close()
  5378. }
  5379. return nil, &googleapi.Error{
  5380. Code: res.StatusCode,
  5381. Header: res.Header,
  5382. }
  5383. }
  5384. if err != nil {
  5385. return nil, err
  5386. }
  5387. defer googleapi.CloseBody(res)
  5388. if err := googleapi.CheckResponse(res); err != nil {
  5389. return nil, err
  5390. }
  5391. ret := &Application{
  5392. ServerResponse: googleapi.ServerResponse{
  5393. Header: res.Header,
  5394. HTTPStatusCode: res.StatusCode,
  5395. },
  5396. }
  5397. target := &ret
  5398. if err := gensupport.DecodeResponse(target, res); err != nil {
  5399. return nil, err
  5400. }
  5401. return ret, nil
  5402. // {
  5403. // "description": "Retrieves the metadata of the application with the given ID. If the requested application is not available for the specified platformType, the returned response will not include any instance data.",
  5404. // "httpMethod": "GET",
  5405. // "id": "games.applications.get",
  5406. // "parameterOrder": [
  5407. // "applicationId"
  5408. // ],
  5409. // "parameters": {
  5410. // "applicationId": {
  5411. // "description": "The application ID from the Google Play developer console.",
  5412. // "location": "path",
  5413. // "required": true,
  5414. // "type": "string"
  5415. // },
  5416. // "language": {
  5417. // "description": "The preferred language to use for strings returned by this method.",
  5418. // "location": "query",
  5419. // "type": "string"
  5420. // },
  5421. // "platformType": {
  5422. // "description": "Restrict application details returned to the specific platform.",
  5423. // "enum": [
  5424. // "ANDROID",
  5425. // "IOS",
  5426. // "WEB_APP"
  5427. // ],
  5428. // "enumDescriptions": [
  5429. // "Retrieve applications that can be played on Android.",
  5430. // "Retrieve applications that can be played on iOS.",
  5431. // "Retrieve applications that can be played on desktop web."
  5432. // ],
  5433. // "location": "query",
  5434. // "type": "string"
  5435. // }
  5436. // },
  5437. // "path": "applications/{applicationId}",
  5438. // "response": {
  5439. // "$ref": "Application"
  5440. // },
  5441. // "scopes": [
  5442. // "https://www.googleapis.com/auth/games",
  5443. // "https://www.googleapis.com/auth/plus.me"
  5444. // ]
  5445. // }
  5446. }
  5447. // method id "games.applications.played":
  5448. type ApplicationsPlayedCall struct {
  5449. s *Service
  5450. urlParams_ gensupport.URLParams
  5451. ctx_ context.Context
  5452. header_ http.Header
  5453. }
  5454. // Played: Indicate that the the currently authenticated user is playing
  5455. // your application.
  5456. func (r *ApplicationsService) Played() *ApplicationsPlayedCall {
  5457. c := &ApplicationsPlayedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5458. return c
  5459. }
  5460. // BuiltinGameId sets the optional parameter "builtinGameId": Override
  5461. // used only by built-in games in Play Games application.
  5462. func (c *ApplicationsPlayedCall) BuiltinGameId(builtinGameId string) *ApplicationsPlayedCall {
  5463. c.urlParams_.Set("builtinGameId", builtinGameId)
  5464. return c
  5465. }
  5466. // Fields allows partial responses to be retrieved. See
  5467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5468. // for more information.
  5469. func (c *ApplicationsPlayedCall) Fields(s ...googleapi.Field) *ApplicationsPlayedCall {
  5470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5471. return c
  5472. }
  5473. // Context sets the context to be used in this call's Do method. Any
  5474. // pending HTTP request will be aborted if the provided context is
  5475. // canceled.
  5476. func (c *ApplicationsPlayedCall) Context(ctx context.Context) *ApplicationsPlayedCall {
  5477. c.ctx_ = ctx
  5478. return c
  5479. }
  5480. // Header returns an http.Header that can be modified by the caller to
  5481. // add HTTP headers to the request.
  5482. func (c *ApplicationsPlayedCall) Header() http.Header {
  5483. if c.header_ == nil {
  5484. c.header_ = make(http.Header)
  5485. }
  5486. return c.header_
  5487. }
  5488. func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) {
  5489. reqHeaders := make(http.Header)
  5490. for k, v := range c.header_ {
  5491. reqHeaders[k] = v
  5492. }
  5493. reqHeaders.Set("User-Agent", c.s.userAgent())
  5494. var body io.Reader = nil
  5495. c.urlParams_.Set("alt", alt)
  5496. c.urlParams_.Set("prettyPrint", "false")
  5497. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played")
  5498. urls += "?" + c.urlParams_.Encode()
  5499. req, err := http.NewRequest("POST", urls, body)
  5500. if err != nil {
  5501. return nil, err
  5502. }
  5503. req.Header = reqHeaders
  5504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5505. }
  5506. // Do executes the "games.applications.played" call.
  5507. func (c *ApplicationsPlayedCall) Do(opts ...googleapi.CallOption) error {
  5508. gensupport.SetOptions(c.urlParams_, opts...)
  5509. res, err := c.doRequest("json")
  5510. if err != nil {
  5511. return err
  5512. }
  5513. defer googleapi.CloseBody(res)
  5514. if err := googleapi.CheckResponse(res); err != nil {
  5515. return err
  5516. }
  5517. return nil
  5518. // {
  5519. // "description": "Indicate that the the currently authenticated user is playing your application.",
  5520. // "httpMethod": "POST",
  5521. // "id": "games.applications.played",
  5522. // "parameters": {
  5523. // "builtinGameId": {
  5524. // "description": "Override used only by built-in games in Play Games application.",
  5525. // "location": "query",
  5526. // "type": "string"
  5527. // }
  5528. // },
  5529. // "path": "applications/played",
  5530. // "scopes": [
  5531. // "https://www.googleapis.com/auth/games",
  5532. // "https://www.googleapis.com/auth/plus.me"
  5533. // ]
  5534. // }
  5535. }
  5536. // method id "games.applications.verify":
  5537. type ApplicationsVerifyCall struct {
  5538. s *Service
  5539. applicationId string
  5540. urlParams_ gensupport.URLParams
  5541. ifNoneMatch_ string
  5542. ctx_ context.Context
  5543. header_ http.Header
  5544. }
  5545. // Verify: Verifies the auth token provided with this request is for the
  5546. // application with the specified ID, and returns the ID of the player
  5547. // it was granted for.
  5548. func (r *ApplicationsService) Verify(applicationId string) *ApplicationsVerifyCall {
  5549. c := &ApplicationsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5550. c.applicationId = applicationId
  5551. return c
  5552. }
  5553. // Fields allows partial responses to be retrieved. See
  5554. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5555. // for more information.
  5556. func (c *ApplicationsVerifyCall) Fields(s ...googleapi.Field) *ApplicationsVerifyCall {
  5557. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5558. return c
  5559. }
  5560. // IfNoneMatch sets the optional parameter which makes the operation
  5561. // fail if the object's ETag matches the given value. This is useful for
  5562. // getting updates only after the object has changed since the last
  5563. // request. Use googleapi.IsNotModified to check whether the response
  5564. // error from Do is the result of In-None-Match.
  5565. func (c *ApplicationsVerifyCall) IfNoneMatch(entityTag string) *ApplicationsVerifyCall {
  5566. c.ifNoneMatch_ = entityTag
  5567. return c
  5568. }
  5569. // Context sets the context to be used in this call's Do method. Any
  5570. // pending HTTP request will be aborted if the provided context is
  5571. // canceled.
  5572. func (c *ApplicationsVerifyCall) Context(ctx context.Context) *ApplicationsVerifyCall {
  5573. c.ctx_ = ctx
  5574. return c
  5575. }
  5576. // Header returns an http.Header that can be modified by the caller to
  5577. // add HTTP headers to the request.
  5578. func (c *ApplicationsVerifyCall) Header() http.Header {
  5579. if c.header_ == nil {
  5580. c.header_ = make(http.Header)
  5581. }
  5582. return c.header_
  5583. }
  5584. func (c *ApplicationsVerifyCall) doRequest(alt string) (*http.Response, error) {
  5585. reqHeaders := make(http.Header)
  5586. for k, v := range c.header_ {
  5587. reqHeaders[k] = v
  5588. }
  5589. reqHeaders.Set("User-Agent", c.s.userAgent())
  5590. if c.ifNoneMatch_ != "" {
  5591. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5592. }
  5593. var body io.Reader = nil
  5594. c.urlParams_.Set("alt", alt)
  5595. c.urlParams_.Set("prettyPrint", "false")
  5596. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/verify")
  5597. urls += "?" + c.urlParams_.Encode()
  5598. req, err := http.NewRequest("GET", urls, body)
  5599. if err != nil {
  5600. return nil, err
  5601. }
  5602. req.Header = reqHeaders
  5603. googleapi.Expand(req.URL, map[string]string{
  5604. "applicationId": c.applicationId,
  5605. })
  5606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5607. }
  5608. // Do executes the "games.applications.verify" call.
  5609. // Exactly one of *ApplicationVerifyResponse or error will be non-nil.
  5610. // Any non-2xx status code is an error. Response headers are in either
  5611. // *ApplicationVerifyResponse.ServerResponse.Header or (if a response
  5612. // was returned at all) in error.(*googleapi.Error).Header. Use
  5613. // googleapi.IsNotModified to check whether the returned error was
  5614. // because http.StatusNotModified was returned.
  5615. func (c *ApplicationsVerifyCall) Do(opts ...googleapi.CallOption) (*ApplicationVerifyResponse, error) {
  5616. gensupport.SetOptions(c.urlParams_, opts...)
  5617. res, err := c.doRequest("json")
  5618. if res != nil && res.StatusCode == http.StatusNotModified {
  5619. if res.Body != nil {
  5620. res.Body.Close()
  5621. }
  5622. return nil, &googleapi.Error{
  5623. Code: res.StatusCode,
  5624. Header: res.Header,
  5625. }
  5626. }
  5627. if err != nil {
  5628. return nil, err
  5629. }
  5630. defer googleapi.CloseBody(res)
  5631. if err := googleapi.CheckResponse(res); err != nil {
  5632. return nil, err
  5633. }
  5634. ret := &ApplicationVerifyResponse{
  5635. ServerResponse: googleapi.ServerResponse{
  5636. Header: res.Header,
  5637. HTTPStatusCode: res.StatusCode,
  5638. },
  5639. }
  5640. target := &ret
  5641. if err := gensupport.DecodeResponse(target, res); err != nil {
  5642. return nil, err
  5643. }
  5644. return ret, nil
  5645. // {
  5646. // "description": "Verifies the auth token provided with this request is for the application with the specified ID, and returns the ID of the player it was granted for.",
  5647. // "httpMethod": "GET",
  5648. // "id": "games.applications.verify",
  5649. // "parameterOrder": [
  5650. // "applicationId"
  5651. // ],
  5652. // "parameters": {
  5653. // "applicationId": {
  5654. // "description": "The application ID from the Google Play developer console.",
  5655. // "location": "path",
  5656. // "required": true,
  5657. // "type": "string"
  5658. // }
  5659. // },
  5660. // "path": "applications/{applicationId}/verify",
  5661. // "response": {
  5662. // "$ref": "ApplicationVerifyResponse"
  5663. // },
  5664. // "scopes": [
  5665. // "https://www.googleapis.com/auth/games",
  5666. // "https://www.googleapis.com/auth/plus.me"
  5667. // ]
  5668. // }
  5669. }
  5670. // method id "games.events.listByPlayer":
  5671. type EventsListByPlayerCall struct {
  5672. s *Service
  5673. urlParams_ gensupport.URLParams
  5674. ifNoneMatch_ string
  5675. ctx_ context.Context
  5676. header_ http.Header
  5677. }
  5678. // ListByPlayer: Returns a list showing the current progress on events
  5679. // in this application for the currently authenticated user.
  5680. func (r *EventsService) ListByPlayer() *EventsListByPlayerCall {
  5681. c := &EventsListByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5682. return c
  5683. }
  5684. // Language sets the optional parameter "language": The preferred
  5685. // language to use for strings returned by this method.
  5686. func (c *EventsListByPlayerCall) Language(language string) *EventsListByPlayerCall {
  5687. c.urlParams_.Set("language", language)
  5688. return c
  5689. }
  5690. // MaxResults sets the optional parameter "maxResults": The maximum
  5691. // number of events to return in the response, used for paging. For any
  5692. // response, the actual number of events to return may be less than the
  5693. // specified maxResults.
  5694. func (c *EventsListByPlayerCall) MaxResults(maxResults int64) *EventsListByPlayerCall {
  5695. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5696. return c
  5697. }
  5698. // PageToken sets the optional parameter "pageToken": The token returned
  5699. // by the previous request.
  5700. func (c *EventsListByPlayerCall) PageToken(pageToken string) *EventsListByPlayerCall {
  5701. c.urlParams_.Set("pageToken", pageToken)
  5702. return c
  5703. }
  5704. // Fields allows partial responses to be retrieved. See
  5705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5706. // for more information.
  5707. func (c *EventsListByPlayerCall) Fields(s ...googleapi.Field) *EventsListByPlayerCall {
  5708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5709. return c
  5710. }
  5711. // IfNoneMatch sets the optional parameter which makes the operation
  5712. // fail if the object's ETag matches the given value. This is useful for
  5713. // getting updates only after the object has changed since the last
  5714. // request. Use googleapi.IsNotModified to check whether the response
  5715. // error from Do is the result of In-None-Match.
  5716. func (c *EventsListByPlayerCall) IfNoneMatch(entityTag string) *EventsListByPlayerCall {
  5717. c.ifNoneMatch_ = entityTag
  5718. return c
  5719. }
  5720. // Context sets the context to be used in this call's Do method. Any
  5721. // pending HTTP request will be aborted if the provided context is
  5722. // canceled.
  5723. func (c *EventsListByPlayerCall) Context(ctx context.Context) *EventsListByPlayerCall {
  5724. c.ctx_ = ctx
  5725. return c
  5726. }
  5727. // Header returns an http.Header that can be modified by the caller to
  5728. // add HTTP headers to the request.
  5729. func (c *EventsListByPlayerCall) Header() http.Header {
  5730. if c.header_ == nil {
  5731. c.header_ = make(http.Header)
  5732. }
  5733. return c.header_
  5734. }
  5735. func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) {
  5736. reqHeaders := make(http.Header)
  5737. for k, v := range c.header_ {
  5738. reqHeaders[k] = v
  5739. }
  5740. reqHeaders.Set("User-Agent", c.s.userAgent())
  5741. if c.ifNoneMatch_ != "" {
  5742. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5743. }
  5744. var body io.Reader = nil
  5745. c.urlParams_.Set("alt", alt)
  5746. c.urlParams_.Set("prettyPrint", "false")
  5747. urls := googleapi.ResolveRelative(c.s.BasePath, "events")
  5748. urls += "?" + c.urlParams_.Encode()
  5749. req, err := http.NewRequest("GET", urls, body)
  5750. if err != nil {
  5751. return nil, err
  5752. }
  5753. req.Header = reqHeaders
  5754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5755. }
  5756. // Do executes the "games.events.listByPlayer" call.
  5757. // Exactly one of *PlayerEventListResponse or error will be non-nil. Any
  5758. // non-2xx status code is an error. Response headers are in either
  5759. // *PlayerEventListResponse.ServerResponse.Header or (if a response was
  5760. // returned at all) in error.(*googleapi.Error).Header. Use
  5761. // googleapi.IsNotModified to check whether the returned error was
  5762. // because http.StatusNotModified was returned.
  5763. func (c *EventsListByPlayerCall) Do(opts ...googleapi.CallOption) (*PlayerEventListResponse, error) {
  5764. gensupport.SetOptions(c.urlParams_, opts...)
  5765. res, err := c.doRequest("json")
  5766. if res != nil && res.StatusCode == http.StatusNotModified {
  5767. if res.Body != nil {
  5768. res.Body.Close()
  5769. }
  5770. return nil, &googleapi.Error{
  5771. Code: res.StatusCode,
  5772. Header: res.Header,
  5773. }
  5774. }
  5775. if err != nil {
  5776. return nil, err
  5777. }
  5778. defer googleapi.CloseBody(res)
  5779. if err := googleapi.CheckResponse(res); err != nil {
  5780. return nil, err
  5781. }
  5782. ret := &PlayerEventListResponse{
  5783. ServerResponse: googleapi.ServerResponse{
  5784. Header: res.Header,
  5785. HTTPStatusCode: res.StatusCode,
  5786. },
  5787. }
  5788. target := &ret
  5789. if err := gensupport.DecodeResponse(target, res); err != nil {
  5790. return nil, err
  5791. }
  5792. return ret, nil
  5793. // {
  5794. // "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.",
  5795. // "httpMethod": "GET",
  5796. // "id": "games.events.listByPlayer",
  5797. // "parameters": {
  5798. // "language": {
  5799. // "description": "The preferred language to use for strings returned by this method.",
  5800. // "location": "query",
  5801. // "type": "string"
  5802. // },
  5803. // "maxResults": {
  5804. // "description": "The maximum number of events to return in the response, used for paging. For any response, the actual number of events to return may be less than the specified maxResults.",
  5805. // "format": "int32",
  5806. // "location": "query",
  5807. // "maximum": "100",
  5808. // "minimum": "1",
  5809. // "type": "integer"
  5810. // },
  5811. // "pageToken": {
  5812. // "description": "The token returned by the previous request.",
  5813. // "location": "query",
  5814. // "type": "string"
  5815. // }
  5816. // },
  5817. // "path": "events",
  5818. // "response": {
  5819. // "$ref": "PlayerEventListResponse"
  5820. // },
  5821. // "scopes": [
  5822. // "https://www.googleapis.com/auth/games",
  5823. // "https://www.googleapis.com/auth/plus.me"
  5824. // ]
  5825. // }
  5826. }
  5827. // Pages invokes f for each page of results.
  5828. // A non-nil error returned from f will halt the iteration.
  5829. // The provided context supersedes any context provided to the Context method.
  5830. func (c *EventsListByPlayerCall) Pages(ctx context.Context, f func(*PlayerEventListResponse) error) error {
  5831. c.ctx_ = ctx
  5832. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5833. for {
  5834. x, err := c.Do()
  5835. if err != nil {
  5836. return err
  5837. }
  5838. if err := f(x); err != nil {
  5839. return err
  5840. }
  5841. if x.NextPageToken == "" {
  5842. return nil
  5843. }
  5844. c.PageToken(x.NextPageToken)
  5845. }
  5846. }
  5847. // method id "games.events.listDefinitions":
  5848. type EventsListDefinitionsCall struct {
  5849. s *Service
  5850. urlParams_ gensupport.URLParams
  5851. ifNoneMatch_ string
  5852. ctx_ context.Context
  5853. header_ http.Header
  5854. }
  5855. // ListDefinitions: Returns a list of the event definitions in this
  5856. // application.
  5857. func (r *EventsService) ListDefinitions() *EventsListDefinitionsCall {
  5858. c := &EventsListDefinitionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5859. return c
  5860. }
  5861. // Language sets the optional parameter "language": The preferred
  5862. // language to use for strings returned by this method.
  5863. func (c *EventsListDefinitionsCall) Language(language string) *EventsListDefinitionsCall {
  5864. c.urlParams_.Set("language", language)
  5865. return c
  5866. }
  5867. // MaxResults sets the optional parameter "maxResults": The maximum
  5868. // number of event definitions to return in the response, used for
  5869. // paging. For any response, the actual number of event definitions to
  5870. // return may be less than the specified maxResults.
  5871. func (c *EventsListDefinitionsCall) MaxResults(maxResults int64) *EventsListDefinitionsCall {
  5872. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5873. return c
  5874. }
  5875. // PageToken sets the optional parameter "pageToken": The token returned
  5876. // by the previous request.
  5877. func (c *EventsListDefinitionsCall) PageToken(pageToken string) *EventsListDefinitionsCall {
  5878. c.urlParams_.Set("pageToken", pageToken)
  5879. return c
  5880. }
  5881. // Fields allows partial responses to be retrieved. See
  5882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5883. // for more information.
  5884. func (c *EventsListDefinitionsCall) Fields(s ...googleapi.Field) *EventsListDefinitionsCall {
  5885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5886. return c
  5887. }
  5888. // IfNoneMatch sets the optional parameter which makes the operation
  5889. // fail if the object's ETag matches the given value. This is useful for
  5890. // getting updates only after the object has changed since the last
  5891. // request. Use googleapi.IsNotModified to check whether the response
  5892. // error from Do is the result of In-None-Match.
  5893. func (c *EventsListDefinitionsCall) IfNoneMatch(entityTag string) *EventsListDefinitionsCall {
  5894. c.ifNoneMatch_ = entityTag
  5895. return c
  5896. }
  5897. // Context sets the context to be used in this call's Do method. Any
  5898. // pending HTTP request will be aborted if the provided context is
  5899. // canceled.
  5900. func (c *EventsListDefinitionsCall) Context(ctx context.Context) *EventsListDefinitionsCall {
  5901. c.ctx_ = ctx
  5902. return c
  5903. }
  5904. // Header returns an http.Header that can be modified by the caller to
  5905. // add HTTP headers to the request.
  5906. func (c *EventsListDefinitionsCall) Header() http.Header {
  5907. if c.header_ == nil {
  5908. c.header_ = make(http.Header)
  5909. }
  5910. return c.header_
  5911. }
  5912. func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error) {
  5913. reqHeaders := make(http.Header)
  5914. for k, v := range c.header_ {
  5915. reqHeaders[k] = v
  5916. }
  5917. reqHeaders.Set("User-Agent", c.s.userAgent())
  5918. if c.ifNoneMatch_ != "" {
  5919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5920. }
  5921. var body io.Reader = nil
  5922. c.urlParams_.Set("alt", alt)
  5923. c.urlParams_.Set("prettyPrint", "false")
  5924. urls := googleapi.ResolveRelative(c.s.BasePath, "eventDefinitions")
  5925. urls += "?" + c.urlParams_.Encode()
  5926. req, err := http.NewRequest("GET", urls, body)
  5927. if err != nil {
  5928. return nil, err
  5929. }
  5930. req.Header = reqHeaders
  5931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5932. }
  5933. // Do executes the "games.events.listDefinitions" call.
  5934. // Exactly one of *EventDefinitionListResponse or error will be non-nil.
  5935. // Any non-2xx status code is an error. Response headers are in either
  5936. // *EventDefinitionListResponse.ServerResponse.Header or (if a response
  5937. // was returned at all) in error.(*googleapi.Error).Header. Use
  5938. // googleapi.IsNotModified to check whether the returned error was
  5939. // because http.StatusNotModified was returned.
  5940. func (c *EventsListDefinitionsCall) Do(opts ...googleapi.CallOption) (*EventDefinitionListResponse, error) {
  5941. gensupport.SetOptions(c.urlParams_, opts...)
  5942. res, err := c.doRequest("json")
  5943. if res != nil && res.StatusCode == http.StatusNotModified {
  5944. if res.Body != nil {
  5945. res.Body.Close()
  5946. }
  5947. return nil, &googleapi.Error{
  5948. Code: res.StatusCode,
  5949. Header: res.Header,
  5950. }
  5951. }
  5952. if err != nil {
  5953. return nil, err
  5954. }
  5955. defer googleapi.CloseBody(res)
  5956. if err := googleapi.CheckResponse(res); err != nil {
  5957. return nil, err
  5958. }
  5959. ret := &EventDefinitionListResponse{
  5960. ServerResponse: googleapi.ServerResponse{
  5961. Header: res.Header,
  5962. HTTPStatusCode: res.StatusCode,
  5963. },
  5964. }
  5965. target := &ret
  5966. if err := gensupport.DecodeResponse(target, res); err != nil {
  5967. return nil, err
  5968. }
  5969. return ret, nil
  5970. // {
  5971. // "description": "Returns a list of the event definitions in this application.",
  5972. // "httpMethod": "GET",
  5973. // "id": "games.events.listDefinitions",
  5974. // "parameters": {
  5975. // "language": {
  5976. // "description": "The preferred language to use for strings returned by this method.",
  5977. // "location": "query",
  5978. // "type": "string"
  5979. // },
  5980. // "maxResults": {
  5981. // "description": "The maximum number of event definitions to return in the response, used for paging. For any response, the actual number of event definitions to return may be less than the specified maxResults.",
  5982. // "format": "int32",
  5983. // "location": "query",
  5984. // "maximum": "100",
  5985. // "minimum": "1",
  5986. // "type": "integer"
  5987. // },
  5988. // "pageToken": {
  5989. // "description": "The token returned by the previous request.",
  5990. // "location": "query",
  5991. // "type": "string"
  5992. // }
  5993. // },
  5994. // "path": "eventDefinitions",
  5995. // "response": {
  5996. // "$ref": "EventDefinitionListResponse"
  5997. // },
  5998. // "scopes": [
  5999. // "https://www.googleapis.com/auth/games",
  6000. // "https://www.googleapis.com/auth/plus.me"
  6001. // ]
  6002. // }
  6003. }
  6004. // Pages invokes f for each page of results.
  6005. // A non-nil error returned from f will halt the iteration.
  6006. // The provided context supersedes any context provided to the Context method.
  6007. func (c *EventsListDefinitionsCall) Pages(ctx context.Context, f func(*EventDefinitionListResponse) error) error {
  6008. c.ctx_ = ctx
  6009. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6010. for {
  6011. x, err := c.Do()
  6012. if err != nil {
  6013. return err
  6014. }
  6015. if err := f(x); err != nil {
  6016. return err
  6017. }
  6018. if x.NextPageToken == "" {
  6019. return nil
  6020. }
  6021. c.PageToken(x.NextPageToken)
  6022. }
  6023. }
  6024. // method id "games.events.record":
  6025. type EventsRecordCall struct {
  6026. s *Service
  6027. eventrecordrequest *EventRecordRequest
  6028. urlParams_ gensupport.URLParams
  6029. ctx_ context.Context
  6030. header_ http.Header
  6031. }
  6032. // Record: Records a batch of changes to the number of times events have
  6033. // occurred for the currently authenticated user of this application.
  6034. func (r *EventsService) Record(eventrecordrequest *EventRecordRequest) *EventsRecordCall {
  6035. c := &EventsRecordCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6036. c.eventrecordrequest = eventrecordrequest
  6037. return c
  6038. }
  6039. // Language sets the optional parameter "language": The preferred
  6040. // language to use for strings returned by this method.
  6041. func (c *EventsRecordCall) Language(language string) *EventsRecordCall {
  6042. c.urlParams_.Set("language", language)
  6043. return c
  6044. }
  6045. // Fields allows partial responses to be retrieved. See
  6046. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6047. // for more information.
  6048. func (c *EventsRecordCall) Fields(s ...googleapi.Field) *EventsRecordCall {
  6049. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6050. return c
  6051. }
  6052. // Context sets the context to be used in this call's Do method. Any
  6053. // pending HTTP request will be aborted if the provided context is
  6054. // canceled.
  6055. func (c *EventsRecordCall) Context(ctx context.Context) *EventsRecordCall {
  6056. c.ctx_ = ctx
  6057. return c
  6058. }
  6059. // Header returns an http.Header that can be modified by the caller to
  6060. // add HTTP headers to the request.
  6061. func (c *EventsRecordCall) Header() http.Header {
  6062. if c.header_ == nil {
  6063. c.header_ = make(http.Header)
  6064. }
  6065. return c.header_
  6066. }
  6067. func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) {
  6068. reqHeaders := make(http.Header)
  6069. for k, v := range c.header_ {
  6070. reqHeaders[k] = v
  6071. }
  6072. reqHeaders.Set("User-Agent", c.s.userAgent())
  6073. var body io.Reader = nil
  6074. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest)
  6075. if err != nil {
  6076. return nil, err
  6077. }
  6078. reqHeaders.Set("Content-Type", "application/json")
  6079. c.urlParams_.Set("alt", alt)
  6080. c.urlParams_.Set("prettyPrint", "false")
  6081. urls := googleapi.ResolveRelative(c.s.BasePath, "events")
  6082. urls += "?" + c.urlParams_.Encode()
  6083. req, err := http.NewRequest("POST", urls, body)
  6084. if err != nil {
  6085. return nil, err
  6086. }
  6087. req.Header = reqHeaders
  6088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6089. }
  6090. // Do executes the "games.events.record" call.
  6091. // Exactly one of *EventUpdateResponse or error will be non-nil. Any
  6092. // non-2xx status code is an error. Response headers are in either
  6093. // *EventUpdateResponse.ServerResponse.Header or (if a response was
  6094. // returned at all) in error.(*googleapi.Error).Header. Use
  6095. // googleapi.IsNotModified to check whether the returned error was
  6096. // because http.StatusNotModified was returned.
  6097. func (c *EventsRecordCall) Do(opts ...googleapi.CallOption) (*EventUpdateResponse, error) {
  6098. gensupport.SetOptions(c.urlParams_, opts...)
  6099. res, err := c.doRequest("json")
  6100. if res != nil && res.StatusCode == http.StatusNotModified {
  6101. if res.Body != nil {
  6102. res.Body.Close()
  6103. }
  6104. return nil, &googleapi.Error{
  6105. Code: res.StatusCode,
  6106. Header: res.Header,
  6107. }
  6108. }
  6109. if err != nil {
  6110. return nil, err
  6111. }
  6112. defer googleapi.CloseBody(res)
  6113. if err := googleapi.CheckResponse(res); err != nil {
  6114. return nil, err
  6115. }
  6116. ret := &EventUpdateResponse{
  6117. ServerResponse: googleapi.ServerResponse{
  6118. Header: res.Header,
  6119. HTTPStatusCode: res.StatusCode,
  6120. },
  6121. }
  6122. target := &ret
  6123. if err := gensupport.DecodeResponse(target, res); err != nil {
  6124. return nil, err
  6125. }
  6126. return ret, nil
  6127. // {
  6128. // "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.",
  6129. // "httpMethod": "POST",
  6130. // "id": "games.events.record",
  6131. // "parameters": {
  6132. // "language": {
  6133. // "description": "The preferred language to use for strings returned by this method.",
  6134. // "location": "query",
  6135. // "type": "string"
  6136. // }
  6137. // },
  6138. // "path": "events",
  6139. // "request": {
  6140. // "$ref": "EventRecordRequest"
  6141. // },
  6142. // "response": {
  6143. // "$ref": "EventUpdateResponse"
  6144. // },
  6145. // "scopes": [
  6146. // "https://www.googleapis.com/auth/games",
  6147. // "https://www.googleapis.com/auth/plus.me"
  6148. // ]
  6149. // }
  6150. }
  6151. // method id "games.leaderboards.get":
  6152. type LeaderboardsGetCall struct {
  6153. s *Service
  6154. leaderboardId string
  6155. urlParams_ gensupport.URLParams
  6156. ifNoneMatch_ string
  6157. ctx_ context.Context
  6158. header_ http.Header
  6159. }
  6160. // Get: Retrieves the metadata of the leaderboard with the given ID.
  6161. func (r *LeaderboardsService) Get(leaderboardId string) *LeaderboardsGetCall {
  6162. c := &LeaderboardsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6163. c.leaderboardId = leaderboardId
  6164. return c
  6165. }
  6166. // Language sets the optional parameter "language": The preferred
  6167. // language to use for strings returned by this method.
  6168. func (c *LeaderboardsGetCall) Language(language string) *LeaderboardsGetCall {
  6169. c.urlParams_.Set("language", language)
  6170. return c
  6171. }
  6172. // Fields allows partial responses to be retrieved. See
  6173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6174. // for more information.
  6175. func (c *LeaderboardsGetCall) Fields(s ...googleapi.Field) *LeaderboardsGetCall {
  6176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6177. return c
  6178. }
  6179. // IfNoneMatch sets the optional parameter which makes the operation
  6180. // fail if the object's ETag matches the given value. This is useful for
  6181. // getting updates only after the object has changed since the last
  6182. // request. Use googleapi.IsNotModified to check whether the response
  6183. // error from Do is the result of In-None-Match.
  6184. func (c *LeaderboardsGetCall) IfNoneMatch(entityTag string) *LeaderboardsGetCall {
  6185. c.ifNoneMatch_ = entityTag
  6186. return c
  6187. }
  6188. // Context sets the context to be used in this call's Do method. Any
  6189. // pending HTTP request will be aborted if the provided context is
  6190. // canceled.
  6191. func (c *LeaderboardsGetCall) Context(ctx context.Context) *LeaderboardsGetCall {
  6192. c.ctx_ = ctx
  6193. return c
  6194. }
  6195. // Header returns an http.Header that can be modified by the caller to
  6196. // add HTTP headers to the request.
  6197. func (c *LeaderboardsGetCall) Header() http.Header {
  6198. if c.header_ == nil {
  6199. c.header_ = make(http.Header)
  6200. }
  6201. return c.header_
  6202. }
  6203. func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) {
  6204. reqHeaders := make(http.Header)
  6205. for k, v := range c.header_ {
  6206. reqHeaders[k] = v
  6207. }
  6208. reqHeaders.Set("User-Agent", c.s.userAgent())
  6209. if c.ifNoneMatch_ != "" {
  6210. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6211. }
  6212. var body io.Reader = nil
  6213. c.urlParams_.Set("alt", alt)
  6214. c.urlParams_.Set("prettyPrint", "false")
  6215. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  6216. urls += "?" + c.urlParams_.Encode()
  6217. req, err := http.NewRequest("GET", urls, body)
  6218. if err != nil {
  6219. return nil, err
  6220. }
  6221. req.Header = reqHeaders
  6222. googleapi.Expand(req.URL, map[string]string{
  6223. "leaderboardId": c.leaderboardId,
  6224. })
  6225. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6226. }
  6227. // Do executes the "games.leaderboards.get" call.
  6228. // Exactly one of *Leaderboard or error will be non-nil. Any non-2xx
  6229. // status code is an error. Response headers are in either
  6230. // *Leaderboard.ServerResponse.Header or (if a response was returned at
  6231. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6232. // to check whether the returned error was because
  6233. // http.StatusNotModified was returned.
  6234. func (c *LeaderboardsGetCall) Do(opts ...googleapi.CallOption) (*Leaderboard, error) {
  6235. gensupport.SetOptions(c.urlParams_, opts...)
  6236. res, err := c.doRequest("json")
  6237. if res != nil && res.StatusCode == http.StatusNotModified {
  6238. if res.Body != nil {
  6239. res.Body.Close()
  6240. }
  6241. return nil, &googleapi.Error{
  6242. Code: res.StatusCode,
  6243. Header: res.Header,
  6244. }
  6245. }
  6246. if err != nil {
  6247. return nil, err
  6248. }
  6249. defer googleapi.CloseBody(res)
  6250. if err := googleapi.CheckResponse(res); err != nil {
  6251. return nil, err
  6252. }
  6253. ret := &Leaderboard{
  6254. ServerResponse: googleapi.ServerResponse{
  6255. Header: res.Header,
  6256. HTTPStatusCode: res.StatusCode,
  6257. },
  6258. }
  6259. target := &ret
  6260. if err := gensupport.DecodeResponse(target, res); err != nil {
  6261. return nil, err
  6262. }
  6263. return ret, nil
  6264. // {
  6265. // "description": "Retrieves the metadata of the leaderboard with the given ID.",
  6266. // "httpMethod": "GET",
  6267. // "id": "games.leaderboards.get",
  6268. // "parameterOrder": [
  6269. // "leaderboardId"
  6270. // ],
  6271. // "parameters": {
  6272. // "language": {
  6273. // "description": "The preferred language to use for strings returned by this method.",
  6274. // "location": "query",
  6275. // "type": "string"
  6276. // },
  6277. // "leaderboardId": {
  6278. // "description": "The ID of the leaderboard.",
  6279. // "location": "path",
  6280. // "required": true,
  6281. // "type": "string"
  6282. // }
  6283. // },
  6284. // "path": "leaderboards/{leaderboardId}",
  6285. // "response": {
  6286. // "$ref": "Leaderboard"
  6287. // },
  6288. // "scopes": [
  6289. // "https://www.googleapis.com/auth/games",
  6290. // "https://www.googleapis.com/auth/plus.me"
  6291. // ]
  6292. // }
  6293. }
  6294. // method id "games.leaderboards.list":
  6295. type LeaderboardsListCall struct {
  6296. s *Service
  6297. urlParams_ gensupport.URLParams
  6298. ifNoneMatch_ string
  6299. ctx_ context.Context
  6300. header_ http.Header
  6301. }
  6302. // List: Lists all the leaderboard metadata for your application.
  6303. func (r *LeaderboardsService) List() *LeaderboardsListCall {
  6304. c := &LeaderboardsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6305. return c
  6306. }
  6307. // Language sets the optional parameter "language": The preferred
  6308. // language to use for strings returned by this method.
  6309. func (c *LeaderboardsListCall) Language(language string) *LeaderboardsListCall {
  6310. c.urlParams_.Set("language", language)
  6311. return c
  6312. }
  6313. // MaxResults sets the optional parameter "maxResults": The maximum
  6314. // number of leaderboards to return in the response. For any response,
  6315. // the actual number of leaderboards returned may be less than the
  6316. // specified maxResults.
  6317. func (c *LeaderboardsListCall) MaxResults(maxResults int64) *LeaderboardsListCall {
  6318. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6319. return c
  6320. }
  6321. // PageToken sets the optional parameter "pageToken": The token returned
  6322. // by the previous request.
  6323. func (c *LeaderboardsListCall) PageToken(pageToken string) *LeaderboardsListCall {
  6324. c.urlParams_.Set("pageToken", pageToken)
  6325. return c
  6326. }
  6327. // Fields allows partial responses to be retrieved. See
  6328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6329. // for more information.
  6330. func (c *LeaderboardsListCall) Fields(s ...googleapi.Field) *LeaderboardsListCall {
  6331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6332. return c
  6333. }
  6334. // IfNoneMatch sets the optional parameter which makes the operation
  6335. // fail if the object's ETag matches the given value. This is useful for
  6336. // getting updates only after the object has changed since the last
  6337. // request. Use googleapi.IsNotModified to check whether the response
  6338. // error from Do is the result of In-None-Match.
  6339. func (c *LeaderboardsListCall) IfNoneMatch(entityTag string) *LeaderboardsListCall {
  6340. c.ifNoneMatch_ = entityTag
  6341. return c
  6342. }
  6343. // Context sets the context to be used in this call's Do method. Any
  6344. // pending HTTP request will be aborted if the provided context is
  6345. // canceled.
  6346. func (c *LeaderboardsListCall) Context(ctx context.Context) *LeaderboardsListCall {
  6347. c.ctx_ = ctx
  6348. return c
  6349. }
  6350. // Header returns an http.Header that can be modified by the caller to
  6351. // add HTTP headers to the request.
  6352. func (c *LeaderboardsListCall) Header() http.Header {
  6353. if c.header_ == nil {
  6354. c.header_ = make(http.Header)
  6355. }
  6356. return c.header_
  6357. }
  6358. func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) {
  6359. reqHeaders := make(http.Header)
  6360. for k, v := range c.header_ {
  6361. reqHeaders[k] = v
  6362. }
  6363. reqHeaders.Set("User-Agent", c.s.userAgent())
  6364. if c.ifNoneMatch_ != "" {
  6365. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6366. }
  6367. var body io.Reader = nil
  6368. c.urlParams_.Set("alt", alt)
  6369. c.urlParams_.Set("prettyPrint", "false")
  6370. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards")
  6371. urls += "?" + c.urlParams_.Encode()
  6372. req, err := http.NewRequest("GET", urls, body)
  6373. if err != nil {
  6374. return nil, err
  6375. }
  6376. req.Header = reqHeaders
  6377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6378. }
  6379. // Do executes the "games.leaderboards.list" call.
  6380. // Exactly one of *LeaderboardListResponse or error will be non-nil. Any
  6381. // non-2xx status code is an error. Response headers are in either
  6382. // *LeaderboardListResponse.ServerResponse.Header or (if a response was
  6383. // returned at all) in error.(*googleapi.Error).Header. Use
  6384. // googleapi.IsNotModified to check whether the returned error was
  6385. // because http.StatusNotModified was returned.
  6386. func (c *LeaderboardsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardListResponse, error) {
  6387. gensupport.SetOptions(c.urlParams_, opts...)
  6388. res, err := c.doRequest("json")
  6389. if res != nil && res.StatusCode == http.StatusNotModified {
  6390. if res.Body != nil {
  6391. res.Body.Close()
  6392. }
  6393. return nil, &googleapi.Error{
  6394. Code: res.StatusCode,
  6395. Header: res.Header,
  6396. }
  6397. }
  6398. if err != nil {
  6399. return nil, err
  6400. }
  6401. defer googleapi.CloseBody(res)
  6402. if err := googleapi.CheckResponse(res); err != nil {
  6403. return nil, err
  6404. }
  6405. ret := &LeaderboardListResponse{
  6406. ServerResponse: googleapi.ServerResponse{
  6407. Header: res.Header,
  6408. HTTPStatusCode: res.StatusCode,
  6409. },
  6410. }
  6411. target := &ret
  6412. if err := gensupport.DecodeResponse(target, res); err != nil {
  6413. return nil, err
  6414. }
  6415. return ret, nil
  6416. // {
  6417. // "description": "Lists all the leaderboard metadata for your application.",
  6418. // "httpMethod": "GET",
  6419. // "id": "games.leaderboards.list",
  6420. // "parameters": {
  6421. // "language": {
  6422. // "description": "The preferred language to use for strings returned by this method.",
  6423. // "location": "query",
  6424. // "type": "string"
  6425. // },
  6426. // "maxResults": {
  6427. // "description": "The maximum number of leaderboards to return in the response. For any response, the actual number of leaderboards returned may be less than the specified maxResults.",
  6428. // "format": "int32",
  6429. // "location": "query",
  6430. // "maximum": "200",
  6431. // "minimum": "1",
  6432. // "type": "integer"
  6433. // },
  6434. // "pageToken": {
  6435. // "description": "The token returned by the previous request.",
  6436. // "location": "query",
  6437. // "type": "string"
  6438. // }
  6439. // },
  6440. // "path": "leaderboards",
  6441. // "response": {
  6442. // "$ref": "LeaderboardListResponse"
  6443. // },
  6444. // "scopes": [
  6445. // "https://www.googleapis.com/auth/games",
  6446. // "https://www.googleapis.com/auth/plus.me"
  6447. // ]
  6448. // }
  6449. }
  6450. // Pages invokes f for each page of results.
  6451. // A non-nil error returned from f will halt the iteration.
  6452. // The provided context supersedes any context provided to the Context method.
  6453. func (c *LeaderboardsListCall) Pages(ctx context.Context, f func(*LeaderboardListResponse) error) error {
  6454. c.ctx_ = ctx
  6455. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6456. for {
  6457. x, err := c.Do()
  6458. if err != nil {
  6459. return err
  6460. }
  6461. if err := f(x); err != nil {
  6462. return err
  6463. }
  6464. if x.NextPageToken == "" {
  6465. return nil
  6466. }
  6467. c.PageToken(x.NextPageToken)
  6468. }
  6469. }
  6470. // method id "games.metagame.getMetagameConfig":
  6471. type MetagameGetMetagameConfigCall struct {
  6472. s *Service
  6473. urlParams_ gensupport.URLParams
  6474. ifNoneMatch_ string
  6475. ctx_ context.Context
  6476. header_ http.Header
  6477. }
  6478. // GetMetagameConfig: Return the metagame configuration data for the
  6479. // calling application.
  6480. func (r *MetagameService) GetMetagameConfig() *MetagameGetMetagameConfigCall {
  6481. c := &MetagameGetMetagameConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6482. return c
  6483. }
  6484. // Fields allows partial responses to be retrieved. See
  6485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6486. // for more information.
  6487. func (c *MetagameGetMetagameConfigCall) Fields(s ...googleapi.Field) *MetagameGetMetagameConfigCall {
  6488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6489. return c
  6490. }
  6491. // IfNoneMatch sets the optional parameter which makes the operation
  6492. // fail if the object's ETag matches the given value. This is useful for
  6493. // getting updates only after the object has changed since the last
  6494. // request. Use googleapi.IsNotModified to check whether the response
  6495. // error from Do is the result of In-None-Match.
  6496. func (c *MetagameGetMetagameConfigCall) IfNoneMatch(entityTag string) *MetagameGetMetagameConfigCall {
  6497. c.ifNoneMatch_ = entityTag
  6498. return c
  6499. }
  6500. // Context sets the context to be used in this call's Do method. Any
  6501. // pending HTTP request will be aborted if the provided context is
  6502. // canceled.
  6503. func (c *MetagameGetMetagameConfigCall) Context(ctx context.Context) *MetagameGetMetagameConfigCall {
  6504. c.ctx_ = ctx
  6505. return c
  6506. }
  6507. // Header returns an http.Header that can be modified by the caller to
  6508. // add HTTP headers to the request.
  6509. func (c *MetagameGetMetagameConfigCall) Header() http.Header {
  6510. if c.header_ == nil {
  6511. c.header_ = make(http.Header)
  6512. }
  6513. return c.header_
  6514. }
  6515. func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, error) {
  6516. reqHeaders := make(http.Header)
  6517. for k, v := range c.header_ {
  6518. reqHeaders[k] = v
  6519. }
  6520. reqHeaders.Set("User-Agent", c.s.userAgent())
  6521. if c.ifNoneMatch_ != "" {
  6522. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6523. }
  6524. var body io.Reader = nil
  6525. c.urlParams_.Set("alt", alt)
  6526. c.urlParams_.Set("prettyPrint", "false")
  6527. urls := googleapi.ResolveRelative(c.s.BasePath, "metagameConfig")
  6528. urls += "?" + c.urlParams_.Encode()
  6529. req, err := http.NewRequest("GET", urls, body)
  6530. if err != nil {
  6531. return nil, err
  6532. }
  6533. req.Header = reqHeaders
  6534. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6535. }
  6536. // Do executes the "games.metagame.getMetagameConfig" call.
  6537. // Exactly one of *MetagameConfig or error will be non-nil. Any non-2xx
  6538. // status code is an error. Response headers are in either
  6539. // *MetagameConfig.ServerResponse.Header or (if a response was returned
  6540. // at all) in error.(*googleapi.Error).Header. Use
  6541. // googleapi.IsNotModified to check whether the returned error was
  6542. // because http.StatusNotModified was returned.
  6543. func (c *MetagameGetMetagameConfigCall) Do(opts ...googleapi.CallOption) (*MetagameConfig, error) {
  6544. gensupport.SetOptions(c.urlParams_, opts...)
  6545. res, err := c.doRequest("json")
  6546. if res != nil && res.StatusCode == http.StatusNotModified {
  6547. if res.Body != nil {
  6548. res.Body.Close()
  6549. }
  6550. return nil, &googleapi.Error{
  6551. Code: res.StatusCode,
  6552. Header: res.Header,
  6553. }
  6554. }
  6555. if err != nil {
  6556. return nil, err
  6557. }
  6558. defer googleapi.CloseBody(res)
  6559. if err := googleapi.CheckResponse(res); err != nil {
  6560. return nil, err
  6561. }
  6562. ret := &MetagameConfig{
  6563. ServerResponse: googleapi.ServerResponse{
  6564. Header: res.Header,
  6565. HTTPStatusCode: res.StatusCode,
  6566. },
  6567. }
  6568. target := &ret
  6569. if err := gensupport.DecodeResponse(target, res); err != nil {
  6570. return nil, err
  6571. }
  6572. return ret, nil
  6573. // {
  6574. // "description": "Return the metagame configuration data for the calling application.",
  6575. // "httpMethod": "GET",
  6576. // "id": "games.metagame.getMetagameConfig",
  6577. // "path": "metagameConfig",
  6578. // "response": {
  6579. // "$ref": "MetagameConfig"
  6580. // },
  6581. // "scopes": [
  6582. // "https://www.googleapis.com/auth/games",
  6583. // "https://www.googleapis.com/auth/plus.me"
  6584. // ]
  6585. // }
  6586. }
  6587. // method id "games.metagame.listCategoriesByPlayer":
  6588. type MetagameListCategoriesByPlayerCall struct {
  6589. s *Service
  6590. playerId string
  6591. collection string
  6592. urlParams_ gensupport.URLParams
  6593. ifNoneMatch_ string
  6594. ctx_ context.Context
  6595. header_ http.Header
  6596. }
  6597. // ListCategoriesByPlayer: List play data aggregated per category for
  6598. // the player corresponding to playerId.
  6599. func (r *MetagameService) ListCategoriesByPlayer(playerId string, collection string) *MetagameListCategoriesByPlayerCall {
  6600. c := &MetagameListCategoriesByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6601. c.playerId = playerId
  6602. c.collection = collection
  6603. return c
  6604. }
  6605. // Language sets the optional parameter "language": The preferred
  6606. // language to use for strings returned by this method.
  6607. func (c *MetagameListCategoriesByPlayerCall) Language(language string) *MetagameListCategoriesByPlayerCall {
  6608. c.urlParams_.Set("language", language)
  6609. return c
  6610. }
  6611. // MaxResults sets the optional parameter "maxResults": The maximum
  6612. // number of category resources to return in the response, used for
  6613. // paging. For any response, the actual number of category resources
  6614. // returned may be less than the specified maxResults.
  6615. func (c *MetagameListCategoriesByPlayerCall) MaxResults(maxResults int64) *MetagameListCategoriesByPlayerCall {
  6616. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6617. return c
  6618. }
  6619. // PageToken sets the optional parameter "pageToken": The token returned
  6620. // by the previous request.
  6621. func (c *MetagameListCategoriesByPlayerCall) PageToken(pageToken string) *MetagameListCategoriesByPlayerCall {
  6622. c.urlParams_.Set("pageToken", pageToken)
  6623. return c
  6624. }
  6625. // Fields allows partial responses to be retrieved. See
  6626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6627. // for more information.
  6628. func (c *MetagameListCategoriesByPlayerCall) Fields(s ...googleapi.Field) *MetagameListCategoriesByPlayerCall {
  6629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6630. return c
  6631. }
  6632. // IfNoneMatch sets the optional parameter which makes the operation
  6633. // fail if the object's ETag matches the given value. This is useful for
  6634. // getting updates only after the object has changed since the last
  6635. // request. Use googleapi.IsNotModified to check whether the response
  6636. // error from Do is the result of In-None-Match.
  6637. func (c *MetagameListCategoriesByPlayerCall) IfNoneMatch(entityTag string) *MetagameListCategoriesByPlayerCall {
  6638. c.ifNoneMatch_ = entityTag
  6639. return c
  6640. }
  6641. // Context sets the context to be used in this call's Do method. Any
  6642. // pending HTTP request will be aborted if the provided context is
  6643. // canceled.
  6644. func (c *MetagameListCategoriesByPlayerCall) Context(ctx context.Context) *MetagameListCategoriesByPlayerCall {
  6645. c.ctx_ = ctx
  6646. return c
  6647. }
  6648. // Header returns an http.Header that can be modified by the caller to
  6649. // add HTTP headers to the request.
  6650. func (c *MetagameListCategoriesByPlayerCall) Header() http.Header {
  6651. if c.header_ == nil {
  6652. c.header_ = make(http.Header)
  6653. }
  6654. return c.header_
  6655. }
  6656. func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Response, error) {
  6657. reqHeaders := make(http.Header)
  6658. for k, v := range c.header_ {
  6659. reqHeaders[k] = v
  6660. }
  6661. reqHeaders.Set("User-Agent", c.s.userAgent())
  6662. if c.ifNoneMatch_ != "" {
  6663. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6664. }
  6665. var body io.Reader = nil
  6666. c.urlParams_.Set("alt", alt)
  6667. c.urlParams_.Set("prettyPrint", "false")
  6668. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/categories/{collection}")
  6669. urls += "?" + c.urlParams_.Encode()
  6670. req, err := http.NewRequest("GET", urls, body)
  6671. if err != nil {
  6672. return nil, err
  6673. }
  6674. req.Header = reqHeaders
  6675. googleapi.Expand(req.URL, map[string]string{
  6676. "playerId": c.playerId,
  6677. "collection": c.collection,
  6678. })
  6679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6680. }
  6681. // Do executes the "games.metagame.listCategoriesByPlayer" call.
  6682. // Exactly one of *CategoryListResponse or error will be non-nil. Any
  6683. // non-2xx status code is an error. Response headers are in either
  6684. // *CategoryListResponse.ServerResponse.Header or (if a response was
  6685. // returned at all) in error.(*googleapi.Error).Header. Use
  6686. // googleapi.IsNotModified to check whether the returned error was
  6687. // because http.StatusNotModified was returned.
  6688. func (c *MetagameListCategoriesByPlayerCall) Do(opts ...googleapi.CallOption) (*CategoryListResponse, error) {
  6689. gensupport.SetOptions(c.urlParams_, opts...)
  6690. res, err := c.doRequest("json")
  6691. if res != nil && res.StatusCode == http.StatusNotModified {
  6692. if res.Body != nil {
  6693. res.Body.Close()
  6694. }
  6695. return nil, &googleapi.Error{
  6696. Code: res.StatusCode,
  6697. Header: res.Header,
  6698. }
  6699. }
  6700. if err != nil {
  6701. return nil, err
  6702. }
  6703. defer googleapi.CloseBody(res)
  6704. if err := googleapi.CheckResponse(res); err != nil {
  6705. return nil, err
  6706. }
  6707. ret := &CategoryListResponse{
  6708. ServerResponse: googleapi.ServerResponse{
  6709. Header: res.Header,
  6710. HTTPStatusCode: res.StatusCode,
  6711. },
  6712. }
  6713. target := &ret
  6714. if err := gensupport.DecodeResponse(target, res); err != nil {
  6715. return nil, err
  6716. }
  6717. return ret, nil
  6718. // {
  6719. // "description": "List play data aggregated per category for the player corresponding to playerId.",
  6720. // "httpMethod": "GET",
  6721. // "id": "games.metagame.listCategoriesByPlayer",
  6722. // "parameterOrder": [
  6723. // "playerId",
  6724. // "collection"
  6725. // ],
  6726. // "parameters": {
  6727. // "collection": {
  6728. // "description": "The collection of categories for which data will be returned.",
  6729. // "enum": [
  6730. // "all"
  6731. // ],
  6732. // "enumDescriptions": [
  6733. // "Retrieve data for all categories. This is the default."
  6734. // ],
  6735. // "location": "path",
  6736. // "required": true,
  6737. // "type": "string"
  6738. // },
  6739. // "language": {
  6740. // "description": "The preferred language to use for strings returned by this method.",
  6741. // "location": "query",
  6742. // "type": "string"
  6743. // },
  6744. // "maxResults": {
  6745. // "description": "The maximum number of category resources to return in the response, used for paging. For any response, the actual number of category resources returned may be less than the specified maxResults.",
  6746. // "format": "int32",
  6747. // "location": "query",
  6748. // "maximum": "100",
  6749. // "minimum": "1",
  6750. // "type": "integer"
  6751. // },
  6752. // "pageToken": {
  6753. // "description": "The token returned by the previous request.",
  6754. // "location": "query",
  6755. // "type": "string"
  6756. // },
  6757. // "playerId": {
  6758. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  6759. // "location": "path",
  6760. // "required": true,
  6761. // "type": "string"
  6762. // }
  6763. // },
  6764. // "path": "players/{playerId}/categories/{collection}",
  6765. // "response": {
  6766. // "$ref": "CategoryListResponse"
  6767. // },
  6768. // "scopes": [
  6769. // "https://www.googleapis.com/auth/games",
  6770. // "https://www.googleapis.com/auth/plus.me"
  6771. // ]
  6772. // }
  6773. }
  6774. // Pages invokes f for each page of results.
  6775. // A non-nil error returned from f will halt the iteration.
  6776. // The provided context supersedes any context provided to the Context method.
  6777. func (c *MetagameListCategoriesByPlayerCall) Pages(ctx context.Context, f func(*CategoryListResponse) error) error {
  6778. c.ctx_ = ctx
  6779. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6780. for {
  6781. x, err := c.Do()
  6782. if err != nil {
  6783. return err
  6784. }
  6785. if err := f(x); err != nil {
  6786. return err
  6787. }
  6788. if x.NextPageToken == "" {
  6789. return nil
  6790. }
  6791. c.PageToken(x.NextPageToken)
  6792. }
  6793. }
  6794. // method id "games.players.get":
  6795. type PlayersGetCall struct {
  6796. s *Service
  6797. playerId string
  6798. urlParams_ gensupport.URLParams
  6799. ifNoneMatch_ string
  6800. ctx_ context.Context
  6801. header_ http.Header
  6802. }
  6803. // Get: Retrieves the Player resource with the given ID. To retrieve the
  6804. // player for the currently authenticated user, set playerId to me.
  6805. func (r *PlayersService) Get(playerId string) *PlayersGetCall {
  6806. c := &PlayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6807. c.playerId = playerId
  6808. return c
  6809. }
  6810. // Language sets the optional parameter "language": The preferred
  6811. // language to use for strings returned by this method.
  6812. func (c *PlayersGetCall) Language(language string) *PlayersGetCall {
  6813. c.urlParams_.Set("language", language)
  6814. return c
  6815. }
  6816. // Fields allows partial responses to be retrieved. See
  6817. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6818. // for more information.
  6819. func (c *PlayersGetCall) Fields(s ...googleapi.Field) *PlayersGetCall {
  6820. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6821. return c
  6822. }
  6823. // IfNoneMatch sets the optional parameter which makes the operation
  6824. // fail if the object's ETag matches the given value. This is useful for
  6825. // getting updates only after the object has changed since the last
  6826. // request. Use googleapi.IsNotModified to check whether the response
  6827. // error from Do is the result of In-None-Match.
  6828. func (c *PlayersGetCall) IfNoneMatch(entityTag string) *PlayersGetCall {
  6829. c.ifNoneMatch_ = entityTag
  6830. return c
  6831. }
  6832. // Context sets the context to be used in this call's Do method. Any
  6833. // pending HTTP request will be aborted if the provided context is
  6834. // canceled.
  6835. func (c *PlayersGetCall) Context(ctx context.Context) *PlayersGetCall {
  6836. c.ctx_ = ctx
  6837. return c
  6838. }
  6839. // Header returns an http.Header that can be modified by the caller to
  6840. // add HTTP headers to the request.
  6841. func (c *PlayersGetCall) Header() http.Header {
  6842. if c.header_ == nil {
  6843. c.header_ = make(http.Header)
  6844. }
  6845. return c.header_
  6846. }
  6847. func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) {
  6848. reqHeaders := make(http.Header)
  6849. for k, v := range c.header_ {
  6850. reqHeaders[k] = v
  6851. }
  6852. reqHeaders.Set("User-Agent", c.s.userAgent())
  6853. if c.ifNoneMatch_ != "" {
  6854. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6855. }
  6856. var body io.Reader = nil
  6857. c.urlParams_.Set("alt", alt)
  6858. c.urlParams_.Set("prettyPrint", "false")
  6859. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}")
  6860. urls += "?" + c.urlParams_.Encode()
  6861. req, err := http.NewRequest("GET", urls, body)
  6862. if err != nil {
  6863. return nil, err
  6864. }
  6865. req.Header = reqHeaders
  6866. googleapi.Expand(req.URL, map[string]string{
  6867. "playerId": c.playerId,
  6868. })
  6869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6870. }
  6871. // Do executes the "games.players.get" call.
  6872. // Exactly one of *Player or error will be non-nil. Any non-2xx status
  6873. // code is an error. Response headers are in either
  6874. // *Player.ServerResponse.Header or (if a response was returned at all)
  6875. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6876. // check whether the returned error was because http.StatusNotModified
  6877. // was returned.
  6878. func (c *PlayersGetCall) Do(opts ...googleapi.CallOption) (*Player, error) {
  6879. gensupport.SetOptions(c.urlParams_, opts...)
  6880. res, err := c.doRequest("json")
  6881. if res != nil && res.StatusCode == http.StatusNotModified {
  6882. if res.Body != nil {
  6883. res.Body.Close()
  6884. }
  6885. return nil, &googleapi.Error{
  6886. Code: res.StatusCode,
  6887. Header: res.Header,
  6888. }
  6889. }
  6890. if err != nil {
  6891. return nil, err
  6892. }
  6893. defer googleapi.CloseBody(res)
  6894. if err := googleapi.CheckResponse(res); err != nil {
  6895. return nil, err
  6896. }
  6897. ret := &Player{
  6898. ServerResponse: googleapi.ServerResponse{
  6899. Header: res.Header,
  6900. HTTPStatusCode: res.StatusCode,
  6901. },
  6902. }
  6903. target := &ret
  6904. if err := gensupport.DecodeResponse(target, res); err != nil {
  6905. return nil, err
  6906. }
  6907. return ret, nil
  6908. // {
  6909. // "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.",
  6910. // "httpMethod": "GET",
  6911. // "id": "games.players.get",
  6912. // "parameterOrder": [
  6913. // "playerId"
  6914. // ],
  6915. // "parameters": {
  6916. // "language": {
  6917. // "description": "The preferred language to use for strings returned by this method.",
  6918. // "location": "query",
  6919. // "type": "string"
  6920. // },
  6921. // "playerId": {
  6922. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  6923. // "location": "path",
  6924. // "required": true,
  6925. // "type": "string"
  6926. // }
  6927. // },
  6928. // "path": "players/{playerId}",
  6929. // "response": {
  6930. // "$ref": "Player"
  6931. // },
  6932. // "scopes": [
  6933. // "https://www.googleapis.com/auth/games",
  6934. // "https://www.googleapis.com/auth/plus.me"
  6935. // ]
  6936. // }
  6937. }
  6938. // method id "games.players.list":
  6939. type PlayersListCall struct {
  6940. s *Service
  6941. collection string
  6942. urlParams_ gensupport.URLParams
  6943. ifNoneMatch_ string
  6944. ctx_ context.Context
  6945. header_ http.Header
  6946. }
  6947. // List: Get the collection of players for the currently authenticated
  6948. // user.
  6949. func (r *PlayersService) List(collection string) *PlayersListCall {
  6950. c := &PlayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6951. c.collection = collection
  6952. return c
  6953. }
  6954. // Language sets the optional parameter "language": The preferred
  6955. // language to use for strings returned by this method.
  6956. func (c *PlayersListCall) Language(language string) *PlayersListCall {
  6957. c.urlParams_.Set("language", language)
  6958. return c
  6959. }
  6960. // MaxResults sets the optional parameter "maxResults": The maximum
  6961. // number of player resources to return in the response, used for
  6962. // paging. For any response, the actual number of player resources
  6963. // returned may be less than the specified maxResults.
  6964. func (c *PlayersListCall) MaxResults(maxResults int64) *PlayersListCall {
  6965. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6966. return c
  6967. }
  6968. // PageToken sets the optional parameter "pageToken": The token returned
  6969. // by the previous request.
  6970. func (c *PlayersListCall) PageToken(pageToken string) *PlayersListCall {
  6971. c.urlParams_.Set("pageToken", pageToken)
  6972. return c
  6973. }
  6974. // Fields allows partial responses to be retrieved. See
  6975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6976. // for more information.
  6977. func (c *PlayersListCall) Fields(s ...googleapi.Field) *PlayersListCall {
  6978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6979. return c
  6980. }
  6981. // IfNoneMatch sets the optional parameter which makes the operation
  6982. // fail if the object's ETag matches the given value. This is useful for
  6983. // getting updates only after the object has changed since the last
  6984. // request. Use googleapi.IsNotModified to check whether the response
  6985. // error from Do is the result of In-None-Match.
  6986. func (c *PlayersListCall) IfNoneMatch(entityTag string) *PlayersListCall {
  6987. c.ifNoneMatch_ = entityTag
  6988. return c
  6989. }
  6990. // Context sets the context to be used in this call's Do method. Any
  6991. // pending HTTP request will be aborted if the provided context is
  6992. // canceled.
  6993. func (c *PlayersListCall) Context(ctx context.Context) *PlayersListCall {
  6994. c.ctx_ = ctx
  6995. return c
  6996. }
  6997. // Header returns an http.Header that can be modified by the caller to
  6998. // add HTTP headers to the request.
  6999. func (c *PlayersListCall) Header() http.Header {
  7000. if c.header_ == nil {
  7001. c.header_ = make(http.Header)
  7002. }
  7003. return c.header_
  7004. }
  7005. func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) {
  7006. reqHeaders := make(http.Header)
  7007. for k, v := range c.header_ {
  7008. reqHeaders[k] = v
  7009. }
  7010. reqHeaders.Set("User-Agent", c.s.userAgent())
  7011. if c.ifNoneMatch_ != "" {
  7012. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7013. }
  7014. var body io.Reader = nil
  7015. c.urlParams_.Set("alt", alt)
  7016. c.urlParams_.Set("prettyPrint", "false")
  7017. urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}")
  7018. urls += "?" + c.urlParams_.Encode()
  7019. req, err := http.NewRequest("GET", urls, body)
  7020. if err != nil {
  7021. return nil, err
  7022. }
  7023. req.Header = reqHeaders
  7024. googleapi.Expand(req.URL, map[string]string{
  7025. "collection": c.collection,
  7026. })
  7027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7028. }
  7029. // Do executes the "games.players.list" call.
  7030. // Exactly one of *PlayerListResponse or error will be non-nil. Any
  7031. // non-2xx status code is an error. Response headers are in either
  7032. // *PlayerListResponse.ServerResponse.Header or (if a response was
  7033. // returned at all) in error.(*googleapi.Error).Header. Use
  7034. // googleapi.IsNotModified to check whether the returned error was
  7035. // because http.StatusNotModified was returned.
  7036. func (c *PlayersListCall) Do(opts ...googleapi.CallOption) (*PlayerListResponse, error) {
  7037. gensupport.SetOptions(c.urlParams_, opts...)
  7038. res, err := c.doRequest("json")
  7039. if res != nil && res.StatusCode == http.StatusNotModified {
  7040. if res.Body != nil {
  7041. res.Body.Close()
  7042. }
  7043. return nil, &googleapi.Error{
  7044. Code: res.StatusCode,
  7045. Header: res.Header,
  7046. }
  7047. }
  7048. if err != nil {
  7049. return nil, err
  7050. }
  7051. defer googleapi.CloseBody(res)
  7052. if err := googleapi.CheckResponse(res); err != nil {
  7053. return nil, err
  7054. }
  7055. ret := &PlayerListResponse{
  7056. ServerResponse: googleapi.ServerResponse{
  7057. Header: res.Header,
  7058. HTTPStatusCode: res.StatusCode,
  7059. },
  7060. }
  7061. target := &ret
  7062. if err := gensupport.DecodeResponse(target, res); err != nil {
  7063. return nil, err
  7064. }
  7065. return ret, nil
  7066. // {
  7067. // "description": "Get the collection of players for the currently authenticated user.",
  7068. // "httpMethod": "GET",
  7069. // "id": "games.players.list",
  7070. // "parameterOrder": [
  7071. // "collection"
  7072. // ],
  7073. // "parameters": {
  7074. // "collection": {
  7075. // "description": "Collection of players being retrieved",
  7076. // "enum": [
  7077. // "connected",
  7078. // "playedWith",
  7079. // "played_with",
  7080. // "visible"
  7081. // ],
  7082. // "enumDescriptions": [
  7083. // "Retrieve a list of players that are also playing this game in reverse chronological order.",
  7084. // "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.",
  7085. // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.",
  7086. // "Retrieve a list of players in the user's social graph that are visible to this game."
  7087. // ],
  7088. // "location": "path",
  7089. // "required": true,
  7090. // "type": "string"
  7091. // },
  7092. // "language": {
  7093. // "description": "The preferred language to use for strings returned by this method.",
  7094. // "location": "query",
  7095. // "type": "string"
  7096. // },
  7097. // "maxResults": {
  7098. // "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.",
  7099. // "format": "int32",
  7100. // "location": "query",
  7101. // "maximum": "50",
  7102. // "minimum": "1",
  7103. // "type": "integer"
  7104. // },
  7105. // "pageToken": {
  7106. // "description": "The token returned by the previous request.",
  7107. // "location": "query",
  7108. // "type": "string"
  7109. // }
  7110. // },
  7111. // "path": "players/me/players/{collection}",
  7112. // "response": {
  7113. // "$ref": "PlayerListResponse"
  7114. // },
  7115. // "scopes": [
  7116. // "https://www.googleapis.com/auth/games",
  7117. // "https://www.googleapis.com/auth/plus.me"
  7118. // ]
  7119. // }
  7120. }
  7121. // Pages invokes f for each page of results.
  7122. // A non-nil error returned from f will halt the iteration.
  7123. // The provided context supersedes any context provided to the Context method.
  7124. func (c *PlayersListCall) Pages(ctx context.Context, f func(*PlayerListResponse) error) error {
  7125. c.ctx_ = ctx
  7126. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7127. for {
  7128. x, err := c.Do()
  7129. if err != nil {
  7130. return err
  7131. }
  7132. if err := f(x); err != nil {
  7133. return err
  7134. }
  7135. if x.NextPageToken == "" {
  7136. return nil
  7137. }
  7138. c.PageToken(x.NextPageToken)
  7139. }
  7140. }
  7141. // method id "games.pushtokens.remove":
  7142. type PushtokensRemoveCall struct {
  7143. s *Service
  7144. pushtokenid *PushTokenId
  7145. urlParams_ gensupport.URLParams
  7146. ctx_ context.Context
  7147. header_ http.Header
  7148. }
  7149. // Remove: Removes a push token for the current user and application.
  7150. // Removing a non-existent push token will report success.
  7151. func (r *PushtokensService) Remove(pushtokenid *PushTokenId) *PushtokensRemoveCall {
  7152. c := &PushtokensRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7153. c.pushtokenid = pushtokenid
  7154. return c
  7155. }
  7156. // Fields allows partial responses to be retrieved. See
  7157. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7158. // for more information.
  7159. func (c *PushtokensRemoveCall) Fields(s ...googleapi.Field) *PushtokensRemoveCall {
  7160. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7161. return c
  7162. }
  7163. // Context sets the context to be used in this call's Do method. Any
  7164. // pending HTTP request will be aborted if the provided context is
  7165. // canceled.
  7166. func (c *PushtokensRemoveCall) Context(ctx context.Context) *PushtokensRemoveCall {
  7167. c.ctx_ = ctx
  7168. return c
  7169. }
  7170. // Header returns an http.Header that can be modified by the caller to
  7171. // add HTTP headers to the request.
  7172. func (c *PushtokensRemoveCall) Header() http.Header {
  7173. if c.header_ == nil {
  7174. c.header_ = make(http.Header)
  7175. }
  7176. return c.header_
  7177. }
  7178. func (c *PushtokensRemoveCall) doRequest(alt string) (*http.Response, error) {
  7179. reqHeaders := make(http.Header)
  7180. for k, v := range c.header_ {
  7181. reqHeaders[k] = v
  7182. }
  7183. reqHeaders.Set("User-Agent", c.s.userAgent())
  7184. var body io.Reader = nil
  7185. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid)
  7186. if err != nil {
  7187. return nil, err
  7188. }
  7189. reqHeaders.Set("Content-Type", "application/json")
  7190. c.urlParams_.Set("alt", alt)
  7191. c.urlParams_.Set("prettyPrint", "false")
  7192. urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens/remove")
  7193. urls += "?" + c.urlParams_.Encode()
  7194. req, err := http.NewRequest("POST", urls, body)
  7195. if err != nil {
  7196. return nil, err
  7197. }
  7198. req.Header = reqHeaders
  7199. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7200. }
  7201. // Do executes the "games.pushtokens.remove" call.
  7202. func (c *PushtokensRemoveCall) Do(opts ...googleapi.CallOption) error {
  7203. gensupport.SetOptions(c.urlParams_, opts...)
  7204. res, err := c.doRequest("json")
  7205. if err != nil {
  7206. return err
  7207. }
  7208. defer googleapi.CloseBody(res)
  7209. if err := googleapi.CheckResponse(res); err != nil {
  7210. return err
  7211. }
  7212. return nil
  7213. // {
  7214. // "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.",
  7215. // "httpMethod": "POST",
  7216. // "id": "games.pushtokens.remove",
  7217. // "path": "pushtokens/remove",
  7218. // "request": {
  7219. // "$ref": "PushTokenId"
  7220. // },
  7221. // "scopes": [
  7222. // "https://www.googleapis.com/auth/games",
  7223. // "https://www.googleapis.com/auth/plus.me"
  7224. // ]
  7225. // }
  7226. }
  7227. // method id "games.pushtokens.update":
  7228. type PushtokensUpdateCall struct {
  7229. s *Service
  7230. pushtoken *PushToken
  7231. urlParams_ gensupport.URLParams
  7232. ctx_ context.Context
  7233. header_ http.Header
  7234. }
  7235. // Update: Registers a push token for the current user and application.
  7236. func (r *PushtokensService) Update(pushtoken *PushToken) *PushtokensUpdateCall {
  7237. c := &PushtokensUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7238. c.pushtoken = pushtoken
  7239. return c
  7240. }
  7241. // Fields allows partial responses to be retrieved. See
  7242. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7243. // for more information.
  7244. func (c *PushtokensUpdateCall) Fields(s ...googleapi.Field) *PushtokensUpdateCall {
  7245. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7246. return c
  7247. }
  7248. // Context sets the context to be used in this call's Do method. Any
  7249. // pending HTTP request will be aborted if the provided context is
  7250. // canceled.
  7251. func (c *PushtokensUpdateCall) Context(ctx context.Context) *PushtokensUpdateCall {
  7252. c.ctx_ = ctx
  7253. return c
  7254. }
  7255. // Header returns an http.Header that can be modified by the caller to
  7256. // add HTTP headers to the request.
  7257. func (c *PushtokensUpdateCall) Header() http.Header {
  7258. if c.header_ == nil {
  7259. c.header_ = make(http.Header)
  7260. }
  7261. return c.header_
  7262. }
  7263. func (c *PushtokensUpdateCall) doRequest(alt string) (*http.Response, error) {
  7264. reqHeaders := make(http.Header)
  7265. for k, v := range c.header_ {
  7266. reqHeaders[k] = v
  7267. }
  7268. reqHeaders.Set("User-Agent", c.s.userAgent())
  7269. var body io.Reader = nil
  7270. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken)
  7271. if err != nil {
  7272. return nil, err
  7273. }
  7274. reqHeaders.Set("Content-Type", "application/json")
  7275. c.urlParams_.Set("alt", alt)
  7276. c.urlParams_.Set("prettyPrint", "false")
  7277. urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens")
  7278. urls += "?" + c.urlParams_.Encode()
  7279. req, err := http.NewRequest("PUT", urls, body)
  7280. if err != nil {
  7281. return nil, err
  7282. }
  7283. req.Header = reqHeaders
  7284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7285. }
  7286. // Do executes the "games.pushtokens.update" call.
  7287. func (c *PushtokensUpdateCall) Do(opts ...googleapi.CallOption) error {
  7288. gensupport.SetOptions(c.urlParams_, opts...)
  7289. res, err := c.doRequest("json")
  7290. if err != nil {
  7291. return err
  7292. }
  7293. defer googleapi.CloseBody(res)
  7294. if err := googleapi.CheckResponse(res); err != nil {
  7295. return err
  7296. }
  7297. return nil
  7298. // {
  7299. // "description": "Registers a push token for the current user and application.",
  7300. // "httpMethod": "PUT",
  7301. // "id": "games.pushtokens.update",
  7302. // "path": "pushtokens",
  7303. // "request": {
  7304. // "$ref": "PushToken"
  7305. // },
  7306. // "scopes": [
  7307. // "https://www.googleapis.com/auth/games",
  7308. // "https://www.googleapis.com/auth/plus.me"
  7309. // ]
  7310. // }
  7311. }
  7312. // method id "games.questMilestones.claim":
  7313. type QuestMilestonesClaimCall struct {
  7314. s *Service
  7315. questId string
  7316. milestoneId string
  7317. urlParams_ gensupport.URLParams
  7318. ctx_ context.Context
  7319. header_ http.Header
  7320. }
  7321. // Claim: Report that a reward for the milestone corresponding to
  7322. // milestoneId for the quest corresponding to questId has been claimed
  7323. // by the currently authorized user.
  7324. func (r *QuestMilestonesService) Claim(questId string, milestoneId string, requestId int64) *QuestMilestonesClaimCall {
  7325. c := &QuestMilestonesClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7326. c.questId = questId
  7327. c.milestoneId = milestoneId
  7328. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  7329. return c
  7330. }
  7331. // Fields allows partial responses to be retrieved. See
  7332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7333. // for more information.
  7334. func (c *QuestMilestonesClaimCall) Fields(s ...googleapi.Field) *QuestMilestonesClaimCall {
  7335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7336. return c
  7337. }
  7338. // Context sets the context to be used in this call's Do method. Any
  7339. // pending HTTP request will be aborted if the provided context is
  7340. // canceled.
  7341. func (c *QuestMilestonesClaimCall) Context(ctx context.Context) *QuestMilestonesClaimCall {
  7342. c.ctx_ = ctx
  7343. return c
  7344. }
  7345. // Header returns an http.Header that can be modified by the caller to
  7346. // add HTTP headers to the request.
  7347. func (c *QuestMilestonesClaimCall) Header() http.Header {
  7348. if c.header_ == nil {
  7349. c.header_ = make(http.Header)
  7350. }
  7351. return c.header_
  7352. }
  7353. func (c *QuestMilestonesClaimCall) doRequest(alt string) (*http.Response, error) {
  7354. reqHeaders := make(http.Header)
  7355. for k, v := range c.header_ {
  7356. reqHeaders[k] = v
  7357. }
  7358. reqHeaders.Set("User-Agent", c.s.userAgent())
  7359. var body io.Reader = nil
  7360. c.urlParams_.Set("alt", alt)
  7361. c.urlParams_.Set("prettyPrint", "false")
  7362. urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/milestones/{milestoneId}/claim")
  7363. urls += "?" + c.urlParams_.Encode()
  7364. req, err := http.NewRequest("PUT", urls, body)
  7365. if err != nil {
  7366. return nil, err
  7367. }
  7368. req.Header = reqHeaders
  7369. googleapi.Expand(req.URL, map[string]string{
  7370. "questId": c.questId,
  7371. "milestoneId": c.milestoneId,
  7372. })
  7373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7374. }
  7375. // Do executes the "games.questMilestones.claim" call.
  7376. func (c *QuestMilestonesClaimCall) Do(opts ...googleapi.CallOption) error {
  7377. gensupport.SetOptions(c.urlParams_, opts...)
  7378. res, err := c.doRequest("json")
  7379. if err != nil {
  7380. return err
  7381. }
  7382. defer googleapi.CloseBody(res)
  7383. if err := googleapi.CheckResponse(res); err != nil {
  7384. return err
  7385. }
  7386. return nil
  7387. // {
  7388. // "description": "Report that a reward for the milestone corresponding to milestoneId for the quest corresponding to questId has been claimed by the currently authorized user.",
  7389. // "httpMethod": "PUT",
  7390. // "id": "games.questMilestones.claim",
  7391. // "parameterOrder": [
  7392. // "questId",
  7393. // "milestoneId",
  7394. // "requestId"
  7395. // ],
  7396. // "parameters": {
  7397. // "milestoneId": {
  7398. // "description": "The ID of the milestone.",
  7399. // "location": "path",
  7400. // "required": true,
  7401. // "type": "string"
  7402. // },
  7403. // "questId": {
  7404. // "description": "The ID of the quest.",
  7405. // "location": "path",
  7406. // "required": true,
  7407. // "type": "string"
  7408. // },
  7409. // "requestId": {
  7410. // "description": "A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly.",
  7411. // "format": "int64",
  7412. // "location": "query",
  7413. // "required": true,
  7414. // "type": "string"
  7415. // }
  7416. // },
  7417. // "path": "quests/{questId}/milestones/{milestoneId}/claim",
  7418. // "scopes": [
  7419. // "https://www.googleapis.com/auth/games",
  7420. // "https://www.googleapis.com/auth/plus.me"
  7421. // ]
  7422. // }
  7423. }
  7424. // method id "games.quests.accept":
  7425. type QuestsAcceptCall struct {
  7426. s *Service
  7427. questId string
  7428. urlParams_ gensupport.URLParams
  7429. ctx_ context.Context
  7430. header_ http.Header
  7431. }
  7432. // Accept: Indicates that the currently authorized user will participate
  7433. // in the quest.
  7434. func (r *QuestsService) Accept(questId string) *QuestsAcceptCall {
  7435. c := &QuestsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7436. c.questId = questId
  7437. return c
  7438. }
  7439. // Language sets the optional parameter "language": The preferred
  7440. // language to use for strings returned by this method.
  7441. func (c *QuestsAcceptCall) Language(language string) *QuestsAcceptCall {
  7442. c.urlParams_.Set("language", language)
  7443. return c
  7444. }
  7445. // Fields allows partial responses to be retrieved. See
  7446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7447. // for more information.
  7448. func (c *QuestsAcceptCall) Fields(s ...googleapi.Field) *QuestsAcceptCall {
  7449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7450. return c
  7451. }
  7452. // Context sets the context to be used in this call's Do method. Any
  7453. // pending HTTP request will be aborted if the provided context is
  7454. // canceled.
  7455. func (c *QuestsAcceptCall) Context(ctx context.Context) *QuestsAcceptCall {
  7456. c.ctx_ = ctx
  7457. return c
  7458. }
  7459. // Header returns an http.Header that can be modified by the caller to
  7460. // add HTTP headers to the request.
  7461. func (c *QuestsAcceptCall) Header() http.Header {
  7462. if c.header_ == nil {
  7463. c.header_ = make(http.Header)
  7464. }
  7465. return c.header_
  7466. }
  7467. func (c *QuestsAcceptCall) doRequest(alt string) (*http.Response, error) {
  7468. reqHeaders := make(http.Header)
  7469. for k, v := range c.header_ {
  7470. reqHeaders[k] = v
  7471. }
  7472. reqHeaders.Set("User-Agent", c.s.userAgent())
  7473. var body io.Reader = nil
  7474. c.urlParams_.Set("alt", alt)
  7475. c.urlParams_.Set("prettyPrint", "false")
  7476. urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/accept")
  7477. urls += "?" + c.urlParams_.Encode()
  7478. req, err := http.NewRequest("POST", urls, body)
  7479. if err != nil {
  7480. return nil, err
  7481. }
  7482. req.Header = reqHeaders
  7483. googleapi.Expand(req.URL, map[string]string{
  7484. "questId": c.questId,
  7485. })
  7486. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7487. }
  7488. // Do executes the "games.quests.accept" call.
  7489. // Exactly one of *Quest or error will be non-nil. Any non-2xx status
  7490. // code is an error. Response headers are in either
  7491. // *Quest.ServerResponse.Header or (if a response was returned at all)
  7492. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7493. // check whether the returned error was because http.StatusNotModified
  7494. // was returned.
  7495. func (c *QuestsAcceptCall) Do(opts ...googleapi.CallOption) (*Quest, error) {
  7496. gensupport.SetOptions(c.urlParams_, opts...)
  7497. res, err := c.doRequest("json")
  7498. if res != nil && res.StatusCode == http.StatusNotModified {
  7499. if res.Body != nil {
  7500. res.Body.Close()
  7501. }
  7502. return nil, &googleapi.Error{
  7503. Code: res.StatusCode,
  7504. Header: res.Header,
  7505. }
  7506. }
  7507. if err != nil {
  7508. return nil, err
  7509. }
  7510. defer googleapi.CloseBody(res)
  7511. if err := googleapi.CheckResponse(res); err != nil {
  7512. return nil, err
  7513. }
  7514. ret := &Quest{
  7515. ServerResponse: googleapi.ServerResponse{
  7516. Header: res.Header,
  7517. HTTPStatusCode: res.StatusCode,
  7518. },
  7519. }
  7520. target := &ret
  7521. if err := gensupport.DecodeResponse(target, res); err != nil {
  7522. return nil, err
  7523. }
  7524. return ret, nil
  7525. // {
  7526. // "description": "Indicates that the currently authorized user will participate in the quest.",
  7527. // "httpMethod": "POST",
  7528. // "id": "games.quests.accept",
  7529. // "parameterOrder": [
  7530. // "questId"
  7531. // ],
  7532. // "parameters": {
  7533. // "language": {
  7534. // "description": "The preferred language to use for strings returned by this method.",
  7535. // "location": "query",
  7536. // "type": "string"
  7537. // },
  7538. // "questId": {
  7539. // "description": "The ID of the quest.",
  7540. // "location": "path",
  7541. // "required": true,
  7542. // "type": "string"
  7543. // }
  7544. // },
  7545. // "path": "quests/{questId}/accept",
  7546. // "response": {
  7547. // "$ref": "Quest"
  7548. // },
  7549. // "scopes": [
  7550. // "https://www.googleapis.com/auth/games",
  7551. // "https://www.googleapis.com/auth/plus.me"
  7552. // ]
  7553. // }
  7554. }
  7555. // method id "games.quests.list":
  7556. type QuestsListCall struct {
  7557. s *Service
  7558. playerId string
  7559. urlParams_ gensupport.URLParams
  7560. ifNoneMatch_ string
  7561. ctx_ context.Context
  7562. header_ http.Header
  7563. }
  7564. // List: Get a list of quests for your application and the currently
  7565. // authenticated player.
  7566. func (r *QuestsService) List(playerId string) *QuestsListCall {
  7567. c := &QuestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7568. c.playerId = playerId
  7569. return c
  7570. }
  7571. // Language sets the optional parameter "language": The preferred
  7572. // language to use for strings returned by this method.
  7573. func (c *QuestsListCall) Language(language string) *QuestsListCall {
  7574. c.urlParams_.Set("language", language)
  7575. return c
  7576. }
  7577. // MaxResults sets the optional parameter "maxResults": The maximum
  7578. // number of quest resources to return in the response, used for paging.
  7579. // For any response, the actual number of quest resources returned may
  7580. // be less than the specified maxResults. Acceptable values are 1 to 50,
  7581. // inclusive. (Default: 50).
  7582. func (c *QuestsListCall) MaxResults(maxResults int64) *QuestsListCall {
  7583. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7584. return c
  7585. }
  7586. // PageToken sets the optional parameter "pageToken": The token returned
  7587. // by the previous request.
  7588. func (c *QuestsListCall) PageToken(pageToken string) *QuestsListCall {
  7589. c.urlParams_.Set("pageToken", pageToken)
  7590. return c
  7591. }
  7592. // Fields allows partial responses to be retrieved. See
  7593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7594. // for more information.
  7595. func (c *QuestsListCall) Fields(s ...googleapi.Field) *QuestsListCall {
  7596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7597. return c
  7598. }
  7599. // IfNoneMatch sets the optional parameter which makes the operation
  7600. // fail if the object's ETag matches the given value. This is useful for
  7601. // getting updates only after the object has changed since the last
  7602. // request. Use googleapi.IsNotModified to check whether the response
  7603. // error from Do is the result of In-None-Match.
  7604. func (c *QuestsListCall) IfNoneMatch(entityTag string) *QuestsListCall {
  7605. c.ifNoneMatch_ = entityTag
  7606. return c
  7607. }
  7608. // Context sets the context to be used in this call's Do method. Any
  7609. // pending HTTP request will be aborted if the provided context is
  7610. // canceled.
  7611. func (c *QuestsListCall) Context(ctx context.Context) *QuestsListCall {
  7612. c.ctx_ = ctx
  7613. return c
  7614. }
  7615. // Header returns an http.Header that can be modified by the caller to
  7616. // add HTTP headers to the request.
  7617. func (c *QuestsListCall) Header() http.Header {
  7618. if c.header_ == nil {
  7619. c.header_ = make(http.Header)
  7620. }
  7621. return c.header_
  7622. }
  7623. func (c *QuestsListCall) doRequest(alt string) (*http.Response, error) {
  7624. reqHeaders := make(http.Header)
  7625. for k, v := range c.header_ {
  7626. reqHeaders[k] = v
  7627. }
  7628. reqHeaders.Set("User-Agent", c.s.userAgent())
  7629. if c.ifNoneMatch_ != "" {
  7630. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7631. }
  7632. var body io.Reader = nil
  7633. c.urlParams_.Set("alt", alt)
  7634. c.urlParams_.Set("prettyPrint", "false")
  7635. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/quests")
  7636. urls += "?" + c.urlParams_.Encode()
  7637. req, err := http.NewRequest("GET", urls, body)
  7638. if err != nil {
  7639. return nil, err
  7640. }
  7641. req.Header = reqHeaders
  7642. googleapi.Expand(req.URL, map[string]string{
  7643. "playerId": c.playerId,
  7644. })
  7645. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7646. }
  7647. // Do executes the "games.quests.list" call.
  7648. // Exactly one of *QuestListResponse or error will be non-nil. Any
  7649. // non-2xx status code is an error. Response headers are in either
  7650. // *QuestListResponse.ServerResponse.Header or (if a response was
  7651. // returned at all) in error.(*googleapi.Error).Header. Use
  7652. // googleapi.IsNotModified to check whether the returned error was
  7653. // because http.StatusNotModified was returned.
  7654. func (c *QuestsListCall) Do(opts ...googleapi.CallOption) (*QuestListResponse, error) {
  7655. gensupport.SetOptions(c.urlParams_, opts...)
  7656. res, err := c.doRequest("json")
  7657. if res != nil && res.StatusCode == http.StatusNotModified {
  7658. if res.Body != nil {
  7659. res.Body.Close()
  7660. }
  7661. return nil, &googleapi.Error{
  7662. Code: res.StatusCode,
  7663. Header: res.Header,
  7664. }
  7665. }
  7666. if err != nil {
  7667. return nil, err
  7668. }
  7669. defer googleapi.CloseBody(res)
  7670. if err := googleapi.CheckResponse(res); err != nil {
  7671. return nil, err
  7672. }
  7673. ret := &QuestListResponse{
  7674. ServerResponse: googleapi.ServerResponse{
  7675. Header: res.Header,
  7676. HTTPStatusCode: res.StatusCode,
  7677. },
  7678. }
  7679. target := &ret
  7680. if err := gensupport.DecodeResponse(target, res); err != nil {
  7681. return nil, err
  7682. }
  7683. return ret, nil
  7684. // {
  7685. // "description": "Get a list of quests for your application and the currently authenticated player.",
  7686. // "httpMethod": "GET",
  7687. // "id": "games.quests.list",
  7688. // "parameterOrder": [
  7689. // "playerId"
  7690. // ],
  7691. // "parameters": {
  7692. // "language": {
  7693. // "description": "The preferred language to use for strings returned by this method.",
  7694. // "location": "query",
  7695. // "type": "string"
  7696. // },
  7697. // "maxResults": {
  7698. // "description": "The maximum number of quest resources to return in the response, used for paging. For any response, the actual number of quest resources returned may be less than the specified maxResults. Acceptable values are 1 to 50, inclusive. (Default: 50).",
  7699. // "format": "int32",
  7700. // "location": "query",
  7701. // "maximum": "50",
  7702. // "minimum": "1",
  7703. // "type": "integer"
  7704. // },
  7705. // "pageToken": {
  7706. // "description": "The token returned by the previous request.",
  7707. // "location": "query",
  7708. // "type": "string"
  7709. // },
  7710. // "playerId": {
  7711. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  7712. // "location": "path",
  7713. // "required": true,
  7714. // "type": "string"
  7715. // }
  7716. // },
  7717. // "path": "players/{playerId}/quests",
  7718. // "response": {
  7719. // "$ref": "QuestListResponse"
  7720. // },
  7721. // "scopes": [
  7722. // "https://www.googleapis.com/auth/games",
  7723. // "https://www.googleapis.com/auth/plus.me"
  7724. // ]
  7725. // }
  7726. }
  7727. // Pages invokes f for each page of results.
  7728. // A non-nil error returned from f will halt the iteration.
  7729. // The provided context supersedes any context provided to the Context method.
  7730. func (c *QuestsListCall) Pages(ctx context.Context, f func(*QuestListResponse) error) error {
  7731. c.ctx_ = ctx
  7732. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7733. for {
  7734. x, err := c.Do()
  7735. if err != nil {
  7736. return err
  7737. }
  7738. if err := f(x); err != nil {
  7739. return err
  7740. }
  7741. if x.NextPageToken == "" {
  7742. return nil
  7743. }
  7744. c.PageToken(x.NextPageToken)
  7745. }
  7746. }
  7747. // method id "games.revisions.check":
  7748. type RevisionsCheckCall struct {
  7749. s *Service
  7750. urlParams_ gensupport.URLParams
  7751. ifNoneMatch_ string
  7752. ctx_ context.Context
  7753. header_ http.Header
  7754. }
  7755. // Check: Checks whether the games client is out of date.
  7756. func (r *RevisionsService) Check(clientRevision string) *RevisionsCheckCall {
  7757. c := &RevisionsCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7758. c.urlParams_.Set("clientRevision", clientRevision)
  7759. return c
  7760. }
  7761. // Fields allows partial responses to be retrieved. See
  7762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7763. // for more information.
  7764. func (c *RevisionsCheckCall) Fields(s ...googleapi.Field) *RevisionsCheckCall {
  7765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7766. return c
  7767. }
  7768. // IfNoneMatch sets the optional parameter which makes the operation
  7769. // fail if the object's ETag matches the given value. This is useful for
  7770. // getting updates only after the object has changed since the last
  7771. // request. Use googleapi.IsNotModified to check whether the response
  7772. // error from Do is the result of In-None-Match.
  7773. func (c *RevisionsCheckCall) IfNoneMatch(entityTag string) *RevisionsCheckCall {
  7774. c.ifNoneMatch_ = entityTag
  7775. return c
  7776. }
  7777. // Context sets the context to be used in this call's Do method. Any
  7778. // pending HTTP request will be aborted if the provided context is
  7779. // canceled.
  7780. func (c *RevisionsCheckCall) Context(ctx context.Context) *RevisionsCheckCall {
  7781. c.ctx_ = ctx
  7782. return c
  7783. }
  7784. // Header returns an http.Header that can be modified by the caller to
  7785. // add HTTP headers to the request.
  7786. func (c *RevisionsCheckCall) Header() http.Header {
  7787. if c.header_ == nil {
  7788. c.header_ = make(http.Header)
  7789. }
  7790. return c.header_
  7791. }
  7792. func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) {
  7793. reqHeaders := make(http.Header)
  7794. for k, v := range c.header_ {
  7795. reqHeaders[k] = v
  7796. }
  7797. reqHeaders.Set("User-Agent", c.s.userAgent())
  7798. if c.ifNoneMatch_ != "" {
  7799. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7800. }
  7801. var body io.Reader = nil
  7802. c.urlParams_.Set("alt", alt)
  7803. c.urlParams_.Set("prettyPrint", "false")
  7804. urls := googleapi.ResolveRelative(c.s.BasePath, "revisions/check")
  7805. urls += "?" + c.urlParams_.Encode()
  7806. req, err := http.NewRequest("GET", urls, body)
  7807. if err != nil {
  7808. return nil, err
  7809. }
  7810. req.Header = reqHeaders
  7811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7812. }
  7813. // Do executes the "games.revisions.check" call.
  7814. // Exactly one of *RevisionCheckResponse or error will be non-nil. Any
  7815. // non-2xx status code is an error. Response headers are in either
  7816. // *RevisionCheckResponse.ServerResponse.Header or (if a response was
  7817. // returned at all) in error.(*googleapi.Error).Header. Use
  7818. // googleapi.IsNotModified to check whether the returned error was
  7819. // because http.StatusNotModified was returned.
  7820. func (c *RevisionsCheckCall) Do(opts ...googleapi.CallOption) (*RevisionCheckResponse, error) {
  7821. gensupport.SetOptions(c.urlParams_, opts...)
  7822. res, err := c.doRequest("json")
  7823. if res != nil && res.StatusCode == http.StatusNotModified {
  7824. if res.Body != nil {
  7825. res.Body.Close()
  7826. }
  7827. return nil, &googleapi.Error{
  7828. Code: res.StatusCode,
  7829. Header: res.Header,
  7830. }
  7831. }
  7832. if err != nil {
  7833. return nil, err
  7834. }
  7835. defer googleapi.CloseBody(res)
  7836. if err := googleapi.CheckResponse(res); err != nil {
  7837. return nil, err
  7838. }
  7839. ret := &RevisionCheckResponse{
  7840. ServerResponse: googleapi.ServerResponse{
  7841. Header: res.Header,
  7842. HTTPStatusCode: res.StatusCode,
  7843. },
  7844. }
  7845. target := &ret
  7846. if err := gensupport.DecodeResponse(target, res); err != nil {
  7847. return nil, err
  7848. }
  7849. return ret, nil
  7850. // {
  7851. // "description": "Checks whether the games client is out of date.",
  7852. // "httpMethod": "GET",
  7853. // "id": "games.revisions.check",
  7854. // "parameterOrder": [
  7855. // "clientRevision"
  7856. // ],
  7857. // "parameters": {
  7858. // "clientRevision": {
  7859. // "description": "The revision of the client SDK used by your application. Format:\n[PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE are:\n \n- \"ANDROID\" - Client is running the Android SDK. \n- \"IOS\" - Client is running the iOS SDK. \n- \"WEB_APP\" - Client is running as a Web App.",
  7860. // "location": "query",
  7861. // "required": true,
  7862. // "type": "string"
  7863. // }
  7864. // },
  7865. // "path": "revisions/check",
  7866. // "response": {
  7867. // "$ref": "RevisionCheckResponse"
  7868. // },
  7869. // "scopes": [
  7870. // "https://www.googleapis.com/auth/games",
  7871. // "https://www.googleapis.com/auth/plus.me"
  7872. // ]
  7873. // }
  7874. }
  7875. // method id "games.rooms.create":
  7876. type RoomsCreateCall struct {
  7877. s *Service
  7878. roomcreaterequest *RoomCreateRequest
  7879. urlParams_ gensupport.URLParams
  7880. ctx_ context.Context
  7881. header_ http.Header
  7882. }
  7883. // Create: Create a room. For internal use by the Games SDK only.
  7884. // Calling this method directly is unsupported.
  7885. func (r *RoomsService) Create(roomcreaterequest *RoomCreateRequest) *RoomsCreateCall {
  7886. c := &RoomsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7887. c.roomcreaterequest = roomcreaterequest
  7888. return c
  7889. }
  7890. // Language sets the optional parameter "language": The preferred
  7891. // language to use for strings returned by this method.
  7892. func (c *RoomsCreateCall) Language(language string) *RoomsCreateCall {
  7893. c.urlParams_.Set("language", language)
  7894. return c
  7895. }
  7896. // Fields allows partial responses to be retrieved. See
  7897. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7898. // for more information.
  7899. func (c *RoomsCreateCall) Fields(s ...googleapi.Field) *RoomsCreateCall {
  7900. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7901. return c
  7902. }
  7903. // Context sets the context to be used in this call's Do method. Any
  7904. // pending HTTP request will be aborted if the provided context is
  7905. // canceled.
  7906. func (c *RoomsCreateCall) Context(ctx context.Context) *RoomsCreateCall {
  7907. c.ctx_ = ctx
  7908. return c
  7909. }
  7910. // Header returns an http.Header that can be modified by the caller to
  7911. // add HTTP headers to the request.
  7912. func (c *RoomsCreateCall) Header() http.Header {
  7913. if c.header_ == nil {
  7914. c.header_ = make(http.Header)
  7915. }
  7916. return c.header_
  7917. }
  7918. func (c *RoomsCreateCall) doRequest(alt string) (*http.Response, error) {
  7919. reqHeaders := make(http.Header)
  7920. for k, v := range c.header_ {
  7921. reqHeaders[k] = v
  7922. }
  7923. reqHeaders.Set("User-Agent", c.s.userAgent())
  7924. var body io.Reader = nil
  7925. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomcreaterequest)
  7926. if err != nil {
  7927. return nil, err
  7928. }
  7929. reqHeaders.Set("Content-Type", "application/json")
  7930. c.urlParams_.Set("alt", alt)
  7931. c.urlParams_.Set("prettyPrint", "false")
  7932. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/create")
  7933. urls += "?" + c.urlParams_.Encode()
  7934. req, err := http.NewRequest("POST", urls, body)
  7935. if err != nil {
  7936. return nil, err
  7937. }
  7938. req.Header = reqHeaders
  7939. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7940. }
  7941. // Do executes the "games.rooms.create" call.
  7942. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  7943. // code is an error. Response headers are in either
  7944. // *Room.ServerResponse.Header or (if a response was returned at all) in
  7945. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7946. // whether the returned error was because http.StatusNotModified was
  7947. // returned.
  7948. func (c *RoomsCreateCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  7949. gensupport.SetOptions(c.urlParams_, opts...)
  7950. res, err := c.doRequest("json")
  7951. if res != nil && res.StatusCode == http.StatusNotModified {
  7952. if res.Body != nil {
  7953. res.Body.Close()
  7954. }
  7955. return nil, &googleapi.Error{
  7956. Code: res.StatusCode,
  7957. Header: res.Header,
  7958. }
  7959. }
  7960. if err != nil {
  7961. return nil, err
  7962. }
  7963. defer googleapi.CloseBody(res)
  7964. if err := googleapi.CheckResponse(res); err != nil {
  7965. return nil, err
  7966. }
  7967. ret := &Room{
  7968. ServerResponse: googleapi.ServerResponse{
  7969. Header: res.Header,
  7970. HTTPStatusCode: res.StatusCode,
  7971. },
  7972. }
  7973. target := &ret
  7974. if err := gensupport.DecodeResponse(target, res); err != nil {
  7975. return nil, err
  7976. }
  7977. return ret, nil
  7978. // {
  7979. // "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  7980. // "httpMethod": "POST",
  7981. // "id": "games.rooms.create",
  7982. // "parameters": {
  7983. // "language": {
  7984. // "description": "The preferred language to use for strings returned by this method.",
  7985. // "location": "query",
  7986. // "type": "string"
  7987. // }
  7988. // },
  7989. // "path": "rooms/create",
  7990. // "request": {
  7991. // "$ref": "RoomCreateRequest"
  7992. // },
  7993. // "response": {
  7994. // "$ref": "Room"
  7995. // },
  7996. // "scopes": [
  7997. // "https://www.googleapis.com/auth/games",
  7998. // "https://www.googleapis.com/auth/plus.me"
  7999. // ]
  8000. // }
  8001. }
  8002. // method id "games.rooms.decline":
  8003. type RoomsDeclineCall struct {
  8004. s *Service
  8005. roomId string
  8006. urlParams_ gensupport.URLParams
  8007. ctx_ context.Context
  8008. header_ http.Header
  8009. }
  8010. // Decline: Decline an invitation to join a room. For internal use by
  8011. // the Games SDK only. Calling this method directly is unsupported.
  8012. func (r *RoomsService) Decline(roomId string) *RoomsDeclineCall {
  8013. c := &RoomsDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8014. c.roomId = roomId
  8015. return c
  8016. }
  8017. // Language sets the optional parameter "language": The preferred
  8018. // language to use for strings returned by this method.
  8019. func (c *RoomsDeclineCall) Language(language string) *RoomsDeclineCall {
  8020. c.urlParams_.Set("language", language)
  8021. return c
  8022. }
  8023. // Fields allows partial responses to be retrieved. See
  8024. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8025. // for more information.
  8026. func (c *RoomsDeclineCall) Fields(s ...googleapi.Field) *RoomsDeclineCall {
  8027. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8028. return c
  8029. }
  8030. // Context sets the context to be used in this call's Do method. Any
  8031. // pending HTTP request will be aborted if the provided context is
  8032. // canceled.
  8033. func (c *RoomsDeclineCall) Context(ctx context.Context) *RoomsDeclineCall {
  8034. c.ctx_ = ctx
  8035. return c
  8036. }
  8037. // Header returns an http.Header that can be modified by the caller to
  8038. // add HTTP headers to the request.
  8039. func (c *RoomsDeclineCall) Header() http.Header {
  8040. if c.header_ == nil {
  8041. c.header_ = make(http.Header)
  8042. }
  8043. return c.header_
  8044. }
  8045. func (c *RoomsDeclineCall) doRequest(alt string) (*http.Response, error) {
  8046. reqHeaders := make(http.Header)
  8047. for k, v := range c.header_ {
  8048. reqHeaders[k] = v
  8049. }
  8050. reqHeaders.Set("User-Agent", c.s.userAgent())
  8051. var body io.Reader = nil
  8052. c.urlParams_.Set("alt", alt)
  8053. c.urlParams_.Set("prettyPrint", "false")
  8054. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline")
  8055. urls += "?" + c.urlParams_.Encode()
  8056. req, err := http.NewRequest("POST", urls, body)
  8057. if err != nil {
  8058. return nil, err
  8059. }
  8060. req.Header = reqHeaders
  8061. googleapi.Expand(req.URL, map[string]string{
  8062. "roomId": c.roomId,
  8063. })
  8064. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8065. }
  8066. // Do executes the "games.rooms.decline" call.
  8067. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8068. // code is an error. Response headers are in either
  8069. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8070. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8071. // whether the returned error was because http.StatusNotModified was
  8072. // returned.
  8073. func (c *RoomsDeclineCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8074. gensupport.SetOptions(c.urlParams_, opts...)
  8075. res, err := c.doRequest("json")
  8076. if res != nil && res.StatusCode == http.StatusNotModified {
  8077. if res.Body != nil {
  8078. res.Body.Close()
  8079. }
  8080. return nil, &googleapi.Error{
  8081. Code: res.StatusCode,
  8082. Header: res.Header,
  8083. }
  8084. }
  8085. if err != nil {
  8086. return nil, err
  8087. }
  8088. defer googleapi.CloseBody(res)
  8089. if err := googleapi.CheckResponse(res); err != nil {
  8090. return nil, err
  8091. }
  8092. ret := &Room{
  8093. ServerResponse: googleapi.ServerResponse{
  8094. Header: res.Header,
  8095. HTTPStatusCode: res.StatusCode,
  8096. },
  8097. }
  8098. target := &ret
  8099. if err := gensupport.DecodeResponse(target, res); err != nil {
  8100. return nil, err
  8101. }
  8102. return ret, nil
  8103. // {
  8104. // "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8105. // "httpMethod": "POST",
  8106. // "id": "games.rooms.decline",
  8107. // "parameterOrder": [
  8108. // "roomId"
  8109. // ],
  8110. // "parameters": {
  8111. // "language": {
  8112. // "description": "The preferred language to use for strings returned by this method.",
  8113. // "location": "query",
  8114. // "type": "string"
  8115. // },
  8116. // "roomId": {
  8117. // "description": "The ID of the room.",
  8118. // "location": "path",
  8119. // "required": true,
  8120. // "type": "string"
  8121. // }
  8122. // },
  8123. // "path": "rooms/{roomId}/decline",
  8124. // "response": {
  8125. // "$ref": "Room"
  8126. // },
  8127. // "scopes": [
  8128. // "https://www.googleapis.com/auth/games",
  8129. // "https://www.googleapis.com/auth/plus.me"
  8130. // ]
  8131. // }
  8132. }
  8133. // method id "games.rooms.dismiss":
  8134. type RoomsDismissCall struct {
  8135. s *Service
  8136. roomId string
  8137. urlParams_ gensupport.URLParams
  8138. ctx_ context.Context
  8139. header_ http.Header
  8140. }
  8141. // Dismiss: Dismiss an invitation to join a room. For internal use by
  8142. // the Games SDK only. Calling this method directly is unsupported.
  8143. func (r *RoomsService) Dismiss(roomId string) *RoomsDismissCall {
  8144. c := &RoomsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8145. c.roomId = roomId
  8146. return c
  8147. }
  8148. // Fields allows partial responses to be retrieved. See
  8149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8150. // for more information.
  8151. func (c *RoomsDismissCall) Fields(s ...googleapi.Field) *RoomsDismissCall {
  8152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8153. return c
  8154. }
  8155. // Context sets the context to be used in this call's Do method. Any
  8156. // pending HTTP request will be aborted if the provided context is
  8157. // canceled.
  8158. func (c *RoomsDismissCall) Context(ctx context.Context) *RoomsDismissCall {
  8159. c.ctx_ = ctx
  8160. return c
  8161. }
  8162. // Header returns an http.Header that can be modified by the caller to
  8163. // add HTTP headers to the request.
  8164. func (c *RoomsDismissCall) Header() http.Header {
  8165. if c.header_ == nil {
  8166. c.header_ = make(http.Header)
  8167. }
  8168. return c.header_
  8169. }
  8170. func (c *RoomsDismissCall) doRequest(alt string) (*http.Response, error) {
  8171. reqHeaders := make(http.Header)
  8172. for k, v := range c.header_ {
  8173. reqHeaders[k] = v
  8174. }
  8175. reqHeaders.Set("User-Agent", c.s.userAgent())
  8176. var body io.Reader = nil
  8177. c.urlParams_.Set("alt", alt)
  8178. c.urlParams_.Set("prettyPrint", "false")
  8179. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/dismiss")
  8180. urls += "?" + c.urlParams_.Encode()
  8181. req, err := http.NewRequest("POST", urls, body)
  8182. if err != nil {
  8183. return nil, err
  8184. }
  8185. req.Header = reqHeaders
  8186. googleapi.Expand(req.URL, map[string]string{
  8187. "roomId": c.roomId,
  8188. })
  8189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8190. }
  8191. // Do executes the "games.rooms.dismiss" call.
  8192. func (c *RoomsDismissCall) Do(opts ...googleapi.CallOption) error {
  8193. gensupport.SetOptions(c.urlParams_, opts...)
  8194. res, err := c.doRequest("json")
  8195. if err != nil {
  8196. return err
  8197. }
  8198. defer googleapi.CloseBody(res)
  8199. if err := googleapi.CheckResponse(res); err != nil {
  8200. return err
  8201. }
  8202. return nil
  8203. // {
  8204. // "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8205. // "httpMethod": "POST",
  8206. // "id": "games.rooms.dismiss",
  8207. // "parameterOrder": [
  8208. // "roomId"
  8209. // ],
  8210. // "parameters": {
  8211. // "roomId": {
  8212. // "description": "The ID of the room.",
  8213. // "location": "path",
  8214. // "required": true,
  8215. // "type": "string"
  8216. // }
  8217. // },
  8218. // "path": "rooms/{roomId}/dismiss",
  8219. // "scopes": [
  8220. // "https://www.googleapis.com/auth/games",
  8221. // "https://www.googleapis.com/auth/plus.me"
  8222. // ]
  8223. // }
  8224. }
  8225. // method id "games.rooms.get":
  8226. type RoomsGetCall struct {
  8227. s *Service
  8228. roomId string
  8229. urlParams_ gensupport.URLParams
  8230. ifNoneMatch_ string
  8231. ctx_ context.Context
  8232. header_ http.Header
  8233. }
  8234. // Get: Get the data for a room.
  8235. func (r *RoomsService) Get(roomId string) *RoomsGetCall {
  8236. c := &RoomsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8237. c.roomId = roomId
  8238. return c
  8239. }
  8240. // Language sets the optional parameter "language": The preferred
  8241. // language to use for strings returned by this method.
  8242. func (c *RoomsGetCall) Language(language string) *RoomsGetCall {
  8243. c.urlParams_.Set("language", language)
  8244. return c
  8245. }
  8246. // Fields allows partial responses to be retrieved. See
  8247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8248. // for more information.
  8249. func (c *RoomsGetCall) Fields(s ...googleapi.Field) *RoomsGetCall {
  8250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8251. return c
  8252. }
  8253. // IfNoneMatch sets the optional parameter which makes the operation
  8254. // fail if the object's ETag matches the given value. This is useful for
  8255. // getting updates only after the object has changed since the last
  8256. // request. Use googleapi.IsNotModified to check whether the response
  8257. // error from Do is the result of In-None-Match.
  8258. func (c *RoomsGetCall) IfNoneMatch(entityTag string) *RoomsGetCall {
  8259. c.ifNoneMatch_ = entityTag
  8260. return c
  8261. }
  8262. // Context sets the context to be used in this call's Do method. Any
  8263. // pending HTTP request will be aborted if the provided context is
  8264. // canceled.
  8265. func (c *RoomsGetCall) Context(ctx context.Context) *RoomsGetCall {
  8266. c.ctx_ = ctx
  8267. return c
  8268. }
  8269. // Header returns an http.Header that can be modified by the caller to
  8270. // add HTTP headers to the request.
  8271. func (c *RoomsGetCall) Header() http.Header {
  8272. if c.header_ == nil {
  8273. c.header_ = make(http.Header)
  8274. }
  8275. return c.header_
  8276. }
  8277. func (c *RoomsGetCall) doRequest(alt string) (*http.Response, error) {
  8278. reqHeaders := make(http.Header)
  8279. for k, v := range c.header_ {
  8280. reqHeaders[k] = v
  8281. }
  8282. reqHeaders.Set("User-Agent", c.s.userAgent())
  8283. if c.ifNoneMatch_ != "" {
  8284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8285. }
  8286. var body io.Reader = nil
  8287. c.urlParams_.Set("alt", alt)
  8288. c.urlParams_.Set("prettyPrint", "false")
  8289. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}")
  8290. urls += "?" + c.urlParams_.Encode()
  8291. req, err := http.NewRequest("GET", urls, body)
  8292. if err != nil {
  8293. return nil, err
  8294. }
  8295. req.Header = reqHeaders
  8296. googleapi.Expand(req.URL, map[string]string{
  8297. "roomId": c.roomId,
  8298. })
  8299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8300. }
  8301. // Do executes the "games.rooms.get" call.
  8302. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8303. // code is an error. Response headers are in either
  8304. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8305. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8306. // whether the returned error was because http.StatusNotModified was
  8307. // returned.
  8308. func (c *RoomsGetCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8309. gensupport.SetOptions(c.urlParams_, opts...)
  8310. res, err := c.doRequest("json")
  8311. if res != nil && res.StatusCode == http.StatusNotModified {
  8312. if res.Body != nil {
  8313. res.Body.Close()
  8314. }
  8315. return nil, &googleapi.Error{
  8316. Code: res.StatusCode,
  8317. Header: res.Header,
  8318. }
  8319. }
  8320. if err != nil {
  8321. return nil, err
  8322. }
  8323. defer googleapi.CloseBody(res)
  8324. if err := googleapi.CheckResponse(res); err != nil {
  8325. return nil, err
  8326. }
  8327. ret := &Room{
  8328. ServerResponse: googleapi.ServerResponse{
  8329. Header: res.Header,
  8330. HTTPStatusCode: res.StatusCode,
  8331. },
  8332. }
  8333. target := &ret
  8334. if err := gensupport.DecodeResponse(target, res); err != nil {
  8335. return nil, err
  8336. }
  8337. return ret, nil
  8338. // {
  8339. // "description": "Get the data for a room.",
  8340. // "httpMethod": "GET",
  8341. // "id": "games.rooms.get",
  8342. // "parameterOrder": [
  8343. // "roomId"
  8344. // ],
  8345. // "parameters": {
  8346. // "language": {
  8347. // "description": "The preferred language to use for strings returned by this method.",
  8348. // "location": "query",
  8349. // "type": "string"
  8350. // },
  8351. // "roomId": {
  8352. // "description": "The ID of the room.",
  8353. // "location": "path",
  8354. // "required": true,
  8355. // "type": "string"
  8356. // }
  8357. // },
  8358. // "path": "rooms/{roomId}",
  8359. // "response": {
  8360. // "$ref": "Room"
  8361. // },
  8362. // "scopes": [
  8363. // "https://www.googleapis.com/auth/games",
  8364. // "https://www.googleapis.com/auth/plus.me"
  8365. // ]
  8366. // }
  8367. }
  8368. // method id "games.rooms.join":
  8369. type RoomsJoinCall struct {
  8370. s *Service
  8371. roomId string
  8372. roomjoinrequest *RoomJoinRequest
  8373. urlParams_ gensupport.URLParams
  8374. ctx_ context.Context
  8375. header_ http.Header
  8376. }
  8377. // Join: Join a room. For internal use by the Games SDK only. Calling
  8378. // this method directly is unsupported.
  8379. func (r *RoomsService) Join(roomId string, roomjoinrequest *RoomJoinRequest) *RoomsJoinCall {
  8380. c := &RoomsJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8381. c.roomId = roomId
  8382. c.roomjoinrequest = roomjoinrequest
  8383. return c
  8384. }
  8385. // Language sets the optional parameter "language": The preferred
  8386. // language to use for strings returned by this method.
  8387. func (c *RoomsJoinCall) Language(language string) *RoomsJoinCall {
  8388. c.urlParams_.Set("language", language)
  8389. return c
  8390. }
  8391. // Fields allows partial responses to be retrieved. See
  8392. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8393. // for more information.
  8394. func (c *RoomsJoinCall) Fields(s ...googleapi.Field) *RoomsJoinCall {
  8395. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8396. return c
  8397. }
  8398. // Context sets the context to be used in this call's Do method. Any
  8399. // pending HTTP request will be aborted if the provided context is
  8400. // canceled.
  8401. func (c *RoomsJoinCall) Context(ctx context.Context) *RoomsJoinCall {
  8402. c.ctx_ = ctx
  8403. return c
  8404. }
  8405. // Header returns an http.Header that can be modified by the caller to
  8406. // add HTTP headers to the request.
  8407. func (c *RoomsJoinCall) Header() http.Header {
  8408. if c.header_ == nil {
  8409. c.header_ = make(http.Header)
  8410. }
  8411. return c.header_
  8412. }
  8413. func (c *RoomsJoinCall) doRequest(alt string) (*http.Response, error) {
  8414. reqHeaders := make(http.Header)
  8415. for k, v := range c.header_ {
  8416. reqHeaders[k] = v
  8417. }
  8418. reqHeaders.Set("User-Agent", c.s.userAgent())
  8419. var body io.Reader = nil
  8420. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomjoinrequest)
  8421. if err != nil {
  8422. return nil, err
  8423. }
  8424. reqHeaders.Set("Content-Type", "application/json")
  8425. c.urlParams_.Set("alt", alt)
  8426. c.urlParams_.Set("prettyPrint", "false")
  8427. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join")
  8428. urls += "?" + c.urlParams_.Encode()
  8429. req, err := http.NewRequest("POST", urls, body)
  8430. if err != nil {
  8431. return nil, err
  8432. }
  8433. req.Header = reqHeaders
  8434. googleapi.Expand(req.URL, map[string]string{
  8435. "roomId": c.roomId,
  8436. })
  8437. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8438. }
  8439. // Do executes the "games.rooms.join" call.
  8440. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8441. // code is an error. Response headers are in either
  8442. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8443. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8444. // whether the returned error was because http.StatusNotModified was
  8445. // returned.
  8446. func (c *RoomsJoinCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8447. gensupport.SetOptions(c.urlParams_, opts...)
  8448. res, err := c.doRequest("json")
  8449. if res != nil && res.StatusCode == http.StatusNotModified {
  8450. if res.Body != nil {
  8451. res.Body.Close()
  8452. }
  8453. return nil, &googleapi.Error{
  8454. Code: res.StatusCode,
  8455. Header: res.Header,
  8456. }
  8457. }
  8458. if err != nil {
  8459. return nil, err
  8460. }
  8461. defer googleapi.CloseBody(res)
  8462. if err := googleapi.CheckResponse(res); err != nil {
  8463. return nil, err
  8464. }
  8465. ret := &Room{
  8466. ServerResponse: googleapi.ServerResponse{
  8467. Header: res.Header,
  8468. HTTPStatusCode: res.StatusCode,
  8469. },
  8470. }
  8471. target := &ret
  8472. if err := gensupport.DecodeResponse(target, res); err != nil {
  8473. return nil, err
  8474. }
  8475. return ret, nil
  8476. // {
  8477. // "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8478. // "httpMethod": "POST",
  8479. // "id": "games.rooms.join",
  8480. // "parameterOrder": [
  8481. // "roomId"
  8482. // ],
  8483. // "parameters": {
  8484. // "language": {
  8485. // "description": "The preferred language to use for strings returned by this method.",
  8486. // "location": "query",
  8487. // "type": "string"
  8488. // },
  8489. // "roomId": {
  8490. // "description": "The ID of the room.",
  8491. // "location": "path",
  8492. // "required": true,
  8493. // "type": "string"
  8494. // }
  8495. // },
  8496. // "path": "rooms/{roomId}/join",
  8497. // "request": {
  8498. // "$ref": "RoomJoinRequest"
  8499. // },
  8500. // "response": {
  8501. // "$ref": "Room"
  8502. // },
  8503. // "scopes": [
  8504. // "https://www.googleapis.com/auth/games",
  8505. // "https://www.googleapis.com/auth/plus.me"
  8506. // ]
  8507. // }
  8508. }
  8509. // method id "games.rooms.leave":
  8510. type RoomsLeaveCall struct {
  8511. s *Service
  8512. roomId string
  8513. roomleaverequest *RoomLeaveRequest
  8514. urlParams_ gensupport.URLParams
  8515. ctx_ context.Context
  8516. header_ http.Header
  8517. }
  8518. // Leave: Leave a room. For internal use by the Games SDK only. Calling
  8519. // this method directly is unsupported.
  8520. func (r *RoomsService) Leave(roomId string, roomleaverequest *RoomLeaveRequest) *RoomsLeaveCall {
  8521. c := &RoomsLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8522. c.roomId = roomId
  8523. c.roomleaverequest = roomleaverequest
  8524. return c
  8525. }
  8526. // Language sets the optional parameter "language": The preferred
  8527. // language to use for strings returned by this method.
  8528. func (c *RoomsLeaveCall) Language(language string) *RoomsLeaveCall {
  8529. c.urlParams_.Set("language", language)
  8530. return c
  8531. }
  8532. // Fields allows partial responses to be retrieved. See
  8533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8534. // for more information.
  8535. func (c *RoomsLeaveCall) Fields(s ...googleapi.Field) *RoomsLeaveCall {
  8536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8537. return c
  8538. }
  8539. // Context sets the context to be used in this call's Do method. Any
  8540. // pending HTTP request will be aborted if the provided context is
  8541. // canceled.
  8542. func (c *RoomsLeaveCall) Context(ctx context.Context) *RoomsLeaveCall {
  8543. c.ctx_ = ctx
  8544. return c
  8545. }
  8546. // Header returns an http.Header that can be modified by the caller to
  8547. // add HTTP headers to the request.
  8548. func (c *RoomsLeaveCall) Header() http.Header {
  8549. if c.header_ == nil {
  8550. c.header_ = make(http.Header)
  8551. }
  8552. return c.header_
  8553. }
  8554. func (c *RoomsLeaveCall) doRequest(alt string) (*http.Response, error) {
  8555. reqHeaders := make(http.Header)
  8556. for k, v := range c.header_ {
  8557. reqHeaders[k] = v
  8558. }
  8559. reqHeaders.Set("User-Agent", c.s.userAgent())
  8560. var body io.Reader = nil
  8561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomleaverequest)
  8562. if err != nil {
  8563. return nil, err
  8564. }
  8565. reqHeaders.Set("Content-Type", "application/json")
  8566. c.urlParams_.Set("alt", alt)
  8567. c.urlParams_.Set("prettyPrint", "false")
  8568. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave")
  8569. urls += "?" + c.urlParams_.Encode()
  8570. req, err := http.NewRequest("POST", urls, body)
  8571. if err != nil {
  8572. return nil, err
  8573. }
  8574. req.Header = reqHeaders
  8575. googleapi.Expand(req.URL, map[string]string{
  8576. "roomId": c.roomId,
  8577. })
  8578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8579. }
  8580. // Do executes the "games.rooms.leave" call.
  8581. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8582. // code is an error. Response headers are in either
  8583. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8584. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8585. // whether the returned error was because http.StatusNotModified was
  8586. // returned.
  8587. func (c *RoomsLeaveCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8588. gensupport.SetOptions(c.urlParams_, opts...)
  8589. res, err := c.doRequest("json")
  8590. if res != nil && res.StatusCode == http.StatusNotModified {
  8591. if res.Body != nil {
  8592. res.Body.Close()
  8593. }
  8594. return nil, &googleapi.Error{
  8595. Code: res.StatusCode,
  8596. Header: res.Header,
  8597. }
  8598. }
  8599. if err != nil {
  8600. return nil, err
  8601. }
  8602. defer googleapi.CloseBody(res)
  8603. if err := googleapi.CheckResponse(res); err != nil {
  8604. return nil, err
  8605. }
  8606. ret := &Room{
  8607. ServerResponse: googleapi.ServerResponse{
  8608. Header: res.Header,
  8609. HTTPStatusCode: res.StatusCode,
  8610. },
  8611. }
  8612. target := &ret
  8613. if err := gensupport.DecodeResponse(target, res); err != nil {
  8614. return nil, err
  8615. }
  8616. return ret, nil
  8617. // {
  8618. // "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8619. // "httpMethod": "POST",
  8620. // "id": "games.rooms.leave",
  8621. // "parameterOrder": [
  8622. // "roomId"
  8623. // ],
  8624. // "parameters": {
  8625. // "language": {
  8626. // "description": "The preferred language to use for strings returned by this method.",
  8627. // "location": "query",
  8628. // "type": "string"
  8629. // },
  8630. // "roomId": {
  8631. // "description": "The ID of the room.",
  8632. // "location": "path",
  8633. // "required": true,
  8634. // "type": "string"
  8635. // }
  8636. // },
  8637. // "path": "rooms/{roomId}/leave",
  8638. // "request": {
  8639. // "$ref": "RoomLeaveRequest"
  8640. // },
  8641. // "response": {
  8642. // "$ref": "Room"
  8643. // },
  8644. // "scopes": [
  8645. // "https://www.googleapis.com/auth/games",
  8646. // "https://www.googleapis.com/auth/plus.me"
  8647. // ]
  8648. // }
  8649. }
  8650. // method id "games.rooms.list":
  8651. type RoomsListCall struct {
  8652. s *Service
  8653. urlParams_ gensupport.URLParams
  8654. ifNoneMatch_ string
  8655. ctx_ context.Context
  8656. header_ http.Header
  8657. }
  8658. // List: Returns invitations to join rooms.
  8659. func (r *RoomsService) List() *RoomsListCall {
  8660. c := &RoomsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8661. return c
  8662. }
  8663. // Language sets the optional parameter "language": The preferred
  8664. // language to use for strings returned by this method.
  8665. func (c *RoomsListCall) Language(language string) *RoomsListCall {
  8666. c.urlParams_.Set("language", language)
  8667. return c
  8668. }
  8669. // MaxResults sets the optional parameter "maxResults": The maximum
  8670. // number of rooms to return in the response, used for paging. For any
  8671. // response, the actual number of rooms to return may be less than the
  8672. // specified maxResults.
  8673. func (c *RoomsListCall) MaxResults(maxResults int64) *RoomsListCall {
  8674. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8675. return c
  8676. }
  8677. // PageToken sets the optional parameter "pageToken": The token returned
  8678. // by the previous request.
  8679. func (c *RoomsListCall) PageToken(pageToken string) *RoomsListCall {
  8680. c.urlParams_.Set("pageToken", pageToken)
  8681. return c
  8682. }
  8683. // Fields allows partial responses to be retrieved. See
  8684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8685. // for more information.
  8686. func (c *RoomsListCall) Fields(s ...googleapi.Field) *RoomsListCall {
  8687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8688. return c
  8689. }
  8690. // IfNoneMatch sets the optional parameter which makes the operation
  8691. // fail if the object's ETag matches the given value. This is useful for
  8692. // getting updates only after the object has changed since the last
  8693. // request. Use googleapi.IsNotModified to check whether the response
  8694. // error from Do is the result of In-None-Match.
  8695. func (c *RoomsListCall) IfNoneMatch(entityTag string) *RoomsListCall {
  8696. c.ifNoneMatch_ = entityTag
  8697. return c
  8698. }
  8699. // Context sets the context to be used in this call's Do method. Any
  8700. // pending HTTP request will be aborted if the provided context is
  8701. // canceled.
  8702. func (c *RoomsListCall) Context(ctx context.Context) *RoomsListCall {
  8703. c.ctx_ = ctx
  8704. return c
  8705. }
  8706. // Header returns an http.Header that can be modified by the caller to
  8707. // add HTTP headers to the request.
  8708. func (c *RoomsListCall) Header() http.Header {
  8709. if c.header_ == nil {
  8710. c.header_ = make(http.Header)
  8711. }
  8712. return c.header_
  8713. }
  8714. func (c *RoomsListCall) doRequest(alt string) (*http.Response, error) {
  8715. reqHeaders := make(http.Header)
  8716. for k, v := range c.header_ {
  8717. reqHeaders[k] = v
  8718. }
  8719. reqHeaders.Set("User-Agent", c.s.userAgent())
  8720. if c.ifNoneMatch_ != "" {
  8721. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8722. }
  8723. var body io.Reader = nil
  8724. c.urlParams_.Set("alt", alt)
  8725. c.urlParams_.Set("prettyPrint", "false")
  8726. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms")
  8727. urls += "?" + c.urlParams_.Encode()
  8728. req, err := http.NewRequest("GET", urls, body)
  8729. if err != nil {
  8730. return nil, err
  8731. }
  8732. req.Header = reqHeaders
  8733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8734. }
  8735. // Do executes the "games.rooms.list" call.
  8736. // Exactly one of *RoomList or error will be non-nil. Any non-2xx status
  8737. // code is an error. Response headers are in either
  8738. // *RoomList.ServerResponse.Header or (if a response was returned at
  8739. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8740. // to check whether the returned error was because
  8741. // http.StatusNotModified was returned.
  8742. func (c *RoomsListCall) Do(opts ...googleapi.CallOption) (*RoomList, error) {
  8743. gensupport.SetOptions(c.urlParams_, opts...)
  8744. res, err := c.doRequest("json")
  8745. if res != nil && res.StatusCode == http.StatusNotModified {
  8746. if res.Body != nil {
  8747. res.Body.Close()
  8748. }
  8749. return nil, &googleapi.Error{
  8750. Code: res.StatusCode,
  8751. Header: res.Header,
  8752. }
  8753. }
  8754. if err != nil {
  8755. return nil, err
  8756. }
  8757. defer googleapi.CloseBody(res)
  8758. if err := googleapi.CheckResponse(res); err != nil {
  8759. return nil, err
  8760. }
  8761. ret := &RoomList{
  8762. ServerResponse: googleapi.ServerResponse{
  8763. Header: res.Header,
  8764. HTTPStatusCode: res.StatusCode,
  8765. },
  8766. }
  8767. target := &ret
  8768. if err := gensupport.DecodeResponse(target, res); err != nil {
  8769. return nil, err
  8770. }
  8771. return ret, nil
  8772. // {
  8773. // "description": "Returns invitations to join rooms.",
  8774. // "httpMethod": "GET",
  8775. // "id": "games.rooms.list",
  8776. // "parameters": {
  8777. // "language": {
  8778. // "description": "The preferred language to use for strings returned by this method.",
  8779. // "location": "query",
  8780. // "type": "string"
  8781. // },
  8782. // "maxResults": {
  8783. // "description": "The maximum number of rooms to return in the response, used for paging. For any response, the actual number of rooms to return may be less than the specified maxResults.",
  8784. // "format": "int32",
  8785. // "location": "query",
  8786. // "maximum": "500",
  8787. // "minimum": "1",
  8788. // "type": "integer"
  8789. // },
  8790. // "pageToken": {
  8791. // "description": "The token returned by the previous request.",
  8792. // "location": "query",
  8793. // "type": "string"
  8794. // }
  8795. // },
  8796. // "path": "rooms",
  8797. // "response": {
  8798. // "$ref": "RoomList"
  8799. // },
  8800. // "scopes": [
  8801. // "https://www.googleapis.com/auth/games",
  8802. // "https://www.googleapis.com/auth/plus.me"
  8803. // ]
  8804. // }
  8805. }
  8806. // Pages invokes f for each page of results.
  8807. // A non-nil error returned from f will halt the iteration.
  8808. // The provided context supersedes any context provided to the Context method.
  8809. func (c *RoomsListCall) Pages(ctx context.Context, f func(*RoomList) error) error {
  8810. c.ctx_ = ctx
  8811. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8812. for {
  8813. x, err := c.Do()
  8814. if err != nil {
  8815. return err
  8816. }
  8817. if err := f(x); err != nil {
  8818. return err
  8819. }
  8820. if x.NextPageToken == "" {
  8821. return nil
  8822. }
  8823. c.PageToken(x.NextPageToken)
  8824. }
  8825. }
  8826. // method id "games.rooms.reportStatus":
  8827. type RoomsReportStatusCall struct {
  8828. s *Service
  8829. roomId string
  8830. roomp2pstatuses *RoomP2PStatuses
  8831. urlParams_ gensupport.URLParams
  8832. ctx_ context.Context
  8833. header_ http.Header
  8834. }
  8835. // ReportStatus: Updates sent by a client reporting the status of peers
  8836. // in a room. For internal use by the Games SDK only. Calling this
  8837. // method directly is unsupported.
  8838. func (r *RoomsService) ReportStatus(roomId string, roomp2pstatuses *RoomP2PStatuses) *RoomsReportStatusCall {
  8839. c := &RoomsReportStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8840. c.roomId = roomId
  8841. c.roomp2pstatuses = roomp2pstatuses
  8842. return c
  8843. }
  8844. // Language sets the optional parameter "language": The preferred
  8845. // language to use for strings returned by this method.
  8846. func (c *RoomsReportStatusCall) Language(language string) *RoomsReportStatusCall {
  8847. c.urlParams_.Set("language", language)
  8848. return c
  8849. }
  8850. // Fields allows partial responses to be retrieved. See
  8851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8852. // for more information.
  8853. func (c *RoomsReportStatusCall) Fields(s ...googleapi.Field) *RoomsReportStatusCall {
  8854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8855. return c
  8856. }
  8857. // Context sets the context to be used in this call's Do method. Any
  8858. // pending HTTP request will be aborted if the provided context is
  8859. // canceled.
  8860. func (c *RoomsReportStatusCall) Context(ctx context.Context) *RoomsReportStatusCall {
  8861. c.ctx_ = ctx
  8862. return c
  8863. }
  8864. // Header returns an http.Header that can be modified by the caller to
  8865. // add HTTP headers to the request.
  8866. func (c *RoomsReportStatusCall) Header() http.Header {
  8867. if c.header_ == nil {
  8868. c.header_ = make(http.Header)
  8869. }
  8870. return c.header_
  8871. }
  8872. func (c *RoomsReportStatusCall) doRequest(alt string) (*http.Response, error) {
  8873. reqHeaders := make(http.Header)
  8874. for k, v := range c.header_ {
  8875. reqHeaders[k] = v
  8876. }
  8877. reqHeaders.Set("User-Agent", c.s.userAgent())
  8878. var body io.Reader = nil
  8879. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomp2pstatuses)
  8880. if err != nil {
  8881. return nil, err
  8882. }
  8883. reqHeaders.Set("Content-Type", "application/json")
  8884. c.urlParams_.Set("alt", alt)
  8885. c.urlParams_.Set("prettyPrint", "false")
  8886. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus")
  8887. urls += "?" + c.urlParams_.Encode()
  8888. req, err := http.NewRequest("POST", urls, body)
  8889. if err != nil {
  8890. return nil, err
  8891. }
  8892. req.Header = reqHeaders
  8893. googleapi.Expand(req.URL, map[string]string{
  8894. "roomId": c.roomId,
  8895. })
  8896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8897. }
  8898. // Do executes the "games.rooms.reportStatus" call.
  8899. // Exactly one of *RoomStatus or error will be non-nil. Any non-2xx
  8900. // status code is an error. Response headers are in either
  8901. // *RoomStatus.ServerResponse.Header or (if a response was returned at
  8902. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8903. // to check whether the returned error was because
  8904. // http.StatusNotModified was returned.
  8905. func (c *RoomsReportStatusCall) Do(opts ...googleapi.CallOption) (*RoomStatus, error) {
  8906. gensupport.SetOptions(c.urlParams_, opts...)
  8907. res, err := c.doRequest("json")
  8908. if res != nil && res.StatusCode == http.StatusNotModified {
  8909. if res.Body != nil {
  8910. res.Body.Close()
  8911. }
  8912. return nil, &googleapi.Error{
  8913. Code: res.StatusCode,
  8914. Header: res.Header,
  8915. }
  8916. }
  8917. if err != nil {
  8918. return nil, err
  8919. }
  8920. defer googleapi.CloseBody(res)
  8921. if err := googleapi.CheckResponse(res); err != nil {
  8922. return nil, err
  8923. }
  8924. ret := &RoomStatus{
  8925. ServerResponse: googleapi.ServerResponse{
  8926. Header: res.Header,
  8927. HTTPStatusCode: res.StatusCode,
  8928. },
  8929. }
  8930. target := &ret
  8931. if err := gensupport.DecodeResponse(target, res); err != nil {
  8932. return nil, err
  8933. }
  8934. return ret, nil
  8935. // {
  8936. // "description": "Updates sent by a client reporting the status of peers in a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8937. // "httpMethod": "POST",
  8938. // "id": "games.rooms.reportStatus",
  8939. // "parameterOrder": [
  8940. // "roomId"
  8941. // ],
  8942. // "parameters": {
  8943. // "language": {
  8944. // "description": "The preferred language to use for strings returned by this method.",
  8945. // "location": "query",
  8946. // "type": "string"
  8947. // },
  8948. // "roomId": {
  8949. // "description": "The ID of the room.",
  8950. // "location": "path",
  8951. // "required": true,
  8952. // "type": "string"
  8953. // }
  8954. // },
  8955. // "path": "rooms/{roomId}/reportstatus",
  8956. // "request": {
  8957. // "$ref": "RoomP2PStatuses"
  8958. // },
  8959. // "response": {
  8960. // "$ref": "RoomStatus"
  8961. // },
  8962. // "scopes": [
  8963. // "https://www.googleapis.com/auth/games",
  8964. // "https://www.googleapis.com/auth/plus.me"
  8965. // ]
  8966. // }
  8967. }
  8968. // method id "games.scores.get":
  8969. type ScoresGetCall struct {
  8970. s *Service
  8971. playerId string
  8972. leaderboardId string
  8973. timeSpan string
  8974. urlParams_ gensupport.URLParams
  8975. ifNoneMatch_ string
  8976. ctx_ context.Context
  8977. header_ http.Header
  8978. }
  8979. // Get: Get high scores, and optionally ranks, in leaderboards for the
  8980. // currently authenticated player. For a specific time span,
  8981. // leaderboardId can be set to ALL to retrieve data for all leaderboards
  8982. // in a given time span.
  8983. // NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in
  8984. // the same request; only one parameter may be set to 'ALL'.
  8985. func (r *ScoresService) Get(playerId string, leaderboardId string, timeSpan string) *ScoresGetCall {
  8986. c := &ScoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8987. c.playerId = playerId
  8988. c.leaderboardId = leaderboardId
  8989. c.timeSpan = timeSpan
  8990. return c
  8991. }
  8992. // IncludeRankType sets the optional parameter "includeRankType": The
  8993. // types of ranks to return. If the parameter is omitted, no ranks will
  8994. // be returned.
  8995. //
  8996. // Possible values:
  8997. // "ALL" - Retrieve public and social ranks.
  8998. // "PUBLIC" - Retrieve public ranks, if the player is sharing their
  8999. // gameplay activity publicly.
  9000. // "SOCIAL" - Retrieve the social rank.
  9001. func (c *ScoresGetCall) IncludeRankType(includeRankType string) *ScoresGetCall {
  9002. c.urlParams_.Set("includeRankType", includeRankType)
  9003. return c
  9004. }
  9005. // Language sets the optional parameter "language": The preferred
  9006. // language to use for strings returned by this method.
  9007. func (c *ScoresGetCall) Language(language string) *ScoresGetCall {
  9008. c.urlParams_.Set("language", language)
  9009. return c
  9010. }
  9011. // MaxResults sets the optional parameter "maxResults": The maximum
  9012. // number of leaderboard scores to return in the response. For any
  9013. // response, the actual number of leaderboard scores returned may be
  9014. // less than the specified maxResults.
  9015. func (c *ScoresGetCall) MaxResults(maxResults int64) *ScoresGetCall {
  9016. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9017. return c
  9018. }
  9019. // PageToken sets the optional parameter "pageToken": The token returned
  9020. // by the previous request.
  9021. func (c *ScoresGetCall) PageToken(pageToken string) *ScoresGetCall {
  9022. c.urlParams_.Set("pageToken", pageToken)
  9023. return c
  9024. }
  9025. // Fields allows partial responses to be retrieved. See
  9026. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9027. // for more information.
  9028. func (c *ScoresGetCall) Fields(s ...googleapi.Field) *ScoresGetCall {
  9029. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9030. return c
  9031. }
  9032. // IfNoneMatch sets the optional parameter which makes the operation
  9033. // fail if the object's ETag matches the given value. This is useful for
  9034. // getting updates only after the object has changed since the last
  9035. // request. Use googleapi.IsNotModified to check whether the response
  9036. // error from Do is the result of In-None-Match.
  9037. func (c *ScoresGetCall) IfNoneMatch(entityTag string) *ScoresGetCall {
  9038. c.ifNoneMatch_ = entityTag
  9039. return c
  9040. }
  9041. // Context sets the context to be used in this call's Do method. Any
  9042. // pending HTTP request will be aborted if the provided context is
  9043. // canceled.
  9044. func (c *ScoresGetCall) Context(ctx context.Context) *ScoresGetCall {
  9045. c.ctx_ = ctx
  9046. return c
  9047. }
  9048. // Header returns an http.Header that can be modified by the caller to
  9049. // add HTTP headers to the request.
  9050. func (c *ScoresGetCall) Header() http.Header {
  9051. if c.header_ == nil {
  9052. c.header_ = make(http.Header)
  9053. }
  9054. return c.header_
  9055. }
  9056. func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) {
  9057. reqHeaders := make(http.Header)
  9058. for k, v := range c.header_ {
  9059. reqHeaders[k] = v
  9060. }
  9061. reqHeaders.Set("User-Agent", c.s.userAgent())
  9062. if c.ifNoneMatch_ != "" {
  9063. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9064. }
  9065. var body io.Reader = nil
  9066. c.urlParams_.Set("alt", alt)
  9067. c.urlParams_.Set("prettyPrint", "false")
  9068. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}")
  9069. urls += "?" + c.urlParams_.Encode()
  9070. req, err := http.NewRequest("GET", urls, body)
  9071. if err != nil {
  9072. return nil, err
  9073. }
  9074. req.Header = reqHeaders
  9075. googleapi.Expand(req.URL, map[string]string{
  9076. "playerId": c.playerId,
  9077. "leaderboardId": c.leaderboardId,
  9078. "timeSpan": c.timeSpan,
  9079. })
  9080. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9081. }
  9082. // Do executes the "games.scores.get" call.
  9083. // Exactly one of *PlayerLeaderboardScoreListResponse or error will be
  9084. // non-nil. Any non-2xx status code is an error. Response headers are in
  9085. // either *PlayerLeaderboardScoreListResponse.ServerResponse.Header or
  9086. // (if a response was returned at all) in
  9087. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9088. // whether the returned error was because http.StatusNotModified was
  9089. // returned.
  9090. func (c *ScoresGetCall) Do(opts ...googleapi.CallOption) (*PlayerLeaderboardScoreListResponse, error) {
  9091. gensupport.SetOptions(c.urlParams_, opts...)
  9092. res, err := c.doRequest("json")
  9093. if res != nil && res.StatusCode == http.StatusNotModified {
  9094. if res.Body != nil {
  9095. res.Body.Close()
  9096. }
  9097. return nil, &googleapi.Error{
  9098. Code: res.StatusCode,
  9099. Header: res.Header,
  9100. }
  9101. }
  9102. if err != nil {
  9103. return nil, err
  9104. }
  9105. defer googleapi.CloseBody(res)
  9106. if err := googleapi.CheckResponse(res); err != nil {
  9107. return nil, err
  9108. }
  9109. ret := &PlayerLeaderboardScoreListResponse{
  9110. ServerResponse: googleapi.ServerResponse{
  9111. Header: res.Header,
  9112. HTTPStatusCode: res.StatusCode,
  9113. },
  9114. }
  9115. target := &ret
  9116. if err := gensupport.DecodeResponse(target, res); err != nil {
  9117. return nil, err
  9118. }
  9119. return ret, nil
  9120. // {
  9121. // "description": "Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span.\nNOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in the same request; only one parameter may be set to 'ALL'.",
  9122. // "httpMethod": "GET",
  9123. // "id": "games.scores.get",
  9124. // "parameterOrder": [
  9125. // "playerId",
  9126. // "leaderboardId",
  9127. // "timeSpan"
  9128. // ],
  9129. // "parameters": {
  9130. // "includeRankType": {
  9131. // "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.",
  9132. // "enum": [
  9133. // "ALL",
  9134. // "PUBLIC",
  9135. // "SOCIAL"
  9136. // ],
  9137. // "enumDescriptions": [
  9138. // "Retrieve public and social ranks.",
  9139. // "Retrieve public ranks, if the player is sharing their gameplay activity publicly.",
  9140. // "Retrieve the social rank."
  9141. // ],
  9142. // "location": "query",
  9143. // "type": "string"
  9144. // },
  9145. // "language": {
  9146. // "description": "The preferred language to use for strings returned by this method.",
  9147. // "location": "query",
  9148. // "type": "string"
  9149. // },
  9150. // "leaderboardId": {
  9151. // "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.",
  9152. // "location": "path",
  9153. // "required": true,
  9154. // "type": "string"
  9155. // },
  9156. // "maxResults": {
  9157. // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.",
  9158. // "format": "int32",
  9159. // "location": "query",
  9160. // "maximum": "30",
  9161. // "minimum": "1",
  9162. // "type": "integer"
  9163. // },
  9164. // "pageToken": {
  9165. // "description": "The token returned by the previous request.",
  9166. // "location": "query",
  9167. // "type": "string"
  9168. // },
  9169. // "playerId": {
  9170. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  9171. // "location": "path",
  9172. // "required": true,
  9173. // "type": "string"
  9174. // },
  9175. // "timeSpan": {
  9176. // "description": "The time span for the scores and ranks you're requesting.",
  9177. // "enum": [
  9178. // "ALL",
  9179. // "ALL_TIME",
  9180. // "DAILY",
  9181. // "WEEKLY"
  9182. // ],
  9183. // "enumDescriptions": [
  9184. // "Get the high scores for all time spans. If this is used, maxResults values will be ignored.",
  9185. // "Get the all time high score.",
  9186. // "List the top scores for the current day.",
  9187. // "List the top scores for the current week."
  9188. // ],
  9189. // "location": "path",
  9190. // "required": true,
  9191. // "type": "string"
  9192. // }
  9193. // },
  9194. // "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}",
  9195. // "response": {
  9196. // "$ref": "PlayerLeaderboardScoreListResponse"
  9197. // },
  9198. // "scopes": [
  9199. // "https://www.googleapis.com/auth/games",
  9200. // "https://www.googleapis.com/auth/plus.me"
  9201. // ]
  9202. // }
  9203. }
  9204. // Pages invokes f for each page of results.
  9205. // A non-nil error returned from f will halt the iteration.
  9206. // The provided context supersedes any context provided to the Context method.
  9207. func (c *ScoresGetCall) Pages(ctx context.Context, f func(*PlayerLeaderboardScoreListResponse) error) error {
  9208. c.ctx_ = ctx
  9209. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9210. for {
  9211. x, err := c.Do()
  9212. if err != nil {
  9213. return err
  9214. }
  9215. if err := f(x); err != nil {
  9216. return err
  9217. }
  9218. if x.NextPageToken == "" {
  9219. return nil
  9220. }
  9221. c.PageToken(x.NextPageToken)
  9222. }
  9223. }
  9224. // method id "games.scores.list":
  9225. type ScoresListCall struct {
  9226. s *Service
  9227. leaderboardId string
  9228. collection string
  9229. urlParams_ gensupport.URLParams
  9230. ifNoneMatch_ string
  9231. ctx_ context.Context
  9232. header_ http.Header
  9233. }
  9234. // List: Lists the scores in a leaderboard, starting from the top.
  9235. func (r *ScoresService) List(leaderboardId string, collection string, timeSpan string) *ScoresListCall {
  9236. c := &ScoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9237. c.leaderboardId = leaderboardId
  9238. c.collection = collection
  9239. c.urlParams_.Set("timeSpan", timeSpan)
  9240. return c
  9241. }
  9242. // Language sets the optional parameter "language": The preferred
  9243. // language to use for strings returned by this method.
  9244. func (c *ScoresListCall) Language(language string) *ScoresListCall {
  9245. c.urlParams_.Set("language", language)
  9246. return c
  9247. }
  9248. // MaxResults sets the optional parameter "maxResults": The maximum
  9249. // number of leaderboard scores to return in the response. For any
  9250. // response, the actual number of leaderboard scores returned may be
  9251. // less than the specified maxResults.
  9252. func (c *ScoresListCall) MaxResults(maxResults int64) *ScoresListCall {
  9253. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9254. return c
  9255. }
  9256. // PageToken sets the optional parameter "pageToken": The token returned
  9257. // by the previous request.
  9258. func (c *ScoresListCall) PageToken(pageToken string) *ScoresListCall {
  9259. c.urlParams_.Set("pageToken", pageToken)
  9260. return c
  9261. }
  9262. // Fields allows partial responses to be retrieved. See
  9263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9264. // for more information.
  9265. func (c *ScoresListCall) Fields(s ...googleapi.Field) *ScoresListCall {
  9266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9267. return c
  9268. }
  9269. // IfNoneMatch sets the optional parameter which makes the operation
  9270. // fail if the object's ETag matches the given value. This is useful for
  9271. // getting updates only after the object has changed since the last
  9272. // request. Use googleapi.IsNotModified to check whether the response
  9273. // error from Do is the result of In-None-Match.
  9274. func (c *ScoresListCall) IfNoneMatch(entityTag string) *ScoresListCall {
  9275. c.ifNoneMatch_ = entityTag
  9276. return c
  9277. }
  9278. // Context sets the context to be used in this call's Do method. Any
  9279. // pending HTTP request will be aborted if the provided context is
  9280. // canceled.
  9281. func (c *ScoresListCall) Context(ctx context.Context) *ScoresListCall {
  9282. c.ctx_ = ctx
  9283. return c
  9284. }
  9285. // Header returns an http.Header that can be modified by the caller to
  9286. // add HTTP headers to the request.
  9287. func (c *ScoresListCall) Header() http.Header {
  9288. if c.header_ == nil {
  9289. c.header_ = make(http.Header)
  9290. }
  9291. return c.header_
  9292. }
  9293. func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) {
  9294. reqHeaders := make(http.Header)
  9295. for k, v := range c.header_ {
  9296. reqHeaders[k] = v
  9297. }
  9298. reqHeaders.Set("User-Agent", c.s.userAgent())
  9299. if c.ifNoneMatch_ != "" {
  9300. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9301. }
  9302. var body io.Reader = nil
  9303. c.urlParams_.Set("alt", alt)
  9304. c.urlParams_.Set("prettyPrint", "false")
  9305. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}")
  9306. urls += "?" + c.urlParams_.Encode()
  9307. req, err := http.NewRequest("GET", urls, body)
  9308. if err != nil {
  9309. return nil, err
  9310. }
  9311. req.Header = reqHeaders
  9312. googleapi.Expand(req.URL, map[string]string{
  9313. "leaderboardId": c.leaderboardId,
  9314. "collection": c.collection,
  9315. })
  9316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9317. }
  9318. // Do executes the "games.scores.list" call.
  9319. // Exactly one of *LeaderboardScores or error will be non-nil. Any
  9320. // non-2xx status code is an error. Response headers are in either
  9321. // *LeaderboardScores.ServerResponse.Header or (if a response was
  9322. // returned at all) in error.(*googleapi.Error).Header. Use
  9323. // googleapi.IsNotModified to check whether the returned error was
  9324. // because http.StatusNotModified was returned.
  9325. func (c *ScoresListCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) {
  9326. gensupport.SetOptions(c.urlParams_, opts...)
  9327. res, err := c.doRequest("json")
  9328. if res != nil && res.StatusCode == http.StatusNotModified {
  9329. if res.Body != nil {
  9330. res.Body.Close()
  9331. }
  9332. return nil, &googleapi.Error{
  9333. Code: res.StatusCode,
  9334. Header: res.Header,
  9335. }
  9336. }
  9337. if err != nil {
  9338. return nil, err
  9339. }
  9340. defer googleapi.CloseBody(res)
  9341. if err := googleapi.CheckResponse(res); err != nil {
  9342. return nil, err
  9343. }
  9344. ret := &LeaderboardScores{
  9345. ServerResponse: googleapi.ServerResponse{
  9346. Header: res.Header,
  9347. HTTPStatusCode: res.StatusCode,
  9348. },
  9349. }
  9350. target := &ret
  9351. if err := gensupport.DecodeResponse(target, res); err != nil {
  9352. return nil, err
  9353. }
  9354. return ret, nil
  9355. // {
  9356. // "description": "Lists the scores in a leaderboard, starting from the top.",
  9357. // "httpMethod": "GET",
  9358. // "id": "games.scores.list",
  9359. // "parameterOrder": [
  9360. // "leaderboardId",
  9361. // "collection",
  9362. // "timeSpan"
  9363. // ],
  9364. // "parameters": {
  9365. // "collection": {
  9366. // "description": "The collection of scores you're requesting.",
  9367. // "enum": [
  9368. // "PUBLIC",
  9369. // "SOCIAL",
  9370. // "SOCIAL_1P"
  9371. // ],
  9372. // "enumDescriptions": [
  9373. // "List all scores in the public leaderboard.",
  9374. // "List only social scores.",
  9375. // "List only social scores, not respecting the fACL."
  9376. // ],
  9377. // "location": "path",
  9378. // "required": true,
  9379. // "type": "string"
  9380. // },
  9381. // "language": {
  9382. // "description": "The preferred language to use for strings returned by this method.",
  9383. // "location": "query",
  9384. // "type": "string"
  9385. // },
  9386. // "leaderboardId": {
  9387. // "description": "The ID of the leaderboard.",
  9388. // "location": "path",
  9389. // "required": true,
  9390. // "type": "string"
  9391. // },
  9392. // "maxResults": {
  9393. // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.",
  9394. // "format": "int32",
  9395. // "location": "query",
  9396. // "maximum": "30",
  9397. // "minimum": "1",
  9398. // "type": "integer"
  9399. // },
  9400. // "pageToken": {
  9401. // "description": "The token returned by the previous request.",
  9402. // "location": "query",
  9403. // "type": "string"
  9404. // },
  9405. // "timeSpan": {
  9406. // "description": "The time span for the scores and ranks you're requesting.",
  9407. // "enum": [
  9408. // "ALL_TIME",
  9409. // "DAILY",
  9410. // "WEEKLY"
  9411. // ],
  9412. // "enumDescriptions": [
  9413. // "List the all-time top scores.",
  9414. // "List the top scores for the current day.",
  9415. // "List the top scores for the current week."
  9416. // ],
  9417. // "location": "query",
  9418. // "required": true,
  9419. // "type": "string"
  9420. // }
  9421. // },
  9422. // "path": "leaderboards/{leaderboardId}/scores/{collection}",
  9423. // "response": {
  9424. // "$ref": "LeaderboardScores"
  9425. // },
  9426. // "scopes": [
  9427. // "https://www.googleapis.com/auth/games",
  9428. // "https://www.googleapis.com/auth/plus.me"
  9429. // ]
  9430. // }
  9431. }
  9432. // Pages invokes f for each page of results.
  9433. // A non-nil error returned from f will halt the iteration.
  9434. // The provided context supersedes any context provided to the Context method.
  9435. func (c *ScoresListCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error {
  9436. c.ctx_ = ctx
  9437. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9438. for {
  9439. x, err := c.Do()
  9440. if err != nil {
  9441. return err
  9442. }
  9443. if err := f(x); err != nil {
  9444. return err
  9445. }
  9446. if x.NextPageToken == "" {
  9447. return nil
  9448. }
  9449. c.PageToken(x.NextPageToken)
  9450. }
  9451. }
  9452. // method id "games.scores.listWindow":
  9453. type ScoresListWindowCall struct {
  9454. s *Service
  9455. leaderboardId string
  9456. collection string
  9457. urlParams_ gensupport.URLParams
  9458. ifNoneMatch_ string
  9459. ctx_ context.Context
  9460. header_ http.Header
  9461. }
  9462. // ListWindow: Lists the scores in a leaderboard around (and including)
  9463. // a player's score.
  9464. func (r *ScoresService) ListWindow(leaderboardId string, collection string, timeSpan string) *ScoresListWindowCall {
  9465. c := &ScoresListWindowCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9466. c.leaderboardId = leaderboardId
  9467. c.collection = collection
  9468. c.urlParams_.Set("timeSpan", timeSpan)
  9469. return c
  9470. }
  9471. // Language sets the optional parameter "language": The preferred
  9472. // language to use for strings returned by this method.
  9473. func (c *ScoresListWindowCall) Language(language string) *ScoresListWindowCall {
  9474. c.urlParams_.Set("language", language)
  9475. return c
  9476. }
  9477. // MaxResults sets the optional parameter "maxResults": The maximum
  9478. // number of leaderboard scores to return in the response. For any
  9479. // response, the actual number of leaderboard scores returned may be
  9480. // less than the specified maxResults.
  9481. func (c *ScoresListWindowCall) MaxResults(maxResults int64) *ScoresListWindowCall {
  9482. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9483. return c
  9484. }
  9485. // PageToken sets the optional parameter "pageToken": The token returned
  9486. // by the previous request.
  9487. func (c *ScoresListWindowCall) PageToken(pageToken string) *ScoresListWindowCall {
  9488. c.urlParams_.Set("pageToken", pageToken)
  9489. return c
  9490. }
  9491. // ResultsAbove sets the optional parameter "resultsAbove": The
  9492. // preferred number of scores to return above the player's score. More
  9493. // scores may be returned if the player is at the bottom of the
  9494. // leaderboard; fewer may be returned if the player is at the top. Must
  9495. // be less than or equal to maxResults.
  9496. func (c *ScoresListWindowCall) ResultsAbove(resultsAbove int64) *ScoresListWindowCall {
  9497. c.urlParams_.Set("resultsAbove", fmt.Sprint(resultsAbove))
  9498. return c
  9499. }
  9500. // ReturnTopIfAbsent sets the optional parameter "returnTopIfAbsent":
  9501. // True if the top scores should be returned when the player is not in
  9502. // the leaderboard. Defaults to true.
  9503. func (c *ScoresListWindowCall) ReturnTopIfAbsent(returnTopIfAbsent bool) *ScoresListWindowCall {
  9504. c.urlParams_.Set("returnTopIfAbsent", fmt.Sprint(returnTopIfAbsent))
  9505. return c
  9506. }
  9507. // Fields allows partial responses to be retrieved. See
  9508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9509. // for more information.
  9510. func (c *ScoresListWindowCall) Fields(s ...googleapi.Field) *ScoresListWindowCall {
  9511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9512. return c
  9513. }
  9514. // IfNoneMatch sets the optional parameter which makes the operation
  9515. // fail if the object's ETag matches the given value. This is useful for
  9516. // getting updates only after the object has changed since the last
  9517. // request. Use googleapi.IsNotModified to check whether the response
  9518. // error from Do is the result of In-None-Match.
  9519. func (c *ScoresListWindowCall) IfNoneMatch(entityTag string) *ScoresListWindowCall {
  9520. c.ifNoneMatch_ = entityTag
  9521. return c
  9522. }
  9523. // Context sets the context to be used in this call's Do method. Any
  9524. // pending HTTP request will be aborted if the provided context is
  9525. // canceled.
  9526. func (c *ScoresListWindowCall) Context(ctx context.Context) *ScoresListWindowCall {
  9527. c.ctx_ = ctx
  9528. return c
  9529. }
  9530. // Header returns an http.Header that can be modified by the caller to
  9531. // add HTTP headers to the request.
  9532. func (c *ScoresListWindowCall) Header() http.Header {
  9533. if c.header_ == nil {
  9534. c.header_ = make(http.Header)
  9535. }
  9536. return c.header_
  9537. }
  9538. func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) {
  9539. reqHeaders := make(http.Header)
  9540. for k, v := range c.header_ {
  9541. reqHeaders[k] = v
  9542. }
  9543. reqHeaders.Set("User-Agent", c.s.userAgent())
  9544. if c.ifNoneMatch_ != "" {
  9545. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9546. }
  9547. var body io.Reader = nil
  9548. c.urlParams_.Set("alt", alt)
  9549. c.urlParams_.Set("prettyPrint", "false")
  9550. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}")
  9551. urls += "?" + c.urlParams_.Encode()
  9552. req, err := http.NewRequest("GET", urls, body)
  9553. if err != nil {
  9554. return nil, err
  9555. }
  9556. req.Header = reqHeaders
  9557. googleapi.Expand(req.URL, map[string]string{
  9558. "leaderboardId": c.leaderboardId,
  9559. "collection": c.collection,
  9560. })
  9561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9562. }
  9563. // Do executes the "games.scores.listWindow" call.
  9564. // Exactly one of *LeaderboardScores or error will be non-nil. Any
  9565. // non-2xx status code is an error. Response headers are in either
  9566. // *LeaderboardScores.ServerResponse.Header or (if a response was
  9567. // returned at all) in error.(*googleapi.Error).Header. Use
  9568. // googleapi.IsNotModified to check whether the returned error was
  9569. // because http.StatusNotModified was returned.
  9570. func (c *ScoresListWindowCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) {
  9571. gensupport.SetOptions(c.urlParams_, opts...)
  9572. res, err := c.doRequest("json")
  9573. if res != nil && res.StatusCode == http.StatusNotModified {
  9574. if res.Body != nil {
  9575. res.Body.Close()
  9576. }
  9577. return nil, &googleapi.Error{
  9578. Code: res.StatusCode,
  9579. Header: res.Header,
  9580. }
  9581. }
  9582. if err != nil {
  9583. return nil, err
  9584. }
  9585. defer googleapi.CloseBody(res)
  9586. if err := googleapi.CheckResponse(res); err != nil {
  9587. return nil, err
  9588. }
  9589. ret := &LeaderboardScores{
  9590. ServerResponse: googleapi.ServerResponse{
  9591. Header: res.Header,
  9592. HTTPStatusCode: res.StatusCode,
  9593. },
  9594. }
  9595. target := &ret
  9596. if err := gensupport.DecodeResponse(target, res); err != nil {
  9597. return nil, err
  9598. }
  9599. return ret, nil
  9600. // {
  9601. // "description": "Lists the scores in a leaderboard around (and including) a player's score.",
  9602. // "httpMethod": "GET",
  9603. // "id": "games.scores.listWindow",
  9604. // "parameterOrder": [
  9605. // "leaderboardId",
  9606. // "collection",
  9607. // "timeSpan"
  9608. // ],
  9609. // "parameters": {
  9610. // "collection": {
  9611. // "description": "The collection of scores you're requesting.",
  9612. // "enum": [
  9613. // "PUBLIC",
  9614. // "SOCIAL",
  9615. // "SOCIAL_1P"
  9616. // ],
  9617. // "enumDescriptions": [
  9618. // "List all scores in the public leaderboard.",
  9619. // "List only social scores.",
  9620. // "List only social scores, not respecting the fACL."
  9621. // ],
  9622. // "location": "path",
  9623. // "required": true,
  9624. // "type": "string"
  9625. // },
  9626. // "language": {
  9627. // "description": "The preferred language to use for strings returned by this method.",
  9628. // "location": "query",
  9629. // "type": "string"
  9630. // },
  9631. // "leaderboardId": {
  9632. // "description": "The ID of the leaderboard.",
  9633. // "location": "path",
  9634. // "required": true,
  9635. // "type": "string"
  9636. // },
  9637. // "maxResults": {
  9638. // "description": "The maximum number of leaderboard scores to return in the response. For any response, the actual number of leaderboard scores returned may be less than the specified maxResults.",
  9639. // "format": "int32",
  9640. // "location": "query",
  9641. // "maximum": "30",
  9642. // "minimum": "1",
  9643. // "type": "integer"
  9644. // },
  9645. // "pageToken": {
  9646. // "description": "The token returned by the previous request.",
  9647. // "location": "query",
  9648. // "type": "string"
  9649. // },
  9650. // "resultsAbove": {
  9651. // "description": "The preferred number of scores to return above the player's score. More scores may be returned if the player is at the bottom of the leaderboard; fewer may be returned if the player is at the top. Must be less than or equal to maxResults.",
  9652. // "format": "int32",
  9653. // "location": "query",
  9654. // "type": "integer"
  9655. // },
  9656. // "returnTopIfAbsent": {
  9657. // "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.",
  9658. // "location": "query",
  9659. // "type": "boolean"
  9660. // },
  9661. // "timeSpan": {
  9662. // "description": "The time span for the scores and ranks you're requesting.",
  9663. // "enum": [
  9664. // "ALL_TIME",
  9665. // "DAILY",
  9666. // "WEEKLY"
  9667. // ],
  9668. // "enumDescriptions": [
  9669. // "List the all-time top scores.",
  9670. // "List the top scores for the current day.",
  9671. // "List the top scores for the current week."
  9672. // ],
  9673. // "location": "query",
  9674. // "required": true,
  9675. // "type": "string"
  9676. // }
  9677. // },
  9678. // "path": "leaderboards/{leaderboardId}/window/{collection}",
  9679. // "response": {
  9680. // "$ref": "LeaderboardScores"
  9681. // },
  9682. // "scopes": [
  9683. // "https://www.googleapis.com/auth/games",
  9684. // "https://www.googleapis.com/auth/plus.me"
  9685. // ]
  9686. // }
  9687. }
  9688. // Pages invokes f for each page of results.
  9689. // A non-nil error returned from f will halt the iteration.
  9690. // The provided context supersedes any context provided to the Context method.
  9691. func (c *ScoresListWindowCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error {
  9692. c.ctx_ = ctx
  9693. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9694. for {
  9695. x, err := c.Do()
  9696. if err != nil {
  9697. return err
  9698. }
  9699. if err := f(x); err != nil {
  9700. return err
  9701. }
  9702. if x.NextPageToken == "" {
  9703. return nil
  9704. }
  9705. c.PageToken(x.NextPageToken)
  9706. }
  9707. }
  9708. // method id "games.scores.submit":
  9709. type ScoresSubmitCall struct {
  9710. s *Service
  9711. leaderboardId string
  9712. urlParams_ gensupport.URLParams
  9713. ctx_ context.Context
  9714. header_ http.Header
  9715. }
  9716. // Submit: Submits a score to the specified leaderboard.
  9717. func (r *ScoresService) Submit(leaderboardId string, score int64) *ScoresSubmitCall {
  9718. c := &ScoresSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9719. c.leaderboardId = leaderboardId
  9720. c.urlParams_.Set("score", fmt.Sprint(score))
  9721. return c
  9722. }
  9723. // Language sets the optional parameter "language": The preferred
  9724. // language to use for strings returned by this method.
  9725. func (c *ScoresSubmitCall) Language(language string) *ScoresSubmitCall {
  9726. c.urlParams_.Set("language", language)
  9727. return c
  9728. }
  9729. // ScoreTag sets the optional parameter "scoreTag": Additional
  9730. // information about the score you're submitting. Values must contain no
  9731. // more than 64 URI-safe characters as defined by section 2.3 of RFC
  9732. // 3986.
  9733. func (c *ScoresSubmitCall) ScoreTag(scoreTag string) *ScoresSubmitCall {
  9734. c.urlParams_.Set("scoreTag", scoreTag)
  9735. return c
  9736. }
  9737. // Fields allows partial responses to be retrieved. See
  9738. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9739. // for more information.
  9740. func (c *ScoresSubmitCall) Fields(s ...googleapi.Field) *ScoresSubmitCall {
  9741. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9742. return c
  9743. }
  9744. // Context sets the context to be used in this call's Do method. Any
  9745. // pending HTTP request will be aborted if the provided context is
  9746. // canceled.
  9747. func (c *ScoresSubmitCall) Context(ctx context.Context) *ScoresSubmitCall {
  9748. c.ctx_ = ctx
  9749. return c
  9750. }
  9751. // Header returns an http.Header that can be modified by the caller to
  9752. // add HTTP headers to the request.
  9753. func (c *ScoresSubmitCall) Header() http.Header {
  9754. if c.header_ == nil {
  9755. c.header_ = make(http.Header)
  9756. }
  9757. return c.header_
  9758. }
  9759. func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) {
  9760. reqHeaders := make(http.Header)
  9761. for k, v := range c.header_ {
  9762. reqHeaders[k] = v
  9763. }
  9764. reqHeaders.Set("User-Agent", c.s.userAgent())
  9765. var body io.Reader = nil
  9766. c.urlParams_.Set("alt", alt)
  9767. c.urlParams_.Set("prettyPrint", "false")
  9768. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores")
  9769. urls += "?" + c.urlParams_.Encode()
  9770. req, err := http.NewRequest("POST", urls, body)
  9771. if err != nil {
  9772. return nil, err
  9773. }
  9774. req.Header = reqHeaders
  9775. googleapi.Expand(req.URL, map[string]string{
  9776. "leaderboardId": c.leaderboardId,
  9777. })
  9778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9779. }
  9780. // Do executes the "games.scores.submit" call.
  9781. // Exactly one of *PlayerScoreResponse or error will be non-nil. Any
  9782. // non-2xx status code is an error. Response headers are in either
  9783. // *PlayerScoreResponse.ServerResponse.Header or (if a response was
  9784. // returned at all) in error.(*googleapi.Error).Header. Use
  9785. // googleapi.IsNotModified to check whether the returned error was
  9786. // because http.StatusNotModified was returned.
  9787. func (c *ScoresSubmitCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResponse, error) {
  9788. gensupport.SetOptions(c.urlParams_, opts...)
  9789. res, err := c.doRequest("json")
  9790. if res != nil && res.StatusCode == http.StatusNotModified {
  9791. if res.Body != nil {
  9792. res.Body.Close()
  9793. }
  9794. return nil, &googleapi.Error{
  9795. Code: res.StatusCode,
  9796. Header: res.Header,
  9797. }
  9798. }
  9799. if err != nil {
  9800. return nil, err
  9801. }
  9802. defer googleapi.CloseBody(res)
  9803. if err := googleapi.CheckResponse(res); err != nil {
  9804. return nil, err
  9805. }
  9806. ret := &PlayerScoreResponse{
  9807. ServerResponse: googleapi.ServerResponse{
  9808. Header: res.Header,
  9809. HTTPStatusCode: res.StatusCode,
  9810. },
  9811. }
  9812. target := &ret
  9813. if err := gensupport.DecodeResponse(target, res); err != nil {
  9814. return nil, err
  9815. }
  9816. return ret, nil
  9817. // {
  9818. // "description": "Submits a score to the specified leaderboard.",
  9819. // "httpMethod": "POST",
  9820. // "id": "games.scores.submit",
  9821. // "parameterOrder": [
  9822. // "leaderboardId",
  9823. // "score"
  9824. // ],
  9825. // "parameters": {
  9826. // "language": {
  9827. // "description": "The preferred language to use for strings returned by this method.",
  9828. // "location": "query",
  9829. // "type": "string"
  9830. // },
  9831. // "leaderboardId": {
  9832. // "description": "The ID of the leaderboard.",
  9833. // "location": "path",
  9834. // "required": true,
  9835. // "type": "string"
  9836. // },
  9837. // "score": {
  9838. // "description": "The score you're submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.",
  9839. // "format": "int64",
  9840. // "location": "query",
  9841. // "required": true,
  9842. // "type": "string"
  9843. // },
  9844. // "scoreTag": {
  9845. // "description": "Additional information about the score you're submitting. Values must contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.",
  9846. // "location": "query",
  9847. // "pattern": "[a-zA-Z0-9-._~]{0,64}",
  9848. // "type": "string"
  9849. // }
  9850. // },
  9851. // "path": "leaderboards/{leaderboardId}/scores",
  9852. // "response": {
  9853. // "$ref": "PlayerScoreResponse"
  9854. // },
  9855. // "scopes": [
  9856. // "https://www.googleapis.com/auth/games",
  9857. // "https://www.googleapis.com/auth/plus.me"
  9858. // ]
  9859. // }
  9860. }
  9861. // method id "games.scores.submitMultiple":
  9862. type ScoresSubmitMultipleCall struct {
  9863. s *Service
  9864. playerscoresubmissionlist *PlayerScoreSubmissionList
  9865. urlParams_ gensupport.URLParams
  9866. ctx_ context.Context
  9867. header_ http.Header
  9868. }
  9869. // SubmitMultiple: Submits multiple scores to leaderboards.
  9870. func (r *ScoresService) SubmitMultiple(playerscoresubmissionlist *PlayerScoreSubmissionList) *ScoresSubmitMultipleCall {
  9871. c := &ScoresSubmitMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9872. c.playerscoresubmissionlist = playerscoresubmissionlist
  9873. return c
  9874. }
  9875. // Language sets the optional parameter "language": The preferred
  9876. // language to use for strings returned by this method.
  9877. func (c *ScoresSubmitMultipleCall) Language(language string) *ScoresSubmitMultipleCall {
  9878. c.urlParams_.Set("language", language)
  9879. return c
  9880. }
  9881. // Fields allows partial responses to be retrieved. See
  9882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9883. // for more information.
  9884. func (c *ScoresSubmitMultipleCall) Fields(s ...googleapi.Field) *ScoresSubmitMultipleCall {
  9885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9886. return c
  9887. }
  9888. // Context sets the context to be used in this call's Do method. Any
  9889. // pending HTTP request will be aborted if the provided context is
  9890. // canceled.
  9891. func (c *ScoresSubmitMultipleCall) Context(ctx context.Context) *ScoresSubmitMultipleCall {
  9892. c.ctx_ = ctx
  9893. return c
  9894. }
  9895. // Header returns an http.Header that can be modified by the caller to
  9896. // add HTTP headers to the request.
  9897. func (c *ScoresSubmitMultipleCall) Header() http.Header {
  9898. if c.header_ == nil {
  9899. c.header_ = make(http.Header)
  9900. }
  9901. return c.header_
  9902. }
  9903. func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, error) {
  9904. reqHeaders := make(http.Header)
  9905. for k, v := range c.header_ {
  9906. reqHeaders[k] = v
  9907. }
  9908. reqHeaders.Set("User-Agent", c.s.userAgent())
  9909. var body io.Reader = nil
  9910. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist)
  9911. if err != nil {
  9912. return nil, err
  9913. }
  9914. reqHeaders.Set("Content-Type", "application/json")
  9915. c.urlParams_.Set("alt", alt)
  9916. c.urlParams_.Set("prettyPrint", "false")
  9917. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/scores")
  9918. urls += "?" + c.urlParams_.Encode()
  9919. req, err := http.NewRequest("POST", urls, body)
  9920. if err != nil {
  9921. return nil, err
  9922. }
  9923. req.Header = reqHeaders
  9924. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9925. }
  9926. // Do executes the "games.scores.submitMultiple" call.
  9927. // Exactly one of *PlayerScoreListResponse or error will be non-nil. Any
  9928. // non-2xx status code is an error. Response headers are in either
  9929. // *PlayerScoreListResponse.ServerResponse.Header or (if a response was
  9930. // returned at all) in error.(*googleapi.Error).Header. Use
  9931. // googleapi.IsNotModified to check whether the returned error was
  9932. // because http.StatusNotModified was returned.
  9933. func (c *ScoresSubmitMultipleCall) Do(opts ...googleapi.CallOption) (*PlayerScoreListResponse, error) {
  9934. gensupport.SetOptions(c.urlParams_, opts...)
  9935. res, err := c.doRequest("json")
  9936. if res != nil && res.StatusCode == http.StatusNotModified {
  9937. if res.Body != nil {
  9938. res.Body.Close()
  9939. }
  9940. return nil, &googleapi.Error{
  9941. Code: res.StatusCode,
  9942. Header: res.Header,
  9943. }
  9944. }
  9945. if err != nil {
  9946. return nil, err
  9947. }
  9948. defer googleapi.CloseBody(res)
  9949. if err := googleapi.CheckResponse(res); err != nil {
  9950. return nil, err
  9951. }
  9952. ret := &PlayerScoreListResponse{
  9953. ServerResponse: googleapi.ServerResponse{
  9954. Header: res.Header,
  9955. HTTPStatusCode: res.StatusCode,
  9956. },
  9957. }
  9958. target := &ret
  9959. if err := gensupport.DecodeResponse(target, res); err != nil {
  9960. return nil, err
  9961. }
  9962. return ret, nil
  9963. // {
  9964. // "description": "Submits multiple scores to leaderboards.",
  9965. // "httpMethod": "POST",
  9966. // "id": "games.scores.submitMultiple",
  9967. // "parameters": {
  9968. // "language": {
  9969. // "description": "The preferred language to use for strings returned by this method.",
  9970. // "location": "query",
  9971. // "type": "string"
  9972. // }
  9973. // },
  9974. // "path": "leaderboards/scores",
  9975. // "request": {
  9976. // "$ref": "PlayerScoreSubmissionList"
  9977. // },
  9978. // "response": {
  9979. // "$ref": "PlayerScoreListResponse"
  9980. // },
  9981. // "scopes": [
  9982. // "https://www.googleapis.com/auth/games",
  9983. // "https://www.googleapis.com/auth/plus.me"
  9984. // ]
  9985. // }
  9986. }
  9987. // method id "games.snapshots.get":
  9988. type SnapshotsGetCall struct {
  9989. s *Service
  9990. snapshotId string
  9991. urlParams_ gensupport.URLParams
  9992. ifNoneMatch_ string
  9993. ctx_ context.Context
  9994. header_ http.Header
  9995. }
  9996. // Get: Retrieves the metadata for a given snapshot ID.
  9997. func (r *SnapshotsService) Get(snapshotId string) *SnapshotsGetCall {
  9998. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9999. c.snapshotId = snapshotId
  10000. return c
  10001. }
  10002. // Language sets the optional parameter "language": The preferred
  10003. // language to use for strings returned by this method.
  10004. func (c *SnapshotsGetCall) Language(language string) *SnapshotsGetCall {
  10005. c.urlParams_.Set("language", language)
  10006. return c
  10007. }
  10008. // Fields allows partial responses to be retrieved. See
  10009. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10010. // for more information.
  10011. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  10012. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10013. return c
  10014. }
  10015. // IfNoneMatch sets the optional parameter which makes the operation
  10016. // fail if the object's ETag matches the given value. This is useful for
  10017. // getting updates only after the object has changed since the last
  10018. // request. Use googleapi.IsNotModified to check whether the response
  10019. // error from Do is the result of In-None-Match.
  10020. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  10021. c.ifNoneMatch_ = entityTag
  10022. return c
  10023. }
  10024. // Context sets the context to be used in this call's Do method. Any
  10025. // pending HTTP request will be aborted if the provided context is
  10026. // canceled.
  10027. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  10028. c.ctx_ = ctx
  10029. return c
  10030. }
  10031. // Header returns an http.Header that can be modified by the caller to
  10032. // add HTTP headers to the request.
  10033. func (c *SnapshotsGetCall) Header() http.Header {
  10034. if c.header_ == nil {
  10035. c.header_ = make(http.Header)
  10036. }
  10037. return c.header_
  10038. }
  10039. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  10040. reqHeaders := make(http.Header)
  10041. for k, v := range c.header_ {
  10042. reqHeaders[k] = v
  10043. }
  10044. reqHeaders.Set("User-Agent", c.s.userAgent())
  10045. if c.ifNoneMatch_ != "" {
  10046. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10047. }
  10048. var body io.Reader = nil
  10049. c.urlParams_.Set("alt", alt)
  10050. c.urlParams_.Set("prettyPrint", "false")
  10051. urls := googleapi.ResolveRelative(c.s.BasePath, "snapshots/{snapshotId}")
  10052. urls += "?" + c.urlParams_.Encode()
  10053. req, err := http.NewRequest("GET", urls, body)
  10054. if err != nil {
  10055. return nil, err
  10056. }
  10057. req.Header = reqHeaders
  10058. googleapi.Expand(req.URL, map[string]string{
  10059. "snapshotId": c.snapshotId,
  10060. })
  10061. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10062. }
  10063. // Do executes the "games.snapshots.get" call.
  10064. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  10065. // code is an error. Response headers are in either
  10066. // *Snapshot.ServerResponse.Header or (if a response was returned at
  10067. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10068. // to check whether the returned error was because
  10069. // http.StatusNotModified was returned.
  10070. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  10071. gensupport.SetOptions(c.urlParams_, opts...)
  10072. res, err := c.doRequest("json")
  10073. if res != nil && res.StatusCode == http.StatusNotModified {
  10074. if res.Body != nil {
  10075. res.Body.Close()
  10076. }
  10077. return nil, &googleapi.Error{
  10078. Code: res.StatusCode,
  10079. Header: res.Header,
  10080. }
  10081. }
  10082. if err != nil {
  10083. return nil, err
  10084. }
  10085. defer googleapi.CloseBody(res)
  10086. if err := googleapi.CheckResponse(res); err != nil {
  10087. return nil, err
  10088. }
  10089. ret := &Snapshot{
  10090. ServerResponse: googleapi.ServerResponse{
  10091. Header: res.Header,
  10092. HTTPStatusCode: res.StatusCode,
  10093. },
  10094. }
  10095. target := &ret
  10096. if err := gensupport.DecodeResponse(target, res); err != nil {
  10097. return nil, err
  10098. }
  10099. return ret, nil
  10100. // {
  10101. // "description": "Retrieves the metadata for a given snapshot ID.",
  10102. // "httpMethod": "GET",
  10103. // "id": "games.snapshots.get",
  10104. // "parameterOrder": [
  10105. // "snapshotId"
  10106. // ],
  10107. // "parameters": {
  10108. // "language": {
  10109. // "description": "The preferred language to use for strings returned by this method.",
  10110. // "location": "query",
  10111. // "type": "string"
  10112. // },
  10113. // "snapshotId": {
  10114. // "description": "The ID of the snapshot.",
  10115. // "location": "path",
  10116. // "required": true,
  10117. // "type": "string"
  10118. // }
  10119. // },
  10120. // "path": "snapshots/{snapshotId}",
  10121. // "response": {
  10122. // "$ref": "Snapshot"
  10123. // },
  10124. // "scopes": [
  10125. // "https://www.googleapis.com/auth/drive.appdata",
  10126. // "https://www.googleapis.com/auth/games",
  10127. // "https://www.googleapis.com/auth/plus.me"
  10128. // ]
  10129. // }
  10130. }
  10131. // method id "games.snapshots.list":
  10132. type SnapshotsListCall struct {
  10133. s *Service
  10134. playerId string
  10135. urlParams_ gensupport.URLParams
  10136. ifNoneMatch_ string
  10137. ctx_ context.Context
  10138. header_ http.Header
  10139. }
  10140. // List: Retrieves a list of snapshots created by your application for
  10141. // the player corresponding to the player ID.
  10142. func (r *SnapshotsService) List(playerId string) *SnapshotsListCall {
  10143. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10144. c.playerId = playerId
  10145. return c
  10146. }
  10147. // Language sets the optional parameter "language": The preferred
  10148. // language to use for strings returned by this method.
  10149. func (c *SnapshotsListCall) Language(language string) *SnapshotsListCall {
  10150. c.urlParams_.Set("language", language)
  10151. return c
  10152. }
  10153. // MaxResults sets the optional parameter "maxResults": The maximum
  10154. // number of snapshot resources to return in the response, used for
  10155. // paging. For any response, the actual number of snapshot resources
  10156. // returned may be less than the specified maxResults.
  10157. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  10158. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10159. return c
  10160. }
  10161. // PageToken sets the optional parameter "pageToken": The token returned
  10162. // by the previous request.
  10163. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  10164. c.urlParams_.Set("pageToken", pageToken)
  10165. return c
  10166. }
  10167. // Fields allows partial responses to be retrieved. See
  10168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10169. // for more information.
  10170. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  10171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10172. return c
  10173. }
  10174. // IfNoneMatch sets the optional parameter which makes the operation
  10175. // fail if the object's ETag matches the given value. This is useful for
  10176. // getting updates only after the object has changed since the last
  10177. // request. Use googleapi.IsNotModified to check whether the response
  10178. // error from Do is the result of In-None-Match.
  10179. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  10180. c.ifNoneMatch_ = entityTag
  10181. return c
  10182. }
  10183. // Context sets the context to be used in this call's Do method. Any
  10184. // pending HTTP request will be aborted if the provided context is
  10185. // canceled.
  10186. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  10187. c.ctx_ = ctx
  10188. return c
  10189. }
  10190. // Header returns an http.Header that can be modified by the caller to
  10191. // add HTTP headers to the request.
  10192. func (c *SnapshotsListCall) Header() http.Header {
  10193. if c.header_ == nil {
  10194. c.header_ = make(http.Header)
  10195. }
  10196. return c.header_
  10197. }
  10198. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  10199. reqHeaders := make(http.Header)
  10200. for k, v := range c.header_ {
  10201. reqHeaders[k] = v
  10202. }
  10203. reqHeaders.Set("User-Agent", c.s.userAgent())
  10204. if c.ifNoneMatch_ != "" {
  10205. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10206. }
  10207. var body io.Reader = nil
  10208. c.urlParams_.Set("alt", alt)
  10209. c.urlParams_.Set("prettyPrint", "false")
  10210. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/snapshots")
  10211. urls += "?" + c.urlParams_.Encode()
  10212. req, err := http.NewRequest("GET", urls, body)
  10213. if err != nil {
  10214. return nil, err
  10215. }
  10216. req.Header = reqHeaders
  10217. googleapi.Expand(req.URL, map[string]string{
  10218. "playerId": c.playerId,
  10219. })
  10220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10221. }
  10222. // Do executes the "games.snapshots.list" call.
  10223. // Exactly one of *SnapshotListResponse or error will be non-nil. Any
  10224. // non-2xx status code is an error. Response headers are in either
  10225. // *SnapshotListResponse.ServerResponse.Header or (if a response was
  10226. // returned at all) in error.(*googleapi.Error).Header. Use
  10227. // googleapi.IsNotModified to check whether the returned error was
  10228. // because http.StatusNotModified was returned.
  10229. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotListResponse, error) {
  10230. gensupport.SetOptions(c.urlParams_, opts...)
  10231. res, err := c.doRequest("json")
  10232. if res != nil && res.StatusCode == http.StatusNotModified {
  10233. if res.Body != nil {
  10234. res.Body.Close()
  10235. }
  10236. return nil, &googleapi.Error{
  10237. Code: res.StatusCode,
  10238. Header: res.Header,
  10239. }
  10240. }
  10241. if err != nil {
  10242. return nil, err
  10243. }
  10244. defer googleapi.CloseBody(res)
  10245. if err := googleapi.CheckResponse(res); err != nil {
  10246. return nil, err
  10247. }
  10248. ret := &SnapshotListResponse{
  10249. ServerResponse: googleapi.ServerResponse{
  10250. Header: res.Header,
  10251. HTTPStatusCode: res.StatusCode,
  10252. },
  10253. }
  10254. target := &ret
  10255. if err := gensupport.DecodeResponse(target, res); err != nil {
  10256. return nil, err
  10257. }
  10258. return ret, nil
  10259. // {
  10260. // "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.",
  10261. // "httpMethod": "GET",
  10262. // "id": "games.snapshots.list",
  10263. // "parameterOrder": [
  10264. // "playerId"
  10265. // ],
  10266. // "parameters": {
  10267. // "language": {
  10268. // "description": "The preferred language to use for strings returned by this method.",
  10269. // "location": "query",
  10270. // "type": "string"
  10271. // },
  10272. // "maxResults": {
  10273. // "description": "The maximum number of snapshot resources to return in the response, used for paging. For any response, the actual number of snapshot resources returned may be less than the specified maxResults.",
  10274. // "format": "int32",
  10275. // "location": "query",
  10276. // "maximum": "25",
  10277. // "minimum": "1",
  10278. // "type": "integer"
  10279. // },
  10280. // "pageToken": {
  10281. // "description": "The token returned by the previous request.",
  10282. // "location": "query",
  10283. // "type": "string"
  10284. // },
  10285. // "playerId": {
  10286. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  10287. // "location": "path",
  10288. // "required": true,
  10289. // "type": "string"
  10290. // }
  10291. // },
  10292. // "path": "players/{playerId}/snapshots",
  10293. // "response": {
  10294. // "$ref": "SnapshotListResponse"
  10295. // },
  10296. // "scopes": [
  10297. // "https://www.googleapis.com/auth/drive.appdata",
  10298. // "https://www.googleapis.com/auth/games",
  10299. // "https://www.googleapis.com/auth/plus.me"
  10300. // ]
  10301. // }
  10302. }
  10303. // Pages invokes f for each page of results.
  10304. // A non-nil error returned from f will halt the iteration.
  10305. // The provided context supersedes any context provided to the Context method.
  10306. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotListResponse) error) error {
  10307. c.ctx_ = ctx
  10308. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10309. for {
  10310. x, err := c.Do()
  10311. if err != nil {
  10312. return err
  10313. }
  10314. if err := f(x); err != nil {
  10315. return err
  10316. }
  10317. if x.NextPageToken == "" {
  10318. return nil
  10319. }
  10320. c.PageToken(x.NextPageToken)
  10321. }
  10322. }
  10323. // method id "games.turnBasedMatches.cancel":
  10324. type TurnBasedMatchesCancelCall struct {
  10325. s *Service
  10326. matchId string
  10327. urlParams_ gensupport.URLParams
  10328. ctx_ context.Context
  10329. header_ http.Header
  10330. }
  10331. // Cancel: Cancel a turn-based match.
  10332. func (r *TurnBasedMatchesService) Cancel(matchId string) *TurnBasedMatchesCancelCall {
  10333. c := &TurnBasedMatchesCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10334. c.matchId = matchId
  10335. return c
  10336. }
  10337. // Fields allows partial responses to be retrieved. See
  10338. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10339. // for more information.
  10340. func (c *TurnBasedMatchesCancelCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCancelCall {
  10341. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10342. return c
  10343. }
  10344. // Context sets the context to be used in this call's Do method. Any
  10345. // pending HTTP request will be aborted if the provided context is
  10346. // canceled.
  10347. func (c *TurnBasedMatchesCancelCall) Context(ctx context.Context) *TurnBasedMatchesCancelCall {
  10348. c.ctx_ = ctx
  10349. return c
  10350. }
  10351. // Header returns an http.Header that can be modified by the caller to
  10352. // add HTTP headers to the request.
  10353. func (c *TurnBasedMatchesCancelCall) Header() http.Header {
  10354. if c.header_ == nil {
  10355. c.header_ = make(http.Header)
  10356. }
  10357. return c.header_
  10358. }
  10359. func (c *TurnBasedMatchesCancelCall) doRequest(alt string) (*http.Response, error) {
  10360. reqHeaders := make(http.Header)
  10361. for k, v := range c.header_ {
  10362. reqHeaders[k] = v
  10363. }
  10364. reqHeaders.Set("User-Agent", c.s.userAgent())
  10365. var body io.Reader = nil
  10366. c.urlParams_.Set("alt", alt)
  10367. c.urlParams_.Set("prettyPrint", "false")
  10368. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel")
  10369. urls += "?" + c.urlParams_.Encode()
  10370. req, err := http.NewRequest("PUT", urls, body)
  10371. if err != nil {
  10372. return nil, err
  10373. }
  10374. req.Header = reqHeaders
  10375. googleapi.Expand(req.URL, map[string]string{
  10376. "matchId": c.matchId,
  10377. })
  10378. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10379. }
  10380. // Do executes the "games.turnBasedMatches.cancel" call.
  10381. func (c *TurnBasedMatchesCancelCall) Do(opts ...googleapi.CallOption) error {
  10382. gensupport.SetOptions(c.urlParams_, opts...)
  10383. res, err := c.doRequest("json")
  10384. if err != nil {
  10385. return err
  10386. }
  10387. defer googleapi.CloseBody(res)
  10388. if err := googleapi.CheckResponse(res); err != nil {
  10389. return err
  10390. }
  10391. return nil
  10392. // {
  10393. // "description": "Cancel a turn-based match.",
  10394. // "httpMethod": "PUT",
  10395. // "id": "games.turnBasedMatches.cancel",
  10396. // "parameterOrder": [
  10397. // "matchId"
  10398. // ],
  10399. // "parameters": {
  10400. // "matchId": {
  10401. // "description": "The ID of the match.",
  10402. // "location": "path",
  10403. // "required": true,
  10404. // "type": "string"
  10405. // }
  10406. // },
  10407. // "path": "turnbasedmatches/{matchId}/cancel",
  10408. // "scopes": [
  10409. // "https://www.googleapis.com/auth/games",
  10410. // "https://www.googleapis.com/auth/plus.me"
  10411. // ]
  10412. // }
  10413. }
  10414. // method id "games.turnBasedMatches.create":
  10415. type TurnBasedMatchesCreateCall struct {
  10416. s *Service
  10417. turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest
  10418. urlParams_ gensupport.URLParams
  10419. ctx_ context.Context
  10420. header_ http.Header
  10421. }
  10422. // Create: Create a turn-based match.
  10423. func (r *TurnBasedMatchesService) Create(turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest) *TurnBasedMatchesCreateCall {
  10424. c := &TurnBasedMatchesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10425. c.turnbasedmatchcreaterequest = turnbasedmatchcreaterequest
  10426. return c
  10427. }
  10428. // Language sets the optional parameter "language": The preferred
  10429. // language to use for strings returned by this method.
  10430. func (c *TurnBasedMatchesCreateCall) Language(language string) *TurnBasedMatchesCreateCall {
  10431. c.urlParams_.Set("language", language)
  10432. return c
  10433. }
  10434. // Fields allows partial responses to be retrieved. See
  10435. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10436. // for more information.
  10437. func (c *TurnBasedMatchesCreateCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCreateCall {
  10438. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10439. return c
  10440. }
  10441. // Context sets the context to be used in this call's Do method. Any
  10442. // pending HTTP request will be aborted if the provided context is
  10443. // canceled.
  10444. func (c *TurnBasedMatchesCreateCall) Context(ctx context.Context) *TurnBasedMatchesCreateCall {
  10445. c.ctx_ = ctx
  10446. return c
  10447. }
  10448. // Header returns an http.Header that can be modified by the caller to
  10449. // add HTTP headers to the request.
  10450. func (c *TurnBasedMatchesCreateCall) Header() http.Header {
  10451. if c.header_ == nil {
  10452. c.header_ = make(http.Header)
  10453. }
  10454. return c.header_
  10455. }
  10456. func (c *TurnBasedMatchesCreateCall) doRequest(alt string) (*http.Response, error) {
  10457. reqHeaders := make(http.Header)
  10458. for k, v := range c.header_ {
  10459. reqHeaders[k] = v
  10460. }
  10461. reqHeaders.Set("User-Agent", c.s.userAgent())
  10462. var body io.Reader = nil
  10463. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchcreaterequest)
  10464. if err != nil {
  10465. return nil, err
  10466. }
  10467. reqHeaders.Set("Content-Type", "application/json")
  10468. c.urlParams_.Set("alt", alt)
  10469. c.urlParams_.Set("prettyPrint", "false")
  10470. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/create")
  10471. urls += "?" + c.urlParams_.Encode()
  10472. req, err := http.NewRequest("POST", urls, body)
  10473. if err != nil {
  10474. return nil, err
  10475. }
  10476. req.Header = reqHeaders
  10477. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10478. }
  10479. // Do executes the "games.turnBasedMatches.create" call.
  10480. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10481. // status code is an error. Response headers are in either
  10482. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10483. // at all) in error.(*googleapi.Error).Header. Use
  10484. // googleapi.IsNotModified to check whether the returned error was
  10485. // because http.StatusNotModified was returned.
  10486. func (c *TurnBasedMatchesCreateCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10487. gensupport.SetOptions(c.urlParams_, opts...)
  10488. res, err := c.doRequest("json")
  10489. if res != nil && res.StatusCode == http.StatusNotModified {
  10490. if res.Body != nil {
  10491. res.Body.Close()
  10492. }
  10493. return nil, &googleapi.Error{
  10494. Code: res.StatusCode,
  10495. Header: res.Header,
  10496. }
  10497. }
  10498. if err != nil {
  10499. return nil, err
  10500. }
  10501. defer googleapi.CloseBody(res)
  10502. if err := googleapi.CheckResponse(res); err != nil {
  10503. return nil, err
  10504. }
  10505. ret := &TurnBasedMatch{
  10506. ServerResponse: googleapi.ServerResponse{
  10507. Header: res.Header,
  10508. HTTPStatusCode: res.StatusCode,
  10509. },
  10510. }
  10511. target := &ret
  10512. if err := gensupport.DecodeResponse(target, res); err != nil {
  10513. return nil, err
  10514. }
  10515. return ret, nil
  10516. // {
  10517. // "description": "Create a turn-based match.",
  10518. // "httpMethod": "POST",
  10519. // "id": "games.turnBasedMatches.create",
  10520. // "parameters": {
  10521. // "language": {
  10522. // "description": "The preferred language to use for strings returned by this method.",
  10523. // "location": "query",
  10524. // "type": "string"
  10525. // }
  10526. // },
  10527. // "path": "turnbasedmatches/create",
  10528. // "request": {
  10529. // "$ref": "TurnBasedMatchCreateRequest"
  10530. // },
  10531. // "response": {
  10532. // "$ref": "TurnBasedMatch"
  10533. // },
  10534. // "scopes": [
  10535. // "https://www.googleapis.com/auth/games",
  10536. // "https://www.googleapis.com/auth/plus.me"
  10537. // ]
  10538. // }
  10539. }
  10540. // method id "games.turnBasedMatches.decline":
  10541. type TurnBasedMatchesDeclineCall struct {
  10542. s *Service
  10543. matchId string
  10544. urlParams_ gensupport.URLParams
  10545. ctx_ context.Context
  10546. header_ http.Header
  10547. }
  10548. // Decline: Decline an invitation to play a turn-based match.
  10549. func (r *TurnBasedMatchesService) Decline(matchId string) *TurnBasedMatchesDeclineCall {
  10550. c := &TurnBasedMatchesDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10551. c.matchId = matchId
  10552. return c
  10553. }
  10554. // Language sets the optional parameter "language": The preferred
  10555. // language to use for strings returned by this method.
  10556. func (c *TurnBasedMatchesDeclineCall) Language(language string) *TurnBasedMatchesDeclineCall {
  10557. c.urlParams_.Set("language", language)
  10558. return c
  10559. }
  10560. // Fields allows partial responses to be retrieved. See
  10561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10562. // for more information.
  10563. func (c *TurnBasedMatchesDeclineCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDeclineCall {
  10564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10565. return c
  10566. }
  10567. // Context sets the context to be used in this call's Do method. Any
  10568. // pending HTTP request will be aborted if the provided context is
  10569. // canceled.
  10570. func (c *TurnBasedMatchesDeclineCall) Context(ctx context.Context) *TurnBasedMatchesDeclineCall {
  10571. c.ctx_ = ctx
  10572. return c
  10573. }
  10574. // Header returns an http.Header that can be modified by the caller to
  10575. // add HTTP headers to the request.
  10576. func (c *TurnBasedMatchesDeclineCall) Header() http.Header {
  10577. if c.header_ == nil {
  10578. c.header_ = make(http.Header)
  10579. }
  10580. return c.header_
  10581. }
  10582. func (c *TurnBasedMatchesDeclineCall) doRequest(alt string) (*http.Response, error) {
  10583. reqHeaders := make(http.Header)
  10584. for k, v := range c.header_ {
  10585. reqHeaders[k] = v
  10586. }
  10587. reqHeaders.Set("User-Agent", c.s.userAgent())
  10588. var body io.Reader = nil
  10589. c.urlParams_.Set("alt", alt)
  10590. c.urlParams_.Set("prettyPrint", "false")
  10591. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline")
  10592. urls += "?" + c.urlParams_.Encode()
  10593. req, err := http.NewRequest("PUT", urls, body)
  10594. if err != nil {
  10595. return nil, err
  10596. }
  10597. req.Header = reqHeaders
  10598. googleapi.Expand(req.URL, map[string]string{
  10599. "matchId": c.matchId,
  10600. })
  10601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10602. }
  10603. // Do executes the "games.turnBasedMatches.decline" call.
  10604. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10605. // status code is an error. Response headers are in either
  10606. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10607. // at all) in error.(*googleapi.Error).Header. Use
  10608. // googleapi.IsNotModified to check whether the returned error was
  10609. // because http.StatusNotModified was returned.
  10610. func (c *TurnBasedMatchesDeclineCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10611. gensupport.SetOptions(c.urlParams_, opts...)
  10612. res, err := c.doRequest("json")
  10613. if res != nil && res.StatusCode == http.StatusNotModified {
  10614. if res.Body != nil {
  10615. res.Body.Close()
  10616. }
  10617. return nil, &googleapi.Error{
  10618. Code: res.StatusCode,
  10619. Header: res.Header,
  10620. }
  10621. }
  10622. if err != nil {
  10623. return nil, err
  10624. }
  10625. defer googleapi.CloseBody(res)
  10626. if err := googleapi.CheckResponse(res); err != nil {
  10627. return nil, err
  10628. }
  10629. ret := &TurnBasedMatch{
  10630. ServerResponse: googleapi.ServerResponse{
  10631. Header: res.Header,
  10632. HTTPStatusCode: res.StatusCode,
  10633. },
  10634. }
  10635. target := &ret
  10636. if err := gensupport.DecodeResponse(target, res); err != nil {
  10637. return nil, err
  10638. }
  10639. return ret, nil
  10640. // {
  10641. // "description": "Decline an invitation to play a turn-based match.",
  10642. // "httpMethod": "PUT",
  10643. // "id": "games.turnBasedMatches.decline",
  10644. // "parameterOrder": [
  10645. // "matchId"
  10646. // ],
  10647. // "parameters": {
  10648. // "language": {
  10649. // "description": "The preferred language to use for strings returned by this method.",
  10650. // "location": "query",
  10651. // "type": "string"
  10652. // },
  10653. // "matchId": {
  10654. // "description": "The ID of the match.",
  10655. // "location": "path",
  10656. // "required": true,
  10657. // "type": "string"
  10658. // }
  10659. // },
  10660. // "path": "turnbasedmatches/{matchId}/decline",
  10661. // "response": {
  10662. // "$ref": "TurnBasedMatch"
  10663. // },
  10664. // "scopes": [
  10665. // "https://www.googleapis.com/auth/games",
  10666. // "https://www.googleapis.com/auth/plus.me"
  10667. // ]
  10668. // }
  10669. }
  10670. // method id "games.turnBasedMatches.dismiss":
  10671. type TurnBasedMatchesDismissCall struct {
  10672. s *Service
  10673. matchId string
  10674. urlParams_ gensupport.URLParams
  10675. ctx_ context.Context
  10676. header_ http.Header
  10677. }
  10678. // Dismiss: Dismiss a turn-based match from the match list. The match
  10679. // will no longer show up in the list and will not generate
  10680. // notifications.
  10681. func (r *TurnBasedMatchesService) Dismiss(matchId string) *TurnBasedMatchesDismissCall {
  10682. c := &TurnBasedMatchesDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10683. c.matchId = matchId
  10684. return c
  10685. }
  10686. // Fields allows partial responses to be retrieved. See
  10687. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10688. // for more information.
  10689. func (c *TurnBasedMatchesDismissCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDismissCall {
  10690. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10691. return c
  10692. }
  10693. // Context sets the context to be used in this call's Do method. Any
  10694. // pending HTTP request will be aborted if the provided context is
  10695. // canceled.
  10696. func (c *TurnBasedMatchesDismissCall) Context(ctx context.Context) *TurnBasedMatchesDismissCall {
  10697. c.ctx_ = ctx
  10698. return c
  10699. }
  10700. // Header returns an http.Header that can be modified by the caller to
  10701. // add HTTP headers to the request.
  10702. func (c *TurnBasedMatchesDismissCall) Header() http.Header {
  10703. if c.header_ == nil {
  10704. c.header_ = make(http.Header)
  10705. }
  10706. return c.header_
  10707. }
  10708. func (c *TurnBasedMatchesDismissCall) doRequest(alt string) (*http.Response, error) {
  10709. reqHeaders := make(http.Header)
  10710. for k, v := range c.header_ {
  10711. reqHeaders[k] = v
  10712. }
  10713. reqHeaders.Set("User-Agent", c.s.userAgent())
  10714. var body io.Reader = nil
  10715. c.urlParams_.Set("alt", alt)
  10716. c.urlParams_.Set("prettyPrint", "false")
  10717. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss")
  10718. urls += "?" + c.urlParams_.Encode()
  10719. req, err := http.NewRequest("PUT", urls, body)
  10720. if err != nil {
  10721. return nil, err
  10722. }
  10723. req.Header = reqHeaders
  10724. googleapi.Expand(req.URL, map[string]string{
  10725. "matchId": c.matchId,
  10726. })
  10727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10728. }
  10729. // Do executes the "games.turnBasedMatches.dismiss" call.
  10730. func (c *TurnBasedMatchesDismissCall) Do(opts ...googleapi.CallOption) error {
  10731. gensupport.SetOptions(c.urlParams_, opts...)
  10732. res, err := c.doRequest("json")
  10733. if err != nil {
  10734. return err
  10735. }
  10736. defer googleapi.CloseBody(res)
  10737. if err := googleapi.CheckResponse(res); err != nil {
  10738. return err
  10739. }
  10740. return nil
  10741. // {
  10742. // "description": "Dismiss a turn-based match from the match list. The match will no longer show up in the list and will not generate notifications.",
  10743. // "httpMethod": "PUT",
  10744. // "id": "games.turnBasedMatches.dismiss",
  10745. // "parameterOrder": [
  10746. // "matchId"
  10747. // ],
  10748. // "parameters": {
  10749. // "matchId": {
  10750. // "description": "The ID of the match.",
  10751. // "location": "path",
  10752. // "required": true,
  10753. // "type": "string"
  10754. // }
  10755. // },
  10756. // "path": "turnbasedmatches/{matchId}/dismiss",
  10757. // "scopes": [
  10758. // "https://www.googleapis.com/auth/games",
  10759. // "https://www.googleapis.com/auth/plus.me"
  10760. // ]
  10761. // }
  10762. }
  10763. // method id "games.turnBasedMatches.finish":
  10764. type TurnBasedMatchesFinishCall struct {
  10765. s *Service
  10766. matchId string
  10767. turnbasedmatchresults *TurnBasedMatchResults
  10768. urlParams_ gensupport.URLParams
  10769. ctx_ context.Context
  10770. header_ http.Header
  10771. }
  10772. // Finish: Finish a turn-based match. Each player should make this call
  10773. // once, after all results are in. Only the player whose turn it is may
  10774. // make the first call to Finish, and can pass in the final match state.
  10775. func (r *TurnBasedMatchesService) Finish(matchId string, turnbasedmatchresults *TurnBasedMatchResults) *TurnBasedMatchesFinishCall {
  10776. c := &TurnBasedMatchesFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10777. c.matchId = matchId
  10778. c.turnbasedmatchresults = turnbasedmatchresults
  10779. return c
  10780. }
  10781. // Language sets the optional parameter "language": The preferred
  10782. // language to use for strings returned by this method.
  10783. func (c *TurnBasedMatchesFinishCall) Language(language string) *TurnBasedMatchesFinishCall {
  10784. c.urlParams_.Set("language", language)
  10785. return c
  10786. }
  10787. // Fields allows partial responses to be retrieved. See
  10788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10789. // for more information.
  10790. func (c *TurnBasedMatchesFinishCall) Fields(s ...googleapi.Field) *TurnBasedMatchesFinishCall {
  10791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10792. return c
  10793. }
  10794. // Context sets the context to be used in this call's Do method. Any
  10795. // pending HTTP request will be aborted if the provided context is
  10796. // canceled.
  10797. func (c *TurnBasedMatchesFinishCall) Context(ctx context.Context) *TurnBasedMatchesFinishCall {
  10798. c.ctx_ = ctx
  10799. return c
  10800. }
  10801. // Header returns an http.Header that can be modified by the caller to
  10802. // add HTTP headers to the request.
  10803. func (c *TurnBasedMatchesFinishCall) Header() http.Header {
  10804. if c.header_ == nil {
  10805. c.header_ = make(http.Header)
  10806. }
  10807. return c.header_
  10808. }
  10809. func (c *TurnBasedMatchesFinishCall) doRequest(alt string) (*http.Response, error) {
  10810. reqHeaders := make(http.Header)
  10811. for k, v := range c.header_ {
  10812. reqHeaders[k] = v
  10813. }
  10814. reqHeaders.Set("User-Agent", c.s.userAgent())
  10815. var body io.Reader = nil
  10816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchresults)
  10817. if err != nil {
  10818. return nil, err
  10819. }
  10820. reqHeaders.Set("Content-Type", "application/json")
  10821. c.urlParams_.Set("alt", alt)
  10822. c.urlParams_.Set("prettyPrint", "false")
  10823. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish")
  10824. urls += "?" + c.urlParams_.Encode()
  10825. req, err := http.NewRequest("PUT", urls, body)
  10826. if err != nil {
  10827. return nil, err
  10828. }
  10829. req.Header = reqHeaders
  10830. googleapi.Expand(req.URL, map[string]string{
  10831. "matchId": c.matchId,
  10832. })
  10833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10834. }
  10835. // Do executes the "games.turnBasedMatches.finish" call.
  10836. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10837. // status code is an error. Response headers are in either
  10838. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10839. // at all) in error.(*googleapi.Error).Header. Use
  10840. // googleapi.IsNotModified to check whether the returned error was
  10841. // because http.StatusNotModified was returned.
  10842. func (c *TurnBasedMatchesFinishCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10843. gensupport.SetOptions(c.urlParams_, opts...)
  10844. res, err := c.doRequest("json")
  10845. if res != nil && res.StatusCode == http.StatusNotModified {
  10846. if res.Body != nil {
  10847. res.Body.Close()
  10848. }
  10849. return nil, &googleapi.Error{
  10850. Code: res.StatusCode,
  10851. Header: res.Header,
  10852. }
  10853. }
  10854. if err != nil {
  10855. return nil, err
  10856. }
  10857. defer googleapi.CloseBody(res)
  10858. if err := googleapi.CheckResponse(res); err != nil {
  10859. return nil, err
  10860. }
  10861. ret := &TurnBasedMatch{
  10862. ServerResponse: googleapi.ServerResponse{
  10863. Header: res.Header,
  10864. HTTPStatusCode: res.StatusCode,
  10865. },
  10866. }
  10867. target := &ret
  10868. if err := gensupport.DecodeResponse(target, res); err != nil {
  10869. return nil, err
  10870. }
  10871. return ret, nil
  10872. // {
  10873. // "description": "Finish a turn-based match. Each player should make this call once, after all results are in. Only the player whose turn it is may make the first call to Finish, and can pass in the final match state.",
  10874. // "httpMethod": "PUT",
  10875. // "id": "games.turnBasedMatches.finish",
  10876. // "parameterOrder": [
  10877. // "matchId"
  10878. // ],
  10879. // "parameters": {
  10880. // "language": {
  10881. // "description": "The preferred language to use for strings returned by this method.",
  10882. // "location": "query",
  10883. // "type": "string"
  10884. // },
  10885. // "matchId": {
  10886. // "description": "The ID of the match.",
  10887. // "location": "path",
  10888. // "required": true,
  10889. // "type": "string"
  10890. // }
  10891. // },
  10892. // "path": "turnbasedmatches/{matchId}/finish",
  10893. // "request": {
  10894. // "$ref": "TurnBasedMatchResults"
  10895. // },
  10896. // "response": {
  10897. // "$ref": "TurnBasedMatch"
  10898. // },
  10899. // "scopes": [
  10900. // "https://www.googleapis.com/auth/games",
  10901. // "https://www.googleapis.com/auth/plus.me"
  10902. // ]
  10903. // }
  10904. }
  10905. // method id "games.turnBasedMatches.get":
  10906. type TurnBasedMatchesGetCall struct {
  10907. s *Service
  10908. matchId string
  10909. urlParams_ gensupport.URLParams
  10910. ifNoneMatch_ string
  10911. ctx_ context.Context
  10912. header_ http.Header
  10913. }
  10914. // Get: Get the data for a turn-based match.
  10915. func (r *TurnBasedMatchesService) Get(matchId string) *TurnBasedMatchesGetCall {
  10916. c := &TurnBasedMatchesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10917. c.matchId = matchId
  10918. return c
  10919. }
  10920. // IncludeMatchData sets the optional parameter "includeMatchData": Get
  10921. // match data along with metadata.
  10922. func (c *TurnBasedMatchesGetCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesGetCall {
  10923. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  10924. return c
  10925. }
  10926. // Language sets the optional parameter "language": The preferred
  10927. // language to use for strings returned by this method.
  10928. func (c *TurnBasedMatchesGetCall) Language(language string) *TurnBasedMatchesGetCall {
  10929. c.urlParams_.Set("language", language)
  10930. return c
  10931. }
  10932. // Fields allows partial responses to be retrieved. See
  10933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10934. // for more information.
  10935. func (c *TurnBasedMatchesGetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesGetCall {
  10936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10937. return c
  10938. }
  10939. // IfNoneMatch sets the optional parameter which makes the operation
  10940. // fail if the object's ETag matches the given value. This is useful for
  10941. // getting updates only after the object has changed since the last
  10942. // request. Use googleapi.IsNotModified to check whether the response
  10943. // error from Do is the result of In-None-Match.
  10944. func (c *TurnBasedMatchesGetCall) IfNoneMatch(entityTag string) *TurnBasedMatchesGetCall {
  10945. c.ifNoneMatch_ = entityTag
  10946. return c
  10947. }
  10948. // Context sets the context to be used in this call's Do method. Any
  10949. // pending HTTP request will be aborted if the provided context is
  10950. // canceled.
  10951. func (c *TurnBasedMatchesGetCall) Context(ctx context.Context) *TurnBasedMatchesGetCall {
  10952. c.ctx_ = ctx
  10953. return c
  10954. }
  10955. // Header returns an http.Header that can be modified by the caller to
  10956. // add HTTP headers to the request.
  10957. func (c *TurnBasedMatchesGetCall) Header() http.Header {
  10958. if c.header_ == nil {
  10959. c.header_ = make(http.Header)
  10960. }
  10961. return c.header_
  10962. }
  10963. func (c *TurnBasedMatchesGetCall) doRequest(alt string) (*http.Response, error) {
  10964. reqHeaders := make(http.Header)
  10965. for k, v := range c.header_ {
  10966. reqHeaders[k] = v
  10967. }
  10968. reqHeaders.Set("User-Agent", c.s.userAgent())
  10969. if c.ifNoneMatch_ != "" {
  10970. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10971. }
  10972. var body io.Reader = nil
  10973. c.urlParams_.Set("alt", alt)
  10974. c.urlParams_.Set("prettyPrint", "false")
  10975. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}")
  10976. urls += "?" + c.urlParams_.Encode()
  10977. req, err := http.NewRequest("GET", urls, body)
  10978. if err != nil {
  10979. return nil, err
  10980. }
  10981. req.Header = reqHeaders
  10982. googleapi.Expand(req.URL, map[string]string{
  10983. "matchId": c.matchId,
  10984. })
  10985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10986. }
  10987. // Do executes the "games.turnBasedMatches.get" call.
  10988. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10989. // status code is an error. Response headers are in either
  10990. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10991. // at all) in error.(*googleapi.Error).Header. Use
  10992. // googleapi.IsNotModified to check whether the returned error was
  10993. // because http.StatusNotModified was returned.
  10994. func (c *TurnBasedMatchesGetCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10995. gensupport.SetOptions(c.urlParams_, opts...)
  10996. res, err := c.doRequest("json")
  10997. if res != nil && res.StatusCode == http.StatusNotModified {
  10998. if res.Body != nil {
  10999. res.Body.Close()
  11000. }
  11001. return nil, &googleapi.Error{
  11002. Code: res.StatusCode,
  11003. Header: res.Header,
  11004. }
  11005. }
  11006. if err != nil {
  11007. return nil, err
  11008. }
  11009. defer googleapi.CloseBody(res)
  11010. if err := googleapi.CheckResponse(res); err != nil {
  11011. return nil, err
  11012. }
  11013. ret := &TurnBasedMatch{
  11014. ServerResponse: googleapi.ServerResponse{
  11015. Header: res.Header,
  11016. HTTPStatusCode: res.StatusCode,
  11017. },
  11018. }
  11019. target := &ret
  11020. if err := gensupport.DecodeResponse(target, res); err != nil {
  11021. return nil, err
  11022. }
  11023. return ret, nil
  11024. // {
  11025. // "description": "Get the data for a turn-based match.",
  11026. // "httpMethod": "GET",
  11027. // "id": "games.turnBasedMatches.get",
  11028. // "parameterOrder": [
  11029. // "matchId"
  11030. // ],
  11031. // "parameters": {
  11032. // "includeMatchData": {
  11033. // "description": "Get match data along with metadata.",
  11034. // "location": "query",
  11035. // "type": "boolean"
  11036. // },
  11037. // "language": {
  11038. // "description": "The preferred language to use for strings returned by this method.",
  11039. // "location": "query",
  11040. // "type": "string"
  11041. // },
  11042. // "matchId": {
  11043. // "description": "The ID of the match.",
  11044. // "location": "path",
  11045. // "required": true,
  11046. // "type": "string"
  11047. // }
  11048. // },
  11049. // "path": "turnbasedmatches/{matchId}",
  11050. // "response": {
  11051. // "$ref": "TurnBasedMatch"
  11052. // },
  11053. // "scopes": [
  11054. // "https://www.googleapis.com/auth/games",
  11055. // "https://www.googleapis.com/auth/plus.me"
  11056. // ]
  11057. // }
  11058. }
  11059. // method id "games.turnBasedMatches.join":
  11060. type TurnBasedMatchesJoinCall struct {
  11061. s *Service
  11062. matchId string
  11063. urlParams_ gensupport.URLParams
  11064. ctx_ context.Context
  11065. header_ http.Header
  11066. }
  11067. // Join: Join a turn-based match.
  11068. func (r *TurnBasedMatchesService) Join(matchId string) *TurnBasedMatchesJoinCall {
  11069. c := &TurnBasedMatchesJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11070. c.matchId = matchId
  11071. return c
  11072. }
  11073. // Language sets the optional parameter "language": The preferred
  11074. // language to use for strings returned by this method.
  11075. func (c *TurnBasedMatchesJoinCall) Language(language string) *TurnBasedMatchesJoinCall {
  11076. c.urlParams_.Set("language", language)
  11077. return c
  11078. }
  11079. // Fields allows partial responses to be retrieved. See
  11080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11081. // for more information.
  11082. func (c *TurnBasedMatchesJoinCall) Fields(s ...googleapi.Field) *TurnBasedMatchesJoinCall {
  11083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11084. return c
  11085. }
  11086. // Context sets the context to be used in this call's Do method. Any
  11087. // pending HTTP request will be aborted if the provided context is
  11088. // canceled.
  11089. func (c *TurnBasedMatchesJoinCall) Context(ctx context.Context) *TurnBasedMatchesJoinCall {
  11090. c.ctx_ = ctx
  11091. return c
  11092. }
  11093. // Header returns an http.Header that can be modified by the caller to
  11094. // add HTTP headers to the request.
  11095. func (c *TurnBasedMatchesJoinCall) Header() http.Header {
  11096. if c.header_ == nil {
  11097. c.header_ = make(http.Header)
  11098. }
  11099. return c.header_
  11100. }
  11101. func (c *TurnBasedMatchesJoinCall) doRequest(alt string) (*http.Response, error) {
  11102. reqHeaders := make(http.Header)
  11103. for k, v := range c.header_ {
  11104. reqHeaders[k] = v
  11105. }
  11106. reqHeaders.Set("User-Agent", c.s.userAgent())
  11107. var body io.Reader = nil
  11108. c.urlParams_.Set("alt", alt)
  11109. c.urlParams_.Set("prettyPrint", "false")
  11110. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join")
  11111. urls += "?" + c.urlParams_.Encode()
  11112. req, err := http.NewRequest("PUT", urls, body)
  11113. if err != nil {
  11114. return nil, err
  11115. }
  11116. req.Header = reqHeaders
  11117. googleapi.Expand(req.URL, map[string]string{
  11118. "matchId": c.matchId,
  11119. })
  11120. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11121. }
  11122. // Do executes the "games.turnBasedMatches.join" call.
  11123. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  11124. // status code is an error. Response headers are in either
  11125. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  11126. // at all) in error.(*googleapi.Error).Header. Use
  11127. // googleapi.IsNotModified to check whether the returned error was
  11128. // because http.StatusNotModified was returned.
  11129. func (c *TurnBasedMatchesJoinCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  11130. gensupport.SetOptions(c.urlParams_, opts...)
  11131. res, err := c.doRequest("json")
  11132. if res != nil && res.StatusCode == http.StatusNotModified {
  11133. if res.Body != nil {
  11134. res.Body.Close()
  11135. }
  11136. return nil, &googleapi.Error{
  11137. Code: res.StatusCode,
  11138. Header: res.Header,
  11139. }
  11140. }
  11141. if err != nil {
  11142. return nil, err
  11143. }
  11144. defer googleapi.CloseBody(res)
  11145. if err := googleapi.CheckResponse(res); err != nil {
  11146. return nil, err
  11147. }
  11148. ret := &TurnBasedMatch{
  11149. ServerResponse: googleapi.ServerResponse{
  11150. Header: res.Header,
  11151. HTTPStatusCode: res.StatusCode,
  11152. },
  11153. }
  11154. target := &ret
  11155. if err := gensupport.DecodeResponse(target, res); err != nil {
  11156. return nil, err
  11157. }
  11158. return ret, nil
  11159. // {
  11160. // "description": "Join a turn-based match.",
  11161. // "httpMethod": "PUT",
  11162. // "id": "games.turnBasedMatches.join",
  11163. // "parameterOrder": [
  11164. // "matchId"
  11165. // ],
  11166. // "parameters": {
  11167. // "language": {
  11168. // "description": "The preferred language to use for strings returned by this method.",
  11169. // "location": "query",
  11170. // "type": "string"
  11171. // },
  11172. // "matchId": {
  11173. // "description": "The ID of the match.",
  11174. // "location": "path",
  11175. // "required": true,
  11176. // "type": "string"
  11177. // }
  11178. // },
  11179. // "path": "turnbasedmatches/{matchId}/join",
  11180. // "response": {
  11181. // "$ref": "TurnBasedMatch"
  11182. // },
  11183. // "scopes": [
  11184. // "https://www.googleapis.com/auth/games",
  11185. // "https://www.googleapis.com/auth/plus.me"
  11186. // ]
  11187. // }
  11188. }
  11189. // method id "games.turnBasedMatches.leave":
  11190. type TurnBasedMatchesLeaveCall struct {
  11191. s *Service
  11192. matchId string
  11193. urlParams_ gensupport.URLParams
  11194. ctx_ context.Context
  11195. header_ http.Header
  11196. }
  11197. // Leave: Leave a turn-based match when it is not the current player's
  11198. // turn, without canceling the match.
  11199. func (r *TurnBasedMatchesService) Leave(matchId string) *TurnBasedMatchesLeaveCall {
  11200. c := &TurnBasedMatchesLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11201. c.matchId = matchId
  11202. return c
  11203. }
  11204. // Language sets the optional parameter "language": The preferred
  11205. // language to use for strings returned by this method.
  11206. func (c *TurnBasedMatchesLeaveCall) Language(language string) *TurnBasedMatchesLeaveCall {
  11207. c.urlParams_.Set("language", language)
  11208. return c
  11209. }
  11210. // Fields allows partial responses to be retrieved. See
  11211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11212. // for more information.
  11213. func (c *TurnBasedMatchesLeaveCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveCall {
  11214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11215. return c
  11216. }
  11217. // Context sets the context to be used in this call's Do method. Any
  11218. // pending HTTP request will be aborted if the provided context is
  11219. // canceled.
  11220. func (c *TurnBasedMatchesLeaveCall) Context(ctx context.Context) *TurnBasedMatchesLeaveCall {
  11221. c.ctx_ = ctx
  11222. return c
  11223. }
  11224. // Header returns an http.Header that can be modified by the caller to
  11225. // add HTTP headers to the request.
  11226. func (c *TurnBasedMatchesLeaveCall) Header() http.Header {
  11227. if c.header_ == nil {
  11228. c.header_ = make(http.Header)
  11229. }
  11230. return c.header_
  11231. }
  11232. func (c *TurnBasedMatchesLeaveCall) doRequest(alt string) (*http.Response, error) {
  11233. reqHeaders := make(http.Header)
  11234. for k, v := range c.header_ {
  11235. reqHeaders[k] = v
  11236. }
  11237. reqHeaders.Set("User-Agent", c.s.userAgent())
  11238. var body io.Reader = nil
  11239. c.urlParams_.Set("alt", alt)
  11240. c.urlParams_.Set("prettyPrint", "false")
  11241. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave")
  11242. urls += "?" + c.urlParams_.Encode()
  11243. req, err := http.NewRequest("PUT", urls, body)
  11244. if err != nil {
  11245. return nil, err
  11246. }
  11247. req.Header = reqHeaders
  11248. googleapi.Expand(req.URL, map[string]string{
  11249. "matchId": c.matchId,
  11250. })
  11251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11252. }
  11253. // Do executes the "games.turnBasedMatches.leave" call.
  11254. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  11255. // status code is an error. Response headers are in either
  11256. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  11257. // at all) in error.(*googleapi.Error).Header. Use
  11258. // googleapi.IsNotModified to check whether the returned error was
  11259. // because http.StatusNotModified was returned.
  11260. func (c *TurnBasedMatchesLeaveCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  11261. gensupport.SetOptions(c.urlParams_, opts...)
  11262. res, err := c.doRequest("json")
  11263. if res != nil && res.StatusCode == http.StatusNotModified {
  11264. if res.Body != nil {
  11265. res.Body.Close()
  11266. }
  11267. return nil, &googleapi.Error{
  11268. Code: res.StatusCode,
  11269. Header: res.Header,
  11270. }
  11271. }
  11272. if err != nil {
  11273. return nil, err
  11274. }
  11275. defer googleapi.CloseBody(res)
  11276. if err := googleapi.CheckResponse(res); err != nil {
  11277. return nil, err
  11278. }
  11279. ret := &TurnBasedMatch{
  11280. ServerResponse: googleapi.ServerResponse{
  11281. Header: res.Header,
  11282. HTTPStatusCode: res.StatusCode,
  11283. },
  11284. }
  11285. target := &ret
  11286. if err := gensupport.DecodeResponse(target, res); err != nil {
  11287. return nil, err
  11288. }
  11289. return ret, nil
  11290. // {
  11291. // "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.",
  11292. // "httpMethod": "PUT",
  11293. // "id": "games.turnBasedMatches.leave",
  11294. // "parameterOrder": [
  11295. // "matchId"
  11296. // ],
  11297. // "parameters": {
  11298. // "language": {
  11299. // "description": "The preferred language to use for strings returned by this method.",
  11300. // "location": "query",
  11301. // "type": "string"
  11302. // },
  11303. // "matchId": {
  11304. // "description": "The ID of the match.",
  11305. // "location": "path",
  11306. // "required": true,
  11307. // "type": "string"
  11308. // }
  11309. // },
  11310. // "path": "turnbasedmatches/{matchId}/leave",
  11311. // "response": {
  11312. // "$ref": "TurnBasedMatch"
  11313. // },
  11314. // "scopes": [
  11315. // "https://www.googleapis.com/auth/games",
  11316. // "https://www.googleapis.com/auth/plus.me"
  11317. // ]
  11318. // }
  11319. }
  11320. // method id "games.turnBasedMatches.leaveTurn":
  11321. type TurnBasedMatchesLeaveTurnCall struct {
  11322. s *Service
  11323. matchId string
  11324. urlParams_ gensupport.URLParams
  11325. ctx_ context.Context
  11326. header_ http.Header
  11327. }
  11328. // LeaveTurn: Leave a turn-based match during the current player's turn,
  11329. // without canceling the match.
  11330. func (r *TurnBasedMatchesService) LeaveTurn(matchId string, matchVersion int64) *TurnBasedMatchesLeaveTurnCall {
  11331. c := &TurnBasedMatchesLeaveTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11332. c.matchId = matchId
  11333. c.urlParams_.Set("matchVersion", fmt.Sprint(matchVersion))
  11334. return c
  11335. }
  11336. // Language sets the optional parameter "language": The preferred
  11337. // language to use for strings returned by this method.
  11338. func (c *TurnBasedMatchesLeaveTurnCall) Language(language string) *TurnBasedMatchesLeaveTurnCall {
  11339. c.urlParams_.Set("language", language)
  11340. return c
  11341. }
  11342. // PendingParticipantId sets the optional parameter
  11343. // "pendingParticipantId": The ID of another participant who should take
  11344. // their turn next. If not set, the match will wait for other player(s)
  11345. // to join via automatching; this is only valid if automatch criteria is
  11346. // set on the match with remaining slots for automatched players.
  11347. func (c *TurnBasedMatchesLeaveTurnCall) PendingParticipantId(pendingParticipantId string) *TurnBasedMatchesLeaveTurnCall {
  11348. c.urlParams_.Set("pendingParticipantId", pendingParticipantId)
  11349. return c
  11350. }
  11351. // Fields allows partial responses to be retrieved. See
  11352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11353. // for more information.
  11354. func (c *TurnBasedMatchesLeaveTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveTurnCall {
  11355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11356. return c
  11357. }
  11358. // Context sets the context to be used in this call's Do method. Any
  11359. // pending HTTP request will be aborted if the provided context is
  11360. // canceled.
  11361. func (c *TurnBasedMatchesLeaveTurnCall) Context(ctx context.Context) *TurnBasedMatchesLeaveTurnCall {
  11362. c.ctx_ = ctx
  11363. return c
  11364. }
  11365. // Header returns an http.Header that can be modified by the caller to
  11366. // add HTTP headers to the request.
  11367. func (c *TurnBasedMatchesLeaveTurnCall) Header() http.Header {
  11368. if c.header_ == nil {
  11369. c.header_ = make(http.Header)
  11370. }
  11371. return c.header_
  11372. }
  11373. func (c *TurnBasedMatchesLeaveTurnCall) doRequest(alt string) (*http.Response, error) {
  11374. reqHeaders := make(http.Header)
  11375. for k, v := range c.header_ {
  11376. reqHeaders[k] = v
  11377. }
  11378. reqHeaders.Set("User-Agent", c.s.userAgent())
  11379. var body io.Reader = nil
  11380. c.urlParams_.Set("alt", alt)
  11381. c.urlParams_.Set("prettyPrint", "false")
  11382. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn")
  11383. urls += "?" + c.urlParams_.Encode()
  11384. req, err := http.NewRequest("PUT", urls, body)
  11385. if err != nil {
  11386. return nil, err
  11387. }
  11388. req.Header = reqHeaders
  11389. googleapi.Expand(req.URL, map[string]string{
  11390. "matchId": c.matchId,
  11391. })
  11392. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11393. }
  11394. // Do executes the "games.turnBasedMatches.leaveTurn" call.
  11395. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  11396. // status code is an error. Response headers are in either
  11397. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  11398. // at all) in error.(*googleapi.Error).Header. Use
  11399. // googleapi.IsNotModified to check whether the returned error was
  11400. // because http.StatusNotModified was returned.
  11401. func (c *TurnBasedMatchesLeaveTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  11402. gensupport.SetOptions(c.urlParams_, opts...)
  11403. res, err := c.doRequest("json")
  11404. if res != nil && res.StatusCode == http.StatusNotModified {
  11405. if res.Body != nil {
  11406. res.Body.Close()
  11407. }
  11408. return nil, &googleapi.Error{
  11409. Code: res.StatusCode,
  11410. Header: res.Header,
  11411. }
  11412. }
  11413. if err != nil {
  11414. return nil, err
  11415. }
  11416. defer googleapi.CloseBody(res)
  11417. if err := googleapi.CheckResponse(res); err != nil {
  11418. return nil, err
  11419. }
  11420. ret := &TurnBasedMatch{
  11421. ServerResponse: googleapi.ServerResponse{
  11422. Header: res.Header,
  11423. HTTPStatusCode: res.StatusCode,
  11424. },
  11425. }
  11426. target := &ret
  11427. if err := gensupport.DecodeResponse(target, res); err != nil {
  11428. return nil, err
  11429. }
  11430. return ret, nil
  11431. // {
  11432. // "description": "Leave a turn-based match during the current player's turn, without canceling the match.",
  11433. // "httpMethod": "PUT",
  11434. // "id": "games.turnBasedMatches.leaveTurn",
  11435. // "parameterOrder": [
  11436. // "matchId",
  11437. // "matchVersion"
  11438. // ],
  11439. // "parameters": {
  11440. // "language": {
  11441. // "description": "The preferred language to use for strings returned by this method.",
  11442. // "location": "query",
  11443. // "type": "string"
  11444. // },
  11445. // "matchId": {
  11446. // "description": "The ID of the match.",
  11447. // "location": "path",
  11448. // "required": true,
  11449. // "type": "string"
  11450. // },
  11451. // "matchVersion": {
  11452. // "description": "The version of the match being updated.",
  11453. // "format": "int32",
  11454. // "location": "query",
  11455. // "required": true,
  11456. // "type": "integer"
  11457. // },
  11458. // "pendingParticipantId": {
  11459. // "description": "The ID of another participant who should take their turn next. If not set, the match will wait for other player(s) to join via automatching; this is only valid if automatch criteria is set on the match with remaining slots for automatched players.",
  11460. // "location": "query",
  11461. // "type": "string"
  11462. // }
  11463. // },
  11464. // "path": "turnbasedmatches/{matchId}/leaveTurn",
  11465. // "response": {
  11466. // "$ref": "TurnBasedMatch"
  11467. // },
  11468. // "scopes": [
  11469. // "https://www.googleapis.com/auth/games",
  11470. // "https://www.googleapis.com/auth/plus.me"
  11471. // ]
  11472. // }
  11473. }
  11474. // method id "games.turnBasedMatches.list":
  11475. type TurnBasedMatchesListCall struct {
  11476. s *Service
  11477. urlParams_ gensupport.URLParams
  11478. ifNoneMatch_ string
  11479. ctx_ context.Context
  11480. header_ http.Header
  11481. }
  11482. // List: Returns turn-based matches the player is or was involved in.
  11483. func (r *TurnBasedMatchesService) List() *TurnBasedMatchesListCall {
  11484. c := &TurnBasedMatchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11485. return c
  11486. }
  11487. // IncludeMatchData sets the optional parameter "includeMatchData": True
  11488. // if match data should be returned in the response. Note that not all
  11489. // data will necessarily be returned if include_match_data is true; the
  11490. // server may decide to only return data for some of the matches to
  11491. // limit download size for the client. The remainder of the data for
  11492. // these matches will be retrievable on request.
  11493. func (c *TurnBasedMatchesListCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesListCall {
  11494. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  11495. return c
  11496. }
  11497. // Language sets the optional parameter "language": The preferred
  11498. // language to use for strings returned by this method.
  11499. func (c *TurnBasedMatchesListCall) Language(language string) *TurnBasedMatchesListCall {
  11500. c.urlParams_.Set("language", language)
  11501. return c
  11502. }
  11503. // MaxCompletedMatches sets the optional parameter
  11504. // "maxCompletedMatches": The maximum number of completed or canceled
  11505. // matches to return in the response. If not set, all matches returned
  11506. // could be completed or canceled.
  11507. func (c *TurnBasedMatchesListCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesListCall {
  11508. c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches))
  11509. return c
  11510. }
  11511. // MaxResults sets the optional parameter "maxResults": The maximum
  11512. // number of matches to return in the response, used for paging. For any
  11513. // response, the actual number of matches to return may be less than the
  11514. // specified maxResults.
  11515. func (c *TurnBasedMatchesListCall) MaxResults(maxResults int64) *TurnBasedMatchesListCall {
  11516. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11517. return c
  11518. }
  11519. // PageToken sets the optional parameter "pageToken": The token returned
  11520. // by the previous request.
  11521. func (c *TurnBasedMatchesListCall) PageToken(pageToken string) *TurnBasedMatchesListCall {
  11522. c.urlParams_.Set("pageToken", pageToken)
  11523. return c
  11524. }
  11525. // Fields allows partial responses to be retrieved. See
  11526. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11527. // for more information.
  11528. func (c *TurnBasedMatchesListCall) Fields(s ...googleapi.Field) *TurnBasedMatchesListCall {
  11529. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11530. return c
  11531. }
  11532. // IfNoneMatch sets the optional parameter which makes the operation
  11533. // fail if the object's ETag matches the given value. This is useful for
  11534. // getting updates only after the object has changed since the last
  11535. // request. Use googleapi.IsNotModified to check whether the response
  11536. // error from Do is the result of In-None-Match.
  11537. func (c *TurnBasedMatchesListCall) IfNoneMatch(entityTag string) *TurnBasedMatchesListCall {
  11538. c.ifNoneMatch_ = entityTag
  11539. return c
  11540. }
  11541. // Context sets the context to be used in this call's Do method. Any
  11542. // pending HTTP request will be aborted if the provided context is
  11543. // canceled.
  11544. func (c *TurnBasedMatchesListCall) Context(ctx context.Context) *TurnBasedMatchesListCall {
  11545. c.ctx_ = ctx
  11546. return c
  11547. }
  11548. // Header returns an http.Header that can be modified by the caller to
  11549. // add HTTP headers to the request.
  11550. func (c *TurnBasedMatchesListCall) Header() http.Header {
  11551. if c.header_ == nil {
  11552. c.header_ = make(http.Header)
  11553. }
  11554. return c.header_
  11555. }
  11556. func (c *TurnBasedMatchesListCall) doRequest(alt string) (*http.Response, error) {
  11557. reqHeaders := make(http.Header)
  11558. for k, v := range c.header_ {
  11559. reqHeaders[k] = v
  11560. }
  11561. reqHeaders.Set("User-Agent", c.s.userAgent())
  11562. if c.ifNoneMatch_ != "" {
  11563. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11564. }
  11565. var body io.Reader = nil
  11566. c.urlParams_.Set("alt", alt)
  11567. c.urlParams_.Set("prettyPrint", "false")
  11568. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches")
  11569. urls += "?" + c.urlParams_.Encode()
  11570. req, err := http.NewRequest("GET", urls, body)
  11571. if err != nil {
  11572. return nil, err
  11573. }
  11574. req.Header = reqHeaders
  11575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11576. }
  11577. // Do executes the "games.turnBasedMatches.list" call.
  11578. // Exactly one of *TurnBasedMatchList or error will be non-nil. Any
  11579. // non-2xx status code is an error. Response headers are in either
  11580. // *TurnBasedMatchList.ServerResponse.Header or (if a response was
  11581. // returned at all) in error.(*googleapi.Error).Header. Use
  11582. // googleapi.IsNotModified to check whether the returned error was
  11583. // because http.StatusNotModified was returned.
  11584. func (c *TurnBasedMatchesListCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchList, error) {
  11585. gensupport.SetOptions(c.urlParams_, opts...)
  11586. res, err := c.doRequest("json")
  11587. if res != nil && res.StatusCode == http.StatusNotModified {
  11588. if res.Body != nil {
  11589. res.Body.Close()
  11590. }
  11591. return nil, &googleapi.Error{
  11592. Code: res.StatusCode,
  11593. Header: res.Header,
  11594. }
  11595. }
  11596. if err != nil {
  11597. return nil, err
  11598. }
  11599. defer googleapi.CloseBody(res)
  11600. if err := googleapi.CheckResponse(res); err != nil {
  11601. return nil, err
  11602. }
  11603. ret := &TurnBasedMatchList{
  11604. ServerResponse: googleapi.ServerResponse{
  11605. Header: res.Header,
  11606. HTTPStatusCode: res.StatusCode,
  11607. },
  11608. }
  11609. target := &ret
  11610. if err := gensupport.DecodeResponse(target, res); err != nil {
  11611. return nil, err
  11612. }
  11613. return ret, nil
  11614. // {
  11615. // "description": "Returns turn-based matches the player is or was involved in.",
  11616. // "httpMethod": "GET",
  11617. // "id": "games.turnBasedMatches.list",
  11618. // "parameters": {
  11619. // "includeMatchData": {
  11620. // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.",
  11621. // "location": "query",
  11622. // "type": "boolean"
  11623. // },
  11624. // "language": {
  11625. // "description": "The preferred language to use for strings returned by this method.",
  11626. // "location": "query",
  11627. // "type": "string"
  11628. // },
  11629. // "maxCompletedMatches": {
  11630. // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.",
  11631. // "format": "int32",
  11632. // "location": "query",
  11633. // "maximum": "500",
  11634. // "minimum": "0",
  11635. // "type": "integer"
  11636. // },
  11637. // "maxResults": {
  11638. // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.",
  11639. // "format": "int32",
  11640. // "location": "query",
  11641. // "maximum": "500",
  11642. // "minimum": "1",
  11643. // "type": "integer"
  11644. // },
  11645. // "pageToken": {
  11646. // "description": "The token returned by the previous request.",
  11647. // "location": "query",
  11648. // "type": "string"
  11649. // }
  11650. // },
  11651. // "path": "turnbasedmatches",
  11652. // "response": {
  11653. // "$ref": "TurnBasedMatchList"
  11654. // },
  11655. // "scopes": [
  11656. // "https://www.googleapis.com/auth/games",
  11657. // "https://www.googleapis.com/auth/plus.me"
  11658. // ]
  11659. // }
  11660. }
  11661. // Pages invokes f for each page of results.
  11662. // A non-nil error returned from f will halt the iteration.
  11663. // The provided context supersedes any context provided to the Context method.
  11664. func (c *TurnBasedMatchesListCall) Pages(ctx context.Context, f func(*TurnBasedMatchList) error) error {
  11665. c.ctx_ = ctx
  11666. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11667. for {
  11668. x, err := c.Do()
  11669. if err != nil {
  11670. return err
  11671. }
  11672. if err := f(x); err != nil {
  11673. return err
  11674. }
  11675. if x.NextPageToken == "" {
  11676. return nil
  11677. }
  11678. c.PageToken(x.NextPageToken)
  11679. }
  11680. }
  11681. // method id "games.turnBasedMatches.rematch":
  11682. type TurnBasedMatchesRematchCall struct {
  11683. s *Service
  11684. matchId string
  11685. urlParams_ gensupport.URLParams
  11686. ctx_ context.Context
  11687. header_ http.Header
  11688. }
  11689. // Rematch: Create a rematch of a match that was previously completed,
  11690. // with the same participants. This can be called by only one player on
  11691. // a match still in their list; the player must have called Finish
  11692. // first. Returns the newly created match; it will be the caller's turn.
  11693. func (r *TurnBasedMatchesService) Rematch(matchId string) *TurnBasedMatchesRematchCall {
  11694. c := &TurnBasedMatchesRematchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11695. c.matchId = matchId
  11696. return c
  11697. }
  11698. // Language sets the optional parameter "language": The preferred
  11699. // language to use for strings returned by this method.
  11700. func (c *TurnBasedMatchesRematchCall) Language(language string) *TurnBasedMatchesRematchCall {
  11701. c.urlParams_.Set("language", language)
  11702. return c
  11703. }
  11704. // RequestId sets the optional parameter "requestId": A randomly
  11705. // generated numeric ID for each request specified by the caller. This
  11706. // number is used at the server to ensure that the request is handled
  11707. // correctly across retries.
  11708. func (c *TurnBasedMatchesRematchCall) RequestId(requestId int64) *TurnBasedMatchesRematchCall {
  11709. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  11710. return c
  11711. }
  11712. // Fields allows partial responses to be retrieved. See
  11713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11714. // for more information.
  11715. func (c *TurnBasedMatchesRematchCall) Fields(s ...googleapi.Field) *TurnBasedMatchesRematchCall {
  11716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11717. return c
  11718. }
  11719. // Context sets the context to be used in this call's Do method. Any
  11720. // pending HTTP request will be aborted if the provided context is
  11721. // canceled.
  11722. func (c *TurnBasedMatchesRematchCall) Context(ctx context.Context) *TurnBasedMatchesRematchCall {
  11723. c.ctx_ = ctx
  11724. return c
  11725. }
  11726. // Header returns an http.Header that can be modified by the caller to
  11727. // add HTTP headers to the request.
  11728. func (c *TurnBasedMatchesRematchCall) Header() http.Header {
  11729. if c.header_ == nil {
  11730. c.header_ = make(http.Header)
  11731. }
  11732. return c.header_
  11733. }
  11734. func (c *TurnBasedMatchesRematchCall) doRequest(alt string) (*http.Response, error) {
  11735. reqHeaders := make(http.Header)
  11736. for k, v := range c.header_ {
  11737. reqHeaders[k] = v
  11738. }
  11739. reqHeaders.Set("User-Agent", c.s.userAgent())
  11740. var body io.Reader = nil
  11741. c.urlParams_.Set("alt", alt)
  11742. c.urlParams_.Set("prettyPrint", "false")
  11743. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch")
  11744. urls += "?" + c.urlParams_.Encode()
  11745. req, err := http.NewRequest("POST", urls, body)
  11746. if err != nil {
  11747. return nil, err
  11748. }
  11749. req.Header = reqHeaders
  11750. googleapi.Expand(req.URL, map[string]string{
  11751. "matchId": c.matchId,
  11752. })
  11753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11754. }
  11755. // Do executes the "games.turnBasedMatches.rematch" call.
  11756. // Exactly one of *TurnBasedMatchRematch or error will be non-nil. Any
  11757. // non-2xx status code is an error. Response headers are in either
  11758. // *TurnBasedMatchRematch.ServerResponse.Header or (if a response was
  11759. // returned at all) in error.(*googleapi.Error).Header. Use
  11760. // googleapi.IsNotModified to check whether the returned error was
  11761. // because http.StatusNotModified was returned.
  11762. func (c *TurnBasedMatchesRematchCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchRematch, error) {
  11763. gensupport.SetOptions(c.urlParams_, opts...)
  11764. res, err := c.doRequest("json")
  11765. if res != nil && res.StatusCode == http.StatusNotModified {
  11766. if res.Body != nil {
  11767. res.Body.Close()
  11768. }
  11769. return nil, &googleapi.Error{
  11770. Code: res.StatusCode,
  11771. Header: res.Header,
  11772. }
  11773. }
  11774. if err != nil {
  11775. return nil, err
  11776. }
  11777. defer googleapi.CloseBody(res)
  11778. if err := googleapi.CheckResponse(res); err != nil {
  11779. return nil, err
  11780. }
  11781. ret := &TurnBasedMatchRematch{
  11782. ServerResponse: googleapi.ServerResponse{
  11783. Header: res.Header,
  11784. HTTPStatusCode: res.StatusCode,
  11785. },
  11786. }
  11787. target := &ret
  11788. if err := gensupport.DecodeResponse(target, res); err != nil {
  11789. return nil, err
  11790. }
  11791. return ret, nil
  11792. // {
  11793. // "description": "Create a rematch of a match that was previously completed, with the same participants. This can be called by only one player on a match still in their list; the player must have called Finish first. Returns the newly created match; it will be the caller's turn.",
  11794. // "httpMethod": "POST",
  11795. // "id": "games.turnBasedMatches.rematch",
  11796. // "parameterOrder": [
  11797. // "matchId"
  11798. // ],
  11799. // "parameters": {
  11800. // "language": {
  11801. // "description": "The preferred language to use for strings returned by this method.",
  11802. // "location": "query",
  11803. // "type": "string"
  11804. // },
  11805. // "matchId": {
  11806. // "description": "The ID of the match.",
  11807. // "location": "path",
  11808. // "required": true,
  11809. // "type": "string"
  11810. // },
  11811. // "requestId": {
  11812. // "description": "A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries.",
  11813. // "format": "int64",
  11814. // "location": "query",
  11815. // "type": "string"
  11816. // }
  11817. // },
  11818. // "path": "turnbasedmatches/{matchId}/rematch",
  11819. // "response": {
  11820. // "$ref": "TurnBasedMatchRematch"
  11821. // },
  11822. // "scopes": [
  11823. // "https://www.googleapis.com/auth/games",
  11824. // "https://www.googleapis.com/auth/plus.me"
  11825. // ]
  11826. // }
  11827. }
  11828. // method id "games.turnBasedMatches.sync":
  11829. type TurnBasedMatchesSyncCall struct {
  11830. s *Service
  11831. urlParams_ gensupport.URLParams
  11832. ifNoneMatch_ string
  11833. ctx_ context.Context
  11834. header_ http.Header
  11835. }
  11836. // Sync: Returns turn-based matches the player is or was involved in
  11837. // that changed since the last sync call, with the least recent changes
  11838. // coming first. Matches that should be removed from the local cache
  11839. // will have a status of MATCH_DELETED.
  11840. func (r *TurnBasedMatchesService) Sync() *TurnBasedMatchesSyncCall {
  11841. c := &TurnBasedMatchesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11842. return c
  11843. }
  11844. // IncludeMatchData sets the optional parameter "includeMatchData": True
  11845. // if match data should be returned in the response. Note that not all
  11846. // data will necessarily be returned if include_match_data is true; the
  11847. // server may decide to only return data for some of the matches to
  11848. // limit download size for the client. The remainder of the data for
  11849. // these matches will be retrievable on request.
  11850. func (c *TurnBasedMatchesSyncCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesSyncCall {
  11851. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  11852. return c
  11853. }
  11854. // Language sets the optional parameter "language": The preferred
  11855. // language to use for strings returned by this method.
  11856. func (c *TurnBasedMatchesSyncCall) Language(language string) *TurnBasedMatchesSyncCall {
  11857. c.urlParams_.Set("language", language)
  11858. return c
  11859. }
  11860. // MaxCompletedMatches sets the optional parameter
  11861. // "maxCompletedMatches": The maximum number of completed or canceled
  11862. // matches to return in the response. If not set, all matches returned
  11863. // could be completed or canceled.
  11864. func (c *TurnBasedMatchesSyncCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesSyncCall {
  11865. c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches))
  11866. return c
  11867. }
  11868. // MaxResults sets the optional parameter "maxResults": The maximum
  11869. // number of matches to return in the response, used for paging. For any
  11870. // response, the actual number of matches to return may be less than the
  11871. // specified maxResults.
  11872. func (c *TurnBasedMatchesSyncCall) MaxResults(maxResults int64) *TurnBasedMatchesSyncCall {
  11873. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11874. return c
  11875. }
  11876. // PageToken sets the optional parameter "pageToken": The token returned
  11877. // by the previous request.
  11878. func (c *TurnBasedMatchesSyncCall) PageToken(pageToken string) *TurnBasedMatchesSyncCall {
  11879. c.urlParams_.Set("pageToken", pageToken)
  11880. return c
  11881. }
  11882. // Fields allows partial responses to be retrieved. See
  11883. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11884. // for more information.
  11885. func (c *TurnBasedMatchesSyncCall) Fields(s ...googleapi.Field) *TurnBasedMatchesSyncCall {
  11886. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11887. return c
  11888. }
  11889. // IfNoneMatch sets the optional parameter which makes the operation
  11890. // fail if the object's ETag matches the given value. This is useful for
  11891. // getting updates only after the object has changed since the last
  11892. // request. Use googleapi.IsNotModified to check whether the response
  11893. // error from Do is the result of In-None-Match.
  11894. func (c *TurnBasedMatchesSyncCall) IfNoneMatch(entityTag string) *TurnBasedMatchesSyncCall {
  11895. c.ifNoneMatch_ = entityTag
  11896. return c
  11897. }
  11898. // Context sets the context to be used in this call's Do method. Any
  11899. // pending HTTP request will be aborted if the provided context is
  11900. // canceled.
  11901. func (c *TurnBasedMatchesSyncCall) Context(ctx context.Context) *TurnBasedMatchesSyncCall {
  11902. c.ctx_ = ctx
  11903. return c
  11904. }
  11905. // Header returns an http.Header that can be modified by the caller to
  11906. // add HTTP headers to the request.
  11907. func (c *TurnBasedMatchesSyncCall) Header() http.Header {
  11908. if c.header_ == nil {
  11909. c.header_ = make(http.Header)
  11910. }
  11911. return c.header_
  11912. }
  11913. func (c *TurnBasedMatchesSyncCall) doRequest(alt string) (*http.Response, error) {
  11914. reqHeaders := make(http.Header)
  11915. for k, v := range c.header_ {
  11916. reqHeaders[k] = v
  11917. }
  11918. reqHeaders.Set("User-Agent", c.s.userAgent())
  11919. if c.ifNoneMatch_ != "" {
  11920. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11921. }
  11922. var body io.Reader = nil
  11923. c.urlParams_.Set("alt", alt)
  11924. c.urlParams_.Set("prettyPrint", "false")
  11925. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/sync")
  11926. urls += "?" + c.urlParams_.Encode()
  11927. req, err := http.NewRequest("GET", urls, body)
  11928. if err != nil {
  11929. return nil, err
  11930. }
  11931. req.Header = reqHeaders
  11932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11933. }
  11934. // Do executes the "games.turnBasedMatches.sync" call.
  11935. // Exactly one of *TurnBasedMatchSync or error will be non-nil. Any
  11936. // non-2xx status code is an error. Response headers are in either
  11937. // *TurnBasedMatchSync.ServerResponse.Header or (if a response was
  11938. // returned at all) in error.(*googleapi.Error).Header. Use
  11939. // googleapi.IsNotModified to check whether the returned error was
  11940. // because http.StatusNotModified was returned.
  11941. func (c *TurnBasedMatchesSyncCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchSync, error) {
  11942. gensupport.SetOptions(c.urlParams_, opts...)
  11943. res, err := c.doRequest("json")
  11944. if res != nil && res.StatusCode == http.StatusNotModified {
  11945. if res.Body != nil {
  11946. res.Body.Close()
  11947. }
  11948. return nil, &googleapi.Error{
  11949. Code: res.StatusCode,
  11950. Header: res.Header,
  11951. }
  11952. }
  11953. if err != nil {
  11954. return nil, err
  11955. }
  11956. defer googleapi.CloseBody(res)
  11957. if err := googleapi.CheckResponse(res); err != nil {
  11958. return nil, err
  11959. }
  11960. ret := &TurnBasedMatchSync{
  11961. ServerResponse: googleapi.ServerResponse{
  11962. Header: res.Header,
  11963. HTTPStatusCode: res.StatusCode,
  11964. },
  11965. }
  11966. target := &ret
  11967. if err := gensupport.DecodeResponse(target, res); err != nil {
  11968. return nil, err
  11969. }
  11970. return ret, nil
  11971. // {
  11972. // "description": "Returns turn-based matches the player is or was involved in that changed since the last sync call, with the least recent changes coming first. Matches that should be removed from the local cache will have a status of MATCH_DELETED.",
  11973. // "httpMethod": "GET",
  11974. // "id": "games.turnBasedMatches.sync",
  11975. // "parameters": {
  11976. // "includeMatchData": {
  11977. // "description": "True if match data should be returned in the response. Note that not all data will necessarily be returned if include_match_data is true; the server may decide to only return data for some of the matches to limit download size for the client. The remainder of the data for these matches will be retrievable on request.",
  11978. // "location": "query",
  11979. // "type": "boolean"
  11980. // },
  11981. // "language": {
  11982. // "description": "The preferred language to use for strings returned by this method.",
  11983. // "location": "query",
  11984. // "type": "string"
  11985. // },
  11986. // "maxCompletedMatches": {
  11987. // "description": "The maximum number of completed or canceled matches to return in the response. If not set, all matches returned could be completed or canceled.",
  11988. // "format": "int32",
  11989. // "location": "query",
  11990. // "maximum": "500",
  11991. // "minimum": "0",
  11992. // "type": "integer"
  11993. // },
  11994. // "maxResults": {
  11995. // "description": "The maximum number of matches to return in the response, used for paging. For any response, the actual number of matches to return may be less than the specified maxResults.",
  11996. // "format": "int32",
  11997. // "location": "query",
  11998. // "maximum": "500",
  11999. // "minimum": "1",
  12000. // "type": "integer"
  12001. // },
  12002. // "pageToken": {
  12003. // "description": "The token returned by the previous request.",
  12004. // "location": "query",
  12005. // "type": "string"
  12006. // }
  12007. // },
  12008. // "path": "turnbasedmatches/sync",
  12009. // "response": {
  12010. // "$ref": "TurnBasedMatchSync"
  12011. // },
  12012. // "scopes": [
  12013. // "https://www.googleapis.com/auth/games",
  12014. // "https://www.googleapis.com/auth/plus.me"
  12015. // ]
  12016. // }
  12017. }
  12018. // Pages invokes f for each page of results.
  12019. // A non-nil error returned from f will halt the iteration.
  12020. // The provided context supersedes any context provided to the Context method.
  12021. func (c *TurnBasedMatchesSyncCall) Pages(ctx context.Context, f func(*TurnBasedMatchSync) error) error {
  12022. c.ctx_ = ctx
  12023. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12024. for {
  12025. x, err := c.Do()
  12026. if err != nil {
  12027. return err
  12028. }
  12029. if err := f(x); err != nil {
  12030. return err
  12031. }
  12032. if x.NextPageToken == "" {
  12033. return nil
  12034. }
  12035. c.PageToken(x.NextPageToken)
  12036. }
  12037. }
  12038. // method id "games.turnBasedMatches.takeTurn":
  12039. type TurnBasedMatchesTakeTurnCall struct {
  12040. s *Service
  12041. matchId string
  12042. turnbasedmatchturn *TurnBasedMatchTurn
  12043. urlParams_ gensupport.URLParams
  12044. ctx_ context.Context
  12045. header_ http.Header
  12046. }
  12047. // TakeTurn: Commit the results of a player turn.
  12048. func (r *TurnBasedMatchesService) TakeTurn(matchId string, turnbasedmatchturn *TurnBasedMatchTurn) *TurnBasedMatchesTakeTurnCall {
  12049. c := &TurnBasedMatchesTakeTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12050. c.matchId = matchId
  12051. c.turnbasedmatchturn = turnbasedmatchturn
  12052. return c
  12053. }
  12054. // Language sets the optional parameter "language": The preferred
  12055. // language to use for strings returned by this method.
  12056. func (c *TurnBasedMatchesTakeTurnCall) Language(language string) *TurnBasedMatchesTakeTurnCall {
  12057. c.urlParams_.Set("language", language)
  12058. return c
  12059. }
  12060. // Fields allows partial responses to be retrieved. See
  12061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12062. // for more information.
  12063. func (c *TurnBasedMatchesTakeTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesTakeTurnCall {
  12064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12065. return c
  12066. }
  12067. // Context sets the context to be used in this call's Do method. Any
  12068. // pending HTTP request will be aborted if the provided context is
  12069. // canceled.
  12070. func (c *TurnBasedMatchesTakeTurnCall) Context(ctx context.Context) *TurnBasedMatchesTakeTurnCall {
  12071. c.ctx_ = ctx
  12072. return c
  12073. }
  12074. // Header returns an http.Header that can be modified by the caller to
  12075. // add HTTP headers to the request.
  12076. func (c *TurnBasedMatchesTakeTurnCall) Header() http.Header {
  12077. if c.header_ == nil {
  12078. c.header_ = make(http.Header)
  12079. }
  12080. return c.header_
  12081. }
  12082. func (c *TurnBasedMatchesTakeTurnCall) doRequest(alt string) (*http.Response, error) {
  12083. reqHeaders := make(http.Header)
  12084. for k, v := range c.header_ {
  12085. reqHeaders[k] = v
  12086. }
  12087. reqHeaders.Set("User-Agent", c.s.userAgent())
  12088. var body io.Reader = nil
  12089. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchturn)
  12090. if err != nil {
  12091. return nil, err
  12092. }
  12093. reqHeaders.Set("Content-Type", "application/json")
  12094. c.urlParams_.Set("alt", alt)
  12095. c.urlParams_.Set("prettyPrint", "false")
  12096. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn")
  12097. urls += "?" + c.urlParams_.Encode()
  12098. req, err := http.NewRequest("PUT", urls, body)
  12099. if err != nil {
  12100. return nil, err
  12101. }
  12102. req.Header = reqHeaders
  12103. googleapi.Expand(req.URL, map[string]string{
  12104. "matchId": c.matchId,
  12105. })
  12106. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12107. }
  12108. // Do executes the "games.turnBasedMatches.takeTurn" call.
  12109. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  12110. // status code is an error. Response headers are in either
  12111. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  12112. // at all) in error.(*googleapi.Error).Header. Use
  12113. // googleapi.IsNotModified to check whether the returned error was
  12114. // because http.StatusNotModified was returned.
  12115. func (c *TurnBasedMatchesTakeTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  12116. gensupport.SetOptions(c.urlParams_, opts...)
  12117. res, err := c.doRequest("json")
  12118. if res != nil && res.StatusCode == http.StatusNotModified {
  12119. if res.Body != nil {
  12120. res.Body.Close()
  12121. }
  12122. return nil, &googleapi.Error{
  12123. Code: res.StatusCode,
  12124. Header: res.Header,
  12125. }
  12126. }
  12127. if err != nil {
  12128. return nil, err
  12129. }
  12130. defer googleapi.CloseBody(res)
  12131. if err := googleapi.CheckResponse(res); err != nil {
  12132. return nil, err
  12133. }
  12134. ret := &TurnBasedMatch{
  12135. ServerResponse: googleapi.ServerResponse{
  12136. Header: res.Header,
  12137. HTTPStatusCode: res.StatusCode,
  12138. },
  12139. }
  12140. target := &ret
  12141. if err := gensupport.DecodeResponse(target, res); err != nil {
  12142. return nil, err
  12143. }
  12144. return ret, nil
  12145. // {
  12146. // "description": "Commit the results of a player turn.",
  12147. // "httpMethod": "PUT",
  12148. // "id": "games.turnBasedMatches.takeTurn",
  12149. // "parameterOrder": [
  12150. // "matchId"
  12151. // ],
  12152. // "parameters": {
  12153. // "language": {
  12154. // "description": "The preferred language to use for strings returned by this method.",
  12155. // "location": "query",
  12156. // "type": "string"
  12157. // },
  12158. // "matchId": {
  12159. // "description": "The ID of the match.",
  12160. // "location": "path",
  12161. // "required": true,
  12162. // "type": "string"
  12163. // }
  12164. // },
  12165. // "path": "turnbasedmatches/{matchId}/turn",
  12166. // "request": {
  12167. // "$ref": "TurnBasedMatchTurn"
  12168. // },
  12169. // "response": {
  12170. // "$ref": "TurnBasedMatch"
  12171. // },
  12172. // "scopes": [
  12173. // "https://www.googleapis.com/auth/games",
  12174. // "https://www.googleapis.com/auth/plus.me"
  12175. // ]
  12176. // }
  12177. }