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

2596 lines
89 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package gamesconfiguration provides access to the Google Play Game Services Publishing API.
  6. //
  7. // For product documentation, see: https://developers.google.com/games/services
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/gamesconfiguration/v1configuration"
  14. // ...
  15. // ctx := context.Background()
  16. // gamesconfigurationService, err := gamesconfiguration.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // gamesconfigurationService, err := gamesconfiguration.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // gamesconfigurationService, err := gamesconfiguration.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package gamesconfiguration // import "google.golang.org/api/gamesconfiguration/v1configuration"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "gamesConfiguration:v1configuration"
  67. const apiName = "gamesConfiguration"
  68. const apiVersion = "v1configuration"
  69. const basePath = "https://www.googleapis.com/games/v1configuration/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your Google Play Developer account
  73. AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/androidpublisher",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.AchievementConfigurations = NewAchievementConfigurationsService(s)
  106. s.ImageConfigurations = NewImageConfigurationsService(s)
  107. s.LeaderboardConfigurations = NewLeaderboardConfigurationsService(s)
  108. return s, nil
  109. }
  110. type Service struct {
  111. client *http.Client
  112. BasePath string // API endpoint base URL
  113. UserAgent string // optional additional User-Agent fragment
  114. AchievementConfigurations *AchievementConfigurationsService
  115. ImageConfigurations *ImageConfigurationsService
  116. LeaderboardConfigurations *LeaderboardConfigurationsService
  117. }
  118. func (s *Service) userAgent() string {
  119. if s.UserAgent == "" {
  120. return googleapi.UserAgent
  121. }
  122. return googleapi.UserAgent + " " + s.UserAgent
  123. }
  124. func NewAchievementConfigurationsService(s *Service) *AchievementConfigurationsService {
  125. rs := &AchievementConfigurationsService{s: s}
  126. return rs
  127. }
  128. type AchievementConfigurationsService struct {
  129. s *Service
  130. }
  131. func NewImageConfigurationsService(s *Service) *ImageConfigurationsService {
  132. rs := &ImageConfigurationsService{s: s}
  133. return rs
  134. }
  135. type ImageConfigurationsService struct {
  136. s *Service
  137. }
  138. func NewLeaderboardConfigurationsService(s *Service) *LeaderboardConfigurationsService {
  139. rs := &LeaderboardConfigurationsService{s: s}
  140. return rs
  141. }
  142. type LeaderboardConfigurationsService struct {
  143. s *Service
  144. }
  145. // AchievementConfiguration: This is a JSON template for an achievement
  146. // configuration resource.
  147. type AchievementConfiguration struct {
  148. // AchievementType: The type of the achievement.
  149. // Possible values are:
  150. // - "STANDARD" - Achievement is either locked or unlocked.
  151. // - "INCREMENTAL" - Achievement is incremental.
  152. AchievementType string `json:"achievementType,omitempty"`
  153. // Draft: The draft data of the achievement.
  154. Draft *AchievementConfigurationDetail `json:"draft,omitempty"`
  155. // Id: The ID of the achievement.
  156. Id string `json:"id,omitempty"`
  157. // InitialState: The initial state of the achievement.
  158. // Possible values are:
  159. // - "HIDDEN" - Achievement is hidden.
  160. // - "REVEALED" - Achievement is revealed.
  161. // - "UNLOCKED" - Achievement is unlocked.
  162. InitialState string `json:"initialState,omitempty"`
  163. // Kind: Uniquely identifies the type of this resource. Value is always
  164. // the fixed string gamesConfiguration#achievementConfiguration.
  165. Kind string `json:"kind,omitempty"`
  166. // Published: The read-only published data of the achievement.
  167. Published *AchievementConfigurationDetail `json:"published,omitempty"`
  168. // StepsToUnlock: Steps to unlock. Only applicable to incremental
  169. // achievements.
  170. StepsToUnlock int64 `json:"stepsToUnlock,omitempty"`
  171. // Token: The token for this resource.
  172. Token string `json:"token,omitempty"`
  173. // ServerResponse contains the HTTP response code and headers from the
  174. // server.
  175. googleapi.ServerResponse `json:"-"`
  176. // ForceSendFields is a list of field names (e.g. "AchievementType") to
  177. // unconditionally include in API requests. By default, fields with
  178. // empty values are omitted from API requests. However, any non-pointer,
  179. // non-interface field appearing in ForceSendFields will be sent to the
  180. // server regardless of whether the field is empty or not. This may be
  181. // used to include empty fields in Patch requests.
  182. ForceSendFields []string `json:"-"`
  183. // NullFields is a list of field names (e.g. "AchievementType") to
  184. // include in API requests with the JSON null value. By default, fields
  185. // with empty values are omitted from API requests. However, any field
  186. // with an empty value appearing in NullFields will be sent to the
  187. // server as null. It is an error if a field in this list has a
  188. // non-empty value. This may be used to include null fields in Patch
  189. // requests.
  190. NullFields []string `json:"-"`
  191. }
  192. func (s *AchievementConfiguration) MarshalJSON() ([]byte, error) {
  193. type NoMethod AchievementConfiguration
  194. raw := NoMethod(*s)
  195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  196. }
  197. // AchievementConfigurationDetail: This is a JSON template for an
  198. // achievement configuration detail.
  199. type AchievementConfigurationDetail struct {
  200. // Description: Localized strings for the achievement description.
  201. Description *LocalizedStringBundle `json:"description,omitempty"`
  202. // IconUrl: The icon url of this achievement. Writes to this field are
  203. // ignored.
  204. IconUrl string `json:"iconUrl,omitempty"`
  205. // Kind: Uniquely identifies the type of this resource. Value is always
  206. // the fixed string gamesConfiguration#achievementConfigurationDetail.
  207. Kind string `json:"kind,omitempty"`
  208. // Name: Localized strings for the achievement name.
  209. Name *LocalizedStringBundle `json:"name,omitempty"`
  210. // PointValue: Point value for the achievement.
  211. PointValue int64 `json:"pointValue,omitempty"`
  212. // SortRank: The sort rank of this achievement. Writes to this field are
  213. // ignored.
  214. SortRank int64 `json:"sortRank,omitempty"`
  215. // ForceSendFields is a list of field names (e.g. "Description") to
  216. // unconditionally include in API requests. By default, fields with
  217. // empty values are omitted from API requests. However, any non-pointer,
  218. // non-interface field appearing in ForceSendFields will be sent to the
  219. // server regardless of whether the field is empty or not. This may be
  220. // used to include empty fields in Patch requests.
  221. ForceSendFields []string `json:"-"`
  222. // NullFields is a list of field names (e.g. "Description") to include
  223. // in API requests with the JSON null value. By default, fields with
  224. // empty values are omitted from API requests. However, any field with
  225. // an empty value appearing in NullFields will be sent to the server as
  226. // null. It is an error if a field in this list has a non-empty value.
  227. // This may be used to include null fields in Patch requests.
  228. NullFields []string `json:"-"`
  229. }
  230. func (s *AchievementConfigurationDetail) MarshalJSON() ([]byte, error) {
  231. type NoMethod AchievementConfigurationDetail
  232. raw := NoMethod(*s)
  233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  234. }
  235. // AchievementConfigurationListResponse: This is a JSON template for a
  236. // ListConfigurations response.
  237. type AchievementConfigurationListResponse struct {
  238. // Items: The achievement configurations.
  239. Items []*AchievementConfiguration `json:"items,omitempty"`
  240. // Kind: Uniquely identifies the type of this resource. Value is always
  241. // the fixed string games#achievementConfigurationListResponse.
  242. Kind string `json:"kind,omitempty"`
  243. // NextPageToken: The pagination token for the next page of results.
  244. NextPageToken string `json:"nextPageToken,omitempty"`
  245. // ServerResponse contains the HTTP response code and headers from the
  246. // server.
  247. googleapi.ServerResponse `json:"-"`
  248. // ForceSendFields is a list of field names (e.g. "Items") 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. "Items") to include in API
  256. // requests with the JSON null value. By default, fields with empty
  257. // values are omitted from API requests. However, any field with an
  258. // empty value appearing in NullFields will be sent to the server as
  259. // null. It is an error if a field in this list has a non-empty value.
  260. // This may be used to include null fields in Patch requests.
  261. NullFields []string `json:"-"`
  262. }
  263. func (s *AchievementConfigurationListResponse) MarshalJSON() ([]byte, error) {
  264. type NoMethod AchievementConfigurationListResponse
  265. raw := NoMethod(*s)
  266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  267. }
  268. // GamesNumberAffixConfiguration: This is a JSON template for a number
  269. // affix resource.
  270. type GamesNumberAffixConfiguration struct {
  271. // Few: When the language requires special treatment of "small" numbers
  272. // (as with 2, 3, and 4 in Czech; or numbers ending 2, 3, or 4 but not
  273. // 12, 13, or 14 in Polish).
  274. Few *LocalizedStringBundle `json:"few,omitempty"`
  275. // Many: When the language requires special treatment of "large" numbers
  276. // (as with numbers ending 11-99 in Maltese).
  277. Many *LocalizedStringBundle `json:"many,omitempty"`
  278. // One: When the language requires special treatment of numbers like one
  279. // (as with the number 1 in English and most other languages; in
  280. // Russian, any number ending in 1 but not ending in 11 is in this
  281. // class).
  282. One *LocalizedStringBundle `json:"one,omitempty"`
  283. // Other: When the language does not require special treatment of the
  284. // given quantity (as with all numbers in Chinese, or 42 in English).
  285. Other *LocalizedStringBundle `json:"other,omitempty"`
  286. // Two: When the language requires special treatment of numbers like two
  287. // (as with 2 in Welsh, or 102 in Slovenian).
  288. Two *LocalizedStringBundle `json:"two,omitempty"`
  289. // Zero: When the language requires special treatment of the number 0
  290. // (as in Arabic).
  291. Zero *LocalizedStringBundle `json:"zero,omitempty"`
  292. // ForceSendFields is a list of field names (e.g. "Few") to
  293. // unconditionally include in API requests. By default, fields with
  294. // empty values are omitted from API requests. However, any non-pointer,
  295. // non-interface field appearing in ForceSendFields will be sent to the
  296. // server regardless of whether the field is empty or not. This may be
  297. // used to include empty fields in Patch requests.
  298. ForceSendFields []string `json:"-"`
  299. // NullFields is a list of field names (e.g. "Few") to include in API
  300. // requests with the JSON null value. By default, fields with empty
  301. // values are omitted from API requests. However, any field with an
  302. // empty value appearing in NullFields will be sent to the server as
  303. // null. It is an error if a field in this list has a non-empty value.
  304. // This may be used to include null fields in Patch requests.
  305. NullFields []string `json:"-"`
  306. }
  307. func (s *GamesNumberAffixConfiguration) MarshalJSON() ([]byte, error) {
  308. type NoMethod GamesNumberAffixConfiguration
  309. raw := NoMethod(*s)
  310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  311. }
  312. // GamesNumberFormatConfiguration: This is a JSON template for a number
  313. // format resource.
  314. type GamesNumberFormatConfiguration struct {
  315. // CurrencyCode: The curreny code string. Only used for CURRENCY format
  316. // type.
  317. CurrencyCode string `json:"currencyCode,omitempty"`
  318. // NumDecimalPlaces: The number of decimal places for number. Only used
  319. // for NUMERIC format type.
  320. NumDecimalPlaces int64 `json:"numDecimalPlaces,omitempty"`
  321. // NumberFormatType: The formatting for the number.
  322. // Possible values are:
  323. // - "NUMERIC" - Numbers are formatted to have no digits or a fixed
  324. // number of digits after the decimal point according to locale. An
  325. // optional custom unit can be added.
  326. // - "TIME_DURATION" - Numbers are formatted to hours, minutes and
  327. // seconds.
  328. // - "CURRENCY" - Numbers are formatted to currency according to locale.
  329. NumberFormatType string `json:"numberFormatType,omitempty"`
  330. // Suffix: An optional suffix for the NUMERIC format type. These strings
  331. // follow the same plural rules as all Android string resources.
  332. Suffix *GamesNumberAffixConfiguration `json:"suffix,omitempty"`
  333. // ForceSendFields is a list of field names (e.g. "CurrencyCode") to
  334. // unconditionally include in API requests. By default, fields with
  335. // empty values are omitted from API requests. However, any non-pointer,
  336. // non-interface field appearing in ForceSendFields will be sent to the
  337. // server regardless of whether the field is empty or not. This may be
  338. // used to include empty fields in Patch requests.
  339. ForceSendFields []string `json:"-"`
  340. // NullFields is a list of field names (e.g. "CurrencyCode") to include
  341. // in API requests with the JSON null value. By default, fields with
  342. // empty values are omitted from API requests. However, any field with
  343. // an empty value appearing in NullFields will be sent to the server as
  344. // null. It is an error if a field in this list has a non-empty value.
  345. // This may be used to include null fields in Patch requests.
  346. NullFields []string `json:"-"`
  347. }
  348. func (s *GamesNumberFormatConfiguration) MarshalJSON() ([]byte, error) {
  349. type NoMethod GamesNumberFormatConfiguration
  350. raw := NoMethod(*s)
  351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  352. }
  353. // ImageConfiguration: This is a JSON template for an image
  354. // configuration resource.
  355. type ImageConfiguration struct {
  356. // ImageType: The image type for the image.
  357. ImageType string `json:"imageType,omitempty"`
  358. // Kind: Uniquely identifies the type of this resource. Value is always
  359. // the fixed string gamesConfiguration#imageConfiguration.
  360. Kind string `json:"kind,omitempty"`
  361. // ResourceId: The resource ID of resource which the image belongs to.
  362. ResourceId string `json:"resourceId,omitempty"`
  363. // Url: The url for this image.
  364. Url string `json:"url,omitempty"`
  365. // ServerResponse contains the HTTP response code and headers from the
  366. // server.
  367. googleapi.ServerResponse `json:"-"`
  368. // ForceSendFields is a list of field names (e.g. "ImageType") to
  369. // unconditionally include in API requests. By default, fields with
  370. // empty values are omitted from API requests. However, any non-pointer,
  371. // non-interface field appearing in ForceSendFields will be sent to the
  372. // server regardless of whether the field is empty or not. This may be
  373. // used to include empty fields in Patch requests.
  374. ForceSendFields []string `json:"-"`
  375. // NullFields is a list of field names (e.g. "ImageType") to include in
  376. // API requests with the JSON null value. By default, fields with empty
  377. // values are omitted from API requests. However, any field with an
  378. // empty value appearing in NullFields will be sent to the server as
  379. // null. It is an error if a field in this list has a non-empty value.
  380. // This may be used to include null fields in Patch requests.
  381. NullFields []string `json:"-"`
  382. }
  383. func (s *ImageConfiguration) MarshalJSON() ([]byte, error) {
  384. type NoMethod ImageConfiguration
  385. raw := NoMethod(*s)
  386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  387. }
  388. // LeaderboardConfiguration: This is a JSON template for an leaderboard
  389. // configuration resource.
  390. type LeaderboardConfiguration struct {
  391. // Draft: The draft data of the leaderboard.
  392. Draft *LeaderboardConfigurationDetail `json:"draft,omitempty"`
  393. // Id: The ID of the leaderboard.
  394. Id string `json:"id,omitempty"`
  395. // Kind: Uniquely identifies the type of this resource. Value is always
  396. // the fixed string gamesConfiguration#leaderboardConfiguration.
  397. Kind string `json:"kind,omitempty"`
  398. // Published: The read-only published data of the leaderboard.
  399. Published *LeaderboardConfigurationDetail `json:"published,omitempty"`
  400. // ScoreMax: Maximum score that can be posted to this leaderboard.
  401. ScoreMax int64 `json:"scoreMax,omitempty,string"`
  402. // ScoreMin: Minimum score that can be posted to this leaderboard.
  403. ScoreMin int64 `json:"scoreMin,omitempty,string"`
  404. // ScoreOrder: The type of the leaderboard.
  405. // Possible values are:
  406. // - "LARGER_IS_BETTER" - Larger scores posted are ranked higher.
  407. // - "SMALLER_IS_BETTER" - Smaller scores posted are ranked higher.
  408. ScoreOrder string `json:"scoreOrder,omitempty"`
  409. // Token: The token for this resource.
  410. Token string `json:"token,omitempty"`
  411. // ServerResponse contains the HTTP response code and headers from the
  412. // server.
  413. googleapi.ServerResponse `json:"-"`
  414. // ForceSendFields is a list of field names (e.g. "Draft") to
  415. // unconditionally include in API requests. By default, fields with
  416. // empty values are omitted from API requests. However, any non-pointer,
  417. // non-interface field appearing in ForceSendFields will be sent to the
  418. // server regardless of whether the field is empty or not. This may be
  419. // used to include empty fields in Patch requests.
  420. ForceSendFields []string `json:"-"`
  421. // NullFields is a list of field names (e.g. "Draft") to include in API
  422. // requests with the JSON null value. By default, fields with empty
  423. // values are omitted from API requests. However, any field with an
  424. // empty value appearing in NullFields will be sent to the server as
  425. // null. It is an error if a field in this list has a non-empty value.
  426. // This may be used to include null fields in Patch requests.
  427. NullFields []string `json:"-"`
  428. }
  429. func (s *LeaderboardConfiguration) MarshalJSON() ([]byte, error) {
  430. type NoMethod LeaderboardConfiguration
  431. raw := NoMethod(*s)
  432. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  433. }
  434. // LeaderboardConfigurationDetail: This is a JSON template for a
  435. // leaderboard configuration detail.
  436. type LeaderboardConfigurationDetail struct {
  437. // IconUrl: The icon url of this leaderboard. Writes to this field are
  438. // ignored.
  439. IconUrl string `json:"iconUrl,omitempty"`
  440. // Kind: Uniquely identifies the type of this resource. Value is always
  441. // the fixed string gamesConfiguration#leaderboardConfigurationDetail.
  442. Kind string `json:"kind,omitempty"`
  443. // Name: Localized strings for the leaderboard name.
  444. Name *LocalizedStringBundle `json:"name,omitempty"`
  445. // ScoreFormat: The score formatting for the leaderboard.
  446. ScoreFormat *GamesNumberFormatConfiguration `json:"scoreFormat,omitempty"`
  447. // SortRank: The sort rank of this leaderboard. Writes to this field are
  448. // ignored.
  449. SortRank int64 `json:"sortRank,omitempty"`
  450. // ForceSendFields is a list of field names (e.g. "IconUrl") to
  451. // unconditionally include in API requests. By default, fields with
  452. // empty values are omitted from API requests. However, any non-pointer,
  453. // non-interface field appearing in ForceSendFields will be sent to the
  454. // server regardless of whether the field is empty or not. This may be
  455. // used to include empty fields in Patch requests.
  456. ForceSendFields []string `json:"-"`
  457. // NullFields is a list of field names (e.g. "IconUrl") to include in
  458. // API requests with the JSON null value. By default, fields with empty
  459. // values are omitted from API requests. However, any field with an
  460. // empty value appearing in NullFields will be sent to the server as
  461. // null. It is an error if a field in this list has a non-empty value.
  462. // This may be used to include null fields in Patch requests.
  463. NullFields []string `json:"-"`
  464. }
  465. func (s *LeaderboardConfigurationDetail) MarshalJSON() ([]byte, error) {
  466. type NoMethod LeaderboardConfigurationDetail
  467. raw := NoMethod(*s)
  468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  469. }
  470. // LeaderboardConfigurationListResponse: This is a JSON template for a
  471. // ListConfigurations response.
  472. type LeaderboardConfigurationListResponse struct {
  473. // Items: The leaderboard configurations.
  474. Items []*LeaderboardConfiguration `json:"items,omitempty"`
  475. // Kind: Uniquely identifies the type of this resource. Value is always
  476. // the fixed string games#leaderboardConfigurationListResponse.
  477. Kind string `json:"kind,omitempty"`
  478. // NextPageToken: The pagination token for the next page of results.
  479. NextPageToken string `json:"nextPageToken,omitempty"`
  480. // ServerResponse contains the HTTP response code and headers from the
  481. // server.
  482. googleapi.ServerResponse `json:"-"`
  483. // ForceSendFields is a list of field names (e.g. "Items") to
  484. // unconditionally include in API requests. By default, fields with
  485. // empty values are omitted from API requests. However, any non-pointer,
  486. // non-interface field appearing in ForceSendFields will be sent to the
  487. // server regardless of whether the field is empty or not. This may be
  488. // used to include empty fields in Patch requests.
  489. ForceSendFields []string `json:"-"`
  490. // NullFields is a list of field names (e.g. "Items") to include in API
  491. // requests with the JSON null value. By default, fields with empty
  492. // values are omitted from API requests. However, any field with an
  493. // empty value appearing in NullFields will be sent to the server as
  494. // null. It is an error if a field in this list has a non-empty value.
  495. // This may be used to include null fields in Patch requests.
  496. NullFields []string `json:"-"`
  497. }
  498. func (s *LeaderboardConfigurationListResponse) MarshalJSON() ([]byte, error) {
  499. type NoMethod LeaderboardConfigurationListResponse
  500. raw := NoMethod(*s)
  501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  502. }
  503. // LocalizedString: This is a JSON template for a localized string
  504. // resource.
  505. type LocalizedString struct {
  506. // Kind: Uniquely identifies the type of this resource. Value is always
  507. // the fixed string gamesConfiguration#localizedString.
  508. Kind string `json:"kind,omitempty"`
  509. // Locale: The locale string.
  510. Locale string `json:"locale,omitempty"`
  511. // Value: The string value.
  512. Value string `json:"value,omitempty"`
  513. // ForceSendFields is a list of field names (e.g. "Kind") to
  514. // unconditionally include in API requests. By default, fields with
  515. // empty values are omitted from API requests. However, any non-pointer,
  516. // non-interface field appearing in ForceSendFields will be sent to the
  517. // server regardless of whether the field is empty or not. This may be
  518. // used to include empty fields in Patch requests.
  519. ForceSendFields []string `json:"-"`
  520. // NullFields is a list of field names (e.g. "Kind") to include in API
  521. // requests with the JSON null value. By default, fields with empty
  522. // values are omitted from API requests. However, any field with an
  523. // empty value appearing in NullFields will be sent to the server as
  524. // null. It is an error if a field in this list has a non-empty value.
  525. // This may be used to include null fields in Patch requests.
  526. NullFields []string `json:"-"`
  527. }
  528. func (s *LocalizedString) MarshalJSON() ([]byte, error) {
  529. type NoMethod LocalizedString
  530. raw := NoMethod(*s)
  531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  532. }
  533. // LocalizedStringBundle: This is a JSON template for a localized string
  534. // bundle resource.
  535. type LocalizedStringBundle struct {
  536. // Kind: Uniquely identifies the type of this resource. Value is always
  537. // the fixed string gamesConfiguration#localizedStringBundle.
  538. Kind string `json:"kind,omitempty"`
  539. // Translations: The locale strings.
  540. Translations []*LocalizedString `json:"translations,omitempty"`
  541. // ForceSendFields is a list of field names (e.g. "Kind") to
  542. // unconditionally include in API requests. By default, fields with
  543. // empty values are omitted from API requests. However, any non-pointer,
  544. // non-interface field appearing in ForceSendFields will be sent to the
  545. // server regardless of whether the field is empty or not. This may be
  546. // used to include empty fields in Patch requests.
  547. ForceSendFields []string `json:"-"`
  548. // NullFields is a list of field names (e.g. "Kind") to include in API
  549. // requests with the JSON null value. By default, fields with empty
  550. // values are omitted from API requests. However, any field with an
  551. // empty value appearing in NullFields will be sent to the server as
  552. // null. It is an error if a field in this list has a non-empty value.
  553. // This may be used to include null fields in Patch requests.
  554. NullFields []string `json:"-"`
  555. }
  556. func (s *LocalizedStringBundle) MarshalJSON() ([]byte, error) {
  557. type NoMethod LocalizedStringBundle
  558. raw := NoMethod(*s)
  559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  560. }
  561. // method id "gamesConfiguration.achievementConfigurations.delete":
  562. type AchievementConfigurationsDeleteCall struct {
  563. s *Service
  564. achievementId string
  565. urlParams_ gensupport.URLParams
  566. ctx_ context.Context
  567. header_ http.Header
  568. }
  569. // Delete: Delete the achievement configuration with the given ID.
  570. func (r *AchievementConfigurationsService) Delete(achievementId string) *AchievementConfigurationsDeleteCall {
  571. c := &AchievementConfigurationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  572. c.achievementId = achievementId
  573. return c
  574. }
  575. // Fields allows partial responses to be retrieved. See
  576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  577. // for more information.
  578. func (c *AchievementConfigurationsDeleteCall) Fields(s ...googleapi.Field) *AchievementConfigurationsDeleteCall {
  579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  580. return c
  581. }
  582. // Context sets the context to be used in this call's Do method. Any
  583. // pending HTTP request will be aborted if the provided context is
  584. // canceled.
  585. func (c *AchievementConfigurationsDeleteCall) Context(ctx context.Context) *AchievementConfigurationsDeleteCall {
  586. c.ctx_ = ctx
  587. return c
  588. }
  589. // Header returns an http.Header that can be modified by the caller to
  590. // add HTTP headers to the request.
  591. func (c *AchievementConfigurationsDeleteCall) Header() http.Header {
  592. if c.header_ == nil {
  593. c.header_ = make(http.Header)
  594. }
  595. return c.header_
  596. }
  597. func (c *AchievementConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  598. reqHeaders := make(http.Header)
  599. for k, v := range c.header_ {
  600. reqHeaders[k] = v
  601. }
  602. reqHeaders.Set("User-Agent", c.s.userAgent())
  603. var body io.Reader = nil
  604. c.urlParams_.Set("alt", alt)
  605. c.urlParams_.Set("prettyPrint", "false")
  606. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}")
  607. urls += "?" + c.urlParams_.Encode()
  608. req, err := http.NewRequest("DELETE", urls, body)
  609. if err != nil {
  610. return nil, err
  611. }
  612. req.Header = reqHeaders
  613. googleapi.Expand(req.URL, map[string]string{
  614. "achievementId": c.achievementId,
  615. })
  616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  617. }
  618. // Do executes the "gamesConfiguration.achievementConfigurations.delete" call.
  619. func (c *AchievementConfigurationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  620. gensupport.SetOptions(c.urlParams_, opts...)
  621. res, err := c.doRequest("json")
  622. if err != nil {
  623. return err
  624. }
  625. defer googleapi.CloseBody(res)
  626. if err := googleapi.CheckResponse(res); err != nil {
  627. return err
  628. }
  629. return nil
  630. // {
  631. // "description": "Delete the achievement configuration with the given ID.",
  632. // "httpMethod": "DELETE",
  633. // "id": "gamesConfiguration.achievementConfigurations.delete",
  634. // "parameterOrder": [
  635. // "achievementId"
  636. // ],
  637. // "parameters": {
  638. // "achievementId": {
  639. // "description": "The ID of the achievement used by this method.",
  640. // "location": "path",
  641. // "required": true,
  642. // "type": "string"
  643. // }
  644. // },
  645. // "path": "achievements/{achievementId}",
  646. // "scopes": [
  647. // "https://www.googleapis.com/auth/androidpublisher"
  648. // ]
  649. // }
  650. }
  651. // method id "gamesConfiguration.achievementConfigurations.get":
  652. type AchievementConfigurationsGetCall struct {
  653. s *Service
  654. achievementId string
  655. urlParams_ gensupport.URLParams
  656. ifNoneMatch_ string
  657. ctx_ context.Context
  658. header_ http.Header
  659. }
  660. // Get: Retrieves the metadata of the achievement configuration with the
  661. // given ID.
  662. func (r *AchievementConfigurationsService) Get(achievementId string) *AchievementConfigurationsGetCall {
  663. c := &AchievementConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  664. c.achievementId = achievementId
  665. return c
  666. }
  667. // Fields allows partial responses to be retrieved. See
  668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  669. // for more information.
  670. func (c *AchievementConfigurationsGetCall) Fields(s ...googleapi.Field) *AchievementConfigurationsGetCall {
  671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  672. return c
  673. }
  674. // IfNoneMatch sets the optional parameter which makes the operation
  675. // fail if the object's ETag matches the given value. This is useful for
  676. // getting updates only after the object has changed since the last
  677. // request. Use googleapi.IsNotModified to check whether the response
  678. // error from Do is the result of In-None-Match.
  679. func (c *AchievementConfigurationsGetCall) IfNoneMatch(entityTag string) *AchievementConfigurationsGetCall {
  680. c.ifNoneMatch_ = entityTag
  681. return c
  682. }
  683. // Context sets the context to be used in this call's Do method. Any
  684. // pending HTTP request will be aborted if the provided context is
  685. // canceled.
  686. func (c *AchievementConfigurationsGetCall) Context(ctx context.Context) *AchievementConfigurationsGetCall {
  687. c.ctx_ = ctx
  688. return c
  689. }
  690. // Header returns an http.Header that can be modified by the caller to
  691. // add HTTP headers to the request.
  692. func (c *AchievementConfigurationsGetCall) Header() http.Header {
  693. if c.header_ == nil {
  694. c.header_ = make(http.Header)
  695. }
  696. return c.header_
  697. }
  698. func (c *AchievementConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  699. reqHeaders := make(http.Header)
  700. for k, v := range c.header_ {
  701. reqHeaders[k] = v
  702. }
  703. reqHeaders.Set("User-Agent", c.s.userAgent())
  704. if c.ifNoneMatch_ != "" {
  705. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  706. }
  707. var body io.Reader = nil
  708. c.urlParams_.Set("alt", alt)
  709. c.urlParams_.Set("prettyPrint", "false")
  710. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}")
  711. urls += "?" + c.urlParams_.Encode()
  712. req, err := http.NewRequest("GET", urls, body)
  713. if err != nil {
  714. return nil, err
  715. }
  716. req.Header = reqHeaders
  717. googleapi.Expand(req.URL, map[string]string{
  718. "achievementId": c.achievementId,
  719. })
  720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  721. }
  722. // Do executes the "gamesConfiguration.achievementConfigurations.get" call.
  723. // Exactly one of *AchievementConfiguration or error will be non-nil.
  724. // Any non-2xx status code is an error. Response headers are in either
  725. // *AchievementConfiguration.ServerResponse.Header or (if a response was
  726. // returned at all) in error.(*googleapi.Error).Header. Use
  727. // googleapi.IsNotModified to check whether the returned error was
  728. // because http.StatusNotModified was returned.
  729. func (c *AchievementConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
  730. gensupport.SetOptions(c.urlParams_, opts...)
  731. res, err := c.doRequest("json")
  732. if res != nil && res.StatusCode == http.StatusNotModified {
  733. if res.Body != nil {
  734. res.Body.Close()
  735. }
  736. return nil, &googleapi.Error{
  737. Code: res.StatusCode,
  738. Header: res.Header,
  739. }
  740. }
  741. if err != nil {
  742. return nil, err
  743. }
  744. defer googleapi.CloseBody(res)
  745. if err := googleapi.CheckResponse(res); err != nil {
  746. return nil, err
  747. }
  748. ret := &AchievementConfiguration{
  749. ServerResponse: googleapi.ServerResponse{
  750. Header: res.Header,
  751. HTTPStatusCode: res.StatusCode,
  752. },
  753. }
  754. target := &ret
  755. if err := gensupport.DecodeResponse(target, res); err != nil {
  756. return nil, err
  757. }
  758. return ret, nil
  759. // {
  760. // "description": "Retrieves the metadata of the achievement configuration with the given ID.",
  761. // "httpMethod": "GET",
  762. // "id": "gamesConfiguration.achievementConfigurations.get",
  763. // "parameterOrder": [
  764. // "achievementId"
  765. // ],
  766. // "parameters": {
  767. // "achievementId": {
  768. // "description": "The ID of the achievement used by this method.",
  769. // "location": "path",
  770. // "required": true,
  771. // "type": "string"
  772. // }
  773. // },
  774. // "path": "achievements/{achievementId}",
  775. // "response": {
  776. // "$ref": "AchievementConfiguration"
  777. // },
  778. // "scopes": [
  779. // "https://www.googleapis.com/auth/androidpublisher"
  780. // ]
  781. // }
  782. }
  783. // method id "gamesConfiguration.achievementConfigurations.insert":
  784. type AchievementConfigurationsInsertCall struct {
  785. s *Service
  786. applicationId string
  787. achievementconfiguration *AchievementConfiguration
  788. urlParams_ gensupport.URLParams
  789. ctx_ context.Context
  790. header_ http.Header
  791. }
  792. // Insert: Insert a new achievement configuration in this application.
  793. func (r *AchievementConfigurationsService) Insert(applicationId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsInsertCall {
  794. c := &AchievementConfigurationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  795. c.applicationId = applicationId
  796. c.achievementconfiguration = achievementconfiguration
  797. return c
  798. }
  799. // Fields allows partial responses to be retrieved. See
  800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  801. // for more information.
  802. func (c *AchievementConfigurationsInsertCall) Fields(s ...googleapi.Field) *AchievementConfigurationsInsertCall {
  803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  804. return c
  805. }
  806. // Context sets the context to be used in this call's Do method. Any
  807. // pending HTTP request will be aborted if the provided context is
  808. // canceled.
  809. func (c *AchievementConfigurationsInsertCall) Context(ctx context.Context) *AchievementConfigurationsInsertCall {
  810. c.ctx_ = ctx
  811. return c
  812. }
  813. // Header returns an http.Header that can be modified by the caller to
  814. // add HTTP headers to the request.
  815. func (c *AchievementConfigurationsInsertCall) Header() http.Header {
  816. if c.header_ == nil {
  817. c.header_ = make(http.Header)
  818. }
  819. return c.header_
  820. }
  821. func (c *AchievementConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) {
  822. reqHeaders := make(http.Header)
  823. for k, v := range c.header_ {
  824. reqHeaders[k] = v
  825. }
  826. reqHeaders.Set("User-Agent", c.s.userAgent())
  827. var body io.Reader = nil
  828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration)
  829. if err != nil {
  830. return nil, err
  831. }
  832. reqHeaders.Set("Content-Type", "application/json")
  833. c.urlParams_.Set("alt", alt)
  834. c.urlParams_.Set("prettyPrint", "false")
  835. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/achievements")
  836. urls += "?" + c.urlParams_.Encode()
  837. req, err := http.NewRequest("POST", urls, body)
  838. if err != nil {
  839. return nil, err
  840. }
  841. req.Header = reqHeaders
  842. googleapi.Expand(req.URL, map[string]string{
  843. "applicationId": c.applicationId,
  844. })
  845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  846. }
  847. // Do executes the "gamesConfiguration.achievementConfigurations.insert" call.
  848. // Exactly one of *AchievementConfiguration or error will be non-nil.
  849. // Any non-2xx status code is an error. Response headers are in either
  850. // *AchievementConfiguration.ServerResponse.Header or (if a response was
  851. // returned at all) in error.(*googleapi.Error).Header. Use
  852. // googleapi.IsNotModified to check whether the returned error was
  853. // because http.StatusNotModified was returned.
  854. func (c *AchievementConfigurationsInsertCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
  855. gensupport.SetOptions(c.urlParams_, opts...)
  856. res, err := c.doRequest("json")
  857. if res != nil && res.StatusCode == http.StatusNotModified {
  858. if res.Body != nil {
  859. res.Body.Close()
  860. }
  861. return nil, &googleapi.Error{
  862. Code: res.StatusCode,
  863. Header: res.Header,
  864. }
  865. }
  866. if err != nil {
  867. return nil, err
  868. }
  869. defer googleapi.CloseBody(res)
  870. if err := googleapi.CheckResponse(res); err != nil {
  871. return nil, err
  872. }
  873. ret := &AchievementConfiguration{
  874. ServerResponse: googleapi.ServerResponse{
  875. Header: res.Header,
  876. HTTPStatusCode: res.StatusCode,
  877. },
  878. }
  879. target := &ret
  880. if err := gensupport.DecodeResponse(target, res); err != nil {
  881. return nil, err
  882. }
  883. return ret, nil
  884. // {
  885. // "description": "Insert a new achievement configuration in this application.",
  886. // "httpMethod": "POST",
  887. // "id": "gamesConfiguration.achievementConfigurations.insert",
  888. // "parameterOrder": [
  889. // "applicationId"
  890. // ],
  891. // "parameters": {
  892. // "applicationId": {
  893. // "description": "The application ID from the Google Play developer console.",
  894. // "location": "path",
  895. // "required": true,
  896. // "type": "string"
  897. // }
  898. // },
  899. // "path": "applications/{applicationId}/achievements",
  900. // "request": {
  901. // "$ref": "AchievementConfiguration"
  902. // },
  903. // "response": {
  904. // "$ref": "AchievementConfiguration"
  905. // },
  906. // "scopes": [
  907. // "https://www.googleapis.com/auth/androidpublisher"
  908. // ]
  909. // }
  910. }
  911. // method id "gamesConfiguration.achievementConfigurations.list":
  912. type AchievementConfigurationsListCall struct {
  913. s *Service
  914. applicationId string
  915. urlParams_ gensupport.URLParams
  916. ifNoneMatch_ string
  917. ctx_ context.Context
  918. header_ http.Header
  919. }
  920. // List: Returns a list of the achievement configurations in this
  921. // application.
  922. func (r *AchievementConfigurationsService) List(applicationId string) *AchievementConfigurationsListCall {
  923. c := &AchievementConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  924. c.applicationId = applicationId
  925. return c
  926. }
  927. // MaxResults sets the optional parameter "maxResults": The maximum
  928. // number of resource configurations to return in the response, used for
  929. // paging. For any response, the actual number of resources returned may
  930. // be less than the specified maxResults.
  931. func (c *AchievementConfigurationsListCall) MaxResults(maxResults int64) *AchievementConfigurationsListCall {
  932. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  933. return c
  934. }
  935. // PageToken sets the optional parameter "pageToken": The token returned
  936. // by the previous request.
  937. func (c *AchievementConfigurationsListCall) PageToken(pageToken string) *AchievementConfigurationsListCall {
  938. c.urlParams_.Set("pageToken", pageToken)
  939. return c
  940. }
  941. // Fields allows partial responses to be retrieved. See
  942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  943. // for more information.
  944. func (c *AchievementConfigurationsListCall) Fields(s ...googleapi.Field) *AchievementConfigurationsListCall {
  945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  946. return c
  947. }
  948. // IfNoneMatch sets the optional parameter which makes the operation
  949. // fail if the object's ETag matches the given value. This is useful for
  950. // getting updates only after the object has changed since the last
  951. // request. Use googleapi.IsNotModified to check whether the response
  952. // error from Do is the result of In-None-Match.
  953. func (c *AchievementConfigurationsListCall) IfNoneMatch(entityTag string) *AchievementConfigurationsListCall {
  954. c.ifNoneMatch_ = entityTag
  955. return c
  956. }
  957. // Context sets the context to be used in this call's Do method. Any
  958. // pending HTTP request will be aborted if the provided context is
  959. // canceled.
  960. func (c *AchievementConfigurationsListCall) Context(ctx context.Context) *AchievementConfigurationsListCall {
  961. c.ctx_ = ctx
  962. return c
  963. }
  964. // Header returns an http.Header that can be modified by the caller to
  965. // add HTTP headers to the request.
  966. func (c *AchievementConfigurationsListCall) Header() http.Header {
  967. if c.header_ == nil {
  968. c.header_ = make(http.Header)
  969. }
  970. return c.header_
  971. }
  972. func (c *AchievementConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  973. reqHeaders := make(http.Header)
  974. for k, v := range c.header_ {
  975. reqHeaders[k] = v
  976. }
  977. reqHeaders.Set("User-Agent", c.s.userAgent())
  978. if c.ifNoneMatch_ != "" {
  979. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  980. }
  981. var body io.Reader = nil
  982. c.urlParams_.Set("alt", alt)
  983. c.urlParams_.Set("prettyPrint", "false")
  984. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/achievements")
  985. urls += "?" + c.urlParams_.Encode()
  986. req, err := http.NewRequest("GET", urls, body)
  987. if err != nil {
  988. return nil, err
  989. }
  990. req.Header = reqHeaders
  991. googleapi.Expand(req.URL, map[string]string{
  992. "applicationId": c.applicationId,
  993. })
  994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  995. }
  996. // Do executes the "gamesConfiguration.achievementConfigurations.list" call.
  997. // Exactly one of *AchievementConfigurationListResponse or error will be
  998. // non-nil. Any non-2xx status code is an error. Response headers are in
  999. // either *AchievementConfigurationListResponse.ServerResponse.Header or
  1000. // (if a response was returned at all) in
  1001. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  1002. // whether the returned error was because http.StatusNotModified was
  1003. // returned.
  1004. func (c *AchievementConfigurationsListCall) Do(opts ...googleapi.CallOption) (*AchievementConfigurationListResponse, error) {
  1005. gensupport.SetOptions(c.urlParams_, opts...)
  1006. res, err := c.doRequest("json")
  1007. if res != nil && res.StatusCode == http.StatusNotModified {
  1008. if res.Body != nil {
  1009. res.Body.Close()
  1010. }
  1011. return nil, &googleapi.Error{
  1012. Code: res.StatusCode,
  1013. Header: res.Header,
  1014. }
  1015. }
  1016. if err != nil {
  1017. return nil, err
  1018. }
  1019. defer googleapi.CloseBody(res)
  1020. if err := googleapi.CheckResponse(res); err != nil {
  1021. return nil, err
  1022. }
  1023. ret := &AchievementConfigurationListResponse{
  1024. ServerResponse: googleapi.ServerResponse{
  1025. Header: res.Header,
  1026. HTTPStatusCode: res.StatusCode,
  1027. },
  1028. }
  1029. target := &ret
  1030. if err := gensupport.DecodeResponse(target, res); err != nil {
  1031. return nil, err
  1032. }
  1033. return ret, nil
  1034. // {
  1035. // "description": "Returns a list of the achievement configurations in this application.",
  1036. // "httpMethod": "GET",
  1037. // "id": "gamesConfiguration.achievementConfigurations.list",
  1038. // "parameterOrder": [
  1039. // "applicationId"
  1040. // ],
  1041. // "parameters": {
  1042. // "applicationId": {
  1043. // "description": "The application ID from the Google Play developer console.",
  1044. // "location": "path",
  1045. // "required": true,
  1046. // "type": "string"
  1047. // },
  1048. // "maxResults": {
  1049. // "description": "The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of resources returned may be less than the specified maxResults.",
  1050. // "format": "int32",
  1051. // "location": "query",
  1052. // "maximum": "200",
  1053. // "minimum": "1",
  1054. // "type": "integer"
  1055. // },
  1056. // "pageToken": {
  1057. // "description": "The token returned by the previous request.",
  1058. // "location": "query",
  1059. // "type": "string"
  1060. // }
  1061. // },
  1062. // "path": "applications/{applicationId}/achievements",
  1063. // "response": {
  1064. // "$ref": "AchievementConfigurationListResponse"
  1065. // },
  1066. // "scopes": [
  1067. // "https://www.googleapis.com/auth/androidpublisher"
  1068. // ]
  1069. // }
  1070. }
  1071. // Pages invokes f for each page of results.
  1072. // A non-nil error returned from f will halt the iteration.
  1073. // The provided context supersedes any context provided to the Context method.
  1074. func (c *AchievementConfigurationsListCall) Pages(ctx context.Context, f func(*AchievementConfigurationListResponse) error) error {
  1075. c.ctx_ = ctx
  1076. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1077. for {
  1078. x, err := c.Do()
  1079. if err != nil {
  1080. return err
  1081. }
  1082. if err := f(x); err != nil {
  1083. return err
  1084. }
  1085. if x.NextPageToken == "" {
  1086. return nil
  1087. }
  1088. c.PageToken(x.NextPageToken)
  1089. }
  1090. }
  1091. // method id "gamesConfiguration.achievementConfigurations.patch":
  1092. type AchievementConfigurationsPatchCall struct {
  1093. s *Service
  1094. achievementId string
  1095. achievementconfiguration *AchievementConfiguration
  1096. urlParams_ gensupport.URLParams
  1097. ctx_ context.Context
  1098. header_ http.Header
  1099. }
  1100. // Patch: Update the metadata of the achievement configuration with the
  1101. // given ID. This method supports patch semantics.
  1102. func (r *AchievementConfigurationsService) Patch(achievementId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsPatchCall {
  1103. c := &AchievementConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1104. c.achievementId = achievementId
  1105. c.achievementconfiguration = achievementconfiguration
  1106. return c
  1107. }
  1108. // Fields allows partial responses to be retrieved. See
  1109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1110. // for more information.
  1111. func (c *AchievementConfigurationsPatchCall) Fields(s ...googleapi.Field) *AchievementConfigurationsPatchCall {
  1112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1113. return c
  1114. }
  1115. // Context sets the context to be used in this call's Do method. Any
  1116. // pending HTTP request will be aborted if the provided context is
  1117. // canceled.
  1118. func (c *AchievementConfigurationsPatchCall) Context(ctx context.Context) *AchievementConfigurationsPatchCall {
  1119. c.ctx_ = ctx
  1120. return c
  1121. }
  1122. // Header returns an http.Header that can be modified by the caller to
  1123. // add HTTP headers to the request.
  1124. func (c *AchievementConfigurationsPatchCall) Header() http.Header {
  1125. if c.header_ == nil {
  1126. c.header_ = make(http.Header)
  1127. }
  1128. return c.header_
  1129. }
  1130. func (c *AchievementConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  1131. reqHeaders := make(http.Header)
  1132. for k, v := range c.header_ {
  1133. reqHeaders[k] = v
  1134. }
  1135. reqHeaders.Set("User-Agent", c.s.userAgent())
  1136. var body io.Reader = nil
  1137. body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration)
  1138. if err != nil {
  1139. return nil, err
  1140. }
  1141. reqHeaders.Set("Content-Type", "application/json")
  1142. c.urlParams_.Set("alt", alt)
  1143. c.urlParams_.Set("prettyPrint", "false")
  1144. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}")
  1145. urls += "?" + c.urlParams_.Encode()
  1146. req, err := http.NewRequest("PATCH", urls, body)
  1147. if err != nil {
  1148. return nil, err
  1149. }
  1150. req.Header = reqHeaders
  1151. googleapi.Expand(req.URL, map[string]string{
  1152. "achievementId": c.achievementId,
  1153. })
  1154. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1155. }
  1156. // Do executes the "gamesConfiguration.achievementConfigurations.patch" call.
  1157. // Exactly one of *AchievementConfiguration or error will be non-nil.
  1158. // Any non-2xx status code is an error. Response headers are in either
  1159. // *AchievementConfiguration.ServerResponse.Header or (if a response was
  1160. // returned at all) in error.(*googleapi.Error).Header. Use
  1161. // googleapi.IsNotModified to check whether the returned error was
  1162. // because http.StatusNotModified was returned.
  1163. func (c *AchievementConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
  1164. gensupport.SetOptions(c.urlParams_, opts...)
  1165. res, err := c.doRequest("json")
  1166. if res != nil && res.StatusCode == http.StatusNotModified {
  1167. if res.Body != nil {
  1168. res.Body.Close()
  1169. }
  1170. return nil, &googleapi.Error{
  1171. Code: res.StatusCode,
  1172. Header: res.Header,
  1173. }
  1174. }
  1175. if err != nil {
  1176. return nil, err
  1177. }
  1178. defer googleapi.CloseBody(res)
  1179. if err := googleapi.CheckResponse(res); err != nil {
  1180. return nil, err
  1181. }
  1182. ret := &AchievementConfiguration{
  1183. ServerResponse: googleapi.ServerResponse{
  1184. Header: res.Header,
  1185. HTTPStatusCode: res.StatusCode,
  1186. },
  1187. }
  1188. target := &ret
  1189. if err := gensupport.DecodeResponse(target, res); err != nil {
  1190. return nil, err
  1191. }
  1192. return ret, nil
  1193. // {
  1194. // "description": "Update the metadata of the achievement configuration with the given ID. This method supports patch semantics.",
  1195. // "httpMethod": "PATCH",
  1196. // "id": "gamesConfiguration.achievementConfigurations.patch",
  1197. // "parameterOrder": [
  1198. // "achievementId"
  1199. // ],
  1200. // "parameters": {
  1201. // "achievementId": {
  1202. // "description": "The ID of the achievement used by this method.",
  1203. // "location": "path",
  1204. // "required": true,
  1205. // "type": "string"
  1206. // }
  1207. // },
  1208. // "path": "achievements/{achievementId}",
  1209. // "request": {
  1210. // "$ref": "AchievementConfiguration"
  1211. // },
  1212. // "response": {
  1213. // "$ref": "AchievementConfiguration"
  1214. // },
  1215. // "scopes": [
  1216. // "https://www.googleapis.com/auth/androidpublisher"
  1217. // ]
  1218. // }
  1219. }
  1220. // method id "gamesConfiguration.achievementConfigurations.update":
  1221. type AchievementConfigurationsUpdateCall struct {
  1222. s *Service
  1223. achievementId string
  1224. achievementconfiguration *AchievementConfiguration
  1225. urlParams_ gensupport.URLParams
  1226. ctx_ context.Context
  1227. header_ http.Header
  1228. }
  1229. // Update: Update the metadata of the achievement configuration with the
  1230. // given ID.
  1231. func (r *AchievementConfigurationsService) Update(achievementId string, achievementconfiguration *AchievementConfiguration) *AchievementConfigurationsUpdateCall {
  1232. c := &AchievementConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1233. c.achievementId = achievementId
  1234. c.achievementconfiguration = achievementconfiguration
  1235. return c
  1236. }
  1237. // Fields allows partial responses to be retrieved. See
  1238. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1239. // for more information.
  1240. func (c *AchievementConfigurationsUpdateCall) Fields(s ...googleapi.Field) *AchievementConfigurationsUpdateCall {
  1241. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1242. return c
  1243. }
  1244. // Context sets the context to be used in this call's Do method. Any
  1245. // pending HTTP request will be aborted if the provided context is
  1246. // canceled.
  1247. func (c *AchievementConfigurationsUpdateCall) Context(ctx context.Context) *AchievementConfigurationsUpdateCall {
  1248. c.ctx_ = ctx
  1249. return c
  1250. }
  1251. // Header returns an http.Header that can be modified by the caller to
  1252. // add HTTP headers to the request.
  1253. func (c *AchievementConfigurationsUpdateCall) Header() http.Header {
  1254. if c.header_ == nil {
  1255. c.header_ = make(http.Header)
  1256. }
  1257. return c.header_
  1258. }
  1259. func (c *AchievementConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  1260. reqHeaders := make(http.Header)
  1261. for k, v := range c.header_ {
  1262. reqHeaders[k] = v
  1263. }
  1264. reqHeaders.Set("User-Agent", c.s.userAgent())
  1265. var body io.Reader = nil
  1266. body, err := googleapi.WithoutDataWrapper.JSONReader(c.achievementconfiguration)
  1267. if err != nil {
  1268. return nil, err
  1269. }
  1270. reqHeaders.Set("Content-Type", "application/json")
  1271. c.urlParams_.Set("alt", alt)
  1272. c.urlParams_.Set("prettyPrint", "false")
  1273. urls := googleapi.ResolveRelative(c.s.BasePath, "achievements/{achievementId}")
  1274. urls += "?" + c.urlParams_.Encode()
  1275. req, err := http.NewRequest("PUT", urls, body)
  1276. if err != nil {
  1277. return nil, err
  1278. }
  1279. req.Header = reqHeaders
  1280. googleapi.Expand(req.URL, map[string]string{
  1281. "achievementId": c.achievementId,
  1282. })
  1283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1284. }
  1285. // Do executes the "gamesConfiguration.achievementConfigurations.update" call.
  1286. // Exactly one of *AchievementConfiguration or error will be non-nil.
  1287. // Any non-2xx status code is an error. Response headers are in either
  1288. // *AchievementConfiguration.ServerResponse.Header or (if a response was
  1289. // returned at all) in error.(*googleapi.Error).Header. Use
  1290. // googleapi.IsNotModified to check whether the returned error was
  1291. // because http.StatusNotModified was returned.
  1292. func (c *AchievementConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*AchievementConfiguration, error) {
  1293. gensupport.SetOptions(c.urlParams_, opts...)
  1294. res, err := c.doRequest("json")
  1295. if res != nil && res.StatusCode == http.StatusNotModified {
  1296. if res.Body != nil {
  1297. res.Body.Close()
  1298. }
  1299. return nil, &googleapi.Error{
  1300. Code: res.StatusCode,
  1301. Header: res.Header,
  1302. }
  1303. }
  1304. if err != nil {
  1305. return nil, err
  1306. }
  1307. defer googleapi.CloseBody(res)
  1308. if err := googleapi.CheckResponse(res); err != nil {
  1309. return nil, err
  1310. }
  1311. ret := &AchievementConfiguration{
  1312. ServerResponse: googleapi.ServerResponse{
  1313. Header: res.Header,
  1314. HTTPStatusCode: res.StatusCode,
  1315. },
  1316. }
  1317. target := &ret
  1318. if err := gensupport.DecodeResponse(target, res); err != nil {
  1319. return nil, err
  1320. }
  1321. return ret, nil
  1322. // {
  1323. // "description": "Update the metadata of the achievement configuration with the given ID.",
  1324. // "httpMethod": "PUT",
  1325. // "id": "gamesConfiguration.achievementConfigurations.update",
  1326. // "parameterOrder": [
  1327. // "achievementId"
  1328. // ],
  1329. // "parameters": {
  1330. // "achievementId": {
  1331. // "description": "The ID of the achievement used by this method.",
  1332. // "location": "path",
  1333. // "required": true,
  1334. // "type": "string"
  1335. // }
  1336. // },
  1337. // "path": "achievements/{achievementId}",
  1338. // "request": {
  1339. // "$ref": "AchievementConfiguration"
  1340. // },
  1341. // "response": {
  1342. // "$ref": "AchievementConfiguration"
  1343. // },
  1344. // "scopes": [
  1345. // "https://www.googleapis.com/auth/androidpublisher"
  1346. // ]
  1347. // }
  1348. }
  1349. // method id "gamesConfiguration.imageConfigurations.upload":
  1350. type ImageConfigurationsUploadCall struct {
  1351. s *Service
  1352. resourceId string
  1353. imageType string
  1354. urlParams_ gensupport.URLParams
  1355. mediaInfo_ *gensupport.MediaInfo
  1356. ctx_ context.Context
  1357. header_ http.Header
  1358. }
  1359. // Upload: Uploads an image for a resource with the given ID and image
  1360. // type.
  1361. func (r *ImageConfigurationsService) Upload(resourceId string, imageType string) *ImageConfigurationsUploadCall {
  1362. c := &ImageConfigurationsUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1363. c.resourceId = resourceId
  1364. c.imageType = imageType
  1365. return c
  1366. }
  1367. // Media specifies the media to upload in one or more chunks. The chunk
  1368. // size may be controlled by supplying a MediaOption generated by
  1369. // googleapi.ChunkSize. The chunk size defaults to
  1370. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  1371. // upload request will be determined by sniffing the contents of r,
  1372. // unless a MediaOption generated by googleapi.ContentType is
  1373. // supplied.
  1374. // At most one of Media and ResumableMedia may be set.
  1375. func (c *ImageConfigurationsUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *ImageConfigurationsUploadCall {
  1376. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  1377. return c
  1378. }
  1379. // ResumableMedia specifies the media to upload in chunks and can be
  1380. // canceled with ctx.
  1381. //
  1382. // Deprecated: use Media instead.
  1383. //
  1384. // At most one of Media and ResumableMedia may be set. mediaType
  1385. // identifies the MIME media type of the upload, such as "image/png". If
  1386. // mediaType is "", it will be auto-detected. The provided ctx will
  1387. // supersede any context previously provided to the Context method.
  1388. func (c *ImageConfigurationsUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ImageConfigurationsUploadCall {
  1389. c.ctx_ = ctx
  1390. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  1391. return c
  1392. }
  1393. // ProgressUpdater provides a callback function that will be called
  1394. // after every chunk. It should be a low-latency function in order to
  1395. // not slow down the upload operation. This should only be called when
  1396. // using ResumableMedia (as opposed to Media).
  1397. func (c *ImageConfigurationsUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ImageConfigurationsUploadCall {
  1398. c.mediaInfo_.SetProgressUpdater(pu)
  1399. return c
  1400. }
  1401. // Fields allows partial responses to be retrieved. See
  1402. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1403. // for more information.
  1404. func (c *ImageConfigurationsUploadCall) Fields(s ...googleapi.Field) *ImageConfigurationsUploadCall {
  1405. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1406. return c
  1407. }
  1408. // Context sets the context to be used in this call's Do method. Any
  1409. // pending HTTP request will be aborted if the provided context is
  1410. // canceled.
  1411. // This context will supersede any context previously provided to the
  1412. // ResumableMedia method.
  1413. func (c *ImageConfigurationsUploadCall) Context(ctx context.Context) *ImageConfigurationsUploadCall {
  1414. c.ctx_ = ctx
  1415. return c
  1416. }
  1417. // Header returns an http.Header that can be modified by the caller to
  1418. // add HTTP headers to the request.
  1419. func (c *ImageConfigurationsUploadCall) Header() http.Header {
  1420. if c.header_ == nil {
  1421. c.header_ = make(http.Header)
  1422. }
  1423. return c.header_
  1424. }
  1425. func (c *ImageConfigurationsUploadCall) doRequest(alt string) (*http.Response, error) {
  1426. reqHeaders := make(http.Header)
  1427. for k, v := range c.header_ {
  1428. reqHeaders[k] = v
  1429. }
  1430. reqHeaders.Set("User-Agent", c.s.userAgent())
  1431. var body io.Reader = nil
  1432. c.urlParams_.Set("alt", alt)
  1433. c.urlParams_.Set("prettyPrint", "false")
  1434. urls := googleapi.ResolveRelative(c.s.BasePath, "images/{resourceId}/imageType/{imageType}")
  1435. if c.mediaInfo_ != nil {
  1436. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  1437. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  1438. }
  1439. if body == nil {
  1440. body = new(bytes.Buffer)
  1441. reqHeaders.Set("Content-Type", "application/json")
  1442. }
  1443. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  1444. defer cleanup()
  1445. urls += "?" + c.urlParams_.Encode()
  1446. req, err := http.NewRequest("POST", urls, body)
  1447. if err != nil {
  1448. return nil, err
  1449. }
  1450. req.Header = reqHeaders
  1451. req.GetBody = getBody
  1452. googleapi.Expand(req.URL, map[string]string{
  1453. "resourceId": c.resourceId,
  1454. "imageType": c.imageType,
  1455. })
  1456. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1457. }
  1458. // Do executes the "gamesConfiguration.imageConfigurations.upload" call.
  1459. // Exactly one of *ImageConfiguration or error will be non-nil. Any
  1460. // non-2xx status code is an error. Response headers are in either
  1461. // *ImageConfiguration.ServerResponse.Header or (if a response was
  1462. // returned at all) in error.(*googleapi.Error).Header. Use
  1463. // googleapi.IsNotModified to check whether the returned error was
  1464. // because http.StatusNotModified was returned.
  1465. func (c *ImageConfigurationsUploadCall) Do(opts ...googleapi.CallOption) (*ImageConfiguration, error) {
  1466. gensupport.SetOptions(c.urlParams_, opts...)
  1467. res, err := c.doRequest("json")
  1468. if res != nil && res.StatusCode == http.StatusNotModified {
  1469. if res.Body != nil {
  1470. res.Body.Close()
  1471. }
  1472. return nil, &googleapi.Error{
  1473. Code: res.StatusCode,
  1474. Header: res.Header,
  1475. }
  1476. }
  1477. if err != nil {
  1478. return nil, err
  1479. }
  1480. defer googleapi.CloseBody(res)
  1481. if err := googleapi.CheckResponse(res); err != nil {
  1482. return nil, err
  1483. }
  1484. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  1485. if rx != nil {
  1486. rx.Client = c.s.client
  1487. rx.UserAgent = c.s.userAgent()
  1488. ctx := c.ctx_
  1489. if ctx == nil {
  1490. ctx = context.TODO()
  1491. }
  1492. res, err = rx.Upload(ctx)
  1493. if err != nil {
  1494. return nil, err
  1495. }
  1496. defer res.Body.Close()
  1497. if err := googleapi.CheckResponse(res); err != nil {
  1498. return nil, err
  1499. }
  1500. }
  1501. ret := &ImageConfiguration{
  1502. ServerResponse: googleapi.ServerResponse{
  1503. Header: res.Header,
  1504. HTTPStatusCode: res.StatusCode,
  1505. },
  1506. }
  1507. target := &ret
  1508. if err := gensupport.DecodeResponse(target, res); err != nil {
  1509. return nil, err
  1510. }
  1511. return ret, nil
  1512. // {
  1513. // "description": "Uploads an image for a resource with the given ID and image type.",
  1514. // "httpMethod": "POST",
  1515. // "id": "gamesConfiguration.imageConfigurations.upload",
  1516. // "mediaUpload": {
  1517. // "accept": [
  1518. // "image/*"
  1519. // ],
  1520. // "maxSize": "15MB",
  1521. // "protocols": {
  1522. // "resumable": {
  1523. // "multipart": true,
  1524. // "path": "/resumable/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}"
  1525. // },
  1526. // "simple": {
  1527. // "multipart": true,
  1528. // "path": "/upload/games/v1configuration/images/{resourceId}/imageType/{imageType}"
  1529. // }
  1530. // }
  1531. // },
  1532. // "parameterOrder": [
  1533. // "resourceId",
  1534. // "imageType"
  1535. // ],
  1536. // "parameters": {
  1537. // "imageType": {
  1538. // "description": "Selects which image in a resource for this method.",
  1539. // "enum": [
  1540. // "ACHIEVEMENT_ICON",
  1541. // "LEADERBOARD_ICON"
  1542. // ],
  1543. // "enumDescriptions": [
  1544. // "The icon image for an achievement resource.",
  1545. // "The icon image for a leaderboard resource."
  1546. // ],
  1547. // "location": "path",
  1548. // "required": true,
  1549. // "type": "string"
  1550. // },
  1551. // "resourceId": {
  1552. // "description": "The ID of the resource used by this method.",
  1553. // "location": "path",
  1554. // "required": true,
  1555. // "type": "string"
  1556. // }
  1557. // },
  1558. // "path": "images/{resourceId}/imageType/{imageType}",
  1559. // "response": {
  1560. // "$ref": "ImageConfiguration"
  1561. // },
  1562. // "scopes": [
  1563. // "https://www.googleapis.com/auth/androidpublisher"
  1564. // ],
  1565. // "supportsMediaUpload": true
  1566. // }
  1567. }
  1568. // method id "gamesConfiguration.leaderboardConfigurations.delete":
  1569. type LeaderboardConfigurationsDeleteCall struct {
  1570. s *Service
  1571. leaderboardId string
  1572. urlParams_ gensupport.URLParams
  1573. ctx_ context.Context
  1574. header_ http.Header
  1575. }
  1576. // Delete: Delete the leaderboard configuration with the given ID.
  1577. func (r *LeaderboardConfigurationsService) Delete(leaderboardId string) *LeaderboardConfigurationsDeleteCall {
  1578. c := &LeaderboardConfigurationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1579. c.leaderboardId = leaderboardId
  1580. return c
  1581. }
  1582. // Fields allows partial responses to be retrieved. See
  1583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1584. // for more information.
  1585. func (c *LeaderboardConfigurationsDeleteCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsDeleteCall {
  1586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1587. return c
  1588. }
  1589. // Context sets the context to be used in this call's Do method. Any
  1590. // pending HTTP request will be aborted if the provided context is
  1591. // canceled.
  1592. func (c *LeaderboardConfigurationsDeleteCall) Context(ctx context.Context) *LeaderboardConfigurationsDeleteCall {
  1593. c.ctx_ = ctx
  1594. return c
  1595. }
  1596. // Header returns an http.Header that can be modified by the caller to
  1597. // add HTTP headers to the request.
  1598. func (c *LeaderboardConfigurationsDeleteCall) Header() http.Header {
  1599. if c.header_ == nil {
  1600. c.header_ = make(http.Header)
  1601. }
  1602. return c.header_
  1603. }
  1604. func (c *LeaderboardConfigurationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  1605. reqHeaders := make(http.Header)
  1606. for k, v := range c.header_ {
  1607. reqHeaders[k] = v
  1608. }
  1609. reqHeaders.Set("User-Agent", c.s.userAgent())
  1610. var body io.Reader = nil
  1611. c.urlParams_.Set("alt", alt)
  1612. c.urlParams_.Set("prettyPrint", "false")
  1613. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  1614. urls += "?" + c.urlParams_.Encode()
  1615. req, err := http.NewRequest("DELETE", urls, body)
  1616. if err != nil {
  1617. return nil, err
  1618. }
  1619. req.Header = reqHeaders
  1620. googleapi.Expand(req.URL, map[string]string{
  1621. "leaderboardId": c.leaderboardId,
  1622. })
  1623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1624. }
  1625. // Do executes the "gamesConfiguration.leaderboardConfigurations.delete" call.
  1626. func (c *LeaderboardConfigurationsDeleteCall) Do(opts ...googleapi.CallOption) error {
  1627. gensupport.SetOptions(c.urlParams_, opts...)
  1628. res, err := c.doRequest("json")
  1629. if err != nil {
  1630. return err
  1631. }
  1632. defer googleapi.CloseBody(res)
  1633. if err := googleapi.CheckResponse(res); err != nil {
  1634. return err
  1635. }
  1636. return nil
  1637. // {
  1638. // "description": "Delete the leaderboard configuration with the given ID.",
  1639. // "httpMethod": "DELETE",
  1640. // "id": "gamesConfiguration.leaderboardConfigurations.delete",
  1641. // "parameterOrder": [
  1642. // "leaderboardId"
  1643. // ],
  1644. // "parameters": {
  1645. // "leaderboardId": {
  1646. // "description": "The ID of the leaderboard.",
  1647. // "location": "path",
  1648. // "required": true,
  1649. // "type": "string"
  1650. // }
  1651. // },
  1652. // "path": "leaderboards/{leaderboardId}",
  1653. // "scopes": [
  1654. // "https://www.googleapis.com/auth/androidpublisher"
  1655. // ]
  1656. // }
  1657. }
  1658. // method id "gamesConfiguration.leaderboardConfigurations.get":
  1659. type LeaderboardConfigurationsGetCall struct {
  1660. s *Service
  1661. leaderboardId string
  1662. urlParams_ gensupport.URLParams
  1663. ifNoneMatch_ string
  1664. ctx_ context.Context
  1665. header_ http.Header
  1666. }
  1667. // Get: Retrieves the metadata of the leaderboard configuration with the
  1668. // given ID.
  1669. func (r *LeaderboardConfigurationsService) Get(leaderboardId string) *LeaderboardConfigurationsGetCall {
  1670. c := &LeaderboardConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1671. c.leaderboardId = leaderboardId
  1672. return c
  1673. }
  1674. // Fields allows partial responses to be retrieved. See
  1675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1676. // for more information.
  1677. func (c *LeaderboardConfigurationsGetCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsGetCall {
  1678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1679. return c
  1680. }
  1681. // IfNoneMatch sets the optional parameter which makes the operation
  1682. // fail if the object's ETag matches the given value. This is useful for
  1683. // getting updates only after the object has changed since the last
  1684. // request. Use googleapi.IsNotModified to check whether the response
  1685. // error from Do is the result of In-None-Match.
  1686. func (c *LeaderboardConfigurationsGetCall) IfNoneMatch(entityTag string) *LeaderboardConfigurationsGetCall {
  1687. c.ifNoneMatch_ = entityTag
  1688. return c
  1689. }
  1690. // Context sets the context to be used in this call's Do method. Any
  1691. // pending HTTP request will be aborted if the provided context is
  1692. // canceled.
  1693. func (c *LeaderboardConfigurationsGetCall) Context(ctx context.Context) *LeaderboardConfigurationsGetCall {
  1694. c.ctx_ = ctx
  1695. return c
  1696. }
  1697. // Header returns an http.Header that can be modified by the caller to
  1698. // add HTTP headers to the request.
  1699. func (c *LeaderboardConfigurationsGetCall) Header() http.Header {
  1700. if c.header_ == nil {
  1701. c.header_ = make(http.Header)
  1702. }
  1703. return c.header_
  1704. }
  1705. func (c *LeaderboardConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  1706. reqHeaders := make(http.Header)
  1707. for k, v := range c.header_ {
  1708. reqHeaders[k] = v
  1709. }
  1710. reqHeaders.Set("User-Agent", c.s.userAgent())
  1711. if c.ifNoneMatch_ != "" {
  1712. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1713. }
  1714. var body io.Reader = nil
  1715. c.urlParams_.Set("alt", alt)
  1716. c.urlParams_.Set("prettyPrint", "false")
  1717. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  1718. urls += "?" + c.urlParams_.Encode()
  1719. req, err := http.NewRequest("GET", urls, body)
  1720. if err != nil {
  1721. return nil, err
  1722. }
  1723. req.Header = reqHeaders
  1724. googleapi.Expand(req.URL, map[string]string{
  1725. "leaderboardId": c.leaderboardId,
  1726. })
  1727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1728. }
  1729. // Do executes the "gamesConfiguration.leaderboardConfigurations.get" call.
  1730. // Exactly one of *LeaderboardConfiguration or error will be non-nil.
  1731. // Any non-2xx status code is an error. Response headers are in either
  1732. // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  1733. // returned at all) in error.(*googleapi.Error).Header. Use
  1734. // googleapi.IsNotModified to check whether the returned error was
  1735. // because http.StatusNotModified was returned.
  1736. func (c *LeaderboardConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  1737. gensupport.SetOptions(c.urlParams_, opts...)
  1738. res, err := c.doRequest("json")
  1739. if res != nil && res.StatusCode == http.StatusNotModified {
  1740. if res.Body != nil {
  1741. res.Body.Close()
  1742. }
  1743. return nil, &googleapi.Error{
  1744. Code: res.StatusCode,
  1745. Header: res.Header,
  1746. }
  1747. }
  1748. if err != nil {
  1749. return nil, err
  1750. }
  1751. defer googleapi.CloseBody(res)
  1752. if err := googleapi.CheckResponse(res); err != nil {
  1753. return nil, err
  1754. }
  1755. ret := &LeaderboardConfiguration{
  1756. ServerResponse: googleapi.ServerResponse{
  1757. Header: res.Header,
  1758. HTTPStatusCode: res.StatusCode,
  1759. },
  1760. }
  1761. target := &ret
  1762. if err := gensupport.DecodeResponse(target, res); err != nil {
  1763. return nil, err
  1764. }
  1765. return ret, nil
  1766. // {
  1767. // "description": "Retrieves the metadata of the leaderboard configuration with the given ID.",
  1768. // "httpMethod": "GET",
  1769. // "id": "gamesConfiguration.leaderboardConfigurations.get",
  1770. // "parameterOrder": [
  1771. // "leaderboardId"
  1772. // ],
  1773. // "parameters": {
  1774. // "leaderboardId": {
  1775. // "description": "The ID of the leaderboard.",
  1776. // "location": "path",
  1777. // "required": true,
  1778. // "type": "string"
  1779. // }
  1780. // },
  1781. // "path": "leaderboards/{leaderboardId}",
  1782. // "response": {
  1783. // "$ref": "LeaderboardConfiguration"
  1784. // },
  1785. // "scopes": [
  1786. // "https://www.googleapis.com/auth/androidpublisher"
  1787. // ]
  1788. // }
  1789. }
  1790. // method id "gamesConfiguration.leaderboardConfigurations.insert":
  1791. type LeaderboardConfigurationsInsertCall struct {
  1792. s *Service
  1793. applicationId string
  1794. leaderboardconfiguration *LeaderboardConfiguration
  1795. urlParams_ gensupport.URLParams
  1796. ctx_ context.Context
  1797. header_ http.Header
  1798. }
  1799. // Insert: Insert a new leaderboard configuration in this application.
  1800. func (r *LeaderboardConfigurationsService) Insert(applicationId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsInsertCall {
  1801. c := &LeaderboardConfigurationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1802. c.applicationId = applicationId
  1803. c.leaderboardconfiguration = leaderboardconfiguration
  1804. return c
  1805. }
  1806. // Fields allows partial responses to be retrieved. See
  1807. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1808. // for more information.
  1809. func (c *LeaderboardConfigurationsInsertCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsInsertCall {
  1810. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1811. return c
  1812. }
  1813. // Context sets the context to be used in this call's Do method. Any
  1814. // pending HTTP request will be aborted if the provided context is
  1815. // canceled.
  1816. func (c *LeaderboardConfigurationsInsertCall) Context(ctx context.Context) *LeaderboardConfigurationsInsertCall {
  1817. c.ctx_ = ctx
  1818. return c
  1819. }
  1820. // Header returns an http.Header that can be modified by the caller to
  1821. // add HTTP headers to the request.
  1822. func (c *LeaderboardConfigurationsInsertCall) Header() http.Header {
  1823. if c.header_ == nil {
  1824. c.header_ = make(http.Header)
  1825. }
  1826. return c.header_
  1827. }
  1828. func (c *LeaderboardConfigurationsInsertCall) doRequest(alt string) (*http.Response, error) {
  1829. reqHeaders := make(http.Header)
  1830. for k, v := range c.header_ {
  1831. reqHeaders[k] = v
  1832. }
  1833. reqHeaders.Set("User-Agent", c.s.userAgent())
  1834. var body io.Reader = nil
  1835. body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration)
  1836. if err != nil {
  1837. return nil, err
  1838. }
  1839. reqHeaders.Set("Content-Type", "application/json")
  1840. c.urlParams_.Set("alt", alt)
  1841. c.urlParams_.Set("prettyPrint", "false")
  1842. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/leaderboards")
  1843. urls += "?" + c.urlParams_.Encode()
  1844. req, err := http.NewRequest("POST", urls, body)
  1845. if err != nil {
  1846. return nil, err
  1847. }
  1848. req.Header = reqHeaders
  1849. googleapi.Expand(req.URL, map[string]string{
  1850. "applicationId": c.applicationId,
  1851. })
  1852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1853. }
  1854. // Do executes the "gamesConfiguration.leaderboardConfigurations.insert" call.
  1855. // Exactly one of *LeaderboardConfiguration or error will be non-nil.
  1856. // Any non-2xx status code is an error. Response headers are in either
  1857. // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  1858. // returned at all) in error.(*googleapi.Error).Header. Use
  1859. // googleapi.IsNotModified to check whether the returned error was
  1860. // because http.StatusNotModified was returned.
  1861. func (c *LeaderboardConfigurationsInsertCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  1862. gensupport.SetOptions(c.urlParams_, opts...)
  1863. res, err := c.doRequest("json")
  1864. if res != nil && res.StatusCode == http.StatusNotModified {
  1865. if res.Body != nil {
  1866. res.Body.Close()
  1867. }
  1868. return nil, &googleapi.Error{
  1869. Code: res.StatusCode,
  1870. Header: res.Header,
  1871. }
  1872. }
  1873. if err != nil {
  1874. return nil, err
  1875. }
  1876. defer googleapi.CloseBody(res)
  1877. if err := googleapi.CheckResponse(res); err != nil {
  1878. return nil, err
  1879. }
  1880. ret := &LeaderboardConfiguration{
  1881. ServerResponse: googleapi.ServerResponse{
  1882. Header: res.Header,
  1883. HTTPStatusCode: res.StatusCode,
  1884. },
  1885. }
  1886. target := &ret
  1887. if err := gensupport.DecodeResponse(target, res); err != nil {
  1888. return nil, err
  1889. }
  1890. return ret, nil
  1891. // {
  1892. // "description": "Insert a new leaderboard configuration in this application.",
  1893. // "httpMethod": "POST",
  1894. // "id": "gamesConfiguration.leaderboardConfigurations.insert",
  1895. // "parameterOrder": [
  1896. // "applicationId"
  1897. // ],
  1898. // "parameters": {
  1899. // "applicationId": {
  1900. // "description": "The application ID from the Google Play developer console.",
  1901. // "location": "path",
  1902. // "required": true,
  1903. // "type": "string"
  1904. // }
  1905. // },
  1906. // "path": "applications/{applicationId}/leaderboards",
  1907. // "request": {
  1908. // "$ref": "LeaderboardConfiguration"
  1909. // },
  1910. // "response": {
  1911. // "$ref": "LeaderboardConfiguration"
  1912. // },
  1913. // "scopes": [
  1914. // "https://www.googleapis.com/auth/androidpublisher"
  1915. // ]
  1916. // }
  1917. }
  1918. // method id "gamesConfiguration.leaderboardConfigurations.list":
  1919. type LeaderboardConfigurationsListCall struct {
  1920. s *Service
  1921. applicationId string
  1922. urlParams_ gensupport.URLParams
  1923. ifNoneMatch_ string
  1924. ctx_ context.Context
  1925. header_ http.Header
  1926. }
  1927. // List: Returns a list of the leaderboard configurations in this
  1928. // application.
  1929. func (r *LeaderboardConfigurationsService) List(applicationId string) *LeaderboardConfigurationsListCall {
  1930. c := &LeaderboardConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1931. c.applicationId = applicationId
  1932. return c
  1933. }
  1934. // MaxResults sets the optional parameter "maxResults": The maximum
  1935. // number of resource configurations to return in the response, used for
  1936. // paging. For any response, the actual number of resources returned may
  1937. // be less than the specified maxResults.
  1938. func (c *LeaderboardConfigurationsListCall) MaxResults(maxResults int64) *LeaderboardConfigurationsListCall {
  1939. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  1940. return c
  1941. }
  1942. // PageToken sets the optional parameter "pageToken": The token returned
  1943. // by the previous request.
  1944. func (c *LeaderboardConfigurationsListCall) PageToken(pageToken string) *LeaderboardConfigurationsListCall {
  1945. c.urlParams_.Set("pageToken", pageToken)
  1946. return c
  1947. }
  1948. // Fields allows partial responses to be retrieved. See
  1949. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1950. // for more information.
  1951. func (c *LeaderboardConfigurationsListCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsListCall {
  1952. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1953. return c
  1954. }
  1955. // IfNoneMatch sets the optional parameter which makes the operation
  1956. // fail if the object's ETag matches the given value. This is useful for
  1957. // getting updates only after the object has changed since the last
  1958. // request. Use googleapi.IsNotModified to check whether the response
  1959. // error from Do is the result of In-None-Match.
  1960. func (c *LeaderboardConfigurationsListCall) IfNoneMatch(entityTag string) *LeaderboardConfigurationsListCall {
  1961. c.ifNoneMatch_ = entityTag
  1962. return c
  1963. }
  1964. // Context sets the context to be used in this call's Do method. Any
  1965. // pending HTTP request will be aborted if the provided context is
  1966. // canceled.
  1967. func (c *LeaderboardConfigurationsListCall) Context(ctx context.Context) *LeaderboardConfigurationsListCall {
  1968. c.ctx_ = ctx
  1969. return c
  1970. }
  1971. // Header returns an http.Header that can be modified by the caller to
  1972. // add HTTP headers to the request.
  1973. func (c *LeaderboardConfigurationsListCall) Header() http.Header {
  1974. if c.header_ == nil {
  1975. c.header_ = make(http.Header)
  1976. }
  1977. return c.header_
  1978. }
  1979. func (c *LeaderboardConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  1980. reqHeaders := make(http.Header)
  1981. for k, v := range c.header_ {
  1982. reqHeaders[k] = v
  1983. }
  1984. reqHeaders.Set("User-Agent", c.s.userAgent())
  1985. if c.ifNoneMatch_ != "" {
  1986. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1987. }
  1988. var body io.Reader = nil
  1989. c.urlParams_.Set("alt", alt)
  1990. c.urlParams_.Set("prettyPrint", "false")
  1991. urls := googleapi.ResolveRelative(c.s.BasePath, "applications/{applicationId}/leaderboards")
  1992. urls += "?" + c.urlParams_.Encode()
  1993. req, err := http.NewRequest("GET", urls, body)
  1994. if err != nil {
  1995. return nil, err
  1996. }
  1997. req.Header = reqHeaders
  1998. googleapi.Expand(req.URL, map[string]string{
  1999. "applicationId": c.applicationId,
  2000. })
  2001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2002. }
  2003. // Do executes the "gamesConfiguration.leaderboardConfigurations.list" call.
  2004. // Exactly one of *LeaderboardConfigurationListResponse or error will be
  2005. // non-nil. Any non-2xx status code is an error. Response headers are in
  2006. // either *LeaderboardConfigurationListResponse.ServerResponse.Header or
  2007. // (if a response was returned at all) in
  2008. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2009. // whether the returned error was because http.StatusNotModified was
  2010. // returned.
  2011. func (c *LeaderboardConfigurationsListCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfigurationListResponse, error) {
  2012. gensupport.SetOptions(c.urlParams_, opts...)
  2013. res, err := c.doRequest("json")
  2014. if res != nil && res.StatusCode == http.StatusNotModified {
  2015. if res.Body != nil {
  2016. res.Body.Close()
  2017. }
  2018. return nil, &googleapi.Error{
  2019. Code: res.StatusCode,
  2020. Header: res.Header,
  2021. }
  2022. }
  2023. if err != nil {
  2024. return nil, err
  2025. }
  2026. defer googleapi.CloseBody(res)
  2027. if err := googleapi.CheckResponse(res); err != nil {
  2028. return nil, err
  2029. }
  2030. ret := &LeaderboardConfigurationListResponse{
  2031. ServerResponse: googleapi.ServerResponse{
  2032. Header: res.Header,
  2033. HTTPStatusCode: res.StatusCode,
  2034. },
  2035. }
  2036. target := &ret
  2037. if err := gensupport.DecodeResponse(target, res); err != nil {
  2038. return nil, err
  2039. }
  2040. return ret, nil
  2041. // {
  2042. // "description": "Returns a list of the leaderboard configurations in this application.",
  2043. // "httpMethod": "GET",
  2044. // "id": "gamesConfiguration.leaderboardConfigurations.list",
  2045. // "parameterOrder": [
  2046. // "applicationId"
  2047. // ],
  2048. // "parameters": {
  2049. // "applicationId": {
  2050. // "description": "The application ID from the Google Play developer console.",
  2051. // "location": "path",
  2052. // "required": true,
  2053. // "type": "string"
  2054. // },
  2055. // "maxResults": {
  2056. // "description": "The maximum number of resource configurations to return in the response, used for paging. For any response, the actual number of resources returned may be less than the specified maxResults.",
  2057. // "format": "int32",
  2058. // "location": "query",
  2059. // "maximum": "200",
  2060. // "minimum": "1",
  2061. // "type": "integer"
  2062. // },
  2063. // "pageToken": {
  2064. // "description": "The token returned by the previous request.",
  2065. // "location": "query",
  2066. // "type": "string"
  2067. // }
  2068. // },
  2069. // "path": "applications/{applicationId}/leaderboards",
  2070. // "response": {
  2071. // "$ref": "LeaderboardConfigurationListResponse"
  2072. // },
  2073. // "scopes": [
  2074. // "https://www.googleapis.com/auth/androidpublisher"
  2075. // ]
  2076. // }
  2077. }
  2078. // Pages invokes f for each page of results.
  2079. // A non-nil error returned from f will halt the iteration.
  2080. // The provided context supersedes any context provided to the Context method.
  2081. func (c *LeaderboardConfigurationsListCall) Pages(ctx context.Context, f func(*LeaderboardConfigurationListResponse) error) error {
  2082. c.ctx_ = ctx
  2083. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2084. for {
  2085. x, err := c.Do()
  2086. if err != nil {
  2087. return err
  2088. }
  2089. if err := f(x); err != nil {
  2090. return err
  2091. }
  2092. if x.NextPageToken == "" {
  2093. return nil
  2094. }
  2095. c.PageToken(x.NextPageToken)
  2096. }
  2097. }
  2098. // method id "gamesConfiguration.leaderboardConfigurations.patch":
  2099. type LeaderboardConfigurationsPatchCall struct {
  2100. s *Service
  2101. leaderboardId string
  2102. leaderboardconfiguration *LeaderboardConfiguration
  2103. urlParams_ gensupport.URLParams
  2104. ctx_ context.Context
  2105. header_ http.Header
  2106. }
  2107. // Patch: Update the metadata of the leaderboard configuration with the
  2108. // given ID. This method supports patch semantics.
  2109. func (r *LeaderboardConfigurationsService) Patch(leaderboardId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsPatchCall {
  2110. c := &LeaderboardConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2111. c.leaderboardId = leaderboardId
  2112. c.leaderboardconfiguration = leaderboardconfiguration
  2113. return c
  2114. }
  2115. // Fields allows partial responses to be retrieved. See
  2116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2117. // for more information.
  2118. func (c *LeaderboardConfigurationsPatchCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsPatchCall {
  2119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2120. return c
  2121. }
  2122. // Context sets the context to be used in this call's Do method. Any
  2123. // pending HTTP request will be aborted if the provided context is
  2124. // canceled.
  2125. func (c *LeaderboardConfigurationsPatchCall) Context(ctx context.Context) *LeaderboardConfigurationsPatchCall {
  2126. c.ctx_ = ctx
  2127. return c
  2128. }
  2129. // Header returns an http.Header that can be modified by the caller to
  2130. // add HTTP headers to the request.
  2131. func (c *LeaderboardConfigurationsPatchCall) Header() http.Header {
  2132. if c.header_ == nil {
  2133. c.header_ = make(http.Header)
  2134. }
  2135. return c.header_
  2136. }
  2137. func (c *LeaderboardConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  2138. reqHeaders := make(http.Header)
  2139. for k, v := range c.header_ {
  2140. reqHeaders[k] = v
  2141. }
  2142. reqHeaders.Set("User-Agent", c.s.userAgent())
  2143. var body io.Reader = nil
  2144. body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration)
  2145. if err != nil {
  2146. return nil, err
  2147. }
  2148. reqHeaders.Set("Content-Type", "application/json")
  2149. c.urlParams_.Set("alt", alt)
  2150. c.urlParams_.Set("prettyPrint", "false")
  2151. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  2152. urls += "?" + c.urlParams_.Encode()
  2153. req, err := http.NewRequest("PATCH", urls, body)
  2154. if err != nil {
  2155. return nil, err
  2156. }
  2157. req.Header = reqHeaders
  2158. googleapi.Expand(req.URL, map[string]string{
  2159. "leaderboardId": c.leaderboardId,
  2160. })
  2161. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2162. }
  2163. // Do executes the "gamesConfiguration.leaderboardConfigurations.patch" call.
  2164. // Exactly one of *LeaderboardConfiguration or error will be non-nil.
  2165. // Any non-2xx status code is an error. Response headers are in either
  2166. // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  2167. // returned at all) in error.(*googleapi.Error).Header. Use
  2168. // googleapi.IsNotModified to check whether the returned error was
  2169. // because http.StatusNotModified was returned.
  2170. func (c *LeaderboardConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  2171. gensupport.SetOptions(c.urlParams_, opts...)
  2172. res, err := c.doRequest("json")
  2173. if res != nil && res.StatusCode == http.StatusNotModified {
  2174. if res.Body != nil {
  2175. res.Body.Close()
  2176. }
  2177. return nil, &googleapi.Error{
  2178. Code: res.StatusCode,
  2179. Header: res.Header,
  2180. }
  2181. }
  2182. if err != nil {
  2183. return nil, err
  2184. }
  2185. defer googleapi.CloseBody(res)
  2186. if err := googleapi.CheckResponse(res); err != nil {
  2187. return nil, err
  2188. }
  2189. ret := &LeaderboardConfiguration{
  2190. ServerResponse: googleapi.ServerResponse{
  2191. Header: res.Header,
  2192. HTTPStatusCode: res.StatusCode,
  2193. },
  2194. }
  2195. target := &ret
  2196. if err := gensupport.DecodeResponse(target, res); err != nil {
  2197. return nil, err
  2198. }
  2199. return ret, nil
  2200. // {
  2201. // "description": "Update the metadata of the leaderboard configuration with the given ID. This method supports patch semantics.",
  2202. // "httpMethod": "PATCH",
  2203. // "id": "gamesConfiguration.leaderboardConfigurations.patch",
  2204. // "parameterOrder": [
  2205. // "leaderboardId"
  2206. // ],
  2207. // "parameters": {
  2208. // "leaderboardId": {
  2209. // "description": "The ID of the leaderboard.",
  2210. // "location": "path",
  2211. // "required": true,
  2212. // "type": "string"
  2213. // }
  2214. // },
  2215. // "path": "leaderboards/{leaderboardId}",
  2216. // "request": {
  2217. // "$ref": "LeaderboardConfiguration"
  2218. // },
  2219. // "response": {
  2220. // "$ref": "LeaderboardConfiguration"
  2221. // },
  2222. // "scopes": [
  2223. // "https://www.googleapis.com/auth/androidpublisher"
  2224. // ]
  2225. // }
  2226. }
  2227. // method id "gamesConfiguration.leaderboardConfigurations.update":
  2228. type LeaderboardConfigurationsUpdateCall struct {
  2229. s *Service
  2230. leaderboardId string
  2231. leaderboardconfiguration *LeaderboardConfiguration
  2232. urlParams_ gensupport.URLParams
  2233. ctx_ context.Context
  2234. header_ http.Header
  2235. }
  2236. // Update: Update the metadata of the leaderboard configuration with the
  2237. // given ID.
  2238. func (r *LeaderboardConfigurationsService) Update(leaderboardId string, leaderboardconfiguration *LeaderboardConfiguration) *LeaderboardConfigurationsUpdateCall {
  2239. c := &LeaderboardConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2240. c.leaderboardId = leaderboardId
  2241. c.leaderboardconfiguration = leaderboardconfiguration
  2242. return c
  2243. }
  2244. // Fields allows partial responses to be retrieved. See
  2245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2246. // for more information.
  2247. func (c *LeaderboardConfigurationsUpdateCall) Fields(s ...googleapi.Field) *LeaderboardConfigurationsUpdateCall {
  2248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2249. return c
  2250. }
  2251. // Context sets the context to be used in this call's Do method. Any
  2252. // pending HTTP request will be aborted if the provided context is
  2253. // canceled.
  2254. func (c *LeaderboardConfigurationsUpdateCall) Context(ctx context.Context) *LeaderboardConfigurationsUpdateCall {
  2255. c.ctx_ = ctx
  2256. return c
  2257. }
  2258. // Header returns an http.Header that can be modified by the caller to
  2259. // add HTTP headers to the request.
  2260. func (c *LeaderboardConfigurationsUpdateCall) Header() http.Header {
  2261. if c.header_ == nil {
  2262. c.header_ = make(http.Header)
  2263. }
  2264. return c.header_
  2265. }
  2266. func (c *LeaderboardConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2267. reqHeaders := make(http.Header)
  2268. for k, v := range c.header_ {
  2269. reqHeaders[k] = v
  2270. }
  2271. reqHeaders.Set("User-Agent", c.s.userAgent())
  2272. var body io.Reader = nil
  2273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.leaderboardconfiguration)
  2274. if err != nil {
  2275. return nil, err
  2276. }
  2277. reqHeaders.Set("Content-Type", "application/json")
  2278. c.urlParams_.Set("alt", alt)
  2279. c.urlParams_.Set("prettyPrint", "false")
  2280. urls := googleapi.ResolveRelative(c.s.BasePath, "leaderboards/{leaderboardId}")
  2281. urls += "?" + c.urlParams_.Encode()
  2282. req, err := http.NewRequest("PUT", urls, body)
  2283. if err != nil {
  2284. return nil, err
  2285. }
  2286. req.Header = reqHeaders
  2287. googleapi.Expand(req.URL, map[string]string{
  2288. "leaderboardId": c.leaderboardId,
  2289. })
  2290. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2291. }
  2292. // Do executes the "gamesConfiguration.leaderboardConfigurations.update" call.
  2293. // Exactly one of *LeaderboardConfiguration or error will be non-nil.
  2294. // Any non-2xx status code is an error. Response headers are in either
  2295. // *LeaderboardConfiguration.ServerResponse.Header or (if a response was
  2296. // returned at all) in error.(*googleapi.Error).Header. Use
  2297. // googleapi.IsNotModified to check whether the returned error was
  2298. // because http.StatusNotModified was returned.
  2299. func (c *LeaderboardConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*LeaderboardConfiguration, error) {
  2300. gensupport.SetOptions(c.urlParams_, opts...)
  2301. res, err := c.doRequest("json")
  2302. if res != nil && res.StatusCode == http.StatusNotModified {
  2303. if res.Body != nil {
  2304. res.Body.Close()
  2305. }
  2306. return nil, &googleapi.Error{
  2307. Code: res.StatusCode,
  2308. Header: res.Header,
  2309. }
  2310. }
  2311. if err != nil {
  2312. return nil, err
  2313. }
  2314. defer googleapi.CloseBody(res)
  2315. if err := googleapi.CheckResponse(res); err != nil {
  2316. return nil, err
  2317. }
  2318. ret := &LeaderboardConfiguration{
  2319. ServerResponse: googleapi.ServerResponse{
  2320. Header: res.Header,
  2321. HTTPStatusCode: res.StatusCode,
  2322. },
  2323. }
  2324. target := &ret
  2325. if err := gensupport.DecodeResponse(target, res); err != nil {
  2326. return nil, err
  2327. }
  2328. return ret, nil
  2329. // {
  2330. // "description": "Update the metadata of the leaderboard configuration with the given ID.",
  2331. // "httpMethod": "PUT",
  2332. // "id": "gamesConfiguration.leaderboardConfigurations.update",
  2333. // "parameterOrder": [
  2334. // "leaderboardId"
  2335. // ],
  2336. // "parameters": {
  2337. // "leaderboardId": {
  2338. // "description": "The ID of the leaderboard.",
  2339. // "location": "path",
  2340. // "required": true,
  2341. // "type": "string"
  2342. // }
  2343. // },
  2344. // "path": "leaderboards/{leaderboardId}",
  2345. // "request": {
  2346. // "$ref": "LeaderboardConfiguration"
  2347. // },
  2348. // "response": {
  2349. // "$ref": "LeaderboardConfiguration"
  2350. // },
  2351. // "scopes": [
  2352. // "https://www.googleapis.com/auth/androidpublisher"
  2353. // ]
  2354. // }
  2355. }