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.
 
 
 

2489 lines
86 KiB

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