Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

13339 linhas
474 KiB

  1. // Package games provides access to the Google Play Game Services API.
  2. //
  3. // See https://developers.google.com/games/services/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/games/v1"
  8. // ...
  9. // gamesService, err := games.New(oauthHttpClient)
  10. package games // import "google.golang.org/api/games/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "games:v1"
  41. const apiName = "games"
  42. const apiVersion = "v1"
  43. const basePath = "https://www.googleapis.com/games/v1/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage its own configuration data in your Google Drive
  47. DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"
  48. // Share your Google+ profile information and view and manage your game
  49. // activity
  50. GamesScope = "https://www.googleapis.com/auth/games"
  51. // Know the list of people in your circles, your age range, and language
  52. PlusLoginScope = "https://www.googleapis.com/auth/plus.login"
  53. )
  54. func New(client *http.Client) (*Service, error) {
  55. if client == nil {
  56. return nil, errors.New("client is nil")
  57. }
  58. s := &Service{client: client, BasePath: basePath}
  59. s.AchievementDefinitions = NewAchievementDefinitionsService(s)
  60. s.Achievements = NewAchievementsService(s)
  61. s.Applications = NewApplicationsService(s)
  62. s.Events = NewEventsService(s)
  63. s.Leaderboards = NewLeaderboardsService(s)
  64. s.Metagame = NewMetagameService(s)
  65. s.Players = NewPlayersService(s)
  66. s.Pushtokens = NewPushtokensService(s)
  67. s.QuestMilestones = NewQuestMilestonesService(s)
  68. s.Quests = NewQuestsService(s)
  69. s.Revisions = NewRevisionsService(s)
  70. s.Rooms = NewRoomsService(s)
  71. s.Scores = NewScoresService(s)
  72. s.Snapshots = NewSnapshotsService(s)
  73. s.TurnBasedMatches = NewTurnBasedMatchesService(s)
  74. return s, nil
  75. }
  76. type Service struct {
  77. client *http.Client
  78. BasePath string // API endpoint base URL
  79. UserAgent string // optional additional User-Agent fragment
  80. AchievementDefinitions *AchievementDefinitionsService
  81. Achievements *AchievementsService
  82. Applications *ApplicationsService
  83. Events *EventsService
  84. Leaderboards *LeaderboardsService
  85. Metagame *MetagameService
  86. Players *PlayersService
  87. Pushtokens *PushtokensService
  88. QuestMilestones *QuestMilestonesService
  89. Quests *QuestsService
  90. Revisions *RevisionsService
  91. Rooms *RoomsService
  92. Scores *ScoresService
  93. Snapshots *SnapshotsService
  94. TurnBasedMatches *TurnBasedMatchesService
  95. }
  96. func (s *Service) userAgent() string {
  97. if s.UserAgent == "" {
  98. return googleapi.UserAgent
  99. }
  100. return googleapi.UserAgent + " " + s.UserAgent
  101. }
  102. func NewAchievementDefinitionsService(s *Service) *AchievementDefinitionsService {
  103. rs := &AchievementDefinitionsService{s: s}
  104. return rs
  105. }
  106. type AchievementDefinitionsService struct {
  107. s *Service
  108. }
  109. func NewAchievementsService(s *Service) *AchievementsService {
  110. rs := &AchievementsService{s: s}
  111. return rs
  112. }
  113. type AchievementsService struct {
  114. s *Service
  115. }
  116. func NewApplicationsService(s *Service) *ApplicationsService {
  117. rs := &ApplicationsService{s: s}
  118. return rs
  119. }
  120. type ApplicationsService struct {
  121. s *Service
  122. }
  123. func NewEventsService(s *Service) *EventsService {
  124. rs := &EventsService{s: s}
  125. return rs
  126. }
  127. type EventsService struct {
  128. s *Service
  129. }
  130. func NewLeaderboardsService(s *Service) *LeaderboardsService {
  131. rs := &LeaderboardsService{s: s}
  132. return rs
  133. }
  134. type LeaderboardsService struct {
  135. s *Service
  136. }
  137. func NewMetagameService(s *Service) *MetagameService {
  138. rs := &MetagameService{s: s}
  139. return rs
  140. }
  141. type MetagameService struct {
  142. s *Service
  143. }
  144. func NewPlayersService(s *Service) *PlayersService {
  145. rs := &PlayersService{s: s}
  146. return rs
  147. }
  148. type PlayersService struct {
  149. s *Service
  150. }
  151. func NewPushtokensService(s *Service) *PushtokensService {
  152. rs := &PushtokensService{s: s}
  153. return rs
  154. }
  155. type PushtokensService struct {
  156. s *Service
  157. }
  158. func NewQuestMilestonesService(s *Service) *QuestMilestonesService {
  159. rs := &QuestMilestonesService{s: s}
  160. return rs
  161. }
  162. type QuestMilestonesService struct {
  163. s *Service
  164. }
  165. func NewQuestsService(s *Service) *QuestsService {
  166. rs := &QuestsService{s: s}
  167. return rs
  168. }
  169. type QuestsService struct {
  170. s *Service
  171. }
  172. func NewRevisionsService(s *Service) *RevisionsService {
  173. rs := &RevisionsService{s: s}
  174. return rs
  175. }
  176. type RevisionsService struct {
  177. s *Service
  178. }
  179. func NewRoomsService(s *Service) *RoomsService {
  180. rs := &RoomsService{s: s}
  181. return rs
  182. }
  183. type RoomsService struct {
  184. s *Service
  185. }
  186. func NewScoresService(s *Service) *ScoresService {
  187. rs := &ScoresService{s: s}
  188. return rs
  189. }
  190. type ScoresService struct {
  191. s *Service
  192. }
  193. func NewSnapshotsService(s *Service) *SnapshotsService {
  194. rs := &SnapshotsService{s: s}
  195. return rs
  196. }
  197. type SnapshotsService struct {
  198. s *Service
  199. }
  200. func NewTurnBasedMatchesService(s *Service) *TurnBasedMatchesService {
  201. rs := &TurnBasedMatchesService{s: s}
  202. return rs
  203. }
  204. type TurnBasedMatchesService struct {
  205. s *Service
  206. }
  207. // AchievementDefinition: This is a JSON template for an achievement
  208. // definition object.
  209. type AchievementDefinition struct {
  210. // AchievementType: The type of the achievement.
  211. // Possible values are:
  212. // - "STANDARD" - Achievement is either locked or unlocked.
  213. // - "INCREMENTAL" - Achievement is incremental.
  214. AchievementType string `json:"achievementType,omitempty"`
  215. // Description: The description of the achievement.
  216. Description string `json:"description,omitempty"`
  217. // ExperiencePoints: Experience points which will be earned when
  218. // unlocking this achievement.
  219. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  220. // FormattedTotalSteps: The total steps for an incremental achievement
  221. // as a string.
  222. FormattedTotalSteps string `json:"formattedTotalSteps,omitempty"`
  223. // Id: The ID of the achievement.
  224. Id string `json:"id,omitempty"`
  225. // InitialState: The initial state of the achievement.
  226. // Possible values are:
  227. // - "HIDDEN" - Achievement is hidden.
  228. // - "REVEALED" - Achievement is revealed.
  229. // - "UNLOCKED" - Achievement is unlocked.
  230. InitialState string `json:"initialState,omitempty"`
  231. // IsRevealedIconUrlDefault: Indicates whether the revealed icon image
  232. // being returned is a default image, or is provided by the game.
  233. IsRevealedIconUrlDefault bool `json:"isRevealedIconUrlDefault,omitempty"`
  234. // IsUnlockedIconUrlDefault: Indicates whether the unlocked icon image
  235. // being returned is a default image, or is game-provided.
  236. IsUnlockedIconUrlDefault bool `json:"isUnlockedIconUrlDefault,omitempty"`
  237. // Kind: Uniquely identifies the type of this resource. Value is always
  238. // the fixed string games#achievementDefinition.
  239. Kind string `json:"kind,omitempty"`
  240. // Name: The name of the achievement.
  241. Name string `json:"name,omitempty"`
  242. // RevealedIconUrl: The image URL for the revealed achievement icon.
  243. RevealedIconUrl string `json:"revealedIconUrl,omitempty"`
  244. // TotalSteps: The total steps for an incremental achievement.
  245. TotalSteps int64 `json:"totalSteps,omitempty"`
  246. // UnlockedIconUrl: The image URL for the unlocked achievement icon.
  247. UnlockedIconUrl string `json:"unlockedIconUrl,omitempty"`
  248. // ForceSendFields is a list of field names (e.g. "AchievementType") to
  249. // unconditionally include in API requests. By default, fields with
  250. // empty values are omitted from API requests. However, any non-pointer,
  251. // non-interface field appearing in ForceSendFields will be sent to the
  252. // server regardless of whether the field is empty or not. This may be
  253. // used to include empty fields in Patch requests.
  254. ForceSendFields []string `json:"-"`
  255. // NullFields is a list of field names (e.g. "AchievementType") to
  256. // include in API requests with the JSON null value. By default, fields
  257. // with empty values are omitted from API requests. However, any field
  258. // with an empty value appearing in NullFields will be sent to the
  259. // server as null. It is an error if a field in this list has a
  260. // non-empty value. This may be used to include null fields in Patch
  261. // requests.
  262. NullFields []string `json:"-"`
  263. }
  264. func (s *AchievementDefinition) MarshalJSON() ([]byte, error) {
  265. type NoMethod AchievementDefinition
  266. raw := NoMethod(*s)
  267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  268. }
  269. // AchievementDefinitionsListResponse: This is a JSON template for a
  270. // list of achievement definition objects.
  271. type AchievementDefinitionsListResponse struct {
  272. // Items: The achievement definitions.
  273. Items []*AchievementDefinition `json:"items,omitempty"`
  274. // Kind: Uniquely identifies the type of this resource. Value is always
  275. // the fixed string games#achievementDefinitionsListResponse.
  276. Kind string `json:"kind,omitempty"`
  277. // NextPageToken: Token corresponding to the next page of results.
  278. NextPageToken string `json:"nextPageToken,omitempty"`
  279. // ServerResponse contains the HTTP response code and headers from the
  280. // server.
  281. googleapi.ServerResponse `json:"-"`
  282. // ForceSendFields is a list of field names (e.g. "Items") to
  283. // unconditionally include in API requests. By default, fields with
  284. // empty values are omitted from API requests. However, any non-pointer,
  285. // non-interface field appearing in ForceSendFields will be sent to the
  286. // server regardless of whether the field is empty or not. This may be
  287. // used to include empty fields in Patch requests.
  288. ForceSendFields []string `json:"-"`
  289. // NullFields is a list of field names (e.g. "Items") to include in API
  290. // requests with the JSON null value. By default, fields with empty
  291. // values are omitted from API requests. However, any field with an
  292. // empty value appearing in NullFields will be sent to the server as
  293. // null. It is an error if a field in this list has a non-empty value.
  294. // This may be used to include null fields in Patch requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *AchievementDefinitionsListResponse) MarshalJSON() ([]byte, error) {
  298. type NoMethod AchievementDefinitionsListResponse
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. // AchievementIncrementResponse: This is a JSON template for an
  303. // achievement increment response
  304. type AchievementIncrementResponse struct {
  305. // CurrentSteps: The current steps recorded for this incremental
  306. // achievement.
  307. CurrentSteps int64 `json:"currentSteps,omitempty"`
  308. // Kind: Uniquely identifies the type of this resource. Value is always
  309. // the fixed string games#achievementIncrementResponse.
  310. Kind string `json:"kind,omitempty"`
  311. // NewlyUnlocked: Whether the current steps for the achievement has
  312. // reached the number of steps required to unlock.
  313. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  314. // ServerResponse contains the HTTP response code and headers from the
  315. // server.
  316. googleapi.ServerResponse `json:"-"`
  317. // ForceSendFields is a list of field names (e.g. "CurrentSteps") to
  318. // unconditionally include in API requests. By default, fields with
  319. // empty values are omitted from API requests. However, any non-pointer,
  320. // non-interface field appearing in ForceSendFields will be sent to the
  321. // server regardless of whether the field is empty or not. This may be
  322. // used to include empty fields in Patch requests.
  323. ForceSendFields []string `json:"-"`
  324. // NullFields is a list of field names (e.g. "CurrentSteps") to include
  325. // in API requests with the JSON null value. By default, fields with
  326. // empty values are omitted from API requests. However, any field with
  327. // an empty value appearing in NullFields will be sent to the server as
  328. // null. It is an error if a field in this list has a non-empty value.
  329. // This may be used to include null fields in Patch requests.
  330. NullFields []string `json:"-"`
  331. }
  332. func (s *AchievementIncrementResponse) MarshalJSON() ([]byte, error) {
  333. type NoMethod AchievementIncrementResponse
  334. raw := NoMethod(*s)
  335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  336. }
  337. // AchievementRevealResponse: This is a JSON template for an achievement
  338. // reveal response
  339. type AchievementRevealResponse struct {
  340. // CurrentState: The current state of the achievement for which a reveal
  341. // was attempted. This might be UNLOCKED if the achievement was already
  342. // unlocked.
  343. // Possible values are:
  344. // - "REVEALED" - Achievement is revealed.
  345. // - "UNLOCKED" - Achievement is unlocked.
  346. CurrentState string `json:"currentState,omitempty"`
  347. // Kind: Uniquely identifies the type of this resource. Value is always
  348. // the fixed string games#achievementRevealResponse.
  349. Kind string `json:"kind,omitempty"`
  350. // ServerResponse contains the HTTP response code and headers from the
  351. // server.
  352. googleapi.ServerResponse `json:"-"`
  353. // ForceSendFields is a list of field names (e.g. "CurrentState") to
  354. // unconditionally include in API requests. By default, fields with
  355. // empty values are omitted from API requests. However, any non-pointer,
  356. // non-interface field appearing in ForceSendFields will be sent to the
  357. // server regardless of whether the field is empty or not. This may be
  358. // used to include empty fields in Patch requests.
  359. ForceSendFields []string `json:"-"`
  360. // NullFields is a list of field names (e.g. "CurrentState") to include
  361. // in API requests with the JSON null value. By default, fields with
  362. // empty values are omitted from API requests. However, any field with
  363. // an empty value appearing in NullFields will be sent to the server as
  364. // null. It is an error if a field in this list has a non-empty value.
  365. // This may be used to include null fields in Patch requests.
  366. NullFields []string `json:"-"`
  367. }
  368. func (s *AchievementRevealResponse) MarshalJSON() ([]byte, error) {
  369. type NoMethod AchievementRevealResponse
  370. raw := NoMethod(*s)
  371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  372. }
  373. // AchievementSetStepsAtLeastResponse: This is a JSON template for an
  374. // achievement set steps at least response.
  375. type AchievementSetStepsAtLeastResponse struct {
  376. // CurrentSteps: The current steps recorded for this incremental
  377. // achievement.
  378. CurrentSteps int64 `json:"currentSteps,omitempty"`
  379. // Kind: Uniquely identifies the type of this resource. Value is always
  380. // the fixed string games#achievementSetStepsAtLeastResponse.
  381. Kind string `json:"kind,omitempty"`
  382. // NewlyUnlocked: Whether the the current steps for the achievement has
  383. // reached the number of steps required to unlock.
  384. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  385. // ServerResponse contains the HTTP response code and headers from the
  386. // server.
  387. googleapi.ServerResponse `json:"-"`
  388. // ForceSendFields is a list of field names (e.g. "CurrentSteps") to
  389. // unconditionally include in API requests. By default, fields with
  390. // empty values are omitted from API requests. However, any non-pointer,
  391. // non-interface field appearing in ForceSendFields will be sent to the
  392. // server regardless of whether the field is empty or not. This may be
  393. // used to include empty fields in Patch requests.
  394. ForceSendFields []string `json:"-"`
  395. // NullFields is a list of field names (e.g. "CurrentSteps") to include
  396. // in API requests with the JSON null value. By default, fields with
  397. // empty values are omitted from API requests. However, any field with
  398. // an empty value appearing in NullFields will be sent to the server as
  399. // null. It is an error if a field in this list has a non-empty value.
  400. // This may be used to include null fields in Patch requests.
  401. NullFields []string `json:"-"`
  402. }
  403. func (s *AchievementSetStepsAtLeastResponse) MarshalJSON() ([]byte, error) {
  404. type NoMethod AchievementSetStepsAtLeastResponse
  405. raw := NoMethod(*s)
  406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  407. }
  408. // AchievementUnlockResponse: This is a JSON template for an achievement
  409. // unlock response
  410. type AchievementUnlockResponse struct {
  411. // Kind: Uniquely identifies the type of this resource. Value is always
  412. // the fixed string games#achievementUnlockResponse.
  413. Kind string `json:"kind,omitempty"`
  414. // NewlyUnlocked: Whether this achievement was newly unlocked (that is,
  415. // whether the unlock request for the achievement was the first for the
  416. // player).
  417. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  418. // ServerResponse contains the HTTP response code and headers from the
  419. // server.
  420. googleapi.ServerResponse `json:"-"`
  421. // ForceSendFields is a list of field names (e.g. "Kind") to
  422. // unconditionally include in API requests. By default, fields with
  423. // empty values are omitted from API requests. However, any non-pointer,
  424. // non-interface field appearing in ForceSendFields will be sent to the
  425. // server regardless of whether the field is empty or not. This may be
  426. // used to include empty fields in Patch requests.
  427. ForceSendFields []string `json:"-"`
  428. // NullFields is a list of field names (e.g. "Kind") to include in API
  429. // requests with the JSON null value. By default, fields with empty
  430. // values are omitted from API requests. However, any field with an
  431. // empty value appearing in NullFields will be sent to the server as
  432. // null. It is an error if a field in this list has a non-empty value.
  433. // This may be used to include null fields in Patch requests.
  434. NullFields []string `json:"-"`
  435. }
  436. func (s *AchievementUnlockResponse) MarshalJSON() ([]byte, error) {
  437. type NoMethod AchievementUnlockResponse
  438. raw := NoMethod(*s)
  439. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  440. }
  441. // AchievementUpdateMultipleRequest: This is a JSON template for a list
  442. // of achievement update requests.
  443. type AchievementUpdateMultipleRequest struct {
  444. // Kind: Uniquely identifies the type of this resource. Value is always
  445. // the fixed string games#achievementUpdateMultipleRequest.
  446. Kind string `json:"kind,omitempty"`
  447. // Updates: The individual achievement update requests.
  448. Updates []*AchievementUpdateRequest `json:"updates,omitempty"`
  449. // ForceSendFields is a list of field names (e.g. "Kind") to
  450. // unconditionally include in API requests. By default, fields with
  451. // empty values are omitted from API requests. However, any non-pointer,
  452. // non-interface field appearing in ForceSendFields will be sent to the
  453. // server regardless of whether the field is empty or not. This may be
  454. // used to include empty fields in Patch requests.
  455. ForceSendFields []string `json:"-"`
  456. // NullFields is a list of field names (e.g. "Kind") to include in API
  457. // requests with the JSON null value. By default, fields with empty
  458. // values are omitted from API requests. However, any field with an
  459. // empty value appearing in NullFields will be sent to the server as
  460. // null. It is an error if a field in this list has a non-empty value.
  461. // This may be used to include null fields in Patch requests.
  462. NullFields []string `json:"-"`
  463. }
  464. func (s *AchievementUpdateMultipleRequest) MarshalJSON() ([]byte, error) {
  465. type NoMethod AchievementUpdateMultipleRequest
  466. raw := NoMethod(*s)
  467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  468. }
  469. // AchievementUpdateMultipleResponse: This is a JSON template for an
  470. // achievement unlock response.
  471. type AchievementUpdateMultipleResponse struct {
  472. // Kind: Uniquely identifies the type of this resource. Value is always
  473. // the fixed string games#achievementUpdateListResponse.
  474. Kind string `json:"kind,omitempty"`
  475. // UpdatedAchievements: The updated state of the achievements.
  476. UpdatedAchievements []*AchievementUpdateResponse `json:"updatedAchievements,omitempty"`
  477. // ServerResponse contains the HTTP response code and headers from the
  478. // server.
  479. googleapi.ServerResponse `json:"-"`
  480. // ForceSendFields is a list of field names (e.g. "Kind") to
  481. // unconditionally include in API requests. By default, fields with
  482. // empty values are omitted from API requests. However, any non-pointer,
  483. // non-interface field appearing in ForceSendFields will be sent to the
  484. // server regardless of whether the field is empty or not. This may be
  485. // used to include empty fields in Patch requests.
  486. ForceSendFields []string `json:"-"`
  487. // NullFields is a list of field names (e.g. "Kind") to include in API
  488. // requests with the JSON null value. By default, fields with empty
  489. // values are omitted from API requests. However, any field with an
  490. // empty value appearing in NullFields will be sent to the server as
  491. // null. It is an error if a field in this list has a non-empty value.
  492. // This may be used to include null fields in Patch requests.
  493. NullFields []string `json:"-"`
  494. }
  495. func (s *AchievementUpdateMultipleResponse) MarshalJSON() ([]byte, error) {
  496. type NoMethod AchievementUpdateMultipleResponse
  497. raw := NoMethod(*s)
  498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  499. }
  500. // AchievementUpdateRequest: This is a JSON template for a request to
  501. // update an achievement.
  502. type AchievementUpdateRequest struct {
  503. // AchievementId: The achievement this update is being applied to.
  504. AchievementId string `json:"achievementId,omitempty"`
  505. // IncrementPayload: The payload if an update of type INCREMENT was
  506. // requested for the achievement.
  507. IncrementPayload *GamesAchievementIncrement `json:"incrementPayload,omitempty"`
  508. // Kind: Uniquely identifies the type of this resource. Value is always
  509. // the fixed string games#achievementUpdateRequest.
  510. Kind string `json:"kind,omitempty"`
  511. // SetStepsAtLeastPayload: The payload if an update of type
  512. // SET_STEPS_AT_LEAST was requested for the achievement.
  513. SetStepsAtLeastPayload *GamesAchievementSetStepsAtLeast `json:"setStepsAtLeastPayload,omitempty"`
  514. // UpdateType: The type of update being applied.
  515. // Possible values are:
  516. // - "REVEAL" - Achievement is revealed.
  517. // - "UNLOCK" - Achievement is unlocked.
  518. // - "INCREMENT" - Achievement is incremented.
  519. // - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the
  520. // passed value.
  521. UpdateType string `json:"updateType,omitempty"`
  522. // ForceSendFields is a list of field names (e.g. "AchievementId") to
  523. // unconditionally include in API requests. By default, fields with
  524. // empty values are omitted from API requests. However, any non-pointer,
  525. // non-interface field appearing in ForceSendFields will be sent to the
  526. // server regardless of whether the field is empty or not. This may be
  527. // used to include empty fields in Patch requests.
  528. ForceSendFields []string `json:"-"`
  529. // NullFields is a list of field names (e.g. "AchievementId") to include
  530. // in API requests with the JSON null value. By default, fields with
  531. // empty values are omitted from API requests. However, any field with
  532. // an empty value appearing in NullFields will be sent to the server as
  533. // null. It is an error if a field in this list has a non-empty value.
  534. // This may be used to include null fields in Patch requests.
  535. NullFields []string `json:"-"`
  536. }
  537. func (s *AchievementUpdateRequest) MarshalJSON() ([]byte, error) {
  538. type NoMethod AchievementUpdateRequest
  539. raw := NoMethod(*s)
  540. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  541. }
  542. // AchievementUpdateResponse: This is a JSON template for an achievement
  543. // update response.
  544. type AchievementUpdateResponse struct {
  545. // AchievementId: The achievement this update is was applied to.
  546. AchievementId string `json:"achievementId,omitempty"`
  547. // CurrentState: The current state of the achievement.
  548. // Possible values are:
  549. // - "HIDDEN" - Achievement is hidden.
  550. // - "REVEALED" - Achievement is revealed.
  551. // - "UNLOCKED" - Achievement is unlocked.
  552. CurrentState string `json:"currentState,omitempty"`
  553. // CurrentSteps: The current steps recorded for this achievement if it
  554. // is incremental.
  555. CurrentSteps int64 `json:"currentSteps,omitempty"`
  556. // Kind: Uniquely identifies the type of this resource. Value is always
  557. // the fixed string games#achievementUpdateResponse.
  558. Kind string `json:"kind,omitempty"`
  559. // NewlyUnlocked: Whether this achievement was newly unlocked (that is,
  560. // whether the unlock request for the achievement was the first for the
  561. // player).
  562. NewlyUnlocked bool `json:"newlyUnlocked,omitempty"`
  563. // UpdateOccurred: Whether the requested updates actually affected the
  564. // achievement.
  565. UpdateOccurred bool `json:"updateOccurred,omitempty"`
  566. // ForceSendFields is a list of field names (e.g. "AchievementId") to
  567. // unconditionally include in API requests. By default, fields with
  568. // empty values are omitted from API requests. However, any non-pointer,
  569. // non-interface field appearing in ForceSendFields will be sent to the
  570. // server regardless of whether the field is empty or not. This may be
  571. // used to include empty fields in Patch requests.
  572. ForceSendFields []string `json:"-"`
  573. // NullFields is a list of field names (e.g. "AchievementId") to include
  574. // in API requests with the JSON null value. By default, fields with
  575. // empty values are omitted from API requests. However, any field with
  576. // an empty value appearing in NullFields will be sent to the server as
  577. // null. It is an error if a field in this list has a non-empty value.
  578. // This may be used to include null fields in Patch requests.
  579. NullFields []string `json:"-"`
  580. }
  581. func (s *AchievementUpdateResponse) MarshalJSON() ([]byte, error) {
  582. type NoMethod AchievementUpdateResponse
  583. raw := NoMethod(*s)
  584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  585. }
  586. // AggregateStats: This is a JSON template for aggregate stats.
  587. type AggregateStats struct {
  588. // Count: The number of messages sent between a pair of peers.
  589. Count int64 `json:"count,omitempty,string"`
  590. // Kind: Uniquely identifies the type of this resource. Value is always
  591. // the fixed string games#aggregateStats.
  592. Kind string `json:"kind,omitempty"`
  593. // Max: The maximum amount.
  594. Max int64 `json:"max,omitempty,string"`
  595. // Min: The minimum amount.
  596. Min int64 `json:"min,omitempty,string"`
  597. // Sum: The total number of bytes sent for messages between a pair of
  598. // peers.
  599. Sum int64 `json:"sum,omitempty,string"`
  600. // ForceSendFields is a list of field names (e.g. "Count") to
  601. // unconditionally include in API requests. By default, fields with
  602. // empty values are omitted from API requests. However, any non-pointer,
  603. // non-interface field appearing in ForceSendFields will be sent to the
  604. // server regardless of whether the field is empty or not. This may be
  605. // used to include empty fields in Patch requests.
  606. ForceSendFields []string `json:"-"`
  607. // NullFields is a list of field names (e.g. "Count") to include in API
  608. // requests with the JSON null value. By default, fields with empty
  609. // values are omitted from API requests. However, any field with an
  610. // empty value appearing in NullFields will be sent to the server as
  611. // null. It is an error if a field in this list has a non-empty value.
  612. // This may be used to include null fields in Patch requests.
  613. NullFields []string `json:"-"`
  614. }
  615. func (s *AggregateStats) MarshalJSON() ([]byte, error) {
  616. type NoMethod AggregateStats
  617. raw := NoMethod(*s)
  618. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  619. }
  620. // AnonymousPlayer: This is a JSON template for an anonymous player
  621. type AnonymousPlayer struct {
  622. // AvatarImageUrl: The base URL for the image to display for the
  623. // anonymous player.
  624. AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
  625. // DisplayName: The name to display for the anonymous player.
  626. DisplayName string `json:"displayName,omitempty"`
  627. // Kind: Uniquely identifies the type of this resource. Value is always
  628. // the fixed string games#anonymousPlayer.
  629. Kind string `json:"kind,omitempty"`
  630. // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
  631. // unconditionally include in API requests. By default, fields with
  632. // empty values are omitted from API requests. However, any non-pointer,
  633. // non-interface field appearing in ForceSendFields will be sent to the
  634. // server regardless of whether the field is empty or not. This may be
  635. // used to include empty fields in Patch requests.
  636. ForceSendFields []string `json:"-"`
  637. // NullFields is a list of field names (e.g. "AvatarImageUrl") to
  638. // include in API requests with the JSON null value. By default, fields
  639. // with empty values are omitted from API requests. However, any field
  640. // with an empty value appearing in NullFields will be sent to the
  641. // server as null. It is an error if a field in this list has a
  642. // non-empty value. This may be used to include null fields in Patch
  643. // requests.
  644. NullFields []string `json:"-"`
  645. }
  646. func (s *AnonymousPlayer) MarshalJSON() ([]byte, error) {
  647. type NoMethod AnonymousPlayer
  648. raw := NoMethod(*s)
  649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  650. }
  651. // Application: This is a JSON template for the Application resource.
  652. type Application struct {
  653. // AchievementCount: The number of achievements visible to the currently
  654. // authenticated player.
  655. AchievementCount int64 `json:"achievement_count,omitempty"`
  656. // Assets: The assets of the application.
  657. Assets []*ImageAsset `json:"assets,omitempty"`
  658. // Author: The author of the application.
  659. Author string `json:"author,omitempty"`
  660. // Category: The category of the application.
  661. Category *ApplicationCategory `json:"category,omitempty"`
  662. // Description: The description of the application.
  663. Description string `json:"description,omitempty"`
  664. // EnabledFeatures: A list of features that have been enabled for the
  665. // application.
  666. // Possible values are:
  667. // - "SNAPSHOTS" - Snapshots has been enabled
  668. EnabledFeatures []string `json:"enabledFeatures,omitempty"`
  669. // Id: The ID of the application.
  670. Id string `json:"id,omitempty"`
  671. // Instances: The instances of the application.
  672. Instances []*Instance `json:"instances,omitempty"`
  673. // Kind: Uniquely identifies the type of this resource. Value is always
  674. // the fixed string games#application.
  675. Kind string `json:"kind,omitempty"`
  676. // LastUpdatedTimestamp: The last updated timestamp of the application.
  677. LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"`
  678. // LeaderboardCount: The number of leaderboards visible to the currently
  679. // authenticated player.
  680. LeaderboardCount int64 `json:"leaderboard_count,omitempty"`
  681. // Name: The name of the application.
  682. Name string `json:"name,omitempty"`
  683. // ThemeColor: A hint to the client UI for what color to use as an
  684. // app-themed color. The color is given as an RGB triplet (e.g.
  685. // "E0E0E0").
  686. ThemeColor string `json:"themeColor,omitempty"`
  687. // ServerResponse contains the HTTP response code and headers from the
  688. // server.
  689. googleapi.ServerResponse `json:"-"`
  690. // ForceSendFields is a list of field names (e.g. "AchievementCount") to
  691. // unconditionally include in API requests. By default, fields with
  692. // empty values are omitted from API requests. However, any non-pointer,
  693. // non-interface field appearing in ForceSendFields will be sent to the
  694. // server regardless of whether the field is empty or not. This may be
  695. // used to include empty fields in Patch requests.
  696. ForceSendFields []string `json:"-"`
  697. // NullFields is a list of field names (e.g. "AchievementCount") to
  698. // include in API requests with the JSON null value. By default, fields
  699. // with empty values are omitted from API requests. However, any field
  700. // with an empty value appearing in NullFields will be sent to the
  701. // server as null. It is an error if a field in this list has a
  702. // non-empty value. This may be used to include null fields in Patch
  703. // requests.
  704. NullFields []string `json:"-"`
  705. }
  706. func (s *Application) MarshalJSON() ([]byte, error) {
  707. type NoMethod Application
  708. raw := NoMethod(*s)
  709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  710. }
  711. // ApplicationCategory: This is a JSON template for an application
  712. // category object.
  713. type ApplicationCategory struct {
  714. // Kind: Uniquely identifies the type of this resource. Value is always
  715. // the fixed string games#applicationCategory.
  716. Kind string `json:"kind,omitempty"`
  717. // Primary: The primary category.
  718. Primary string `json:"primary,omitempty"`
  719. // Secondary: The secondary category.
  720. Secondary string `json:"secondary,omitempty"`
  721. // ForceSendFields is a list of field names (e.g. "Kind") to
  722. // unconditionally include in API requests. By default, fields with
  723. // empty values are omitted from API requests. However, any non-pointer,
  724. // non-interface field appearing in ForceSendFields will be sent to the
  725. // server regardless of whether the field is empty or not. This may be
  726. // used to include empty fields in Patch requests.
  727. ForceSendFields []string `json:"-"`
  728. // NullFields is a list of field names (e.g. "Kind") to include in API
  729. // requests with the JSON null value. By default, fields with empty
  730. // values are omitted from API requests. However, any field with an
  731. // empty value appearing in NullFields will be sent to the server as
  732. // null. It is an error if a field in this list has a non-empty value.
  733. // This may be used to include null fields in Patch requests.
  734. NullFields []string `json:"-"`
  735. }
  736. func (s *ApplicationCategory) MarshalJSON() ([]byte, error) {
  737. type NoMethod ApplicationCategory
  738. raw := NoMethod(*s)
  739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  740. }
  741. // ApplicationVerifyResponse: This is a JSON template for a third party
  742. // application verification response resource.
  743. type ApplicationVerifyResponse struct {
  744. // AlternatePlayerId: An alternate ID that was once used for the player
  745. // that was issued the auth token used in this request. (This field is
  746. // not normally populated.)
  747. AlternatePlayerId string `json:"alternate_player_id,omitempty"`
  748. // Kind: Uniquely identifies the type of this resource. Value is always
  749. // the fixed string games#applicationVerifyResponse.
  750. Kind string `json:"kind,omitempty"`
  751. // PlayerId: The ID of the player that was issued the auth token used in
  752. // this request.
  753. PlayerId string `json:"player_id,omitempty"`
  754. // ServerResponse contains the HTTP response code and headers from the
  755. // server.
  756. googleapi.ServerResponse `json:"-"`
  757. // ForceSendFields is a list of field names (e.g. "AlternatePlayerId")
  758. // to unconditionally include in API requests. By default, fields with
  759. // empty values are omitted from API requests. However, any non-pointer,
  760. // non-interface field appearing in ForceSendFields will be sent to the
  761. // server regardless of whether the field is empty or not. This may be
  762. // used to include empty fields in Patch requests.
  763. ForceSendFields []string `json:"-"`
  764. // NullFields is a list of field names (e.g. "AlternatePlayerId") to
  765. // include in API requests with the JSON null value. By default, fields
  766. // with empty values are omitted from API requests. However, any field
  767. // with an empty value appearing in NullFields will be sent to the
  768. // server as null. It is an error if a field in this list has a
  769. // non-empty value. This may be used to include null fields in Patch
  770. // requests.
  771. NullFields []string `json:"-"`
  772. }
  773. func (s *ApplicationVerifyResponse) MarshalJSON() ([]byte, error) {
  774. type NoMethod ApplicationVerifyResponse
  775. raw := NoMethod(*s)
  776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  777. }
  778. // Category: This is a JSON template for data related to individual game
  779. // categories.
  780. type Category struct {
  781. // Category: The category name.
  782. Category string `json:"category,omitempty"`
  783. // ExperiencePoints: Experience points earned in this category.
  784. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  785. // Kind: Uniquely identifies the type of this resource. Value is always
  786. // the fixed string games#category.
  787. Kind string `json:"kind,omitempty"`
  788. // ForceSendFields is a list of field names (e.g. "Category") to
  789. // unconditionally include in API requests. By default, fields with
  790. // empty values are omitted from API requests. However, any non-pointer,
  791. // non-interface field appearing in ForceSendFields will be sent to the
  792. // server regardless of whether the field is empty or not. This may be
  793. // used to include empty fields in Patch requests.
  794. ForceSendFields []string `json:"-"`
  795. // NullFields is a list of field names (e.g. "Category") to include in
  796. // API requests with the JSON null value. By default, fields with empty
  797. // values are omitted from API requests. However, any field with an
  798. // empty value appearing in NullFields will be sent to the server as
  799. // null. It is an error if a field in this list has a non-empty value.
  800. // This may be used to include null fields in Patch requests.
  801. NullFields []string `json:"-"`
  802. }
  803. func (s *Category) MarshalJSON() ([]byte, error) {
  804. type NoMethod Category
  805. raw := NoMethod(*s)
  806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  807. }
  808. // CategoryListResponse: This is a JSON template for a list of category
  809. // data objects.
  810. type CategoryListResponse struct {
  811. // Items: The list of categories with usage data.
  812. Items []*Category `json:"items,omitempty"`
  813. // Kind: Uniquely identifies the type of this resource. Value is always
  814. // the fixed string games#categoryListResponse.
  815. Kind string `json:"kind,omitempty"`
  816. // NextPageToken: Token corresponding to the next page of results.
  817. NextPageToken string `json:"nextPageToken,omitempty"`
  818. // ServerResponse contains the HTTP response code and headers from the
  819. // server.
  820. googleapi.ServerResponse `json:"-"`
  821. // ForceSendFields is a list of field names (e.g. "Items") to
  822. // unconditionally include in API requests. By default, fields with
  823. // empty values are omitted from API requests. However, any non-pointer,
  824. // non-interface field appearing in ForceSendFields will be sent to the
  825. // server regardless of whether the field is empty or not. This may be
  826. // used to include empty fields in Patch requests.
  827. ForceSendFields []string `json:"-"`
  828. // NullFields is a list of field names (e.g. "Items") to include in API
  829. // requests with the JSON null value. By default, fields with empty
  830. // values are omitted from API requests. However, any field with an
  831. // empty value appearing in NullFields will be sent to the server as
  832. // null. It is an error if a field in this list has a non-empty value.
  833. // This may be used to include null fields in Patch requests.
  834. NullFields []string `json:"-"`
  835. }
  836. func (s *CategoryListResponse) MarshalJSON() ([]byte, error) {
  837. type NoMethod CategoryListResponse
  838. raw := NoMethod(*s)
  839. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  840. }
  841. // EventBatchRecordFailure: This is a JSON template for a batch update
  842. // failure resource.
  843. type EventBatchRecordFailure struct {
  844. // FailureCause: The cause for the update failure.
  845. // Possible values are:
  846. // - "TOO_LARGE": A batch request was issued with more events than are
  847. // allowed in a single batch.
  848. // - "TIME_PERIOD_EXPIRED": A batch was sent with data too far in the
  849. // past to record.
  850. // - "TIME_PERIOD_SHORT": A batch was sent with a time range that was
  851. // too short.
  852. // - "TIME_PERIOD_LONG": A batch was sent with a time range that was too
  853. // long.
  854. // - "ALREADY_UPDATED": An attempt was made to record a batch of data
  855. // which was already seen.
  856. // - "RECORD_RATE_HIGH": An attempt was made to record data faster than
  857. // the server will apply updates.
  858. FailureCause string `json:"failureCause,omitempty"`
  859. // Kind: Uniquely identifies the type of this resource. Value is always
  860. // the fixed string games#eventBatchRecordFailure.
  861. Kind string `json:"kind,omitempty"`
  862. // Range: The time range which was rejected; empty for a request-wide
  863. // failure.
  864. Range *EventPeriodRange `json:"range,omitempty"`
  865. // ForceSendFields is a list of field names (e.g. "FailureCause") to
  866. // unconditionally include in API requests. By default, fields with
  867. // empty values are omitted from API requests. However, any non-pointer,
  868. // non-interface field appearing in ForceSendFields will be sent to the
  869. // server regardless of whether the field is empty or not. This may be
  870. // used to include empty fields in Patch requests.
  871. ForceSendFields []string `json:"-"`
  872. // NullFields is a list of field names (e.g. "FailureCause") to include
  873. // in API requests with the JSON null value. By default, fields with
  874. // empty values are omitted from API requests. However, any field with
  875. // an empty value appearing in NullFields will be sent to the server as
  876. // null. It is an error if a field in this list has a non-empty value.
  877. // This may be used to include null fields in Patch requests.
  878. NullFields []string `json:"-"`
  879. }
  880. func (s *EventBatchRecordFailure) MarshalJSON() ([]byte, error) {
  881. type NoMethod EventBatchRecordFailure
  882. raw := NoMethod(*s)
  883. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  884. }
  885. // EventChild: This is a JSON template for an event child relationship
  886. // resource.
  887. type EventChild struct {
  888. // ChildId: The ID of the child event.
  889. ChildId string `json:"childId,omitempty"`
  890. // Kind: Uniquely identifies the type of this resource. Value is always
  891. // the fixed string games#eventChild.
  892. Kind string `json:"kind,omitempty"`
  893. // ForceSendFields is a list of field names (e.g. "ChildId") to
  894. // unconditionally include in API requests. By default, fields with
  895. // empty values are omitted from API requests. However, any non-pointer,
  896. // non-interface field appearing in ForceSendFields will be sent to the
  897. // server regardless of whether the field is empty or not. This may be
  898. // used to include empty fields in Patch requests.
  899. ForceSendFields []string `json:"-"`
  900. // NullFields is a list of field names (e.g. "ChildId") to include in
  901. // API requests with the JSON null value. By default, fields with empty
  902. // values are omitted from API requests. However, any field with an
  903. // empty value appearing in NullFields will be sent to the server as
  904. // null. It is an error if a field in this list has a non-empty value.
  905. // This may be used to include null fields in Patch requests.
  906. NullFields []string `json:"-"`
  907. }
  908. func (s *EventChild) MarshalJSON() ([]byte, error) {
  909. type NoMethod EventChild
  910. raw := NoMethod(*s)
  911. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  912. }
  913. // EventDefinition: This is a JSON template for an event definition
  914. // resource.
  915. type EventDefinition struct {
  916. // ChildEvents: A list of events that are a child of this event.
  917. ChildEvents []*EventChild `json:"childEvents,omitempty"`
  918. // Description: Description of what this event represents.
  919. Description string `json:"description,omitempty"`
  920. // DisplayName: The name to display for the event.
  921. DisplayName string `json:"displayName,omitempty"`
  922. // Id: The ID of the event.
  923. Id string `json:"id,omitempty"`
  924. // ImageUrl: The base URL for the image that represents the event.
  925. ImageUrl string `json:"imageUrl,omitempty"`
  926. // IsDefaultImageUrl: Indicates whether the icon image being returned is
  927. // a default image, or is game-provided.
  928. IsDefaultImageUrl bool `json:"isDefaultImageUrl,omitempty"`
  929. // Kind: Uniquely identifies the type of this resource. Value is always
  930. // the fixed string games#eventDefinition.
  931. Kind string `json:"kind,omitempty"`
  932. // Visibility: The visibility of event being tracked in this
  933. // definition.
  934. // Possible values are:
  935. // - "REVEALED": This event should be visible to all users.
  936. // - "HIDDEN": This event should only be shown to users that have
  937. // recorded this event at least once.
  938. Visibility string `json:"visibility,omitempty"`
  939. // ForceSendFields is a list of field names (e.g. "ChildEvents") to
  940. // unconditionally include in API requests. By default, fields with
  941. // empty values are omitted from API requests. However, any non-pointer,
  942. // non-interface field appearing in ForceSendFields will be sent to the
  943. // server regardless of whether the field is empty or not. This may be
  944. // used to include empty fields in Patch requests.
  945. ForceSendFields []string `json:"-"`
  946. // NullFields is a list of field names (e.g. "ChildEvents") to include
  947. // in API requests with the JSON null value. By default, fields with
  948. // empty values are omitted from API requests. However, any field with
  949. // an empty value appearing in NullFields will be sent to the server as
  950. // null. It is an error if a field in this list has a non-empty value.
  951. // This may be used to include null fields in Patch requests.
  952. NullFields []string `json:"-"`
  953. }
  954. func (s *EventDefinition) MarshalJSON() ([]byte, error) {
  955. type NoMethod EventDefinition
  956. raw := NoMethod(*s)
  957. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  958. }
  959. // EventDefinitionListResponse: This is a JSON template for a
  960. // ListDefinitions response.
  961. type EventDefinitionListResponse struct {
  962. // Items: The event definitions.
  963. Items []*EventDefinition `json:"items,omitempty"`
  964. // Kind: Uniquely identifies the type of this resource. Value is always
  965. // the fixed string games#eventDefinitionListResponse.
  966. Kind string `json:"kind,omitempty"`
  967. // NextPageToken: The pagination token for the next page of results.
  968. NextPageToken string `json:"nextPageToken,omitempty"`
  969. // ServerResponse contains the HTTP response code and headers from the
  970. // server.
  971. googleapi.ServerResponse `json:"-"`
  972. // ForceSendFields is a list of field names (e.g. "Items") to
  973. // unconditionally include in API requests. By default, fields with
  974. // empty values are omitted from API requests. However, any non-pointer,
  975. // non-interface field appearing in ForceSendFields will be sent to the
  976. // server regardless of whether the field is empty or not. This may be
  977. // used to include empty fields in Patch requests.
  978. ForceSendFields []string `json:"-"`
  979. // NullFields is a list of field names (e.g. "Items") to include in API
  980. // requests with the JSON null value. By default, fields with empty
  981. // values are omitted from API requests. However, any field with an
  982. // empty value appearing in NullFields will be sent to the server as
  983. // null. It is an error if a field in this list has a non-empty value.
  984. // This may be used to include null fields in Patch requests.
  985. NullFields []string `json:"-"`
  986. }
  987. func (s *EventDefinitionListResponse) MarshalJSON() ([]byte, error) {
  988. type NoMethod EventDefinitionListResponse
  989. raw := NoMethod(*s)
  990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  991. }
  992. // EventPeriodRange: This is a JSON template for an event period time
  993. // range.
  994. type EventPeriodRange struct {
  995. // Kind: Uniquely identifies the type of this resource. Value is always
  996. // the fixed string games#eventPeriodRange.
  997. Kind string `json:"kind,omitempty"`
  998. // PeriodEndMillis: The time when this update period ends, in millis,
  999. // since 1970 UTC (Unix Epoch).
  1000. PeriodEndMillis int64 `json:"periodEndMillis,omitempty,string"`
  1001. // PeriodStartMillis: The time when this update period begins, in
  1002. // millis, since 1970 UTC (Unix Epoch).
  1003. PeriodStartMillis int64 `json:"periodStartMillis,omitempty,string"`
  1004. // ForceSendFields is a list of field names (e.g. "Kind") to
  1005. // unconditionally include in API requests. By default, fields with
  1006. // empty values are omitted from API requests. However, any non-pointer,
  1007. // non-interface field appearing in ForceSendFields will be sent to the
  1008. // server regardless of whether the field is empty or not. This may be
  1009. // used to include empty fields in Patch requests.
  1010. ForceSendFields []string `json:"-"`
  1011. // NullFields is a list of field names (e.g. "Kind") to include in API
  1012. // requests with the JSON null value. By default, fields with empty
  1013. // values are omitted from API requests. However, any field with an
  1014. // empty value appearing in NullFields will be sent to the server as
  1015. // null. It is an error if a field in this list has a non-empty value.
  1016. // This may be used to include null fields in Patch requests.
  1017. NullFields []string `json:"-"`
  1018. }
  1019. func (s *EventPeriodRange) MarshalJSON() ([]byte, error) {
  1020. type NoMethod EventPeriodRange
  1021. raw := NoMethod(*s)
  1022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1023. }
  1024. // EventPeriodUpdate: This is a JSON template for an event period update
  1025. // resource.
  1026. type EventPeriodUpdate struct {
  1027. // Kind: Uniquely identifies the type of this resource. Value is always
  1028. // the fixed string games#eventPeriodUpdate.
  1029. Kind string `json:"kind,omitempty"`
  1030. // TimePeriod: The time period being covered by this update.
  1031. TimePeriod *EventPeriodRange `json:"timePeriod,omitempty"`
  1032. // Updates: The updates being made for this time period.
  1033. Updates []*EventUpdateRequest `json:"updates,omitempty"`
  1034. // ForceSendFields is a list of field names (e.g. "Kind") to
  1035. // unconditionally include in API requests. By default, fields with
  1036. // empty values are omitted from API requests. However, any non-pointer,
  1037. // non-interface field appearing in ForceSendFields will be sent to the
  1038. // server regardless of whether the field is empty or not. This may be
  1039. // used to include empty fields in Patch requests.
  1040. ForceSendFields []string `json:"-"`
  1041. // NullFields is a list of field names (e.g. "Kind") to include in API
  1042. // requests with the JSON null value. By default, fields with empty
  1043. // values are omitted from API requests. However, any field with an
  1044. // empty value appearing in NullFields will be sent to the server as
  1045. // null. It is an error if a field in this list has a non-empty value.
  1046. // This may be used to include null fields in Patch requests.
  1047. NullFields []string `json:"-"`
  1048. }
  1049. func (s *EventPeriodUpdate) MarshalJSON() ([]byte, error) {
  1050. type NoMethod EventPeriodUpdate
  1051. raw := NoMethod(*s)
  1052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1053. }
  1054. // EventRecordFailure: This is a JSON template for an event update
  1055. // failure resource.
  1056. type EventRecordFailure struct {
  1057. // EventId: The ID of the event that was not updated.
  1058. EventId string `json:"eventId,omitempty"`
  1059. // FailureCause: The cause for the update failure.
  1060. // Possible values are:
  1061. // - "NOT_FOUND" - An attempt was made to set an event that was not
  1062. // defined.
  1063. // - "INVALID_UPDATE_VALUE" - An attempt was made to increment an event
  1064. // by a non-positive value.
  1065. FailureCause string `json:"failureCause,omitempty"`
  1066. // Kind: Uniquely identifies the type of this resource. Value is always
  1067. // the fixed string games#eventRecordFailure.
  1068. Kind string `json:"kind,omitempty"`
  1069. // ForceSendFields is a list of field names (e.g. "EventId") to
  1070. // unconditionally include in API requests. By default, fields with
  1071. // empty values are omitted from API requests. However, any non-pointer,
  1072. // non-interface field appearing in ForceSendFields will be sent to the
  1073. // server regardless of whether the field is empty or not. This may be
  1074. // used to include empty fields in Patch requests.
  1075. ForceSendFields []string `json:"-"`
  1076. // NullFields is a list of field names (e.g. "EventId") to include in
  1077. // API requests with the JSON null value. By default, fields with empty
  1078. // values are omitted from API requests. However, any field with an
  1079. // empty value appearing in NullFields will be sent to the server as
  1080. // null. It is an error if a field in this list has a non-empty value.
  1081. // This may be used to include null fields in Patch requests.
  1082. NullFields []string `json:"-"`
  1083. }
  1084. func (s *EventRecordFailure) MarshalJSON() ([]byte, error) {
  1085. type NoMethod EventRecordFailure
  1086. raw := NoMethod(*s)
  1087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1088. }
  1089. // EventRecordRequest: This is a JSON template for an event period
  1090. // update resource.
  1091. type EventRecordRequest struct {
  1092. // CurrentTimeMillis: The current time when this update was sent, in
  1093. // milliseconds, since 1970 UTC (Unix Epoch).
  1094. CurrentTimeMillis int64 `json:"currentTimeMillis,omitempty,string"`
  1095. // Kind: Uniquely identifies the type of this resource. Value is always
  1096. // the fixed string games#eventRecordRequest.
  1097. Kind string `json:"kind,omitempty"`
  1098. // RequestId: The request ID used to identify this attempt to record
  1099. // events.
  1100. RequestId int64 `json:"requestId,omitempty,string"`
  1101. // TimePeriods: A list of the time period updates being made in this
  1102. // request.
  1103. TimePeriods []*EventPeriodUpdate `json:"timePeriods,omitempty"`
  1104. // ForceSendFields is a list of field names (e.g. "CurrentTimeMillis")
  1105. // to unconditionally include in API requests. By default, fields with
  1106. // empty values are omitted from API requests. However, any non-pointer,
  1107. // non-interface field appearing in ForceSendFields will be sent to the
  1108. // server regardless of whether the field is empty or not. This may be
  1109. // used to include empty fields in Patch requests.
  1110. ForceSendFields []string `json:"-"`
  1111. // NullFields is a list of field names (e.g. "CurrentTimeMillis") to
  1112. // include in API requests with the JSON null value. By default, fields
  1113. // with empty values are omitted from API requests. However, any field
  1114. // with an empty value appearing in NullFields will be sent to the
  1115. // server as null. It is an error if a field in this list has a
  1116. // non-empty value. This may be used to include null fields in Patch
  1117. // requests.
  1118. NullFields []string `json:"-"`
  1119. }
  1120. func (s *EventRecordRequest) MarshalJSON() ([]byte, error) {
  1121. type NoMethod EventRecordRequest
  1122. raw := NoMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1124. }
  1125. // EventUpdateRequest: This is a JSON template for an event period
  1126. // update resource.
  1127. type EventUpdateRequest struct {
  1128. // DefinitionId: The ID of the event being modified in this update.
  1129. DefinitionId string `json:"definitionId,omitempty"`
  1130. // Kind: Uniquely identifies the type of this resource. Value is always
  1131. // the fixed string games#eventUpdateRequest.
  1132. Kind string `json:"kind,omitempty"`
  1133. // UpdateCount: The number of times this event occurred in this time
  1134. // period.
  1135. UpdateCount int64 `json:"updateCount,omitempty,string"`
  1136. // ForceSendFields is a list of field names (e.g. "DefinitionId") to
  1137. // unconditionally include in API requests. By default, fields with
  1138. // empty values are omitted from API requests. However, any non-pointer,
  1139. // non-interface field appearing in ForceSendFields will be sent to the
  1140. // server regardless of whether the field is empty or not. This may be
  1141. // used to include empty fields in Patch requests.
  1142. ForceSendFields []string `json:"-"`
  1143. // NullFields is a list of field names (e.g. "DefinitionId") to include
  1144. // in API requests with the JSON null value. By default, fields with
  1145. // empty values are omitted from API requests. However, any field with
  1146. // an empty value appearing in NullFields will be sent to the server as
  1147. // null. It is an error if a field in this list has a non-empty value.
  1148. // This may be used to include null fields in Patch requests.
  1149. NullFields []string `json:"-"`
  1150. }
  1151. func (s *EventUpdateRequest) MarshalJSON() ([]byte, error) {
  1152. type NoMethod EventUpdateRequest
  1153. raw := NoMethod(*s)
  1154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1155. }
  1156. // EventUpdateResponse: This is a JSON template for an event period
  1157. // update resource.
  1158. type EventUpdateResponse struct {
  1159. // BatchFailures: Any batch-wide failures which occurred applying
  1160. // updates.
  1161. BatchFailures []*EventBatchRecordFailure `json:"batchFailures,omitempty"`
  1162. // EventFailures: Any failures updating a particular event.
  1163. EventFailures []*EventRecordFailure `json:"eventFailures,omitempty"`
  1164. // Kind: Uniquely identifies the type of this resource. Value is always
  1165. // the fixed string games#eventUpdateResponse.
  1166. Kind string `json:"kind,omitempty"`
  1167. // PlayerEvents: The current status of any updated events
  1168. PlayerEvents []*PlayerEvent `json:"playerEvents,omitempty"`
  1169. // ServerResponse contains the HTTP response code and headers from the
  1170. // server.
  1171. googleapi.ServerResponse `json:"-"`
  1172. // ForceSendFields is a list of field names (e.g. "BatchFailures") to
  1173. // unconditionally include in API requests. By default, fields with
  1174. // empty values are omitted from API requests. However, any non-pointer,
  1175. // non-interface field appearing in ForceSendFields will be sent to the
  1176. // server regardless of whether the field is empty or not. This may be
  1177. // used to include empty fields in Patch requests.
  1178. ForceSendFields []string `json:"-"`
  1179. // NullFields is a list of field names (e.g. "BatchFailures") to include
  1180. // in API requests with the JSON null value. By default, fields with
  1181. // empty values are omitted from API requests. However, any field with
  1182. // an empty value appearing in NullFields will be sent to the server as
  1183. // null. It is an error if a field in this list has a non-empty value.
  1184. // This may be used to include null fields in Patch requests.
  1185. NullFields []string `json:"-"`
  1186. }
  1187. func (s *EventUpdateResponse) MarshalJSON() ([]byte, error) {
  1188. type NoMethod EventUpdateResponse
  1189. raw := NoMethod(*s)
  1190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1191. }
  1192. // GamesAchievementIncrement: This is a JSON template for the payload to
  1193. // request to increment an achievement.
  1194. type GamesAchievementIncrement struct {
  1195. // Kind: Uniquely identifies the type of this resource. Value is always
  1196. // the fixed string games#GamesAchievementIncrement.
  1197. Kind string `json:"kind,omitempty"`
  1198. // RequestId: The requestId associated with an increment to an
  1199. // achievement.
  1200. RequestId int64 `json:"requestId,omitempty,string"`
  1201. // Steps: The number of steps to be incremented.
  1202. Steps int64 `json:"steps,omitempty"`
  1203. // ForceSendFields is a list of field names (e.g. "Kind") to
  1204. // unconditionally include in API requests. By default, fields with
  1205. // empty values are omitted from API requests. However, any non-pointer,
  1206. // non-interface field appearing in ForceSendFields will be sent to the
  1207. // server regardless of whether the field is empty or not. This may be
  1208. // used to include empty fields in Patch requests.
  1209. ForceSendFields []string `json:"-"`
  1210. // NullFields is a list of field names (e.g. "Kind") to include in API
  1211. // requests with the JSON null value. By default, fields with empty
  1212. // values are omitted from API requests. However, any field with an
  1213. // empty value appearing in NullFields will be sent to the server as
  1214. // null. It is an error if a field in this list has a non-empty value.
  1215. // This may be used to include null fields in Patch requests.
  1216. NullFields []string `json:"-"`
  1217. }
  1218. func (s *GamesAchievementIncrement) MarshalJSON() ([]byte, error) {
  1219. type NoMethod GamesAchievementIncrement
  1220. raw := NoMethod(*s)
  1221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1222. }
  1223. // GamesAchievementSetStepsAtLeast: This is a JSON template for the
  1224. // payload to request to increment an achievement.
  1225. type GamesAchievementSetStepsAtLeast struct {
  1226. // Kind: Uniquely identifies the type of this resource. Value is always
  1227. // the fixed string games#GamesAchievementSetStepsAtLeast.
  1228. Kind string `json:"kind,omitempty"`
  1229. // Steps: The minimum number of steps for the achievement to be set to.
  1230. Steps int64 `json:"steps,omitempty"`
  1231. // ForceSendFields is a list of field names (e.g. "Kind") to
  1232. // unconditionally include in API requests. By default, fields with
  1233. // empty values are omitted from API requests. However, any non-pointer,
  1234. // non-interface field appearing in ForceSendFields will be sent to the
  1235. // server regardless of whether the field is empty or not. This may be
  1236. // used to include empty fields in Patch requests.
  1237. ForceSendFields []string `json:"-"`
  1238. // NullFields is a list of field names (e.g. "Kind") to include in API
  1239. // requests with the JSON null value. By default, fields with empty
  1240. // values are omitted from API requests. However, any field with an
  1241. // empty value appearing in NullFields will be sent to the server as
  1242. // null. It is an error if a field in this list has a non-empty value.
  1243. // This may be used to include null fields in Patch requests.
  1244. NullFields []string `json:"-"`
  1245. }
  1246. func (s *GamesAchievementSetStepsAtLeast) MarshalJSON() ([]byte, error) {
  1247. type NoMethod GamesAchievementSetStepsAtLeast
  1248. raw := NoMethod(*s)
  1249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1250. }
  1251. // ImageAsset: This is a JSON template for an image asset object.
  1252. type ImageAsset struct {
  1253. // Height: The height of the asset.
  1254. Height int64 `json:"height,omitempty"`
  1255. // Kind: Uniquely identifies the type of this resource. Value is always
  1256. // the fixed string games#imageAsset.
  1257. Kind string `json:"kind,omitempty"`
  1258. // Name: The name of the asset.
  1259. Name string `json:"name,omitempty"`
  1260. // Url: The URL of the asset.
  1261. Url string `json:"url,omitempty"`
  1262. // Width: The width of the asset.
  1263. Width int64 `json:"width,omitempty"`
  1264. // ForceSendFields is a list of field names (e.g. "Height") to
  1265. // unconditionally include in API requests. By default, fields with
  1266. // empty values are omitted from API requests. However, any non-pointer,
  1267. // non-interface field appearing in ForceSendFields will be sent to the
  1268. // server regardless of whether the field is empty or not. This may be
  1269. // used to include empty fields in Patch requests.
  1270. ForceSendFields []string `json:"-"`
  1271. // NullFields is a list of field names (e.g. "Height") to include in API
  1272. // requests with the JSON null value. By default, fields with empty
  1273. // values are omitted from API requests. However, any field with an
  1274. // empty value appearing in NullFields will be sent to the server as
  1275. // null. It is an error if a field in this list has a non-empty value.
  1276. // This may be used to include null fields in Patch requests.
  1277. NullFields []string `json:"-"`
  1278. }
  1279. func (s *ImageAsset) MarshalJSON() ([]byte, error) {
  1280. type NoMethod ImageAsset
  1281. raw := NoMethod(*s)
  1282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1283. }
  1284. // Instance: This is a JSON template for the Instance resource.
  1285. type Instance struct {
  1286. // AcquisitionUri: URI which shows where a user can acquire this
  1287. // instance.
  1288. AcquisitionUri string `json:"acquisitionUri,omitempty"`
  1289. // AndroidInstance: Platform dependent details for Android.
  1290. AndroidInstance *InstanceAndroidDetails `json:"androidInstance,omitempty"`
  1291. // IosInstance: Platform dependent details for iOS.
  1292. IosInstance *InstanceIosDetails `json:"iosInstance,omitempty"`
  1293. // Kind: Uniquely identifies the type of this resource. Value is always
  1294. // the fixed string games#instance.
  1295. Kind string `json:"kind,omitempty"`
  1296. // Name: Localized display name.
  1297. Name string `json:"name,omitempty"`
  1298. // PlatformType: The platform type.
  1299. // Possible values are:
  1300. // - "ANDROID" - Instance is for Android.
  1301. // - "IOS" - Instance is for iOS
  1302. // - "WEB_APP" - Instance is for Web App.
  1303. PlatformType string `json:"platformType,omitempty"`
  1304. // RealtimePlay: Flag to show if this game instance supports realtime
  1305. // play.
  1306. RealtimePlay bool `json:"realtimePlay,omitempty"`
  1307. // TurnBasedPlay: Flag to show if this game instance supports turn based
  1308. // play.
  1309. TurnBasedPlay bool `json:"turnBasedPlay,omitempty"`
  1310. // WebInstance: Platform dependent details for Web.
  1311. WebInstance *InstanceWebDetails `json:"webInstance,omitempty"`
  1312. // ForceSendFields is a list of field names (e.g. "AcquisitionUri") to
  1313. // unconditionally include in API requests. By default, fields with
  1314. // empty values are omitted from API requests. However, any non-pointer,
  1315. // non-interface field appearing in ForceSendFields will be sent to the
  1316. // server regardless of whether the field is empty or not. This may be
  1317. // used to include empty fields in Patch requests.
  1318. ForceSendFields []string `json:"-"`
  1319. // NullFields is a list of field names (e.g. "AcquisitionUri") to
  1320. // include in API requests with the JSON null value. By default, fields
  1321. // with empty values are omitted from API requests. However, any field
  1322. // with an empty value appearing in NullFields will be sent to the
  1323. // server as null. It is an error if a field in this list has a
  1324. // non-empty value. This may be used to include null fields in Patch
  1325. // requests.
  1326. NullFields []string `json:"-"`
  1327. }
  1328. func (s *Instance) MarshalJSON() ([]byte, error) {
  1329. type NoMethod Instance
  1330. raw := NoMethod(*s)
  1331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1332. }
  1333. // InstanceAndroidDetails: This is a JSON template for the Android
  1334. // instance details resource.
  1335. type InstanceAndroidDetails struct {
  1336. // EnablePiracyCheck: Flag indicating whether the anti-piracy check is
  1337. // enabled.
  1338. EnablePiracyCheck bool `json:"enablePiracyCheck,omitempty"`
  1339. // Kind: Uniquely identifies the type of this resource. Value is always
  1340. // the fixed string games#instanceAndroidDetails.
  1341. Kind string `json:"kind,omitempty"`
  1342. // PackageName: Android package name which maps to Google Play URL.
  1343. PackageName string `json:"packageName,omitempty"`
  1344. // Preferred: Indicates that this instance is the default for new
  1345. // installations.
  1346. Preferred bool `json:"preferred,omitempty"`
  1347. // ForceSendFields is a list of field names (e.g. "EnablePiracyCheck")
  1348. // to unconditionally include in API requests. By default, fields with
  1349. // empty values are omitted from API requests. However, any non-pointer,
  1350. // non-interface field appearing in ForceSendFields will be sent to the
  1351. // server regardless of whether the field is empty or not. This may be
  1352. // used to include empty fields in Patch requests.
  1353. ForceSendFields []string `json:"-"`
  1354. // NullFields is a list of field names (e.g. "EnablePiracyCheck") to
  1355. // include in API requests with the JSON null value. By default, fields
  1356. // with empty values are omitted from API requests. However, any field
  1357. // with an empty value appearing in NullFields will be sent to the
  1358. // server as null. It is an error if a field in this list has a
  1359. // non-empty value. This may be used to include null fields in Patch
  1360. // requests.
  1361. NullFields []string `json:"-"`
  1362. }
  1363. func (s *InstanceAndroidDetails) MarshalJSON() ([]byte, error) {
  1364. type NoMethod InstanceAndroidDetails
  1365. raw := NoMethod(*s)
  1366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1367. }
  1368. // InstanceIosDetails: This is a JSON template for the iOS details
  1369. // resource.
  1370. type InstanceIosDetails struct {
  1371. // BundleIdentifier: Bundle identifier.
  1372. BundleIdentifier string `json:"bundleIdentifier,omitempty"`
  1373. // ItunesAppId: iTunes App ID.
  1374. ItunesAppId string `json:"itunesAppId,omitempty"`
  1375. // Kind: Uniquely identifies the type of this resource. Value is always
  1376. // the fixed string games#instanceIosDetails.
  1377. Kind string `json:"kind,omitempty"`
  1378. // PreferredForIpad: Indicates that this instance is the default for new
  1379. // installations on iPad devices.
  1380. PreferredForIpad bool `json:"preferredForIpad,omitempty"`
  1381. // PreferredForIphone: Indicates that this instance is the default for
  1382. // new installations on iPhone devices.
  1383. PreferredForIphone bool `json:"preferredForIphone,omitempty"`
  1384. // SupportIpad: Flag to indicate if this instance supports iPad.
  1385. SupportIpad bool `json:"supportIpad,omitempty"`
  1386. // SupportIphone: Flag to indicate if this instance supports iPhone.
  1387. SupportIphone bool `json:"supportIphone,omitempty"`
  1388. // ForceSendFields is a list of field names (e.g. "BundleIdentifier") to
  1389. // unconditionally include in API requests. By default, fields with
  1390. // empty values are omitted from API requests. However, any non-pointer,
  1391. // non-interface field appearing in ForceSendFields will be sent to the
  1392. // server regardless of whether the field is empty or not. This may be
  1393. // used to include empty fields in Patch requests.
  1394. ForceSendFields []string `json:"-"`
  1395. // NullFields is a list of field names (e.g. "BundleIdentifier") to
  1396. // include in API requests with the JSON null value. By default, fields
  1397. // with empty values are omitted from API requests. However, any field
  1398. // with an empty value appearing in NullFields will be sent to the
  1399. // server as null. It is an error if a field in this list has a
  1400. // non-empty value. This may be used to include null fields in Patch
  1401. // requests.
  1402. NullFields []string `json:"-"`
  1403. }
  1404. func (s *InstanceIosDetails) MarshalJSON() ([]byte, error) {
  1405. type NoMethod InstanceIosDetails
  1406. raw := NoMethod(*s)
  1407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1408. }
  1409. // InstanceWebDetails: This is a JSON template for the Web details
  1410. // resource.
  1411. type InstanceWebDetails struct {
  1412. // Kind: Uniquely identifies the type of this resource. Value is always
  1413. // the fixed string games#instanceWebDetails.
  1414. Kind string `json:"kind,omitempty"`
  1415. // LaunchUrl: Launch URL for the game.
  1416. LaunchUrl string `json:"launchUrl,omitempty"`
  1417. // Preferred: Indicates that this instance is the default for new
  1418. // installations.
  1419. Preferred bool `json:"preferred,omitempty"`
  1420. // ForceSendFields is a list of field names (e.g. "Kind") to
  1421. // unconditionally include in API requests. By default, fields with
  1422. // empty values are omitted from API requests. However, any non-pointer,
  1423. // non-interface field appearing in ForceSendFields will be sent to the
  1424. // server regardless of whether the field is empty or not. This may be
  1425. // used to include empty fields in Patch requests.
  1426. ForceSendFields []string `json:"-"`
  1427. // NullFields is a list of field names (e.g. "Kind") to include in API
  1428. // requests with the JSON null value. By default, fields with empty
  1429. // values are omitted from API requests. However, any field with an
  1430. // empty value appearing in NullFields will be sent to the server as
  1431. // null. It is an error if a field in this list has a non-empty value.
  1432. // This may be used to include null fields in Patch requests.
  1433. NullFields []string `json:"-"`
  1434. }
  1435. func (s *InstanceWebDetails) MarshalJSON() ([]byte, error) {
  1436. type NoMethod InstanceWebDetails
  1437. raw := NoMethod(*s)
  1438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1439. }
  1440. // Leaderboard: This is a JSON template for the Leaderboard resource.
  1441. type Leaderboard struct {
  1442. // IconUrl: The icon for the leaderboard.
  1443. IconUrl string `json:"iconUrl,omitempty"`
  1444. // Id: The leaderboard ID.
  1445. Id string `json:"id,omitempty"`
  1446. // IsIconUrlDefault: Indicates whether the icon image being returned is
  1447. // a default image, or is game-provided.
  1448. IsIconUrlDefault bool `json:"isIconUrlDefault,omitempty"`
  1449. // Kind: Uniquely identifies the type of this resource. Value is always
  1450. // the fixed string games#leaderboard.
  1451. Kind string `json:"kind,omitempty"`
  1452. // Name: The name of the leaderboard.
  1453. Name string `json:"name,omitempty"`
  1454. // Order: How scores are ordered.
  1455. // Possible values are:
  1456. // - "LARGER_IS_BETTER" - Larger values are better; scores are sorted in
  1457. // descending order.
  1458. // - "SMALLER_IS_BETTER" - Smaller values are better; scores are sorted
  1459. // in ascending order.
  1460. Order string `json:"order,omitempty"`
  1461. // ServerResponse contains the HTTP response code and headers from the
  1462. // server.
  1463. googleapi.ServerResponse `json:"-"`
  1464. // ForceSendFields is a list of field names (e.g. "IconUrl") to
  1465. // unconditionally include in API requests. By default, fields with
  1466. // empty values are omitted from API requests. However, any non-pointer,
  1467. // non-interface field appearing in ForceSendFields will be sent to the
  1468. // server regardless of whether the field is empty or not. This may be
  1469. // used to include empty fields in Patch requests.
  1470. ForceSendFields []string `json:"-"`
  1471. // NullFields is a list of field names (e.g. "IconUrl") to include in
  1472. // API requests with the JSON null value. By default, fields with empty
  1473. // values are omitted from API requests. However, any field with an
  1474. // empty value appearing in NullFields will be sent to the server as
  1475. // null. It is an error if a field in this list has a non-empty value.
  1476. // This may be used to include null fields in Patch requests.
  1477. NullFields []string `json:"-"`
  1478. }
  1479. func (s *Leaderboard) MarshalJSON() ([]byte, error) {
  1480. type NoMethod Leaderboard
  1481. raw := NoMethod(*s)
  1482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1483. }
  1484. // LeaderboardEntry: This is a JSON template for the Leaderboard Entry
  1485. // resource.
  1486. type LeaderboardEntry struct {
  1487. // FormattedScore: The localized string for the numerical value of this
  1488. // score.
  1489. FormattedScore string `json:"formattedScore,omitempty"`
  1490. // FormattedScoreRank: The localized string for the rank of this score
  1491. // for this leaderboard.
  1492. FormattedScoreRank string `json:"formattedScoreRank,omitempty"`
  1493. // Kind: Uniquely identifies the type of this resource. Value is always
  1494. // the fixed string games#leaderboardEntry.
  1495. Kind string `json:"kind,omitempty"`
  1496. // Player: The player who holds this score.
  1497. Player *Player `json:"player,omitempty"`
  1498. // ScoreRank: The rank of this score for this leaderboard.
  1499. ScoreRank int64 `json:"scoreRank,omitempty,string"`
  1500. // ScoreTag: Additional information about the score. Values must contain
  1501. // no more than 64 URI-safe characters as defined by section 2.3 of RFC
  1502. // 3986.
  1503. ScoreTag string `json:"scoreTag,omitempty"`
  1504. // ScoreValue: The numerical value of this score.
  1505. ScoreValue int64 `json:"scoreValue,omitempty,string"`
  1506. // TimeSpan: The time span of this high score.
  1507. // Possible values are:
  1508. // - "ALL_TIME" - The score is an all-time high score.
  1509. // - "WEEKLY" - The score is a weekly high score.
  1510. // - "DAILY" - The score is a daily high score.
  1511. TimeSpan string `json:"timeSpan,omitempty"`
  1512. // WriteTimestampMillis: The timestamp at which this score was recorded,
  1513. // in milliseconds since the epoch in UTC.
  1514. WriteTimestampMillis int64 `json:"writeTimestampMillis,omitempty,string"`
  1515. // ForceSendFields is a list of field names (e.g. "FormattedScore") to
  1516. // unconditionally include in API requests. By default, fields with
  1517. // empty values are omitted from API requests. However, any non-pointer,
  1518. // non-interface field appearing in ForceSendFields will be sent to the
  1519. // server regardless of whether the field is empty or not. This may be
  1520. // used to include empty fields in Patch requests.
  1521. ForceSendFields []string `json:"-"`
  1522. // NullFields is a list of field names (e.g. "FormattedScore") to
  1523. // include in API requests with the JSON null value. By default, fields
  1524. // with empty values are omitted from API requests. However, any field
  1525. // with an empty value appearing in NullFields will be sent to the
  1526. // server as null. It is an error if a field in this list has a
  1527. // non-empty value. This may be used to include null fields in Patch
  1528. // requests.
  1529. NullFields []string `json:"-"`
  1530. }
  1531. func (s *LeaderboardEntry) MarshalJSON() ([]byte, error) {
  1532. type NoMethod LeaderboardEntry
  1533. raw := NoMethod(*s)
  1534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1535. }
  1536. // LeaderboardListResponse: This is a JSON template for a list of
  1537. // leaderboard objects.
  1538. type LeaderboardListResponse struct {
  1539. // Items: The leaderboards.
  1540. Items []*Leaderboard `json:"items,omitempty"`
  1541. // Kind: Uniquely identifies the type of this resource. Value is always
  1542. // the fixed string games#leaderboardListResponse.
  1543. Kind string `json:"kind,omitempty"`
  1544. // NextPageToken: Token corresponding to the next page of results.
  1545. NextPageToken string `json:"nextPageToken,omitempty"`
  1546. // ServerResponse contains the HTTP response code and headers from the
  1547. // server.
  1548. googleapi.ServerResponse `json:"-"`
  1549. // ForceSendFields is a list of field names (e.g. "Items") to
  1550. // unconditionally include in API requests. By default, fields with
  1551. // empty values are omitted from API requests. However, any non-pointer,
  1552. // non-interface field appearing in ForceSendFields will be sent to the
  1553. // server regardless of whether the field is empty or not. This may be
  1554. // used to include empty fields in Patch requests.
  1555. ForceSendFields []string `json:"-"`
  1556. // NullFields is a list of field names (e.g. "Items") to include in API
  1557. // requests with the JSON null value. By default, fields with empty
  1558. // values are omitted from API requests. However, any field with an
  1559. // empty value appearing in NullFields will be sent to the server as
  1560. // null. It is an error if a field in this list has a non-empty value.
  1561. // This may be used to include null fields in Patch requests.
  1562. NullFields []string `json:"-"`
  1563. }
  1564. func (s *LeaderboardListResponse) MarshalJSON() ([]byte, error) {
  1565. type NoMethod LeaderboardListResponse
  1566. raw := NoMethod(*s)
  1567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1568. }
  1569. // LeaderboardScoreRank: This is a JSON template for a score rank in a
  1570. // leaderboard.
  1571. type LeaderboardScoreRank struct {
  1572. // FormattedNumScores: The number of scores in the leaderboard as a
  1573. // string.
  1574. FormattedNumScores string `json:"formattedNumScores,omitempty"`
  1575. // FormattedRank: The rank in the leaderboard as a string.
  1576. FormattedRank string `json:"formattedRank,omitempty"`
  1577. // Kind: Uniquely identifies the type of this resource. Value is always
  1578. // the fixed string games#leaderboardScoreRank.
  1579. Kind string `json:"kind,omitempty"`
  1580. // NumScores: The number of scores in the leaderboard.
  1581. NumScores int64 `json:"numScores,omitempty,string"`
  1582. // Rank: The rank in the leaderboard.
  1583. Rank int64 `json:"rank,omitempty,string"`
  1584. // ForceSendFields is a list of field names (e.g. "FormattedNumScores")
  1585. // to unconditionally include in API requests. By default, fields with
  1586. // empty values are omitted from API requests. However, any non-pointer,
  1587. // non-interface field appearing in ForceSendFields will be sent to the
  1588. // server regardless of whether the field is empty or not. This may be
  1589. // used to include empty fields in Patch requests.
  1590. ForceSendFields []string `json:"-"`
  1591. // NullFields is a list of field names (e.g. "FormattedNumScores") to
  1592. // include in API requests with the JSON null value. By default, fields
  1593. // with empty values are omitted from API requests. However, any field
  1594. // with an empty value appearing in NullFields will be sent to the
  1595. // server as null. It is an error if a field in this list has a
  1596. // non-empty value. This may be used to include null fields in Patch
  1597. // requests.
  1598. NullFields []string `json:"-"`
  1599. }
  1600. func (s *LeaderboardScoreRank) MarshalJSON() ([]byte, error) {
  1601. type NoMethod LeaderboardScoreRank
  1602. raw := NoMethod(*s)
  1603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1604. }
  1605. // LeaderboardScores: This is a JSON template for a ListScores response.
  1606. type LeaderboardScores struct {
  1607. // Items: The scores in the leaderboard.
  1608. Items []*LeaderboardEntry `json:"items,omitempty"`
  1609. // Kind: Uniquely identifies the type of this resource. Value is always
  1610. // the fixed string games#leaderboardScores.
  1611. Kind string `json:"kind,omitempty"`
  1612. // NextPageToken: The pagination token for the next page of results.
  1613. NextPageToken string `json:"nextPageToken,omitempty"`
  1614. // NumScores: The total number of scores in the leaderboard.
  1615. NumScores int64 `json:"numScores,omitempty,string"`
  1616. // PlayerScore: The score of the requesting player on the leaderboard.
  1617. // The player's score may appear both here and in the list of scores
  1618. // above. If you are viewing a public leaderboard and the player is not
  1619. // sharing their gameplay information publicly, the scoreRank and
  1620. // formattedScoreRank values will not be present.
  1621. PlayerScore *LeaderboardEntry `json:"playerScore,omitempty"`
  1622. // PrevPageToken: The pagination token for the previous page of results.
  1623. PrevPageToken string `json:"prevPageToken,omitempty"`
  1624. // ServerResponse contains the HTTP response code and headers from the
  1625. // server.
  1626. googleapi.ServerResponse `json:"-"`
  1627. // ForceSendFields is a list of field names (e.g. "Items") to
  1628. // unconditionally include in API requests. By default, fields with
  1629. // empty values are omitted from API requests. However, any non-pointer,
  1630. // non-interface field appearing in ForceSendFields will be sent to the
  1631. // server regardless of whether the field is empty or not. This may be
  1632. // used to include empty fields in Patch requests.
  1633. ForceSendFields []string `json:"-"`
  1634. // NullFields is a list of field names (e.g. "Items") to include in API
  1635. // requests with the JSON null value. By default, fields with empty
  1636. // values are omitted from API requests. However, any field with an
  1637. // empty value appearing in NullFields will be sent to the server as
  1638. // null. It is an error if a field in this list has a non-empty value.
  1639. // This may be used to include null fields in Patch requests.
  1640. NullFields []string `json:"-"`
  1641. }
  1642. func (s *LeaderboardScores) MarshalJSON() ([]byte, error) {
  1643. type NoMethod LeaderboardScores
  1644. raw := NoMethod(*s)
  1645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1646. }
  1647. // MetagameConfig: This is a JSON template for the metagame config
  1648. // resource
  1649. type MetagameConfig struct {
  1650. // CurrentVersion: Current version of the metagame configuration data.
  1651. // When this data is updated, the version number will be increased by
  1652. // one.
  1653. CurrentVersion int64 `json:"currentVersion,omitempty"`
  1654. // Kind: Uniquely identifies the type of this resource. Value is always
  1655. // the fixed string games#metagameConfig.
  1656. Kind string `json:"kind,omitempty"`
  1657. // PlayerLevels: The list of player levels.
  1658. PlayerLevels []*PlayerLevel `json:"playerLevels,omitempty"`
  1659. // ServerResponse contains the HTTP response code and headers from the
  1660. // server.
  1661. googleapi.ServerResponse `json:"-"`
  1662. // ForceSendFields is a list of field names (e.g. "CurrentVersion") to
  1663. // unconditionally include in API requests. By default, fields with
  1664. // empty values are omitted from API requests. However, any non-pointer,
  1665. // non-interface field appearing in ForceSendFields will be sent to the
  1666. // server regardless of whether the field is empty or not. This may be
  1667. // used to include empty fields in Patch requests.
  1668. ForceSendFields []string `json:"-"`
  1669. // NullFields is a list of field names (e.g. "CurrentVersion") to
  1670. // include in API requests with the JSON null value. By default, fields
  1671. // with empty values are omitted from API requests. However, any field
  1672. // with an empty value appearing in NullFields will be sent to the
  1673. // server as null. It is an error if a field in this list has a
  1674. // non-empty value. This may be used to include null fields in Patch
  1675. // requests.
  1676. NullFields []string `json:"-"`
  1677. }
  1678. func (s *MetagameConfig) MarshalJSON() ([]byte, error) {
  1679. type NoMethod MetagameConfig
  1680. raw := NoMethod(*s)
  1681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1682. }
  1683. // NetworkDiagnostics: This is a JSON template for network diagnostics
  1684. // reported for a client.
  1685. type NetworkDiagnostics struct {
  1686. // AndroidNetworkSubtype: The Android network subtype.
  1687. AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"`
  1688. // AndroidNetworkType: The Android network type.
  1689. AndroidNetworkType int64 `json:"androidNetworkType,omitempty"`
  1690. // IosNetworkType: iOS network type as defined in Reachability.h.
  1691. IosNetworkType int64 `json:"iosNetworkType,omitempty"`
  1692. // Kind: Uniquely identifies the type of this resource. Value is always
  1693. // the fixed string games#networkDiagnostics.
  1694. Kind string `json:"kind,omitempty"`
  1695. // NetworkOperatorCode: The MCC+MNC code for the client's network
  1696. // connection. On Android:
  1697. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see:
  1698. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
  1699. NetworkOperatorCode string `json:"networkOperatorCode,omitempty"`
  1700. // NetworkOperatorName: The name of the carrier of the client's network
  1701. // connection. On Android:
  1702. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS:
  1703. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
  1704. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  1705. // RegistrationLatencyMillis: The amount of time in milliseconds it took
  1706. // for the client to establish a connection with the XMPP server.
  1707. RegistrationLatencyMillis int64 `json:"registrationLatencyMillis,omitempty"`
  1708. // ForceSendFields is a list of field names (e.g.
  1709. // "AndroidNetworkSubtype") to unconditionally include in API requests.
  1710. // By default, fields with empty values are omitted from API requests.
  1711. // However, any non-pointer, non-interface field appearing in
  1712. // ForceSendFields will be sent to the server regardless of whether the
  1713. // field is empty or not. This may be used to include empty fields in
  1714. // Patch requests.
  1715. ForceSendFields []string `json:"-"`
  1716. // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to
  1717. // include in API requests with the JSON null value. By default, fields
  1718. // with empty values are omitted from API requests. However, any field
  1719. // with an empty value appearing in NullFields will be sent to the
  1720. // server as null. It is an error if a field in this list has a
  1721. // non-empty value. This may be used to include null fields in Patch
  1722. // requests.
  1723. NullFields []string `json:"-"`
  1724. }
  1725. func (s *NetworkDiagnostics) MarshalJSON() ([]byte, error) {
  1726. type NoMethod NetworkDiagnostics
  1727. raw := NoMethod(*s)
  1728. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1729. }
  1730. // ParticipantResult: This is a JSON template for a result for a match
  1731. // participant.
  1732. type ParticipantResult struct {
  1733. // Kind: Uniquely identifies the type of this resource. Value is always
  1734. // the fixed string games#participantResult.
  1735. Kind string `json:"kind,omitempty"`
  1736. // ParticipantId: The ID of the participant.
  1737. ParticipantId string `json:"participantId,omitempty"`
  1738. // Placing: The placement or ranking of the participant in the match
  1739. // results; a number from one to the number of participants in the
  1740. // match. Multiple participants may have the same placing value in case
  1741. // of a type.
  1742. Placing int64 `json:"placing,omitempty"`
  1743. // Result: The result of the participant for this match.
  1744. // Possible values are:
  1745. // - "MATCH_RESULT_WIN" - The participant won the match.
  1746. // - "MATCH_RESULT_LOSS" - The participant lost the match.
  1747. // - "MATCH_RESULT_TIE" - The participant tied the match.
  1748. // - "MATCH_RESULT_NONE" - There was no winner for the match (nobody
  1749. // wins or loses this kind of game.)
  1750. // - "MATCH_RESULT_DISCONNECT" - The participant disconnected / left
  1751. // during the match.
  1752. // - "MATCH_RESULT_DISAGREED" - Different clients reported different
  1753. // results for this participant.
  1754. Result string `json:"result,omitempty"`
  1755. // ForceSendFields is a list of field names (e.g. "Kind") to
  1756. // unconditionally include in API requests. By default, fields with
  1757. // empty values are omitted from API requests. However, any non-pointer,
  1758. // non-interface field appearing in ForceSendFields will be sent to the
  1759. // server regardless of whether the field is empty or not. This may be
  1760. // used to include empty fields in Patch requests.
  1761. ForceSendFields []string `json:"-"`
  1762. // NullFields is a list of field names (e.g. "Kind") to include in API
  1763. // requests with the JSON null value. By default, fields with empty
  1764. // values are omitted from API requests. However, any field with an
  1765. // empty value appearing in NullFields will be sent to the server as
  1766. // null. It is an error if a field in this list has a non-empty value.
  1767. // This may be used to include null fields in Patch requests.
  1768. NullFields []string `json:"-"`
  1769. }
  1770. func (s *ParticipantResult) MarshalJSON() ([]byte, error) {
  1771. type NoMethod ParticipantResult
  1772. raw := NoMethod(*s)
  1773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1774. }
  1775. // PeerChannelDiagnostics: This is a JSON template for peer channel
  1776. // diagnostics.
  1777. type PeerChannelDiagnostics struct {
  1778. // BytesReceived: Number of bytes received.
  1779. BytesReceived *AggregateStats `json:"bytesReceived,omitempty"`
  1780. // BytesSent: Number of bytes sent.
  1781. BytesSent *AggregateStats `json:"bytesSent,omitempty"`
  1782. // Kind: Uniquely identifies the type of this resource. Value is always
  1783. // the fixed string games#peerChannelDiagnostics.
  1784. Kind string `json:"kind,omitempty"`
  1785. // NumMessagesLost: Number of messages lost.
  1786. NumMessagesLost int64 `json:"numMessagesLost,omitempty"`
  1787. // NumMessagesReceived: Number of messages received.
  1788. NumMessagesReceived int64 `json:"numMessagesReceived,omitempty"`
  1789. // NumMessagesSent: Number of messages sent.
  1790. NumMessagesSent int64 `json:"numMessagesSent,omitempty"`
  1791. // NumSendFailures: Number of send failures.
  1792. NumSendFailures int64 `json:"numSendFailures,omitempty"`
  1793. // RoundtripLatencyMillis: Roundtrip latency stats in milliseconds.
  1794. RoundtripLatencyMillis *AggregateStats `json:"roundtripLatencyMillis,omitempty"`
  1795. // ForceSendFields is a list of field names (e.g. "BytesReceived") to
  1796. // unconditionally include in API requests. By default, fields with
  1797. // empty values are omitted from API requests. However, any non-pointer,
  1798. // non-interface field appearing in ForceSendFields will be sent to the
  1799. // server regardless of whether the field is empty or not. This may be
  1800. // used to include empty fields in Patch requests.
  1801. ForceSendFields []string `json:"-"`
  1802. // NullFields is a list of field names (e.g. "BytesReceived") to include
  1803. // in API requests with the JSON null value. By default, fields with
  1804. // empty values are omitted from API requests. However, any field with
  1805. // an empty value appearing in NullFields will be sent to the server as
  1806. // null. It is an error if a field in this list has a non-empty value.
  1807. // This may be used to include null fields in Patch requests.
  1808. NullFields []string `json:"-"`
  1809. }
  1810. func (s *PeerChannelDiagnostics) MarshalJSON() ([]byte, error) {
  1811. type NoMethod PeerChannelDiagnostics
  1812. raw := NoMethod(*s)
  1813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1814. }
  1815. // PeerSessionDiagnostics: This is a JSON template for peer session
  1816. // diagnostics.
  1817. type PeerSessionDiagnostics struct {
  1818. // ConnectedTimestampMillis: Connected time in milliseconds.
  1819. ConnectedTimestampMillis int64 `json:"connectedTimestampMillis,omitempty,string"`
  1820. // Kind: Uniquely identifies the type of this resource. Value is always
  1821. // the fixed string games#peerSessionDiagnostics.
  1822. Kind string `json:"kind,omitempty"`
  1823. // ParticipantId: The participant ID of the peer.
  1824. ParticipantId string `json:"participantId,omitempty"`
  1825. // ReliableChannel: Reliable channel diagnostics.
  1826. ReliableChannel *PeerChannelDiagnostics `json:"reliableChannel,omitempty"`
  1827. // UnreliableChannel: Unreliable channel diagnostics.
  1828. UnreliableChannel *PeerChannelDiagnostics `json:"unreliableChannel,omitempty"`
  1829. // ForceSendFields is a list of field names (e.g.
  1830. // "ConnectedTimestampMillis") to unconditionally include in API
  1831. // requests. By default, fields with empty values are omitted from API
  1832. // requests. However, any non-pointer, non-interface field appearing in
  1833. // ForceSendFields will be sent to the server regardless of whether the
  1834. // field is empty or not. This may be used to include empty fields in
  1835. // Patch requests.
  1836. ForceSendFields []string `json:"-"`
  1837. // NullFields is a list of field names (e.g. "ConnectedTimestampMillis")
  1838. // to include in API requests with the JSON null value. By default,
  1839. // fields with empty values are omitted from API requests. However, any
  1840. // field with an empty value appearing in NullFields will be sent to the
  1841. // server as null. It is an error if a field in this list has a
  1842. // non-empty value. This may be used to include null fields in Patch
  1843. // requests.
  1844. NullFields []string `json:"-"`
  1845. }
  1846. func (s *PeerSessionDiagnostics) MarshalJSON() ([]byte, error) {
  1847. type NoMethod PeerSessionDiagnostics
  1848. raw := NoMethod(*s)
  1849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1850. }
  1851. // Played: This is a JSON template for metadata about a player playing a
  1852. // game with the currently authenticated user.
  1853. type Played struct {
  1854. // AutoMatched: True if the player was auto-matched with the currently
  1855. // authenticated user.
  1856. AutoMatched bool `json:"autoMatched,omitempty"`
  1857. // Kind: Uniquely identifies the type of this resource. Value is always
  1858. // the fixed string games#played.
  1859. Kind string `json:"kind,omitempty"`
  1860. // TimeMillis: The last time the player played the game in milliseconds
  1861. // since the epoch in UTC.
  1862. TimeMillis int64 `json:"timeMillis,omitempty,string"`
  1863. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  1864. // unconditionally include in API requests. By default, fields with
  1865. // empty values are omitted from API requests. However, any non-pointer,
  1866. // non-interface field appearing in ForceSendFields will be sent to the
  1867. // server regardless of whether the field is empty or not. This may be
  1868. // used to include empty fields in Patch requests.
  1869. ForceSendFields []string `json:"-"`
  1870. // NullFields is a list of field names (e.g. "AutoMatched") to include
  1871. // in API requests with the JSON null value. By default, fields with
  1872. // empty values are omitted from API requests. However, any field with
  1873. // an empty value appearing in NullFields will be sent to the server as
  1874. // null. It is an error if a field in this list has a non-empty value.
  1875. // This may be used to include null fields in Patch requests.
  1876. NullFields []string `json:"-"`
  1877. }
  1878. func (s *Played) MarshalJSON() ([]byte, error) {
  1879. type NoMethod Played
  1880. raw := NoMethod(*s)
  1881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1882. }
  1883. // Player: This is a JSON template for a Player resource.
  1884. type Player struct {
  1885. // AvatarImageUrl: The base URL for the image that represents the
  1886. // player.
  1887. AvatarImageUrl string `json:"avatarImageUrl,omitempty"`
  1888. // BannerUrlLandscape: The url to the landscape mode player banner
  1889. // image.
  1890. BannerUrlLandscape string `json:"bannerUrlLandscape,omitempty"`
  1891. // BannerUrlPortrait: The url to the portrait mode player banner image.
  1892. BannerUrlPortrait string `json:"bannerUrlPortrait,omitempty"`
  1893. // DisplayName: The name to display for the player.
  1894. DisplayName string `json:"displayName,omitempty"`
  1895. // ExperienceInfo: An object to represent Play Game experience
  1896. // information for the player.
  1897. ExperienceInfo *PlayerExperienceInfo `json:"experienceInfo,omitempty"`
  1898. // Kind: Uniquely identifies the type of this resource. Value is always
  1899. // the fixed string games#player.
  1900. Kind string `json:"kind,omitempty"`
  1901. // LastPlayedWith: Details about the last time this player played a
  1902. // multiplayer game with the currently authenticated player. Populated
  1903. // for PLAYED_WITH player collection members.
  1904. LastPlayedWith *Played `json:"lastPlayedWith,omitempty"`
  1905. // Name: An object representation of the individual components of the
  1906. // player's name. For some players, these fields may not be present.
  1907. Name *PlayerName `json:"name,omitempty"`
  1908. // OriginalPlayerId: The player ID that was used for this player the
  1909. // first time they signed into the game in question. This is only
  1910. // populated for calls to player.get for the requesting player, only if
  1911. // the player ID has subsequently changed, and only to clients that
  1912. // support remapping player IDs.
  1913. OriginalPlayerId string `json:"originalPlayerId,omitempty"`
  1914. // PlayerId: The ID of the player.
  1915. PlayerId string `json:"playerId,omitempty"`
  1916. // ProfileSettings: The player's profile settings. Controls whether or
  1917. // not the player's profile is visible to other players.
  1918. ProfileSettings *ProfileSettings `json:"profileSettings,omitempty"`
  1919. // Title: The player's title rewarded for their game activities.
  1920. Title string `json:"title,omitempty"`
  1921. // ServerResponse contains the HTTP response code and headers from the
  1922. // server.
  1923. googleapi.ServerResponse `json:"-"`
  1924. // ForceSendFields is a list of field names (e.g. "AvatarImageUrl") to
  1925. // unconditionally include in API requests. By default, fields with
  1926. // empty values are omitted from API requests. However, any non-pointer,
  1927. // non-interface field appearing in ForceSendFields will be sent to the
  1928. // server regardless of whether the field is empty or not. This may be
  1929. // used to include empty fields in Patch requests.
  1930. ForceSendFields []string `json:"-"`
  1931. // NullFields is a list of field names (e.g. "AvatarImageUrl") to
  1932. // include in API requests with the JSON null value. By default, fields
  1933. // with empty values are omitted from API requests. However, any field
  1934. // with an empty value appearing in NullFields will be sent to the
  1935. // server as null. It is an error if a field in this list has a
  1936. // non-empty value. This may be used to include null fields in Patch
  1937. // requests.
  1938. NullFields []string `json:"-"`
  1939. }
  1940. func (s *Player) MarshalJSON() ([]byte, error) {
  1941. type NoMethod Player
  1942. raw := NoMethod(*s)
  1943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1944. }
  1945. // PlayerName: An object representation of the individual components of
  1946. // the player's name. For some players, these fields may not be present.
  1947. type PlayerName struct {
  1948. // FamilyName: The family name of this player. In some places, this is
  1949. // known as the last name.
  1950. FamilyName string `json:"familyName,omitempty"`
  1951. // GivenName: The given name of this player. In some places, this is
  1952. // known as the first name.
  1953. GivenName string `json:"givenName,omitempty"`
  1954. // ForceSendFields is a list of field names (e.g. "FamilyName") to
  1955. // unconditionally include in API requests. By default, fields with
  1956. // empty values are omitted from API requests. However, any non-pointer,
  1957. // non-interface field appearing in ForceSendFields will be sent to the
  1958. // server regardless of whether the field is empty or not. This may be
  1959. // used to include empty fields in Patch requests.
  1960. ForceSendFields []string `json:"-"`
  1961. // NullFields is a list of field names (e.g. "FamilyName") to include in
  1962. // API requests with the JSON null value. By default, fields with empty
  1963. // values are omitted from API requests. However, any field with an
  1964. // empty value appearing in NullFields will be sent to the server as
  1965. // null. It is an error if a field in this list has a non-empty value.
  1966. // This may be used to include null fields in Patch requests.
  1967. NullFields []string `json:"-"`
  1968. }
  1969. func (s *PlayerName) MarshalJSON() ([]byte, error) {
  1970. type NoMethod PlayerName
  1971. raw := NoMethod(*s)
  1972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1973. }
  1974. // PlayerAchievement: This is a JSON template for an achievement object.
  1975. type PlayerAchievement struct {
  1976. // AchievementState: The state of the achievement.
  1977. // Possible values are:
  1978. // - "HIDDEN" - Achievement is hidden.
  1979. // - "REVEALED" - Achievement is revealed.
  1980. // - "UNLOCKED" - Achievement is unlocked.
  1981. AchievementState string `json:"achievementState,omitempty"`
  1982. // CurrentSteps: The current steps for an incremental achievement.
  1983. CurrentSteps int64 `json:"currentSteps,omitempty"`
  1984. // ExperiencePoints: Experience points earned for the achievement. This
  1985. // field is absent for achievements that have not yet been unlocked and
  1986. // 0 for achievements that have been unlocked by testers but that are
  1987. // unpublished.
  1988. ExperiencePoints int64 `json:"experiencePoints,omitempty,string"`
  1989. // FormattedCurrentStepsString: The current steps for an incremental
  1990. // achievement as a string.
  1991. FormattedCurrentStepsString string `json:"formattedCurrentStepsString,omitempty"`
  1992. // Id: The ID of the achievement.
  1993. Id string `json:"id,omitempty"`
  1994. // Kind: Uniquely identifies the type of this resource. Value is always
  1995. // the fixed string games#playerAchievement.
  1996. Kind string `json:"kind,omitempty"`
  1997. // LastUpdatedTimestamp: The timestamp of the last modification to this
  1998. // achievement's state.
  1999. LastUpdatedTimestamp int64 `json:"lastUpdatedTimestamp,omitempty,string"`
  2000. // ForceSendFields is a list of field names (e.g. "AchievementState") to
  2001. // unconditionally include in API requests. By default, fields with
  2002. // empty values are omitted from API requests. However, any non-pointer,
  2003. // non-interface field appearing in ForceSendFields will be sent to the
  2004. // server regardless of whether the field is empty or not. This may be
  2005. // used to include empty fields in Patch requests.
  2006. ForceSendFields []string `json:"-"`
  2007. // NullFields is a list of field names (e.g. "AchievementState") to
  2008. // include in API requests with the JSON null value. By default, fields
  2009. // with empty values are omitted from API requests. However, any field
  2010. // with an empty value appearing in NullFields will be sent to the
  2011. // server as null. It is an error if a field in this list has a
  2012. // non-empty value. This may be used to include null fields in Patch
  2013. // requests.
  2014. NullFields []string `json:"-"`
  2015. }
  2016. func (s *PlayerAchievement) MarshalJSON() ([]byte, error) {
  2017. type NoMethod PlayerAchievement
  2018. raw := NoMethod(*s)
  2019. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2020. }
  2021. // PlayerAchievementListResponse: This is a JSON template for a list of
  2022. // achievement objects.
  2023. type PlayerAchievementListResponse struct {
  2024. // Items: The achievements.
  2025. Items []*PlayerAchievement `json:"items,omitempty"`
  2026. // Kind: Uniquely identifies the type of this resource. Value is always
  2027. // the fixed string games#playerAchievementListResponse.
  2028. Kind string `json:"kind,omitempty"`
  2029. // NextPageToken: Token corresponding to the next page of results.
  2030. NextPageToken string `json:"nextPageToken,omitempty"`
  2031. // ServerResponse contains the HTTP response code and headers from the
  2032. // server.
  2033. googleapi.ServerResponse `json:"-"`
  2034. // ForceSendFields is a list of field names (e.g. "Items") to
  2035. // unconditionally include in API requests. By default, fields with
  2036. // empty values are omitted from API requests. However, any non-pointer,
  2037. // non-interface field appearing in ForceSendFields will be sent to the
  2038. // server regardless of whether the field is empty or not. This may be
  2039. // used to include empty fields in Patch requests.
  2040. ForceSendFields []string `json:"-"`
  2041. // NullFields is a list of field names (e.g. "Items") to include in API
  2042. // requests with the JSON null value. By default, fields with empty
  2043. // values are omitted from API requests. However, any field with an
  2044. // empty value appearing in NullFields will be sent to the server as
  2045. // null. It is an error if a field in this list has a non-empty value.
  2046. // This may be used to include null fields in Patch requests.
  2047. NullFields []string `json:"-"`
  2048. }
  2049. func (s *PlayerAchievementListResponse) MarshalJSON() ([]byte, error) {
  2050. type NoMethod PlayerAchievementListResponse
  2051. raw := NoMethod(*s)
  2052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2053. }
  2054. // PlayerEvent: This is a JSON template for an event status resource.
  2055. type PlayerEvent struct {
  2056. // DefinitionId: The ID of the event definition.
  2057. DefinitionId string `json:"definitionId,omitempty"`
  2058. // FormattedNumEvents: The current number of times this event has
  2059. // occurred, as a string. The formatting of this string depends on the
  2060. // configuration of your event in the Play Games Developer Console.
  2061. FormattedNumEvents string `json:"formattedNumEvents,omitempty"`
  2062. // Kind: Uniquely identifies the type of this resource. Value is always
  2063. // the fixed string games#playerEvent.
  2064. Kind string `json:"kind,omitempty"`
  2065. // NumEvents: The current number of times this event has occurred.
  2066. NumEvents int64 `json:"numEvents,omitempty,string"`
  2067. // PlayerId: The ID of the player.
  2068. PlayerId string `json:"playerId,omitempty"`
  2069. // ForceSendFields is a list of field names (e.g. "DefinitionId") to
  2070. // unconditionally include in API requests. By default, fields with
  2071. // empty values are omitted from API requests. However, any non-pointer,
  2072. // non-interface field appearing in ForceSendFields will be sent to the
  2073. // server regardless of whether the field is empty or not. This may be
  2074. // used to include empty fields in Patch requests.
  2075. ForceSendFields []string `json:"-"`
  2076. // NullFields is a list of field names (e.g. "DefinitionId") to include
  2077. // in API requests with the JSON null value. By default, fields with
  2078. // empty values are omitted from API requests. However, any field with
  2079. // an empty value appearing in NullFields will be sent to the server as
  2080. // null. It is an error if a field in this list has a non-empty value.
  2081. // This may be used to include null fields in Patch requests.
  2082. NullFields []string `json:"-"`
  2083. }
  2084. func (s *PlayerEvent) MarshalJSON() ([]byte, error) {
  2085. type NoMethod PlayerEvent
  2086. raw := NoMethod(*s)
  2087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2088. }
  2089. // PlayerEventListResponse: This is a JSON template for a ListByPlayer
  2090. // response.
  2091. type PlayerEventListResponse struct {
  2092. // Items: The player events.
  2093. Items []*PlayerEvent `json:"items,omitempty"`
  2094. // Kind: Uniquely identifies the type of this resource. Value is always
  2095. // the fixed string games#playerEventListResponse.
  2096. Kind string `json:"kind,omitempty"`
  2097. // NextPageToken: The pagination token for the next page of results.
  2098. NextPageToken string `json:"nextPageToken,omitempty"`
  2099. // ServerResponse contains the HTTP response code and headers from the
  2100. // server.
  2101. googleapi.ServerResponse `json:"-"`
  2102. // ForceSendFields is a list of field names (e.g. "Items") to
  2103. // unconditionally include in API requests. By default, fields with
  2104. // empty values are omitted from API requests. However, any non-pointer,
  2105. // non-interface field appearing in ForceSendFields will be sent to the
  2106. // server regardless of whether the field is empty or not. This may be
  2107. // used to include empty fields in Patch requests.
  2108. ForceSendFields []string `json:"-"`
  2109. // NullFields is a list of field names (e.g. "Items") to include in API
  2110. // requests with the JSON null value. By default, fields with empty
  2111. // values are omitted from API requests. However, any field with an
  2112. // empty value appearing in NullFields will be sent to the server as
  2113. // null. It is an error if a field in this list has a non-empty value.
  2114. // This may be used to include null fields in Patch requests.
  2115. NullFields []string `json:"-"`
  2116. }
  2117. func (s *PlayerEventListResponse) MarshalJSON() ([]byte, error) {
  2118. type NoMethod PlayerEventListResponse
  2119. raw := NoMethod(*s)
  2120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2121. }
  2122. // PlayerExperienceInfo: This is a JSON template for 1P/3P metadata
  2123. // about the player's experience.
  2124. type PlayerExperienceInfo struct {
  2125. // CurrentExperiencePoints: The current number of experience points for
  2126. // the player.
  2127. CurrentExperiencePoints int64 `json:"currentExperiencePoints,omitempty,string"`
  2128. // CurrentLevel: The current level of the player.
  2129. CurrentLevel *PlayerLevel `json:"currentLevel,omitempty"`
  2130. // Kind: Uniquely identifies the type of this resource. Value is always
  2131. // the fixed string games#playerExperienceInfo.
  2132. Kind string `json:"kind,omitempty"`
  2133. // LastLevelUpTimestampMillis: The timestamp when the player was leveled
  2134. // up, in millis since Unix epoch UTC.
  2135. LastLevelUpTimestampMillis int64 `json:"lastLevelUpTimestampMillis,omitempty,string"`
  2136. // NextLevel: The next level of the player. If the current level is the
  2137. // maximum level, this should be same as the current level.
  2138. NextLevel *PlayerLevel `json:"nextLevel,omitempty"`
  2139. // ForceSendFields is a list of field names (e.g.
  2140. // "CurrentExperiencePoints") to unconditionally include in API
  2141. // requests. By default, fields with empty values are omitted from API
  2142. // requests. However, any non-pointer, non-interface field appearing in
  2143. // ForceSendFields will be sent to the server regardless of whether the
  2144. // field is empty or not. This may be used to include empty fields in
  2145. // Patch requests.
  2146. ForceSendFields []string `json:"-"`
  2147. // NullFields is a list of field names (e.g. "CurrentExperiencePoints")
  2148. // to include in API requests with the JSON null value. By default,
  2149. // fields with empty values are omitted from API requests. However, any
  2150. // field with an empty value appearing in NullFields will be sent to the
  2151. // server as null. It is an error if a field in this list has a
  2152. // non-empty value. This may be used to include null fields in Patch
  2153. // requests.
  2154. NullFields []string `json:"-"`
  2155. }
  2156. func (s *PlayerExperienceInfo) MarshalJSON() ([]byte, error) {
  2157. type NoMethod PlayerExperienceInfo
  2158. raw := NoMethod(*s)
  2159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2160. }
  2161. // PlayerLeaderboardScore: This is a JSON template for a player
  2162. // leaderboard score object.
  2163. type PlayerLeaderboardScore struct {
  2164. // Kind: Uniquely identifies the type of this resource. Value is always
  2165. // the fixed string games#playerLeaderboardScore.
  2166. Kind string `json:"kind,omitempty"`
  2167. // LeaderboardId: The ID of the leaderboard this score is in.
  2168. LeaderboardId string `json:"leaderboard_id,omitempty"`
  2169. // PublicRank: The public rank of the score in this leaderboard. This
  2170. // object will not be present if the user is not sharing their scores
  2171. // publicly.
  2172. PublicRank *LeaderboardScoreRank `json:"publicRank,omitempty"`
  2173. // ScoreString: The formatted value of this score.
  2174. ScoreString string `json:"scoreString,omitempty"`
  2175. // ScoreTag: Additional information about the score. Values must contain
  2176. // no more than 64 URI-safe characters as defined by section 2.3 of RFC
  2177. // 3986.
  2178. ScoreTag string `json:"scoreTag,omitempty"`
  2179. // ScoreValue: The numerical value of this score.
  2180. ScoreValue int64 `json:"scoreValue,omitempty,string"`
  2181. // SocialRank: The social rank of the score in this leaderboard.
  2182. SocialRank *LeaderboardScoreRank `json:"socialRank,omitempty"`
  2183. // TimeSpan: The time span of this score.
  2184. // Possible values are:
  2185. // - "ALL_TIME" - The score is an all-time score.
  2186. // - "WEEKLY" - The score is a weekly score.
  2187. // - "DAILY" - The score is a daily score.
  2188. TimeSpan string `json:"timeSpan,omitempty"`
  2189. // WriteTimestamp: The timestamp at which this score was recorded, in
  2190. // milliseconds since the epoch in UTC.
  2191. WriteTimestamp int64 `json:"writeTimestamp,omitempty,string"`
  2192. // ForceSendFields is a list of field names (e.g. "Kind") to
  2193. // unconditionally include in API requests. By default, fields with
  2194. // empty values are omitted from API requests. However, any non-pointer,
  2195. // non-interface field appearing in ForceSendFields will be sent to the
  2196. // server regardless of whether the field is empty or not. This may be
  2197. // used to include empty fields in Patch requests.
  2198. ForceSendFields []string `json:"-"`
  2199. // NullFields is a list of field names (e.g. "Kind") to include in API
  2200. // requests with the JSON null value. By default, fields with empty
  2201. // values are omitted from API requests. However, any field with an
  2202. // empty value appearing in NullFields will be sent to the server as
  2203. // null. It is an error if a field in this list has a non-empty value.
  2204. // This may be used to include null fields in Patch requests.
  2205. NullFields []string `json:"-"`
  2206. }
  2207. func (s *PlayerLeaderboardScore) MarshalJSON() ([]byte, error) {
  2208. type NoMethod PlayerLeaderboardScore
  2209. raw := NoMethod(*s)
  2210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2211. }
  2212. // PlayerLeaderboardScoreListResponse: This is a JSON template for a
  2213. // list of player leaderboard scores.
  2214. type PlayerLeaderboardScoreListResponse struct {
  2215. // Items: The leaderboard scores.
  2216. Items []*PlayerLeaderboardScore `json:"items,omitempty"`
  2217. // Kind: Uniquely identifies the type of this resource. Value is always
  2218. // the fixed string games#playerLeaderboardScoreListResponse.
  2219. Kind string `json:"kind,omitempty"`
  2220. // NextPageToken: The pagination token for the next page of results.
  2221. NextPageToken string `json:"nextPageToken,omitempty"`
  2222. // Player: The Player resources for the owner of this score.
  2223. Player *Player `json:"player,omitempty"`
  2224. // ServerResponse contains the HTTP response code and headers from the
  2225. // server.
  2226. googleapi.ServerResponse `json:"-"`
  2227. // ForceSendFields is a list of field names (e.g. "Items") to
  2228. // unconditionally include in API requests. By default, fields with
  2229. // empty values are omitted from API requests. However, any non-pointer,
  2230. // non-interface field appearing in ForceSendFields will be sent to the
  2231. // server regardless of whether the field is empty or not. This may be
  2232. // used to include empty fields in Patch requests.
  2233. ForceSendFields []string `json:"-"`
  2234. // NullFields is a list of field names (e.g. "Items") to include in API
  2235. // requests with the JSON null value. By default, fields with empty
  2236. // values are omitted from API requests. However, any field with an
  2237. // empty value appearing in NullFields will be sent to the server as
  2238. // null. It is an error if a field in this list has a non-empty value.
  2239. // This may be used to include null fields in Patch requests.
  2240. NullFields []string `json:"-"`
  2241. }
  2242. func (s *PlayerLeaderboardScoreListResponse) MarshalJSON() ([]byte, error) {
  2243. type NoMethod PlayerLeaderboardScoreListResponse
  2244. raw := NoMethod(*s)
  2245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2246. }
  2247. // PlayerLevel: This is a JSON template for 1P/3P metadata about a
  2248. // user's level.
  2249. type PlayerLevel struct {
  2250. // Kind: Uniquely identifies the type of this resource. Value is always
  2251. // the fixed string games#playerLevel.
  2252. Kind string `json:"kind,omitempty"`
  2253. // Level: The level for the user.
  2254. Level int64 `json:"level,omitempty"`
  2255. // MaxExperiencePoints: The maximum experience points for this level.
  2256. MaxExperiencePoints int64 `json:"maxExperiencePoints,omitempty,string"`
  2257. // MinExperiencePoints: The minimum experience points for this level.
  2258. MinExperiencePoints int64 `json:"minExperiencePoints,omitempty,string"`
  2259. // ForceSendFields is a list of field names (e.g. "Kind") to
  2260. // unconditionally include in API requests. By default, fields with
  2261. // empty values are omitted from API requests. However, any non-pointer,
  2262. // non-interface field appearing in ForceSendFields will be sent to the
  2263. // server regardless of whether the field is empty or not. This may be
  2264. // used to include empty fields in Patch requests.
  2265. ForceSendFields []string `json:"-"`
  2266. // NullFields is a list of field names (e.g. "Kind") to include in API
  2267. // requests with the JSON null value. By default, fields with empty
  2268. // values are omitted from API requests. However, any field with an
  2269. // empty value appearing in NullFields will be sent to the server as
  2270. // null. It is an error if a field in this list has a non-empty value.
  2271. // This may be used to include null fields in Patch requests.
  2272. NullFields []string `json:"-"`
  2273. }
  2274. func (s *PlayerLevel) MarshalJSON() ([]byte, error) {
  2275. type NoMethod PlayerLevel
  2276. raw := NoMethod(*s)
  2277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2278. }
  2279. // PlayerListResponse: This is a JSON template for a third party player
  2280. // list response.
  2281. type PlayerListResponse struct {
  2282. // Items: The players.
  2283. Items []*Player `json:"items,omitempty"`
  2284. // Kind: Uniquely identifies the type of this resource. Value is always
  2285. // the fixed string games#playerListResponse.
  2286. Kind string `json:"kind,omitempty"`
  2287. // NextPageToken: Token corresponding to the next page of results.
  2288. NextPageToken string `json:"nextPageToken,omitempty"`
  2289. // ServerResponse contains the HTTP response code and headers from the
  2290. // server.
  2291. googleapi.ServerResponse `json:"-"`
  2292. // ForceSendFields is a list of field names (e.g. "Items") to
  2293. // unconditionally include in API requests. By default, fields with
  2294. // empty values are omitted from API requests. However, any non-pointer,
  2295. // non-interface field appearing in ForceSendFields will be sent to the
  2296. // server regardless of whether the field is empty or not. This may be
  2297. // used to include empty fields in Patch requests.
  2298. ForceSendFields []string `json:"-"`
  2299. // NullFields is a list of field names (e.g. "Items") to include in API
  2300. // requests with the JSON null value. By default, fields with empty
  2301. // values are omitted from API requests. However, any field with an
  2302. // empty value appearing in NullFields will be sent to the server as
  2303. // null. It is an error if a field in this list has a non-empty value.
  2304. // This may be used to include null fields in Patch requests.
  2305. NullFields []string `json:"-"`
  2306. }
  2307. func (s *PlayerListResponse) MarshalJSON() ([]byte, error) {
  2308. type NoMethod PlayerListResponse
  2309. raw := NoMethod(*s)
  2310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2311. }
  2312. // PlayerScore: This is a JSON template for a player score.
  2313. type PlayerScore struct {
  2314. // FormattedScore: The formatted score for this player score.
  2315. FormattedScore string `json:"formattedScore,omitempty"`
  2316. // Kind: Uniquely identifies the type of this resource. Value is always
  2317. // the fixed string games#playerScore.
  2318. Kind string `json:"kind,omitempty"`
  2319. // Score: The numerical value for this player score.
  2320. Score int64 `json:"score,omitempty,string"`
  2321. // ScoreTag: Additional information about this score. Values will
  2322. // contain no more than 64 URI-safe characters as defined by section 2.3
  2323. // of RFC 3986.
  2324. ScoreTag string `json:"scoreTag,omitempty"`
  2325. // TimeSpan: The time span for this player score.
  2326. // Possible values are:
  2327. // - "ALL_TIME" - The score is an all-time score.
  2328. // - "WEEKLY" - The score is a weekly score.
  2329. // - "DAILY" - The score is a daily score.
  2330. TimeSpan string `json:"timeSpan,omitempty"`
  2331. // ForceSendFields is a list of field names (e.g. "FormattedScore") to
  2332. // unconditionally include in API requests. By default, fields with
  2333. // empty values are omitted from API requests. However, any non-pointer,
  2334. // non-interface field appearing in ForceSendFields will be sent to the
  2335. // server regardless of whether the field is empty or not. This may be
  2336. // used to include empty fields in Patch requests.
  2337. ForceSendFields []string `json:"-"`
  2338. // NullFields is a list of field names (e.g. "FormattedScore") to
  2339. // include in API requests with the JSON null value. By default, fields
  2340. // with empty values are omitted from API requests. However, any field
  2341. // with an empty value appearing in NullFields will be sent to the
  2342. // server as null. It is an error if a field in this list has a
  2343. // non-empty value. This may be used to include null fields in Patch
  2344. // requests.
  2345. NullFields []string `json:"-"`
  2346. }
  2347. func (s *PlayerScore) MarshalJSON() ([]byte, error) {
  2348. type NoMethod PlayerScore
  2349. raw := NoMethod(*s)
  2350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2351. }
  2352. // PlayerScoreListResponse: This is a JSON template for a list of score
  2353. // submission statuses.
  2354. type PlayerScoreListResponse struct {
  2355. // Kind: Uniquely identifies the type of this resource. Value is always
  2356. // the fixed string games#playerScoreListResponse.
  2357. Kind string `json:"kind,omitempty"`
  2358. // SubmittedScores: The score submissions statuses.
  2359. SubmittedScores []*PlayerScoreResponse `json:"submittedScores,omitempty"`
  2360. // ServerResponse contains the HTTP response code and headers from the
  2361. // server.
  2362. googleapi.ServerResponse `json:"-"`
  2363. // ForceSendFields is a list of field names (e.g. "Kind") to
  2364. // unconditionally include in API requests. By default, fields with
  2365. // empty values are omitted from API requests. However, any non-pointer,
  2366. // non-interface field appearing in ForceSendFields will be sent to the
  2367. // server regardless of whether the field is empty or not. This may be
  2368. // used to include empty fields in Patch requests.
  2369. ForceSendFields []string `json:"-"`
  2370. // NullFields is a list of field names (e.g. "Kind") to include in API
  2371. // requests with the JSON null value. By default, fields with empty
  2372. // values are omitted from API requests. However, any field with an
  2373. // empty value appearing in NullFields will be sent to the server as
  2374. // null. It is an error if a field in this list has a non-empty value.
  2375. // This may be used to include null fields in Patch requests.
  2376. NullFields []string `json:"-"`
  2377. }
  2378. func (s *PlayerScoreListResponse) MarshalJSON() ([]byte, error) {
  2379. type NoMethod PlayerScoreListResponse
  2380. raw := NoMethod(*s)
  2381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2382. }
  2383. // PlayerScoreResponse: This is a JSON template for a list of
  2384. // leaderboard entry resources.
  2385. type PlayerScoreResponse struct {
  2386. // BeatenScoreTimeSpans: The time spans where the submitted score is
  2387. // better than the existing score for that time span.
  2388. // Possible values are:
  2389. // - "ALL_TIME" - The score is an all-time score.
  2390. // - "WEEKLY" - The score is a weekly score.
  2391. // - "DAILY" - The score is a daily score.
  2392. BeatenScoreTimeSpans []string `json:"beatenScoreTimeSpans,omitempty"`
  2393. // FormattedScore: The formatted value of the submitted score.
  2394. FormattedScore string `json:"formattedScore,omitempty"`
  2395. // Kind: Uniquely identifies the type of this resource. Value is always
  2396. // the fixed string games#playerScoreResponse.
  2397. Kind string `json:"kind,omitempty"`
  2398. // LeaderboardId: The leaderboard ID that this score was submitted to.
  2399. LeaderboardId string `json:"leaderboardId,omitempty"`
  2400. // ScoreTag: Additional information about this score. Values will
  2401. // contain no more than 64 URI-safe characters as defined by section 2.3
  2402. // of RFC 3986.
  2403. ScoreTag string `json:"scoreTag,omitempty"`
  2404. // UnbeatenScores: The scores in time spans that have not been beaten.
  2405. // As an example, the submitted score may be better than the player's
  2406. // DAILY score, but not better than the player's scores for the WEEKLY
  2407. // or ALL_TIME time spans.
  2408. UnbeatenScores []*PlayerScore `json:"unbeatenScores,omitempty"`
  2409. // ServerResponse contains the HTTP response code and headers from the
  2410. // server.
  2411. googleapi.ServerResponse `json:"-"`
  2412. // ForceSendFields is a list of field names (e.g.
  2413. // "BeatenScoreTimeSpans") to unconditionally include in API requests.
  2414. // By default, fields with empty values are omitted from API requests.
  2415. // However, any non-pointer, non-interface field appearing in
  2416. // ForceSendFields will be sent to the server regardless of whether the
  2417. // field is empty or not. This may be used to include empty fields in
  2418. // Patch requests.
  2419. ForceSendFields []string `json:"-"`
  2420. // NullFields is a list of field names (e.g. "BeatenScoreTimeSpans") to
  2421. // include in API requests with the JSON null value. By default, fields
  2422. // with empty values are omitted from API requests. However, any field
  2423. // with an empty value appearing in NullFields will be sent to the
  2424. // server as null. It is an error if a field in this list has a
  2425. // non-empty value. This may be used to include null fields in Patch
  2426. // requests.
  2427. NullFields []string `json:"-"`
  2428. }
  2429. func (s *PlayerScoreResponse) MarshalJSON() ([]byte, error) {
  2430. type NoMethod PlayerScoreResponse
  2431. raw := NoMethod(*s)
  2432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2433. }
  2434. // PlayerScoreSubmissionList: This is a JSON template for a list of
  2435. // score submission requests
  2436. type PlayerScoreSubmissionList struct {
  2437. // Kind: Uniquely identifies the type of this resource. Value is always
  2438. // the fixed string games#playerScoreSubmissionList.
  2439. Kind string `json:"kind,omitempty"`
  2440. // Scores: The score submissions.
  2441. Scores []*ScoreSubmission `json:"scores,omitempty"`
  2442. // ForceSendFields is a list of field names (e.g. "Kind") to
  2443. // unconditionally include in API requests. By default, fields with
  2444. // empty values are omitted from API requests. However, any non-pointer,
  2445. // non-interface field appearing in ForceSendFields will be sent to the
  2446. // server regardless of whether the field is empty or not. This may be
  2447. // used to include empty fields in Patch requests.
  2448. ForceSendFields []string `json:"-"`
  2449. // NullFields is a list of field names (e.g. "Kind") to include in API
  2450. // requests with the JSON null value. By default, fields with empty
  2451. // values are omitted from API requests. However, any field with an
  2452. // empty value appearing in NullFields will be sent to the server as
  2453. // null. It is an error if a field in this list has a non-empty value.
  2454. // This may be used to include null fields in Patch requests.
  2455. NullFields []string `json:"-"`
  2456. }
  2457. func (s *PlayerScoreSubmissionList) MarshalJSON() ([]byte, error) {
  2458. type NoMethod PlayerScoreSubmissionList
  2459. raw := NoMethod(*s)
  2460. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2461. }
  2462. // ProfileSettings: This is a JSON template for profile settings
  2463. type ProfileSettings struct {
  2464. // Kind: Uniquely identifies the type of this resource. Value is always
  2465. // the fixed string games#profileSettings.
  2466. Kind string `json:"kind,omitempty"`
  2467. // ProfileVisible: The player's current profile visibility. This field
  2468. // is visible to both 1P and 3P APIs.
  2469. ProfileVisible bool `json:"profileVisible,omitempty"`
  2470. // ForceSendFields is a list of field names (e.g. "Kind") to
  2471. // unconditionally include in API requests. By default, fields with
  2472. // empty values are omitted from API requests. However, any non-pointer,
  2473. // non-interface field appearing in ForceSendFields will be sent to the
  2474. // server regardless of whether the field is empty or not. This may be
  2475. // used to include empty fields in Patch requests.
  2476. ForceSendFields []string `json:"-"`
  2477. // NullFields is a list of field names (e.g. "Kind") to include in API
  2478. // requests with the JSON null value. By default, fields with empty
  2479. // values are omitted from API requests. However, any field with an
  2480. // empty value appearing in NullFields will be sent to the server as
  2481. // null. It is an error if a field in this list has a non-empty value.
  2482. // This may be used to include null fields in Patch requests.
  2483. NullFields []string `json:"-"`
  2484. }
  2485. func (s *ProfileSettings) MarshalJSON() ([]byte, error) {
  2486. type NoMethod ProfileSettings
  2487. raw := NoMethod(*s)
  2488. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2489. }
  2490. // PushToken: This is a JSON template for a push token resource.
  2491. type PushToken struct {
  2492. // ClientRevision: The revision of the client SDK used by your
  2493. // application, in the same format that's used by revisions.check. Used
  2494. // to send backward compatible messages. Format:
  2495. // [PLATFORM_TYPE]:[VERSION_NUMBER]. Possible values of PLATFORM_TYPE
  2496. // are:
  2497. // - IOS - Push token is for iOS
  2498. ClientRevision string `json:"clientRevision,omitempty"`
  2499. // Id: Unique identifier for this push token.
  2500. Id *PushTokenId `json:"id,omitempty"`
  2501. // Kind: Uniquely identifies the type of this resource. Value is always
  2502. // the fixed string games#pushToken.
  2503. Kind string `json:"kind,omitempty"`
  2504. // Language: The preferred language for notifications that are sent
  2505. // using this token.
  2506. Language string `json:"language,omitempty"`
  2507. // ForceSendFields is a list of field names (e.g. "ClientRevision") to
  2508. // unconditionally include in API requests. By default, fields with
  2509. // empty values are omitted from API requests. However, any non-pointer,
  2510. // non-interface field appearing in ForceSendFields will be sent to the
  2511. // server regardless of whether the field is empty or not. This may be
  2512. // used to include empty fields in Patch requests.
  2513. ForceSendFields []string `json:"-"`
  2514. // NullFields is a list of field names (e.g. "ClientRevision") to
  2515. // include in API requests with the JSON null value. By default, fields
  2516. // with empty values are omitted from API requests. However, any field
  2517. // with an empty value appearing in NullFields will be sent to the
  2518. // server as null. It is an error if a field in this list has a
  2519. // non-empty value. This may be used to include null fields in Patch
  2520. // requests.
  2521. NullFields []string `json:"-"`
  2522. }
  2523. func (s *PushToken) MarshalJSON() ([]byte, error) {
  2524. type NoMethod PushToken
  2525. raw := NoMethod(*s)
  2526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2527. }
  2528. // PushTokenId: This is a JSON template for a push token ID resource.
  2529. type PushTokenId struct {
  2530. // Ios: A push token ID for iOS devices.
  2531. Ios *PushTokenIdIos `json:"ios,omitempty"`
  2532. // Kind: Uniquely identifies the type of this resource. Value is always
  2533. // the fixed string games#pushTokenId.
  2534. Kind string `json:"kind,omitempty"`
  2535. // ForceSendFields is a list of field names (e.g. "Ios") to
  2536. // unconditionally include in API requests. By default, fields with
  2537. // empty values are omitted from API requests. However, any non-pointer,
  2538. // non-interface field appearing in ForceSendFields will be sent to the
  2539. // server regardless of whether the field is empty or not. This may be
  2540. // used to include empty fields in Patch requests.
  2541. ForceSendFields []string `json:"-"`
  2542. // NullFields is a list of field names (e.g. "Ios") to include in API
  2543. // requests with the JSON null value. By default, fields with empty
  2544. // values are omitted from API requests. However, any field with an
  2545. // empty value appearing in NullFields will be sent to the server as
  2546. // null. It is an error if a field in this list has a non-empty value.
  2547. // This may be used to include null fields in Patch requests.
  2548. NullFields []string `json:"-"`
  2549. }
  2550. func (s *PushTokenId) MarshalJSON() ([]byte, error) {
  2551. type NoMethod PushTokenId
  2552. raw := NoMethod(*s)
  2553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2554. }
  2555. // PushTokenIdIos: A push token ID for iOS devices.
  2556. type PushTokenIdIos struct {
  2557. // ApnsDeviceToken: Device token supplied by an iOS system call to
  2558. // register for remote notifications. Encode this field as web-safe
  2559. // base64.
  2560. ApnsDeviceToken string `json:"apns_device_token,omitempty"`
  2561. // ApnsEnvironment: Indicates whether this token should be used for the
  2562. // production or sandbox APNS server.
  2563. ApnsEnvironment string `json:"apns_environment,omitempty"`
  2564. // ForceSendFields is a list of field names (e.g. "ApnsDeviceToken") to
  2565. // unconditionally include in API requests. By default, fields with
  2566. // empty values are omitted from API requests. However, any non-pointer,
  2567. // non-interface field appearing in ForceSendFields will be sent to the
  2568. // server regardless of whether the field is empty or not. This may be
  2569. // used to include empty fields in Patch requests.
  2570. ForceSendFields []string `json:"-"`
  2571. // NullFields is a list of field names (e.g. "ApnsDeviceToken") to
  2572. // include in API requests with the JSON null value. By default, fields
  2573. // with empty values are omitted from API requests. However, any field
  2574. // with an empty value appearing in NullFields will be sent to the
  2575. // server as null. It is an error if a field in this list has a
  2576. // non-empty value. This may be used to include null fields in Patch
  2577. // requests.
  2578. NullFields []string `json:"-"`
  2579. }
  2580. func (s *PushTokenIdIos) MarshalJSON() ([]byte, error) {
  2581. type NoMethod PushTokenIdIos
  2582. raw := NoMethod(*s)
  2583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2584. }
  2585. // Quest: This is a JSON template for a Quest resource.
  2586. type Quest struct {
  2587. // AcceptedTimestampMillis: The timestamp at which the user accepted the
  2588. // quest in milliseconds since the epoch in UTC. Only present if the
  2589. // player has accepted the quest.
  2590. AcceptedTimestampMillis int64 `json:"acceptedTimestampMillis,omitempty,string"`
  2591. // ApplicationId: The ID of the application this quest is part of.
  2592. ApplicationId string `json:"applicationId,omitempty"`
  2593. // BannerUrl: The banner image URL for the quest.
  2594. BannerUrl string `json:"bannerUrl,omitempty"`
  2595. // Description: The description of the quest.
  2596. Description string `json:"description,omitempty"`
  2597. // EndTimestampMillis: The timestamp at which the quest ceases to be
  2598. // active in milliseconds since the epoch in UTC.
  2599. EndTimestampMillis int64 `json:"endTimestampMillis,omitempty,string"`
  2600. // IconUrl: The icon image URL for the quest.
  2601. IconUrl string `json:"iconUrl,omitempty"`
  2602. // Id: The ID of the quest.
  2603. Id string `json:"id,omitempty"`
  2604. // IsDefaultBannerUrl: Indicates whether the banner image being returned
  2605. // is a default image, or is game-provided.
  2606. IsDefaultBannerUrl bool `json:"isDefaultBannerUrl,omitempty"`
  2607. // IsDefaultIconUrl: Indicates whether the icon image being returned is
  2608. // a default image, or is game-provided.
  2609. IsDefaultIconUrl bool `json:"isDefaultIconUrl,omitempty"`
  2610. // Kind: Uniquely identifies the type of this resource. Value is always
  2611. // the fixed string games#quest.
  2612. Kind string `json:"kind,omitempty"`
  2613. // LastUpdatedTimestampMillis: The timestamp at which the quest was last
  2614. // updated by the user in milliseconds since the epoch in UTC. Only
  2615. // present if the player has accepted the quest.
  2616. LastUpdatedTimestampMillis int64 `json:"lastUpdatedTimestampMillis,omitempty,string"`
  2617. // Milestones: The quest milestones.
  2618. Milestones []*QuestMilestone `json:"milestones,omitempty"`
  2619. // Name: The name of the quest.
  2620. Name string `json:"name,omitempty"`
  2621. // NotifyTimestampMillis: The timestamp at which the user should be
  2622. // notified that the quest will end soon in milliseconds since the epoch
  2623. // in UTC.
  2624. NotifyTimestampMillis int64 `json:"notifyTimestampMillis,omitempty,string"`
  2625. // StartTimestampMillis: The timestamp at which the quest becomes active
  2626. // in milliseconds since the epoch in UTC.
  2627. StartTimestampMillis int64 `json:"startTimestampMillis,omitempty,string"`
  2628. // State: The state of the quest.
  2629. // Possible values are:
  2630. // - "UPCOMING": The quest is upcoming. The user can see the quest, but
  2631. // cannot accept it until it is open.
  2632. // - "OPEN": The quest is currently open and may be accepted at this
  2633. // time.
  2634. // - "ACCEPTED": The user is currently participating in this quest.
  2635. // - "COMPLETED": The user has completed the quest.
  2636. // - "FAILED": The quest was attempted but was not completed before the
  2637. // deadline expired.
  2638. // - "EXPIRED": The quest has expired and was not accepted.
  2639. // - "DELETED": The quest should be deleted from the local database.
  2640. State string `json:"state,omitempty"`
  2641. // ServerResponse contains the HTTP response code and headers from the
  2642. // server.
  2643. googleapi.ServerResponse `json:"-"`
  2644. // ForceSendFields is a list of field names (e.g.
  2645. // "AcceptedTimestampMillis") to unconditionally include in API
  2646. // requests. By default, fields with empty values are omitted from API
  2647. // requests. However, any non-pointer, non-interface field appearing in
  2648. // ForceSendFields will be sent to the server regardless of whether the
  2649. // field is empty or not. This may be used to include empty fields in
  2650. // Patch requests.
  2651. ForceSendFields []string `json:"-"`
  2652. // NullFields is a list of field names (e.g. "AcceptedTimestampMillis")
  2653. // to include in API requests with the JSON null value. By default,
  2654. // fields with empty values are omitted from API requests. However, any
  2655. // field with an empty value appearing in NullFields will be sent to the
  2656. // server as null. It is an error if a field in this list has a
  2657. // non-empty value. This may be used to include null fields in Patch
  2658. // requests.
  2659. NullFields []string `json:"-"`
  2660. }
  2661. func (s *Quest) MarshalJSON() ([]byte, error) {
  2662. type NoMethod Quest
  2663. raw := NoMethod(*s)
  2664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2665. }
  2666. // QuestContribution: This is a JSON template for a Quest Criterion
  2667. // Contribution resource.
  2668. type QuestContribution struct {
  2669. // FormattedValue: The formatted value of the contribution as a string.
  2670. // Format depends on the configuration for the associated event
  2671. // definition in the Play Games Developer Console.
  2672. FormattedValue string `json:"formattedValue,omitempty"`
  2673. // Kind: Uniquely identifies the type of this resource. Value is always
  2674. // the fixed string games#questContribution.
  2675. Kind string `json:"kind,omitempty"`
  2676. // Value: The value of the contribution.
  2677. Value int64 `json:"value,omitempty,string"`
  2678. // ForceSendFields is a list of field names (e.g. "FormattedValue") to
  2679. // unconditionally include in API requests. By default, fields with
  2680. // empty values are omitted from API requests. However, any non-pointer,
  2681. // non-interface field appearing in ForceSendFields will be sent to the
  2682. // server regardless of whether the field is empty or not. This may be
  2683. // used to include empty fields in Patch requests.
  2684. ForceSendFields []string `json:"-"`
  2685. // NullFields is a list of field names (e.g. "FormattedValue") to
  2686. // include in API requests with the JSON null value. By default, fields
  2687. // with empty values are omitted from API requests. However, any field
  2688. // with an empty value appearing in NullFields will be sent to the
  2689. // server as null. It is an error if a field in this list has a
  2690. // non-empty value. This may be used to include null fields in Patch
  2691. // requests.
  2692. NullFields []string `json:"-"`
  2693. }
  2694. func (s *QuestContribution) MarshalJSON() ([]byte, error) {
  2695. type NoMethod QuestContribution
  2696. raw := NoMethod(*s)
  2697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2698. }
  2699. // QuestCriterion: This is a JSON template for a Quest Criterion
  2700. // resource.
  2701. type QuestCriterion struct {
  2702. // CompletionContribution: The total number of times the associated
  2703. // event must be incremented for the player to complete this quest.
  2704. CompletionContribution *QuestContribution `json:"completionContribution,omitempty"`
  2705. // CurrentContribution: The number of increments the player has made
  2706. // toward the completion count event increments required to complete the
  2707. // quest. This value will not exceed the completion contribution.
  2708. // There will be no currentContribution until the player has accepted
  2709. // the quest.
  2710. CurrentContribution *QuestContribution `json:"currentContribution,omitempty"`
  2711. // EventId: The ID of the event the criterion corresponds to.
  2712. EventId string `json:"eventId,omitempty"`
  2713. // InitialPlayerProgress: The value of the event associated with this
  2714. // quest at the time that the quest was accepted. This value may change
  2715. // if event increments that took place before the start of quest are
  2716. // uploaded after the quest starts.
  2717. // There will be no initialPlayerProgress until the player has accepted
  2718. // the quest.
  2719. InitialPlayerProgress *QuestContribution `json:"initialPlayerProgress,omitempty"`
  2720. // Kind: Uniquely identifies the type of this resource. Value is always
  2721. // the fixed string games#questCriterion.
  2722. Kind string `json:"kind,omitempty"`
  2723. // ForceSendFields is a list of field names (e.g.
  2724. // "CompletionContribution") to unconditionally include in API requests.
  2725. // By default, fields with empty values are omitted from API requests.
  2726. // However, any non-pointer, non-interface field appearing in
  2727. // ForceSendFields will be sent to the server regardless of whether the
  2728. // field is empty or not. This may be used to include empty fields in
  2729. // Patch requests.
  2730. ForceSendFields []string `json:"-"`
  2731. // NullFields is a list of field names (e.g. "CompletionContribution")
  2732. // to include in API requests with the JSON null value. By default,
  2733. // fields with empty values are omitted from API requests. However, any
  2734. // field with an empty value appearing in NullFields will be sent to the
  2735. // server as null. It is an error if a field in this list has a
  2736. // non-empty value. This may be used to include null fields in Patch
  2737. // requests.
  2738. NullFields []string `json:"-"`
  2739. }
  2740. func (s *QuestCriterion) MarshalJSON() ([]byte, error) {
  2741. type NoMethod QuestCriterion
  2742. raw := NoMethod(*s)
  2743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2744. }
  2745. // QuestListResponse: This is a JSON template for a list of quest
  2746. // objects.
  2747. type QuestListResponse struct {
  2748. // Items: The quests.
  2749. Items []*Quest `json:"items,omitempty"`
  2750. // Kind: Uniquely identifies the type of this resource. Value is always
  2751. // the fixed string games#questListResponse.
  2752. Kind string `json:"kind,omitempty"`
  2753. // NextPageToken: Token corresponding to the next page of results.
  2754. NextPageToken string `json:"nextPageToken,omitempty"`
  2755. // ServerResponse contains the HTTP response code and headers from the
  2756. // server.
  2757. googleapi.ServerResponse `json:"-"`
  2758. // ForceSendFields is a list of field names (e.g. "Items") to
  2759. // unconditionally include in API requests. By default, fields with
  2760. // empty values are omitted from API requests. However, any non-pointer,
  2761. // non-interface field appearing in ForceSendFields will be sent to the
  2762. // server regardless of whether the field is empty or not. This may be
  2763. // used to include empty fields in Patch requests.
  2764. ForceSendFields []string `json:"-"`
  2765. // NullFields is a list of field names (e.g. "Items") to include in API
  2766. // requests with the JSON null value. By default, fields with empty
  2767. // values are omitted from API requests. However, any field with an
  2768. // empty value appearing in NullFields will be sent to the server as
  2769. // null. It is an error if a field in this list has a non-empty value.
  2770. // This may be used to include null fields in Patch requests.
  2771. NullFields []string `json:"-"`
  2772. }
  2773. func (s *QuestListResponse) MarshalJSON() ([]byte, error) {
  2774. type NoMethod QuestListResponse
  2775. raw := NoMethod(*s)
  2776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2777. }
  2778. // QuestMilestone: This is a JSON template for a Quest Milestone
  2779. // resource.
  2780. type QuestMilestone struct {
  2781. // CompletionRewardData: The completion reward data of the milestone,
  2782. // represented as a Base64-encoded string. This is a developer-specified
  2783. // binary blob with size between 0 and 2 KB before encoding.
  2784. CompletionRewardData string `json:"completionRewardData,omitempty"`
  2785. // Criteria: The criteria of the milestone.
  2786. Criteria []*QuestCriterion `json:"criteria,omitempty"`
  2787. // Id: The milestone ID.
  2788. Id string `json:"id,omitempty"`
  2789. // Kind: Uniquely identifies the type of this resource. Value is always
  2790. // the fixed string games#questMilestone.
  2791. Kind string `json:"kind,omitempty"`
  2792. // State: The current state of the milestone.
  2793. // Possible values are:
  2794. // - "COMPLETED_NOT_CLAIMED" - The milestone is complete, but has not
  2795. // yet been claimed.
  2796. // - "CLAIMED" - The milestone is complete and has been claimed.
  2797. // - "NOT_COMPLETED" - The milestone has not yet been completed.
  2798. // - "NOT_STARTED" - The milestone is for a quest that has not yet been
  2799. // accepted.
  2800. State string `json:"state,omitempty"`
  2801. // ForceSendFields is a list of field names (e.g.
  2802. // "CompletionRewardData") to unconditionally include in API requests.
  2803. // By default, fields with empty values are omitted from API requests.
  2804. // However, any non-pointer, non-interface field appearing in
  2805. // ForceSendFields will be sent to the server regardless of whether the
  2806. // field is empty or not. This may be used to include empty fields in
  2807. // Patch requests.
  2808. ForceSendFields []string `json:"-"`
  2809. // NullFields is a list of field names (e.g. "CompletionRewardData") to
  2810. // include in API requests with the JSON null value. By default, fields
  2811. // with empty values are omitted from API requests. However, any field
  2812. // with an empty value appearing in NullFields will be sent to the
  2813. // server as null. It is an error if a field in this list has a
  2814. // non-empty value. This may be used to include null fields in Patch
  2815. // requests.
  2816. NullFields []string `json:"-"`
  2817. }
  2818. func (s *QuestMilestone) MarshalJSON() ([]byte, error) {
  2819. type NoMethod QuestMilestone
  2820. raw := NoMethod(*s)
  2821. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2822. }
  2823. // RevisionCheckResponse: This is a JSON template for the result of
  2824. // checking a revision.
  2825. type RevisionCheckResponse struct {
  2826. // ApiVersion: The version of the API this client revision should use
  2827. // when calling API methods.
  2828. ApiVersion string `json:"apiVersion,omitempty"`
  2829. // Kind: Uniquely identifies the type of this resource. Value is always
  2830. // the fixed string games#revisionCheckResponse.
  2831. Kind string `json:"kind,omitempty"`
  2832. // RevisionStatus: The result of the revision check.
  2833. // Possible values are:
  2834. // - "OK" - The revision being used is current.
  2835. // - "DEPRECATED" - There is currently a newer version available, but
  2836. // the revision being used still works.
  2837. // - "INVALID" - The revision being used is not supported in any
  2838. // released version.
  2839. RevisionStatus string `json:"revisionStatus,omitempty"`
  2840. // ServerResponse contains the HTTP response code and headers from the
  2841. // server.
  2842. googleapi.ServerResponse `json:"-"`
  2843. // ForceSendFields is a list of field names (e.g. "ApiVersion") to
  2844. // unconditionally include in API requests. By default, fields with
  2845. // empty values are omitted from API requests. However, any non-pointer,
  2846. // non-interface field appearing in ForceSendFields will be sent to the
  2847. // server regardless of whether the field is empty or not. This may be
  2848. // used to include empty fields in Patch requests.
  2849. ForceSendFields []string `json:"-"`
  2850. // NullFields is a list of field names (e.g. "ApiVersion") to include in
  2851. // API requests with the JSON null value. By default, fields with empty
  2852. // values are omitted from API requests. However, any field with an
  2853. // empty value appearing in NullFields will be sent to the server as
  2854. // null. It is an error if a field in this list has a non-empty value.
  2855. // This may be used to include null fields in Patch requests.
  2856. NullFields []string `json:"-"`
  2857. }
  2858. func (s *RevisionCheckResponse) MarshalJSON() ([]byte, error) {
  2859. type NoMethod RevisionCheckResponse
  2860. raw := NoMethod(*s)
  2861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2862. }
  2863. // Room: This is a JSON template for a room resource object.
  2864. type Room struct {
  2865. // ApplicationId: The ID of the application being played.
  2866. ApplicationId string `json:"applicationId,omitempty"`
  2867. // AutoMatchingCriteria: Criteria for auto-matching players into this
  2868. // room.
  2869. AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  2870. // AutoMatchingStatus: Auto-matching status for this room. Not set if
  2871. // the room is not currently in the auto-matching queue.
  2872. AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"`
  2873. // CreationDetails: Details about the room creation.
  2874. CreationDetails *RoomModification `json:"creationDetails,omitempty"`
  2875. // Description: This short description is generated by our servers and
  2876. // worded relative to the player requesting the room. It is intended to
  2877. // be displayed when the room is shown in a list (that is, an invitation
  2878. // to a room.)
  2879. Description string `json:"description,omitempty"`
  2880. // InviterId: The ID of the participant that invited the user to the
  2881. // room. Not set if the user was not invited to the room.
  2882. InviterId string `json:"inviterId,omitempty"`
  2883. // Kind: Uniquely identifies the type of this resource. Value is always
  2884. // the fixed string games#room.
  2885. Kind string `json:"kind,omitempty"`
  2886. // LastUpdateDetails: Details about the last update to the room.
  2887. LastUpdateDetails *RoomModification `json:"lastUpdateDetails,omitempty"`
  2888. // Participants: The participants involved in the room, along with their
  2889. // statuses. Includes participants who have left or declined
  2890. // invitations.
  2891. Participants []*RoomParticipant `json:"participants,omitempty"`
  2892. // RoomId: Globally unique ID for a room.
  2893. RoomId string `json:"roomId,omitempty"`
  2894. // RoomStatusVersion: The version of the room status: an increasing
  2895. // counter, used by the client to ignore out-of-order updates to room
  2896. // status.
  2897. RoomStatusVersion int64 `json:"roomStatusVersion,omitempty"`
  2898. // Status: The status of the room.
  2899. // Possible values are:
  2900. // - "ROOM_INVITING" - One or more players have been invited and not
  2901. // responded.
  2902. // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by
  2903. // auto-matching.
  2904. // - "ROOM_CONNECTING" - Players have joined and are connecting to each
  2905. // other (either before or after auto-matching).
  2906. // - "ROOM_ACTIVE" - All players have joined and connected to each
  2907. // other.
  2908. // - "ROOM_DELETED" - The room should no longer be shown on the client.
  2909. // Returned in sync calls when a player joins a room (as a tombstone),
  2910. // or for rooms where all joined participants have left.
  2911. Status string `json:"status,omitempty"`
  2912. // Variant: The variant / mode of the application being played; can be
  2913. // any integer value, or left blank.
  2914. Variant int64 `json:"variant,omitempty"`
  2915. // ServerResponse contains the HTTP response code and headers from the
  2916. // server.
  2917. googleapi.ServerResponse `json:"-"`
  2918. // ForceSendFields is a list of field names (e.g. "ApplicationId") to
  2919. // unconditionally include in API requests. By default, fields with
  2920. // empty values are omitted from API requests. However, any non-pointer,
  2921. // non-interface field appearing in ForceSendFields will be sent to the
  2922. // server regardless of whether the field is empty or not. This may be
  2923. // used to include empty fields in Patch requests.
  2924. ForceSendFields []string `json:"-"`
  2925. // NullFields is a list of field names (e.g. "ApplicationId") to include
  2926. // in API requests with the JSON null value. By default, fields with
  2927. // empty values are omitted from API requests. However, any field with
  2928. // an empty value appearing in NullFields will be sent to the server as
  2929. // null. It is an error if a field in this list has a non-empty value.
  2930. // This may be used to include null fields in Patch requests.
  2931. NullFields []string `json:"-"`
  2932. }
  2933. func (s *Room) MarshalJSON() ([]byte, error) {
  2934. type NoMethod Room
  2935. raw := NoMethod(*s)
  2936. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2937. }
  2938. // RoomAutoMatchStatus: This is a JSON template for status of room
  2939. // automatching that is in progress.
  2940. type RoomAutoMatchStatus struct {
  2941. // Kind: Uniquely identifies the type of this resource. Value is always
  2942. // the fixed string games#roomAutoMatchStatus.
  2943. Kind string `json:"kind,omitempty"`
  2944. // WaitEstimateSeconds: An estimate for the amount of time (in seconds)
  2945. // that auto-matching is expected to take to complete.
  2946. WaitEstimateSeconds int64 `json:"waitEstimateSeconds,omitempty"`
  2947. // ForceSendFields is a list of field names (e.g. "Kind") to
  2948. // unconditionally include in API requests. By default, fields with
  2949. // empty values are omitted from API requests. However, any non-pointer,
  2950. // non-interface field appearing in ForceSendFields will be sent to the
  2951. // server regardless of whether the field is empty or not. This may be
  2952. // used to include empty fields in Patch requests.
  2953. ForceSendFields []string `json:"-"`
  2954. // NullFields is a list of field names (e.g. "Kind") to include in API
  2955. // requests with the JSON null value. By default, fields with empty
  2956. // values are omitted from API requests. However, any field with an
  2957. // empty value appearing in NullFields will be sent to the server as
  2958. // null. It is an error if a field in this list has a non-empty value.
  2959. // This may be used to include null fields in Patch requests.
  2960. NullFields []string `json:"-"`
  2961. }
  2962. func (s *RoomAutoMatchStatus) MarshalJSON() ([]byte, error) {
  2963. type NoMethod RoomAutoMatchStatus
  2964. raw := NoMethod(*s)
  2965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2966. }
  2967. // RoomAutoMatchingCriteria: This is a JSON template for a room
  2968. // auto-match criteria object.
  2969. type RoomAutoMatchingCriteria struct {
  2970. // ExclusiveBitmask: A bitmask indicating when auto-matches are valid.
  2971. // When ANDed with other exclusive bitmasks, the result must be zero.
  2972. // Can be used to support exclusive roles within a game.
  2973. ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"`
  2974. // Kind: Uniquely identifies the type of this resource. Value is always
  2975. // the fixed string games#roomAutoMatchingCriteria.
  2976. Kind string `json:"kind,omitempty"`
  2977. // MaxAutoMatchingPlayers: The maximum number of players that should be
  2978. // added to the room by auto-matching.
  2979. MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"`
  2980. // MinAutoMatchingPlayers: The minimum number of players that should be
  2981. // added to the room by auto-matching.
  2982. MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"`
  2983. // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to
  2984. // unconditionally include in API requests. By default, fields with
  2985. // empty values are omitted from API requests. However, any non-pointer,
  2986. // non-interface field appearing in ForceSendFields will be sent to the
  2987. // server regardless of whether the field is empty or not. This may be
  2988. // used to include empty fields in Patch requests.
  2989. ForceSendFields []string `json:"-"`
  2990. // NullFields is a list of field names (e.g. "ExclusiveBitmask") to
  2991. // include in API requests with the JSON null value. By default, fields
  2992. // with empty values are omitted from API requests. However, any field
  2993. // with an empty value appearing in NullFields will be sent to the
  2994. // server as null. It is an error if a field in this list has a
  2995. // non-empty value. This may be used to include null fields in Patch
  2996. // requests.
  2997. NullFields []string `json:"-"`
  2998. }
  2999. func (s *RoomAutoMatchingCriteria) MarshalJSON() ([]byte, error) {
  3000. type NoMethod RoomAutoMatchingCriteria
  3001. raw := NoMethod(*s)
  3002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3003. }
  3004. // RoomClientAddress: This is a JSON template for the client address
  3005. // when setting up a room.
  3006. type RoomClientAddress struct {
  3007. // Kind: Uniquely identifies the type of this resource. Value is always
  3008. // the fixed string games#roomClientAddress.
  3009. Kind string `json:"kind,omitempty"`
  3010. // XmppAddress: The XMPP address of the client on the Google Games XMPP
  3011. // network.
  3012. XmppAddress string `json:"xmppAddress,omitempty"`
  3013. // ForceSendFields is a list of field names (e.g. "Kind") to
  3014. // unconditionally include in API requests. By default, fields with
  3015. // empty values are omitted from API requests. However, any non-pointer,
  3016. // non-interface field appearing in ForceSendFields will be sent to the
  3017. // server regardless of whether the field is empty or not. This may be
  3018. // used to include empty fields in Patch requests.
  3019. ForceSendFields []string `json:"-"`
  3020. // NullFields is a list of field names (e.g. "Kind") to include in API
  3021. // requests with the JSON null value. By default, fields with empty
  3022. // values are omitted from API requests. However, any field with an
  3023. // empty value appearing in NullFields will be sent to the server as
  3024. // null. It is an error if a field in this list has a non-empty value.
  3025. // This may be used to include null fields in Patch requests.
  3026. NullFields []string `json:"-"`
  3027. }
  3028. func (s *RoomClientAddress) MarshalJSON() ([]byte, error) {
  3029. type NoMethod RoomClientAddress
  3030. raw := NoMethod(*s)
  3031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3032. }
  3033. // RoomCreateRequest: This is a JSON template for a room creation
  3034. // request.
  3035. type RoomCreateRequest struct {
  3036. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3037. // room.
  3038. AutoMatchingCriteria *RoomAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3039. // Capabilities: The capabilities that this client supports for realtime
  3040. // communication.
  3041. Capabilities []string `json:"capabilities,omitempty"`
  3042. // ClientAddress: Client address for the player creating the room.
  3043. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  3044. // InvitedPlayerIds: The player IDs to invite to the room.
  3045. InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"`
  3046. // Kind: Uniquely identifies the type of this resource. Value is always
  3047. // the fixed string games#roomCreateRequest.
  3048. Kind string `json:"kind,omitempty"`
  3049. // NetworkDiagnostics: Network diagnostics for the client creating the
  3050. // room.
  3051. NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"`
  3052. // RequestId: A randomly generated numeric ID. This number is used at
  3053. // the server to ensure that the request is handled correctly across
  3054. // retries.
  3055. RequestId int64 `json:"requestId,omitempty,string"`
  3056. // Variant: The variant / mode of the application to be played. This can
  3057. // be any integer value, or left blank. You should use a small number of
  3058. // variants to keep the auto-matching pool as large as possible.
  3059. Variant int64 `json:"variant,omitempty"`
  3060. // ForceSendFields is a list of field names (e.g.
  3061. // "AutoMatchingCriteria") to unconditionally include in API requests.
  3062. // By default, fields with empty values are omitted from API requests.
  3063. // However, any non-pointer, non-interface field appearing in
  3064. // ForceSendFields will be sent to the server regardless of whether the
  3065. // field is empty or not. This may be used to include empty fields in
  3066. // Patch requests.
  3067. ForceSendFields []string `json:"-"`
  3068. // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to
  3069. // include in API requests with the JSON null value. By default, fields
  3070. // with empty values are omitted from API requests. However, any field
  3071. // with an empty value appearing in NullFields will be sent to the
  3072. // server as null. It is an error if a field in this list has a
  3073. // non-empty value. This may be used to include null fields in Patch
  3074. // requests.
  3075. NullFields []string `json:"-"`
  3076. }
  3077. func (s *RoomCreateRequest) MarshalJSON() ([]byte, error) {
  3078. type NoMethod RoomCreateRequest
  3079. raw := NoMethod(*s)
  3080. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3081. }
  3082. // RoomJoinRequest: This is a JSON template for a join room request.
  3083. type RoomJoinRequest struct {
  3084. // Capabilities: The capabilities that this client supports for realtime
  3085. // communication.
  3086. Capabilities []string `json:"capabilities,omitempty"`
  3087. // ClientAddress: Client address for the player joining the room.
  3088. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  3089. // Kind: Uniquely identifies the type of this resource. Value is always
  3090. // the fixed string games#roomJoinRequest.
  3091. Kind string `json:"kind,omitempty"`
  3092. // NetworkDiagnostics: Network diagnostics for the client joining the
  3093. // room.
  3094. NetworkDiagnostics *NetworkDiagnostics `json:"networkDiagnostics,omitempty"`
  3095. // ForceSendFields is a list of field names (e.g. "Capabilities") to
  3096. // unconditionally include in API requests. By default, fields with
  3097. // empty values are omitted from API requests. However, any non-pointer,
  3098. // non-interface field appearing in ForceSendFields will be sent to the
  3099. // server regardless of whether the field is empty or not. This may be
  3100. // used to include empty fields in Patch requests.
  3101. ForceSendFields []string `json:"-"`
  3102. // NullFields is a list of field names (e.g. "Capabilities") to include
  3103. // in API requests with the JSON null value. By default, fields with
  3104. // empty values are omitted from API requests. However, any field with
  3105. // an empty value appearing in NullFields will be sent to the server as
  3106. // null. It is an error if a field in this list has a non-empty value.
  3107. // This may be used to include null fields in Patch requests.
  3108. NullFields []string `json:"-"`
  3109. }
  3110. func (s *RoomJoinRequest) MarshalJSON() ([]byte, error) {
  3111. type NoMethod RoomJoinRequest
  3112. raw := NoMethod(*s)
  3113. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3114. }
  3115. // RoomLeaveDiagnostics: This is a JSON template for room leave
  3116. // diagnostics.
  3117. type RoomLeaveDiagnostics struct {
  3118. // AndroidNetworkSubtype: Android network subtype.
  3119. // http://developer.android.com/reference/android/net/NetworkInfo.html#getSubtype()
  3120. AndroidNetworkSubtype int64 `json:"androidNetworkSubtype,omitempty"`
  3121. // AndroidNetworkType: Android network type.
  3122. // http://developer.android.com/reference/android/net/NetworkInfo.html#getType()
  3123. AndroidNetworkType int64 `json:"androidNetworkType,omitempty"`
  3124. // IosNetworkType: iOS network type as defined in Reachability.h.
  3125. IosNetworkType int64 `json:"iosNetworkType,omitempty"`
  3126. // Kind: Uniquely identifies the type of this resource. Value is always
  3127. // the fixed string games#roomLeaveDiagnostics.
  3128. Kind string `json:"kind,omitempty"`
  3129. // NetworkOperatorCode: The MCC+MNC code for the client's network
  3130. // connection. On Android:
  3131. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperator() On iOS, see:
  3132. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html
  3133. NetworkOperatorCode string `json:"networkOperatorCode,omitempty"`
  3134. // NetworkOperatorName: The name of the carrier of the client's network
  3135. // connection. On Android:
  3136. // http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName() On iOS:
  3137. // https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/CTCarrier/Reference/Reference.html#//apple_ref/occ/instp/CTCarrier/carrierName
  3138. NetworkOperatorName string `json:"networkOperatorName,omitempty"`
  3139. // PeerSession: Diagnostics about all peer sessions.
  3140. PeerSession []*PeerSessionDiagnostics `json:"peerSession,omitempty"`
  3141. // SocketsUsed: Whether or not sockets were used.
  3142. SocketsUsed bool `json:"socketsUsed,omitempty"`
  3143. // ForceSendFields is a list of field names (e.g.
  3144. // "AndroidNetworkSubtype") to unconditionally include in API requests.
  3145. // By default, fields with empty values are omitted from API requests.
  3146. // However, any non-pointer, non-interface field appearing in
  3147. // ForceSendFields will be sent to the server regardless of whether the
  3148. // field is empty or not. This may be used to include empty fields in
  3149. // Patch requests.
  3150. ForceSendFields []string `json:"-"`
  3151. // NullFields is a list of field names (e.g. "AndroidNetworkSubtype") to
  3152. // include in API requests with the JSON null value. By default, fields
  3153. // with empty values are omitted from API requests. However, any field
  3154. // with an empty value appearing in NullFields will be sent to the
  3155. // server as null. It is an error if a field in this list has a
  3156. // non-empty value. This may be used to include null fields in Patch
  3157. // requests.
  3158. NullFields []string `json:"-"`
  3159. }
  3160. func (s *RoomLeaveDiagnostics) MarshalJSON() ([]byte, error) {
  3161. type NoMethod RoomLeaveDiagnostics
  3162. raw := NoMethod(*s)
  3163. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3164. }
  3165. // RoomLeaveRequest: This is a JSON template for a leave room request.
  3166. type RoomLeaveRequest struct {
  3167. // Kind: Uniquely identifies the type of this resource. Value is always
  3168. // the fixed string games#roomLeaveRequest.
  3169. Kind string `json:"kind,omitempty"`
  3170. // LeaveDiagnostics: Diagnostics for a player leaving the room.
  3171. LeaveDiagnostics *RoomLeaveDiagnostics `json:"leaveDiagnostics,omitempty"`
  3172. // Reason: Reason for leaving the match.
  3173. // Possible values are:
  3174. // - "PLAYER_LEFT" - The player chose to leave the room..
  3175. // - "GAME_LEFT" - The game chose to remove the player from the room.
  3176. // - "REALTIME_ABANDONED" - The player switched to another application
  3177. // and abandoned the room.
  3178. // - "REALTIME_PEER_CONNECTION_FAILURE" - The client was unable to
  3179. // establish a connection to other peer(s).
  3180. // - "REALTIME_SERVER_CONNECTION_FAILURE" - The client was unable to
  3181. // communicate with the server.
  3182. // - "REALTIME_SERVER_ERROR" - The client received an error response
  3183. // when it tried to communicate with the server.
  3184. // - "REALTIME_TIMEOUT" - The client timed out while waiting for a room.
  3185. //
  3186. // - "REALTIME_CLIENT_DISCONNECTING" - The client disconnects without
  3187. // first calling Leave.
  3188. // - "REALTIME_SIGN_OUT" - The user signed out of G+ while in the room.
  3189. //
  3190. // - "REALTIME_GAME_CRASHED" - The game crashed.
  3191. // - "REALTIME_ROOM_SERVICE_CRASHED" - RoomAndroidService crashed.
  3192. // - "REALTIME_DIFFERENT_CLIENT_ROOM_OPERATION" - Another client is
  3193. // trying to enter a room.
  3194. // - "REALTIME_SAME_CLIENT_ROOM_OPERATION" - The same client is trying
  3195. // to enter a new room.
  3196. Reason string `json:"reason,omitempty"`
  3197. // ForceSendFields is a list of field names (e.g. "Kind") to
  3198. // unconditionally include in API requests. By default, fields with
  3199. // empty values are omitted from API requests. However, any non-pointer,
  3200. // non-interface field appearing in ForceSendFields will be sent to the
  3201. // server regardless of whether the field is empty or not. This may be
  3202. // used to include empty fields in Patch requests.
  3203. ForceSendFields []string `json:"-"`
  3204. // NullFields is a list of field names (e.g. "Kind") to include in API
  3205. // requests with the JSON null value. By default, fields with empty
  3206. // values are omitted from API requests. However, any field with an
  3207. // empty value appearing in NullFields will be sent to the server as
  3208. // null. It is an error if a field in this list has a non-empty value.
  3209. // This may be used to include null fields in Patch requests.
  3210. NullFields []string `json:"-"`
  3211. }
  3212. func (s *RoomLeaveRequest) MarshalJSON() ([]byte, error) {
  3213. type NoMethod RoomLeaveRequest
  3214. raw := NoMethod(*s)
  3215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3216. }
  3217. // RoomList: This is a JSON template for a list of rooms.
  3218. type RoomList struct {
  3219. // Items: The rooms.
  3220. Items []*Room `json:"items,omitempty"`
  3221. // Kind: Uniquely identifies the type of this resource. Value is always
  3222. // the fixed string games#roomList.
  3223. Kind string `json:"kind,omitempty"`
  3224. // NextPageToken: The pagination token for the next page of results.
  3225. NextPageToken string `json:"nextPageToken,omitempty"`
  3226. // ServerResponse contains the HTTP response code and headers from the
  3227. // server.
  3228. googleapi.ServerResponse `json:"-"`
  3229. // ForceSendFields is a list of field names (e.g. "Items") to
  3230. // unconditionally include in API requests. By default, fields with
  3231. // empty values are omitted from API requests. However, any non-pointer,
  3232. // non-interface field appearing in ForceSendFields will be sent to the
  3233. // server regardless of whether the field is empty or not. This may be
  3234. // used to include empty fields in Patch requests.
  3235. ForceSendFields []string `json:"-"`
  3236. // NullFields is a list of field names (e.g. "Items") to include in API
  3237. // requests with the JSON null value. By default, fields with empty
  3238. // values are omitted from API requests. However, any field with an
  3239. // empty value appearing in NullFields will be sent to the server as
  3240. // null. It is an error if a field in this list has a non-empty value.
  3241. // This may be used to include null fields in Patch requests.
  3242. NullFields []string `json:"-"`
  3243. }
  3244. func (s *RoomList) MarshalJSON() ([]byte, error) {
  3245. type NoMethod RoomList
  3246. raw := NoMethod(*s)
  3247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3248. }
  3249. // RoomModification: This is a JSON template for room modification
  3250. // metadata.
  3251. type RoomModification struct {
  3252. // Kind: Uniquely identifies the type of this resource. Value is always
  3253. // the fixed string games#roomModification.
  3254. Kind string `json:"kind,omitempty"`
  3255. // ModifiedTimestampMillis: The timestamp at which they modified the
  3256. // room, in milliseconds since the epoch in UTC.
  3257. ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"`
  3258. // ParticipantId: The ID of the participant that modified the room.
  3259. ParticipantId string `json:"participantId,omitempty"`
  3260. // ForceSendFields is a list of field names (e.g. "Kind") to
  3261. // unconditionally include in API requests. By default, fields with
  3262. // empty values are omitted from API requests. However, any non-pointer,
  3263. // non-interface field appearing in ForceSendFields will be sent to the
  3264. // server regardless of whether the field is empty or not. This may be
  3265. // used to include empty fields in Patch requests.
  3266. ForceSendFields []string `json:"-"`
  3267. // NullFields is a list of field names (e.g. "Kind") to include in API
  3268. // requests with the JSON null value. By default, fields with empty
  3269. // values are omitted from API requests. However, any field with an
  3270. // empty value appearing in NullFields will be sent to the server as
  3271. // null. It is an error if a field in this list has a non-empty value.
  3272. // This may be used to include null fields in Patch requests.
  3273. NullFields []string `json:"-"`
  3274. }
  3275. func (s *RoomModification) MarshalJSON() ([]byte, error) {
  3276. type NoMethod RoomModification
  3277. raw := NoMethod(*s)
  3278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3279. }
  3280. // RoomP2PStatus: This is a JSON template for an update on the status of
  3281. // a peer in a room.
  3282. type RoomP2PStatus struct {
  3283. // ConnectionSetupLatencyMillis: The amount of time in milliseconds it
  3284. // took to establish connections with this peer.
  3285. ConnectionSetupLatencyMillis int64 `json:"connectionSetupLatencyMillis,omitempty"`
  3286. // Error: The error code in event of a failure.
  3287. // Possible values are:
  3288. // - "P2P_FAILED" - The client failed to establish a P2P connection with
  3289. // the peer.
  3290. // - "PRESENCE_FAILED" - The client failed to register to receive P2P
  3291. // connections.
  3292. // - "RELAY_SERVER_FAILED" - The client received an error when trying to
  3293. // use the relay server to establish a P2P connection with the peer.
  3294. Error string `json:"error,omitempty"`
  3295. // ErrorReason: More detailed diagnostic message returned in event of a
  3296. // failure.
  3297. ErrorReason string `json:"error_reason,omitempty"`
  3298. // Kind: Uniquely identifies the type of this resource. Value is always
  3299. // the fixed string games#roomP2PStatus.
  3300. Kind string `json:"kind,omitempty"`
  3301. // ParticipantId: The ID of the participant.
  3302. ParticipantId string `json:"participantId,omitempty"`
  3303. // Status: The status of the peer in the room.
  3304. // Possible values are:
  3305. // - "CONNECTION_ESTABLISHED" - The client established a P2P connection
  3306. // with the peer.
  3307. // - "CONNECTION_FAILED" - The client failed to establish directed
  3308. // presence with the peer.
  3309. Status string `json:"status,omitempty"`
  3310. // UnreliableRoundtripLatencyMillis: The amount of time in milliseconds
  3311. // it took to send packets back and forth on the unreliable channel with
  3312. // this peer.
  3313. UnreliableRoundtripLatencyMillis int64 `json:"unreliableRoundtripLatencyMillis,omitempty"`
  3314. // ForceSendFields is a list of field names (e.g.
  3315. // "ConnectionSetupLatencyMillis") to unconditionally include in API
  3316. // requests. By default, fields with empty values are omitted from API
  3317. // requests. However, any non-pointer, non-interface field appearing in
  3318. // ForceSendFields will be sent to the server regardless of whether the
  3319. // field is empty or not. This may be used to include empty fields in
  3320. // Patch requests.
  3321. ForceSendFields []string `json:"-"`
  3322. // NullFields is a list of field names (e.g.
  3323. // "ConnectionSetupLatencyMillis") to include in API requests with the
  3324. // JSON null value. By default, fields with empty values are omitted
  3325. // from API requests. However, any field with an empty value appearing
  3326. // in NullFields will be sent to the server as null. It is an error if a
  3327. // field in this list has a non-empty value. This may be used to include
  3328. // null fields in Patch requests.
  3329. NullFields []string `json:"-"`
  3330. }
  3331. func (s *RoomP2PStatus) MarshalJSON() ([]byte, error) {
  3332. type NoMethod RoomP2PStatus
  3333. raw := NoMethod(*s)
  3334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3335. }
  3336. // RoomP2PStatuses: This is a JSON template for an update on the status
  3337. // of peers in a room.
  3338. type RoomP2PStatuses struct {
  3339. // Kind: Uniquely identifies the type of this resource. Value is always
  3340. // the fixed string games#roomP2PStatuses.
  3341. Kind string `json:"kind,omitempty"`
  3342. // Updates: The updates for the peers.
  3343. Updates []*RoomP2PStatus `json:"updates,omitempty"`
  3344. // ForceSendFields is a list of field names (e.g. "Kind") to
  3345. // unconditionally include in API requests. By default, fields with
  3346. // empty values are omitted from API requests. However, any non-pointer,
  3347. // non-interface field appearing in ForceSendFields will be sent to the
  3348. // server regardless of whether the field is empty or not. This may be
  3349. // used to include empty fields in Patch requests.
  3350. ForceSendFields []string `json:"-"`
  3351. // NullFields is a list of field names (e.g. "Kind") to include in API
  3352. // requests with the JSON null value. By default, fields with empty
  3353. // values are omitted from API requests. However, any field with an
  3354. // empty value appearing in NullFields will be sent to the server as
  3355. // null. It is an error if a field in this list has a non-empty value.
  3356. // This may be used to include null fields in Patch requests.
  3357. NullFields []string `json:"-"`
  3358. }
  3359. func (s *RoomP2PStatuses) MarshalJSON() ([]byte, error) {
  3360. type NoMethod RoomP2PStatuses
  3361. raw := NoMethod(*s)
  3362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3363. }
  3364. // RoomParticipant: This is a JSON template for a participant in a room.
  3365. type RoomParticipant struct {
  3366. // AutoMatched: True if this participant was auto-matched with the
  3367. // requesting player.
  3368. AutoMatched bool `json:"autoMatched,omitempty"`
  3369. // AutoMatchedPlayer: Information about a player that has been
  3370. // anonymously auto-matched against the requesting player. (Either
  3371. // player or autoMatchedPlayer will be set.)
  3372. AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"`
  3373. // Capabilities: The capabilities which can be used when communicating
  3374. // with this participant.
  3375. Capabilities []string `json:"capabilities,omitempty"`
  3376. // ClientAddress: Client address for the participant.
  3377. ClientAddress *RoomClientAddress `json:"clientAddress,omitempty"`
  3378. // Connected: True if this participant is in the fully connected set of
  3379. // peers in the room.
  3380. Connected bool `json:"connected,omitempty"`
  3381. // Id: An identifier for the participant in the scope of the room.
  3382. // Cannot be used to identify a player across rooms or in other
  3383. // contexts.
  3384. Id string `json:"id,omitempty"`
  3385. // Kind: Uniquely identifies the type of this resource. Value is always
  3386. // the fixed string games#roomParticipant.
  3387. Kind string `json:"kind,omitempty"`
  3388. // LeaveReason: The reason the participant left the room; populated if
  3389. // the participant status is PARTICIPANT_LEFT.
  3390. // Possible values are:
  3391. // - "PLAYER_LEFT" - The player explicitly chose to leave the room.
  3392. // - "GAME_LEFT" - The game chose to remove the player from the room.
  3393. // - "ABANDONED" - The player switched to another application and
  3394. // abandoned the room.
  3395. // - "PEER_CONNECTION_FAILURE" - The client was unable to establish or
  3396. // maintain a connection to other peer(s) in the room.
  3397. // - "SERVER_ERROR" - The client received an error response when it
  3398. // tried to communicate with the server.
  3399. // - "TIMEOUT" - The client timed out while waiting for players to join
  3400. // and connect.
  3401. // - "PRESENCE_FAILURE" - The client's XMPP connection ended abruptly.
  3402. LeaveReason string `json:"leaveReason,omitempty"`
  3403. // Player: Information about the player. Not populated if this player
  3404. // was anonymously auto-matched against the requesting player. (Either
  3405. // player or autoMatchedPlayer will be set.)
  3406. Player *Player `json:"player,omitempty"`
  3407. // Status: The status of the participant with respect to the
  3408. // room.
  3409. // Possible values are:
  3410. // - "PARTICIPANT_INVITED" - The participant has been invited to join
  3411. // the room, but has not yet responded.
  3412. // - "PARTICIPANT_JOINED" - The participant has joined the room (either
  3413. // after creating it or accepting an invitation.)
  3414. // - "PARTICIPANT_DECLINED" - The participant declined an invitation to
  3415. // join the room.
  3416. // - "PARTICIPANT_LEFT" - The participant joined the room and then left
  3417. // it.
  3418. Status string `json:"status,omitempty"`
  3419. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  3420. // unconditionally include in API requests. By default, fields with
  3421. // empty values are omitted from API requests. However, any non-pointer,
  3422. // non-interface field appearing in ForceSendFields will be sent to the
  3423. // server regardless of whether the field is empty or not. This may be
  3424. // used to include empty fields in Patch requests.
  3425. ForceSendFields []string `json:"-"`
  3426. // NullFields is a list of field names (e.g. "AutoMatched") to include
  3427. // in API requests with the JSON null value. By default, fields with
  3428. // empty values are omitted from API requests. However, any field with
  3429. // an empty value appearing in NullFields will be sent to the server as
  3430. // null. It is an error if a field in this list has a non-empty value.
  3431. // This may be used to include null fields in Patch requests.
  3432. NullFields []string `json:"-"`
  3433. }
  3434. func (s *RoomParticipant) MarshalJSON() ([]byte, error) {
  3435. type NoMethod RoomParticipant
  3436. raw := NoMethod(*s)
  3437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3438. }
  3439. // RoomStatus: This is a JSON template for the status of a room that the
  3440. // player has joined.
  3441. type RoomStatus struct {
  3442. // AutoMatchingStatus: Auto-matching status for this room. Not set if
  3443. // the room is not currently in the automatching queue.
  3444. AutoMatchingStatus *RoomAutoMatchStatus `json:"autoMatchingStatus,omitempty"`
  3445. // Kind: Uniquely identifies the type of this resource. Value is always
  3446. // the fixed string games#roomStatus.
  3447. Kind string `json:"kind,omitempty"`
  3448. // Participants: The participants involved in the room, along with their
  3449. // statuses. Includes participants who have left or declined
  3450. // invitations.
  3451. Participants []*RoomParticipant `json:"participants,omitempty"`
  3452. // RoomId: Globally unique ID for a room.
  3453. RoomId string `json:"roomId,omitempty"`
  3454. // Status: The status of the room.
  3455. // Possible values are:
  3456. // - "ROOM_INVITING" - One or more players have been invited and not
  3457. // responded.
  3458. // - "ROOM_AUTO_MATCHING" - One or more slots need to be filled by
  3459. // auto-matching.
  3460. // - "ROOM_CONNECTING" - Players have joined are connecting to each
  3461. // other (either before or after auto-matching).
  3462. // - "ROOM_ACTIVE" - All players have joined and connected to each
  3463. // other.
  3464. // - "ROOM_DELETED" - All joined players have left.
  3465. Status string `json:"status,omitempty"`
  3466. // StatusVersion: The version of the status for the room: an increasing
  3467. // counter, used by the client to ignore out-of-order updates to room
  3468. // status.
  3469. StatusVersion int64 `json:"statusVersion,omitempty"`
  3470. // ServerResponse contains the HTTP response code and headers from the
  3471. // server.
  3472. googleapi.ServerResponse `json:"-"`
  3473. // ForceSendFields is a list of field names (e.g. "AutoMatchingStatus")
  3474. // to unconditionally include in API requests. By default, fields with
  3475. // empty values are omitted from API requests. However, any non-pointer,
  3476. // non-interface field appearing in ForceSendFields will be sent to the
  3477. // server regardless of whether the field is empty or not. This may be
  3478. // used to include empty fields in Patch requests.
  3479. ForceSendFields []string `json:"-"`
  3480. // NullFields is a list of field names (e.g. "AutoMatchingStatus") to
  3481. // include in API requests with the JSON null value. By default, fields
  3482. // with empty values are omitted from API requests. However, any field
  3483. // with an empty value appearing in NullFields will be sent to the
  3484. // server as null. It is an error if a field in this list has a
  3485. // non-empty value. This may be used to include null fields in Patch
  3486. // requests.
  3487. NullFields []string `json:"-"`
  3488. }
  3489. func (s *RoomStatus) MarshalJSON() ([]byte, error) {
  3490. type NoMethod RoomStatus
  3491. raw := NoMethod(*s)
  3492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3493. }
  3494. // ScoreSubmission: This is a JSON template for a request to submit a
  3495. // score to leaderboards.
  3496. type ScoreSubmission struct {
  3497. // Kind: Uniquely identifies the type of this resource. Value is always
  3498. // the fixed string games#scoreSubmission.
  3499. Kind string `json:"kind,omitempty"`
  3500. // LeaderboardId: The leaderboard this score is being submitted to.
  3501. LeaderboardId string `json:"leaderboardId,omitempty"`
  3502. // Score: The new score being submitted.
  3503. Score int64 `json:"score,omitempty,string"`
  3504. // ScoreTag: Additional information about this score. Values will
  3505. // contain no more than 64 URI-safe characters as defined by section 2.3
  3506. // of RFC 3986.
  3507. ScoreTag string `json:"scoreTag,omitempty"`
  3508. // Signature: Signature Values will contain URI-safe characters as
  3509. // defined by section 2.3 of RFC 3986.
  3510. Signature string `json:"signature,omitempty"`
  3511. // ForceSendFields is a list of field names (e.g. "Kind") to
  3512. // unconditionally include in API requests. By default, fields with
  3513. // empty values are omitted from API requests. However, any non-pointer,
  3514. // non-interface field appearing in ForceSendFields will be sent to the
  3515. // server regardless of whether the field is empty or not. This may be
  3516. // used to include empty fields in Patch requests.
  3517. ForceSendFields []string `json:"-"`
  3518. // NullFields is a list of field names (e.g. "Kind") to include in API
  3519. // requests with the JSON null value. By default, fields with empty
  3520. // values are omitted from API requests. However, any field with an
  3521. // empty value appearing in NullFields will be sent to the server as
  3522. // null. It is an error if a field in this list has a non-empty value.
  3523. // This may be used to include null fields in Patch requests.
  3524. NullFields []string `json:"-"`
  3525. }
  3526. func (s *ScoreSubmission) MarshalJSON() ([]byte, error) {
  3527. type NoMethod ScoreSubmission
  3528. raw := NoMethod(*s)
  3529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3530. }
  3531. // Snapshot: This is a JSON template for an snapshot object.
  3532. type Snapshot struct {
  3533. // CoverImage: The cover image of this snapshot. May be absent if there
  3534. // is no image.
  3535. CoverImage *SnapshotImage `json:"coverImage,omitempty"`
  3536. // Description: The description of this snapshot.
  3537. Description string `json:"description,omitempty"`
  3538. // DriveId: The ID of the file underlying this snapshot in the Drive
  3539. // API. Only present if the snapshot is a view on a Drive file and the
  3540. // file is owned by the caller.
  3541. DriveId string `json:"driveId,omitempty"`
  3542. // DurationMillis: The duration associated with this snapshot, in
  3543. // millis.
  3544. DurationMillis int64 `json:"durationMillis,omitempty,string"`
  3545. // Id: The ID of the snapshot.
  3546. Id string `json:"id,omitempty"`
  3547. // Kind: Uniquely identifies the type of this resource. Value is always
  3548. // the fixed string games#snapshot.
  3549. Kind string `json:"kind,omitempty"`
  3550. // LastModifiedMillis: The timestamp (in millis since Unix epoch) of the
  3551. // last modification to this snapshot.
  3552. LastModifiedMillis int64 `json:"lastModifiedMillis,omitempty,string"`
  3553. // ProgressValue: The progress value (64-bit integer set by developer)
  3554. // associated with this snapshot.
  3555. ProgressValue int64 `json:"progressValue,omitempty,string"`
  3556. // Title: The title of this snapshot.
  3557. Title string `json:"title,omitempty"`
  3558. // Type: The type of this snapshot.
  3559. // Possible values are:
  3560. // - "SAVE_GAME" - A snapshot representing a save game.
  3561. Type string `json:"type,omitempty"`
  3562. // UniqueName: The unique name provided when the snapshot was created.
  3563. UniqueName string `json:"uniqueName,omitempty"`
  3564. // ServerResponse contains the HTTP response code and headers from the
  3565. // server.
  3566. googleapi.ServerResponse `json:"-"`
  3567. // ForceSendFields is a list of field names (e.g. "CoverImage") 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. "CoverImage") to include in
  3575. // API 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 *Snapshot) MarshalJSON() ([]byte, error) {
  3583. type NoMethod Snapshot
  3584. raw := NoMethod(*s)
  3585. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3586. }
  3587. // SnapshotImage: This is a JSON template for an image of a snapshot.
  3588. type SnapshotImage struct {
  3589. // Height: The height of the image.
  3590. Height int64 `json:"height,omitempty"`
  3591. // Kind: Uniquely identifies the type of this resource. Value is always
  3592. // the fixed string games#snapshotImage.
  3593. Kind string `json:"kind,omitempty"`
  3594. // MimeType: The MIME type of the image.
  3595. MimeType string `json:"mime_type,omitempty"`
  3596. // Url: The URL of the image. This URL may be invalidated at any time
  3597. // and should not be cached.
  3598. Url string `json:"url,omitempty"`
  3599. // Width: The width of the image.
  3600. Width int64 `json:"width,omitempty"`
  3601. // ForceSendFields is a list of field names (e.g. "Height") to
  3602. // unconditionally include in API requests. By default, fields with
  3603. // empty values are omitted from API requests. However, any non-pointer,
  3604. // non-interface field appearing in ForceSendFields will be sent to the
  3605. // server regardless of whether the field is empty or not. This may be
  3606. // used to include empty fields in Patch requests.
  3607. ForceSendFields []string `json:"-"`
  3608. // NullFields is a list of field names (e.g. "Height") to include in API
  3609. // requests with the JSON null value. By default, fields with empty
  3610. // values are omitted from API requests. However, any field with an
  3611. // empty value appearing in NullFields will be sent to the server as
  3612. // null. It is an error if a field in this list has a non-empty value.
  3613. // This may be used to include null fields in Patch requests.
  3614. NullFields []string `json:"-"`
  3615. }
  3616. func (s *SnapshotImage) MarshalJSON() ([]byte, error) {
  3617. type NoMethod SnapshotImage
  3618. raw := NoMethod(*s)
  3619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3620. }
  3621. // SnapshotListResponse: This is a JSON template for a list of snapshot
  3622. // objects.
  3623. type SnapshotListResponse struct {
  3624. // Items: The snapshots.
  3625. Items []*Snapshot `json:"items,omitempty"`
  3626. // Kind: Uniquely identifies the type of this resource. Value is always
  3627. // the fixed string games#snapshotListResponse.
  3628. Kind string `json:"kind,omitempty"`
  3629. // NextPageToken: Token corresponding to the next page of results. If
  3630. // there are no more results, the token is omitted.
  3631. NextPageToken string `json:"nextPageToken,omitempty"`
  3632. // ServerResponse contains the HTTP response code and headers from the
  3633. // server.
  3634. googleapi.ServerResponse `json:"-"`
  3635. // ForceSendFields is a list of field names (e.g. "Items") to
  3636. // unconditionally include in API requests. By default, fields with
  3637. // empty values are omitted from API requests. However, any non-pointer,
  3638. // non-interface field appearing in ForceSendFields will be sent to the
  3639. // server regardless of whether the field is empty or not. This may be
  3640. // used to include empty fields in Patch requests.
  3641. ForceSendFields []string `json:"-"`
  3642. // NullFields is a list of field names (e.g. "Items") to include in API
  3643. // requests with the JSON null value. By default, fields with empty
  3644. // values are omitted from API requests. However, any field with an
  3645. // empty value appearing in NullFields will be sent to the server as
  3646. // null. It is an error if a field in this list has a non-empty value.
  3647. // This may be used to include null fields in Patch requests.
  3648. NullFields []string `json:"-"`
  3649. }
  3650. func (s *SnapshotListResponse) MarshalJSON() ([]byte, error) {
  3651. type NoMethod SnapshotListResponse
  3652. raw := NoMethod(*s)
  3653. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3654. }
  3655. // TurnBasedAutoMatchingCriteria: This is a JSON template for an
  3656. // turn-based auto-match criteria object.
  3657. type TurnBasedAutoMatchingCriteria struct {
  3658. // ExclusiveBitmask: A bitmask indicating when auto-matches are valid.
  3659. // When ANDed with other exclusive bitmasks, the result must be zero.
  3660. // Can be used to support exclusive roles within a game.
  3661. ExclusiveBitmask int64 `json:"exclusiveBitmask,omitempty,string"`
  3662. // Kind: Uniquely identifies the type of this resource. Value is always
  3663. // the fixed string games#turnBasedAutoMatchingCriteria.
  3664. Kind string `json:"kind,omitempty"`
  3665. // MaxAutoMatchingPlayers: The maximum number of players that should be
  3666. // added to the match by auto-matching.
  3667. MaxAutoMatchingPlayers int64 `json:"maxAutoMatchingPlayers,omitempty"`
  3668. // MinAutoMatchingPlayers: The minimum number of players that should be
  3669. // added to the match by auto-matching.
  3670. MinAutoMatchingPlayers int64 `json:"minAutoMatchingPlayers,omitempty"`
  3671. // ForceSendFields is a list of field names (e.g. "ExclusiveBitmask") to
  3672. // unconditionally include in API requests. By default, fields with
  3673. // empty values are omitted from API requests. However, any non-pointer,
  3674. // non-interface field appearing in ForceSendFields will be sent to the
  3675. // server regardless of whether the field is empty or not. This may be
  3676. // used to include empty fields in Patch requests.
  3677. ForceSendFields []string `json:"-"`
  3678. // NullFields is a list of field names (e.g. "ExclusiveBitmask") to
  3679. // include in API requests with the JSON null value. By default, fields
  3680. // with empty values are omitted from API requests. However, any field
  3681. // with an empty value appearing in NullFields will be sent to the
  3682. // server as null. It is an error if a field in this list has a
  3683. // non-empty value. This may be used to include null fields in Patch
  3684. // requests.
  3685. NullFields []string `json:"-"`
  3686. }
  3687. func (s *TurnBasedAutoMatchingCriteria) MarshalJSON() ([]byte, error) {
  3688. type NoMethod TurnBasedAutoMatchingCriteria
  3689. raw := NoMethod(*s)
  3690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3691. }
  3692. // TurnBasedMatch: This is a JSON template for a turn-based match
  3693. // resource object.
  3694. type TurnBasedMatch struct {
  3695. // ApplicationId: The ID of the application being played.
  3696. ApplicationId string `json:"applicationId,omitempty"`
  3697. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3698. // match.
  3699. AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3700. // CreationDetails: Details about the match creation.
  3701. CreationDetails *TurnBasedMatchModification `json:"creationDetails,omitempty"`
  3702. // Data: The data / game state for this match.
  3703. Data *TurnBasedMatchData `json:"data,omitempty"`
  3704. // Description: This short description is generated by our servers based
  3705. // on turn state and is localized and worded relative to the player
  3706. // requesting the match. It is intended to be displayed when the match
  3707. // is shown in a list.
  3708. Description string `json:"description,omitempty"`
  3709. // InviterId: The ID of the participant that invited the user to the
  3710. // match. Not set if the user was not invited to the match.
  3711. InviterId string `json:"inviterId,omitempty"`
  3712. // Kind: Uniquely identifies the type of this resource. Value is always
  3713. // the fixed string games#turnBasedMatch.
  3714. Kind string `json:"kind,omitempty"`
  3715. // LastUpdateDetails: Details about the last update to the match.
  3716. LastUpdateDetails *TurnBasedMatchModification `json:"lastUpdateDetails,omitempty"`
  3717. // MatchId: Globally unique ID for a turn-based match.
  3718. MatchId string `json:"matchId,omitempty"`
  3719. // MatchNumber: The number of the match in a chain of rematches. Will be
  3720. // set to 1 for the first match and incremented by 1 for each rematch.
  3721. MatchNumber int64 `json:"matchNumber,omitempty"`
  3722. // MatchVersion: The version of this match: an increasing counter, used
  3723. // to avoid out-of-date updates to the match.
  3724. MatchVersion int64 `json:"matchVersion,omitempty"`
  3725. // Participants: The participants involved in the match, along with
  3726. // their statuses. Includes participants who have left or declined
  3727. // invitations.
  3728. Participants []*TurnBasedMatchParticipant `json:"participants,omitempty"`
  3729. // PendingParticipantId: The ID of the participant that is taking a
  3730. // turn.
  3731. PendingParticipantId string `json:"pendingParticipantId,omitempty"`
  3732. // PreviousMatchData: The data / game state for the previous match; set
  3733. // for the first turn of rematches only.
  3734. PreviousMatchData *TurnBasedMatchData `json:"previousMatchData,omitempty"`
  3735. // RematchId: The ID of a rematch of this match. Only set for completed
  3736. // matches that have been rematched.
  3737. RematchId string `json:"rematchId,omitempty"`
  3738. // Results: The results reported for this match.
  3739. Results []*ParticipantResult `json:"results,omitempty"`
  3740. // Status: The status of the match.
  3741. // Possible values are:
  3742. // - "MATCH_AUTO_MATCHING" - One or more slots need to be filled by
  3743. // auto-matching; the match cannot be established until they are filled.
  3744. //
  3745. // - "MATCH_ACTIVE" - The match has started.
  3746. // - "MATCH_COMPLETE" - The match has finished.
  3747. // - "MATCH_CANCELED" - The match was canceled.
  3748. // - "MATCH_EXPIRED" - The match expired due to inactivity.
  3749. // - "MATCH_DELETED" - The match should no longer be shown on the
  3750. // client. Returned only for tombstones for matches when sync is called.
  3751. Status string `json:"status,omitempty"`
  3752. // UserMatchStatus: The status of the current user in the match. Derived
  3753. // from the match type, match status, the user's participant status, and
  3754. // the pending participant for the match.
  3755. // Possible values are:
  3756. // - "USER_INVITED" - The user has been invited to join the match and
  3757. // has not responded yet.
  3758. // - "USER_AWAITING_TURN" - The user is waiting for their turn.
  3759. // - "USER_TURN" - The user has an action to take in the match.
  3760. // - "USER_MATCH_COMPLETED" - The match has ended (it is completed,
  3761. // canceled, or expired.)
  3762. UserMatchStatus string `json:"userMatchStatus,omitempty"`
  3763. // Variant: The variant / mode of the application being played; can be
  3764. // any integer value, or left blank.
  3765. Variant int64 `json:"variant,omitempty"`
  3766. // WithParticipantId: The ID of another participant in the match that
  3767. // can be used when describing the participants the user is playing
  3768. // with.
  3769. WithParticipantId string `json:"withParticipantId,omitempty"`
  3770. // ServerResponse contains the HTTP response code and headers from the
  3771. // server.
  3772. googleapi.ServerResponse `json:"-"`
  3773. // ForceSendFields is a list of field names (e.g. "ApplicationId") to
  3774. // unconditionally include in API requests. By default, fields with
  3775. // empty values are omitted from API requests. However, any non-pointer,
  3776. // non-interface field appearing in ForceSendFields will be sent to the
  3777. // server regardless of whether the field is empty or not. This may be
  3778. // used to include empty fields in Patch requests.
  3779. ForceSendFields []string `json:"-"`
  3780. // NullFields is a list of field names (e.g. "ApplicationId") to include
  3781. // in API requests with the JSON null value. By default, fields with
  3782. // empty values are omitted from API requests. However, any field with
  3783. // an empty value appearing in NullFields will be sent to the server as
  3784. // null. It is an error if a field in this list has a non-empty value.
  3785. // This may be used to include null fields in Patch requests.
  3786. NullFields []string `json:"-"`
  3787. }
  3788. func (s *TurnBasedMatch) MarshalJSON() ([]byte, error) {
  3789. type NoMethod TurnBasedMatch
  3790. raw := NoMethod(*s)
  3791. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3792. }
  3793. // TurnBasedMatchCreateRequest: This is a JSON template for a turn-based
  3794. // match creation request.
  3795. type TurnBasedMatchCreateRequest struct {
  3796. // AutoMatchingCriteria: Criteria for auto-matching players into this
  3797. // match.
  3798. AutoMatchingCriteria *TurnBasedAutoMatchingCriteria `json:"autoMatchingCriteria,omitempty"`
  3799. // InvitedPlayerIds: The player ids to invite to the match.
  3800. InvitedPlayerIds []string `json:"invitedPlayerIds,omitempty"`
  3801. // Kind: Uniquely identifies the type of this resource. Value is always
  3802. // the fixed string games#turnBasedMatchCreateRequest.
  3803. Kind string `json:"kind,omitempty"`
  3804. // RequestId: A randomly generated numeric ID. This number is used at
  3805. // the server to ensure that the request is handled correctly across
  3806. // retries.
  3807. RequestId int64 `json:"requestId,omitempty,string"`
  3808. // Variant: The variant / mode of the application to be played. This can
  3809. // be any integer value, or left blank. You should use a small number of
  3810. // variants to keep the auto-matching pool as large as possible.
  3811. Variant int64 `json:"variant,omitempty"`
  3812. // ForceSendFields is a list of field names (e.g.
  3813. // "AutoMatchingCriteria") to unconditionally include in API requests.
  3814. // By default, fields with empty values are omitted from API requests.
  3815. // However, any non-pointer, non-interface field appearing in
  3816. // ForceSendFields will be sent to the server regardless of whether the
  3817. // field is empty or not. This may be used to include empty fields in
  3818. // Patch requests.
  3819. ForceSendFields []string `json:"-"`
  3820. // NullFields is a list of field names (e.g. "AutoMatchingCriteria") to
  3821. // include in API requests with the JSON null value. By default, fields
  3822. // with empty values are omitted from API requests. However, any field
  3823. // with an empty value appearing in NullFields will be sent to the
  3824. // server as null. It is an error if a field in this list has a
  3825. // non-empty value. This may be used to include null fields in Patch
  3826. // requests.
  3827. NullFields []string `json:"-"`
  3828. }
  3829. func (s *TurnBasedMatchCreateRequest) MarshalJSON() ([]byte, error) {
  3830. type NoMethod TurnBasedMatchCreateRequest
  3831. raw := NoMethod(*s)
  3832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3833. }
  3834. // TurnBasedMatchData: This is a JSON template for a turn-based match
  3835. // data object.
  3836. type TurnBasedMatchData struct {
  3837. // Data: The byte representation of the data (limited to 128 kB), as a
  3838. // Base64-encoded string with the URL_SAFE encoding option.
  3839. Data string `json:"data,omitempty"`
  3840. // DataAvailable: True if this match has data available but it wasn't
  3841. // returned in a list response; fetching the match individually will
  3842. // retrieve this data.
  3843. DataAvailable bool `json:"dataAvailable,omitempty"`
  3844. // Kind: Uniquely identifies the type of this resource. Value is always
  3845. // the fixed string games#turnBasedMatchData.
  3846. Kind string `json:"kind,omitempty"`
  3847. // ForceSendFields is a list of field names (e.g. "Data") to
  3848. // unconditionally include in API requests. By default, fields with
  3849. // empty values are omitted from API requests. However, any non-pointer,
  3850. // non-interface field appearing in ForceSendFields will be sent to the
  3851. // server regardless of whether the field is empty or not. This may be
  3852. // used to include empty fields in Patch requests.
  3853. ForceSendFields []string `json:"-"`
  3854. // NullFields is a list of field names (e.g. "Data") to include in API
  3855. // requests with the JSON null value. By default, fields with empty
  3856. // values are omitted from API requests. However, any field with an
  3857. // empty value appearing in NullFields will be sent to the server as
  3858. // null. It is an error if a field in this list has a non-empty value.
  3859. // This may be used to include null fields in Patch requests.
  3860. NullFields []string `json:"-"`
  3861. }
  3862. func (s *TurnBasedMatchData) MarshalJSON() ([]byte, error) {
  3863. type NoMethod TurnBasedMatchData
  3864. raw := NoMethod(*s)
  3865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3866. }
  3867. // TurnBasedMatchDataRequest: This is a JSON template for sending a
  3868. // turn-based match data object.
  3869. type TurnBasedMatchDataRequest struct {
  3870. // Data: The byte representation of the data (limited to 128 kB), as a
  3871. // Base64-encoded string with the URL_SAFE encoding option.
  3872. Data string `json:"data,omitempty"`
  3873. // Kind: Uniquely identifies the type of this resource. Value is always
  3874. // the fixed string games#turnBasedMatchDataRequest.
  3875. Kind string `json:"kind,omitempty"`
  3876. // ForceSendFields is a list of field names (e.g. "Data") to
  3877. // unconditionally include in API requests. By default, fields with
  3878. // empty values are omitted from API requests. However, any non-pointer,
  3879. // non-interface field appearing in ForceSendFields will be sent to the
  3880. // server regardless of whether the field is empty or not. This may be
  3881. // used to include empty fields in Patch requests.
  3882. ForceSendFields []string `json:"-"`
  3883. // NullFields is a list of field names (e.g. "Data") to include in API
  3884. // requests with the JSON null value. By default, fields with empty
  3885. // values are omitted from API requests. However, any field with an
  3886. // empty value appearing in NullFields will be sent to the server as
  3887. // null. It is an error if a field in this list has a non-empty value.
  3888. // This may be used to include null fields in Patch requests.
  3889. NullFields []string `json:"-"`
  3890. }
  3891. func (s *TurnBasedMatchDataRequest) MarshalJSON() ([]byte, error) {
  3892. type NoMethod TurnBasedMatchDataRequest
  3893. raw := NoMethod(*s)
  3894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3895. }
  3896. // TurnBasedMatchList: This is a JSON template for a list of turn-based
  3897. // matches.
  3898. type TurnBasedMatchList struct {
  3899. // Items: The matches.
  3900. Items []*TurnBasedMatch `json:"items,omitempty"`
  3901. // Kind: Uniquely identifies the type of this resource. Value is always
  3902. // the fixed string games#turnBasedMatchList.
  3903. Kind string `json:"kind,omitempty"`
  3904. // NextPageToken: The pagination token for the next page of results.
  3905. NextPageToken string `json:"nextPageToken,omitempty"`
  3906. // ServerResponse contains the HTTP response code and headers from the
  3907. // server.
  3908. googleapi.ServerResponse `json:"-"`
  3909. // ForceSendFields is a list of field names (e.g. "Items") to
  3910. // unconditionally include in API requests. By default, fields with
  3911. // empty values are omitted from API requests. However, any non-pointer,
  3912. // non-interface field appearing in ForceSendFields will be sent to the
  3913. // server regardless of whether the field is empty or not. This may be
  3914. // used to include empty fields in Patch requests.
  3915. ForceSendFields []string `json:"-"`
  3916. // NullFields is a list of field names (e.g. "Items") to include in API
  3917. // requests with the JSON null value. By default, fields with empty
  3918. // values are omitted from API requests. However, any field with an
  3919. // empty value appearing in NullFields will be sent to the server as
  3920. // null. It is an error if a field in this list has a non-empty value.
  3921. // This may be used to include null fields in Patch requests.
  3922. NullFields []string `json:"-"`
  3923. }
  3924. func (s *TurnBasedMatchList) MarshalJSON() ([]byte, error) {
  3925. type NoMethod TurnBasedMatchList
  3926. raw := NoMethod(*s)
  3927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3928. }
  3929. // TurnBasedMatchModification: This is a JSON template for turn-based
  3930. // match modification metadata.
  3931. type TurnBasedMatchModification struct {
  3932. // Kind: Uniquely identifies the type of this resource. Value is always
  3933. // the fixed string games#turnBasedMatchModification.
  3934. Kind string `json:"kind,omitempty"`
  3935. // ModifiedTimestampMillis: The timestamp at which they modified the
  3936. // match, in milliseconds since the epoch in UTC.
  3937. ModifiedTimestampMillis int64 `json:"modifiedTimestampMillis,omitempty,string"`
  3938. // ParticipantId: The ID of the participant that modified the match.
  3939. ParticipantId string `json:"participantId,omitempty"`
  3940. // ForceSendFields is a list of field names (e.g. "Kind") to
  3941. // unconditionally include in API requests. By default, fields with
  3942. // empty values are omitted from API requests. However, any non-pointer,
  3943. // non-interface field appearing in ForceSendFields will be sent to the
  3944. // server regardless of whether the field is empty or not. This may be
  3945. // used to include empty fields in Patch requests.
  3946. ForceSendFields []string `json:"-"`
  3947. // NullFields is a list of field names (e.g. "Kind") to include in API
  3948. // requests with the JSON null value. By default, fields with empty
  3949. // values are omitted from API requests. However, any field with an
  3950. // empty value appearing in NullFields will be sent to the server as
  3951. // null. It is an error if a field in this list has a non-empty value.
  3952. // This may be used to include null fields in Patch requests.
  3953. NullFields []string `json:"-"`
  3954. }
  3955. func (s *TurnBasedMatchModification) MarshalJSON() ([]byte, error) {
  3956. type NoMethod TurnBasedMatchModification
  3957. raw := NoMethod(*s)
  3958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3959. }
  3960. // TurnBasedMatchParticipant: This is a JSON template for a participant
  3961. // in a turn-based match.
  3962. type TurnBasedMatchParticipant struct {
  3963. // AutoMatched: True if this participant was auto-matched with the
  3964. // requesting player.
  3965. AutoMatched bool `json:"autoMatched,omitempty"`
  3966. // AutoMatchedPlayer: Information about a player that has been
  3967. // anonymously auto-matched against the requesting player. (Either
  3968. // player or autoMatchedPlayer will be set.)
  3969. AutoMatchedPlayer *AnonymousPlayer `json:"autoMatchedPlayer,omitempty"`
  3970. // Id: An identifier for the participant in the scope of the match.
  3971. // Cannot be used to identify a player across matches or in other
  3972. // contexts.
  3973. Id string `json:"id,omitempty"`
  3974. // Kind: Uniquely identifies the type of this resource. Value is always
  3975. // the fixed string games#turnBasedMatchParticipant.
  3976. Kind string `json:"kind,omitempty"`
  3977. // Player: Information about the player. Not populated if this player
  3978. // was anonymously auto-matched against the requesting player. (Either
  3979. // player or autoMatchedPlayer will be set.)
  3980. Player *Player `json:"player,omitempty"`
  3981. // Status: The status of the participant with respect to the
  3982. // match.
  3983. // Possible values are:
  3984. // - "PARTICIPANT_NOT_INVITED_YET" - The participant is slated to be
  3985. // invited to the match, but the invitation has not been sent; the
  3986. // invite will be sent when it becomes their turn.
  3987. // - "PARTICIPANT_INVITED" - The participant has been invited to join
  3988. // the match, but has not yet responded.
  3989. // - "PARTICIPANT_JOINED" - The participant has joined the match (either
  3990. // after creating it or accepting an invitation.)
  3991. // - "PARTICIPANT_DECLINED" - The participant declined an invitation to
  3992. // join the match.
  3993. // - "PARTICIPANT_LEFT" - The participant joined the match and then left
  3994. // it.
  3995. // - "PARTICIPANT_FINISHED" - The participant finished playing in the
  3996. // match.
  3997. // - "PARTICIPANT_UNRESPONSIVE" - The participant did not take their
  3998. // turn in the allotted time.
  3999. Status string `json:"status,omitempty"`
  4000. // ForceSendFields is a list of field names (e.g. "AutoMatched") to
  4001. // unconditionally include in API requests. By default, fields with
  4002. // empty values are omitted from API requests. However, any non-pointer,
  4003. // non-interface field appearing in ForceSendFields will be sent to the
  4004. // server regardless of whether the field is empty or not. This may be
  4005. // used to include empty fields in Patch requests.
  4006. ForceSendFields []string `json:"-"`
  4007. // NullFields is a list of field names (e.g. "AutoMatched") to include
  4008. // in API requests with the JSON null value. By default, fields with
  4009. // empty values are omitted from API requests. However, any field with
  4010. // an empty value appearing in NullFields will be sent to the server as
  4011. // null. It is an error if a field in this list has a non-empty value.
  4012. // This may be used to include null fields in Patch requests.
  4013. NullFields []string `json:"-"`
  4014. }
  4015. func (s *TurnBasedMatchParticipant) MarshalJSON() ([]byte, error) {
  4016. type NoMethod TurnBasedMatchParticipant
  4017. raw := NoMethod(*s)
  4018. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4019. }
  4020. // TurnBasedMatchRematch: This is a JSON template for a rematch
  4021. // response.
  4022. type TurnBasedMatchRematch struct {
  4023. // Kind: Uniquely identifies the type of this resource. Value is always
  4024. // the fixed string games#turnBasedMatchRematch.
  4025. Kind string `json:"kind,omitempty"`
  4026. // PreviousMatch: The old match that the rematch was created from; will
  4027. // be updated such that the rematchId field will point at the new match.
  4028. PreviousMatch *TurnBasedMatch `json:"previousMatch,omitempty"`
  4029. // Rematch: The newly created match; a rematch of the old match with the
  4030. // same participants.
  4031. Rematch *TurnBasedMatch `json:"rematch,omitempty"`
  4032. // ServerResponse contains the HTTP response code and headers from the
  4033. // server.
  4034. googleapi.ServerResponse `json:"-"`
  4035. // ForceSendFields is a list of field names (e.g. "Kind") to
  4036. // unconditionally include in API requests. By default, fields with
  4037. // empty values are omitted from API requests. However, any non-pointer,
  4038. // non-interface field appearing in ForceSendFields will be sent to the
  4039. // server regardless of whether the field is empty or not. This may be
  4040. // used to include empty fields in Patch requests.
  4041. ForceSendFields []string `json:"-"`
  4042. // NullFields is a list of field names (e.g. "Kind") to include in API
  4043. // requests with the JSON null value. By default, fields with empty
  4044. // values are omitted from API requests. However, any field with an
  4045. // empty value appearing in NullFields will be sent to the server as
  4046. // null. It is an error if a field in this list has a non-empty value.
  4047. // This may be used to include null fields in Patch requests.
  4048. NullFields []string `json:"-"`
  4049. }
  4050. func (s *TurnBasedMatchRematch) MarshalJSON() ([]byte, error) {
  4051. type NoMethod TurnBasedMatchRematch
  4052. raw := NoMethod(*s)
  4053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4054. }
  4055. // TurnBasedMatchResults: This is a JSON template for a turn-based match
  4056. // results object.
  4057. type TurnBasedMatchResults struct {
  4058. // Data: The final match data.
  4059. Data *TurnBasedMatchDataRequest `json:"data,omitempty"`
  4060. // Kind: Uniquely identifies the type of this resource. Value is always
  4061. // the fixed string games#turnBasedMatchResults.
  4062. Kind string `json:"kind,omitempty"`
  4063. // MatchVersion: The version of the match being updated.
  4064. MatchVersion int64 `json:"matchVersion,omitempty"`
  4065. // Results: The match results for the participants in the match.
  4066. Results []*ParticipantResult `json:"results,omitempty"`
  4067. // ForceSendFields is a list of field names (e.g. "Data") to
  4068. // unconditionally include in API requests. By default, fields with
  4069. // empty values are omitted from API requests. However, any non-pointer,
  4070. // non-interface field appearing in ForceSendFields will be sent to the
  4071. // server regardless of whether the field is empty or not. This may be
  4072. // used to include empty fields in Patch requests.
  4073. ForceSendFields []string `json:"-"`
  4074. // NullFields is a list of field names (e.g. "Data") to include in API
  4075. // requests with the JSON null value. By default, fields with empty
  4076. // values are omitted from API requests. However, any field with an
  4077. // empty value appearing in NullFields will be sent to the server as
  4078. // null. It is an error if a field in this list has a non-empty value.
  4079. // This may be used to include null fields in Patch requests.
  4080. NullFields []string `json:"-"`
  4081. }
  4082. func (s *TurnBasedMatchResults) MarshalJSON() ([]byte, error) {
  4083. type NoMethod TurnBasedMatchResults
  4084. raw := NoMethod(*s)
  4085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4086. }
  4087. // TurnBasedMatchSync: This is a JSON template for a list of turn-based
  4088. // matches returned from a sync.
  4089. type TurnBasedMatchSync struct {
  4090. // Items: The matches.
  4091. Items []*TurnBasedMatch `json:"items,omitempty"`
  4092. // Kind: Uniquely identifies the type of this resource. Value is always
  4093. // the fixed string games#turnBasedMatchSync.
  4094. Kind string `json:"kind,omitempty"`
  4095. // MoreAvailable: True if there were more matches available to fetch at
  4096. // the time the response was generated (which were not returned due to
  4097. // page size limits.)
  4098. MoreAvailable bool `json:"moreAvailable,omitempty"`
  4099. // NextPageToken: The pagination token for the next page of results.
  4100. NextPageToken string `json:"nextPageToken,omitempty"`
  4101. // ServerResponse contains the HTTP response code and headers from the
  4102. // server.
  4103. googleapi.ServerResponse `json:"-"`
  4104. // ForceSendFields is a list of field names (e.g. "Items") to
  4105. // unconditionally include in API requests. By default, fields with
  4106. // empty values are omitted from API requests. However, any non-pointer,
  4107. // non-interface field appearing in ForceSendFields will be sent to the
  4108. // server regardless of whether the field is empty or not. This may be
  4109. // used to include empty fields in Patch requests.
  4110. ForceSendFields []string `json:"-"`
  4111. // NullFields is a list of field names (e.g. "Items") to include in API
  4112. // requests with the JSON null value. By default, fields with empty
  4113. // values are omitted from API requests. However, any field with an
  4114. // empty value appearing in NullFields will be sent to the server as
  4115. // null. It is an error if a field in this list has a non-empty value.
  4116. // This may be used to include null fields in Patch requests.
  4117. NullFields []string `json:"-"`
  4118. }
  4119. func (s *TurnBasedMatchSync) MarshalJSON() ([]byte, error) {
  4120. type NoMethod TurnBasedMatchSync
  4121. raw := NoMethod(*s)
  4122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4123. }
  4124. // TurnBasedMatchTurn: This is a JSON template for the object
  4125. // representing a turn.
  4126. type TurnBasedMatchTurn struct {
  4127. // Data: The shared game state data after the turn is over.
  4128. Data *TurnBasedMatchDataRequest `json:"data,omitempty"`
  4129. // Kind: Uniquely identifies the type of this resource. Value is always
  4130. // the fixed string games#turnBasedMatchTurn.
  4131. Kind string `json:"kind,omitempty"`
  4132. // MatchVersion: The version of this match: an increasing counter, used
  4133. // to avoid out-of-date updates to the match.
  4134. MatchVersion int64 `json:"matchVersion,omitempty"`
  4135. // PendingParticipantId: The ID of the participant who should take their
  4136. // turn next. May be set to the current player's participant ID to
  4137. // update match state without changing the turn. If not set, the match
  4138. // will wait for other player(s) to join via automatching; this is only
  4139. // valid if automatch criteria is set on the match with remaining slots
  4140. // for automatched players.
  4141. PendingParticipantId string `json:"pendingParticipantId,omitempty"`
  4142. // Results: The match results for the participants in the match.
  4143. Results []*ParticipantResult `json:"results,omitempty"`
  4144. // ForceSendFields is a list of field names (e.g. "Data") to
  4145. // unconditionally include in API requests. By default, fields with
  4146. // empty values are omitted from API requests. However, any non-pointer,
  4147. // non-interface field appearing in ForceSendFields will be sent to the
  4148. // server regardless of whether the field is empty or not. This may be
  4149. // used to include empty fields in Patch requests.
  4150. ForceSendFields []string `json:"-"`
  4151. // NullFields is a list of field names (e.g. "Data") to include in API
  4152. // requests with the JSON null value. By default, fields with empty
  4153. // values are omitted from API requests. However, any field with an
  4154. // empty value appearing in NullFields will be sent to the server as
  4155. // null. It is an error if a field in this list has a non-empty value.
  4156. // This may be used to include null fields in Patch requests.
  4157. NullFields []string `json:"-"`
  4158. }
  4159. func (s *TurnBasedMatchTurn) MarshalJSON() ([]byte, error) {
  4160. type NoMethod TurnBasedMatchTurn
  4161. raw := NoMethod(*s)
  4162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4163. }
  4164. // method id "games.achievementDefinitions.list":
  4165. type AchievementDefinitionsListCall struct {
  4166. s *Service
  4167. urlParams_ gensupport.URLParams
  4168. ifNoneMatch_ string
  4169. ctx_ context.Context
  4170. header_ http.Header
  4171. }
  4172. // List: Lists all the achievement definitions for your application.
  4173. func (r *AchievementDefinitionsService) List() *AchievementDefinitionsListCall {
  4174. c := &AchievementDefinitionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4175. return c
  4176. }
  4177. // Language sets the optional parameter "language": The preferred
  4178. // language to use for strings returned by this method.
  4179. func (c *AchievementDefinitionsListCall) Language(language string) *AchievementDefinitionsListCall {
  4180. c.urlParams_.Set("language", language)
  4181. return c
  4182. }
  4183. // MaxResults sets the optional parameter "maxResults": The maximum
  4184. // number of achievement resources to return in the response, used for
  4185. // paging. For any response, the actual number of achievement resources
  4186. // returned may be less than the specified maxResults.
  4187. func (c *AchievementDefinitionsListCall) MaxResults(maxResults int64) *AchievementDefinitionsListCall {
  4188. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4189. return c
  4190. }
  4191. // PageToken sets the optional parameter "pageToken": The token returned
  4192. // by the previous request.
  4193. func (c *AchievementDefinitionsListCall) PageToken(pageToken string) *AchievementDefinitionsListCall {
  4194. c.urlParams_.Set("pageToken", pageToken)
  4195. return c
  4196. }
  4197. // Fields allows partial responses to be retrieved. See
  4198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4199. // for more information.
  4200. func (c *AchievementDefinitionsListCall) Fields(s ...googleapi.Field) *AchievementDefinitionsListCall {
  4201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4202. return c
  4203. }
  4204. // IfNoneMatch sets the optional parameter which makes the operation
  4205. // fail if the object's ETag matches the given value. This is useful for
  4206. // getting updates only after the object has changed since the last
  4207. // request. Use googleapi.IsNotModified to check whether the response
  4208. // error from Do is the result of In-None-Match.
  4209. func (c *AchievementDefinitionsListCall) IfNoneMatch(entityTag string) *AchievementDefinitionsListCall {
  4210. c.ifNoneMatch_ = entityTag
  4211. return c
  4212. }
  4213. // Context sets the context to be used in this call's Do method. Any
  4214. // pending HTTP request will be aborted if the provided context is
  4215. // canceled.
  4216. func (c *AchievementDefinitionsListCall) Context(ctx context.Context) *AchievementDefinitionsListCall {
  4217. c.ctx_ = ctx
  4218. return c
  4219. }
  4220. // Header returns an http.Header that can be modified by the caller to
  4221. // add HTTP headers to the request.
  4222. func (c *AchievementDefinitionsListCall) Header() http.Header {
  4223. if c.header_ == nil {
  4224. c.header_ = make(http.Header)
  4225. }
  4226. return c.header_
  4227. }
  4228. func (c *AchievementDefinitionsListCall) doRequest(alt string) (*http.Response, error) {
  4229. reqHeaders := make(http.Header)
  4230. for k, v := range c.header_ {
  4231. reqHeaders[k] = v
  4232. }
  4233. reqHeaders.Set("User-Agent", c.s.userAgent())
  4234. if c.ifNoneMatch_ != "" {
  4235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4236. }
  4237. var body io.Reader = nil
  4238. c.urlParams_.Set("alt", alt)
  4239. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements")
  4240. urls += "?" + c.urlParams_.Encode()
  4241. req, _ := http.NewRequest("GET", urls, body)
  4242. req.Header = reqHeaders
  4243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4244. }
  4245. // Do executes the "games.achievementDefinitions.list" call.
  4246. // Exactly one of *AchievementDefinitionsListResponse or error will be
  4247. // non-nil. Any non-2xx status code is an error. Response headers are in
  4248. // either *AchievementDefinitionsListResponse.ServerResponse.Header or
  4249. // (if a response was returned at all) in
  4250. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4251. // whether the returned error was because http.StatusNotModified was
  4252. // returned.
  4253. func (c *AchievementDefinitionsListCall) Do(opts ...googleapi.CallOption) (*AchievementDefinitionsListResponse, error) {
  4254. gensupport.SetOptions(c.urlParams_, opts...)
  4255. res, err := c.doRequest("json")
  4256. if res != nil && res.StatusCode == http.StatusNotModified {
  4257. if res.Body != nil {
  4258. res.Body.Close()
  4259. }
  4260. return nil, &googleapi.Error{
  4261. Code: res.StatusCode,
  4262. Header: res.Header,
  4263. }
  4264. }
  4265. if err != nil {
  4266. return nil, err
  4267. }
  4268. defer googleapi.CloseBody(res)
  4269. if err := googleapi.CheckResponse(res); err != nil {
  4270. return nil, err
  4271. }
  4272. ret := &AchievementDefinitionsListResponse{
  4273. ServerResponse: googleapi.ServerResponse{
  4274. Header: res.Header,
  4275. HTTPStatusCode: res.StatusCode,
  4276. },
  4277. }
  4278. target := &ret
  4279. if err := gensupport.DecodeResponse(target, res); err != nil {
  4280. return nil, err
  4281. }
  4282. return ret, nil
  4283. // {
  4284. // "description": "Lists all the achievement definitions for your application.",
  4285. // "httpMethod": "GET",
  4286. // "id": "games.achievementDefinitions.list",
  4287. // "parameters": {
  4288. // "language": {
  4289. // "description": "The preferred language to use for strings returned by this method.",
  4290. // "location": "query",
  4291. // "type": "string"
  4292. // },
  4293. // "maxResults": {
  4294. // "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.",
  4295. // "format": "int32",
  4296. // "location": "query",
  4297. // "maximum": "200",
  4298. // "minimum": "1",
  4299. // "type": "integer"
  4300. // },
  4301. // "pageToken": {
  4302. // "description": "The token returned by the previous request.",
  4303. // "location": "query",
  4304. // "type": "string"
  4305. // }
  4306. // },
  4307. // "path": "achievements",
  4308. // "response": {
  4309. // "$ref": "AchievementDefinitionsListResponse"
  4310. // },
  4311. // "scopes": [
  4312. // "https://www.googleapis.com/auth/games",
  4313. // "https://www.googleapis.com/auth/plus.login"
  4314. // ]
  4315. // }
  4316. }
  4317. // Pages invokes f for each page of results.
  4318. // A non-nil error returned from f will halt the iteration.
  4319. // The provided context supersedes any context provided to the Context method.
  4320. func (c *AchievementDefinitionsListCall) Pages(ctx context.Context, f func(*AchievementDefinitionsListResponse) error) error {
  4321. c.ctx_ = ctx
  4322. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4323. for {
  4324. x, err := c.Do()
  4325. if err != nil {
  4326. return err
  4327. }
  4328. if err := f(x); err != nil {
  4329. return err
  4330. }
  4331. if x.NextPageToken == "" {
  4332. return nil
  4333. }
  4334. c.PageToken(x.NextPageToken)
  4335. }
  4336. }
  4337. // method id "games.achievements.increment":
  4338. type AchievementsIncrementCall struct {
  4339. s *Service
  4340. achievementId string
  4341. urlParams_ gensupport.URLParams
  4342. ctx_ context.Context
  4343. header_ http.Header
  4344. }
  4345. // Increment: Increments the steps of the achievement with the given ID
  4346. // for the currently authenticated player.
  4347. func (r *AchievementsService) Increment(achievementId string, stepsToIncrement int64) *AchievementsIncrementCall {
  4348. c := &AchievementsIncrementCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4349. c.achievementId = achievementId
  4350. c.urlParams_.Set("stepsToIncrement", fmt.Sprint(stepsToIncrement))
  4351. return c
  4352. }
  4353. // RequestId sets the optional parameter "requestId": A randomly
  4354. // generated numeric ID for each request specified by the caller. This
  4355. // number is used at the server to ensure that the request is handled
  4356. // correctly across retries.
  4357. func (c *AchievementsIncrementCall) RequestId(requestId int64) *AchievementsIncrementCall {
  4358. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  4359. return c
  4360. }
  4361. // Fields allows partial responses to be retrieved. See
  4362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4363. // for more information.
  4364. func (c *AchievementsIncrementCall) Fields(s ...googleapi.Field) *AchievementsIncrementCall {
  4365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4366. return c
  4367. }
  4368. // Context sets the context to be used in this call's Do method. Any
  4369. // pending HTTP request will be aborted if the provided context is
  4370. // canceled.
  4371. func (c *AchievementsIncrementCall) Context(ctx context.Context) *AchievementsIncrementCall {
  4372. c.ctx_ = ctx
  4373. return c
  4374. }
  4375. // Header returns an http.Header that can be modified by the caller to
  4376. // add HTTP headers to the request.
  4377. func (c *AchievementsIncrementCall) Header() http.Header {
  4378. if c.header_ == nil {
  4379. c.header_ = make(http.Header)
  4380. }
  4381. return c.header_
  4382. }
  4383. func (c *AchievementsIncrementCall) doRequest(alt string) (*http.Response, error) {
  4384. reqHeaders := make(http.Header)
  4385. for k, v := range c.header_ {
  4386. reqHeaders[k] = v
  4387. }
  4388. reqHeaders.Set("User-Agent", c.s.userAgent())
  4389. var body io.Reader = nil
  4390. c.urlParams_.Set("alt", alt)
  4391. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/increment")
  4392. urls += "?" + c.urlParams_.Encode()
  4393. req, _ := http.NewRequest("POST", urls, body)
  4394. req.Header = reqHeaders
  4395. googleapi.Expand(req.URL, map[string]string{
  4396. "achievementId": c.achievementId,
  4397. })
  4398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4399. }
  4400. // Do executes the "games.achievements.increment" call.
  4401. // Exactly one of *AchievementIncrementResponse or error will be
  4402. // non-nil. Any non-2xx status code is an error. Response headers are in
  4403. // either *AchievementIncrementResponse.ServerResponse.Header or (if a
  4404. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4405. // googleapi.IsNotModified to check whether the returned error was
  4406. // because http.StatusNotModified was returned.
  4407. func (c *AchievementsIncrementCall) Do(opts ...googleapi.CallOption) (*AchievementIncrementResponse, error) {
  4408. gensupport.SetOptions(c.urlParams_, opts...)
  4409. res, err := c.doRequest("json")
  4410. if res != nil && res.StatusCode == http.StatusNotModified {
  4411. if res.Body != nil {
  4412. res.Body.Close()
  4413. }
  4414. return nil, &googleapi.Error{
  4415. Code: res.StatusCode,
  4416. Header: res.Header,
  4417. }
  4418. }
  4419. if err != nil {
  4420. return nil, err
  4421. }
  4422. defer googleapi.CloseBody(res)
  4423. if err := googleapi.CheckResponse(res); err != nil {
  4424. return nil, err
  4425. }
  4426. ret := &AchievementIncrementResponse{
  4427. ServerResponse: googleapi.ServerResponse{
  4428. Header: res.Header,
  4429. HTTPStatusCode: res.StatusCode,
  4430. },
  4431. }
  4432. target := &ret
  4433. if err := gensupport.DecodeResponse(target, res); err != nil {
  4434. return nil, err
  4435. }
  4436. return ret, nil
  4437. // {
  4438. // "description": "Increments the steps of the achievement with the given ID for the currently authenticated player.",
  4439. // "httpMethod": "POST",
  4440. // "id": "games.achievements.increment",
  4441. // "parameterOrder": [
  4442. // "achievementId",
  4443. // "stepsToIncrement"
  4444. // ],
  4445. // "parameters": {
  4446. // "achievementId": {
  4447. // "description": "The ID of the achievement used by this method.",
  4448. // "location": "path",
  4449. // "required": true,
  4450. // "type": "string"
  4451. // },
  4452. // "requestId": {
  4453. // "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.",
  4454. // "format": "int64",
  4455. // "location": "query",
  4456. // "type": "string"
  4457. // },
  4458. // "stepsToIncrement": {
  4459. // "description": "The number of steps to increment.",
  4460. // "format": "int32",
  4461. // "location": "query",
  4462. // "minimum": "1",
  4463. // "required": true,
  4464. // "type": "integer"
  4465. // }
  4466. // },
  4467. // "path": "achievements/{achievementId}/increment",
  4468. // "response": {
  4469. // "$ref": "AchievementIncrementResponse"
  4470. // },
  4471. // "scopes": [
  4472. // "https://www.googleapis.com/auth/games",
  4473. // "https://www.googleapis.com/auth/plus.login"
  4474. // ]
  4475. // }
  4476. }
  4477. // method id "games.achievements.list":
  4478. type AchievementsListCall struct {
  4479. s *Service
  4480. playerId string
  4481. urlParams_ gensupport.URLParams
  4482. ifNoneMatch_ string
  4483. ctx_ context.Context
  4484. header_ http.Header
  4485. }
  4486. // List: Lists the progress for all your application's achievements for
  4487. // the currently authenticated player.
  4488. func (r *AchievementsService) List(playerId string) *AchievementsListCall {
  4489. c := &AchievementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4490. c.playerId = playerId
  4491. return c
  4492. }
  4493. // Language sets the optional parameter "language": The preferred
  4494. // language to use for strings returned by this method.
  4495. func (c *AchievementsListCall) Language(language string) *AchievementsListCall {
  4496. c.urlParams_.Set("language", language)
  4497. return c
  4498. }
  4499. // MaxResults sets the optional parameter "maxResults": The maximum
  4500. // number of achievement resources to return in the response, used for
  4501. // paging. For any response, the actual number of achievement resources
  4502. // returned may be less than the specified maxResults.
  4503. func (c *AchievementsListCall) MaxResults(maxResults int64) *AchievementsListCall {
  4504. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  4505. return c
  4506. }
  4507. // PageToken sets the optional parameter "pageToken": The token returned
  4508. // by the previous request.
  4509. func (c *AchievementsListCall) PageToken(pageToken string) *AchievementsListCall {
  4510. c.urlParams_.Set("pageToken", pageToken)
  4511. return c
  4512. }
  4513. // State sets the optional parameter "state": Tells the server to return
  4514. // only achievements with the specified state. If this parameter isn't
  4515. // specified, all achievements are returned.
  4516. //
  4517. // Possible values:
  4518. // "ALL" - List all achievements. This is the default.
  4519. // "HIDDEN" - List only hidden achievements.
  4520. // "REVEALED" - List only revealed achievements.
  4521. // "UNLOCKED" - List only unlocked achievements.
  4522. func (c *AchievementsListCall) State(state string) *AchievementsListCall {
  4523. c.urlParams_.Set("state", state)
  4524. return c
  4525. }
  4526. // Fields allows partial responses to be retrieved. See
  4527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4528. // for more information.
  4529. func (c *AchievementsListCall) Fields(s ...googleapi.Field) *AchievementsListCall {
  4530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4531. return c
  4532. }
  4533. // IfNoneMatch sets the optional parameter which makes the operation
  4534. // fail if the object's ETag matches the given value. This is useful for
  4535. // getting updates only after the object has changed since the last
  4536. // request. Use googleapi.IsNotModified to check whether the response
  4537. // error from Do is the result of In-None-Match.
  4538. func (c *AchievementsListCall) IfNoneMatch(entityTag string) *AchievementsListCall {
  4539. c.ifNoneMatch_ = entityTag
  4540. return c
  4541. }
  4542. // Context sets the context to be used in this call's Do method. Any
  4543. // pending HTTP request will be aborted if the provided context is
  4544. // canceled.
  4545. func (c *AchievementsListCall) Context(ctx context.Context) *AchievementsListCall {
  4546. c.ctx_ = ctx
  4547. return c
  4548. }
  4549. // Header returns an http.Header that can be modified by the caller to
  4550. // add HTTP headers to the request.
  4551. func (c *AchievementsListCall) Header() http.Header {
  4552. if c.header_ == nil {
  4553. c.header_ = make(http.Header)
  4554. }
  4555. return c.header_
  4556. }
  4557. func (c *AchievementsListCall) doRequest(alt string) (*http.Response, error) {
  4558. reqHeaders := make(http.Header)
  4559. for k, v := range c.header_ {
  4560. reqHeaders[k] = v
  4561. }
  4562. reqHeaders.Set("User-Agent", c.s.userAgent())
  4563. if c.ifNoneMatch_ != "" {
  4564. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4565. }
  4566. var body io.Reader = nil
  4567. c.urlParams_.Set("alt", alt)
  4568. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/achievements")
  4569. urls += "?" + c.urlParams_.Encode()
  4570. req, _ := http.NewRequest("GET", urls, body)
  4571. req.Header = reqHeaders
  4572. googleapi.Expand(req.URL, map[string]string{
  4573. "playerId": c.playerId,
  4574. })
  4575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4576. }
  4577. // Do executes the "games.achievements.list" call.
  4578. // Exactly one of *PlayerAchievementListResponse or error will be
  4579. // non-nil. Any non-2xx status code is an error. Response headers are in
  4580. // either *PlayerAchievementListResponse.ServerResponse.Header or (if a
  4581. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4582. // googleapi.IsNotModified to check whether the returned error was
  4583. // because http.StatusNotModified was returned.
  4584. func (c *AchievementsListCall) Do(opts ...googleapi.CallOption) (*PlayerAchievementListResponse, error) {
  4585. gensupport.SetOptions(c.urlParams_, opts...)
  4586. res, err := c.doRequest("json")
  4587. if res != nil && res.StatusCode == http.StatusNotModified {
  4588. if res.Body != nil {
  4589. res.Body.Close()
  4590. }
  4591. return nil, &googleapi.Error{
  4592. Code: res.StatusCode,
  4593. Header: res.Header,
  4594. }
  4595. }
  4596. if err != nil {
  4597. return nil, err
  4598. }
  4599. defer googleapi.CloseBody(res)
  4600. if err := googleapi.CheckResponse(res); err != nil {
  4601. return nil, err
  4602. }
  4603. ret := &PlayerAchievementListResponse{
  4604. ServerResponse: googleapi.ServerResponse{
  4605. Header: res.Header,
  4606. HTTPStatusCode: res.StatusCode,
  4607. },
  4608. }
  4609. target := &ret
  4610. if err := gensupport.DecodeResponse(target, res); err != nil {
  4611. return nil, err
  4612. }
  4613. return ret, nil
  4614. // {
  4615. // "description": "Lists the progress for all your application's achievements for the currently authenticated player.",
  4616. // "httpMethod": "GET",
  4617. // "id": "games.achievements.list",
  4618. // "parameterOrder": [
  4619. // "playerId"
  4620. // ],
  4621. // "parameters": {
  4622. // "language": {
  4623. // "description": "The preferred language to use for strings returned by this method.",
  4624. // "location": "query",
  4625. // "type": "string"
  4626. // },
  4627. // "maxResults": {
  4628. // "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.",
  4629. // "format": "int32",
  4630. // "location": "query",
  4631. // "maximum": "200",
  4632. // "minimum": "1",
  4633. // "type": "integer"
  4634. // },
  4635. // "pageToken": {
  4636. // "description": "The token returned by the previous request.",
  4637. // "location": "query",
  4638. // "type": "string"
  4639. // },
  4640. // "playerId": {
  4641. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  4642. // "location": "path",
  4643. // "required": true,
  4644. // "type": "string"
  4645. // },
  4646. // "state": {
  4647. // "description": "Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.",
  4648. // "enum": [
  4649. // "ALL",
  4650. // "HIDDEN",
  4651. // "REVEALED",
  4652. // "UNLOCKED"
  4653. // ],
  4654. // "enumDescriptions": [
  4655. // "List all achievements. This is the default.",
  4656. // "List only hidden achievements.",
  4657. // "List only revealed achievements.",
  4658. // "List only unlocked achievements."
  4659. // ],
  4660. // "location": "query",
  4661. // "type": "string"
  4662. // }
  4663. // },
  4664. // "path": "players/{playerId}/achievements",
  4665. // "response": {
  4666. // "$ref": "PlayerAchievementListResponse"
  4667. // },
  4668. // "scopes": [
  4669. // "https://www.googleapis.com/auth/games",
  4670. // "https://www.googleapis.com/auth/plus.login"
  4671. // ]
  4672. // }
  4673. }
  4674. // Pages invokes f for each page of results.
  4675. // A non-nil error returned from f will halt the iteration.
  4676. // The provided context supersedes any context provided to the Context method.
  4677. func (c *AchievementsListCall) Pages(ctx context.Context, f func(*PlayerAchievementListResponse) error) error {
  4678. c.ctx_ = ctx
  4679. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4680. for {
  4681. x, err := c.Do()
  4682. if err != nil {
  4683. return err
  4684. }
  4685. if err := f(x); err != nil {
  4686. return err
  4687. }
  4688. if x.NextPageToken == "" {
  4689. return nil
  4690. }
  4691. c.PageToken(x.NextPageToken)
  4692. }
  4693. }
  4694. // method id "games.achievements.reveal":
  4695. type AchievementsRevealCall struct {
  4696. s *Service
  4697. achievementId string
  4698. urlParams_ gensupport.URLParams
  4699. ctx_ context.Context
  4700. header_ http.Header
  4701. }
  4702. // Reveal: Sets the state of the achievement with the given ID to
  4703. // REVEALED for the currently authenticated player.
  4704. func (r *AchievementsService) Reveal(achievementId string) *AchievementsRevealCall {
  4705. c := &AchievementsRevealCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4706. c.achievementId = achievementId
  4707. return c
  4708. }
  4709. // Fields allows partial responses to be retrieved. See
  4710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4711. // for more information.
  4712. func (c *AchievementsRevealCall) Fields(s ...googleapi.Field) *AchievementsRevealCall {
  4713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4714. return c
  4715. }
  4716. // Context sets the context to be used in this call's Do method. Any
  4717. // pending HTTP request will be aborted if the provided context is
  4718. // canceled.
  4719. func (c *AchievementsRevealCall) Context(ctx context.Context) *AchievementsRevealCall {
  4720. c.ctx_ = ctx
  4721. return c
  4722. }
  4723. // Header returns an http.Header that can be modified by the caller to
  4724. // add HTTP headers to the request.
  4725. func (c *AchievementsRevealCall) Header() http.Header {
  4726. if c.header_ == nil {
  4727. c.header_ = make(http.Header)
  4728. }
  4729. return c.header_
  4730. }
  4731. func (c *AchievementsRevealCall) doRequest(alt string) (*http.Response, error) {
  4732. reqHeaders := make(http.Header)
  4733. for k, v := range c.header_ {
  4734. reqHeaders[k] = v
  4735. }
  4736. reqHeaders.Set("User-Agent", c.s.userAgent())
  4737. var body io.Reader = nil
  4738. c.urlParams_.Set("alt", alt)
  4739. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/reveal")
  4740. urls += "?" + c.urlParams_.Encode()
  4741. req, _ := http.NewRequest("POST", urls, body)
  4742. req.Header = reqHeaders
  4743. googleapi.Expand(req.URL, map[string]string{
  4744. "achievementId": c.achievementId,
  4745. })
  4746. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4747. }
  4748. // Do executes the "games.achievements.reveal" call.
  4749. // Exactly one of *AchievementRevealResponse or error will be non-nil.
  4750. // Any non-2xx status code is an error. Response headers are in either
  4751. // *AchievementRevealResponse.ServerResponse.Header or (if a response
  4752. // was returned at all) in error.(*googleapi.Error).Header. Use
  4753. // googleapi.IsNotModified to check whether the returned error was
  4754. // because http.StatusNotModified was returned.
  4755. func (c *AchievementsRevealCall) Do(opts ...googleapi.CallOption) (*AchievementRevealResponse, error) {
  4756. gensupport.SetOptions(c.urlParams_, opts...)
  4757. res, err := c.doRequest("json")
  4758. if res != nil && res.StatusCode == http.StatusNotModified {
  4759. if res.Body != nil {
  4760. res.Body.Close()
  4761. }
  4762. return nil, &googleapi.Error{
  4763. Code: res.StatusCode,
  4764. Header: res.Header,
  4765. }
  4766. }
  4767. if err != nil {
  4768. return nil, err
  4769. }
  4770. defer googleapi.CloseBody(res)
  4771. if err := googleapi.CheckResponse(res); err != nil {
  4772. return nil, err
  4773. }
  4774. ret := &AchievementRevealResponse{
  4775. ServerResponse: googleapi.ServerResponse{
  4776. Header: res.Header,
  4777. HTTPStatusCode: res.StatusCode,
  4778. },
  4779. }
  4780. target := &ret
  4781. if err := gensupport.DecodeResponse(target, res); err != nil {
  4782. return nil, err
  4783. }
  4784. return ret, nil
  4785. // {
  4786. // "description": "Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.",
  4787. // "httpMethod": "POST",
  4788. // "id": "games.achievements.reveal",
  4789. // "parameterOrder": [
  4790. // "achievementId"
  4791. // ],
  4792. // "parameters": {
  4793. // "achievementId": {
  4794. // "description": "The ID of the achievement used by this method.",
  4795. // "location": "path",
  4796. // "required": true,
  4797. // "type": "string"
  4798. // }
  4799. // },
  4800. // "path": "achievements/{achievementId}/reveal",
  4801. // "response": {
  4802. // "$ref": "AchievementRevealResponse"
  4803. // },
  4804. // "scopes": [
  4805. // "https://www.googleapis.com/auth/games",
  4806. // "https://www.googleapis.com/auth/plus.login"
  4807. // ]
  4808. // }
  4809. }
  4810. // method id "games.achievements.setStepsAtLeast":
  4811. type AchievementsSetStepsAtLeastCall struct {
  4812. s *Service
  4813. achievementId string
  4814. urlParams_ gensupport.URLParams
  4815. ctx_ context.Context
  4816. header_ http.Header
  4817. }
  4818. // SetStepsAtLeast: Sets the steps for the currently authenticated
  4819. // player towards unlocking an achievement. If the steps parameter is
  4820. // less than the current number of steps that the player already gained
  4821. // for the achievement, the achievement is not modified.
  4822. func (r *AchievementsService) SetStepsAtLeast(achievementId string, steps int64) *AchievementsSetStepsAtLeastCall {
  4823. c := &AchievementsSetStepsAtLeastCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4824. c.achievementId = achievementId
  4825. c.urlParams_.Set("steps", fmt.Sprint(steps))
  4826. return c
  4827. }
  4828. // Fields allows partial responses to be retrieved. See
  4829. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4830. // for more information.
  4831. func (c *AchievementsSetStepsAtLeastCall) Fields(s ...googleapi.Field) *AchievementsSetStepsAtLeastCall {
  4832. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4833. return c
  4834. }
  4835. // Context sets the context to be used in this call's Do method. Any
  4836. // pending HTTP request will be aborted if the provided context is
  4837. // canceled.
  4838. func (c *AchievementsSetStepsAtLeastCall) Context(ctx context.Context) *AchievementsSetStepsAtLeastCall {
  4839. c.ctx_ = ctx
  4840. return c
  4841. }
  4842. // Header returns an http.Header that can be modified by the caller to
  4843. // add HTTP headers to the request.
  4844. func (c *AchievementsSetStepsAtLeastCall) Header() http.Header {
  4845. if c.header_ == nil {
  4846. c.header_ = make(http.Header)
  4847. }
  4848. return c.header_
  4849. }
  4850. func (c *AchievementsSetStepsAtLeastCall) doRequest(alt string) (*http.Response, error) {
  4851. reqHeaders := make(http.Header)
  4852. for k, v := range c.header_ {
  4853. reqHeaders[k] = v
  4854. }
  4855. reqHeaders.Set("User-Agent", c.s.userAgent())
  4856. var body io.Reader = nil
  4857. c.urlParams_.Set("alt", alt)
  4858. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/setStepsAtLeast")
  4859. urls += "?" + c.urlParams_.Encode()
  4860. req, _ := http.NewRequest("POST", urls, body)
  4861. req.Header = reqHeaders
  4862. googleapi.Expand(req.URL, map[string]string{
  4863. "achievementId": c.achievementId,
  4864. })
  4865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4866. }
  4867. // Do executes the "games.achievements.setStepsAtLeast" call.
  4868. // Exactly one of *AchievementSetStepsAtLeastResponse or error will be
  4869. // non-nil. Any non-2xx status code is an error. Response headers are in
  4870. // either *AchievementSetStepsAtLeastResponse.ServerResponse.Header or
  4871. // (if a response was returned at all) in
  4872. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4873. // whether the returned error was because http.StatusNotModified was
  4874. // returned.
  4875. func (c *AchievementsSetStepsAtLeastCall) Do(opts ...googleapi.CallOption) (*AchievementSetStepsAtLeastResponse, error) {
  4876. gensupport.SetOptions(c.urlParams_, opts...)
  4877. res, err := c.doRequest("json")
  4878. if res != nil && res.StatusCode == http.StatusNotModified {
  4879. if res.Body != nil {
  4880. res.Body.Close()
  4881. }
  4882. return nil, &googleapi.Error{
  4883. Code: res.StatusCode,
  4884. Header: res.Header,
  4885. }
  4886. }
  4887. if err != nil {
  4888. return nil, err
  4889. }
  4890. defer googleapi.CloseBody(res)
  4891. if err := googleapi.CheckResponse(res); err != nil {
  4892. return nil, err
  4893. }
  4894. ret := &AchievementSetStepsAtLeastResponse{
  4895. ServerResponse: googleapi.ServerResponse{
  4896. Header: res.Header,
  4897. HTTPStatusCode: res.StatusCode,
  4898. },
  4899. }
  4900. target := &ret
  4901. if err := gensupport.DecodeResponse(target, res); err != nil {
  4902. return nil, err
  4903. }
  4904. return ret, nil
  4905. // {
  4906. // "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.",
  4907. // "httpMethod": "POST",
  4908. // "id": "games.achievements.setStepsAtLeast",
  4909. // "parameterOrder": [
  4910. // "achievementId",
  4911. // "steps"
  4912. // ],
  4913. // "parameters": {
  4914. // "achievementId": {
  4915. // "description": "The ID of the achievement used by this method.",
  4916. // "location": "path",
  4917. // "required": true,
  4918. // "type": "string"
  4919. // },
  4920. // "steps": {
  4921. // "description": "The minimum value to set the steps to.",
  4922. // "format": "int32",
  4923. // "location": "query",
  4924. // "minimum": "1",
  4925. // "required": true,
  4926. // "type": "integer"
  4927. // }
  4928. // },
  4929. // "path": "achievements/{achievementId}/setStepsAtLeast",
  4930. // "response": {
  4931. // "$ref": "AchievementSetStepsAtLeastResponse"
  4932. // },
  4933. // "scopes": [
  4934. // "https://www.googleapis.com/auth/games",
  4935. // "https://www.googleapis.com/auth/plus.login"
  4936. // ]
  4937. // }
  4938. }
  4939. // method id "games.achievements.unlock":
  4940. type AchievementsUnlockCall struct {
  4941. s *Service
  4942. achievementId string
  4943. urlParams_ gensupport.URLParams
  4944. ctx_ context.Context
  4945. header_ http.Header
  4946. }
  4947. // Unlock: Unlocks this achievement for the currently authenticated
  4948. // player.
  4949. func (r *AchievementsService) Unlock(achievementId string) *AchievementsUnlockCall {
  4950. c := &AchievementsUnlockCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4951. c.achievementId = achievementId
  4952. return c
  4953. }
  4954. // Fields allows partial responses to be retrieved. See
  4955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4956. // for more information.
  4957. func (c *AchievementsUnlockCall) Fields(s ...googleapi.Field) *AchievementsUnlockCall {
  4958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4959. return c
  4960. }
  4961. // Context sets the context to be used in this call's Do method. Any
  4962. // pending HTTP request will be aborted if the provided context is
  4963. // canceled.
  4964. func (c *AchievementsUnlockCall) Context(ctx context.Context) *AchievementsUnlockCall {
  4965. c.ctx_ = ctx
  4966. return c
  4967. }
  4968. // Header returns an http.Header that can be modified by the caller to
  4969. // add HTTP headers to the request.
  4970. func (c *AchievementsUnlockCall) Header() http.Header {
  4971. if c.header_ == nil {
  4972. c.header_ = make(http.Header)
  4973. }
  4974. return c.header_
  4975. }
  4976. func (c *AchievementsUnlockCall) doRequest(alt string) (*http.Response, error) {
  4977. reqHeaders := make(http.Header)
  4978. for k, v := range c.header_ {
  4979. reqHeaders[k] = v
  4980. }
  4981. reqHeaders.Set("User-Agent", c.s.userAgent())
  4982. var body io.Reader = nil
  4983. c.urlParams_.Set("alt", alt)
  4984. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}/unlock")
  4985. urls += "?" + c.urlParams_.Encode()
  4986. req, _ := http.NewRequest("POST", urls, body)
  4987. req.Header = reqHeaders
  4988. googleapi.Expand(req.URL, map[string]string{
  4989. "achievementId": c.achievementId,
  4990. })
  4991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4992. }
  4993. // Do executes the "games.achievements.unlock" call.
  4994. // Exactly one of *AchievementUnlockResponse or error will be non-nil.
  4995. // Any non-2xx status code is an error. Response headers are in either
  4996. // *AchievementUnlockResponse.ServerResponse.Header or (if a response
  4997. // was returned at all) in error.(*googleapi.Error).Header. Use
  4998. // googleapi.IsNotModified to check whether the returned error was
  4999. // because http.StatusNotModified was returned.
  5000. func (c *AchievementsUnlockCall) Do(opts ...googleapi.CallOption) (*AchievementUnlockResponse, error) {
  5001. gensupport.SetOptions(c.urlParams_, opts...)
  5002. res, err := c.doRequest("json")
  5003. if res != nil && res.StatusCode == http.StatusNotModified {
  5004. if res.Body != nil {
  5005. res.Body.Close()
  5006. }
  5007. return nil, &googleapi.Error{
  5008. Code: res.StatusCode,
  5009. Header: res.Header,
  5010. }
  5011. }
  5012. if err != nil {
  5013. return nil, err
  5014. }
  5015. defer googleapi.CloseBody(res)
  5016. if err := googleapi.CheckResponse(res); err != nil {
  5017. return nil, err
  5018. }
  5019. ret := &AchievementUnlockResponse{
  5020. ServerResponse: googleapi.ServerResponse{
  5021. Header: res.Header,
  5022. HTTPStatusCode: res.StatusCode,
  5023. },
  5024. }
  5025. target := &ret
  5026. if err := gensupport.DecodeResponse(target, res); err != nil {
  5027. return nil, err
  5028. }
  5029. return ret, nil
  5030. // {
  5031. // "description": "Unlocks this achievement for the currently authenticated player.",
  5032. // "httpMethod": "POST",
  5033. // "id": "games.achievements.unlock",
  5034. // "parameterOrder": [
  5035. // "achievementId"
  5036. // ],
  5037. // "parameters": {
  5038. // "achievementId": {
  5039. // "description": "The ID of the achievement used by this method.",
  5040. // "location": "path",
  5041. // "required": true,
  5042. // "type": "string"
  5043. // }
  5044. // },
  5045. // "path": "achievements/{achievementId}/unlock",
  5046. // "response": {
  5047. // "$ref": "AchievementUnlockResponse"
  5048. // },
  5049. // "scopes": [
  5050. // "https://www.googleapis.com/auth/games",
  5051. // "https://www.googleapis.com/auth/plus.login"
  5052. // ]
  5053. // }
  5054. }
  5055. // method id "games.achievements.updateMultiple":
  5056. type AchievementsUpdateMultipleCall struct {
  5057. s *Service
  5058. achievementupdatemultiplerequest *AchievementUpdateMultipleRequest
  5059. urlParams_ gensupport.URLParams
  5060. ctx_ context.Context
  5061. header_ http.Header
  5062. }
  5063. // UpdateMultiple: Updates multiple achievements for the currently
  5064. // authenticated player.
  5065. func (r *AchievementsService) UpdateMultiple(achievementupdatemultiplerequest *AchievementUpdateMultipleRequest) *AchievementsUpdateMultipleCall {
  5066. c := &AchievementsUpdateMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5067. c.achievementupdatemultiplerequest = achievementupdatemultiplerequest
  5068. return c
  5069. }
  5070. // Fields allows partial responses to be retrieved. See
  5071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5072. // for more information.
  5073. func (c *AchievementsUpdateMultipleCall) Fields(s ...googleapi.Field) *AchievementsUpdateMultipleCall {
  5074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5075. return c
  5076. }
  5077. // Context sets the context to be used in this call's Do method. Any
  5078. // pending HTTP request will be aborted if the provided context is
  5079. // canceled.
  5080. func (c *AchievementsUpdateMultipleCall) Context(ctx context.Context) *AchievementsUpdateMultipleCall {
  5081. c.ctx_ = ctx
  5082. return c
  5083. }
  5084. // Header returns an http.Header that can be modified by the caller to
  5085. // add HTTP headers to the request.
  5086. func (c *AchievementsUpdateMultipleCall) Header() http.Header {
  5087. if c.header_ == nil {
  5088. c.header_ = make(http.Header)
  5089. }
  5090. return c.header_
  5091. }
  5092. func (c *AchievementsUpdateMultipleCall) doRequest(alt string) (*http.Response, error) {
  5093. reqHeaders := make(http.Header)
  5094. for k, v := range c.header_ {
  5095. reqHeaders[k] = v
  5096. }
  5097. reqHeaders.Set("User-Agent", c.s.userAgent())
  5098. var body io.Reader = nil
  5099. body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementupdatemultiplerequest)
  5100. if err != nil {
  5101. return nil, err
  5102. }
  5103. reqHeaders.Set("Content-Type", "application/json")
  5104. c.urlParams_.Set("alt", alt)
  5105. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/updateMultiple")
  5106. urls += "?" + c.urlParams_.Encode()
  5107. req, _ := http.NewRequest("POST", urls, body)
  5108. req.Header = reqHeaders
  5109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5110. }
  5111. // Do executes the "games.achievements.updateMultiple" call.
  5112. // Exactly one of *AchievementUpdateMultipleResponse or error will be
  5113. // non-nil. Any non-2xx status code is an error. Response headers are in
  5114. // either *AchievementUpdateMultipleResponse.ServerResponse.Header or
  5115. // (if a response was returned at all) in
  5116. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5117. // whether the returned error was because http.StatusNotModified was
  5118. // returned.
  5119. func (c *AchievementsUpdateMultipleCall) Do(opts ...googleapi.CallOption) (*AchievementUpdateMultipleResponse, error) {
  5120. gensupport.SetOptions(c.urlParams_, opts...)
  5121. res, err := c.doRequest("json")
  5122. if res != nil && res.StatusCode == http.StatusNotModified {
  5123. if res.Body != nil {
  5124. res.Body.Close()
  5125. }
  5126. return nil, &googleapi.Error{
  5127. Code: res.StatusCode,
  5128. Header: res.Header,
  5129. }
  5130. }
  5131. if err != nil {
  5132. return nil, err
  5133. }
  5134. defer googleapi.CloseBody(res)
  5135. if err := googleapi.CheckResponse(res); err != nil {
  5136. return nil, err
  5137. }
  5138. ret := &AchievementUpdateMultipleResponse{
  5139. ServerResponse: googleapi.ServerResponse{
  5140. Header: res.Header,
  5141. HTTPStatusCode: res.StatusCode,
  5142. },
  5143. }
  5144. target := &ret
  5145. if err := gensupport.DecodeResponse(target, res); err != nil {
  5146. return nil, err
  5147. }
  5148. return ret, nil
  5149. // {
  5150. // "description": "Updates multiple achievements for the currently authenticated player.",
  5151. // "httpMethod": "POST",
  5152. // "id": "games.achievements.updateMultiple",
  5153. // "path": "achievements/updateMultiple",
  5154. // "request": {
  5155. // "$ref": "AchievementUpdateMultipleRequest"
  5156. // },
  5157. // "response": {
  5158. // "$ref": "AchievementUpdateMultipleResponse"
  5159. // },
  5160. // "scopes": [
  5161. // "https://www.googleapis.com/auth/games",
  5162. // "https://www.googleapis.com/auth/plus.login"
  5163. // ]
  5164. // }
  5165. }
  5166. // method id "games.applications.get":
  5167. type ApplicationsGetCall struct {
  5168. s *Service
  5169. applicationId string
  5170. urlParams_ gensupport.URLParams
  5171. ifNoneMatch_ string
  5172. ctx_ context.Context
  5173. header_ http.Header
  5174. }
  5175. // Get: Retrieves the metadata of the application with the given ID. If
  5176. // the requested application is not available for the specified
  5177. // platformType, the returned response will not include any instance
  5178. // data.
  5179. func (r *ApplicationsService) Get(applicationId string) *ApplicationsGetCall {
  5180. c := &ApplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5181. c.applicationId = applicationId
  5182. return c
  5183. }
  5184. // Language sets the optional parameter "language": The preferred
  5185. // language to use for strings returned by this method.
  5186. func (c *ApplicationsGetCall) Language(language string) *ApplicationsGetCall {
  5187. c.urlParams_.Set("language", language)
  5188. return c
  5189. }
  5190. // PlatformType sets the optional parameter "platformType": Restrict
  5191. // application details returned to the specific platform.
  5192. //
  5193. // Possible values:
  5194. // "ANDROID" - Retrieve applications that can be played on Android.
  5195. // "IOS" - Retrieve applications that can be played on iOS.
  5196. // "WEB_APP" - Retrieve applications that can be played on desktop
  5197. // web.
  5198. func (c *ApplicationsGetCall) PlatformType(platformType string) *ApplicationsGetCall {
  5199. c.urlParams_.Set("platformType", platformType)
  5200. return c
  5201. }
  5202. // Fields allows partial responses to be retrieved. See
  5203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5204. // for more information.
  5205. func (c *ApplicationsGetCall) Fields(s ...googleapi.Field) *ApplicationsGetCall {
  5206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5207. return c
  5208. }
  5209. // IfNoneMatch sets the optional parameter which makes the operation
  5210. // fail if the object's ETag matches the given value. This is useful for
  5211. // getting updates only after the object has changed since the last
  5212. // request. Use googleapi.IsNotModified to check whether the response
  5213. // error from Do is the result of In-None-Match.
  5214. func (c *ApplicationsGetCall) IfNoneMatch(entityTag string) *ApplicationsGetCall {
  5215. c.ifNoneMatch_ = entityTag
  5216. return c
  5217. }
  5218. // Context sets the context to be used in this call's Do method. Any
  5219. // pending HTTP request will be aborted if the provided context is
  5220. // canceled.
  5221. func (c *ApplicationsGetCall) Context(ctx context.Context) *ApplicationsGetCall {
  5222. c.ctx_ = ctx
  5223. return c
  5224. }
  5225. // Header returns an http.Header that can be modified by the caller to
  5226. // add HTTP headers to the request.
  5227. func (c *ApplicationsGetCall) Header() http.Header {
  5228. if c.header_ == nil {
  5229. c.header_ = make(http.Header)
  5230. }
  5231. return c.header_
  5232. }
  5233. func (c *ApplicationsGetCall) doRequest(alt string) (*http.Response, error) {
  5234. reqHeaders := make(http.Header)
  5235. for k, v := range c.header_ {
  5236. reqHeaders[k] = v
  5237. }
  5238. reqHeaders.Set("User-Agent", c.s.userAgent())
  5239. if c.ifNoneMatch_ != "" {
  5240. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5241. }
  5242. var body io.Reader = nil
  5243. c.urlParams_.Set("alt", alt)
  5244. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}")
  5245. urls += "?" + c.urlParams_.Encode()
  5246. req, _ := http.NewRequest("GET", urls, body)
  5247. req.Header = reqHeaders
  5248. googleapi.Expand(req.URL, map[string]string{
  5249. "applicationId": c.applicationId,
  5250. })
  5251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5252. }
  5253. // Do executes the "games.applications.get" call.
  5254. // Exactly one of *Application or error will be non-nil. Any non-2xx
  5255. // status code is an error. Response headers are in either
  5256. // *Application.ServerResponse.Header or (if a response was returned at
  5257. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5258. // to check whether the returned error was because
  5259. // http.StatusNotModified was returned.
  5260. func (c *ApplicationsGetCall) Do(opts ...googleapi.CallOption) (*Application, error) {
  5261. gensupport.SetOptions(c.urlParams_, opts...)
  5262. res, err := c.doRequest("json")
  5263. if res != nil && res.StatusCode == http.StatusNotModified {
  5264. if res.Body != nil {
  5265. res.Body.Close()
  5266. }
  5267. return nil, &googleapi.Error{
  5268. Code: res.StatusCode,
  5269. Header: res.Header,
  5270. }
  5271. }
  5272. if err != nil {
  5273. return nil, err
  5274. }
  5275. defer googleapi.CloseBody(res)
  5276. if err := googleapi.CheckResponse(res); err != nil {
  5277. return nil, err
  5278. }
  5279. ret := &Application{
  5280. ServerResponse: googleapi.ServerResponse{
  5281. Header: res.Header,
  5282. HTTPStatusCode: res.StatusCode,
  5283. },
  5284. }
  5285. target := &ret
  5286. if err := gensupport.DecodeResponse(target, res); err != nil {
  5287. return nil, err
  5288. }
  5289. return ret, nil
  5290. // {
  5291. // "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.",
  5292. // "httpMethod": "GET",
  5293. // "id": "games.applications.get",
  5294. // "parameterOrder": [
  5295. // "applicationId"
  5296. // ],
  5297. // "parameters": {
  5298. // "applicationId": {
  5299. // "description": "The application ID from the Google Play developer console.",
  5300. // "location": "path",
  5301. // "required": true,
  5302. // "type": "string"
  5303. // },
  5304. // "language": {
  5305. // "description": "The preferred language to use for strings returned by this method.",
  5306. // "location": "query",
  5307. // "type": "string"
  5308. // },
  5309. // "platformType": {
  5310. // "description": "Restrict application details returned to the specific platform.",
  5311. // "enum": [
  5312. // "ANDROID",
  5313. // "IOS",
  5314. // "WEB_APP"
  5315. // ],
  5316. // "enumDescriptions": [
  5317. // "Retrieve applications that can be played on Android.",
  5318. // "Retrieve applications that can be played on iOS.",
  5319. // "Retrieve applications that can be played on desktop web."
  5320. // ],
  5321. // "location": "query",
  5322. // "type": "string"
  5323. // }
  5324. // },
  5325. // "path": "applications/{applicationId}",
  5326. // "response": {
  5327. // "$ref": "Application"
  5328. // },
  5329. // "scopes": [
  5330. // "https://www.googleapis.com/auth/games",
  5331. // "https://www.googleapis.com/auth/plus.login"
  5332. // ]
  5333. // }
  5334. }
  5335. // method id "games.applications.played":
  5336. type ApplicationsPlayedCall struct {
  5337. s *Service
  5338. urlParams_ gensupport.URLParams
  5339. ctx_ context.Context
  5340. header_ http.Header
  5341. }
  5342. // Played: Indicate that the the currently authenticated user is playing
  5343. // your application.
  5344. func (r *ApplicationsService) Played() *ApplicationsPlayedCall {
  5345. c := &ApplicationsPlayedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5346. return c
  5347. }
  5348. // Fields allows partial responses to be retrieved. See
  5349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5350. // for more information.
  5351. func (c *ApplicationsPlayedCall) Fields(s ...googleapi.Field) *ApplicationsPlayedCall {
  5352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5353. return c
  5354. }
  5355. // Context sets the context to be used in this call's Do method. Any
  5356. // pending HTTP request will be aborted if the provided context is
  5357. // canceled.
  5358. func (c *ApplicationsPlayedCall) Context(ctx context.Context) *ApplicationsPlayedCall {
  5359. c.ctx_ = ctx
  5360. return c
  5361. }
  5362. // Header returns an http.Header that can be modified by the caller to
  5363. // add HTTP headers to the request.
  5364. func (c *ApplicationsPlayedCall) Header() http.Header {
  5365. if c.header_ == nil {
  5366. c.header_ = make(http.Header)
  5367. }
  5368. return c.header_
  5369. }
  5370. func (c *ApplicationsPlayedCall) doRequest(alt string) (*http.Response, error) {
  5371. reqHeaders := make(http.Header)
  5372. for k, v := range c.header_ {
  5373. reqHeaders[k] = v
  5374. }
  5375. reqHeaders.Set("User-Agent", c.s.userAgent())
  5376. var body io.Reader = nil
  5377. c.urlParams_.Set("alt", alt)
  5378. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/played")
  5379. urls += "?" + c.urlParams_.Encode()
  5380. req, _ := http.NewRequest("POST", urls, body)
  5381. req.Header = reqHeaders
  5382. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5383. }
  5384. // Do executes the "games.applications.played" call.
  5385. func (c *ApplicationsPlayedCall) Do(opts ...googleapi.CallOption) error {
  5386. gensupport.SetOptions(c.urlParams_, opts...)
  5387. res, err := c.doRequest("json")
  5388. if err != nil {
  5389. return err
  5390. }
  5391. defer googleapi.CloseBody(res)
  5392. if err := googleapi.CheckResponse(res); err != nil {
  5393. return err
  5394. }
  5395. return nil
  5396. // {
  5397. // "description": "Indicate that the the currently authenticated user is playing your application.",
  5398. // "httpMethod": "POST",
  5399. // "id": "games.applications.played",
  5400. // "path": "applications/played",
  5401. // "scopes": [
  5402. // "https://www.googleapis.com/auth/games",
  5403. // "https://www.googleapis.com/auth/plus.login"
  5404. // ]
  5405. // }
  5406. }
  5407. // method id "games.applications.verify":
  5408. type ApplicationsVerifyCall struct {
  5409. s *Service
  5410. applicationId string
  5411. urlParams_ gensupport.URLParams
  5412. ifNoneMatch_ string
  5413. ctx_ context.Context
  5414. header_ http.Header
  5415. }
  5416. // Verify: Verifies the auth token provided with this request is for the
  5417. // application with the specified ID, and returns the ID of the player
  5418. // it was granted for.
  5419. func (r *ApplicationsService) Verify(applicationId string) *ApplicationsVerifyCall {
  5420. c := &ApplicationsVerifyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5421. c.applicationId = applicationId
  5422. return c
  5423. }
  5424. // Fields allows partial responses to be retrieved. See
  5425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5426. // for more information.
  5427. func (c *ApplicationsVerifyCall) Fields(s ...googleapi.Field) *ApplicationsVerifyCall {
  5428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5429. return c
  5430. }
  5431. // IfNoneMatch sets the optional parameter which makes the operation
  5432. // fail if the object's ETag matches the given value. This is useful for
  5433. // getting updates only after the object has changed since the last
  5434. // request. Use googleapi.IsNotModified to check whether the response
  5435. // error from Do is the result of In-None-Match.
  5436. func (c *ApplicationsVerifyCall) IfNoneMatch(entityTag string) *ApplicationsVerifyCall {
  5437. c.ifNoneMatch_ = entityTag
  5438. return c
  5439. }
  5440. // Context sets the context to be used in this call's Do method. Any
  5441. // pending HTTP request will be aborted if the provided context is
  5442. // canceled.
  5443. func (c *ApplicationsVerifyCall) Context(ctx context.Context) *ApplicationsVerifyCall {
  5444. c.ctx_ = ctx
  5445. return c
  5446. }
  5447. // Header returns an http.Header that can be modified by the caller to
  5448. // add HTTP headers to the request.
  5449. func (c *ApplicationsVerifyCall) Header() http.Header {
  5450. if c.header_ == nil {
  5451. c.header_ = make(http.Header)
  5452. }
  5453. return c.header_
  5454. }
  5455. func (c *ApplicationsVerifyCall) doRequest(alt string) (*http.Response, error) {
  5456. reqHeaders := make(http.Header)
  5457. for k, v := range c.header_ {
  5458. reqHeaders[k] = v
  5459. }
  5460. reqHeaders.Set("User-Agent", c.s.userAgent())
  5461. if c.ifNoneMatch_ != "" {
  5462. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5463. }
  5464. var body io.Reader = nil
  5465. c.urlParams_.Set("alt", alt)
  5466. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/verify")
  5467. urls += "?" + c.urlParams_.Encode()
  5468. req, _ := http.NewRequest("GET", urls, body)
  5469. req.Header = reqHeaders
  5470. googleapi.Expand(req.URL, map[string]string{
  5471. "applicationId": c.applicationId,
  5472. })
  5473. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5474. }
  5475. // Do executes the "games.applications.verify" call.
  5476. // Exactly one of *ApplicationVerifyResponse or error will be non-nil.
  5477. // Any non-2xx status code is an error. Response headers are in either
  5478. // *ApplicationVerifyResponse.ServerResponse.Header or (if a response
  5479. // was returned at all) in error.(*googleapi.Error).Header. Use
  5480. // googleapi.IsNotModified to check whether the returned error was
  5481. // because http.StatusNotModified was returned.
  5482. func (c *ApplicationsVerifyCall) Do(opts ...googleapi.CallOption) (*ApplicationVerifyResponse, error) {
  5483. gensupport.SetOptions(c.urlParams_, opts...)
  5484. res, err := c.doRequest("json")
  5485. if res != nil && res.StatusCode == http.StatusNotModified {
  5486. if res.Body != nil {
  5487. res.Body.Close()
  5488. }
  5489. return nil, &googleapi.Error{
  5490. Code: res.StatusCode,
  5491. Header: res.Header,
  5492. }
  5493. }
  5494. if err != nil {
  5495. return nil, err
  5496. }
  5497. defer googleapi.CloseBody(res)
  5498. if err := googleapi.CheckResponse(res); err != nil {
  5499. return nil, err
  5500. }
  5501. ret := &ApplicationVerifyResponse{
  5502. ServerResponse: googleapi.ServerResponse{
  5503. Header: res.Header,
  5504. HTTPStatusCode: res.StatusCode,
  5505. },
  5506. }
  5507. target := &ret
  5508. if err := gensupport.DecodeResponse(target, res); err != nil {
  5509. return nil, err
  5510. }
  5511. return ret, nil
  5512. // {
  5513. // "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.",
  5514. // "httpMethod": "GET",
  5515. // "id": "games.applications.verify",
  5516. // "parameterOrder": [
  5517. // "applicationId"
  5518. // ],
  5519. // "parameters": {
  5520. // "applicationId": {
  5521. // "description": "The application ID from the Google Play developer console.",
  5522. // "location": "path",
  5523. // "required": true,
  5524. // "type": "string"
  5525. // }
  5526. // },
  5527. // "path": "applications/{applicationId}/verify",
  5528. // "response": {
  5529. // "$ref": "ApplicationVerifyResponse"
  5530. // },
  5531. // "scopes": [
  5532. // "https://www.googleapis.com/auth/games",
  5533. // "https://www.googleapis.com/auth/plus.login"
  5534. // ]
  5535. // }
  5536. }
  5537. // method id "games.events.listByPlayer":
  5538. type EventsListByPlayerCall struct {
  5539. s *Service
  5540. urlParams_ gensupport.URLParams
  5541. ifNoneMatch_ string
  5542. ctx_ context.Context
  5543. header_ http.Header
  5544. }
  5545. // ListByPlayer: Returns a list showing the current progress on events
  5546. // in this application for the currently authenticated user.
  5547. func (r *EventsService) ListByPlayer() *EventsListByPlayerCall {
  5548. c := &EventsListByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5549. return c
  5550. }
  5551. // Language sets the optional parameter "language": The preferred
  5552. // language to use for strings returned by this method.
  5553. func (c *EventsListByPlayerCall) Language(language string) *EventsListByPlayerCall {
  5554. c.urlParams_.Set("language", language)
  5555. return c
  5556. }
  5557. // MaxResults sets the optional parameter "maxResults": The maximum
  5558. // number of events to return in the response, used for paging. For any
  5559. // response, the actual number of events to return may be less than the
  5560. // specified maxResults.
  5561. func (c *EventsListByPlayerCall) MaxResults(maxResults int64) *EventsListByPlayerCall {
  5562. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5563. return c
  5564. }
  5565. // PageToken sets the optional parameter "pageToken": The token returned
  5566. // by the previous request.
  5567. func (c *EventsListByPlayerCall) PageToken(pageToken string) *EventsListByPlayerCall {
  5568. c.urlParams_.Set("pageToken", pageToken)
  5569. return c
  5570. }
  5571. // Fields allows partial responses to be retrieved. See
  5572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5573. // for more information.
  5574. func (c *EventsListByPlayerCall) Fields(s ...googleapi.Field) *EventsListByPlayerCall {
  5575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5576. return c
  5577. }
  5578. // IfNoneMatch sets the optional parameter which makes the operation
  5579. // fail if the object's ETag matches the given value. This is useful for
  5580. // getting updates only after the object has changed since the last
  5581. // request. Use googleapi.IsNotModified to check whether the response
  5582. // error from Do is the result of In-None-Match.
  5583. func (c *EventsListByPlayerCall) IfNoneMatch(entityTag string) *EventsListByPlayerCall {
  5584. c.ifNoneMatch_ = entityTag
  5585. return c
  5586. }
  5587. // Context sets the context to be used in this call's Do method. Any
  5588. // pending HTTP request will be aborted if the provided context is
  5589. // canceled.
  5590. func (c *EventsListByPlayerCall) Context(ctx context.Context) *EventsListByPlayerCall {
  5591. c.ctx_ = ctx
  5592. return c
  5593. }
  5594. // Header returns an http.Header that can be modified by the caller to
  5595. // add HTTP headers to the request.
  5596. func (c *EventsListByPlayerCall) Header() http.Header {
  5597. if c.header_ == nil {
  5598. c.header_ = make(http.Header)
  5599. }
  5600. return c.header_
  5601. }
  5602. func (c *EventsListByPlayerCall) doRequest(alt string) (*http.Response, error) {
  5603. reqHeaders := make(http.Header)
  5604. for k, v := range c.header_ {
  5605. reqHeaders[k] = v
  5606. }
  5607. reqHeaders.Set("User-Agent", c.s.userAgent())
  5608. if c.ifNoneMatch_ != "" {
  5609. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5610. }
  5611. var body io.Reader = nil
  5612. c.urlParams_.Set("alt", alt)
  5613. urls := googleapi.ResolveRelative(c.s.BasePath, "events")
  5614. urls += "?" + c.urlParams_.Encode()
  5615. req, _ := http.NewRequest("GET", urls, body)
  5616. req.Header = reqHeaders
  5617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5618. }
  5619. // Do executes the "games.events.listByPlayer" call.
  5620. // Exactly one of *PlayerEventListResponse or error will be non-nil. Any
  5621. // non-2xx status code is an error. Response headers are in either
  5622. // *PlayerEventListResponse.ServerResponse.Header or (if a response was
  5623. // returned at all) in error.(*googleapi.Error).Header. Use
  5624. // googleapi.IsNotModified to check whether the returned error was
  5625. // because http.StatusNotModified was returned.
  5626. func (c *EventsListByPlayerCall) Do(opts ...googleapi.CallOption) (*PlayerEventListResponse, error) {
  5627. gensupport.SetOptions(c.urlParams_, opts...)
  5628. res, err := c.doRequest("json")
  5629. if res != nil && res.StatusCode == http.StatusNotModified {
  5630. if res.Body != nil {
  5631. res.Body.Close()
  5632. }
  5633. return nil, &googleapi.Error{
  5634. Code: res.StatusCode,
  5635. Header: res.Header,
  5636. }
  5637. }
  5638. if err != nil {
  5639. return nil, err
  5640. }
  5641. defer googleapi.CloseBody(res)
  5642. if err := googleapi.CheckResponse(res); err != nil {
  5643. return nil, err
  5644. }
  5645. ret := &PlayerEventListResponse{
  5646. ServerResponse: googleapi.ServerResponse{
  5647. Header: res.Header,
  5648. HTTPStatusCode: res.StatusCode,
  5649. },
  5650. }
  5651. target := &ret
  5652. if err := gensupport.DecodeResponse(target, res); err != nil {
  5653. return nil, err
  5654. }
  5655. return ret, nil
  5656. // {
  5657. // "description": "Returns a list showing the current progress on events in this application for the currently authenticated user.",
  5658. // "httpMethod": "GET",
  5659. // "id": "games.events.listByPlayer",
  5660. // "parameters": {
  5661. // "language": {
  5662. // "description": "The preferred language to use for strings returned by this method.",
  5663. // "location": "query",
  5664. // "type": "string"
  5665. // },
  5666. // "maxResults": {
  5667. // "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.",
  5668. // "format": "int32",
  5669. // "location": "query",
  5670. // "maximum": "100",
  5671. // "minimum": "1",
  5672. // "type": "integer"
  5673. // },
  5674. // "pageToken": {
  5675. // "description": "The token returned by the previous request.",
  5676. // "location": "query",
  5677. // "type": "string"
  5678. // }
  5679. // },
  5680. // "path": "events",
  5681. // "response": {
  5682. // "$ref": "PlayerEventListResponse"
  5683. // },
  5684. // "scopes": [
  5685. // "https://www.googleapis.com/auth/games",
  5686. // "https://www.googleapis.com/auth/plus.login"
  5687. // ]
  5688. // }
  5689. }
  5690. // Pages invokes f for each page of results.
  5691. // A non-nil error returned from f will halt the iteration.
  5692. // The provided context supersedes any context provided to the Context method.
  5693. func (c *EventsListByPlayerCall) Pages(ctx context.Context, f func(*PlayerEventListResponse) error) error {
  5694. c.ctx_ = ctx
  5695. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5696. for {
  5697. x, err := c.Do()
  5698. if err != nil {
  5699. return err
  5700. }
  5701. if err := f(x); err != nil {
  5702. return err
  5703. }
  5704. if x.NextPageToken == "" {
  5705. return nil
  5706. }
  5707. c.PageToken(x.NextPageToken)
  5708. }
  5709. }
  5710. // method id "games.events.listDefinitions":
  5711. type EventsListDefinitionsCall struct {
  5712. s *Service
  5713. urlParams_ gensupport.URLParams
  5714. ifNoneMatch_ string
  5715. ctx_ context.Context
  5716. header_ http.Header
  5717. }
  5718. // ListDefinitions: Returns a list of the event definitions in this
  5719. // application.
  5720. func (r *EventsService) ListDefinitions() *EventsListDefinitionsCall {
  5721. c := &EventsListDefinitionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5722. return c
  5723. }
  5724. // Language sets the optional parameter "language": The preferred
  5725. // language to use for strings returned by this method.
  5726. func (c *EventsListDefinitionsCall) Language(language string) *EventsListDefinitionsCall {
  5727. c.urlParams_.Set("language", language)
  5728. return c
  5729. }
  5730. // MaxResults sets the optional parameter "maxResults": The maximum
  5731. // number of event definitions to return in the response, used for
  5732. // paging. For any response, the actual number of event definitions to
  5733. // return may be less than the specified maxResults.
  5734. func (c *EventsListDefinitionsCall) MaxResults(maxResults int64) *EventsListDefinitionsCall {
  5735. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  5736. return c
  5737. }
  5738. // PageToken sets the optional parameter "pageToken": The token returned
  5739. // by the previous request.
  5740. func (c *EventsListDefinitionsCall) PageToken(pageToken string) *EventsListDefinitionsCall {
  5741. c.urlParams_.Set("pageToken", pageToken)
  5742. return c
  5743. }
  5744. // Fields allows partial responses to be retrieved. See
  5745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5746. // for more information.
  5747. func (c *EventsListDefinitionsCall) Fields(s ...googleapi.Field) *EventsListDefinitionsCall {
  5748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5749. return c
  5750. }
  5751. // IfNoneMatch sets the optional parameter which makes the operation
  5752. // fail if the object's ETag matches the given value. This is useful for
  5753. // getting updates only after the object has changed since the last
  5754. // request. Use googleapi.IsNotModified to check whether the response
  5755. // error from Do is the result of In-None-Match.
  5756. func (c *EventsListDefinitionsCall) IfNoneMatch(entityTag string) *EventsListDefinitionsCall {
  5757. c.ifNoneMatch_ = entityTag
  5758. return c
  5759. }
  5760. // Context sets the context to be used in this call's Do method. Any
  5761. // pending HTTP request will be aborted if the provided context is
  5762. // canceled.
  5763. func (c *EventsListDefinitionsCall) Context(ctx context.Context) *EventsListDefinitionsCall {
  5764. c.ctx_ = ctx
  5765. return c
  5766. }
  5767. // Header returns an http.Header that can be modified by the caller to
  5768. // add HTTP headers to the request.
  5769. func (c *EventsListDefinitionsCall) Header() http.Header {
  5770. if c.header_ == nil {
  5771. c.header_ = make(http.Header)
  5772. }
  5773. return c.header_
  5774. }
  5775. func (c *EventsListDefinitionsCall) doRequest(alt string) (*http.Response, error) {
  5776. reqHeaders := make(http.Header)
  5777. for k, v := range c.header_ {
  5778. reqHeaders[k] = v
  5779. }
  5780. reqHeaders.Set("User-Agent", c.s.userAgent())
  5781. if c.ifNoneMatch_ != "" {
  5782. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5783. }
  5784. var body io.Reader = nil
  5785. c.urlParams_.Set("alt", alt)
  5786. urls := googleapi.ResolveRelative(c.s.BasePath, "eventDefinitions")
  5787. urls += "?" + c.urlParams_.Encode()
  5788. req, _ := http.NewRequest("GET", urls, body)
  5789. req.Header = reqHeaders
  5790. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5791. }
  5792. // Do executes the "games.events.listDefinitions" call.
  5793. // Exactly one of *EventDefinitionListResponse or error will be non-nil.
  5794. // Any non-2xx status code is an error. Response headers are in either
  5795. // *EventDefinitionListResponse.ServerResponse.Header or (if a response
  5796. // was returned at all) in error.(*googleapi.Error).Header. Use
  5797. // googleapi.IsNotModified to check whether the returned error was
  5798. // because http.StatusNotModified was returned.
  5799. func (c *EventsListDefinitionsCall) Do(opts ...googleapi.CallOption) (*EventDefinitionListResponse, error) {
  5800. gensupport.SetOptions(c.urlParams_, opts...)
  5801. res, err := c.doRequest("json")
  5802. if res != nil && res.StatusCode == http.StatusNotModified {
  5803. if res.Body != nil {
  5804. res.Body.Close()
  5805. }
  5806. return nil, &googleapi.Error{
  5807. Code: res.StatusCode,
  5808. Header: res.Header,
  5809. }
  5810. }
  5811. if err != nil {
  5812. return nil, err
  5813. }
  5814. defer googleapi.CloseBody(res)
  5815. if err := googleapi.CheckResponse(res); err != nil {
  5816. return nil, err
  5817. }
  5818. ret := &EventDefinitionListResponse{
  5819. ServerResponse: googleapi.ServerResponse{
  5820. Header: res.Header,
  5821. HTTPStatusCode: res.StatusCode,
  5822. },
  5823. }
  5824. target := &ret
  5825. if err := gensupport.DecodeResponse(target, res); err != nil {
  5826. return nil, err
  5827. }
  5828. return ret, nil
  5829. // {
  5830. // "description": "Returns a list of the event definitions in this application.",
  5831. // "httpMethod": "GET",
  5832. // "id": "games.events.listDefinitions",
  5833. // "parameters": {
  5834. // "language": {
  5835. // "description": "The preferred language to use for strings returned by this method.",
  5836. // "location": "query",
  5837. // "type": "string"
  5838. // },
  5839. // "maxResults": {
  5840. // "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.",
  5841. // "format": "int32",
  5842. // "location": "query",
  5843. // "maximum": "100",
  5844. // "minimum": "1",
  5845. // "type": "integer"
  5846. // },
  5847. // "pageToken": {
  5848. // "description": "The token returned by the previous request.",
  5849. // "location": "query",
  5850. // "type": "string"
  5851. // }
  5852. // },
  5853. // "path": "eventDefinitions",
  5854. // "response": {
  5855. // "$ref": "EventDefinitionListResponse"
  5856. // },
  5857. // "scopes": [
  5858. // "https://www.googleapis.com/auth/games",
  5859. // "https://www.googleapis.com/auth/plus.login"
  5860. // ]
  5861. // }
  5862. }
  5863. // Pages invokes f for each page of results.
  5864. // A non-nil error returned from f will halt the iteration.
  5865. // The provided context supersedes any context provided to the Context method.
  5866. func (c *EventsListDefinitionsCall) Pages(ctx context.Context, f func(*EventDefinitionListResponse) error) error {
  5867. c.ctx_ = ctx
  5868. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5869. for {
  5870. x, err := c.Do()
  5871. if err != nil {
  5872. return err
  5873. }
  5874. if err := f(x); err != nil {
  5875. return err
  5876. }
  5877. if x.NextPageToken == "" {
  5878. return nil
  5879. }
  5880. c.PageToken(x.NextPageToken)
  5881. }
  5882. }
  5883. // method id "games.events.record":
  5884. type EventsRecordCall struct {
  5885. s *Service
  5886. eventrecordrequest *EventRecordRequest
  5887. urlParams_ gensupport.URLParams
  5888. ctx_ context.Context
  5889. header_ http.Header
  5890. }
  5891. // Record: Records a batch of changes to the number of times events have
  5892. // occurred for the currently authenticated user of this application.
  5893. func (r *EventsService) Record(eventrecordrequest *EventRecordRequest) *EventsRecordCall {
  5894. c := &EventsRecordCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5895. c.eventrecordrequest = eventrecordrequest
  5896. return c
  5897. }
  5898. // Language sets the optional parameter "language": The preferred
  5899. // language to use for strings returned by this method.
  5900. func (c *EventsRecordCall) Language(language string) *EventsRecordCall {
  5901. c.urlParams_.Set("language", language)
  5902. return c
  5903. }
  5904. // Fields allows partial responses to be retrieved. See
  5905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5906. // for more information.
  5907. func (c *EventsRecordCall) Fields(s ...googleapi.Field) *EventsRecordCall {
  5908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5909. return c
  5910. }
  5911. // Context sets the context to be used in this call's Do method. Any
  5912. // pending HTTP request will be aborted if the provided context is
  5913. // canceled.
  5914. func (c *EventsRecordCall) Context(ctx context.Context) *EventsRecordCall {
  5915. c.ctx_ = ctx
  5916. return c
  5917. }
  5918. // Header returns an http.Header that can be modified by the caller to
  5919. // add HTTP headers to the request.
  5920. func (c *EventsRecordCall) Header() http.Header {
  5921. if c.header_ == nil {
  5922. c.header_ = make(http.Header)
  5923. }
  5924. return c.header_
  5925. }
  5926. func (c *EventsRecordCall) doRequest(alt string) (*http.Response, error) {
  5927. reqHeaders := make(http.Header)
  5928. for k, v := range c.header_ {
  5929. reqHeaders[k] = v
  5930. }
  5931. reqHeaders.Set("User-Agent", c.s.userAgent())
  5932. var body io.Reader = nil
  5933. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventrecordrequest)
  5934. if err != nil {
  5935. return nil, err
  5936. }
  5937. reqHeaders.Set("Content-Type", "application/json")
  5938. c.urlParams_.Set("alt", alt)
  5939. urls := googleapi.ResolveRelative(c.s.BasePath, "events")
  5940. urls += "?" + c.urlParams_.Encode()
  5941. req, _ := http.NewRequest("POST", urls, body)
  5942. req.Header = reqHeaders
  5943. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5944. }
  5945. // Do executes the "games.events.record" call.
  5946. // Exactly one of *EventUpdateResponse or error will be non-nil. Any
  5947. // non-2xx status code is an error. Response headers are in either
  5948. // *EventUpdateResponse.ServerResponse.Header or (if a response was
  5949. // returned at all) in error.(*googleapi.Error).Header. Use
  5950. // googleapi.IsNotModified to check whether the returned error was
  5951. // because http.StatusNotModified was returned.
  5952. func (c *EventsRecordCall) Do(opts ...googleapi.CallOption) (*EventUpdateResponse, error) {
  5953. gensupport.SetOptions(c.urlParams_, opts...)
  5954. res, err := c.doRequest("json")
  5955. if res != nil && res.StatusCode == http.StatusNotModified {
  5956. if res.Body != nil {
  5957. res.Body.Close()
  5958. }
  5959. return nil, &googleapi.Error{
  5960. Code: res.StatusCode,
  5961. Header: res.Header,
  5962. }
  5963. }
  5964. if err != nil {
  5965. return nil, err
  5966. }
  5967. defer googleapi.CloseBody(res)
  5968. if err := googleapi.CheckResponse(res); err != nil {
  5969. return nil, err
  5970. }
  5971. ret := &EventUpdateResponse{
  5972. ServerResponse: googleapi.ServerResponse{
  5973. Header: res.Header,
  5974. HTTPStatusCode: res.StatusCode,
  5975. },
  5976. }
  5977. target := &ret
  5978. if err := gensupport.DecodeResponse(target, res); err != nil {
  5979. return nil, err
  5980. }
  5981. return ret, nil
  5982. // {
  5983. // "description": "Records a batch of changes to the number of times events have occurred for the currently authenticated user of this application.",
  5984. // "httpMethod": "POST",
  5985. // "id": "games.events.record",
  5986. // "parameters": {
  5987. // "language": {
  5988. // "description": "The preferred language to use for strings returned by this method.",
  5989. // "location": "query",
  5990. // "type": "string"
  5991. // }
  5992. // },
  5993. // "path": "events",
  5994. // "request": {
  5995. // "$ref": "EventRecordRequest"
  5996. // },
  5997. // "response": {
  5998. // "$ref": "EventUpdateResponse"
  5999. // },
  6000. // "scopes": [
  6001. // "https://www.googleapis.com/auth/games",
  6002. // "https://www.googleapis.com/auth/plus.login"
  6003. // ]
  6004. // }
  6005. }
  6006. // method id "games.leaderboards.get":
  6007. type LeaderboardsGetCall struct {
  6008. s *Service
  6009. leaderboardId string
  6010. urlParams_ gensupport.URLParams
  6011. ifNoneMatch_ string
  6012. ctx_ context.Context
  6013. header_ http.Header
  6014. }
  6015. // Get: Retrieves the metadata of the leaderboard with the given ID.
  6016. func (r *LeaderboardsService) Get(leaderboardId string) *LeaderboardsGetCall {
  6017. c := &LeaderboardsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6018. c.leaderboardId = leaderboardId
  6019. return c
  6020. }
  6021. // Language sets the optional parameter "language": The preferred
  6022. // language to use for strings returned by this method.
  6023. func (c *LeaderboardsGetCall) Language(language string) *LeaderboardsGetCall {
  6024. c.urlParams_.Set("language", language)
  6025. return c
  6026. }
  6027. // Fields allows partial responses to be retrieved. See
  6028. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6029. // for more information.
  6030. func (c *LeaderboardsGetCall) Fields(s ...googleapi.Field) *LeaderboardsGetCall {
  6031. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6032. return c
  6033. }
  6034. // IfNoneMatch sets the optional parameter which makes the operation
  6035. // fail if the object's ETag matches the given value. This is useful for
  6036. // getting updates only after the object has changed since the last
  6037. // request. Use googleapi.IsNotModified to check whether the response
  6038. // error from Do is the result of In-None-Match.
  6039. func (c *LeaderboardsGetCall) IfNoneMatch(entityTag string) *LeaderboardsGetCall {
  6040. c.ifNoneMatch_ = entityTag
  6041. return c
  6042. }
  6043. // Context sets the context to be used in this call's Do method. Any
  6044. // pending HTTP request will be aborted if the provided context is
  6045. // canceled.
  6046. func (c *LeaderboardsGetCall) Context(ctx context.Context) *LeaderboardsGetCall {
  6047. c.ctx_ = ctx
  6048. return c
  6049. }
  6050. // Header returns an http.Header that can be modified by the caller to
  6051. // add HTTP headers to the request.
  6052. func (c *LeaderboardsGetCall) Header() http.Header {
  6053. if c.header_ == nil {
  6054. c.header_ = make(http.Header)
  6055. }
  6056. return c.header_
  6057. }
  6058. func (c *LeaderboardsGetCall) doRequest(alt string) (*http.Response, error) {
  6059. reqHeaders := make(http.Header)
  6060. for k, v := range c.header_ {
  6061. reqHeaders[k] = v
  6062. }
  6063. reqHeaders.Set("User-Agent", c.s.userAgent())
  6064. if c.ifNoneMatch_ != "" {
  6065. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6066. }
  6067. var body io.Reader = nil
  6068. c.urlParams_.Set("alt", alt)
  6069. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  6070. urls += "?" + c.urlParams_.Encode()
  6071. req, _ := http.NewRequest("GET", urls, body)
  6072. req.Header = reqHeaders
  6073. googleapi.Expand(req.URL, map[string]string{
  6074. "leaderboardId": c.leaderboardId,
  6075. })
  6076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6077. }
  6078. // Do executes the "games.leaderboards.get" call.
  6079. // Exactly one of *Leaderboard or error will be non-nil. Any non-2xx
  6080. // status code is an error. Response headers are in either
  6081. // *Leaderboard.ServerResponse.Header or (if a response was returned at
  6082. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6083. // to check whether the returned error was because
  6084. // http.StatusNotModified was returned.
  6085. func (c *LeaderboardsGetCall) Do(opts ...googleapi.CallOption) (*Leaderboard, error) {
  6086. gensupport.SetOptions(c.urlParams_, opts...)
  6087. res, err := c.doRequest("json")
  6088. if res != nil && res.StatusCode == http.StatusNotModified {
  6089. if res.Body != nil {
  6090. res.Body.Close()
  6091. }
  6092. return nil, &googleapi.Error{
  6093. Code: res.StatusCode,
  6094. Header: res.Header,
  6095. }
  6096. }
  6097. if err != nil {
  6098. return nil, err
  6099. }
  6100. defer googleapi.CloseBody(res)
  6101. if err := googleapi.CheckResponse(res); err != nil {
  6102. return nil, err
  6103. }
  6104. ret := &Leaderboard{
  6105. ServerResponse: googleapi.ServerResponse{
  6106. Header: res.Header,
  6107. HTTPStatusCode: res.StatusCode,
  6108. },
  6109. }
  6110. target := &ret
  6111. if err := gensupport.DecodeResponse(target, res); err != nil {
  6112. return nil, err
  6113. }
  6114. return ret, nil
  6115. // {
  6116. // "description": "Retrieves the metadata of the leaderboard with the given ID.",
  6117. // "httpMethod": "GET",
  6118. // "id": "games.leaderboards.get",
  6119. // "parameterOrder": [
  6120. // "leaderboardId"
  6121. // ],
  6122. // "parameters": {
  6123. // "language": {
  6124. // "description": "The preferred language to use for strings returned by this method.",
  6125. // "location": "query",
  6126. // "type": "string"
  6127. // },
  6128. // "leaderboardId": {
  6129. // "description": "The ID of the leaderboard.",
  6130. // "location": "path",
  6131. // "required": true,
  6132. // "type": "string"
  6133. // }
  6134. // },
  6135. // "path": "leaderboards/{leaderboardId}",
  6136. // "response": {
  6137. // "$ref": "Leaderboard"
  6138. // },
  6139. // "scopes": [
  6140. // "https://www.googleapis.com/auth/games",
  6141. // "https://www.googleapis.com/auth/plus.login"
  6142. // ]
  6143. // }
  6144. }
  6145. // method id "games.leaderboards.list":
  6146. type LeaderboardsListCall struct {
  6147. s *Service
  6148. urlParams_ gensupport.URLParams
  6149. ifNoneMatch_ string
  6150. ctx_ context.Context
  6151. header_ http.Header
  6152. }
  6153. // List: Lists all the leaderboard metadata for your application.
  6154. func (r *LeaderboardsService) List() *LeaderboardsListCall {
  6155. c := &LeaderboardsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6156. return c
  6157. }
  6158. // Language sets the optional parameter "language": The preferred
  6159. // language to use for strings returned by this method.
  6160. func (c *LeaderboardsListCall) Language(language string) *LeaderboardsListCall {
  6161. c.urlParams_.Set("language", language)
  6162. return c
  6163. }
  6164. // MaxResults sets the optional parameter "maxResults": The maximum
  6165. // number of leaderboards to return in the response. For any response,
  6166. // the actual number of leaderboards returned may be less than the
  6167. // specified maxResults.
  6168. func (c *LeaderboardsListCall) MaxResults(maxResults int64) *LeaderboardsListCall {
  6169. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6170. return c
  6171. }
  6172. // PageToken sets the optional parameter "pageToken": The token returned
  6173. // by the previous request.
  6174. func (c *LeaderboardsListCall) PageToken(pageToken string) *LeaderboardsListCall {
  6175. c.urlParams_.Set("pageToken", pageToken)
  6176. return c
  6177. }
  6178. // Fields allows partial responses to be retrieved. See
  6179. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6180. // for more information.
  6181. func (c *LeaderboardsListCall) Fields(s ...googleapi.Field) *LeaderboardsListCall {
  6182. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6183. return c
  6184. }
  6185. // IfNoneMatch sets the optional parameter which makes the operation
  6186. // fail if the object's ETag matches the given value. This is useful for
  6187. // getting updates only after the object has changed since the last
  6188. // request. Use googleapi.IsNotModified to check whether the response
  6189. // error from Do is the result of In-None-Match.
  6190. func (c *LeaderboardsListCall) IfNoneMatch(entityTag string) *LeaderboardsListCall {
  6191. c.ifNoneMatch_ = entityTag
  6192. return c
  6193. }
  6194. // Context sets the context to be used in this call's Do method. Any
  6195. // pending HTTP request will be aborted if the provided context is
  6196. // canceled.
  6197. func (c *LeaderboardsListCall) Context(ctx context.Context) *LeaderboardsListCall {
  6198. c.ctx_ = ctx
  6199. return c
  6200. }
  6201. // Header returns an http.Header that can be modified by the caller to
  6202. // add HTTP headers to the request.
  6203. func (c *LeaderboardsListCall) Header() http.Header {
  6204. if c.header_ == nil {
  6205. c.header_ = make(http.Header)
  6206. }
  6207. return c.header_
  6208. }
  6209. func (c *LeaderboardsListCall) doRequest(alt string) (*http.Response, error) {
  6210. reqHeaders := make(http.Header)
  6211. for k, v := range c.header_ {
  6212. reqHeaders[k] = v
  6213. }
  6214. reqHeaders.Set("User-Agent", c.s.userAgent())
  6215. if c.ifNoneMatch_ != "" {
  6216. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6217. }
  6218. var body io.Reader = nil
  6219. c.urlParams_.Set("alt", alt)
  6220. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards")
  6221. urls += "?" + c.urlParams_.Encode()
  6222. req, _ := http.NewRequest("GET", urls, body)
  6223. req.Header = reqHeaders
  6224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6225. }
  6226. // Do executes the "games.leaderboards.list" call.
  6227. // Exactly one of *LeaderboardListResponse or error will be non-nil. Any
  6228. // non-2xx status code is an error. Response headers are in either
  6229. // *LeaderboardListResponse.ServerResponse.Header or (if a response was
  6230. // returned at all) in error.(*googleapi.Error).Header. Use
  6231. // googleapi.IsNotModified to check whether the returned error was
  6232. // because http.StatusNotModified was returned.
  6233. func (c *LeaderboardsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardListResponse, error) {
  6234. gensupport.SetOptions(c.urlParams_, opts...)
  6235. res, err := c.doRequest("json")
  6236. if res != nil && res.StatusCode == http.StatusNotModified {
  6237. if res.Body != nil {
  6238. res.Body.Close()
  6239. }
  6240. return nil, &googleapi.Error{
  6241. Code: res.StatusCode,
  6242. Header: res.Header,
  6243. }
  6244. }
  6245. if err != nil {
  6246. return nil, err
  6247. }
  6248. defer googleapi.CloseBody(res)
  6249. if err := googleapi.CheckResponse(res); err != nil {
  6250. return nil, err
  6251. }
  6252. ret := &LeaderboardListResponse{
  6253. ServerResponse: googleapi.ServerResponse{
  6254. Header: res.Header,
  6255. HTTPStatusCode: res.StatusCode,
  6256. },
  6257. }
  6258. target := &ret
  6259. if err := gensupport.DecodeResponse(target, res); err != nil {
  6260. return nil, err
  6261. }
  6262. return ret, nil
  6263. // {
  6264. // "description": "Lists all the leaderboard metadata for your application.",
  6265. // "httpMethod": "GET",
  6266. // "id": "games.leaderboards.list",
  6267. // "parameters": {
  6268. // "language": {
  6269. // "description": "The preferred language to use for strings returned by this method.",
  6270. // "location": "query",
  6271. // "type": "string"
  6272. // },
  6273. // "maxResults": {
  6274. // "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.",
  6275. // "format": "int32",
  6276. // "location": "query",
  6277. // "maximum": "200",
  6278. // "minimum": "1",
  6279. // "type": "integer"
  6280. // },
  6281. // "pageToken": {
  6282. // "description": "The token returned by the previous request.",
  6283. // "location": "query",
  6284. // "type": "string"
  6285. // }
  6286. // },
  6287. // "path": "leaderboards",
  6288. // "response": {
  6289. // "$ref": "LeaderboardListResponse"
  6290. // },
  6291. // "scopes": [
  6292. // "https://www.googleapis.com/auth/games",
  6293. // "https://www.googleapis.com/auth/plus.login"
  6294. // ]
  6295. // }
  6296. }
  6297. // Pages invokes f for each page of results.
  6298. // A non-nil error returned from f will halt the iteration.
  6299. // The provided context supersedes any context provided to the Context method.
  6300. func (c *LeaderboardsListCall) Pages(ctx context.Context, f func(*LeaderboardListResponse) error) error {
  6301. c.ctx_ = ctx
  6302. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6303. for {
  6304. x, err := c.Do()
  6305. if err != nil {
  6306. return err
  6307. }
  6308. if err := f(x); err != nil {
  6309. return err
  6310. }
  6311. if x.NextPageToken == "" {
  6312. return nil
  6313. }
  6314. c.PageToken(x.NextPageToken)
  6315. }
  6316. }
  6317. // method id "games.metagame.getMetagameConfig":
  6318. type MetagameGetMetagameConfigCall struct {
  6319. s *Service
  6320. urlParams_ gensupport.URLParams
  6321. ifNoneMatch_ string
  6322. ctx_ context.Context
  6323. header_ http.Header
  6324. }
  6325. // GetMetagameConfig: Return the metagame configuration data for the
  6326. // calling application.
  6327. func (r *MetagameService) GetMetagameConfig() *MetagameGetMetagameConfigCall {
  6328. c := &MetagameGetMetagameConfigCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6329. return c
  6330. }
  6331. // Fields allows partial responses to be retrieved. See
  6332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6333. // for more information.
  6334. func (c *MetagameGetMetagameConfigCall) Fields(s ...googleapi.Field) *MetagameGetMetagameConfigCall {
  6335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6336. return c
  6337. }
  6338. // IfNoneMatch sets the optional parameter which makes the operation
  6339. // fail if the object's ETag matches the given value. This is useful for
  6340. // getting updates only after the object has changed since the last
  6341. // request. Use googleapi.IsNotModified to check whether the response
  6342. // error from Do is the result of In-None-Match.
  6343. func (c *MetagameGetMetagameConfigCall) IfNoneMatch(entityTag string) *MetagameGetMetagameConfigCall {
  6344. c.ifNoneMatch_ = entityTag
  6345. return c
  6346. }
  6347. // Context sets the context to be used in this call's Do method. Any
  6348. // pending HTTP request will be aborted if the provided context is
  6349. // canceled.
  6350. func (c *MetagameGetMetagameConfigCall) Context(ctx context.Context) *MetagameGetMetagameConfigCall {
  6351. c.ctx_ = ctx
  6352. return c
  6353. }
  6354. // Header returns an http.Header that can be modified by the caller to
  6355. // add HTTP headers to the request.
  6356. func (c *MetagameGetMetagameConfigCall) Header() http.Header {
  6357. if c.header_ == nil {
  6358. c.header_ = make(http.Header)
  6359. }
  6360. return c.header_
  6361. }
  6362. func (c *MetagameGetMetagameConfigCall) doRequest(alt string) (*http.Response, error) {
  6363. reqHeaders := make(http.Header)
  6364. for k, v := range c.header_ {
  6365. reqHeaders[k] = v
  6366. }
  6367. reqHeaders.Set("User-Agent", c.s.userAgent())
  6368. if c.ifNoneMatch_ != "" {
  6369. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6370. }
  6371. var body io.Reader = nil
  6372. c.urlParams_.Set("alt", alt)
  6373. urls := googleapi.ResolveRelative(c.s.BasePath, "metagameConfig")
  6374. urls += "?" + c.urlParams_.Encode()
  6375. req, _ := http.NewRequest("GET", urls, body)
  6376. req.Header = reqHeaders
  6377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6378. }
  6379. // Do executes the "games.metagame.getMetagameConfig" call.
  6380. // Exactly one of *MetagameConfig or error will be non-nil. Any non-2xx
  6381. // status code is an error. Response headers are in either
  6382. // *MetagameConfig.ServerResponse.Header or (if a response was returned
  6383. // 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 *MetagameGetMetagameConfigCall) Do(opts ...googleapi.CallOption) (*MetagameConfig, 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 := &MetagameConfig{
  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": "Return the metagame configuration data for the calling application.",
  6418. // "httpMethod": "GET",
  6419. // "id": "games.metagame.getMetagameConfig",
  6420. // "path": "metagameConfig",
  6421. // "response": {
  6422. // "$ref": "MetagameConfig"
  6423. // },
  6424. // "scopes": [
  6425. // "https://www.googleapis.com/auth/games",
  6426. // "https://www.googleapis.com/auth/plus.login"
  6427. // ]
  6428. // }
  6429. }
  6430. // method id "games.metagame.listCategoriesByPlayer":
  6431. type MetagameListCategoriesByPlayerCall struct {
  6432. s *Service
  6433. playerId string
  6434. collection string
  6435. urlParams_ gensupport.URLParams
  6436. ifNoneMatch_ string
  6437. ctx_ context.Context
  6438. header_ http.Header
  6439. }
  6440. // ListCategoriesByPlayer: List play data aggregated per category for
  6441. // the player corresponding to playerId.
  6442. func (r *MetagameService) ListCategoriesByPlayer(playerId string, collection string) *MetagameListCategoriesByPlayerCall {
  6443. c := &MetagameListCategoriesByPlayerCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6444. c.playerId = playerId
  6445. c.collection = collection
  6446. return c
  6447. }
  6448. // Language sets the optional parameter "language": The preferred
  6449. // language to use for strings returned by this method.
  6450. func (c *MetagameListCategoriesByPlayerCall) Language(language string) *MetagameListCategoriesByPlayerCall {
  6451. c.urlParams_.Set("language", language)
  6452. return c
  6453. }
  6454. // MaxResults sets the optional parameter "maxResults": The maximum
  6455. // number of category resources to return in the response, used for
  6456. // paging. For any response, the actual number of category resources
  6457. // returned may be less than the specified maxResults.
  6458. func (c *MetagameListCategoriesByPlayerCall) MaxResults(maxResults int64) *MetagameListCategoriesByPlayerCall {
  6459. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6460. return c
  6461. }
  6462. // PageToken sets the optional parameter "pageToken": The token returned
  6463. // by the previous request.
  6464. func (c *MetagameListCategoriesByPlayerCall) PageToken(pageToken string) *MetagameListCategoriesByPlayerCall {
  6465. c.urlParams_.Set("pageToken", pageToken)
  6466. return c
  6467. }
  6468. // Fields allows partial responses to be retrieved. See
  6469. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6470. // for more information.
  6471. func (c *MetagameListCategoriesByPlayerCall) Fields(s ...googleapi.Field) *MetagameListCategoriesByPlayerCall {
  6472. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6473. return c
  6474. }
  6475. // IfNoneMatch sets the optional parameter which makes the operation
  6476. // fail if the object's ETag matches the given value. This is useful for
  6477. // getting updates only after the object has changed since the last
  6478. // request. Use googleapi.IsNotModified to check whether the response
  6479. // error from Do is the result of In-None-Match.
  6480. func (c *MetagameListCategoriesByPlayerCall) IfNoneMatch(entityTag string) *MetagameListCategoriesByPlayerCall {
  6481. c.ifNoneMatch_ = entityTag
  6482. return c
  6483. }
  6484. // Context sets the context to be used in this call's Do method. Any
  6485. // pending HTTP request will be aborted if the provided context is
  6486. // canceled.
  6487. func (c *MetagameListCategoriesByPlayerCall) Context(ctx context.Context) *MetagameListCategoriesByPlayerCall {
  6488. c.ctx_ = ctx
  6489. return c
  6490. }
  6491. // Header returns an http.Header that can be modified by the caller to
  6492. // add HTTP headers to the request.
  6493. func (c *MetagameListCategoriesByPlayerCall) Header() http.Header {
  6494. if c.header_ == nil {
  6495. c.header_ = make(http.Header)
  6496. }
  6497. return c.header_
  6498. }
  6499. func (c *MetagameListCategoriesByPlayerCall) doRequest(alt string) (*http.Response, error) {
  6500. reqHeaders := make(http.Header)
  6501. for k, v := range c.header_ {
  6502. reqHeaders[k] = v
  6503. }
  6504. reqHeaders.Set("User-Agent", c.s.userAgent())
  6505. if c.ifNoneMatch_ != "" {
  6506. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6507. }
  6508. var body io.Reader = nil
  6509. c.urlParams_.Set("alt", alt)
  6510. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/categories/{collection}")
  6511. urls += "?" + c.urlParams_.Encode()
  6512. req, _ := http.NewRequest("GET", urls, body)
  6513. req.Header = reqHeaders
  6514. googleapi.Expand(req.URL, map[string]string{
  6515. "playerId": c.playerId,
  6516. "collection": c.collection,
  6517. })
  6518. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6519. }
  6520. // Do executes the "games.metagame.listCategoriesByPlayer" call.
  6521. // Exactly one of *CategoryListResponse or error will be non-nil. Any
  6522. // non-2xx status code is an error. Response headers are in either
  6523. // *CategoryListResponse.ServerResponse.Header or (if a response was
  6524. // returned at all) in error.(*googleapi.Error).Header. Use
  6525. // googleapi.IsNotModified to check whether the returned error was
  6526. // because http.StatusNotModified was returned.
  6527. func (c *MetagameListCategoriesByPlayerCall) Do(opts ...googleapi.CallOption) (*CategoryListResponse, error) {
  6528. gensupport.SetOptions(c.urlParams_, opts...)
  6529. res, err := c.doRequest("json")
  6530. if res != nil && res.StatusCode == http.StatusNotModified {
  6531. if res.Body != nil {
  6532. res.Body.Close()
  6533. }
  6534. return nil, &googleapi.Error{
  6535. Code: res.StatusCode,
  6536. Header: res.Header,
  6537. }
  6538. }
  6539. if err != nil {
  6540. return nil, err
  6541. }
  6542. defer googleapi.CloseBody(res)
  6543. if err := googleapi.CheckResponse(res); err != nil {
  6544. return nil, err
  6545. }
  6546. ret := &CategoryListResponse{
  6547. ServerResponse: googleapi.ServerResponse{
  6548. Header: res.Header,
  6549. HTTPStatusCode: res.StatusCode,
  6550. },
  6551. }
  6552. target := &ret
  6553. if err := gensupport.DecodeResponse(target, res); err != nil {
  6554. return nil, err
  6555. }
  6556. return ret, nil
  6557. // {
  6558. // "description": "List play data aggregated per category for the player corresponding to playerId.",
  6559. // "httpMethod": "GET",
  6560. // "id": "games.metagame.listCategoriesByPlayer",
  6561. // "parameterOrder": [
  6562. // "playerId",
  6563. // "collection"
  6564. // ],
  6565. // "parameters": {
  6566. // "collection": {
  6567. // "description": "The collection of categories for which data will be returned.",
  6568. // "enum": [
  6569. // "all"
  6570. // ],
  6571. // "enumDescriptions": [
  6572. // "Retrieve data for all categories. This is the default."
  6573. // ],
  6574. // "location": "path",
  6575. // "required": true,
  6576. // "type": "string"
  6577. // },
  6578. // "language": {
  6579. // "description": "The preferred language to use for strings returned by this method.",
  6580. // "location": "query",
  6581. // "type": "string"
  6582. // },
  6583. // "maxResults": {
  6584. // "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.",
  6585. // "format": "int32",
  6586. // "location": "query",
  6587. // "maximum": "100",
  6588. // "minimum": "1",
  6589. // "type": "integer"
  6590. // },
  6591. // "pageToken": {
  6592. // "description": "The token returned by the previous request.",
  6593. // "location": "query",
  6594. // "type": "string"
  6595. // },
  6596. // "playerId": {
  6597. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  6598. // "location": "path",
  6599. // "required": true,
  6600. // "type": "string"
  6601. // }
  6602. // },
  6603. // "path": "players/{playerId}/categories/{collection}",
  6604. // "response": {
  6605. // "$ref": "CategoryListResponse"
  6606. // },
  6607. // "scopes": [
  6608. // "https://www.googleapis.com/auth/games",
  6609. // "https://www.googleapis.com/auth/plus.login"
  6610. // ]
  6611. // }
  6612. }
  6613. // Pages invokes f for each page of results.
  6614. // A non-nil error returned from f will halt the iteration.
  6615. // The provided context supersedes any context provided to the Context method.
  6616. func (c *MetagameListCategoriesByPlayerCall) Pages(ctx context.Context, f func(*CategoryListResponse) error) error {
  6617. c.ctx_ = ctx
  6618. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6619. for {
  6620. x, err := c.Do()
  6621. if err != nil {
  6622. return err
  6623. }
  6624. if err := f(x); err != nil {
  6625. return err
  6626. }
  6627. if x.NextPageToken == "" {
  6628. return nil
  6629. }
  6630. c.PageToken(x.NextPageToken)
  6631. }
  6632. }
  6633. // method id "games.players.get":
  6634. type PlayersGetCall struct {
  6635. s *Service
  6636. playerId string
  6637. urlParams_ gensupport.URLParams
  6638. ifNoneMatch_ string
  6639. ctx_ context.Context
  6640. header_ http.Header
  6641. }
  6642. // Get: Retrieves the Player resource with the given ID. To retrieve the
  6643. // player for the currently authenticated user, set playerId to me.
  6644. func (r *PlayersService) Get(playerId string) *PlayersGetCall {
  6645. c := &PlayersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6646. c.playerId = playerId
  6647. return c
  6648. }
  6649. // Language sets the optional parameter "language": The preferred
  6650. // language to use for strings returned by this method.
  6651. func (c *PlayersGetCall) Language(language string) *PlayersGetCall {
  6652. c.urlParams_.Set("language", language)
  6653. return c
  6654. }
  6655. // Fields allows partial responses to be retrieved. See
  6656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6657. // for more information.
  6658. func (c *PlayersGetCall) Fields(s ...googleapi.Field) *PlayersGetCall {
  6659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6660. return c
  6661. }
  6662. // IfNoneMatch sets the optional parameter which makes the operation
  6663. // fail if the object's ETag matches the given value. This is useful for
  6664. // getting updates only after the object has changed since the last
  6665. // request. Use googleapi.IsNotModified to check whether the response
  6666. // error from Do is the result of In-None-Match.
  6667. func (c *PlayersGetCall) IfNoneMatch(entityTag string) *PlayersGetCall {
  6668. c.ifNoneMatch_ = entityTag
  6669. return c
  6670. }
  6671. // Context sets the context to be used in this call's Do method. Any
  6672. // pending HTTP request will be aborted if the provided context is
  6673. // canceled.
  6674. func (c *PlayersGetCall) Context(ctx context.Context) *PlayersGetCall {
  6675. c.ctx_ = ctx
  6676. return c
  6677. }
  6678. // Header returns an http.Header that can be modified by the caller to
  6679. // add HTTP headers to the request.
  6680. func (c *PlayersGetCall) Header() http.Header {
  6681. if c.header_ == nil {
  6682. c.header_ = make(http.Header)
  6683. }
  6684. return c.header_
  6685. }
  6686. func (c *PlayersGetCall) doRequest(alt string) (*http.Response, error) {
  6687. reqHeaders := make(http.Header)
  6688. for k, v := range c.header_ {
  6689. reqHeaders[k] = v
  6690. }
  6691. reqHeaders.Set("User-Agent", c.s.userAgent())
  6692. if c.ifNoneMatch_ != "" {
  6693. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6694. }
  6695. var body io.Reader = nil
  6696. c.urlParams_.Set("alt", alt)
  6697. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}")
  6698. urls += "?" + c.urlParams_.Encode()
  6699. req, _ := http.NewRequest("GET", urls, body)
  6700. req.Header = reqHeaders
  6701. googleapi.Expand(req.URL, map[string]string{
  6702. "playerId": c.playerId,
  6703. })
  6704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6705. }
  6706. // Do executes the "games.players.get" call.
  6707. // Exactly one of *Player or error will be non-nil. Any non-2xx status
  6708. // code is an error. Response headers are in either
  6709. // *Player.ServerResponse.Header or (if a response was returned at all)
  6710. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6711. // check whether the returned error was because http.StatusNotModified
  6712. // was returned.
  6713. func (c *PlayersGetCall) Do(opts ...googleapi.CallOption) (*Player, error) {
  6714. gensupport.SetOptions(c.urlParams_, opts...)
  6715. res, err := c.doRequest("json")
  6716. if res != nil && res.StatusCode == http.StatusNotModified {
  6717. if res.Body != nil {
  6718. res.Body.Close()
  6719. }
  6720. return nil, &googleapi.Error{
  6721. Code: res.StatusCode,
  6722. Header: res.Header,
  6723. }
  6724. }
  6725. if err != nil {
  6726. return nil, err
  6727. }
  6728. defer googleapi.CloseBody(res)
  6729. if err := googleapi.CheckResponse(res); err != nil {
  6730. return nil, err
  6731. }
  6732. ret := &Player{
  6733. ServerResponse: googleapi.ServerResponse{
  6734. Header: res.Header,
  6735. HTTPStatusCode: res.StatusCode,
  6736. },
  6737. }
  6738. target := &ret
  6739. if err := gensupport.DecodeResponse(target, res); err != nil {
  6740. return nil, err
  6741. }
  6742. return ret, nil
  6743. // {
  6744. // "description": "Retrieves the Player resource with the given ID. To retrieve the player for the currently authenticated user, set playerId to me.",
  6745. // "httpMethod": "GET",
  6746. // "id": "games.players.get",
  6747. // "parameterOrder": [
  6748. // "playerId"
  6749. // ],
  6750. // "parameters": {
  6751. // "language": {
  6752. // "description": "The preferred language to use for strings returned by this method.",
  6753. // "location": "query",
  6754. // "type": "string"
  6755. // },
  6756. // "playerId": {
  6757. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  6758. // "location": "path",
  6759. // "required": true,
  6760. // "type": "string"
  6761. // }
  6762. // },
  6763. // "path": "players/{playerId}",
  6764. // "response": {
  6765. // "$ref": "Player"
  6766. // },
  6767. // "scopes": [
  6768. // "https://www.googleapis.com/auth/games",
  6769. // "https://www.googleapis.com/auth/plus.login"
  6770. // ]
  6771. // }
  6772. }
  6773. // method id "games.players.list":
  6774. type PlayersListCall struct {
  6775. s *Service
  6776. collection string
  6777. urlParams_ gensupport.URLParams
  6778. ifNoneMatch_ string
  6779. ctx_ context.Context
  6780. header_ http.Header
  6781. }
  6782. // List: Get the collection of players for the currently authenticated
  6783. // user.
  6784. func (r *PlayersService) List(collection string) *PlayersListCall {
  6785. c := &PlayersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6786. c.collection = collection
  6787. return c
  6788. }
  6789. // Language sets the optional parameter "language": The preferred
  6790. // language to use for strings returned by this method.
  6791. func (c *PlayersListCall) Language(language string) *PlayersListCall {
  6792. c.urlParams_.Set("language", language)
  6793. return c
  6794. }
  6795. // MaxResults sets the optional parameter "maxResults": The maximum
  6796. // number of player resources to return in the response, used for
  6797. // paging. For any response, the actual number of player resources
  6798. // returned may be less than the specified maxResults.
  6799. func (c *PlayersListCall) MaxResults(maxResults int64) *PlayersListCall {
  6800. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6801. return c
  6802. }
  6803. // PageToken sets the optional parameter "pageToken": The token returned
  6804. // by the previous request.
  6805. func (c *PlayersListCall) PageToken(pageToken string) *PlayersListCall {
  6806. c.urlParams_.Set("pageToken", pageToken)
  6807. return c
  6808. }
  6809. // Fields allows partial responses to be retrieved. See
  6810. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6811. // for more information.
  6812. func (c *PlayersListCall) Fields(s ...googleapi.Field) *PlayersListCall {
  6813. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6814. return c
  6815. }
  6816. // IfNoneMatch sets the optional parameter which makes the operation
  6817. // fail if the object's ETag matches the given value. This is useful for
  6818. // getting updates only after the object has changed since the last
  6819. // request. Use googleapi.IsNotModified to check whether the response
  6820. // error from Do is the result of In-None-Match.
  6821. func (c *PlayersListCall) IfNoneMatch(entityTag string) *PlayersListCall {
  6822. c.ifNoneMatch_ = entityTag
  6823. return c
  6824. }
  6825. // Context sets the context to be used in this call's Do method. Any
  6826. // pending HTTP request will be aborted if the provided context is
  6827. // canceled.
  6828. func (c *PlayersListCall) Context(ctx context.Context) *PlayersListCall {
  6829. c.ctx_ = ctx
  6830. return c
  6831. }
  6832. // Header returns an http.Header that can be modified by the caller to
  6833. // add HTTP headers to the request.
  6834. func (c *PlayersListCall) Header() http.Header {
  6835. if c.header_ == nil {
  6836. c.header_ = make(http.Header)
  6837. }
  6838. return c.header_
  6839. }
  6840. func (c *PlayersListCall) doRequest(alt string) (*http.Response, error) {
  6841. reqHeaders := make(http.Header)
  6842. for k, v := range c.header_ {
  6843. reqHeaders[k] = v
  6844. }
  6845. reqHeaders.Set("User-Agent", c.s.userAgent())
  6846. if c.ifNoneMatch_ != "" {
  6847. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6848. }
  6849. var body io.Reader = nil
  6850. c.urlParams_.Set("alt", alt)
  6851. urls := googleapi.ResolveRelative(c.s.BasePath, "players/me/players/{collection}")
  6852. urls += "?" + c.urlParams_.Encode()
  6853. req, _ := http.NewRequest("GET", urls, body)
  6854. req.Header = reqHeaders
  6855. googleapi.Expand(req.URL, map[string]string{
  6856. "collection": c.collection,
  6857. })
  6858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6859. }
  6860. // Do executes the "games.players.list" call.
  6861. // Exactly one of *PlayerListResponse or error will be non-nil. Any
  6862. // non-2xx status code is an error. Response headers are in either
  6863. // *PlayerListResponse.ServerResponse.Header or (if a response was
  6864. // returned at all) in error.(*googleapi.Error).Header. Use
  6865. // googleapi.IsNotModified to check whether the returned error was
  6866. // because http.StatusNotModified was returned.
  6867. func (c *PlayersListCall) Do(opts ...googleapi.CallOption) (*PlayerListResponse, error) {
  6868. gensupport.SetOptions(c.urlParams_, opts...)
  6869. res, err := c.doRequest("json")
  6870. if res != nil && res.StatusCode == http.StatusNotModified {
  6871. if res.Body != nil {
  6872. res.Body.Close()
  6873. }
  6874. return nil, &googleapi.Error{
  6875. Code: res.StatusCode,
  6876. Header: res.Header,
  6877. }
  6878. }
  6879. if err != nil {
  6880. return nil, err
  6881. }
  6882. defer googleapi.CloseBody(res)
  6883. if err := googleapi.CheckResponse(res); err != nil {
  6884. return nil, err
  6885. }
  6886. ret := &PlayerListResponse{
  6887. ServerResponse: googleapi.ServerResponse{
  6888. Header: res.Header,
  6889. HTTPStatusCode: res.StatusCode,
  6890. },
  6891. }
  6892. target := &ret
  6893. if err := gensupport.DecodeResponse(target, res); err != nil {
  6894. return nil, err
  6895. }
  6896. return ret, nil
  6897. // {
  6898. // "description": "Get the collection of players for the currently authenticated user.",
  6899. // "httpMethod": "GET",
  6900. // "id": "games.players.list",
  6901. // "parameterOrder": [
  6902. // "collection"
  6903. // ],
  6904. // "parameters": {
  6905. // "collection": {
  6906. // "description": "Collection of players being retrieved",
  6907. // "enum": [
  6908. // "connected",
  6909. // "playedWith",
  6910. // "played_with",
  6911. // "visible"
  6912. // ],
  6913. // "enumDescriptions": [
  6914. // "Retrieve a list of players that are also playing this game in reverse chronological order.",
  6915. // "(DEPRECATED: please use played_with!) Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.",
  6916. // "Retrieve a list of players you have played a multiplayer game (realtime or turn-based) with recently.",
  6917. // "Retrieve a list of players in the user's social graph that are visible to this game."
  6918. // ],
  6919. // "location": "path",
  6920. // "required": true,
  6921. // "type": "string"
  6922. // },
  6923. // "language": {
  6924. // "description": "The preferred language to use for strings returned by this method.",
  6925. // "location": "query",
  6926. // "type": "string"
  6927. // },
  6928. // "maxResults": {
  6929. // "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.",
  6930. // "format": "int32",
  6931. // "location": "query",
  6932. // "maximum": "50",
  6933. // "minimum": "1",
  6934. // "type": "integer"
  6935. // },
  6936. // "pageToken": {
  6937. // "description": "The token returned by the previous request.",
  6938. // "location": "query",
  6939. // "type": "string"
  6940. // }
  6941. // },
  6942. // "path": "players/me/players/{collection}",
  6943. // "response": {
  6944. // "$ref": "PlayerListResponse"
  6945. // },
  6946. // "scopes": [
  6947. // "https://www.googleapis.com/auth/games",
  6948. // "https://www.googleapis.com/auth/plus.login"
  6949. // ]
  6950. // }
  6951. }
  6952. // Pages invokes f for each page of results.
  6953. // A non-nil error returned from f will halt the iteration.
  6954. // The provided context supersedes any context provided to the Context method.
  6955. func (c *PlayersListCall) Pages(ctx context.Context, f func(*PlayerListResponse) error) error {
  6956. c.ctx_ = ctx
  6957. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6958. for {
  6959. x, err := c.Do()
  6960. if err != nil {
  6961. return err
  6962. }
  6963. if err := f(x); err != nil {
  6964. return err
  6965. }
  6966. if x.NextPageToken == "" {
  6967. return nil
  6968. }
  6969. c.PageToken(x.NextPageToken)
  6970. }
  6971. }
  6972. // method id "games.pushtokens.remove":
  6973. type PushtokensRemoveCall struct {
  6974. s *Service
  6975. pushtokenid *PushTokenId
  6976. urlParams_ gensupport.URLParams
  6977. ctx_ context.Context
  6978. header_ http.Header
  6979. }
  6980. // Remove: Removes a push token for the current user and application.
  6981. // Removing a non-existent push token will report success.
  6982. func (r *PushtokensService) Remove(pushtokenid *PushTokenId) *PushtokensRemoveCall {
  6983. c := &PushtokensRemoveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6984. c.pushtokenid = pushtokenid
  6985. return c
  6986. }
  6987. // Fields allows partial responses to be retrieved. See
  6988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6989. // for more information.
  6990. func (c *PushtokensRemoveCall) Fields(s ...googleapi.Field) *PushtokensRemoveCall {
  6991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6992. return c
  6993. }
  6994. // Context sets the context to be used in this call's Do method. Any
  6995. // pending HTTP request will be aborted if the provided context is
  6996. // canceled.
  6997. func (c *PushtokensRemoveCall) Context(ctx context.Context) *PushtokensRemoveCall {
  6998. c.ctx_ = ctx
  6999. return c
  7000. }
  7001. // Header returns an http.Header that can be modified by the caller to
  7002. // add HTTP headers to the request.
  7003. func (c *PushtokensRemoveCall) Header() http.Header {
  7004. if c.header_ == nil {
  7005. c.header_ = make(http.Header)
  7006. }
  7007. return c.header_
  7008. }
  7009. func (c *PushtokensRemoveCall) doRequest(alt string) (*http.Response, error) {
  7010. reqHeaders := make(http.Header)
  7011. for k, v := range c.header_ {
  7012. reqHeaders[k] = v
  7013. }
  7014. reqHeaders.Set("User-Agent", c.s.userAgent())
  7015. var body io.Reader = nil
  7016. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtokenid)
  7017. if err != nil {
  7018. return nil, err
  7019. }
  7020. reqHeaders.Set("Content-Type", "application/json")
  7021. c.urlParams_.Set("alt", alt)
  7022. urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens/remove")
  7023. urls += "?" + c.urlParams_.Encode()
  7024. req, _ := http.NewRequest("POST", urls, body)
  7025. req.Header = reqHeaders
  7026. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7027. }
  7028. // Do executes the "games.pushtokens.remove" call.
  7029. func (c *PushtokensRemoveCall) Do(opts ...googleapi.CallOption) error {
  7030. gensupport.SetOptions(c.urlParams_, opts...)
  7031. res, err := c.doRequest("json")
  7032. if err != nil {
  7033. return err
  7034. }
  7035. defer googleapi.CloseBody(res)
  7036. if err := googleapi.CheckResponse(res); err != nil {
  7037. return err
  7038. }
  7039. return nil
  7040. // {
  7041. // "description": "Removes a push token for the current user and application. Removing a non-existent push token will report success.",
  7042. // "httpMethod": "POST",
  7043. // "id": "games.pushtokens.remove",
  7044. // "path": "pushtokens/remove",
  7045. // "request": {
  7046. // "$ref": "PushTokenId"
  7047. // },
  7048. // "scopes": [
  7049. // "https://www.googleapis.com/auth/games",
  7050. // "https://www.googleapis.com/auth/plus.login"
  7051. // ]
  7052. // }
  7053. }
  7054. // method id "games.pushtokens.update":
  7055. type PushtokensUpdateCall struct {
  7056. s *Service
  7057. pushtoken *PushToken
  7058. urlParams_ gensupport.URLParams
  7059. ctx_ context.Context
  7060. header_ http.Header
  7061. }
  7062. // Update: Registers a push token for the current user and application.
  7063. func (r *PushtokensService) Update(pushtoken *PushToken) *PushtokensUpdateCall {
  7064. c := &PushtokensUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7065. c.pushtoken = pushtoken
  7066. return c
  7067. }
  7068. // Fields allows partial responses to be retrieved. See
  7069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7070. // for more information.
  7071. func (c *PushtokensUpdateCall) Fields(s ...googleapi.Field) *PushtokensUpdateCall {
  7072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7073. return c
  7074. }
  7075. // Context sets the context to be used in this call's Do method. Any
  7076. // pending HTTP request will be aborted if the provided context is
  7077. // canceled.
  7078. func (c *PushtokensUpdateCall) Context(ctx context.Context) *PushtokensUpdateCall {
  7079. c.ctx_ = ctx
  7080. return c
  7081. }
  7082. // Header returns an http.Header that can be modified by the caller to
  7083. // add HTTP headers to the request.
  7084. func (c *PushtokensUpdateCall) Header() http.Header {
  7085. if c.header_ == nil {
  7086. c.header_ = make(http.Header)
  7087. }
  7088. return c.header_
  7089. }
  7090. func (c *PushtokensUpdateCall) doRequest(alt string) (*http.Response, error) {
  7091. reqHeaders := make(http.Header)
  7092. for k, v := range c.header_ {
  7093. reqHeaders[k] = v
  7094. }
  7095. reqHeaders.Set("User-Agent", c.s.userAgent())
  7096. var body io.Reader = nil
  7097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushtoken)
  7098. if err != nil {
  7099. return nil, err
  7100. }
  7101. reqHeaders.Set("Content-Type", "application/json")
  7102. c.urlParams_.Set("alt", alt)
  7103. urls := googleapi.ResolveRelative(c.s.BasePath, "pushtokens")
  7104. urls += "?" + c.urlParams_.Encode()
  7105. req, _ := http.NewRequest("PUT", urls, body)
  7106. req.Header = reqHeaders
  7107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7108. }
  7109. // Do executes the "games.pushtokens.update" call.
  7110. func (c *PushtokensUpdateCall) Do(opts ...googleapi.CallOption) error {
  7111. gensupport.SetOptions(c.urlParams_, opts...)
  7112. res, err := c.doRequest("json")
  7113. if err != nil {
  7114. return err
  7115. }
  7116. defer googleapi.CloseBody(res)
  7117. if err := googleapi.CheckResponse(res); err != nil {
  7118. return err
  7119. }
  7120. return nil
  7121. // {
  7122. // "description": "Registers a push token for the current user and application.",
  7123. // "httpMethod": "PUT",
  7124. // "id": "games.pushtokens.update",
  7125. // "path": "pushtokens",
  7126. // "request": {
  7127. // "$ref": "PushToken"
  7128. // },
  7129. // "scopes": [
  7130. // "https://www.googleapis.com/auth/games",
  7131. // "https://www.googleapis.com/auth/plus.login"
  7132. // ]
  7133. // }
  7134. }
  7135. // method id "games.questMilestones.claim":
  7136. type QuestMilestonesClaimCall struct {
  7137. s *Service
  7138. questId string
  7139. milestoneId string
  7140. urlParams_ gensupport.URLParams
  7141. ctx_ context.Context
  7142. header_ http.Header
  7143. }
  7144. // Claim: Report that a reward for the milestone corresponding to
  7145. // milestoneId for the quest corresponding to questId has been claimed
  7146. // by the currently authorized user.
  7147. func (r *QuestMilestonesService) Claim(questId string, milestoneId string, requestId int64) *QuestMilestonesClaimCall {
  7148. c := &QuestMilestonesClaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7149. c.questId = questId
  7150. c.milestoneId = milestoneId
  7151. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  7152. return c
  7153. }
  7154. // Fields allows partial responses to be retrieved. See
  7155. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7156. // for more information.
  7157. func (c *QuestMilestonesClaimCall) Fields(s ...googleapi.Field) *QuestMilestonesClaimCall {
  7158. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7159. return c
  7160. }
  7161. // Context sets the context to be used in this call's Do method. Any
  7162. // pending HTTP request will be aborted if the provided context is
  7163. // canceled.
  7164. func (c *QuestMilestonesClaimCall) Context(ctx context.Context) *QuestMilestonesClaimCall {
  7165. c.ctx_ = ctx
  7166. return c
  7167. }
  7168. // Header returns an http.Header that can be modified by the caller to
  7169. // add HTTP headers to the request.
  7170. func (c *QuestMilestonesClaimCall) Header() http.Header {
  7171. if c.header_ == nil {
  7172. c.header_ = make(http.Header)
  7173. }
  7174. return c.header_
  7175. }
  7176. func (c *QuestMilestonesClaimCall) doRequest(alt string) (*http.Response, error) {
  7177. reqHeaders := make(http.Header)
  7178. for k, v := range c.header_ {
  7179. reqHeaders[k] = v
  7180. }
  7181. reqHeaders.Set("User-Agent", c.s.userAgent())
  7182. var body io.Reader = nil
  7183. c.urlParams_.Set("alt", alt)
  7184. urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/milestones/{milestoneId}/claim")
  7185. urls += "?" + c.urlParams_.Encode()
  7186. req, _ := http.NewRequest("PUT", urls, body)
  7187. req.Header = reqHeaders
  7188. googleapi.Expand(req.URL, map[string]string{
  7189. "questId": c.questId,
  7190. "milestoneId": c.milestoneId,
  7191. })
  7192. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7193. }
  7194. // Do executes the "games.questMilestones.claim" call.
  7195. func (c *QuestMilestonesClaimCall) Do(opts ...googleapi.CallOption) error {
  7196. gensupport.SetOptions(c.urlParams_, opts...)
  7197. res, err := c.doRequest("json")
  7198. if err != nil {
  7199. return err
  7200. }
  7201. defer googleapi.CloseBody(res)
  7202. if err := googleapi.CheckResponse(res); err != nil {
  7203. return err
  7204. }
  7205. return nil
  7206. // {
  7207. // "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.",
  7208. // "httpMethod": "PUT",
  7209. // "id": "games.questMilestones.claim",
  7210. // "parameterOrder": [
  7211. // "questId",
  7212. // "milestoneId",
  7213. // "requestId"
  7214. // ],
  7215. // "parameters": {
  7216. // "milestoneId": {
  7217. // "description": "The ID of the milestone.",
  7218. // "location": "path",
  7219. // "required": true,
  7220. // "type": "string"
  7221. // },
  7222. // "questId": {
  7223. // "description": "The ID of the quest.",
  7224. // "location": "path",
  7225. // "required": true,
  7226. // "type": "string"
  7227. // },
  7228. // "requestId": {
  7229. // "description": "A numeric ID to ensure that the request is handled correctly across retries. Your client application must generate this ID randomly.",
  7230. // "format": "int64",
  7231. // "location": "query",
  7232. // "required": true,
  7233. // "type": "string"
  7234. // }
  7235. // },
  7236. // "path": "quests/{questId}/milestones/{milestoneId}/claim",
  7237. // "scopes": [
  7238. // "https://www.googleapis.com/auth/games",
  7239. // "https://www.googleapis.com/auth/plus.login"
  7240. // ]
  7241. // }
  7242. }
  7243. // method id "games.quests.accept":
  7244. type QuestsAcceptCall struct {
  7245. s *Service
  7246. questId string
  7247. urlParams_ gensupport.URLParams
  7248. ctx_ context.Context
  7249. header_ http.Header
  7250. }
  7251. // Accept: Indicates that the currently authorized user will participate
  7252. // in the quest.
  7253. func (r *QuestsService) Accept(questId string) *QuestsAcceptCall {
  7254. c := &QuestsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7255. c.questId = questId
  7256. return c
  7257. }
  7258. // Language sets the optional parameter "language": The preferred
  7259. // language to use for strings returned by this method.
  7260. func (c *QuestsAcceptCall) Language(language string) *QuestsAcceptCall {
  7261. c.urlParams_.Set("language", language)
  7262. return c
  7263. }
  7264. // Fields allows partial responses to be retrieved. See
  7265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7266. // for more information.
  7267. func (c *QuestsAcceptCall) Fields(s ...googleapi.Field) *QuestsAcceptCall {
  7268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7269. return c
  7270. }
  7271. // Context sets the context to be used in this call's Do method. Any
  7272. // pending HTTP request will be aborted if the provided context is
  7273. // canceled.
  7274. func (c *QuestsAcceptCall) Context(ctx context.Context) *QuestsAcceptCall {
  7275. c.ctx_ = ctx
  7276. return c
  7277. }
  7278. // Header returns an http.Header that can be modified by the caller to
  7279. // add HTTP headers to the request.
  7280. func (c *QuestsAcceptCall) Header() http.Header {
  7281. if c.header_ == nil {
  7282. c.header_ = make(http.Header)
  7283. }
  7284. return c.header_
  7285. }
  7286. func (c *QuestsAcceptCall) doRequest(alt string) (*http.Response, error) {
  7287. reqHeaders := make(http.Header)
  7288. for k, v := range c.header_ {
  7289. reqHeaders[k] = v
  7290. }
  7291. reqHeaders.Set("User-Agent", c.s.userAgent())
  7292. var body io.Reader = nil
  7293. c.urlParams_.Set("alt", alt)
  7294. urls := googleapi.ResolveRelative(c.s.BasePath, "quests/{questId}/accept")
  7295. urls += "?" + c.urlParams_.Encode()
  7296. req, _ := http.NewRequest("POST", urls, body)
  7297. req.Header = reqHeaders
  7298. googleapi.Expand(req.URL, map[string]string{
  7299. "questId": c.questId,
  7300. })
  7301. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7302. }
  7303. // Do executes the "games.quests.accept" call.
  7304. // Exactly one of *Quest or error will be non-nil. Any non-2xx status
  7305. // code is an error. Response headers are in either
  7306. // *Quest.ServerResponse.Header or (if a response was returned at all)
  7307. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7308. // check whether the returned error was because http.StatusNotModified
  7309. // was returned.
  7310. func (c *QuestsAcceptCall) Do(opts ...googleapi.CallOption) (*Quest, error) {
  7311. gensupport.SetOptions(c.urlParams_, opts...)
  7312. res, err := c.doRequest("json")
  7313. if res != nil && res.StatusCode == http.StatusNotModified {
  7314. if res.Body != nil {
  7315. res.Body.Close()
  7316. }
  7317. return nil, &googleapi.Error{
  7318. Code: res.StatusCode,
  7319. Header: res.Header,
  7320. }
  7321. }
  7322. if err != nil {
  7323. return nil, err
  7324. }
  7325. defer googleapi.CloseBody(res)
  7326. if err := googleapi.CheckResponse(res); err != nil {
  7327. return nil, err
  7328. }
  7329. ret := &Quest{
  7330. ServerResponse: googleapi.ServerResponse{
  7331. Header: res.Header,
  7332. HTTPStatusCode: res.StatusCode,
  7333. },
  7334. }
  7335. target := &ret
  7336. if err := gensupport.DecodeResponse(target, res); err != nil {
  7337. return nil, err
  7338. }
  7339. return ret, nil
  7340. // {
  7341. // "description": "Indicates that the currently authorized user will participate in the quest.",
  7342. // "httpMethod": "POST",
  7343. // "id": "games.quests.accept",
  7344. // "parameterOrder": [
  7345. // "questId"
  7346. // ],
  7347. // "parameters": {
  7348. // "language": {
  7349. // "description": "The preferred language to use for strings returned by this method.",
  7350. // "location": "query",
  7351. // "type": "string"
  7352. // },
  7353. // "questId": {
  7354. // "description": "The ID of the quest.",
  7355. // "location": "path",
  7356. // "required": true,
  7357. // "type": "string"
  7358. // }
  7359. // },
  7360. // "path": "quests/{questId}/accept",
  7361. // "response": {
  7362. // "$ref": "Quest"
  7363. // },
  7364. // "scopes": [
  7365. // "https://www.googleapis.com/auth/games",
  7366. // "https://www.googleapis.com/auth/plus.login"
  7367. // ]
  7368. // }
  7369. }
  7370. // method id "games.quests.list":
  7371. type QuestsListCall struct {
  7372. s *Service
  7373. playerId string
  7374. urlParams_ gensupport.URLParams
  7375. ifNoneMatch_ string
  7376. ctx_ context.Context
  7377. header_ http.Header
  7378. }
  7379. // List: Get a list of quests for your application and the currently
  7380. // authenticated player.
  7381. func (r *QuestsService) List(playerId string) *QuestsListCall {
  7382. c := &QuestsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7383. c.playerId = playerId
  7384. return c
  7385. }
  7386. // Language sets the optional parameter "language": The preferred
  7387. // language to use for strings returned by this method.
  7388. func (c *QuestsListCall) Language(language string) *QuestsListCall {
  7389. c.urlParams_.Set("language", language)
  7390. return c
  7391. }
  7392. // MaxResults sets the optional parameter "maxResults": The maximum
  7393. // number of quest resources to return in the response, used for paging.
  7394. // For any response, the actual number of quest resources returned may
  7395. // be less than the specified maxResults. Acceptable values are 1 to 50,
  7396. // inclusive. (Default: 50).
  7397. func (c *QuestsListCall) MaxResults(maxResults int64) *QuestsListCall {
  7398. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7399. return c
  7400. }
  7401. // PageToken sets the optional parameter "pageToken": The token returned
  7402. // by the previous request.
  7403. func (c *QuestsListCall) PageToken(pageToken string) *QuestsListCall {
  7404. c.urlParams_.Set("pageToken", pageToken)
  7405. return c
  7406. }
  7407. // Fields allows partial responses to be retrieved. See
  7408. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7409. // for more information.
  7410. func (c *QuestsListCall) Fields(s ...googleapi.Field) *QuestsListCall {
  7411. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7412. return c
  7413. }
  7414. // IfNoneMatch sets the optional parameter which makes the operation
  7415. // fail if the object's ETag matches the given value. This is useful for
  7416. // getting updates only after the object has changed since the last
  7417. // request. Use googleapi.IsNotModified to check whether the response
  7418. // error from Do is the result of In-None-Match.
  7419. func (c *QuestsListCall) IfNoneMatch(entityTag string) *QuestsListCall {
  7420. c.ifNoneMatch_ = entityTag
  7421. return c
  7422. }
  7423. // Context sets the context to be used in this call's Do method. Any
  7424. // pending HTTP request will be aborted if the provided context is
  7425. // canceled.
  7426. func (c *QuestsListCall) Context(ctx context.Context) *QuestsListCall {
  7427. c.ctx_ = ctx
  7428. return c
  7429. }
  7430. // Header returns an http.Header that can be modified by the caller to
  7431. // add HTTP headers to the request.
  7432. func (c *QuestsListCall) Header() http.Header {
  7433. if c.header_ == nil {
  7434. c.header_ = make(http.Header)
  7435. }
  7436. return c.header_
  7437. }
  7438. func (c *QuestsListCall) doRequest(alt string) (*http.Response, error) {
  7439. reqHeaders := make(http.Header)
  7440. for k, v := range c.header_ {
  7441. reqHeaders[k] = v
  7442. }
  7443. reqHeaders.Set("User-Agent", c.s.userAgent())
  7444. if c.ifNoneMatch_ != "" {
  7445. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7446. }
  7447. var body io.Reader = nil
  7448. c.urlParams_.Set("alt", alt)
  7449. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/quests")
  7450. urls += "?" + c.urlParams_.Encode()
  7451. req, _ := http.NewRequest("GET", urls, body)
  7452. req.Header = reqHeaders
  7453. googleapi.Expand(req.URL, map[string]string{
  7454. "playerId": c.playerId,
  7455. })
  7456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7457. }
  7458. // Do executes the "games.quests.list" call.
  7459. // Exactly one of *QuestListResponse or error will be non-nil. Any
  7460. // non-2xx status code is an error. Response headers are in either
  7461. // *QuestListResponse.ServerResponse.Header or (if a response was
  7462. // returned at all) in error.(*googleapi.Error).Header. Use
  7463. // googleapi.IsNotModified to check whether the returned error was
  7464. // because http.StatusNotModified was returned.
  7465. func (c *QuestsListCall) Do(opts ...googleapi.CallOption) (*QuestListResponse, error) {
  7466. gensupport.SetOptions(c.urlParams_, opts...)
  7467. res, err := c.doRequest("json")
  7468. if res != nil && res.StatusCode == http.StatusNotModified {
  7469. if res.Body != nil {
  7470. res.Body.Close()
  7471. }
  7472. return nil, &googleapi.Error{
  7473. Code: res.StatusCode,
  7474. Header: res.Header,
  7475. }
  7476. }
  7477. if err != nil {
  7478. return nil, err
  7479. }
  7480. defer googleapi.CloseBody(res)
  7481. if err := googleapi.CheckResponse(res); err != nil {
  7482. return nil, err
  7483. }
  7484. ret := &QuestListResponse{
  7485. ServerResponse: googleapi.ServerResponse{
  7486. Header: res.Header,
  7487. HTTPStatusCode: res.StatusCode,
  7488. },
  7489. }
  7490. target := &ret
  7491. if err := gensupport.DecodeResponse(target, res); err != nil {
  7492. return nil, err
  7493. }
  7494. return ret, nil
  7495. // {
  7496. // "description": "Get a list of quests for your application and the currently authenticated player.",
  7497. // "httpMethod": "GET",
  7498. // "id": "games.quests.list",
  7499. // "parameterOrder": [
  7500. // "playerId"
  7501. // ],
  7502. // "parameters": {
  7503. // "language": {
  7504. // "description": "The preferred language to use for strings returned by this method.",
  7505. // "location": "query",
  7506. // "type": "string"
  7507. // },
  7508. // "maxResults": {
  7509. // "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).",
  7510. // "format": "int32",
  7511. // "location": "query",
  7512. // "maximum": "50",
  7513. // "minimum": "1",
  7514. // "type": "integer"
  7515. // },
  7516. // "pageToken": {
  7517. // "description": "The token returned by the previous request.",
  7518. // "location": "query",
  7519. // "type": "string"
  7520. // },
  7521. // "playerId": {
  7522. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  7523. // "location": "path",
  7524. // "required": true,
  7525. // "type": "string"
  7526. // }
  7527. // },
  7528. // "path": "players/{playerId}/quests",
  7529. // "response": {
  7530. // "$ref": "QuestListResponse"
  7531. // },
  7532. // "scopes": [
  7533. // "https://www.googleapis.com/auth/games",
  7534. // "https://www.googleapis.com/auth/plus.login"
  7535. // ]
  7536. // }
  7537. }
  7538. // Pages invokes f for each page of results.
  7539. // A non-nil error returned from f will halt the iteration.
  7540. // The provided context supersedes any context provided to the Context method.
  7541. func (c *QuestsListCall) Pages(ctx context.Context, f func(*QuestListResponse) error) error {
  7542. c.ctx_ = ctx
  7543. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7544. for {
  7545. x, err := c.Do()
  7546. if err != nil {
  7547. return err
  7548. }
  7549. if err := f(x); err != nil {
  7550. return err
  7551. }
  7552. if x.NextPageToken == "" {
  7553. return nil
  7554. }
  7555. c.PageToken(x.NextPageToken)
  7556. }
  7557. }
  7558. // method id "games.revisions.check":
  7559. type RevisionsCheckCall struct {
  7560. s *Service
  7561. urlParams_ gensupport.URLParams
  7562. ifNoneMatch_ string
  7563. ctx_ context.Context
  7564. header_ http.Header
  7565. }
  7566. // Check: Checks whether the games client is out of date.
  7567. func (r *RevisionsService) Check(clientRevision string) *RevisionsCheckCall {
  7568. c := &RevisionsCheckCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7569. c.urlParams_.Set("clientRevision", clientRevision)
  7570. return c
  7571. }
  7572. // Fields allows partial responses to be retrieved. See
  7573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7574. // for more information.
  7575. func (c *RevisionsCheckCall) Fields(s ...googleapi.Field) *RevisionsCheckCall {
  7576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7577. return c
  7578. }
  7579. // IfNoneMatch sets the optional parameter which makes the operation
  7580. // fail if the object's ETag matches the given value. This is useful for
  7581. // getting updates only after the object has changed since the last
  7582. // request. Use googleapi.IsNotModified to check whether the response
  7583. // error from Do is the result of In-None-Match.
  7584. func (c *RevisionsCheckCall) IfNoneMatch(entityTag string) *RevisionsCheckCall {
  7585. c.ifNoneMatch_ = entityTag
  7586. return c
  7587. }
  7588. // Context sets the context to be used in this call's Do method. Any
  7589. // pending HTTP request will be aborted if the provided context is
  7590. // canceled.
  7591. func (c *RevisionsCheckCall) Context(ctx context.Context) *RevisionsCheckCall {
  7592. c.ctx_ = ctx
  7593. return c
  7594. }
  7595. // Header returns an http.Header that can be modified by the caller to
  7596. // add HTTP headers to the request.
  7597. func (c *RevisionsCheckCall) Header() http.Header {
  7598. if c.header_ == nil {
  7599. c.header_ = make(http.Header)
  7600. }
  7601. return c.header_
  7602. }
  7603. func (c *RevisionsCheckCall) doRequest(alt string) (*http.Response, error) {
  7604. reqHeaders := make(http.Header)
  7605. for k, v := range c.header_ {
  7606. reqHeaders[k] = v
  7607. }
  7608. reqHeaders.Set("User-Agent", c.s.userAgent())
  7609. if c.ifNoneMatch_ != "" {
  7610. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7611. }
  7612. var body io.Reader = nil
  7613. c.urlParams_.Set("alt", alt)
  7614. urls := googleapi.ResolveRelative(c.s.BasePath, "revisions/check")
  7615. urls += "?" + c.urlParams_.Encode()
  7616. req, _ := http.NewRequest("GET", urls, body)
  7617. req.Header = reqHeaders
  7618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7619. }
  7620. // Do executes the "games.revisions.check" call.
  7621. // Exactly one of *RevisionCheckResponse or error will be non-nil. Any
  7622. // non-2xx status code is an error. Response headers are in either
  7623. // *RevisionCheckResponse.ServerResponse.Header or (if a response was
  7624. // returned at all) in error.(*googleapi.Error).Header. Use
  7625. // googleapi.IsNotModified to check whether the returned error was
  7626. // because http.StatusNotModified was returned.
  7627. func (c *RevisionsCheckCall) Do(opts ...googleapi.CallOption) (*RevisionCheckResponse, error) {
  7628. gensupport.SetOptions(c.urlParams_, opts...)
  7629. res, err := c.doRequest("json")
  7630. if res != nil && res.StatusCode == http.StatusNotModified {
  7631. if res.Body != nil {
  7632. res.Body.Close()
  7633. }
  7634. return nil, &googleapi.Error{
  7635. Code: res.StatusCode,
  7636. Header: res.Header,
  7637. }
  7638. }
  7639. if err != nil {
  7640. return nil, err
  7641. }
  7642. defer googleapi.CloseBody(res)
  7643. if err := googleapi.CheckResponse(res); err != nil {
  7644. return nil, err
  7645. }
  7646. ret := &RevisionCheckResponse{
  7647. ServerResponse: googleapi.ServerResponse{
  7648. Header: res.Header,
  7649. HTTPStatusCode: res.StatusCode,
  7650. },
  7651. }
  7652. target := &ret
  7653. if err := gensupport.DecodeResponse(target, res); err != nil {
  7654. return nil, err
  7655. }
  7656. return ret, nil
  7657. // {
  7658. // "description": "Checks whether the games client is out of date.",
  7659. // "httpMethod": "GET",
  7660. // "id": "games.revisions.check",
  7661. // "parameterOrder": [
  7662. // "clientRevision"
  7663. // ],
  7664. // "parameters": {
  7665. // "clientRevision": {
  7666. // "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.",
  7667. // "location": "query",
  7668. // "required": true,
  7669. // "type": "string"
  7670. // }
  7671. // },
  7672. // "path": "revisions/check",
  7673. // "response": {
  7674. // "$ref": "RevisionCheckResponse"
  7675. // },
  7676. // "scopes": [
  7677. // "https://www.googleapis.com/auth/games",
  7678. // "https://www.googleapis.com/auth/plus.login"
  7679. // ]
  7680. // }
  7681. }
  7682. // method id "games.rooms.create":
  7683. type RoomsCreateCall struct {
  7684. s *Service
  7685. roomcreaterequest *RoomCreateRequest
  7686. urlParams_ gensupport.URLParams
  7687. ctx_ context.Context
  7688. header_ http.Header
  7689. }
  7690. // Create: Create a room. For internal use by the Games SDK only.
  7691. // Calling this method directly is unsupported.
  7692. func (r *RoomsService) Create(roomcreaterequest *RoomCreateRequest) *RoomsCreateCall {
  7693. c := &RoomsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7694. c.roomcreaterequest = roomcreaterequest
  7695. return c
  7696. }
  7697. // Language sets the optional parameter "language": The preferred
  7698. // language to use for strings returned by this method.
  7699. func (c *RoomsCreateCall) Language(language string) *RoomsCreateCall {
  7700. c.urlParams_.Set("language", language)
  7701. return c
  7702. }
  7703. // Fields allows partial responses to be retrieved. See
  7704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7705. // for more information.
  7706. func (c *RoomsCreateCall) Fields(s ...googleapi.Field) *RoomsCreateCall {
  7707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7708. return c
  7709. }
  7710. // Context sets the context to be used in this call's Do method. Any
  7711. // pending HTTP request will be aborted if the provided context is
  7712. // canceled.
  7713. func (c *RoomsCreateCall) Context(ctx context.Context) *RoomsCreateCall {
  7714. c.ctx_ = ctx
  7715. return c
  7716. }
  7717. // Header returns an http.Header that can be modified by the caller to
  7718. // add HTTP headers to the request.
  7719. func (c *RoomsCreateCall) Header() http.Header {
  7720. if c.header_ == nil {
  7721. c.header_ = make(http.Header)
  7722. }
  7723. return c.header_
  7724. }
  7725. func (c *RoomsCreateCall) doRequest(alt string) (*http.Response, error) {
  7726. reqHeaders := make(http.Header)
  7727. for k, v := range c.header_ {
  7728. reqHeaders[k] = v
  7729. }
  7730. reqHeaders.Set("User-Agent", c.s.userAgent())
  7731. var body io.Reader = nil
  7732. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomcreaterequest)
  7733. if err != nil {
  7734. return nil, err
  7735. }
  7736. reqHeaders.Set("Content-Type", "application/json")
  7737. c.urlParams_.Set("alt", alt)
  7738. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/create")
  7739. urls += "?" + c.urlParams_.Encode()
  7740. req, _ := http.NewRequest("POST", urls, body)
  7741. req.Header = reqHeaders
  7742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7743. }
  7744. // Do executes the "games.rooms.create" call.
  7745. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  7746. // code is an error. Response headers are in either
  7747. // *Room.ServerResponse.Header or (if a response was returned at all) in
  7748. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7749. // whether the returned error was because http.StatusNotModified was
  7750. // returned.
  7751. func (c *RoomsCreateCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  7752. gensupport.SetOptions(c.urlParams_, opts...)
  7753. res, err := c.doRequest("json")
  7754. if res != nil && res.StatusCode == http.StatusNotModified {
  7755. if res.Body != nil {
  7756. res.Body.Close()
  7757. }
  7758. return nil, &googleapi.Error{
  7759. Code: res.StatusCode,
  7760. Header: res.Header,
  7761. }
  7762. }
  7763. if err != nil {
  7764. return nil, err
  7765. }
  7766. defer googleapi.CloseBody(res)
  7767. if err := googleapi.CheckResponse(res); err != nil {
  7768. return nil, err
  7769. }
  7770. ret := &Room{
  7771. ServerResponse: googleapi.ServerResponse{
  7772. Header: res.Header,
  7773. HTTPStatusCode: res.StatusCode,
  7774. },
  7775. }
  7776. target := &ret
  7777. if err := gensupport.DecodeResponse(target, res); err != nil {
  7778. return nil, err
  7779. }
  7780. return ret, nil
  7781. // {
  7782. // "description": "Create a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  7783. // "httpMethod": "POST",
  7784. // "id": "games.rooms.create",
  7785. // "parameters": {
  7786. // "language": {
  7787. // "description": "The preferred language to use for strings returned by this method.",
  7788. // "location": "query",
  7789. // "type": "string"
  7790. // }
  7791. // },
  7792. // "path": "rooms/create",
  7793. // "request": {
  7794. // "$ref": "RoomCreateRequest"
  7795. // },
  7796. // "response": {
  7797. // "$ref": "Room"
  7798. // },
  7799. // "scopes": [
  7800. // "https://www.googleapis.com/auth/games",
  7801. // "https://www.googleapis.com/auth/plus.login"
  7802. // ]
  7803. // }
  7804. }
  7805. // method id "games.rooms.decline":
  7806. type RoomsDeclineCall struct {
  7807. s *Service
  7808. roomId string
  7809. urlParams_ gensupport.URLParams
  7810. ctx_ context.Context
  7811. header_ http.Header
  7812. }
  7813. // Decline: Decline an invitation to join a room. For internal use by
  7814. // the Games SDK only. Calling this method directly is unsupported.
  7815. func (r *RoomsService) Decline(roomId string) *RoomsDeclineCall {
  7816. c := &RoomsDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7817. c.roomId = roomId
  7818. return c
  7819. }
  7820. // Language sets the optional parameter "language": The preferred
  7821. // language to use for strings returned by this method.
  7822. func (c *RoomsDeclineCall) Language(language string) *RoomsDeclineCall {
  7823. c.urlParams_.Set("language", language)
  7824. return c
  7825. }
  7826. // Fields allows partial responses to be retrieved. See
  7827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7828. // for more information.
  7829. func (c *RoomsDeclineCall) Fields(s ...googleapi.Field) *RoomsDeclineCall {
  7830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7831. return c
  7832. }
  7833. // Context sets the context to be used in this call's Do method. Any
  7834. // pending HTTP request will be aborted if the provided context is
  7835. // canceled.
  7836. func (c *RoomsDeclineCall) Context(ctx context.Context) *RoomsDeclineCall {
  7837. c.ctx_ = ctx
  7838. return c
  7839. }
  7840. // Header returns an http.Header that can be modified by the caller to
  7841. // add HTTP headers to the request.
  7842. func (c *RoomsDeclineCall) Header() http.Header {
  7843. if c.header_ == nil {
  7844. c.header_ = make(http.Header)
  7845. }
  7846. return c.header_
  7847. }
  7848. func (c *RoomsDeclineCall) doRequest(alt string) (*http.Response, error) {
  7849. reqHeaders := make(http.Header)
  7850. for k, v := range c.header_ {
  7851. reqHeaders[k] = v
  7852. }
  7853. reqHeaders.Set("User-Agent", c.s.userAgent())
  7854. var body io.Reader = nil
  7855. c.urlParams_.Set("alt", alt)
  7856. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/decline")
  7857. urls += "?" + c.urlParams_.Encode()
  7858. req, _ := http.NewRequest("POST", urls, body)
  7859. req.Header = reqHeaders
  7860. googleapi.Expand(req.URL, map[string]string{
  7861. "roomId": c.roomId,
  7862. })
  7863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7864. }
  7865. // Do executes the "games.rooms.decline" call.
  7866. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  7867. // code is an error. Response headers are in either
  7868. // *Room.ServerResponse.Header or (if a response was returned at all) in
  7869. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7870. // whether the returned error was because http.StatusNotModified was
  7871. // returned.
  7872. func (c *RoomsDeclineCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  7873. gensupport.SetOptions(c.urlParams_, opts...)
  7874. res, err := c.doRequest("json")
  7875. if res != nil && res.StatusCode == http.StatusNotModified {
  7876. if res.Body != nil {
  7877. res.Body.Close()
  7878. }
  7879. return nil, &googleapi.Error{
  7880. Code: res.StatusCode,
  7881. Header: res.Header,
  7882. }
  7883. }
  7884. if err != nil {
  7885. return nil, err
  7886. }
  7887. defer googleapi.CloseBody(res)
  7888. if err := googleapi.CheckResponse(res); err != nil {
  7889. return nil, err
  7890. }
  7891. ret := &Room{
  7892. ServerResponse: googleapi.ServerResponse{
  7893. Header: res.Header,
  7894. HTTPStatusCode: res.StatusCode,
  7895. },
  7896. }
  7897. target := &ret
  7898. if err := gensupport.DecodeResponse(target, res); err != nil {
  7899. return nil, err
  7900. }
  7901. return ret, nil
  7902. // {
  7903. // "description": "Decline an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  7904. // "httpMethod": "POST",
  7905. // "id": "games.rooms.decline",
  7906. // "parameterOrder": [
  7907. // "roomId"
  7908. // ],
  7909. // "parameters": {
  7910. // "language": {
  7911. // "description": "The preferred language to use for strings returned by this method.",
  7912. // "location": "query",
  7913. // "type": "string"
  7914. // },
  7915. // "roomId": {
  7916. // "description": "The ID of the room.",
  7917. // "location": "path",
  7918. // "required": true,
  7919. // "type": "string"
  7920. // }
  7921. // },
  7922. // "path": "rooms/{roomId}/decline",
  7923. // "response": {
  7924. // "$ref": "Room"
  7925. // },
  7926. // "scopes": [
  7927. // "https://www.googleapis.com/auth/games",
  7928. // "https://www.googleapis.com/auth/plus.login"
  7929. // ]
  7930. // }
  7931. }
  7932. // method id "games.rooms.dismiss":
  7933. type RoomsDismissCall struct {
  7934. s *Service
  7935. roomId string
  7936. urlParams_ gensupport.URLParams
  7937. ctx_ context.Context
  7938. header_ http.Header
  7939. }
  7940. // Dismiss: Dismiss an invitation to join a room. For internal use by
  7941. // the Games SDK only. Calling this method directly is unsupported.
  7942. func (r *RoomsService) Dismiss(roomId string) *RoomsDismissCall {
  7943. c := &RoomsDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7944. c.roomId = roomId
  7945. return c
  7946. }
  7947. // Fields allows partial responses to be retrieved. See
  7948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7949. // for more information.
  7950. func (c *RoomsDismissCall) Fields(s ...googleapi.Field) *RoomsDismissCall {
  7951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7952. return c
  7953. }
  7954. // Context sets the context to be used in this call's Do method. Any
  7955. // pending HTTP request will be aborted if the provided context is
  7956. // canceled.
  7957. func (c *RoomsDismissCall) Context(ctx context.Context) *RoomsDismissCall {
  7958. c.ctx_ = ctx
  7959. return c
  7960. }
  7961. // Header returns an http.Header that can be modified by the caller to
  7962. // add HTTP headers to the request.
  7963. func (c *RoomsDismissCall) Header() http.Header {
  7964. if c.header_ == nil {
  7965. c.header_ = make(http.Header)
  7966. }
  7967. return c.header_
  7968. }
  7969. func (c *RoomsDismissCall) doRequest(alt string) (*http.Response, error) {
  7970. reqHeaders := make(http.Header)
  7971. for k, v := range c.header_ {
  7972. reqHeaders[k] = v
  7973. }
  7974. reqHeaders.Set("User-Agent", c.s.userAgent())
  7975. var body io.Reader = nil
  7976. c.urlParams_.Set("alt", alt)
  7977. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/dismiss")
  7978. urls += "?" + c.urlParams_.Encode()
  7979. req, _ := http.NewRequest("POST", urls, body)
  7980. req.Header = reqHeaders
  7981. googleapi.Expand(req.URL, map[string]string{
  7982. "roomId": c.roomId,
  7983. })
  7984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7985. }
  7986. // Do executes the "games.rooms.dismiss" call.
  7987. func (c *RoomsDismissCall) Do(opts ...googleapi.CallOption) error {
  7988. gensupport.SetOptions(c.urlParams_, opts...)
  7989. res, err := c.doRequest("json")
  7990. if err != nil {
  7991. return err
  7992. }
  7993. defer googleapi.CloseBody(res)
  7994. if err := googleapi.CheckResponse(res); err != nil {
  7995. return err
  7996. }
  7997. return nil
  7998. // {
  7999. // "description": "Dismiss an invitation to join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8000. // "httpMethod": "POST",
  8001. // "id": "games.rooms.dismiss",
  8002. // "parameterOrder": [
  8003. // "roomId"
  8004. // ],
  8005. // "parameters": {
  8006. // "roomId": {
  8007. // "description": "The ID of the room.",
  8008. // "location": "path",
  8009. // "required": true,
  8010. // "type": "string"
  8011. // }
  8012. // },
  8013. // "path": "rooms/{roomId}/dismiss",
  8014. // "scopes": [
  8015. // "https://www.googleapis.com/auth/games",
  8016. // "https://www.googleapis.com/auth/plus.login"
  8017. // ]
  8018. // }
  8019. }
  8020. // method id "games.rooms.get":
  8021. type RoomsGetCall struct {
  8022. s *Service
  8023. roomId string
  8024. urlParams_ gensupport.URLParams
  8025. ifNoneMatch_ string
  8026. ctx_ context.Context
  8027. header_ http.Header
  8028. }
  8029. // Get: Get the data for a room.
  8030. func (r *RoomsService) Get(roomId string) *RoomsGetCall {
  8031. c := &RoomsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8032. c.roomId = roomId
  8033. return c
  8034. }
  8035. // Language sets the optional parameter "language": The preferred
  8036. // language to use for strings returned by this method.
  8037. func (c *RoomsGetCall) Language(language string) *RoomsGetCall {
  8038. c.urlParams_.Set("language", language)
  8039. return c
  8040. }
  8041. // Fields allows partial responses to be retrieved. See
  8042. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8043. // for more information.
  8044. func (c *RoomsGetCall) Fields(s ...googleapi.Field) *RoomsGetCall {
  8045. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8046. return c
  8047. }
  8048. // IfNoneMatch sets the optional parameter which makes the operation
  8049. // fail if the object's ETag matches the given value. This is useful for
  8050. // getting updates only after the object has changed since the last
  8051. // request. Use googleapi.IsNotModified to check whether the response
  8052. // error from Do is the result of In-None-Match.
  8053. func (c *RoomsGetCall) IfNoneMatch(entityTag string) *RoomsGetCall {
  8054. c.ifNoneMatch_ = entityTag
  8055. return c
  8056. }
  8057. // Context sets the context to be used in this call's Do method. Any
  8058. // pending HTTP request will be aborted if the provided context is
  8059. // canceled.
  8060. func (c *RoomsGetCall) Context(ctx context.Context) *RoomsGetCall {
  8061. c.ctx_ = ctx
  8062. return c
  8063. }
  8064. // Header returns an http.Header that can be modified by the caller to
  8065. // add HTTP headers to the request.
  8066. func (c *RoomsGetCall) Header() http.Header {
  8067. if c.header_ == nil {
  8068. c.header_ = make(http.Header)
  8069. }
  8070. return c.header_
  8071. }
  8072. func (c *RoomsGetCall) doRequest(alt string) (*http.Response, error) {
  8073. reqHeaders := make(http.Header)
  8074. for k, v := range c.header_ {
  8075. reqHeaders[k] = v
  8076. }
  8077. reqHeaders.Set("User-Agent", c.s.userAgent())
  8078. if c.ifNoneMatch_ != "" {
  8079. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8080. }
  8081. var body io.Reader = nil
  8082. c.urlParams_.Set("alt", alt)
  8083. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}")
  8084. urls += "?" + c.urlParams_.Encode()
  8085. req, _ := http.NewRequest("GET", urls, body)
  8086. req.Header = reqHeaders
  8087. googleapi.Expand(req.URL, map[string]string{
  8088. "roomId": c.roomId,
  8089. })
  8090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8091. }
  8092. // Do executes the "games.rooms.get" call.
  8093. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8094. // code is an error. Response headers are in either
  8095. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8096. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8097. // whether the returned error was because http.StatusNotModified was
  8098. // returned.
  8099. func (c *RoomsGetCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8100. gensupport.SetOptions(c.urlParams_, opts...)
  8101. res, err := c.doRequest("json")
  8102. if res != nil && res.StatusCode == http.StatusNotModified {
  8103. if res.Body != nil {
  8104. res.Body.Close()
  8105. }
  8106. return nil, &googleapi.Error{
  8107. Code: res.StatusCode,
  8108. Header: res.Header,
  8109. }
  8110. }
  8111. if err != nil {
  8112. return nil, err
  8113. }
  8114. defer googleapi.CloseBody(res)
  8115. if err := googleapi.CheckResponse(res); err != nil {
  8116. return nil, err
  8117. }
  8118. ret := &Room{
  8119. ServerResponse: googleapi.ServerResponse{
  8120. Header: res.Header,
  8121. HTTPStatusCode: res.StatusCode,
  8122. },
  8123. }
  8124. target := &ret
  8125. if err := gensupport.DecodeResponse(target, res); err != nil {
  8126. return nil, err
  8127. }
  8128. return ret, nil
  8129. // {
  8130. // "description": "Get the data for a room.",
  8131. // "httpMethod": "GET",
  8132. // "id": "games.rooms.get",
  8133. // "parameterOrder": [
  8134. // "roomId"
  8135. // ],
  8136. // "parameters": {
  8137. // "language": {
  8138. // "description": "The preferred language to use for strings returned by this method.",
  8139. // "location": "query",
  8140. // "type": "string"
  8141. // },
  8142. // "roomId": {
  8143. // "description": "The ID of the room.",
  8144. // "location": "path",
  8145. // "required": true,
  8146. // "type": "string"
  8147. // }
  8148. // },
  8149. // "path": "rooms/{roomId}",
  8150. // "response": {
  8151. // "$ref": "Room"
  8152. // },
  8153. // "scopes": [
  8154. // "https://www.googleapis.com/auth/games",
  8155. // "https://www.googleapis.com/auth/plus.login"
  8156. // ]
  8157. // }
  8158. }
  8159. // method id "games.rooms.join":
  8160. type RoomsJoinCall struct {
  8161. s *Service
  8162. roomId string
  8163. roomjoinrequest *RoomJoinRequest
  8164. urlParams_ gensupport.URLParams
  8165. ctx_ context.Context
  8166. header_ http.Header
  8167. }
  8168. // Join: Join a room. For internal use by the Games SDK only. Calling
  8169. // this method directly is unsupported.
  8170. func (r *RoomsService) Join(roomId string, roomjoinrequest *RoomJoinRequest) *RoomsJoinCall {
  8171. c := &RoomsJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8172. c.roomId = roomId
  8173. c.roomjoinrequest = roomjoinrequest
  8174. return c
  8175. }
  8176. // Language sets the optional parameter "language": The preferred
  8177. // language to use for strings returned by this method.
  8178. func (c *RoomsJoinCall) Language(language string) *RoomsJoinCall {
  8179. c.urlParams_.Set("language", language)
  8180. return c
  8181. }
  8182. // Fields allows partial responses to be retrieved. See
  8183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8184. // for more information.
  8185. func (c *RoomsJoinCall) Fields(s ...googleapi.Field) *RoomsJoinCall {
  8186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8187. return c
  8188. }
  8189. // Context sets the context to be used in this call's Do method. Any
  8190. // pending HTTP request will be aborted if the provided context is
  8191. // canceled.
  8192. func (c *RoomsJoinCall) Context(ctx context.Context) *RoomsJoinCall {
  8193. c.ctx_ = ctx
  8194. return c
  8195. }
  8196. // Header returns an http.Header that can be modified by the caller to
  8197. // add HTTP headers to the request.
  8198. func (c *RoomsJoinCall) Header() http.Header {
  8199. if c.header_ == nil {
  8200. c.header_ = make(http.Header)
  8201. }
  8202. return c.header_
  8203. }
  8204. func (c *RoomsJoinCall) doRequest(alt string) (*http.Response, error) {
  8205. reqHeaders := make(http.Header)
  8206. for k, v := range c.header_ {
  8207. reqHeaders[k] = v
  8208. }
  8209. reqHeaders.Set("User-Agent", c.s.userAgent())
  8210. var body io.Reader = nil
  8211. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomjoinrequest)
  8212. if err != nil {
  8213. return nil, err
  8214. }
  8215. reqHeaders.Set("Content-Type", "application/json")
  8216. c.urlParams_.Set("alt", alt)
  8217. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/join")
  8218. urls += "?" + c.urlParams_.Encode()
  8219. req, _ := http.NewRequest("POST", urls, body)
  8220. req.Header = reqHeaders
  8221. googleapi.Expand(req.URL, map[string]string{
  8222. "roomId": c.roomId,
  8223. })
  8224. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8225. }
  8226. // Do executes the "games.rooms.join" call.
  8227. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8228. // code is an error. Response headers are in either
  8229. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8230. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8231. // whether the returned error was because http.StatusNotModified was
  8232. // returned.
  8233. func (c *RoomsJoinCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8234. gensupport.SetOptions(c.urlParams_, opts...)
  8235. res, err := c.doRequest("json")
  8236. if res != nil && res.StatusCode == http.StatusNotModified {
  8237. if res.Body != nil {
  8238. res.Body.Close()
  8239. }
  8240. return nil, &googleapi.Error{
  8241. Code: res.StatusCode,
  8242. Header: res.Header,
  8243. }
  8244. }
  8245. if err != nil {
  8246. return nil, err
  8247. }
  8248. defer googleapi.CloseBody(res)
  8249. if err := googleapi.CheckResponse(res); err != nil {
  8250. return nil, err
  8251. }
  8252. ret := &Room{
  8253. ServerResponse: googleapi.ServerResponse{
  8254. Header: res.Header,
  8255. HTTPStatusCode: res.StatusCode,
  8256. },
  8257. }
  8258. target := &ret
  8259. if err := gensupport.DecodeResponse(target, res); err != nil {
  8260. return nil, err
  8261. }
  8262. return ret, nil
  8263. // {
  8264. // "description": "Join a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8265. // "httpMethod": "POST",
  8266. // "id": "games.rooms.join",
  8267. // "parameterOrder": [
  8268. // "roomId"
  8269. // ],
  8270. // "parameters": {
  8271. // "language": {
  8272. // "description": "The preferred language to use for strings returned by this method.",
  8273. // "location": "query",
  8274. // "type": "string"
  8275. // },
  8276. // "roomId": {
  8277. // "description": "The ID of the room.",
  8278. // "location": "path",
  8279. // "required": true,
  8280. // "type": "string"
  8281. // }
  8282. // },
  8283. // "path": "rooms/{roomId}/join",
  8284. // "request": {
  8285. // "$ref": "RoomJoinRequest"
  8286. // },
  8287. // "response": {
  8288. // "$ref": "Room"
  8289. // },
  8290. // "scopes": [
  8291. // "https://www.googleapis.com/auth/games",
  8292. // "https://www.googleapis.com/auth/plus.login"
  8293. // ]
  8294. // }
  8295. }
  8296. // method id "games.rooms.leave":
  8297. type RoomsLeaveCall struct {
  8298. s *Service
  8299. roomId string
  8300. roomleaverequest *RoomLeaveRequest
  8301. urlParams_ gensupport.URLParams
  8302. ctx_ context.Context
  8303. header_ http.Header
  8304. }
  8305. // Leave: Leave a room. For internal use by the Games SDK only. Calling
  8306. // this method directly is unsupported.
  8307. func (r *RoomsService) Leave(roomId string, roomleaverequest *RoomLeaveRequest) *RoomsLeaveCall {
  8308. c := &RoomsLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8309. c.roomId = roomId
  8310. c.roomleaverequest = roomleaverequest
  8311. return c
  8312. }
  8313. // Language sets the optional parameter "language": The preferred
  8314. // language to use for strings returned by this method.
  8315. func (c *RoomsLeaveCall) Language(language string) *RoomsLeaveCall {
  8316. c.urlParams_.Set("language", language)
  8317. return c
  8318. }
  8319. // Fields allows partial responses to be retrieved. See
  8320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8321. // for more information.
  8322. func (c *RoomsLeaveCall) Fields(s ...googleapi.Field) *RoomsLeaveCall {
  8323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8324. return c
  8325. }
  8326. // Context sets the context to be used in this call's Do method. Any
  8327. // pending HTTP request will be aborted if the provided context is
  8328. // canceled.
  8329. func (c *RoomsLeaveCall) Context(ctx context.Context) *RoomsLeaveCall {
  8330. c.ctx_ = ctx
  8331. return c
  8332. }
  8333. // Header returns an http.Header that can be modified by the caller to
  8334. // add HTTP headers to the request.
  8335. func (c *RoomsLeaveCall) Header() http.Header {
  8336. if c.header_ == nil {
  8337. c.header_ = make(http.Header)
  8338. }
  8339. return c.header_
  8340. }
  8341. func (c *RoomsLeaveCall) doRequest(alt string) (*http.Response, error) {
  8342. reqHeaders := make(http.Header)
  8343. for k, v := range c.header_ {
  8344. reqHeaders[k] = v
  8345. }
  8346. reqHeaders.Set("User-Agent", c.s.userAgent())
  8347. var body io.Reader = nil
  8348. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomleaverequest)
  8349. if err != nil {
  8350. return nil, err
  8351. }
  8352. reqHeaders.Set("Content-Type", "application/json")
  8353. c.urlParams_.Set("alt", alt)
  8354. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/leave")
  8355. urls += "?" + c.urlParams_.Encode()
  8356. req, _ := http.NewRequest("POST", urls, body)
  8357. req.Header = reqHeaders
  8358. googleapi.Expand(req.URL, map[string]string{
  8359. "roomId": c.roomId,
  8360. })
  8361. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8362. }
  8363. // Do executes the "games.rooms.leave" call.
  8364. // Exactly one of *Room or error will be non-nil. Any non-2xx status
  8365. // code is an error. Response headers are in either
  8366. // *Room.ServerResponse.Header or (if a response was returned at all) in
  8367. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8368. // whether the returned error was because http.StatusNotModified was
  8369. // returned.
  8370. func (c *RoomsLeaveCall) Do(opts ...googleapi.CallOption) (*Room, error) {
  8371. gensupport.SetOptions(c.urlParams_, opts...)
  8372. res, err := c.doRequest("json")
  8373. if res != nil && res.StatusCode == http.StatusNotModified {
  8374. if res.Body != nil {
  8375. res.Body.Close()
  8376. }
  8377. return nil, &googleapi.Error{
  8378. Code: res.StatusCode,
  8379. Header: res.Header,
  8380. }
  8381. }
  8382. if err != nil {
  8383. return nil, err
  8384. }
  8385. defer googleapi.CloseBody(res)
  8386. if err := googleapi.CheckResponse(res); err != nil {
  8387. return nil, err
  8388. }
  8389. ret := &Room{
  8390. ServerResponse: googleapi.ServerResponse{
  8391. Header: res.Header,
  8392. HTTPStatusCode: res.StatusCode,
  8393. },
  8394. }
  8395. target := &ret
  8396. if err := gensupport.DecodeResponse(target, res); err != nil {
  8397. return nil, err
  8398. }
  8399. return ret, nil
  8400. // {
  8401. // "description": "Leave a room. For internal use by the Games SDK only. Calling this method directly is unsupported.",
  8402. // "httpMethod": "POST",
  8403. // "id": "games.rooms.leave",
  8404. // "parameterOrder": [
  8405. // "roomId"
  8406. // ],
  8407. // "parameters": {
  8408. // "language": {
  8409. // "description": "The preferred language to use for strings returned by this method.",
  8410. // "location": "query",
  8411. // "type": "string"
  8412. // },
  8413. // "roomId": {
  8414. // "description": "The ID of the room.",
  8415. // "location": "path",
  8416. // "required": true,
  8417. // "type": "string"
  8418. // }
  8419. // },
  8420. // "path": "rooms/{roomId}/leave",
  8421. // "request": {
  8422. // "$ref": "RoomLeaveRequest"
  8423. // },
  8424. // "response": {
  8425. // "$ref": "Room"
  8426. // },
  8427. // "scopes": [
  8428. // "https://www.googleapis.com/auth/games",
  8429. // "https://www.googleapis.com/auth/plus.login"
  8430. // ]
  8431. // }
  8432. }
  8433. // method id "games.rooms.list":
  8434. type RoomsListCall struct {
  8435. s *Service
  8436. urlParams_ gensupport.URLParams
  8437. ifNoneMatch_ string
  8438. ctx_ context.Context
  8439. header_ http.Header
  8440. }
  8441. // List: Returns invitations to join rooms.
  8442. func (r *RoomsService) List() *RoomsListCall {
  8443. c := &RoomsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8444. return c
  8445. }
  8446. // Language sets the optional parameter "language": The preferred
  8447. // language to use for strings returned by this method.
  8448. func (c *RoomsListCall) Language(language string) *RoomsListCall {
  8449. c.urlParams_.Set("language", language)
  8450. return c
  8451. }
  8452. // MaxResults sets the optional parameter "maxResults": The maximum
  8453. // number of rooms to return in the response, used for paging. For any
  8454. // response, the actual number of rooms to return may be less than the
  8455. // specified maxResults.
  8456. func (c *RoomsListCall) MaxResults(maxResults int64) *RoomsListCall {
  8457. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8458. return c
  8459. }
  8460. // PageToken sets the optional parameter "pageToken": The token returned
  8461. // by the previous request.
  8462. func (c *RoomsListCall) PageToken(pageToken string) *RoomsListCall {
  8463. c.urlParams_.Set("pageToken", pageToken)
  8464. return c
  8465. }
  8466. // Fields allows partial responses to be retrieved. See
  8467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8468. // for more information.
  8469. func (c *RoomsListCall) Fields(s ...googleapi.Field) *RoomsListCall {
  8470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8471. return c
  8472. }
  8473. // IfNoneMatch sets the optional parameter which makes the operation
  8474. // fail if the object's ETag matches the given value. This is useful for
  8475. // getting updates only after the object has changed since the last
  8476. // request. Use googleapi.IsNotModified to check whether the response
  8477. // error from Do is the result of In-None-Match.
  8478. func (c *RoomsListCall) IfNoneMatch(entityTag string) *RoomsListCall {
  8479. c.ifNoneMatch_ = entityTag
  8480. return c
  8481. }
  8482. // Context sets the context to be used in this call's Do method. Any
  8483. // pending HTTP request will be aborted if the provided context is
  8484. // canceled.
  8485. func (c *RoomsListCall) Context(ctx context.Context) *RoomsListCall {
  8486. c.ctx_ = ctx
  8487. return c
  8488. }
  8489. // Header returns an http.Header that can be modified by the caller to
  8490. // add HTTP headers to the request.
  8491. func (c *RoomsListCall) Header() http.Header {
  8492. if c.header_ == nil {
  8493. c.header_ = make(http.Header)
  8494. }
  8495. return c.header_
  8496. }
  8497. func (c *RoomsListCall) doRequest(alt string) (*http.Response, error) {
  8498. reqHeaders := make(http.Header)
  8499. for k, v := range c.header_ {
  8500. reqHeaders[k] = v
  8501. }
  8502. reqHeaders.Set("User-Agent", c.s.userAgent())
  8503. if c.ifNoneMatch_ != "" {
  8504. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8505. }
  8506. var body io.Reader = nil
  8507. c.urlParams_.Set("alt", alt)
  8508. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms")
  8509. urls += "?" + c.urlParams_.Encode()
  8510. req, _ := http.NewRequest("GET", urls, body)
  8511. req.Header = reqHeaders
  8512. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8513. }
  8514. // Do executes the "games.rooms.list" call.
  8515. // Exactly one of *RoomList or error will be non-nil. Any non-2xx status
  8516. // code is an error. Response headers are in either
  8517. // *RoomList.ServerResponse.Header or (if a response was returned at
  8518. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8519. // to check whether the returned error was because
  8520. // http.StatusNotModified was returned.
  8521. func (c *RoomsListCall) Do(opts ...googleapi.CallOption) (*RoomList, error) {
  8522. gensupport.SetOptions(c.urlParams_, opts...)
  8523. res, err := c.doRequest("json")
  8524. if res != nil && res.StatusCode == http.StatusNotModified {
  8525. if res.Body != nil {
  8526. res.Body.Close()
  8527. }
  8528. return nil, &googleapi.Error{
  8529. Code: res.StatusCode,
  8530. Header: res.Header,
  8531. }
  8532. }
  8533. if err != nil {
  8534. return nil, err
  8535. }
  8536. defer googleapi.CloseBody(res)
  8537. if err := googleapi.CheckResponse(res); err != nil {
  8538. return nil, err
  8539. }
  8540. ret := &RoomList{
  8541. ServerResponse: googleapi.ServerResponse{
  8542. Header: res.Header,
  8543. HTTPStatusCode: res.StatusCode,
  8544. },
  8545. }
  8546. target := &ret
  8547. if err := gensupport.DecodeResponse(target, res); err != nil {
  8548. return nil, err
  8549. }
  8550. return ret, nil
  8551. // {
  8552. // "description": "Returns invitations to join rooms.",
  8553. // "httpMethod": "GET",
  8554. // "id": "games.rooms.list",
  8555. // "parameters": {
  8556. // "language": {
  8557. // "description": "The preferred language to use for strings returned by this method.",
  8558. // "location": "query",
  8559. // "type": "string"
  8560. // },
  8561. // "maxResults": {
  8562. // "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.",
  8563. // "format": "int32",
  8564. // "location": "query",
  8565. // "maximum": "500",
  8566. // "minimum": "1",
  8567. // "type": "integer"
  8568. // },
  8569. // "pageToken": {
  8570. // "description": "The token returned by the previous request.",
  8571. // "location": "query",
  8572. // "type": "string"
  8573. // }
  8574. // },
  8575. // "path": "rooms",
  8576. // "response": {
  8577. // "$ref": "RoomList"
  8578. // },
  8579. // "scopes": [
  8580. // "https://www.googleapis.com/auth/games",
  8581. // "https://www.googleapis.com/auth/plus.login"
  8582. // ]
  8583. // }
  8584. }
  8585. // Pages invokes f for each page of results.
  8586. // A non-nil error returned from f will halt the iteration.
  8587. // The provided context supersedes any context provided to the Context method.
  8588. func (c *RoomsListCall) Pages(ctx context.Context, f func(*RoomList) error) error {
  8589. c.ctx_ = ctx
  8590. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8591. for {
  8592. x, err := c.Do()
  8593. if err != nil {
  8594. return err
  8595. }
  8596. if err := f(x); err != nil {
  8597. return err
  8598. }
  8599. if x.NextPageToken == "" {
  8600. return nil
  8601. }
  8602. c.PageToken(x.NextPageToken)
  8603. }
  8604. }
  8605. // method id "games.rooms.reportStatus":
  8606. type RoomsReportStatusCall struct {
  8607. s *Service
  8608. roomId string
  8609. roomp2pstatuses *RoomP2PStatuses
  8610. urlParams_ gensupport.URLParams
  8611. ctx_ context.Context
  8612. header_ http.Header
  8613. }
  8614. // ReportStatus: Updates sent by a client reporting the status of peers
  8615. // in a room. For internal use by the Games SDK only. Calling this
  8616. // method directly is unsupported.
  8617. func (r *RoomsService) ReportStatus(roomId string, roomp2pstatuses *RoomP2PStatuses) *RoomsReportStatusCall {
  8618. c := &RoomsReportStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8619. c.roomId = roomId
  8620. c.roomp2pstatuses = roomp2pstatuses
  8621. return c
  8622. }
  8623. // Language sets the optional parameter "language": The preferred
  8624. // language to use for strings returned by this method.
  8625. func (c *RoomsReportStatusCall) Language(language string) *RoomsReportStatusCall {
  8626. c.urlParams_.Set("language", language)
  8627. return c
  8628. }
  8629. // Fields allows partial responses to be retrieved. See
  8630. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8631. // for more information.
  8632. func (c *RoomsReportStatusCall) Fields(s ...googleapi.Field) *RoomsReportStatusCall {
  8633. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8634. return c
  8635. }
  8636. // Context sets the context to be used in this call's Do method. Any
  8637. // pending HTTP request will be aborted if the provided context is
  8638. // canceled.
  8639. func (c *RoomsReportStatusCall) Context(ctx context.Context) *RoomsReportStatusCall {
  8640. c.ctx_ = ctx
  8641. return c
  8642. }
  8643. // Header returns an http.Header that can be modified by the caller to
  8644. // add HTTP headers to the request.
  8645. func (c *RoomsReportStatusCall) Header() http.Header {
  8646. if c.header_ == nil {
  8647. c.header_ = make(http.Header)
  8648. }
  8649. return c.header_
  8650. }
  8651. func (c *RoomsReportStatusCall) doRequest(alt string) (*http.Response, error) {
  8652. reqHeaders := make(http.Header)
  8653. for k, v := range c.header_ {
  8654. reqHeaders[k] = v
  8655. }
  8656. reqHeaders.Set("User-Agent", c.s.userAgent())
  8657. var body io.Reader = nil
  8658. body, err := googleapi.WithoutDataWrapper.JSONReader(c.roomp2pstatuses)
  8659. if err != nil {
  8660. return nil, err
  8661. }
  8662. reqHeaders.Set("Content-Type", "application/json")
  8663. c.urlParams_.Set("alt", alt)
  8664. urls := googleapi.ResolveRelative(c.s.BasePath, "rooms/{roomId}/reportstatus")
  8665. urls += "?" + c.urlParams_.Encode()
  8666. req, _ := http.NewRequest("POST", urls, body)
  8667. req.Header = reqHeaders
  8668. googleapi.Expand(req.URL, map[string]string{
  8669. "roomId": c.roomId,
  8670. })
  8671. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8672. }
  8673. // Do executes the "games.rooms.reportStatus" call.
  8674. // Exactly one of *RoomStatus or error will be non-nil. Any non-2xx
  8675. // status code is an error. Response headers are in either
  8676. // *RoomStatus.ServerResponse.Header or (if a response was returned at
  8677. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8678. // to check whether the returned error was because
  8679. // http.StatusNotModified was returned.
  8680. func (c *RoomsReportStatusCall) Do(opts ...googleapi.CallOption) (*RoomStatus, error) {
  8681. gensupport.SetOptions(c.urlParams_, opts...)
  8682. res, err := c.doRequest("json")
  8683. if res != nil && res.StatusCode == http.StatusNotModified {
  8684. if res.Body != nil {
  8685. res.Body.Close()
  8686. }
  8687. return nil, &googleapi.Error{
  8688. Code: res.StatusCode,
  8689. Header: res.Header,
  8690. }
  8691. }
  8692. if err != nil {
  8693. return nil, err
  8694. }
  8695. defer googleapi.CloseBody(res)
  8696. if err := googleapi.CheckResponse(res); err != nil {
  8697. return nil, err
  8698. }
  8699. ret := &RoomStatus{
  8700. ServerResponse: googleapi.ServerResponse{
  8701. Header: res.Header,
  8702. HTTPStatusCode: res.StatusCode,
  8703. },
  8704. }
  8705. target := &ret
  8706. if err := gensupport.DecodeResponse(target, res); err != nil {
  8707. return nil, err
  8708. }
  8709. return ret, nil
  8710. // {
  8711. // "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.",
  8712. // "httpMethod": "POST",
  8713. // "id": "games.rooms.reportStatus",
  8714. // "parameterOrder": [
  8715. // "roomId"
  8716. // ],
  8717. // "parameters": {
  8718. // "language": {
  8719. // "description": "The preferred language to use for strings returned by this method.",
  8720. // "location": "query",
  8721. // "type": "string"
  8722. // },
  8723. // "roomId": {
  8724. // "description": "The ID of the room.",
  8725. // "location": "path",
  8726. // "required": true,
  8727. // "type": "string"
  8728. // }
  8729. // },
  8730. // "path": "rooms/{roomId}/reportstatus",
  8731. // "request": {
  8732. // "$ref": "RoomP2PStatuses"
  8733. // },
  8734. // "response": {
  8735. // "$ref": "RoomStatus"
  8736. // },
  8737. // "scopes": [
  8738. // "https://www.googleapis.com/auth/games",
  8739. // "https://www.googleapis.com/auth/plus.login"
  8740. // ]
  8741. // }
  8742. }
  8743. // method id "games.scores.get":
  8744. type ScoresGetCall struct {
  8745. s *Service
  8746. playerId string
  8747. leaderboardId string
  8748. timeSpan string
  8749. urlParams_ gensupport.URLParams
  8750. ifNoneMatch_ string
  8751. ctx_ context.Context
  8752. header_ http.Header
  8753. }
  8754. // Get: Get high scores, and optionally ranks, in leaderboards for the
  8755. // currently authenticated player. For a specific time span,
  8756. // leaderboardId can be set to ALL to retrieve data for all leaderboards
  8757. // in a given time span.
  8758. // NOTE: You cannot ask for 'ALL' leaderboards and 'ALL' timeSpans in
  8759. // the same request; only one parameter may be set to 'ALL'.
  8760. func (r *ScoresService) Get(playerId string, leaderboardId string, timeSpan string) *ScoresGetCall {
  8761. c := &ScoresGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8762. c.playerId = playerId
  8763. c.leaderboardId = leaderboardId
  8764. c.timeSpan = timeSpan
  8765. return c
  8766. }
  8767. // IncludeRankType sets the optional parameter "includeRankType": The
  8768. // types of ranks to return. If the parameter is omitted, no ranks will
  8769. // be returned.
  8770. //
  8771. // Possible values:
  8772. // "ALL" - Retrieve public and social ranks.
  8773. // "PUBLIC" - Retrieve public ranks, if the player is sharing their
  8774. // gameplay activity publicly.
  8775. // "SOCIAL" - Retrieve the social rank.
  8776. func (c *ScoresGetCall) IncludeRankType(includeRankType string) *ScoresGetCall {
  8777. c.urlParams_.Set("includeRankType", includeRankType)
  8778. return c
  8779. }
  8780. // Language sets the optional parameter "language": The preferred
  8781. // language to use for strings returned by this method.
  8782. func (c *ScoresGetCall) Language(language string) *ScoresGetCall {
  8783. c.urlParams_.Set("language", language)
  8784. return c
  8785. }
  8786. // MaxResults sets the optional parameter "maxResults": The maximum
  8787. // number of leaderboard scores to return in the response. For any
  8788. // response, the actual number of leaderboard scores returned may be
  8789. // less than the specified maxResults.
  8790. func (c *ScoresGetCall) MaxResults(maxResults int64) *ScoresGetCall {
  8791. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8792. return c
  8793. }
  8794. // PageToken sets the optional parameter "pageToken": The token returned
  8795. // by the previous request.
  8796. func (c *ScoresGetCall) PageToken(pageToken string) *ScoresGetCall {
  8797. c.urlParams_.Set("pageToken", pageToken)
  8798. return c
  8799. }
  8800. // Fields allows partial responses to be retrieved. See
  8801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8802. // for more information.
  8803. func (c *ScoresGetCall) Fields(s ...googleapi.Field) *ScoresGetCall {
  8804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8805. return c
  8806. }
  8807. // IfNoneMatch sets the optional parameter which makes the operation
  8808. // fail if the object's ETag matches the given value. This is useful for
  8809. // getting updates only after the object has changed since the last
  8810. // request. Use googleapi.IsNotModified to check whether the response
  8811. // error from Do is the result of In-None-Match.
  8812. func (c *ScoresGetCall) IfNoneMatch(entityTag string) *ScoresGetCall {
  8813. c.ifNoneMatch_ = entityTag
  8814. return c
  8815. }
  8816. // Context sets the context to be used in this call's Do method. Any
  8817. // pending HTTP request will be aborted if the provided context is
  8818. // canceled.
  8819. func (c *ScoresGetCall) Context(ctx context.Context) *ScoresGetCall {
  8820. c.ctx_ = ctx
  8821. return c
  8822. }
  8823. // Header returns an http.Header that can be modified by the caller to
  8824. // add HTTP headers to the request.
  8825. func (c *ScoresGetCall) Header() http.Header {
  8826. if c.header_ == nil {
  8827. c.header_ = make(http.Header)
  8828. }
  8829. return c.header_
  8830. }
  8831. func (c *ScoresGetCall) doRequest(alt string) (*http.Response, error) {
  8832. reqHeaders := make(http.Header)
  8833. for k, v := range c.header_ {
  8834. reqHeaders[k] = v
  8835. }
  8836. reqHeaders.Set("User-Agent", c.s.userAgent())
  8837. if c.ifNoneMatch_ != "" {
  8838. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8839. }
  8840. var body io.Reader = nil
  8841. c.urlParams_.Set("alt", alt)
  8842. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}")
  8843. urls += "?" + c.urlParams_.Encode()
  8844. req, _ := http.NewRequest("GET", urls, body)
  8845. req.Header = reqHeaders
  8846. googleapi.Expand(req.URL, map[string]string{
  8847. "playerId": c.playerId,
  8848. "leaderboardId": c.leaderboardId,
  8849. "timeSpan": c.timeSpan,
  8850. })
  8851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8852. }
  8853. // Do executes the "games.scores.get" call.
  8854. // Exactly one of *PlayerLeaderboardScoreListResponse or error will be
  8855. // non-nil. Any non-2xx status code is an error. Response headers are in
  8856. // either *PlayerLeaderboardScoreListResponse.ServerResponse.Header or
  8857. // (if a response was returned at all) in
  8858. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8859. // whether the returned error was because http.StatusNotModified was
  8860. // returned.
  8861. func (c *ScoresGetCall) Do(opts ...googleapi.CallOption) (*PlayerLeaderboardScoreListResponse, error) {
  8862. gensupport.SetOptions(c.urlParams_, opts...)
  8863. res, err := c.doRequest("json")
  8864. if res != nil && res.StatusCode == http.StatusNotModified {
  8865. if res.Body != nil {
  8866. res.Body.Close()
  8867. }
  8868. return nil, &googleapi.Error{
  8869. Code: res.StatusCode,
  8870. Header: res.Header,
  8871. }
  8872. }
  8873. if err != nil {
  8874. return nil, err
  8875. }
  8876. defer googleapi.CloseBody(res)
  8877. if err := googleapi.CheckResponse(res); err != nil {
  8878. return nil, err
  8879. }
  8880. ret := &PlayerLeaderboardScoreListResponse{
  8881. ServerResponse: googleapi.ServerResponse{
  8882. Header: res.Header,
  8883. HTTPStatusCode: res.StatusCode,
  8884. },
  8885. }
  8886. target := &ret
  8887. if err := gensupport.DecodeResponse(target, res); err != nil {
  8888. return nil, err
  8889. }
  8890. return ret, nil
  8891. // {
  8892. // "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'.",
  8893. // "httpMethod": "GET",
  8894. // "id": "games.scores.get",
  8895. // "parameterOrder": [
  8896. // "playerId",
  8897. // "leaderboardId",
  8898. // "timeSpan"
  8899. // ],
  8900. // "parameters": {
  8901. // "includeRankType": {
  8902. // "description": "The types of ranks to return. If the parameter is omitted, no ranks will be returned.",
  8903. // "enum": [
  8904. // "ALL",
  8905. // "PUBLIC",
  8906. // "SOCIAL"
  8907. // ],
  8908. // "enumDescriptions": [
  8909. // "Retrieve public and social ranks.",
  8910. // "Retrieve public ranks, if the player is sharing their gameplay activity publicly.",
  8911. // "Retrieve the social rank."
  8912. // ],
  8913. // "location": "query",
  8914. // "type": "string"
  8915. // },
  8916. // "language": {
  8917. // "description": "The preferred language to use for strings returned by this method.",
  8918. // "location": "query",
  8919. // "type": "string"
  8920. // },
  8921. // "leaderboardId": {
  8922. // "description": "The ID of the leaderboard. Can be set to 'ALL' to retrieve data for all leaderboards for this application.",
  8923. // "location": "path",
  8924. // "required": true,
  8925. // "type": "string"
  8926. // },
  8927. // "maxResults": {
  8928. // "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.",
  8929. // "format": "int32",
  8930. // "location": "query",
  8931. // "maximum": "30",
  8932. // "minimum": "1",
  8933. // "type": "integer"
  8934. // },
  8935. // "pageToken": {
  8936. // "description": "The token returned by the previous request.",
  8937. // "location": "query",
  8938. // "type": "string"
  8939. // },
  8940. // "playerId": {
  8941. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  8942. // "location": "path",
  8943. // "required": true,
  8944. // "type": "string"
  8945. // },
  8946. // "timeSpan": {
  8947. // "description": "The time span for the scores and ranks you're requesting.",
  8948. // "enum": [
  8949. // "ALL",
  8950. // "ALL_TIME",
  8951. // "DAILY",
  8952. // "WEEKLY"
  8953. // ],
  8954. // "enumDescriptions": [
  8955. // "Get the high scores for all time spans. If this is used, maxResults values will be ignored.",
  8956. // "Get the all time high score.",
  8957. // "List the top scores for the current day.",
  8958. // "List the top scores for the current week."
  8959. // ],
  8960. // "location": "path",
  8961. // "required": true,
  8962. // "type": "string"
  8963. // }
  8964. // },
  8965. // "path": "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}",
  8966. // "response": {
  8967. // "$ref": "PlayerLeaderboardScoreListResponse"
  8968. // },
  8969. // "scopes": [
  8970. // "https://www.googleapis.com/auth/games",
  8971. // "https://www.googleapis.com/auth/plus.login"
  8972. // ]
  8973. // }
  8974. }
  8975. // Pages invokes f for each page of results.
  8976. // A non-nil error returned from f will halt the iteration.
  8977. // The provided context supersedes any context provided to the Context method.
  8978. func (c *ScoresGetCall) Pages(ctx context.Context, f func(*PlayerLeaderboardScoreListResponse) error) error {
  8979. c.ctx_ = ctx
  8980. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8981. for {
  8982. x, err := c.Do()
  8983. if err != nil {
  8984. return err
  8985. }
  8986. if err := f(x); err != nil {
  8987. return err
  8988. }
  8989. if x.NextPageToken == "" {
  8990. return nil
  8991. }
  8992. c.PageToken(x.NextPageToken)
  8993. }
  8994. }
  8995. // method id "games.scores.list":
  8996. type ScoresListCall struct {
  8997. s *Service
  8998. leaderboardId string
  8999. collection string
  9000. urlParams_ gensupport.URLParams
  9001. ifNoneMatch_ string
  9002. ctx_ context.Context
  9003. header_ http.Header
  9004. }
  9005. // List: Lists the scores in a leaderboard, starting from the top.
  9006. func (r *ScoresService) List(leaderboardId string, collection string, timeSpan string) *ScoresListCall {
  9007. c := &ScoresListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9008. c.leaderboardId = leaderboardId
  9009. c.collection = collection
  9010. c.urlParams_.Set("timeSpan", timeSpan)
  9011. return c
  9012. }
  9013. // Language sets the optional parameter "language": The preferred
  9014. // language to use for strings returned by this method.
  9015. func (c *ScoresListCall) Language(language string) *ScoresListCall {
  9016. c.urlParams_.Set("language", language)
  9017. return c
  9018. }
  9019. // MaxResults sets the optional parameter "maxResults": The maximum
  9020. // number of leaderboard scores to return in the response. For any
  9021. // response, the actual number of leaderboard scores returned may be
  9022. // less than the specified maxResults.
  9023. func (c *ScoresListCall) MaxResults(maxResults int64) *ScoresListCall {
  9024. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9025. return c
  9026. }
  9027. // PageToken sets the optional parameter "pageToken": The token returned
  9028. // by the previous request.
  9029. func (c *ScoresListCall) PageToken(pageToken string) *ScoresListCall {
  9030. c.urlParams_.Set("pageToken", pageToken)
  9031. return c
  9032. }
  9033. // Fields allows partial responses to be retrieved. See
  9034. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9035. // for more information.
  9036. func (c *ScoresListCall) Fields(s ...googleapi.Field) *ScoresListCall {
  9037. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9038. return c
  9039. }
  9040. // IfNoneMatch sets the optional parameter which makes the operation
  9041. // fail if the object's ETag matches the given value. This is useful for
  9042. // getting updates only after the object has changed since the last
  9043. // request. Use googleapi.IsNotModified to check whether the response
  9044. // error from Do is the result of In-None-Match.
  9045. func (c *ScoresListCall) IfNoneMatch(entityTag string) *ScoresListCall {
  9046. c.ifNoneMatch_ = entityTag
  9047. return c
  9048. }
  9049. // Context sets the context to be used in this call's Do method. Any
  9050. // pending HTTP request will be aborted if the provided context is
  9051. // canceled.
  9052. func (c *ScoresListCall) Context(ctx context.Context) *ScoresListCall {
  9053. c.ctx_ = ctx
  9054. return c
  9055. }
  9056. // Header returns an http.Header that can be modified by the caller to
  9057. // add HTTP headers to the request.
  9058. func (c *ScoresListCall) Header() http.Header {
  9059. if c.header_ == nil {
  9060. c.header_ = make(http.Header)
  9061. }
  9062. return c.header_
  9063. }
  9064. func (c *ScoresListCall) doRequest(alt string) (*http.Response, error) {
  9065. reqHeaders := make(http.Header)
  9066. for k, v := range c.header_ {
  9067. reqHeaders[k] = v
  9068. }
  9069. reqHeaders.Set("User-Agent", c.s.userAgent())
  9070. if c.ifNoneMatch_ != "" {
  9071. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9072. }
  9073. var body io.Reader = nil
  9074. c.urlParams_.Set("alt", alt)
  9075. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores/{collection}")
  9076. urls += "?" + c.urlParams_.Encode()
  9077. req, _ := http.NewRequest("GET", urls, body)
  9078. req.Header = reqHeaders
  9079. googleapi.Expand(req.URL, map[string]string{
  9080. "leaderboardId": c.leaderboardId,
  9081. "collection": c.collection,
  9082. })
  9083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9084. }
  9085. // Do executes the "games.scores.list" call.
  9086. // Exactly one of *LeaderboardScores or error will be non-nil. Any
  9087. // non-2xx status code is an error. Response headers are in either
  9088. // *LeaderboardScores.ServerResponse.Header or (if a response was
  9089. // returned at all) in error.(*googleapi.Error).Header. Use
  9090. // googleapi.IsNotModified to check whether the returned error was
  9091. // because http.StatusNotModified was returned.
  9092. func (c *ScoresListCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) {
  9093. gensupport.SetOptions(c.urlParams_, opts...)
  9094. res, err := c.doRequest("json")
  9095. if res != nil && res.StatusCode == http.StatusNotModified {
  9096. if res.Body != nil {
  9097. res.Body.Close()
  9098. }
  9099. return nil, &googleapi.Error{
  9100. Code: res.StatusCode,
  9101. Header: res.Header,
  9102. }
  9103. }
  9104. if err != nil {
  9105. return nil, err
  9106. }
  9107. defer googleapi.CloseBody(res)
  9108. if err := googleapi.CheckResponse(res); err != nil {
  9109. return nil, err
  9110. }
  9111. ret := &LeaderboardScores{
  9112. ServerResponse: googleapi.ServerResponse{
  9113. Header: res.Header,
  9114. HTTPStatusCode: res.StatusCode,
  9115. },
  9116. }
  9117. target := &ret
  9118. if err := gensupport.DecodeResponse(target, res); err != nil {
  9119. return nil, err
  9120. }
  9121. return ret, nil
  9122. // {
  9123. // "description": "Lists the scores in a leaderboard, starting from the top.",
  9124. // "httpMethod": "GET",
  9125. // "id": "games.scores.list",
  9126. // "parameterOrder": [
  9127. // "leaderboardId",
  9128. // "collection",
  9129. // "timeSpan"
  9130. // ],
  9131. // "parameters": {
  9132. // "collection": {
  9133. // "description": "The collection of scores you're requesting.",
  9134. // "enum": [
  9135. // "PUBLIC",
  9136. // "SOCIAL",
  9137. // "SOCIAL_1P"
  9138. // ],
  9139. // "enumDescriptions": [
  9140. // "List all scores in the public leaderboard.",
  9141. // "List only social scores.",
  9142. // "List only social scores, not respecting the fACL."
  9143. // ],
  9144. // "location": "path",
  9145. // "required": true,
  9146. // "type": "string"
  9147. // },
  9148. // "language": {
  9149. // "description": "The preferred language to use for strings returned by this method.",
  9150. // "location": "query",
  9151. // "type": "string"
  9152. // },
  9153. // "leaderboardId": {
  9154. // "description": "The ID of the leaderboard.",
  9155. // "location": "path",
  9156. // "required": true,
  9157. // "type": "string"
  9158. // },
  9159. // "maxResults": {
  9160. // "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.",
  9161. // "format": "int32",
  9162. // "location": "query",
  9163. // "maximum": "30",
  9164. // "minimum": "1",
  9165. // "type": "integer"
  9166. // },
  9167. // "pageToken": {
  9168. // "description": "The token returned by the previous request.",
  9169. // "location": "query",
  9170. // "type": "string"
  9171. // },
  9172. // "timeSpan": {
  9173. // "description": "The time span for the scores and ranks you're requesting.",
  9174. // "enum": [
  9175. // "ALL_TIME",
  9176. // "DAILY",
  9177. // "WEEKLY"
  9178. // ],
  9179. // "enumDescriptions": [
  9180. // "List the all-time top scores.",
  9181. // "List the top scores for the current day.",
  9182. // "List the top scores for the current week."
  9183. // ],
  9184. // "location": "query",
  9185. // "required": true,
  9186. // "type": "string"
  9187. // }
  9188. // },
  9189. // "path": "leaderboards/{leaderboardId}/scores/{collection}",
  9190. // "response": {
  9191. // "$ref": "LeaderboardScores"
  9192. // },
  9193. // "scopes": [
  9194. // "https://www.googleapis.com/auth/games",
  9195. // "https://www.googleapis.com/auth/plus.login"
  9196. // ]
  9197. // }
  9198. }
  9199. // Pages invokes f for each page of results.
  9200. // A non-nil error returned from f will halt the iteration.
  9201. // The provided context supersedes any context provided to the Context method.
  9202. func (c *ScoresListCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error {
  9203. c.ctx_ = ctx
  9204. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9205. for {
  9206. x, err := c.Do()
  9207. if err != nil {
  9208. return err
  9209. }
  9210. if err := f(x); err != nil {
  9211. return err
  9212. }
  9213. if x.NextPageToken == "" {
  9214. return nil
  9215. }
  9216. c.PageToken(x.NextPageToken)
  9217. }
  9218. }
  9219. // method id "games.scores.listWindow":
  9220. type ScoresListWindowCall struct {
  9221. s *Service
  9222. leaderboardId string
  9223. collection string
  9224. urlParams_ gensupport.URLParams
  9225. ifNoneMatch_ string
  9226. ctx_ context.Context
  9227. header_ http.Header
  9228. }
  9229. // ListWindow: Lists the scores in a leaderboard around (and including)
  9230. // a player's score.
  9231. func (r *ScoresService) ListWindow(leaderboardId string, collection string, timeSpan string) *ScoresListWindowCall {
  9232. c := &ScoresListWindowCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9233. c.leaderboardId = leaderboardId
  9234. c.collection = collection
  9235. c.urlParams_.Set("timeSpan", timeSpan)
  9236. return c
  9237. }
  9238. // Language sets the optional parameter "language": The preferred
  9239. // language to use for strings returned by this method.
  9240. func (c *ScoresListWindowCall) Language(language string) *ScoresListWindowCall {
  9241. c.urlParams_.Set("language", language)
  9242. return c
  9243. }
  9244. // MaxResults sets the optional parameter "maxResults": The maximum
  9245. // number of leaderboard scores to return in the response. For any
  9246. // response, the actual number of leaderboard scores returned may be
  9247. // less than the specified maxResults.
  9248. func (c *ScoresListWindowCall) MaxResults(maxResults int64) *ScoresListWindowCall {
  9249. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9250. return c
  9251. }
  9252. // PageToken sets the optional parameter "pageToken": The token returned
  9253. // by the previous request.
  9254. func (c *ScoresListWindowCall) PageToken(pageToken string) *ScoresListWindowCall {
  9255. c.urlParams_.Set("pageToken", pageToken)
  9256. return c
  9257. }
  9258. // ResultsAbove sets the optional parameter "resultsAbove": The
  9259. // preferred number of scores to return above the player's score. More
  9260. // scores may be returned if the player is at the bottom of the
  9261. // leaderboard; fewer may be returned if the player is at the top. Must
  9262. // be less than or equal to maxResults.
  9263. func (c *ScoresListWindowCall) ResultsAbove(resultsAbove int64) *ScoresListWindowCall {
  9264. c.urlParams_.Set("resultsAbove", fmt.Sprint(resultsAbove))
  9265. return c
  9266. }
  9267. // ReturnTopIfAbsent sets the optional parameter "returnTopIfAbsent":
  9268. // True if the top scores should be returned when the player is not in
  9269. // the leaderboard. Defaults to true.
  9270. func (c *ScoresListWindowCall) ReturnTopIfAbsent(returnTopIfAbsent bool) *ScoresListWindowCall {
  9271. c.urlParams_.Set("returnTopIfAbsent", fmt.Sprint(returnTopIfAbsent))
  9272. return c
  9273. }
  9274. // Fields allows partial responses to be retrieved. See
  9275. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9276. // for more information.
  9277. func (c *ScoresListWindowCall) Fields(s ...googleapi.Field) *ScoresListWindowCall {
  9278. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9279. return c
  9280. }
  9281. // IfNoneMatch sets the optional parameter which makes the operation
  9282. // fail if the object's ETag matches the given value. This is useful for
  9283. // getting updates only after the object has changed since the last
  9284. // request. Use googleapi.IsNotModified to check whether the response
  9285. // error from Do is the result of In-None-Match.
  9286. func (c *ScoresListWindowCall) IfNoneMatch(entityTag string) *ScoresListWindowCall {
  9287. c.ifNoneMatch_ = entityTag
  9288. return c
  9289. }
  9290. // Context sets the context to be used in this call's Do method. Any
  9291. // pending HTTP request will be aborted if the provided context is
  9292. // canceled.
  9293. func (c *ScoresListWindowCall) Context(ctx context.Context) *ScoresListWindowCall {
  9294. c.ctx_ = ctx
  9295. return c
  9296. }
  9297. // Header returns an http.Header that can be modified by the caller to
  9298. // add HTTP headers to the request.
  9299. func (c *ScoresListWindowCall) Header() http.Header {
  9300. if c.header_ == nil {
  9301. c.header_ = make(http.Header)
  9302. }
  9303. return c.header_
  9304. }
  9305. func (c *ScoresListWindowCall) doRequest(alt string) (*http.Response, error) {
  9306. reqHeaders := make(http.Header)
  9307. for k, v := range c.header_ {
  9308. reqHeaders[k] = v
  9309. }
  9310. reqHeaders.Set("User-Agent", c.s.userAgent())
  9311. if c.ifNoneMatch_ != "" {
  9312. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9313. }
  9314. var body io.Reader = nil
  9315. c.urlParams_.Set("alt", alt)
  9316. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/window/{collection}")
  9317. urls += "?" + c.urlParams_.Encode()
  9318. req, _ := http.NewRequest("GET", urls, body)
  9319. req.Header = reqHeaders
  9320. googleapi.Expand(req.URL, map[string]string{
  9321. "leaderboardId": c.leaderboardId,
  9322. "collection": c.collection,
  9323. })
  9324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9325. }
  9326. // Do executes the "games.scores.listWindow" call.
  9327. // Exactly one of *LeaderboardScores or error will be non-nil. Any
  9328. // non-2xx status code is an error. Response headers are in either
  9329. // *LeaderboardScores.ServerResponse.Header or (if a response was
  9330. // returned at all) in error.(*googleapi.Error).Header. Use
  9331. // googleapi.IsNotModified to check whether the returned error was
  9332. // because http.StatusNotModified was returned.
  9333. func (c *ScoresListWindowCall) Do(opts ...googleapi.CallOption) (*LeaderboardScores, error) {
  9334. gensupport.SetOptions(c.urlParams_, opts...)
  9335. res, err := c.doRequest("json")
  9336. if res != nil && res.StatusCode == http.StatusNotModified {
  9337. if res.Body != nil {
  9338. res.Body.Close()
  9339. }
  9340. return nil, &googleapi.Error{
  9341. Code: res.StatusCode,
  9342. Header: res.Header,
  9343. }
  9344. }
  9345. if err != nil {
  9346. return nil, err
  9347. }
  9348. defer googleapi.CloseBody(res)
  9349. if err := googleapi.CheckResponse(res); err != nil {
  9350. return nil, err
  9351. }
  9352. ret := &LeaderboardScores{
  9353. ServerResponse: googleapi.ServerResponse{
  9354. Header: res.Header,
  9355. HTTPStatusCode: res.StatusCode,
  9356. },
  9357. }
  9358. target := &ret
  9359. if err := gensupport.DecodeResponse(target, res); err != nil {
  9360. return nil, err
  9361. }
  9362. return ret, nil
  9363. // {
  9364. // "description": "Lists the scores in a leaderboard around (and including) a player's score.",
  9365. // "httpMethod": "GET",
  9366. // "id": "games.scores.listWindow",
  9367. // "parameterOrder": [
  9368. // "leaderboardId",
  9369. // "collection",
  9370. // "timeSpan"
  9371. // ],
  9372. // "parameters": {
  9373. // "collection": {
  9374. // "description": "The collection of scores you're requesting.",
  9375. // "enum": [
  9376. // "PUBLIC",
  9377. // "SOCIAL",
  9378. // "SOCIAL_1P"
  9379. // ],
  9380. // "enumDescriptions": [
  9381. // "List all scores in the public leaderboard.",
  9382. // "List only social scores.",
  9383. // "List only social scores, not respecting the fACL."
  9384. // ],
  9385. // "location": "path",
  9386. // "required": true,
  9387. // "type": "string"
  9388. // },
  9389. // "language": {
  9390. // "description": "The preferred language to use for strings returned by this method.",
  9391. // "location": "query",
  9392. // "type": "string"
  9393. // },
  9394. // "leaderboardId": {
  9395. // "description": "The ID of the leaderboard.",
  9396. // "location": "path",
  9397. // "required": true,
  9398. // "type": "string"
  9399. // },
  9400. // "maxResults": {
  9401. // "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.",
  9402. // "format": "int32",
  9403. // "location": "query",
  9404. // "maximum": "30",
  9405. // "minimum": "1",
  9406. // "type": "integer"
  9407. // },
  9408. // "pageToken": {
  9409. // "description": "The token returned by the previous request.",
  9410. // "location": "query",
  9411. // "type": "string"
  9412. // },
  9413. // "resultsAbove": {
  9414. // "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.",
  9415. // "format": "int32",
  9416. // "location": "query",
  9417. // "type": "integer"
  9418. // },
  9419. // "returnTopIfAbsent": {
  9420. // "description": "True if the top scores should be returned when the player is not in the leaderboard. Defaults to true.",
  9421. // "location": "query",
  9422. // "type": "boolean"
  9423. // },
  9424. // "timeSpan": {
  9425. // "description": "The time span for the scores and ranks you're requesting.",
  9426. // "enum": [
  9427. // "ALL_TIME",
  9428. // "DAILY",
  9429. // "WEEKLY"
  9430. // ],
  9431. // "enumDescriptions": [
  9432. // "List the all-time top scores.",
  9433. // "List the top scores for the current day.",
  9434. // "List the top scores for the current week."
  9435. // ],
  9436. // "location": "query",
  9437. // "required": true,
  9438. // "type": "string"
  9439. // }
  9440. // },
  9441. // "path": "leaderboards/{leaderboardId}/window/{collection}",
  9442. // "response": {
  9443. // "$ref": "LeaderboardScores"
  9444. // },
  9445. // "scopes": [
  9446. // "https://www.googleapis.com/auth/games",
  9447. // "https://www.googleapis.com/auth/plus.login"
  9448. // ]
  9449. // }
  9450. }
  9451. // Pages invokes f for each page of results.
  9452. // A non-nil error returned from f will halt the iteration.
  9453. // The provided context supersedes any context provided to the Context method.
  9454. func (c *ScoresListWindowCall) Pages(ctx context.Context, f func(*LeaderboardScores) error) error {
  9455. c.ctx_ = ctx
  9456. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9457. for {
  9458. x, err := c.Do()
  9459. if err != nil {
  9460. return err
  9461. }
  9462. if err := f(x); err != nil {
  9463. return err
  9464. }
  9465. if x.NextPageToken == "" {
  9466. return nil
  9467. }
  9468. c.PageToken(x.NextPageToken)
  9469. }
  9470. }
  9471. // method id "games.scores.submit":
  9472. type ScoresSubmitCall struct {
  9473. s *Service
  9474. leaderboardId string
  9475. urlParams_ gensupport.URLParams
  9476. ctx_ context.Context
  9477. header_ http.Header
  9478. }
  9479. // Submit: Submits a score to the specified leaderboard.
  9480. func (r *ScoresService) Submit(leaderboardId string, score int64) *ScoresSubmitCall {
  9481. c := &ScoresSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9482. c.leaderboardId = leaderboardId
  9483. c.urlParams_.Set("score", fmt.Sprint(score))
  9484. return c
  9485. }
  9486. // Language sets the optional parameter "language": The preferred
  9487. // language to use for strings returned by this method.
  9488. func (c *ScoresSubmitCall) Language(language string) *ScoresSubmitCall {
  9489. c.urlParams_.Set("language", language)
  9490. return c
  9491. }
  9492. // ScoreTag sets the optional parameter "scoreTag": Additional
  9493. // information about the score you're submitting. Values must contain no
  9494. // more than 64 URI-safe characters as defined by section 2.3 of RFC
  9495. // 3986.
  9496. func (c *ScoresSubmitCall) ScoreTag(scoreTag string) *ScoresSubmitCall {
  9497. c.urlParams_.Set("scoreTag", scoreTag)
  9498. return c
  9499. }
  9500. // Fields allows partial responses to be retrieved. See
  9501. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9502. // for more information.
  9503. func (c *ScoresSubmitCall) Fields(s ...googleapi.Field) *ScoresSubmitCall {
  9504. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9505. return c
  9506. }
  9507. // Context sets the context to be used in this call's Do method. Any
  9508. // pending HTTP request will be aborted if the provided context is
  9509. // canceled.
  9510. func (c *ScoresSubmitCall) Context(ctx context.Context) *ScoresSubmitCall {
  9511. c.ctx_ = ctx
  9512. return c
  9513. }
  9514. // Header returns an http.Header that can be modified by the caller to
  9515. // add HTTP headers to the request.
  9516. func (c *ScoresSubmitCall) Header() http.Header {
  9517. if c.header_ == nil {
  9518. c.header_ = make(http.Header)
  9519. }
  9520. return c.header_
  9521. }
  9522. func (c *ScoresSubmitCall) doRequest(alt string) (*http.Response, error) {
  9523. reqHeaders := make(http.Header)
  9524. for k, v := range c.header_ {
  9525. reqHeaders[k] = v
  9526. }
  9527. reqHeaders.Set("User-Agent", c.s.userAgent())
  9528. var body io.Reader = nil
  9529. c.urlParams_.Set("alt", alt)
  9530. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}/scores")
  9531. urls += "?" + c.urlParams_.Encode()
  9532. req, _ := http.NewRequest("POST", urls, body)
  9533. req.Header = reqHeaders
  9534. googleapi.Expand(req.URL, map[string]string{
  9535. "leaderboardId": c.leaderboardId,
  9536. })
  9537. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9538. }
  9539. // Do executes the "games.scores.submit" call.
  9540. // Exactly one of *PlayerScoreResponse or error will be non-nil. Any
  9541. // non-2xx status code is an error. Response headers are in either
  9542. // *PlayerScoreResponse.ServerResponse.Header or (if a response was
  9543. // returned at all) in error.(*googleapi.Error).Header. Use
  9544. // googleapi.IsNotModified to check whether the returned error was
  9545. // because http.StatusNotModified was returned.
  9546. func (c *ScoresSubmitCall) Do(opts ...googleapi.CallOption) (*PlayerScoreResponse, error) {
  9547. gensupport.SetOptions(c.urlParams_, opts...)
  9548. res, err := c.doRequest("json")
  9549. if res != nil && res.StatusCode == http.StatusNotModified {
  9550. if res.Body != nil {
  9551. res.Body.Close()
  9552. }
  9553. return nil, &googleapi.Error{
  9554. Code: res.StatusCode,
  9555. Header: res.Header,
  9556. }
  9557. }
  9558. if err != nil {
  9559. return nil, err
  9560. }
  9561. defer googleapi.CloseBody(res)
  9562. if err := googleapi.CheckResponse(res); err != nil {
  9563. return nil, err
  9564. }
  9565. ret := &PlayerScoreResponse{
  9566. ServerResponse: googleapi.ServerResponse{
  9567. Header: res.Header,
  9568. HTTPStatusCode: res.StatusCode,
  9569. },
  9570. }
  9571. target := &ret
  9572. if err := gensupport.DecodeResponse(target, res); err != nil {
  9573. return nil, err
  9574. }
  9575. return ret, nil
  9576. // {
  9577. // "description": "Submits a score to the specified leaderboard.",
  9578. // "httpMethod": "POST",
  9579. // "id": "games.scores.submit",
  9580. // "parameterOrder": [
  9581. // "leaderboardId",
  9582. // "score"
  9583. // ],
  9584. // "parameters": {
  9585. // "language": {
  9586. // "description": "The preferred language to use for strings returned by this method.",
  9587. // "location": "query",
  9588. // "type": "string"
  9589. // },
  9590. // "leaderboardId": {
  9591. // "description": "The ID of the leaderboard.",
  9592. // "location": "path",
  9593. // "required": true,
  9594. // "type": "string"
  9595. // },
  9596. // "score": {
  9597. // "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.",
  9598. // "format": "int64",
  9599. // "location": "query",
  9600. // "required": true,
  9601. // "type": "string"
  9602. // },
  9603. // "scoreTag": {
  9604. // "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.",
  9605. // "location": "query",
  9606. // "pattern": "[a-zA-Z0-9-._~]{0,64}",
  9607. // "type": "string"
  9608. // }
  9609. // },
  9610. // "path": "leaderboards/{leaderboardId}/scores",
  9611. // "response": {
  9612. // "$ref": "PlayerScoreResponse"
  9613. // },
  9614. // "scopes": [
  9615. // "https://www.googleapis.com/auth/games",
  9616. // "https://www.googleapis.com/auth/plus.login"
  9617. // ]
  9618. // }
  9619. }
  9620. // method id "games.scores.submitMultiple":
  9621. type ScoresSubmitMultipleCall struct {
  9622. s *Service
  9623. playerscoresubmissionlist *PlayerScoreSubmissionList
  9624. urlParams_ gensupport.URLParams
  9625. ctx_ context.Context
  9626. header_ http.Header
  9627. }
  9628. // SubmitMultiple: Submits multiple scores to leaderboards.
  9629. func (r *ScoresService) SubmitMultiple(playerscoresubmissionlist *PlayerScoreSubmissionList) *ScoresSubmitMultipleCall {
  9630. c := &ScoresSubmitMultipleCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9631. c.playerscoresubmissionlist = playerscoresubmissionlist
  9632. return c
  9633. }
  9634. // Language sets the optional parameter "language": The preferred
  9635. // language to use for strings returned by this method.
  9636. func (c *ScoresSubmitMultipleCall) Language(language string) *ScoresSubmitMultipleCall {
  9637. c.urlParams_.Set("language", language)
  9638. return c
  9639. }
  9640. // Fields allows partial responses to be retrieved. See
  9641. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9642. // for more information.
  9643. func (c *ScoresSubmitMultipleCall) Fields(s ...googleapi.Field) *ScoresSubmitMultipleCall {
  9644. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9645. return c
  9646. }
  9647. // Context sets the context to be used in this call's Do method. Any
  9648. // pending HTTP request will be aborted if the provided context is
  9649. // canceled.
  9650. func (c *ScoresSubmitMultipleCall) Context(ctx context.Context) *ScoresSubmitMultipleCall {
  9651. c.ctx_ = ctx
  9652. return c
  9653. }
  9654. // Header returns an http.Header that can be modified by the caller to
  9655. // add HTTP headers to the request.
  9656. func (c *ScoresSubmitMultipleCall) Header() http.Header {
  9657. if c.header_ == nil {
  9658. c.header_ = make(http.Header)
  9659. }
  9660. return c.header_
  9661. }
  9662. func (c *ScoresSubmitMultipleCall) doRequest(alt string) (*http.Response, error) {
  9663. reqHeaders := make(http.Header)
  9664. for k, v := range c.header_ {
  9665. reqHeaders[k] = v
  9666. }
  9667. reqHeaders.Set("User-Agent", c.s.userAgent())
  9668. var body io.Reader = nil
  9669. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playerscoresubmissionlist)
  9670. if err != nil {
  9671. return nil, err
  9672. }
  9673. reqHeaders.Set("Content-Type", "application/json")
  9674. c.urlParams_.Set("alt", alt)
  9675. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/scores")
  9676. urls += "?" + c.urlParams_.Encode()
  9677. req, _ := http.NewRequest("POST", urls, body)
  9678. req.Header = reqHeaders
  9679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9680. }
  9681. // Do executes the "games.scores.submitMultiple" call.
  9682. // Exactly one of *PlayerScoreListResponse or error will be non-nil. Any
  9683. // non-2xx status code is an error. Response headers are in either
  9684. // *PlayerScoreListResponse.ServerResponse.Header or (if a response was
  9685. // returned at all) in error.(*googleapi.Error).Header. Use
  9686. // googleapi.IsNotModified to check whether the returned error was
  9687. // because http.StatusNotModified was returned.
  9688. func (c *ScoresSubmitMultipleCall) Do(opts ...googleapi.CallOption) (*PlayerScoreListResponse, error) {
  9689. gensupport.SetOptions(c.urlParams_, opts...)
  9690. res, err := c.doRequest("json")
  9691. if res != nil && res.StatusCode == http.StatusNotModified {
  9692. if res.Body != nil {
  9693. res.Body.Close()
  9694. }
  9695. return nil, &googleapi.Error{
  9696. Code: res.StatusCode,
  9697. Header: res.Header,
  9698. }
  9699. }
  9700. if err != nil {
  9701. return nil, err
  9702. }
  9703. defer googleapi.CloseBody(res)
  9704. if err := googleapi.CheckResponse(res); err != nil {
  9705. return nil, err
  9706. }
  9707. ret := &PlayerScoreListResponse{
  9708. ServerResponse: googleapi.ServerResponse{
  9709. Header: res.Header,
  9710. HTTPStatusCode: res.StatusCode,
  9711. },
  9712. }
  9713. target := &ret
  9714. if err := gensupport.DecodeResponse(target, res); err != nil {
  9715. return nil, err
  9716. }
  9717. return ret, nil
  9718. // {
  9719. // "description": "Submits multiple scores to leaderboards.",
  9720. // "httpMethod": "POST",
  9721. // "id": "games.scores.submitMultiple",
  9722. // "parameters": {
  9723. // "language": {
  9724. // "description": "The preferred language to use for strings returned by this method.",
  9725. // "location": "query",
  9726. // "type": "string"
  9727. // }
  9728. // },
  9729. // "path": "leaderboards/scores",
  9730. // "request": {
  9731. // "$ref": "PlayerScoreSubmissionList"
  9732. // },
  9733. // "response": {
  9734. // "$ref": "PlayerScoreListResponse"
  9735. // },
  9736. // "scopes": [
  9737. // "https://www.googleapis.com/auth/games",
  9738. // "https://www.googleapis.com/auth/plus.login"
  9739. // ]
  9740. // }
  9741. }
  9742. // method id "games.snapshots.get":
  9743. type SnapshotsGetCall struct {
  9744. s *Service
  9745. snapshotId string
  9746. urlParams_ gensupport.URLParams
  9747. ifNoneMatch_ string
  9748. ctx_ context.Context
  9749. header_ http.Header
  9750. }
  9751. // Get: Retrieves the metadata for a given snapshot ID.
  9752. func (r *SnapshotsService) Get(snapshotId string) *SnapshotsGetCall {
  9753. c := &SnapshotsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9754. c.snapshotId = snapshotId
  9755. return c
  9756. }
  9757. // Language sets the optional parameter "language": The preferred
  9758. // language to use for strings returned by this method.
  9759. func (c *SnapshotsGetCall) Language(language string) *SnapshotsGetCall {
  9760. c.urlParams_.Set("language", language)
  9761. return c
  9762. }
  9763. // Fields allows partial responses to be retrieved. See
  9764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9765. // for more information.
  9766. func (c *SnapshotsGetCall) Fields(s ...googleapi.Field) *SnapshotsGetCall {
  9767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9768. return c
  9769. }
  9770. // IfNoneMatch sets the optional parameter which makes the operation
  9771. // fail if the object's ETag matches the given value. This is useful for
  9772. // getting updates only after the object has changed since the last
  9773. // request. Use googleapi.IsNotModified to check whether the response
  9774. // error from Do is the result of In-None-Match.
  9775. func (c *SnapshotsGetCall) IfNoneMatch(entityTag string) *SnapshotsGetCall {
  9776. c.ifNoneMatch_ = entityTag
  9777. return c
  9778. }
  9779. // Context sets the context to be used in this call's Do method. Any
  9780. // pending HTTP request will be aborted if the provided context is
  9781. // canceled.
  9782. func (c *SnapshotsGetCall) Context(ctx context.Context) *SnapshotsGetCall {
  9783. c.ctx_ = ctx
  9784. return c
  9785. }
  9786. // Header returns an http.Header that can be modified by the caller to
  9787. // add HTTP headers to the request.
  9788. func (c *SnapshotsGetCall) Header() http.Header {
  9789. if c.header_ == nil {
  9790. c.header_ = make(http.Header)
  9791. }
  9792. return c.header_
  9793. }
  9794. func (c *SnapshotsGetCall) doRequest(alt string) (*http.Response, error) {
  9795. reqHeaders := make(http.Header)
  9796. for k, v := range c.header_ {
  9797. reqHeaders[k] = v
  9798. }
  9799. reqHeaders.Set("User-Agent", c.s.userAgent())
  9800. if c.ifNoneMatch_ != "" {
  9801. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9802. }
  9803. var body io.Reader = nil
  9804. c.urlParams_.Set("alt", alt)
  9805. urls := googleapi.ResolveRelative(c.s.BasePath, "snapshots/{snapshotId}")
  9806. urls += "?" + c.urlParams_.Encode()
  9807. req, _ := http.NewRequest("GET", urls, body)
  9808. req.Header = reqHeaders
  9809. googleapi.Expand(req.URL, map[string]string{
  9810. "snapshotId": c.snapshotId,
  9811. })
  9812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9813. }
  9814. // Do executes the "games.snapshots.get" call.
  9815. // Exactly one of *Snapshot or error will be non-nil. Any non-2xx status
  9816. // code is an error. Response headers are in either
  9817. // *Snapshot.ServerResponse.Header or (if a response was returned at
  9818. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9819. // to check whether the returned error was because
  9820. // http.StatusNotModified was returned.
  9821. func (c *SnapshotsGetCall) Do(opts ...googleapi.CallOption) (*Snapshot, error) {
  9822. gensupport.SetOptions(c.urlParams_, opts...)
  9823. res, err := c.doRequest("json")
  9824. if res != nil && res.StatusCode == http.StatusNotModified {
  9825. if res.Body != nil {
  9826. res.Body.Close()
  9827. }
  9828. return nil, &googleapi.Error{
  9829. Code: res.StatusCode,
  9830. Header: res.Header,
  9831. }
  9832. }
  9833. if err != nil {
  9834. return nil, err
  9835. }
  9836. defer googleapi.CloseBody(res)
  9837. if err := googleapi.CheckResponse(res); err != nil {
  9838. return nil, err
  9839. }
  9840. ret := &Snapshot{
  9841. ServerResponse: googleapi.ServerResponse{
  9842. Header: res.Header,
  9843. HTTPStatusCode: res.StatusCode,
  9844. },
  9845. }
  9846. target := &ret
  9847. if err := gensupport.DecodeResponse(target, res); err != nil {
  9848. return nil, err
  9849. }
  9850. return ret, nil
  9851. // {
  9852. // "description": "Retrieves the metadata for a given snapshot ID.",
  9853. // "httpMethod": "GET",
  9854. // "id": "games.snapshots.get",
  9855. // "parameterOrder": [
  9856. // "snapshotId"
  9857. // ],
  9858. // "parameters": {
  9859. // "language": {
  9860. // "description": "The preferred language to use for strings returned by this method.",
  9861. // "location": "query",
  9862. // "type": "string"
  9863. // },
  9864. // "snapshotId": {
  9865. // "description": "The ID of the snapshot.",
  9866. // "location": "path",
  9867. // "required": true,
  9868. // "type": "string"
  9869. // }
  9870. // },
  9871. // "path": "snapshots/{snapshotId}",
  9872. // "response": {
  9873. // "$ref": "Snapshot"
  9874. // },
  9875. // "scopes": [
  9876. // "https://www.googleapis.com/auth/drive.appdata",
  9877. // "https://www.googleapis.com/auth/games",
  9878. // "https://www.googleapis.com/auth/plus.login"
  9879. // ]
  9880. // }
  9881. }
  9882. // method id "games.snapshots.list":
  9883. type SnapshotsListCall struct {
  9884. s *Service
  9885. playerId string
  9886. urlParams_ gensupport.URLParams
  9887. ifNoneMatch_ string
  9888. ctx_ context.Context
  9889. header_ http.Header
  9890. }
  9891. // List: Retrieves a list of snapshots created by your application for
  9892. // the player corresponding to the player ID.
  9893. func (r *SnapshotsService) List(playerId string) *SnapshotsListCall {
  9894. c := &SnapshotsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9895. c.playerId = playerId
  9896. return c
  9897. }
  9898. // Language sets the optional parameter "language": The preferred
  9899. // language to use for strings returned by this method.
  9900. func (c *SnapshotsListCall) Language(language string) *SnapshotsListCall {
  9901. c.urlParams_.Set("language", language)
  9902. return c
  9903. }
  9904. // MaxResults sets the optional parameter "maxResults": The maximum
  9905. // number of snapshot resources to return in the response, used for
  9906. // paging. For any response, the actual number of snapshot resources
  9907. // returned may be less than the specified maxResults.
  9908. func (c *SnapshotsListCall) MaxResults(maxResults int64) *SnapshotsListCall {
  9909. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9910. return c
  9911. }
  9912. // PageToken sets the optional parameter "pageToken": The token returned
  9913. // by the previous request.
  9914. func (c *SnapshotsListCall) PageToken(pageToken string) *SnapshotsListCall {
  9915. c.urlParams_.Set("pageToken", pageToken)
  9916. return c
  9917. }
  9918. // Fields allows partial responses to be retrieved. See
  9919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9920. // for more information.
  9921. func (c *SnapshotsListCall) Fields(s ...googleapi.Field) *SnapshotsListCall {
  9922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9923. return c
  9924. }
  9925. // IfNoneMatch sets the optional parameter which makes the operation
  9926. // fail if the object's ETag matches the given value. This is useful for
  9927. // getting updates only after the object has changed since the last
  9928. // request. Use googleapi.IsNotModified to check whether the response
  9929. // error from Do is the result of In-None-Match.
  9930. func (c *SnapshotsListCall) IfNoneMatch(entityTag string) *SnapshotsListCall {
  9931. c.ifNoneMatch_ = entityTag
  9932. return c
  9933. }
  9934. // Context sets the context to be used in this call's Do method. Any
  9935. // pending HTTP request will be aborted if the provided context is
  9936. // canceled.
  9937. func (c *SnapshotsListCall) Context(ctx context.Context) *SnapshotsListCall {
  9938. c.ctx_ = ctx
  9939. return c
  9940. }
  9941. // Header returns an http.Header that can be modified by the caller to
  9942. // add HTTP headers to the request.
  9943. func (c *SnapshotsListCall) Header() http.Header {
  9944. if c.header_ == nil {
  9945. c.header_ = make(http.Header)
  9946. }
  9947. return c.header_
  9948. }
  9949. func (c *SnapshotsListCall) doRequest(alt string) (*http.Response, error) {
  9950. reqHeaders := make(http.Header)
  9951. for k, v := range c.header_ {
  9952. reqHeaders[k] = v
  9953. }
  9954. reqHeaders.Set("User-Agent", c.s.userAgent())
  9955. if c.ifNoneMatch_ != "" {
  9956. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9957. }
  9958. var body io.Reader = nil
  9959. c.urlParams_.Set("alt", alt)
  9960. urls := googleapi.ResolveRelative(c.s.BasePath, "players/{playerId}/snapshots")
  9961. urls += "?" + c.urlParams_.Encode()
  9962. req, _ := http.NewRequest("GET", urls, body)
  9963. req.Header = reqHeaders
  9964. googleapi.Expand(req.URL, map[string]string{
  9965. "playerId": c.playerId,
  9966. })
  9967. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9968. }
  9969. // Do executes the "games.snapshots.list" call.
  9970. // Exactly one of *SnapshotListResponse or error will be non-nil. Any
  9971. // non-2xx status code is an error. Response headers are in either
  9972. // *SnapshotListResponse.ServerResponse.Header or (if a response was
  9973. // returned at all) in error.(*googleapi.Error).Header. Use
  9974. // googleapi.IsNotModified to check whether the returned error was
  9975. // because http.StatusNotModified was returned.
  9976. func (c *SnapshotsListCall) Do(opts ...googleapi.CallOption) (*SnapshotListResponse, error) {
  9977. gensupport.SetOptions(c.urlParams_, opts...)
  9978. res, err := c.doRequest("json")
  9979. if res != nil && res.StatusCode == http.StatusNotModified {
  9980. if res.Body != nil {
  9981. res.Body.Close()
  9982. }
  9983. return nil, &googleapi.Error{
  9984. Code: res.StatusCode,
  9985. Header: res.Header,
  9986. }
  9987. }
  9988. if err != nil {
  9989. return nil, err
  9990. }
  9991. defer googleapi.CloseBody(res)
  9992. if err := googleapi.CheckResponse(res); err != nil {
  9993. return nil, err
  9994. }
  9995. ret := &SnapshotListResponse{
  9996. ServerResponse: googleapi.ServerResponse{
  9997. Header: res.Header,
  9998. HTTPStatusCode: res.StatusCode,
  9999. },
  10000. }
  10001. target := &ret
  10002. if err := gensupport.DecodeResponse(target, res); err != nil {
  10003. return nil, err
  10004. }
  10005. return ret, nil
  10006. // {
  10007. // "description": "Retrieves a list of snapshots created by your application for the player corresponding to the player ID.",
  10008. // "httpMethod": "GET",
  10009. // "id": "games.snapshots.list",
  10010. // "parameterOrder": [
  10011. // "playerId"
  10012. // ],
  10013. // "parameters": {
  10014. // "language": {
  10015. // "description": "The preferred language to use for strings returned by this method.",
  10016. // "location": "query",
  10017. // "type": "string"
  10018. // },
  10019. // "maxResults": {
  10020. // "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.",
  10021. // "format": "int32",
  10022. // "location": "query",
  10023. // "maximum": "25",
  10024. // "minimum": "1",
  10025. // "type": "integer"
  10026. // },
  10027. // "pageToken": {
  10028. // "description": "The token returned by the previous request.",
  10029. // "location": "query",
  10030. // "type": "string"
  10031. // },
  10032. // "playerId": {
  10033. // "description": "A player ID. A value of me may be used in place of the authenticated player's ID.",
  10034. // "location": "path",
  10035. // "required": true,
  10036. // "type": "string"
  10037. // }
  10038. // },
  10039. // "path": "players/{playerId}/snapshots",
  10040. // "response": {
  10041. // "$ref": "SnapshotListResponse"
  10042. // },
  10043. // "scopes": [
  10044. // "https://www.googleapis.com/auth/drive.appdata",
  10045. // "https://www.googleapis.com/auth/games",
  10046. // "https://www.googleapis.com/auth/plus.login"
  10047. // ]
  10048. // }
  10049. }
  10050. // Pages invokes f for each page of results.
  10051. // A non-nil error returned from f will halt the iteration.
  10052. // The provided context supersedes any context provided to the Context method.
  10053. func (c *SnapshotsListCall) Pages(ctx context.Context, f func(*SnapshotListResponse) error) error {
  10054. c.ctx_ = ctx
  10055. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10056. for {
  10057. x, err := c.Do()
  10058. if err != nil {
  10059. return err
  10060. }
  10061. if err := f(x); err != nil {
  10062. return err
  10063. }
  10064. if x.NextPageToken == "" {
  10065. return nil
  10066. }
  10067. c.PageToken(x.NextPageToken)
  10068. }
  10069. }
  10070. // method id "games.turnBasedMatches.cancel":
  10071. type TurnBasedMatchesCancelCall struct {
  10072. s *Service
  10073. matchId string
  10074. urlParams_ gensupport.URLParams
  10075. ctx_ context.Context
  10076. header_ http.Header
  10077. }
  10078. // Cancel: Cancel a turn-based match.
  10079. func (r *TurnBasedMatchesService) Cancel(matchId string) *TurnBasedMatchesCancelCall {
  10080. c := &TurnBasedMatchesCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10081. c.matchId = matchId
  10082. return c
  10083. }
  10084. // Fields allows partial responses to be retrieved. See
  10085. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10086. // for more information.
  10087. func (c *TurnBasedMatchesCancelCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCancelCall {
  10088. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10089. return c
  10090. }
  10091. // Context sets the context to be used in this call's Do method. Any
  10092. // pending HTTP request will be aborted if the provided context is
  10093. // canceled.
  10094. func (c *TurnBasedMatchesCancelCall) Context(ctx context.Context) *TurnBasedMatchesCancelCall {
  10095. c.ctx_ = ctx
  10096. return c
  10097. }
  10098. // Header returns an http.Header that can be modified by the caller to
  10099. // add HTTP headers to the request.
  10100. func (c *TurnBasedMatchesCancelCall) Header() http.Header {
  10101. if c.header_ == nil {
  10102. c.header_ = make(http.Header)
  10103. }
  10104. return c.header_
  10105. }
  10106. func (c *TurnBasedMatchesCancelCall) doRequest(alt string) (*http.Response, error) {
  10107. reqHeaders := make(http.Header)
  10108. for k, v := range c.header_ {
  10109. reqHeaders[k] = v
  10110. }
  10111. reqHeaders.Set("User-Agent", c.s.userAgent())
  10112. var body io.Reader = nil
  10113. c.urlParams_.Set("alt", alt)
  10114. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/cancel")
  10115. urls += "?" + c.urlParams_.Encode()
  10116. req, _ := http.NewRequest("PUT", urls, body)
  10117. req.Header = reqHeaders
  10118. googleapi.Expand(req.URL, map[string]string{
  10119. "matchId": c.matchId,
  10120. })
  10121. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10122. }
  10123. // Do executes the "games.turnBasedMatches.cancel" call.
  10124. func (c *TurnBasedMatchesCancelCall) Do(opts ...googleapi.CallOption) error {
  10125. gensupport.SetOptions(c.urlParams_, opts...)
  10126. res, err := c.doRequest("json")
  10127. if err != nil {
  10128. return err
  10129. }
  10130. defer googleapi.CloseBody(res)
  10131. if err := googleapi.CheckResponse(res); err != nil {
  10132. return err
  10133. }
  10134. return nil
  10135. // {
  10136. // "description": "Cancel a turn-based match.",
  10137. // "httpMethod": "PUT",
  10138. // "id": "games.turnBasedMatches.cancel",
  10139. // "parameterOrder": [
  10140. // "matchId"
  10141. // ],
  10142. // "parameters": {
  10143. // "matchId": {
  10144. // "description": "The ID of the match.",
  10145. // "location": "path",
  10146. // "required": true,
  10147. // "type": "string"
  10148. // }
  10149. // },
  10150. // "path": "turnbasedmatches/{matchId}/cancel",
  10151. // "scopes": [
  10152. // "https://www.googleapis.com/auth/games",
  10153. // "https://www.googleapis.com/auth/plus.login"
  10154. // ]
  10155. // }
  10156. }
  10157. // method id "games.turnBasedMatches.create":
  10158. type TurnBasedMatchesCreateCall struct {
  10159. s *Service
  10160. turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest
  10161. urlParams_ gensupport.URLParams
  10162. ctx_ context.Context
  10163. header_ http.Header
  10164. }
  10165. // Create: Create a turn-based match.
  10166. func (r *TurnBasedMatchesService) Create(turnbasedmatchcreaterequest *TurnBasedMatchCreateRequest) *TurnBasedMatchesCreateCall {
  10167. c := &TurnBasedMatchesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10168. c.turnbasedmatchcreaterequest = turnbasedmatchcreaterequest
  10169. return c
  10170. }
  10171. // Language sets the optional parameter "language": The preferred
  10172. // language to use for strings returned by this method.
  10173. func (c *TurnBasedMatchesCreateCall) Language(language string) *TurnBasedMatchesCreateCall {
  10174. c.urlParams_.Set("language", language)
  10175. return c
  10176. }
  10177. // Fields allows partial responses to be retrieved. See
  10178. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10179. // for more information.
  10180. func (c *TurnBasedMatchesCreateCall) Fields(s ...googleapi.Field) *TurnBasedMatchesCreateCall {
  10181. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10182. return c
  10183. }
  10184. // Context sets the context to be used in this call's Do method. Any
  10185. // pending HTTP request will be aborted if the provided context is
  10186. // canceled.
  10187. func (c *TurnBasedMatchesCreateCall) Context(ctx context.Context) *TurnBasedMatchesCreateCall {
  10188. c.ctx_ = ctx
  10189. return c
  10190. }
  10191. // Header returns an http.Header that can be modified by the caller to
  10192. // add HTTP headers to the request.
  10193. func (c *TurnBasedMatchesCreateCall) Header() http.Header {
  10194. if c.header_ == nil {
  10195. c.header_ = make(http.Header)
  10196. }
  10197. return c.header_
  10198. }
  10199. func (c *TurnBasedMatchesCreateCall) doRequest(alt string) (*http.Response, error) {
  10200. reqHeaders := make(http.Header)
  10201. for k, v := range c.header_ {
  10202. reqHeaders[k] = v
  10203. }
  10204. reqHeaders.Set("User-Agent", c.s.userAgent())
  10205. var body io.Reader = nil
  10206. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchcreaterequest)
  10207. if err != nil {
  10208. return nil, err
  10209. }
  10210. reqHeaders.Set("Content-Type", "application/json")
  10211. c.urlParams_.Set("alt", alt)
  10212. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/create")
  10213. urls += "?" + c.urlParams_.Encode()
  10214. req, _ := http.NewRequest("POST", urls, body)
  10215. req.Header = reqHeaders
  10216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10217. }
  10218. // Do executes the "games.turnBasedMatches.create" call.
  10219. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10220. // status code is an error. Response headers are in either
  10221. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10222. // at all) in error.(*googleapi.Error).Header. Use
  10223. // googleapi.IsNotModified to check whether the returned error was
  10224. // because http.StatusNotModified was returned.
  10225. func (c *TurnBasedMatchesCreateCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10226. gensupport.SetOptions(c.urlParams_, opts...)
  10227. res, err := c.doRequest("json")
  10228. if res != nil && res.StatusCode == http.StatusNotModified {
  10229. if res.Body != nil {
  10230. res.Body.Close()
  10231. }
  10232. return nil, &googleapi.Error{
  10233. Code: res.StatusCode,
  10234. Header: res.Header,
  10235. }
  10236. }
  10237. if err != nil {
  10238. return nil, err
  10239. }
  10240. defer googleapi.CloseBody(res)
  10241. if err := googleapi.CheckResponse(res); err != nil {
  10242. return nil, err
  10243. }
  10244. ret := &TurnBasedMatch{
  10245. ServerResponse: googleapi.ServerResponse{
  10246. Header: res.Header,
  10247. HTTPStatusCode: res.StatusCode,
  10248. },
  10249. }
  10250. target := &ret
  10251. if err := gensupport.DecodeResponse(target, res); err != nil {
  10252. return nil, err
  10253. }
  10254. return ret, nil
  10255. // {
  10256. // "description": "Create a turn-based match.",
  10257. // "httpMethod": "POST",
  10258. // "id": "games.turnBasedMatches.create",
  10259. // "parameters": {
  10260. // "language": {
  10261. // "description": "The preferred language to use for strings returned by this method.",
  10262. // "location": "query",
  10263. // "type": "string"
  10264. // }
  10265. // },
  10266. // "path": "turnbasedmatches/create",
  10267. // "request": {
  10268. // "$ref": "TurnBasedMatchCreateRequest"
  10269. // },
  10270. // "response": {
  10271. // "$ref": "TurnBasedMatch"
  10272. // },
  10273. // "scopes": [
  10274. // "https://www.googleapis.com/auth/games",
  10275. // "https://www.googleapis.com/auth/plus.login"
  10276. // ]
  10277. // }
  10278. }
  10279. // method id "games.turnBasedMatches.decline":
  10280. type TurnBasedMatchesDeclineCall struct {
  10281. s *Service
  10282. matchId string
  10283. urlParams_ gensupport.URLParams
  10284. ctx_ context.Context
  10285. header_ http.Header
  10286. }
  10287. // Decline: Decline an invitation to play a turn-based match.
  10288. func (r *TurnBasedMatchesService) Decline(matchId string) *TurnBasedMatchesDeclineCall {
  10289. c := &TurnBasedMatchesDeclineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10290. c.matchId = matchId
  10291. return c
  10292. }
  10293. // Language sets the optional parameter "language": The preferred
  10294. // language to use for strings returned by this method.
  10295. func (c *TurnBasedMatchesDeclineCall) Language(language string) *TurnBasedMatchesDeclineCall {
  10296. c.urlParams_.Set("language", language)
  10297. return c
  10298. }
  10299. // Fields allows partial responses to be retrieved. See
  10300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10301. // for more information.
  10302. func (c *TurnBasedMatchesDeclineCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDeclineCall {
  10303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10304. return c
  10305. }
  10306. // Context sets the context to be used in this call's Do method. Any
  10307. // pending HTTP request will be aborted if the provided context is
  10308. // canceled.
  10309. func (c *TurnBasedMatchesDeclineCall) Context(ctx context.Context) *TurnBasedMatchesDeclineCall {
  10310. c.ctx_ = ctx
  10311. return c
  10312. }
  10313. // Header returns an http.Header that can be modified by the caller to
  10314. // add HTTP headers to the request.
  10315. func (c *TurnBasedMatchesDeclineCall) Header() http.Header {
  10316. if c.header_ == nil {
  10317. c.header_ = make(http.Header)
  10318. }
  10319. return c.header_
  10320. }
  10321. func (c *TurnBasedMatchesDeclineCall) doRequest(alt string) (*http.Response, error) {
  10322. reqHeaders := make(http.Header)
  10323. for k, v := range c.header_ {
  10324. reqHeaders[k] = v
  10325. }
  10326. reqHeaders.Set("User-Agent", c.s.userAgent())
  10327. var body io.Reader = nil
  10328. c.urlParams_.Set("alt", alt)
  10329. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/decline")
  10330. urls += "?" + c.urlParams_.Encode()
  10331. req, _ := http.NewRequest("PUT", urls, body)
  10332. req.Header = reqHeaders
  10333. googleapi.Expand(req.URL, map[string]string{
  10334. "matchId": c.matchId,
  10335. })
  10336. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10337. }
  10338. // Do executes the "games.turnBasedMatches.decline" call.
  10339. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10340. // status code is an error. Response headers are in either
  10341. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10342. // at all) in error.(*googleapi.Error).Header. Use
  10343. // googleapi.IsNotModified to check whether the returned error was
  10344. // because http.StatusNotModified was returned.
  10345. func (c *TurnBasedMatchesDeclineCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10346. gensupport.SetOptions(c.urlParams_, opts...)
  10347. res, err := c.doRequest("json")
  10348. if res != nil && res.StatusCode == http.StatusNotModified {
  10349. if res.Body != nil {
  10350. res.Body.Close()
  10351. }
  10352. return nil, &googleapi.Error{
  10353. Code: res.StatusCode,
  10354. Header: res.Header,
  10355. }
  10356. }
  10357. if err != nil {
  10358. return nil, err
  10359. }
  10360. defer googleapi.CloseBody(res)
  10361. if err := googleapi.CheckResponse(res); err != nil {
  10362. return nil, err
  10363. }
  10364. ret := &TurnBasedMatch{
  10365. ServerResponse: googleapi.ServerResponse{
  10366. Header: res.Header,
  10367. HTTPStatusCode: res.StatusCode,
  10368. },
  10369. }
  10370. target := &ret
  10371. if err := gensupport.DecodeResponse(target, res); err != nil {
  10372. return nil, err
  10373. }
  10374. return ret, nil
  10375. // {
  10376. // "description": "Decline an invitation to play a turn-based match.",
  10377. // "httpMethod": "PUT",
  10378. // "id": "games.turnBasedMatches.decline",
  10379. // "parameterOrder": [
  10380. // "matchId"
  10381. // ],
  10382. // "parameters": {
  10383. // "language": {
  10384. // "description": "The preferred language to use for strings returned by this method.",
  10385. // "location": "query",
  10386. // "type": "string"
  10387. // },
  10388. // "matchId": {
  10389. // "description": "The ID of the match.",
  10390. // "location": "path",
  10391. // "required": true,
  10392. // "type": "string"
  10393. // }
  10394. // },
  10395. // "path": "turnbasedmatches/{matchId}/decline",
  10396. // "response": {
  10397. // "$ref": "TurnBasedMatch"
  10398. // },
  10399. // "scopes": [
  10400. // "https://www.googleapis.com/auth/games",
  10401. // "https://www.googleapis.com/auth/plus.login"
  10402. // ]
  10403. // }
  10404. }
  10405. // method id "games.turnBasedMatches.dismiss":
  10406. type TurnBasedMatchesDismissCall struct {
  10407. s *Service
  10408. matchId string
  10409. urlParams_ gensupport.URLParams
  10410. ctx_ context.Context
  10411. header_ http.Header
  10412. }
  10413. // Dismiss: Dismiss a turn-based match from the match list. The match
  10414. // will no longer show up in the list and will not generate
  10415. // notifications.
  10416. func (r *TurnBasedMatchesService) Dismiss(matchId string) *TurnBasedMatchesDismissCall {
  10417. c := &TurnBasedMatchesDismissCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10418. c.matchId = matchId
  10419. return c
  10420. }
  10421. // Fields allows partial responses to be retrieved. See
  10422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10423. // for more information.
  10424. func (c *TurnBasedMatchesDismissCall) Fields(s ...googleapi.Field) *TurnBasedMatchesDismissCall {
  10425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10426. return c
  10427. }
  10428. // Context sets the context to be used in this call's Do method. Any
  10429. // pending HTTP request will be aborted if the provided context is
  10430. // canceled.
  10431. func (c *TurnBasedMatchesDismissCall) Context(ctx context.Context) *TurnBasedMatchesDismissCall {
  10432. c.ctx_ = ctx
  10433. return c
  10434. }
  10435. // Header returns an http.Header that can be modified by the caller to
  10436. // add HTTP headers to the request.
  10437. func (c *TurnBasedMatchesDismissCall) Header() http.Header {
  10438. if c.header_ == nil {
  10439. c.header_ = make(http.Header)
  10440. }
  10441. return c.header_
  10442. }
  10443. func (c *TurnBasedMatchesDismissCall) doRequest(alt string) (*http.Response, error) {
  10444. reqHeaders := make(http.Header)
  10445. for k, v := range c.header_ {
  10446. reqHeaders[k] = v
  10447. }
  10448. reqHeaders.Set("User-Agent", c.s.userAgent())
  10449. var body io.Reader = nil
  10450. c.urlParams_.Set("alt", alt)
  10451. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/dismiss")
  10452. urls += "?" + c.urlParams_.Encode()
  10453. req, _ := http.NewRequest("PUT", urls, body)
  10454. req.Header = reqHeaders
  10455. googleapi.Expand(req.URL, map[string]string{
  10456. "matchId": c.matchId,
  10457. })
  10458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10459. }
  10460. // Do executes the "games.turnBasedMatches.dismiss" call.
  10461. func (c *TurnBasedMatchesDismissCall) Do(opts ...googleapi.CallOption) error {
  10462. gensupport.SetOptions(c.urlParams_, opts...)
  10463. res, err := c.doRequest("json")
  10464. if err != nil {
  10465. return err
  10466. }
  10467. defer googleapi.CloseBody(res)
  10468. if err := googleapi.CheckResponse(res); err != nil {
  10469. return err
  10470. }
  10471. return nil
  10472. // {
  10473. // "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.",
  10474. // "httpMethod": "PUT",
  10475. // "id": "games.turnBasedMatches.dismiss",
  10476. // "parameterOrder": [
  10477. // "matchId"
  10478. // ],
  10479. // "parameters": {
  10480. // "matchId": {
  10481. // "description": "The ID of the match.",
  10482. // "location": "path",
  10483. // "required": true,
  10484. // "type": "string"
  10485. // }
  10486. // },
  10487. // "path": "turnbasedmatches/{matchId}/dismiss",
  10488. // "scopes": [
  10489. // "https://www.googleapis.com/auth/games",
  10490. // "https://www.googleapis.com/auth/plus.login"
  10491. // ]
  10492. // }
  10493. }
  10494. // method id "games.turnBasedMatches.finish":
  10495. type TurnBasedMatchesFinishCall struct {
  10496. s *Service
  10497. matchId string
  10498. turnbasedmatchresults *TurnBasedMatchResults
  10499. urlParams_ gensupport.URLParams
  10500. ctx_ context.Context
  10501. header_ http.Header
  10502. }
  10503. // Finish: Finish a turn-based match. Each player should make this call
  10504. // once, after all results are in. Only the player whose turn it is may
  10505. // make the first call to Finish, and can pass in the final match state.
  10506. func (r *TurnBasedMatchesService) Finish(matchId string, turnbasedmatchresults *TurnBasedMatchResults) *TurnBasedMatchesFinishCall {
  10507. c := &TurnBasedMatchesFinishCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10508. c.matchId = matchId
  10509. c.turnbasedmatchresults = turnbasedmatchresults
  10510. return c
  10511. }
  10512. // Language sets the optional parameter "language": The preferred
  10513. // language to use for strings returned by this method.
  10514. func (c *TurnBasedMatchesFinishCall) Language(language string) *TurnBasedMatchesFinishCall {
  10515. c.urlParams_.Set("language", language)
  10516. return c
  10517. }
  10518. // Fields allows partial responses to be retrieved. See
  10519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10520. // for more information.
  10521. func (c *TurnBasedMatchesFinishCall) Fields(s ...googleapi.Field) *TurnBasedMatchesFinishCall {
  10522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10523. return c
  10524. }
  10525. // Context sets the context to be used in this call's Do method. Any
  10526. // pending HTTP request will be aborted if the provided context is
  10527. // canceled.
  10528. func (c *TurnBasedMatchesFinishCall) Context(ctx context.Context) *TurnBasedMatchesFinishCall {
  10529. c.ctx_ = ctx
  10530. return c
  10531. }
  10532. // Header returns an http.Header that can be modified by the caller to
  10533. // add HTTP headers to the request.
  10534. func (c *TurnBasedMatchesFinishCall) Header() http.Header {
  10535. if c.header_ == nil {
  10536. c.header_ = make(http.Header)
  10537. }
  10538. return c.header_
  10539. }
  10540. func (c *TurnBasedMatchesFinishCall) doRequest(alt string) (*http.Response, error) {
  10541. reqHeaders := make(http.Header)
  10542. for k, v := range c.header_ {
  10543. reqHeaders[k] = v
  10544. }
  10545. reqHeaders.Set("User-Agent", c.s.userAgent())
  10546. var body io.Reader = nil
  10547. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchresults)
  10548. if err != nil {
  10549. return nil, err
  10550. }
  10551. reqHeaders.Set("Content-Type", "application/json")
  10552. c.urlParams_.Set("alt", alt)
  10553. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/finish")
  10554. urls += "?" + c.urlParams_.Encode()
  10555. req, _ := http.NewRequest("PUT", urls, body)
  10556. req.Header = reqHeaders
  10557. googleapi.Expand(req.URL, map[string]string{
  10558. "matchId": c.matchId,
  10559. })
  10560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10561. }
  10562. // Do executes the "games.turnBasedMatches.finish" call.
  10563. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10564. // status code is an error. Response headers are in either
  10565. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10566. // at all) in error.(*googleapi.Error).Header. Use
  10567. // googleapi.IsNotModified to check whether the returned error was
  10568. // because http.StatusNotModified was returned.
  10569. func (c *TurnBasedMatchesFinishCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10570. gensupport.SetOptions(c.urlParams_, opts...)
  10571. res, err := c.doRequest("json")
  10572. if res != nil && res.StatusCode == http.StatusNotModified {
  10573. if res.Body != nil {
  10574. res.Body.Close()
  10575. }
  10576. return nil, &googleapi.Error{
  10577. Code: res.StatusCode,
  10578. Header: res.Header,
  10579. }
  10580. }
  10581. if err != nil {
  10582. return nil, err
  10583. }
  10584. defer googleapi.CloseBody(res)
  10585. if err := googleapi.CheckResponse(res); err != nil {
  10586. return nil, err
  10587. }
  10588. ret := &TurnBasedMatch{
  10589. ServerResponse: googleapi.ServerResponse{
  10590. Header: res.Header,
  10591. HTTPStatusCode: res.StatusCode,
  10592. },
  10593. }
  10594. target := &ret
  10595. if err := gensupport.DecodeResponse(target, res); err != nil {
  10596. return nil, err
  10597. }
  10598. return ret, nil
  10599. // {
  10600. // "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.",
  10601. // "httpMethod": "PUT",
  10602. // "id": "games.turnBasedMatches.finish",
  10603. // "parameterOrder": [
  10604. // "matchId"
  10605. // ],
  10606. // "parameters": {
  10607. // "language": {
  10608. // "description": "The preferred language to use for strings returned by this method.",
  10609. // "location": "query",
  10610. // "type": "string"
  10611. // },
  10612. // "matchId": {
  10613. // "description": "The ID of the match.",
  10614. // "location": "path",
  10615. // "required": true,
  10616. // "type": "string"
  10617. // }
  10618. // },
  10619. // "path": "turnbasedmatches/{matchId}/finish",
  10620. // "request": {
  10621. // "$ref": "TurnBasedMatchResults"
  10622. // },
  10623. // "response": {
  10624. // "$ref": "TurnBasedMatch"
  10625. // },
  10626. // "scopes": [
  10627. // "https://www.googleapis.com/auth/games",
  10628. // "https://www.googleapis.com/auth/plus.login"
  10629. // ]
  10630. // }
  10631. }
  10632. // method id "games.turnBasedMatches.get":
  10633. type TurnBasedMatchesGetCall struct {
  10634. s *Service
  10635. matchId string
  10636. urlParams_ gensupport.URLParams
  10637. ifNoneMatch_ string
  10638. ctx_ context.Context
  10639. header_ http.Header
  10640. }
  10641. // Get: Get the data for a turn-based match.
  10642. func (r *TurnBasedMatchesService) Get(matchId string) *TurnBasedMatchesGetCall {
  10643. c := &TurnBasedMatchesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10644. c.matchId = matchId
  10645. return c
  10646. }
  10647. // IncludeMatchData sets the optional parameter "includeMatchData": Get
  10648. // match data along with metadata.
  10649. func (c *TurnBasedMatchesGetCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesGetCall {
  10650. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  10651. return c
  10652. }
  10653. // Language sets the optional parameter "language": The preferred
  10654. // language to use for strings returned by this method.
  10655. func (c *TurnBasedMatchesGetCall) Language(language string) *TurnBasedMatchesGetCall {
  10656. c.urlParams_.Set("language", language)
  10657. return c
  10658. }
  10659. // Fields allows partial responses to be retrieved. See
  10660. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10661. // for more information.
  10662. func (c *TurnBasedMatchesGetCall) Fields(s ...googleapi.Field) *TurnBasedMatchesGetCall {
  10663. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10664. return c
  10665. }
  10666. // IfNoneMatch sets the optional parameter which makes the operation
  10667. // fail if the object's ETag matches the given value. This is useful for
  10668. // getting updates only after the object has changed since the last
  10669. // request. Use googleapi.IsNotModified to check whether the response
  10670. // error from Do is the result of In-None-Match.
  10671. func (c *TurnBasedMatchesGetCall) IfNoneMatch(entityTag string) *TurnBasedMatchesGetCall {
  10672. c.ifNoneMatch_ = entityTag
  10673. return c
  10674. }
  10675. // Context sets the context to be used in this call's Do method. Any
  10676. // pending HTTP request will be aborted if the provided context is
  10677. // canceled.
  10678. func (c *TurnBasedMatchesGetCall) Context(ctx context.Context) *TurnBasedMatchesGetCall {
  10679. c.ctx_ = ctx
  10680. return c
  10681. }
  10682. // Header returns an http.Header that can be modified by the caller to
  10683. // add HTTP headers to the request.
  10684. func (c *TurnBasedMatchesGetCall) Header() http.Header {
  10685. if c.header_ == nil {
  10686. c.header_ = make(http.Header)
  10687. }
  10688. return c.header_
  10689. }
  10690. func (c *TurnBasedMatchesGetCall) doRequest(alt string) (*http.Response, error) {
  10691. reqHeaders := make(http.Header)
  10692. for k, v := range c.header_ {
  10693. reqHeaders[k] = v
  10694. }
  10695. reqHeaders.Set("User-Agent", c.s.userAgent())
  10696. if c.ifNoneMatch_ != "" {
  10697. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10698. }
  10699. var body io.Reader = nil
  10700. c.urlParams_.Set("alt", alt)
  10701. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}")
  10702. urls += "?" + c.urlParams_.Encode()
  10703. req, _ := http.NewRequest("GET", urls, body)
  10704. req.Header = reqHeaders
  10705. googleapi.Expand(req.URL, map[string]string{
  10706. "matchId": c.matchId,
  10707. })
  10708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10709. }
  10710. // Do executes the "games.turnBasedMatches.get" call.
  10711. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10712. // status code is an error. Response headers are in either
  10713. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10714. // at all) in error.(*googleapi.Error).Header. Use
  10715. // googleapi.IsNotModified to check whether the returned error was
  10716. // because http.StatusNotModified was returned.
  10717. func (c *TurnBasedMatchesGetCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10718. gensupport.SetOptions(c.urlParams_, opts...)
  10719. res, err := c.doRequest("json")
  10720. if res != nil && res.StatusCode == http.StatusNotModified {
  10721. if res.Body != nil {
  10722. res.Body.Close()
  10723. }
  10724. return nil, &googleapi.Error{
  10725. Code: res.StatusCode,
  10726. Header: res.Header,
  10727. }
  10728. }
  10729. if err != nil {
  10730. return nil, err
  10731. }
  10732. defer googleapi.CloseBody(res)
  10733. if err := googleapi.CheckResponse(res); err != nil {
  10734. return nil, err
  10735. }
  10736. ret := &TurnBasedMatch{
  10737. ServerResponse: googleapi.ServerResponse{
  10738. Header: res.Header,
  10739. HTTPStatusCode: res.StatusCode,
  10740. },
  10741. }
  10742. target := &ret
  10743. if err := gensupport.DecodeResponse(target, res); err != nil {
  10744. return nil, err
  10745. }
  10746. return ret, nil
  10747. // {
  10748. // "description": "Get the data for a turn-based match.",
  10749. // "httpMethod": "GET",
  10750. // "id": "games.turnBasedMatches.get",
  10751. // "parameterOrder": [
  10752. // "matchId"
  10753. // ],
  10754. // "parameters": {
  10755. // "includeMatchData": {
  10756. // "description": "Get match data along with metadata.",
  10757. // "location": "query",
  10758. // "type": "boolean"
  10759. // },
  10760. // "language": {
  10761. // "description": "The preferred language to use for strings returned by this method.",
  10762. // "location": "query",
  10763. // "type": "string"
  10764. // },
  10765. // "matchId": {
  10766. // "description": "The ID of the match.",
  10767. // "location": "path",
  10768. // "required": true,
  10769. // "type": "string"
  10770. // }
  10771. // },
  10772. // "path": "turnbasedmatches/{matchId}",
  10773. // "response": {
  10774. // "$ref": "TurnBasedMatch"
  10775. // },
  10776. // "scopes": [
  10777. // "https://www.googleapis.com/auth/games",
  10778. // "https://www.googleapis.com/auth/plus.login"
  10779. // ]
  10780. // }
  10781. }
  10782. // method id "games.turnBasedMatches.join":
  10783. type TurnBasedMatchesJoinCall struct {
  10784. s *Service
  10785. matchId string
  10786. urlParams_ gensupport.URLParams
  10787. ctx_ context.Context
  10788. header_ http.Header
  10789. }
  10790. // Join: Join a turn-based match.
  10791. func (r *TurnBasedMatchesService) Join(matchId string) *TurnBasedMatchesJoinCall {
  10792. c := &TurnBasedMatchesJoinCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10793. c.matchId = matchId
  10794. return c
  10795. }
  10796. // Language sets the optional parameter "language": The preferred
  10797. // language to use for strings returned by this method.
  10798. func (c *TurnBasedMatchesJoinCall) Language(language string) *TurnBasedMatchesJoinCall {
  10799. c.urlParams_.Set("language", language)
  10800. return c
  10801. }
  10802. // Fields allows partial responses to be retrieved. See
  10803. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10804. // for more information.
  10805. func (c *TurnBasedMatchesJoinCall) Fields(s ...googleapi.Field) *TurnBasedMatchesJoinCall {
  10806. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10807. return c
  10808. }
  10809. // Context sets the context to be used in this call's Do method. Any
  10810. // pending HTTP request will be aborted if the provided context is
  10811. // canceled.
  10812. func (c *TurnBasedMatchesJoinCall) Context(ctx context.Context) *TurnBasedMatchesJoinCall {
  10813. c.ctx_ = ctx
  10814. return c
  10815. }
  10816. // Header returns an http.Header that can be modified by the caller to
  10817. // add HTTP headers to the request.
  10818. func (c *TurnBasedMatchesJoinCall) Header() http.Header {
  10819. if c.header_ == nil {
  10820. c.header_ = make(http.Header)
  10821. }
  10822. return c.header_
  10823. }
  10824. func (c *TurnBasedMatchesJoinCall) doRequest(alt string) (*http.Response, error) {
  10825. reqHeaders := make(http.Header)
  10826. for k, v := range c.header_ {
  10827. reqHeaders[k] = v
  10828. }
  10829. reqHeaders.Set("User-Agent", c.s.userAgent())
  10830. var body io.Reader = nil
  10831. c.urlParams_.Set("alt", alt)
  10832. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/join")
  10833. urls += "?" + c.urlParams_.Encode()
  10834. req, _ := http.NewRequest("PUT", urls, body)
  10835. req.Header = reqHeaders
  10836. googleapi.Expand(req.URL, map[string]string{
  10837. "matchId": c.matchId,
  10838. })
  10839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10840. }
  10841. // Do executes the "games.turnBasedMatches.join" call.
  10842. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10843. // status code is an error. Response headers are in either
  10844. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10845. // at all) in error.(*googleapi.Error).Header. Use
  10846. // googleapi.IsNotModified to check whether the returned error was
  10847. // because http.StatusNotModified was returned.
  10848. func (c *TurnBasedMatchesJoinCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10849. gensupport.SetOptions(c.urlParams_, opts...)
  10850. res, err := c.doRequest("json")
  10851. if res != nil && res.StatusCode == http.StatusNotModified {
  10852. if res.Body != nil {
  10853. res.Body.Close()
  10854. }
  10855. return nil, &googleapi.Error{
  10856. Code: res.StatusCode,
  10857. Header: res.Header,
  10858. }
  10859. }
  10860. if err != nil {
  10861. return nil, err
  10862. }
  10863. defer googleapi.CloseBody(res)
  10864. if err := googleapi.CheckResponse(res); err != nil {
  10865. return nil, err
  10866. }
  10867. ret := &TurnBasedMatch{
  10868. ServerResponse: googleapi.ServerResponse{
  10869. Header: res.Header,
  10870. HTTPStatusCode: res.StatusCode,
  10871. },
  10872. }
  10873. target := &ret
  10874. if err := gensupport.DecodeResponse(target, res); err != nil {
  10875. return nil, err
  10876. }
  10877. return ret, nil
  10878. // {
  10879. // "description": "Join a turn-based match.",
  10880. // "httpMethod": "PUT",
  10881. // "id": "games.turnBasedMatches.join",
  10882. // "parameterOrder": [
  10883. // "matchId"
  10884. // ],
  10885. // "parameters": {
  10886. // "language": {
  10887. // "description": "The preferred language to use for strings returned by this method.",
  10888. // "location": "query",
  10889. // "type": "string"
  10890. // },
  10891. // "matchId": {
  10892. // "description": "The ID of the match.",
  10893. // "location": "path",
  10894. // "required": true,
  10895. // "type": "string"
  10896. // }
  10897. // },
  10898. // "path": "turnbasedmatches/{matchId}/join",
  10899. // "response": {
  10900. // "$ref": "TurnBasedMatch"
  10901. // },
  10902. // "scopes": [
  10903. // "https://www.googleapis.com/auth/games",
  10904. // "https://www.googleapis.com/auth/plus.login"
  10905. // ]
  10906. // }
  10907. }
  10908. // method id "games.turnBasedMatches.leave":
  10909. type TurnBasedMatchesLeaveCall struct {
  10910. s *Service
  10911. matchId string
  10912. urlParams_ gensupport.URLParams
  10913. ctx_ context.Context
  10914. header_ http.Header
  10915. }
  10916. // Leave: Leave a turn-based match when it is not the current player's
  10917. // turn, without canceling the match.
  10918. func (r *TurnBasedMatchesService) Leave(matchId string) *TurnBasedMatchesLeaveCall {
  10919. c := &TurnBasedMatchesLeaveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10920. c.matchId = matchId
  10921. return c
  10922. }
  10923. // Language sets the optional parameter "language": The preferred
  10924. // language to use for strings returned by this method.
  10925. func (c *TurnBasedMatchesLeaveCall) Language(language string) *TurnBasedMatchesLeaveCall {
  10926. c.urlParams_.Set("language", language)
  10927. return c
  10928. }
  10929. // Fields allows partial responses to be retrieved. See
  10930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10931. // for more information.
  10932. func (c *TurnBasedMatchesLeaveCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveCall {
  10933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10934. return c
  10935. }
  10936. // Context sets the context to be used in this call's Do method. Any
  10937. // pending HTTP request will be aborted if the provided context is
  10938. // canceled.
  10939. func (c *TurnBasedMatchesLeaveCall) Context(ctx context.Context) *TurnBasedMatchesLeaveCall {
  10940. c.ctx_ = ctx
  10941. return c
  10942. }
  10943. // Header returns an http.Header that can be modified by the caller to
  10944. // add HTTP headers to the request.
  10945. func (c *TurnBasedMatchesLeaveCall) Header() http.Header {
  10946. if c.header_ == nil {
  10947. c.header_ = make(http.Header)
  10948. }
  10949. return c.header_
  10950. }
  10951. func (c *TurnBasedMatchesLeaveCall) doRequest(alt string) (*http.Response, error) {
  10952. reqHeaders := make(http.Header)
  10953. for k, v := range c.header_ {
  10954. reqHeaders[k] = v
  10955. }
  10956. reqHeaders.Set("User-Agent", c.s.userAgent())
  10957. var body io.Reader = nil
  10958. c.urlParams_.Set("alt", alt)
  10959. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leave")
  10960. urls += "?" + c.urlParams_.Encode()
  10961. req, _ := http.NewRequest("PUT", urls, body)
  10962. req.Header = reqHeaders
  10963. googleapi.Expand(req.URL, map[string]string{
  10964. "matchId": c.matchId,
  10965. })
  10966. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10967. }
  10968. // Do executes the "games.turnBasedMatches.leave" call.
  10969. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  10970. // status code is an error. Response headers are in either
  10971. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  10972. // at all) in error.(*googleapi.Error).Header. Use
  10973. // googleapi.IsNotModified to check whether the returned error was
  10974. // because http.StatusNotModified was returned.
  10975. func (c *TurnBasedMatchesLeaveCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  10976. gensupport.SetOptions(c.urlParams_, opts...)
  10977. res, err := c.doRequest("json")
  10978. if res != nil && res.StatusCode == http.StatusNotModified {
  10979. if res.Body != nil {
  10980. res.Body.Close()
  10981. }
  10982. return nil, &googleapi.Error{
  10983. Code: res.StatusCode,
  10984. Header: res.Header,
  10985. }
  10986. }
  10987. if err != nil {
  10988. return nil, err
  10989. }
  10990. defer googleapi.CloseBody(res)
  10991. if err := googleapi.CheckResponse(res); err != nil {
  10992. return nil, err
  10993. }
  10994. ret := &TurnBasedMatch{
  10995. ServerResponse: googleapi.ServerResponse{
  10996. Header: res.Header,
  10997. HTTPStatusCode: res.StatusCode,
  10998. },
  10999. }
  11000. target := &ret
  11001. if err := gensupport.DecodeResponse(target, res); err != nil {
  11002. return nil, err
  11003. }
  11004. return ret, nil
  11005. // {
  11006. // "description": "Leave a turn-based match when it is not the current player's turn, without canceling the match.",
  11007. // "httpMethod": "PUT",
  11008. // "id": "games.turnBasedMatches.leave",
  11009. // "parameterOrder": [
  11010. // "matchId"
  11011. // ],
  11012. // "parameters": {
  11013. // "language": {
  11014. // "description": "The preferred language to use for strings returned by this method.",
  11015. // "location": "query",
  11016. // "type": "string"
  11017. // },
  11018. // "matchId": {
  11019. // "description": "The ID of the match.",
  11020. // "location": "path",
  11021. // "required": true,
  11022. // "type": "string"
  11023. // }
  11024. // },
  11025. // "path": "turnbasedmatches/{matchId}/leave",
  11026. // "response": {
  11027. // "$ref": "TurnBasedMatch"
  11028. // },
  11029. // "scopes": [
  11030. // "https://www.googleapis.com/auth/games",
  11031. // "https://www.googleapis.com/auth/plus.login"
  11032. // ]
  11033. // }
  11034. }
  11035. // method id "games.turnBasedMatches.leaveTurn":
  11036. type TurnBasedMatchesLeaveTurnCall struct {
  11037. s *Service
  11038. matchId string
  11039. urlParams_ gensupport.URLParams
  11040. ctx_ context.Context
  11041. header_ http.Header
  11042. }
  11043. // LeaveTurn: Leave a turn-based match during the current player's turn,
  11044. // without canceling the match.
  11045. func (r *TurnBasedMatchesService) LeaveTurn(matchId string, matchVersion int64) *TurnBasedMatchesLeaveTurnCall {
  11046. c := &TurnBasedMatchesLeaveTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11047. c.matchId = matchId
  11048. c.urlParams_.Set("matchVersion", fmt.Sprint(matchVersion))
  11049. return c
  11050. }
  11051. // Language sets the optional parameter "language": The preferred
  11052. // language to use for strings returned by this method.
  11053. func (c *TurnBasedMatchesLeaveTurnCall) Language(language string) *TurnBasedMatchesLeaveTurnCall {
  11054. c.urlParams_.Set("language", language)
  11055. return c
  11056. }
  11057. // PendingParticipantId sets the optional parameter
  11058. // "pendingParticipantId": The ID of another participant who should take
  11059. // their turn next. If not set, the match will wait for other player(s)
  11060. // to join via automatching; this is only valid if automatch criteria is
  11061. // set on the match with remaining slots for automatched players.
  11062. func (c *TurnBasedMatchesLeaveTurnCall) PendingParticipantId(pendingParticipantId string) *TurnBasedMatchesLeaveTurnCall {
  11063. c.urlParams_.Set("pendingParticipantId", pendingParticipantId)
  11064. return c
  11065. }
  11066. // Fields allows partial responses to be retrieved. See
  11067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11068. // for more information.
  11069. func (c *TurnBasedMatchesLeaveTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesLeaveTurnCall {
  11070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11071. return c
  11072. }
  11073. // Context sets the context to be used in this call's Do method. Any
  11074. // pending HTTP request will be aborted if the provided context is
  11075. // canceled.
  11076. func (c *TurnBasedMatchesLeaveTurnCall) Context(ctx context.Context) *TurnBasedMatchesLeaveTurnCall {
  11077. c.ctx_ = ctx
  11078. return c
  11079. }
  11080. // Header returns an http.Header that can be modified by the caller to
  11081. // add HTTP headers to the request.
  11082. func (c *TurnBasedMatchesLeaveTurnCall) Header() http.Header {
  11083. if c.header_ == nil {
  11084. c.header_ = make(http.Header)
  11085. }
  11086. return c.header_
  11087. }
  11088. func (c *TurnBasedMatchesLeaveTurnCall) doRequest(alt string) (*http.Response, error) {
  11089. reqHeaders := make(http.Header)
  11090. for k, v := range c.header_ {
  11091. reqHeaders[k] = v
  11092. }
  11093. reqHeaders.Set("User-Agent", c.s.userAgent())
  11094. var body io.Reader = nil
  11095. c.urlParams_.Set("alt", alt)
  11096. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/leaveTurn")
  11097. urls += "?" + c.urlParams_.Encode()
  11098. req, _ := http.NewRequest("PUT", urls, body)
  11099. req.Header = reqHeaders
  11100. googleapi.Expand(req.URL, map[string]string{
  11101. "matchId": c.matchId,
  11102. })
  11103. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11104. }
  11105. // Do executes the "games.turnBasedMatches.leaveTurn" call.
  11106. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  11107. // status code is an error. Response headers are in either
  11108. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  11109. // at all) in error.(*googleapi.Error).Header. Use
  11110. // googleapi.IsNotModified to check whether the returned error was
  11111. // because http.StatusNotModified was returned.
  11112. func (c *TurnBasedMatchesLeaveTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  11113. gensupport.SetOptions(c.urlParams_, opts...)
  11114. res, err := c.doRequest("json")
  11115. if res != nil && res.StatusCode == http.StatusNotModified {
  11116. if res.Body != nil {
  11117. res.Body.Close()
  11118. }
  11119. return nil, &googleapi.Error{
  11120. Code: res.StatusCode,
  11121. Header: res.Header,
  11122. }
  11123. }
  11124. if err != nil {
  11125. return nil, err
  11126. }
  11127. defer googleapi.CloseBody(res)
  11128. if err := googleapi.CheckResponse(res); err != nil {
  11129. return nil, err
  11130. }
  11131. ret := &TurnBasedMatch{
  11132. ServerResponse: googleapi.ServerResponse{
  11133. Header: res.Header,
  11134. HTTPStatusCode: res.StatusCode,
  11135. },
  11136. }
  11137. target := &ret
  11138. if err := gensupport.DecodeResponse(target, res); err != nil {
  11139. return nil, err
  11140. }
  11141. return ret, nil
  11142. // {
  11143. // "description": "Leave a turn-based match during the current player's turn, without canceling the match.",
  11144. // "httpMethod": "PUT",
  11145. // "id": "games.turnBasedMatches.leaveTurn",
  11146. // "parameterOrder": [
  11147. // "matchId",
  11148. // "matchVersion"
  11149. // ],
  11150. // "parameters": {
  11151. // "language": {
  11152. // "description": "The preferred language to use for strings returned by this method.",
  11153. // "location": "query",
  11154. // "type": "string"
  11155. // },
  11156. // "matchId": {
  11157. // "description": "The ID of the match.",
  11158. // "location": "path",
  11159. // "required": true,
  11160. // "type": "string"
  11161. // },
  11162. // "matchVersion": {
  11163. // "description": "The version of the match being updated.",
  11164. // "format": "int32",
  11165. // "location": "query",
  11166. // "required": true,
  11167. // "type": "integer"
  11168. // },
  11169. // "pendingParticipantId": {
  11170. // "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.",
  11171. // "location": "query",
  11172. // "type": "string"
  11173. // }
  11174. // },
  11175. // "path": "turnbasedmatches/{matchId}/leaveTurn",
  11176. // "response": {
  11177. // "$ref": "TurnBasedMatch"
  11178. // },
  11179. // "scopes": [
  11180. // "https://www.googleapis.com/auth/games",
  11181. // "https://www.googleapis.com/auth/plus.login"
  11182. // ]
  11183. // }
  11184. }
  11185. // method id "games.turnBasedMatches.list":
  11186. type TurnBasedMatchesListCall struct {
  11187. s *Service
  11188. urlParams_ gensupport.URLParams
  11189. ifNoneMatch_ string
  11190. ctx_ context.Context
  11191. header_ http.Header
  11192. }
  11193. // List: Returns turn-based matches the player is or was involved in.
  11194. func (r *TurnBasedMatchesService) List() *TurnBasedMatchesListCall {
  11195. c := &TurnBasedMatchesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11196. return c
  11197. }
  11198. // IncludeMatchData sets the optional parameter "includeMatchData": True
  11199. // if match data should be returned in the response. Note that not all
  11200. // data will necessarily be returned if include_match_data is true; the
  11201. // server may decide to only return data for some of the matches to
  11202. // limit download size for the client. The remainder of the data for
  11203. // these matches will be retrievable on request.
  11204. func (c *TurnBasedMatchesListCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesListCall {
  11205. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  11206. return c
  11207. }
  11208. // Language sets the optional parameter "language": The preferred
  11209. // language to use for strings returned by this method.
  11210. func (c *TurnBasedMatchesListCall) Language(language string) *TurnBasedMatchesListCall {
  11211. c.urlParams_.Set("language", language)
  11212. return c
  11213. }
  11214. // MaxCompletedMatches sets the optional parameter
  11215. // "maxCompletedMatches": The maximum number of completed or canceled
  11216. // matches to return in the response. If not set, all matches returned
  11217. // could be completed or canceled.
  11218. func (c *TurnBasedMatchesListCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesListCall {
  11219. c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches))
  11220. return c
  11221. }
  11222. // MaxResults sets the optional parameter "maxResults": The maximum
  11223. // number of matches to return in the response, used for paging. For any
  11224. // response, the actual number of matches to return may be less than the
  11225. // specified maxResults.
  11226. func (c *TurnBasedMatchesListCall) MaxResults(maxResults int64) *TurnBasedMatchesListCall {
  11227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11228. return c
  11229. }
  11230. // PageToken sets the optional parameter "pageToken": The token returned
  11231. // by the previous request.
  11232. func (c *TurnBasedMatchesListCall) PageToken(pageToken string) *TurnBasedMatchesListCall {
  11233. c.urlParams_.Set("pageToken", pageToken)
  11234. return c
  11235. }
  11236. // Fields allows partial responses to be retrieved. See
  11237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11238. // for more information.
  11239. func (c *TurnBasedMatchesListCall) Fields(s ...googleapi.Field) *TurnBasedMatchesListCall {
  11240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11241. return c
  11242. }
  11243. // IfNoneMatch sets the optional parameter which makes the operation
  11244. // fail if the object's ETag matches the given value. This is useful for
  11245. // getting updates only after the object has changed since the last
  11246. // request. Use googleapi.IsNotModified to check whether the response
  11247. // error from Do is the result of In-None-Match.
  11248. func (c *TurnBasedMatchesListCall) IfNoneMatch(entityTag string) *TurnBasedMatchesListCall {
  11249. c.ifNoneMatch_ = entityTag
  11250. return c
  11251. }
  11252. // Context sets the context to be used in this call's Do method. Any
  11253. // pending HTTP request will be aborted if the provided context is
  11254. // canceled.
  11255. func (c *TurnBasedMatchesListCall) Context(ctx context.Context) *TurnBasedMatchesListCall {
  11256. c.ctx_ = ctx
  11257. return c
  11258. }
  11259. // Header returns an http.Header that can be modified by the caller to
  11260. // add HTTP headers to the request.
  11261. func (c *TurnBasedMatchesListCall) Header() http.Header {
  11262. if c.header_ == nil {
  11263. c.header_ = make(http.Header)
  11264. }
  11265. return c.header_
  11266. }
  11267. func (c *TurnBasedMatchesListCall) doRequest(alt string) (*http.Response, error) {
  11268. reqHeaders := make(http.Header)
  11269. for k, v := range c.header_ {
  11270. reqHeaders[k] = v
  11271. }
  11272. reqHeaders.Set("User-Agent", c.s.userAgent())
  11273. if c.ifNoneMatch_ != "" {
  11274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11275. }
  11276. var body io.Reader = nil
  11277. c.urlParams_.Set("alt", alt)
  11278. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches")
  11279. urls += "?" + c.urlParams_.Encode()
  11280. req, _ := http.NewRequest("GET", urls, body)
  11281. req.Header = reqHeaders
  11282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11283. }
  11284. // Do executes the "games.turnBasedMatches.list" call.
  11285. // Exactly one of *TurnBasedMatchList or error will be non-nil. Any
  11286. // non-2xx status code is an error. Response headers are in either
  11287. // *TurnBasedMatchList.ServerResponse.Header or (if a response was
  11288. // returned at all) in error.(*googleapi.Error).Header. Use
  11289. // googleapi.IsNotModified to check whether the returned error was
  11290. // because http.StatusNotModified was returned.
  11291. func (c *TurnBasedMatchesListCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchList, error) {
  11292. gensupport.SetOptions(c.urlParams_, opts...)
  11293. res, err := c.doRequest("json")
  11294. if res != nil && res.StatusCode == http.StatusNotModified {
  11295. if res.Body != nil {
  11296. res.Body.Close()
  11297. }
  11298. return nil, &googleapi.Error{
  11299. Code: res.StatusCode,
  11300. Header: res.Header,
  11301. }
  11302. }
  11303. if err != nil {
  11304. return nil, err
  11305. }
  11306. defer googleapi.CloseBody(res)
  11307. if err := googleapi.CheckResponse(res); err != nil {
  11308. return nil, err
  11309. }
  11310. ret := &TurnBasedMatchList{
  11311. ServerResponse: googleapi.ServerResponse{
  11312. Header: res.Header,
  11313. HTTPStatusCode: res.StatusCode,
  11314. },
  11315. }
  11316. target := &ret
  11317. if err := gensupport.DecodeResponse(target, res); err != nil {
  11318. return nil, err
  11319. }
  11320. return ret, nil
  11321. // {
  11322. // "description": "Returns turn-based matches the player is or was involved in.",
  11323. // "httpMethod": "GET",
  11324. // "id": "games.turnBasedMatches.list",
  11325. // "parameters": {
  11326. // "includeMatchData": {
  11327. // "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.",
  11328. // "location": "query",
  11329. // "type": "boolean"
  11330. // },
  11331. // "language": {
  11332. // "description": "The preferred language to use for strings returned by this method.",
  11333. // "location": "query",
  11334. // "type": "string"
  11335. // },
  11336. // "maxCompletedMatches": {
  11337. // "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.",
  11338. // "format": "int32",
  11339. // "location": "query",
  11340. // "maximum": "500",
  11341. // "minimum": "0",
  11342. // "type": "integer"
  11343. // },
  11344. // "maxResults": {
  11345. // "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.",
  11346. // "format": "int32",
  11347. // "location": "query",
  11348. // "maximum": "500",
  11349. // "minimum": "1",
  11350. // "type": "integer"
  11351. // },
  11352. // "pageToken": {
  11353. // "description": "The token returned by the previous request.",
  11354. // "location": "query",
  11355. // "type": "string"
  11356. // }
  11357. // },
  11358. // "path": "turnbasedmatches",
  11359. // "response": {
  11360. // "$ref": "TurnBasedMatchList"
  11361. // },
  11362. // "scopes": [
  11363. // "https://www.googleapis.com/auth/games",
  11364. // "https://www.googleapis.com/auth/plus.login"
  11365. // ]
  11366. // }
  11367. }
  11368. // Pages invokes f for each page of results.
  11369. // A non-nil error returned from f will halt the iteration.
  11370. // The provided context supersedes any context provided to the Context method.
  11371. func (c *TurnBasedMatchesListCall) Pages(ctx context.Context, f func(*TurnBasedMatchList) error) error {
  11372. c.ctx_ = ctx
  11373. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11374. for {
  11375. x, err := c.Do()
  11376. if err != nil {
  11377. return err
  11378. }
  11379. if err := f(x); err != nil {
  11380. return err
  11381. }
  11382. if x.NextPageToken == "" {
  11383. return nil
  11384. }
  11385. c.PageToken(x.NextPageToken)
  11386. }
  11387. }
  11388. // method id "games.turnBasedMatches.rematch":
  11389. type TurnBasedMatchesRematchCall struct {
  11390. s *Service
  11391. matchId string
  11392. urlParams_ gensupport.URLParams
  11393. ctx_ context.Context
  11394. header_ http.Header
  11395. }
  11396. // Rematch: Create a rematch of a match that was previously completed,
  11397. // with the same participants. This can be called by only one player on
  11398. // a match still in their list; the player must have called Finish
  11399. // first. Returns the newly created match; it will be the caller's turn.
  11400. func (r *TurnBasedMatchesService) Rematch(matchId string) *TurnBasedMatchesRematchCall {
  11401. c := &TurnBasedMatchesRematchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11402. c.matchId = matchId
  11403. return c
  11404. }
  11405. // Language sets the optional parameter "language": The preferred
  11406. // language to use for strings returned by this method.
  11407. func (c *TurnBasedMatchesRematchCall) Language(language string) *TurnBasedMatchesRematchCall {
  11408. c.urlParams_.Set("language", language)
  11409. return c
  11410. }
  11411. // RequestId sets the optional parameter "requestId": A randomly
  11412. // generated numeric ID for each request specified by the caller. This
  11413. // number is used at the server to ensure that the request is handled
  11414. // correctly across retries.
  11415. func (c *TurnBasedMatchesRematchCall) RequestId(requestId int64) *TurnBasedMatchesRematchCall {
  11416. c.urlParams_.Set("requestId", fmt.Sprint(requestId))
  11417. return c
  11418. }
  11419. // Fields allows partial responses to be retrieved. See
  11420. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11421. // for more information.
  11422. func (c *TurnBasedMatchesRematchCall) Fields(s ...googleapi.Field) *TurnBasedMatchesRematchCall {
  11423. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11424. return c
  11425. }
  11426. // Context sets the context to be used in this call's Do method. Any
  11427. // pending HTTP request will be aborted if the provided context is
  11428. // canceled.
  11429. func (c *TurnBasedMatchesRematchCall) Context(ctx context.Context) *TurnBasedMatchesRematchCall {
  11430. c.ctx_ = ctx
  11431. return c
  11432. }
  11433. // Header returns an http.Header that can be modified by the caller to
  11434. // add HTTP headers to the request.
  11435. func (c *TurnBasedMatchesRematchCall) Header() http.Header {
  11436. if c.header_ == nil {
  11437. c.header_ = make(http.Header)
  11438. }
  11439. return c.header_
  11440. }
  11441. func (c *TurnBasedMatchesRematchCall) doRequest(alt string) (*http.Response, error) {
  11442. reqHeaders := make(http.Header)
  11443. for k, v := range c.header_ {
  11444. reqHeaders[k] = v
  11445. }
  11446. reqHeaders.Set("User-Agent", c.s.userAgent())
  11447. var body io.Reader = nil
  11448. c.urlParams_.Set("alt", alt)
  11449. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/rematch")
  11450. urls += "?" + c.urlParams_.Encode()
  11451. req, _ := http.NewRequest("POST", urls, body)
  11452. req.Header = reqHeaders
  11453. googleapi.Expand(req.URL, map[string]string{
  11454. "matchId": c.matchId,
  11455. })
  11456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11457. }
  11458. // Do executes the "games.turnBasedMatches.rematch" call.
  11459. // Exactly one of *TurnBasedMatchRematch or error will be non-nil. Any
  11460. // non-2xx status code is an error. Response headers are in either
  11461. // *TurnBasedMatchRematch.ServerResponse.Header or (if a response was
  11462. // returned at all) in error.(*googleapi.Error).Header. Use
  11463. // googleapi.IsNotModified to check whether the returned error was
  11464. // because http.StatusNotModified was returned.
  11465. func (c *TurnBasedMatchesRematchCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchRematch, error) {
  11466. gensupport.SetOptions(c.urlParams_, opts...)
  11467. res, err := c.doRequest("json")
  11468. if res != nil && res.StatusCode == http.StatusNotModified {
  11469. if res.Body != nil {
  11470. res.Body.Close()
  11471. }
  11472. return nil, &googleapi.Error{
  11473. Code: res.StatusCode,
  11474. Header: res.Header,
  11475. }
  11476. }
  11477. if err != nil {
  11478. return nil, err
  11479. }
  11480. defer googleapi.CloseBody(res)
  11481. if err := googleapi.CheckResponse(res); err != nil {
  11482. return nil, err
  11483. }
  11484. ret := &TurnBasedMatchRematch{
  11485. ServerResponse: googleapi.ServerResponse{
  11486. Header: res.Header,
  11487. HTTPStatusCode: res.StatusCode,
  11488. },
  11489. }
  11490. target := &ret
  11491. if err := gensupport.DecodeResponse(target, res); err != nil {
  11492. return nil, err
  11493. }
  11494. return ret, nil
  11495. // {
  11496. // "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.",
  11497. // "httpMethod": "POST",
  11498. // "id": "games.turnBasedMatches.rematch",
  11499. // "parameterOrder": [
  11500. // "matchId"
  11501. // ],
  11502. // "parameters": {
  11503. // "language": {
  11504. // "description": "The preferred language to use for strings returned by this method.",
  11505. // "location": "query",
  11506. // "type": "string"
  11507. // },
  11508. // "matchId": {
  11509. // "description": "The ID of the match.",
  11510. // "location": "path",
  11511. // "required": true,
  11512. // "type": "string"
  11513. // },
  11514. // "requestId": {
  11515. // "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.",
  11516. // "format": "int64",
  11517. // "location": "query",
  11518. // "type": "string"
  11519. // }
  11520. // },
  11521. // "path": "turnbasedmatches/{matchId}/rematch",
  11522. // "response": {
  11523. // "$ref": "TurnBasedMatchRematch"
  11524. // },
  11525. // "scopes": [
  11526. // "https://www.googleapis.com/auth/games",
  11527. // "https://www.googleapis.com/auth/plus.login"
  11528. // ]
  11529. // }
  11530. }
  11531. // method id "games.turnBasedMatches.sync":
  11532. type TurnBasedMatchesSyncCall struct {
  11533. s *Service
  11534. urlParams_ gensupport.URLParams
  11535. ifNoneMatch_ string
  11536. ctx_ context.Context
  11537. header_ http.Header
  11538. }
  11539. // Sync: Returns turn-based matches the player is or was involved in
  11540. // that changed since the last sync call, with the least recent changes
  11541. // coming first. Matches that should be removed from the local cache
  11542. // will have a status of MATCH_DELETED.
  11543. func (r *TurnBasedMatchesService) Sync() *TurnBasedMatchesSyncCall {
  11544. c := &TurnBasedMatchesSyncCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11545. return c
  11546. }
  11547. // IncludeMatchData sets the optional parameter "includeMatchData": True
  11548. // if match data should be returned in the response. Note that not all
  11549. // data will necessarily be returned if include_match_data is true; the
  11550. // server may decide to only return data for some of the matches to
  11551. // limit download size for the client. The remainder of the data for
  11552. // these matches will be retrievable on request.
  11553. func (c *TurnBasedMatchesSyncCall) IncludeMatchData(includeMatchData bool) *TurnBasedMatchesSyncCall {
  11554. c.urlParams_.Set("includeMatchData", fmt.Sprint(includeMatchData))
  11555. return c
  11556. }
  11557. // Language sets the optional parameter "language": The preferred
  11558. // language to use for strings returned by this method.
  11559. func (c *TurnBasedMatchesSyncCall) Language(language string) *TurnBasedMatchesSyncCall {
  11560. c.urlParams_.Set("language", language)
  11561. return c
  11562. }
  11563. // MaxCompletedMatches sets the optional parameter
  11564. // "maxCompletedMatches": The maximum number of completed or canceled
  11565. // matches to return in the response. If not set, all matches returned
  11566. // could be completed or canceled.
  11567. func (c *TurnBasedMatchesSyncCall) MaxCompletedMatches(maxCompletedMatches int64) *TurnBasedMatchesSyncCall {
  11568. c.urlParams_.Set("maxCompletedMatches", fmt.Sprint(maxCompletedMatches))
  11569. return c
  11570. }
  11571. // MaxResults sets the optional parameter "maxResults": The maximum
  11572. // number of matches to return in the response, used for paging. For any
  11573. // response, the actual number of matches to return may be less than the
  11574. // specified maxResults.
  11575. func (c *TurnBasedMatchesSyncCall) MaxResults(maxResults int64) *TurnBasedMatchesSyncCall {
  11576. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11577. return c
  11578. }
  11579. // PageToken sets the optional parameter "pageToken": The token returned
  11580. // by the previous request.
  11581. func (c *TurnBasedMatchesSyncCall) PageToken(pageToken string) *TurnBasedMatchesSyncCall {
  11582. c.urlParams_.Set("pageToken", pageToken)
  11583. return c
  11584. }
  11585. // Fields allows partial responses to be retrieved. See
  11586. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11587. // for more information.
  11588. func (c *TurnBasedMatchesSyncCall) Fields(s ...googleapi.Field) *TurnBasedMatchesSyncCall {
  11589. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11590. return c
  11591. }
  11592. // IfNoneMatch sets the optional parameter which makes the operation
  11593. // fail if the object's ETag matches the given value. This is useful for
  11594. // getting updates only after the object has changed since the last
  11595. // request. Use googleapi.IsNotModified to check whether the response
  11596. // error from Do is the result of In-None-Match.
  11597. func (c *TurnBasedMatchesSyncCall) IfNoneMatch(entityTag string) *TurnBasedMatchesSyncCall {
  11598. c.ifNoneMatch_ = entityTag
  11599. return c
  11600. }
  11601. // Context sets the context to be used in this call's Do method. Any
  11602. // pending HTTP request will be aborted if the provided context is
  11603. // canceled.
  11604. func (c *TurnBasedMatchesSyncCall) Context(ctx context.Context) *TurnBasedMatchesSyncCall {
  11605. c.ctx_ = ctx
  11606. return c
  11607. }
  11608. // Header returns an http.Header that can be modified by the caller to
  11609. // add HTTP headers to the request.
  11610. func (c *TurnBasedMatchesSyncCall) Header() http.Header {
  11611. if c.header_ == nil {
  11612. c.header_ = make(http.Header)
  11613. }
  11614. return c.header_
  11615. }
  11616. func (c *TurnBasedMatchesSyncCall) doRequest(alt string) (*http.Response, error) {
  11617. reqHeaders := make(http.Header)
  11618. for k, v := range c.header_ {
  11619. reqHeaders[k] = v
  11620. }
  11621. reqHeaders.Set("User-Agent", c.s.userAgent())
  11622. if c.ifNoneMatch_ != "" {
  11623. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11624. }
  11625. var body io.Reader = nil
  11626. c.urlParams_.Set("alt", alt)
  11627. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/sync")
  11628. urls += "?" + c.urlParams_.Encode()
  11629. req, _ := http.NewRequest("GET", urls, body)
  11630. req.Header = reqHeaders
  11631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11632. }
  11633. // Do executes the "games.turnBasedMatches.sync" call.
  11634. // Exactly one of *TurnBasedMatchSync or error will be non-nil. Any
  11635. // non-2xx status code is an error. Response headers are in either
  11636. // *TurnBasedMatchSync.ServerResponse.Header or (if a response was
  11637. // returned at all) in error.(*googleapi.Error).Header. Use
  11638. // googleapi.IsNotModified to check whether the returned error was
  11639. // because http.StatusNotModified was returned.
  11640. func (c *TurnBasedMatchesSyncCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatchSync, error) {
  11641. gensupport.SetOptions(c.urlParams_, opts...)
  11642. res, err := c.doRequest("json")
  11643. if res != nil && res.StatusCode == http.StatusNotModified {
  11644. if res.Body != nil {
  11645. res.Body.Close()
  11646. }
  11647. return nil, &googleapi.Error{
  11648. Code: res.StatusCode,
  11649. Header: res.Header,
  11650. }
  11651. }
  11652. if err != nil {
  11653. return nil, err
  11654. }
  11655. defer googleapi.CloseBody(res)
  11656. if err := googleapi.CheckResponse(res); err != nil {
  11657. return nil, err
  11658. }
  11659. ret := &TurnBasedMatchSync{
  11660. ServerResponse: googleapi.ServerResponse{
  11661. Header: res.Header,
  11662. HTTPStatusCode: res.StatusCode,
  11663. },
  11664. }
  11665. target := &ret
  11666. if err := gensupport.DecodeResponse(target, res); err != nil {
  11667. return nil, err
  11668. }
  11669. return ret, nil
  11670. // {
  11671. // "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.",
  11672. // "httpMethod": "GET",
  11673. // "id": "games.turnBasedMatches.sync",
  11674. // "parameters": {
  11675. // "includeMatchData": {
  11676. // "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.",
  11677. // "location": "query",
  11678. // "type": "boolean"
  11679. // },
  11680. // "language": {
  11681. // "description": "The preferred language to use for strings returned by this method.",
  11682. // "location": "query",
  11683. // "type": "string"
  11684. // },
  11685. // "maxCompletedMatches": {
  11686. // "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.",
  11687. // "format": "int32",
  11688. // "location": "query",
  11689. // "maximum": "500",
  11690. // "minimum": "0",
  11691. // "type": "integer"
  11692. // },
  11693. // "maxResults": {
  11694. // "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.",
  11695. // "format": "int32",
  11696. // "location": "query",
  11697. // "maximum": "500",
  11698. // "minimum": "1",
  11699. // "type": "integer"
  11700. // },
  11701. // "pageToken": {
  11702. // "description": "The token returned by the previous request.",
  11703. // "location": "query",
  11704. // "type": "string"
  11705. // }
  11706. // },
  11707. // "path": "turnbasedmatches/sync",
  11708. // "response": {
  11709. // "$ref": "TurnBasedMatchSync"
  11710. // },
  11711. // "scopes": [
  11712. // "https://www.googleapis.com/auth/games",
  11713. // "https://www.googleapis.com/auth/plus.login"
  11714. // ]
  11715. // }
  11716. }
  11717. // Pages invokes f for each page of results.
  11718. // A non-nil error returned from f will halt the iteration.
  11719. // The provided context supersedes any context provided to the Context method.
  11720. func (c *TurnBasedMatchesSyncCall) Pages(ctx context.Context, f func(*TurnBasedMatchSync) error) error {
  11721. c.ctx_ = ctx
  11722. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11723. for {
  11724. x, err := c.Do()
  11725. if err != nil {
  11726. return err
  11727. }
  11728. if err := f(x); err != nil {
  11729. return err
  11730. }
  11731. if x.NextPageToken == "" {
  11732. return nil
  11733. }
  11734. c.PageToken(x.NextPageToken)
  11735. }
  11736. }
  11737. // method id "games.turnBasedMatches.takeTurn":
  11738. type TurnBasedMatchesTakeTurnCall struct {
  11739. s *Service
  11740. matchId string
  11741. turnbasedmatchturn *TurnBasedMatchTurn
  11742. urlParams_ gensupport.URLParams
  11743. ctx_ context.Context
  11744. header_ http.Header
  11745. }
  11746. // TakeTurn: Commit the results of a player turn.
  11747. func (r *TurnBasedMatchesService) TakeTurn(matchId string, turnbasedmatchturn *TurnBasedMatchTurn) *TurnBasedMatchesTakeTurnCall {
  11748. c := &TurnBasedMatchesTakeTurnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11749. c.matchId = matchId
  11750. c.turnbasedmatchturn = turnbasedmatchturn
  11751. return c
  11752. }
  11753. // Language sets the optional parameter "language": The preferred
  11754. // language to use for strings returned by this method.
  11755. func (c *TurnBasedMatchesTakeTurnCall) Language(language string) *TurnBasedMatchesTakeTurnCall {
  11756. c.urlParams_.Set("language", language)
  11757. return c
  11758. }
  11759. // Fields allows partial responses to be retrieved. See
  11760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11761. // for more information.
  11762. func (c *TurnBasedMatchesTakeTurnCall) Fields(s ...googleapi.Field) *TurnBasedMatchesTakeTurnCall {
  11763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11764. return c
  11765. }
  11766. // Context sets the context to be used in this call's Do method. Any
  11767. // pending HTTP request will be aborted if the provided context is
  11768. // canceled.
  11769. func (c *TurnBasedMatchesTakeTurnCall) Context(ctx context.Context) *TurnBasedMatchesTakeTurnCall {
  11770. c.ctx_ = ctx
  11771. return c
  11772. }
  11773. // Header returns an http.Header that can be modified by the caller to
  11774. // add HTTP headers to the request.
  11775. func (c *TurnBasedMatchesTakeTurnCall) Header() http.Header {
  11776. if c.header_ == nil {
  11777. c.header_ = make(http.Header)
  11778. }
  11779. return c.header_
  11780. }
  11781. func (c *TurnBasedMatchesTakeTurnCall) doRequest(alt string) (*http.Response, error) {
  11782. reqHeaders := make(http.Header)
  11783. for k, v := range c.header_ {
  11784. reqHeaders[k] = v
  11785. }
  11786. reqHeaders.Set("User-Agent", c.s.userAgent())
  11787. var body io.Reader = nil
  11788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.turnbasedmatchturn)
  11789. if err != nil {
  11790. return nil, err
  11791. }
  11792. reqHeaders.Set("Content-Type", "application/json")
  11793. c.urlParams_.Set("alt", alt)
  11794. urls := googleapi.ResolveRelative(c.s.BasePath, "turnbasedmatches/{matchId}/turn")
  11795. urls += "?" + c.urlParams_.Encode()
  11796. req, _ := http.NewRequest("PUT", urls, body)
  11797. req.Header = reqHeaders
  11798. googleapi.Expand(req.URL, map[string]string{
  11799. "matchId": c.matchId,
  11800. })
  11801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11802. }
  11803. // Do executes the "games.turnBasedMatches.takeTurn" call.
  11804. // Exactly one of *TurnBasedMatch or error will be non-nil. Any non-2xx
  11805. // status code is an error. Response headers are in either
  11806. // *TurnBasedMatch.ServerResponse.Header or (if a response was returned
  11807. // at all) in error.(*googleapi.Error).Header. Use
  11808. // googleapi.IsNotModified to check whether the returned error was
  11809. // because http.StatusNotModified was returned.
  11810. func (c *TurnBasedMatchesTakeTurnCall) Do(opts ...googleapi.CallOption) (*TurnBasedMatch, error) {
  11811. gensupport.SetOptions(c.urlParams_, opts...)
  11812. res, err := c.doRequest("json")
  11813. if res != nil && res.StatusCode == http.StatusNotModified {
  11814. if res.Body != nil {
  11815. res.Body.Close()
  11816. }
  11817. return nil, &googleapi.Error{
  11818. Code: res.StatusCode,
  11819. Header: res.Header,
  11820. }
  11821. }
  11822. if err != nil {
  11823. return nil, err
  11824. }
  11825. defer googleapi.CloseBody(res)
  11826. if err := googleapi.CheckResponse(res); err != nil {
  11827. return nil, err
  11828. }
  11829. ret := &TurnBasedMatch{
  11830. ServerResponse: googleapi.ServerResponse{
  11831. Header: res.Header,
  11832. HTTPStatusCode: res.StatusCode,
  11833. },
  11834. }
  11835. target := &ret
  11836. if err := gensupport.DecodeResponse(target, res); err != nil {
  11837. return nil, err
  11838. }
  11839. return ret, nil
  11840. // {
  11841. // "description": "Commit the results of a player turn.",
  11842. // "httpMethod": "PUT",
  11843. // "id": "games.turnBasedMatches.takeTurn",
  11844. // "parameterOrder": [
  11845. // "matchId"
  11846. // ],
  11847. // "parameters": {
  11848. // "language": {
  11849. // "description": "The preferred language to use for strings returned by this method.",
  11850. // "location": "query",
  11851. // "type": "string"
  11852. // },
  11853. // "matchId": {
  11854. // "description": "The ID of the match.",
  11855. // "location": "path",
  11856. // "required": true,
  11857. // "type": "string"
  11858. // }
  11859. // },
  11860. // "path": "turnbasedmatches/{matchId}/turn",
  11861. // "request": {
  11862. // "$ref": "TurnBasedMatchTurn"
  11863. // },
  11864. // "response": {
  11865. // "$ref": "TurnBasedMatch"
  11866. // },
  11867. // "scopes": [
  11868. // "https://www.googleapis.com/auth/games",
  11869. // "https://www.googleapis.com/auth/plus.login"
  11870. // ]
  11871. // }
  11872. }