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

11825 linhas
393 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package androidpublisher provides access to the Google Play Developer API.
  6. //
  7. // For product documentation, see: https://developers.google.com/android-publisher
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/androidpublisher/v2"
  14. // ...
  15. // ctx := context.Background()
  16. // androidpublisherService, err := androidpublisher.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  25. //
  26. // androidpublisherService, err := androidpublisher.NewService(ctx, option.WithAPIKey("AIza..."))
  27. //
  28. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  29. //
  30. // config := &oauth2.Config{...}
  31. // // ...
  32. // token, err := config.Exchange(ctx, ...)
  33. // androidpublisherService, err := androidpublisher.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  34. //
  35. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  36. package androidpublisher // import "google.golang.org/api/androidpublisher/v2"
  37. import (
  38. "bytes"
  39. "context"
  40. "encoding/json"
  41. "errors"
  42. "fmt"
  43. "io"
  44. "net/http"
  45. "net/url"
  46. "strconv"
  47. "strings"
  48. gensupport "google.golang.org/api/gensupport"
  49. googleapi "google.golang.org/api/googleapi"
  50. option "google.golang.org/api/option"
  51. htransport "google.golang.org/api/transport/http"
  52. )
  53. // Always reference these packages, just in case the auto-generated code
  54. // below doesn't.
  55. var _ = bytes.NewBuffer
  56. var _ = strconv.Itoa
  57. var _ = fmt.Sprintf
  58. var _ = json.NewDecoder
  59. var _ = io.Copy
  60. var _ = url.Parse
  61. var _ = gensupport.MarshalJSON
  62. var _ = googleapi.Version
  63. var _ = errors.New
  64. var _ = strings.Replace
  65. var _ = context.Canceled
  66. const apiId = "androidpublisher:v2"
  67. const apiName = "androidpublisher"
  68. const apiVersion = "v2"
  69. const basePath = "https://www.googleapis.com/androidpublisher/v2/applications/"
  70. // OAuth2 scopes used by this API.
  71. const (
  72. // View and manage your Google Play Developer account
  73. AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher"
  74. )
  75. // NewService creates a new Service.
  76. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  77. scopesOption := option.WithScopes(
  78. "https://www.googleapis.com/auth/androidpublisher",
  79. )
  80. // NOTE: prepend, so we don't override user-specified scopes.
  81. opts = append([]option.ClientOption{scopesOption}, opts...)
  82. client, endpoint, err := htransport.NewClient(ctx, opts...)
  83. if err != nil {
  84. return nil, err
  85. }
  86. s, err := New(client)
  87. if err != nil {
  88. return nil, err
  89. }
  90. if endpoint != "" {
  91. s.BasePath = endpoint
  92. }
  93. return s, nil
  94. }
  95. // New creates a new Service. It uses the provided http.Client for requests.
  96. //
  97. // Deprecated: please use NewService instead.
  98. // To provide a custom HTTP client, use option.WithHTTPClient.
  99. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  100. func New(client *http.Client) (*Service, error) {
  101. if client == nil {
  102. return nil, errors.New("client is nil")
  103. }
  104. s := &Service{client: client, BasePath: basePath}
  105. s.Edits = NewEditsService(s)
  106. s.Inappproducts = NewInappproductsService(s)
  107. s.Orders = NewOrdersService(s)
  108. s.Purchases = NewPurchasesService(s)
  109. s.Reviews = NewReviewsService(s)
  110. return s, nil
  111. }
  112. type Service struct {
  113. client *http.Client
  114. BasePath string // API endpoint base URL
  115. UserAgent string // optional additional User-Agent fragment
  116. Edits *EditsService
  117. Inappproducts *InappproductsService
  118. Orders *OrdersService
  119. Purchases *PurchasesService
  120. Reviews *ReviewsService
  121. }
  122. func (s *Service) userAgent() string {
  123. if s.UserAgent == "" {
  124. return googleapi.UserAgent
  125. }
  126. return googleapi.UserAgent + " " + s.UserAgent
  127. }
  128. func NewEditsService(s *Service) *EditsService {
  129. rs := &EditsService{s: s}
  130. rs.Apklistings = NewEditsApklistingsService(s)
  131. rs.Apks = NewEditsApksService(s)
  132. rs.Bundles = NewEditsBundlesService(s)
  133. rs.Deobfuscationfiles = NewEditsDeobfuscationfilesService(s)
  134. rs.Details = NewEditsDetailsService(s)
  135. rs.Expansionfiles = NewEditsExpansionfilesService(s)
  136. rs.Images = NewEditsImagesService(s)
  137. rs.Listings = NewEditsListingsService(s)
  138. rs.Testers = NewEditsTestersService(s)
  139. rs.Tracks = NewEditsTracksService(s)
  140. return rs
  141. }
  142. type EditsService struct {
  143. s *Service
  144. Apklistings *EditsApklistingsService
  145. Apks *EditsApksService
  146. Bundles *EditsBundlesService
  147. Deobfuscationfiles *EditsDeobfuscationfilesService
  148. Details *EditsDetailsService
  149. Expansionfiles *EditsExpansionfilesService
  150. Images *EditsImagesService
  151. Listings *EditsListingsService
  152. Testers *EditsTestersService
  153. Tracks *EditsTracksService
  154. }
  155. func NewEditsApklistingsService(s *Service) *EditsApklistingsService {
  156. rs := &EditsApklistingsService{s: s}
  157. return rs
  158. }
  159. type EditsApklistingsService struct {
  160. s *Service
  161. }
  162. func NewEditsApksService(s *Service) *EditsApksService {
  163. rs := &EditsApksService{s: s}
  164. return rs
  165. }
  166. type EditsApksService struct {
  167. s *Service
  168. }
  169. func NewEditsBundlesService(s *Service) *EditsBundlesService {
  170. rs := &EditsBundlesService{s: s}
  171. return rs
  172. }
  173. type EditsBundlesService struct {
  174. s *Service
  175. }
  176. func NewEditsDeobfuscationfilesService(s *Service) *EditsDeobfuscationfilesService {
  177. rs := &EditsDeobfuscationfilesService{s: s}
  178. return rs
  179. }
  180. type EditsDeobfuscationfilesService struct {
  181. s *Service
  182. }
  183. func NewEditsDetailsService(s *Service) *EditsDetailsService {
  184. rs := &EditsDetailsService{s: s}
  185. return rs
  186. }
  187. type EditsDetailsService struct {
  188. s *Service
  189. }
  190. func NewEditsExpansionfilesService(s *Service) *EditsExpansionfilesService {
  191. rs := &EditsExpansionfilesService{s: s}
  192. return rs
  193. }
  194. type EditsExpansionfilesService struct {
  195. s *Service
  196. }
  197. func NewEditsImagesService(s *Service) *EditsImagesService {
  198. rs := &EditsImagesService{s: s}
  199. return rs
  200. }
  201. type EditsImagesService struct {
  202. s *Service
  203. }
  204. func NewEditsListingsService(s *Service) *EditsListingsService {
  205. rs := &EditsListingsService{s: s}
  206. return rs
  207. }
  208. type EditsListingsService struct {
  209. s *Service
  210. }
  211. func NewEditsTestersService(s *Service) *EditsTestersService {
  212. rs := &EditsTestersService{s: s}
  213. return rs
  214. }
  215. type EditsTestersService struct {
  216. s *Service
  217. }
  218. func NewEditsTracksService(s *Service) *EditsTracksService {
  219. rs := &EditsTracksService{s: s}
  220. return rs
  221. }
  222. type EditsTracksService struct {
  223. s *Service
  224. }
  225. func NewInappproductsService(s *Service) *InappproductsService {
  226. rs := &InappproductsService{s: s}
  227. return rs
  228. }
  229. type InappproductsService struct {
  230. s *Service
  231. }
  232. func NewOrdersService(s *Service) *OrdersService {
  233. rs := &OrdersService{s: s}
  234. return rs
  235. }
  236. type OrdersService struct {
  237. s *Service
  238. }
  239. func NewPurchasesService(s *Service) *PurchasesService {
  240. rs := &PurchasesService{s: s}
  241. rs.Products = NewPurchasesProductsService(s)
  242. rs.Subscriptions = NewPurchasesSubscriptionsService(s)
  243. rs.Voidedpurchases = NewPurchasesVoidedpurchasesService(s)
  244. return rs
  245. }
  246. type PurchasesService struct {
  247. s *Service
  248. Products *PurchasesProductsService
  249. Subscriptions *PurchasesSubscriptionsService
  250. Voidedpurchases *PurchasesVoidedpurchasesService
  251. }
  252. func NewPurchasesProductsService(s *Service) *PurchasesProductsService {
  253. rs := &PurchasesProductsService{s: s}
  254. return rs
  255. }
  256. type PurchasesProductsService struct {
  257. s *Service
  258. }
  259. func NewPurchasesSubscriptionsService(s *Service) *PurchasesSubscriptionsService {
  260. rs := &PurchasesSubscriptionsService{s: s}
  261. return rs
  262. }
  263. type PurchasesSubscriptionsService struct {
  264. s *Service
  265. }
  266. func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService {
  267. rs := &PurchasesVoidedpurchasesService{s: s}
  268. return rs
  269. }
  270. type PurchasesVoidedpurchasesService struct {
  271. s *Service
  272. }
  273. func NewReviewsService(s *Service) *ReviewsService {
  274. rs := &ReviewsService{s: s}
  275. return rs
  276. }
  277. type ReviewsService struct {
  278. s *Service
  279. }
  280. type Apk struct {
  281. // Binary: Information about the binary payload of this APK.
  282. Binary *ApkBinary `json:"binary,omitempty"`
  283. // VersionCode: The version code of the APK, as specified in the APK's
  284. // manifest file.
  285. VersionCode int64 `json:"versionCode,omitempty"`
  286. // ServerResponse contains the HTTP response code and headers from the
  287. // server.
  288. googleapi.ServerResponse `json:"-"`
  289. // ForceSendFields is a list of field names (e.g. "Binary") to
  290. // unconditionally include in API requests. By default, fields with
  291. // empty values are omitted from API requests. However, any non-pointer,
  292. // non-interface field appearing in ForceSendFields will be sent to the
  293. // server regardless of whether the field is empty or not. This may be
  294. // used to include empty fields in Patch requests.
  295. ForceSendFields []string `json:"-"`
  296. // NullFields is a list of field names (e.g. "Binary") to include in API
  297. // requests with the JSON null value. By default, fields with empty
  298. // values are omitted from API requests. However, any field with an
  299. // empty value appearing in NullFields will be sent to the server as
  300. // null. It is an error if a field in this list has a non-empty value.
  301. // This may be used to include null fields in Patch requests.
  302. NullFields []string `json:"-"`
  303. }
  304. func (s *Apk) MarshalJSON() ([]byte, error) {
  305. type NoMethod Apk
  306. raw := NoMethod(*s)
  307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  308. }
  309. // ApkBinary: Represents the binary payload of an APK.
  310. type ApkBinary struct {
  311. // Sha1: A sha1 hash of the APK payload, encoded as a hex string and
  312. // matching the output of the sha1sum command.
  313. Sha1 string `json:"sha1,omitempty"`
  314. // Sha256: A sha256 hash of the APK payload, encoded as a hex string and
  315. // matching the output of the sha256sum command.
  316. Sha256 string `json:"sha256,omitempty"`
  317. // ForceSendFields is a list of field names (e.g. "Sha1") 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. "Sha1") to include in API
  325. // 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 *ApkBinary) MarshalJSON() ([]byte, error) {
  333. type NoMethod ApkBinary
  334. raw := NoMethod(*s)
  335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  336. }
  337. type ApkListing struct {
  338. // Language: The language code, in BCP 47 format (eg "en-US").
  339. Language string `json:"language,omitempty"`
  340. // RecentChanges: Describe what's new in your APK.
  341. RecentChanges string `json:"recentChanges,omitempty"`
  342. // ServerResponse contains the HTTP response code and headers from the
  343. // server.
  344. googleapi.ServerResponse `json:"-"`
  345. // ForceSendFields is a list of field names (e.g. "Language") to
  346. // unconditionally include in API requests. By default, fields with
  347. // empty values are omitted from API requests. However, any non-pointer,
  348. // non-interface field appearing in ForceSendFields will be sent to the
  349. // server regardless of whether the field is empty or not. This may be
  350. // used to include empty fields in Patch requests.
  351. ForceSendFields []string `json:"-"`
  352. // NullFields is a list of field names (e.g. "Language") to include in
  353. // API requests with the JSON null value. By default, fields with empty
  354. // values are omitted from API requests. However, any field with an
  355. // empty value appearing in NullFields will be sent to the server as
  356. // null. It is an error if a field in this list has a non-empty value.
  357. // This may be used to include null fields in Patch requests.
  358. NullFields []string `json:"-"`
  359. }
  360. func (s *ApkListing) MarshalJSON() ([]byte, error) {
  361. type NoMethod ApkListing
  362. raw := NoMethod(*s)
  363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  364. }
  365. type ApkListingsListResponse struct {
  366. // Kind: Identifies what kind of resource this is. Value: the fixed
  367. // string "androidpublisher#apkListingsListResponse".
  368. Kind string `json:"kind,omitempty"`
  369. Listings []*ApkListing `json:"listings,omitempty"`
  370. // ServerResponse contains the HTTP response code and headers from the
  371. // server.
  372. googleapi.ServerResponse `json:"-"`
  373. // ForceSendFields is a list of field names (e.g. "Kind") to
  374. // unconditionally include in API requests. By default, fields with
  375. // empty values are omitted from API requests. However, any non-pointer,
  376. // non-interface field appearing in ForceSendFields will be sent to the
  377. // server regardless of whether the field is empty or not. This may be
  378. // used to include empty fields in Patch requests.
  379. ForceSendFields []string `json:"-"`
  380. // NullFields is a list of field names (e.g. "Kind") to include in API
  381. // requests with the JSON null value. By default, fields with empty
  382. // values are omitted from API requests. However, any field with an
  383. // empty value appearing in NullFields will be sent to the server as
  384. // null. It is an error if a field in this list has a non-empty value.
  385. // This may be used to include null fields in Patch requests.
  386. NullFields []string `json:"-"`
  387. }
  388. func (s *ApkListingsListResponse) MarshalJSON() ([]byte, error) {
  389. type NoMethod ApkListingsListResponse
  390. raw := NoMethod(*s)
  391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  392. }
  393. type ApksAddExternallyHostedRequest struct {
  394. // ExternallyHostedApk: The definition of the externally-hosted APK and
  395. // where it is located.
  396. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  397. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  398. // to unconditionally include in API requests. By default, fields with
  399. // empty values are omitted from API requests. However, any non-pointer,
  400. // non-interface field appearing in ForceSendFields will be sent to the
  401. // server regardless of whether the field is empty or not. This may be
  402. // used to include empty fields in Patch requests.
  403. ForceSendFields []string `json:"-"`
  404. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  405. // include in API requests with the JSON null value. By default, fields
  406. // with empty values are omitted from API requests. However, any field
  407. // with an empty value appearing in NullFields will be sent to the
  408. // server as null. It is an error if a field in this list has a
  409. // non-empty value. This may be used to include null fields in Patch
  410. // requests.
  411. NullFields []string `json:"-"`
  412. }
  413. func (s *ApksAddExternallyHostedRequest) MarshalJSON() ([]byte, error) {
  414. type NoMethod ApksAddExternallyHostedRequest
  415. raw := NoMethod(*s)
  416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  417. }
  418. type ApksAddExternallyHostedResponse struct {
  419. // ExternallyHostedApk: The definition of the externally-hosted APK and
  420. // where it is located.
  421. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  422. // ServerResponse contains the HTTP response code and headers from the
  423. // server.
  424. googleapi.ServerResponse `json:"-"`
  425. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  426. // to unconditionally include in API requests. By default, fields with
  427. // empty values are omitted from API requests. However, any non-pointer,
  428. // non-interface field appearing in ForceSendFields will be sent to the
  429. // server regardless of whether the field is empty or not. This may be
  430. // used to include empty fields in Patch requests.
  431. ForceSendFields []string `json:"-"`
  432. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  433. // include in API requests with the JSON null value. By default, fields
  434. // with empty values are omitted from API requests. However, any field
  435. // with an empty value appearing in NullFields will be sent to the
  436. // server as null. It is an error if a field in this list has a
  437. // non-empty value. This may be used to include null fields in Patch
  438. // requests.
  439. NullFields []string `json:"-"`
  440. }
  441. func (s *ApksAddExternallyHostedResponse) MarshalJSON() ([]byte, error) {
  442. type NoMethod ApksAddExternallyHostedResponse
  443. raw := NoMethod(*s)
  444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  445. }
  446. type ApksListResponse struct {
  447. Apks []*Apk `json:"apks,omitempty"`
  448. // Kind: Identifies what kind of resource this is. Value: the fixed
  449. // string "androidpublisher#apksListResponse".
  450. Kind string `json:"kind,omitempty"`
  451. // ServerResponse contains the HTTP response code and headers from the
  452. // server.
  453. googleapi.ServerResponse `json:"-"`
  454. // ForceSendFields is a list of field names (e.g. "Apks") to
  455. // unconditionally include in API requests. By default, fields with
  456. // empty values are omitted from API requests. However, any non-pointer,
  457. // non-interface field appearing in ForceSendFields will be sent to the
  458. // server regardless of whether the field is empty or not. This may be
  459. // used to include empty fields in Patch requests.
  460. ForceSendFields []string `json:"-"`
  461. // NullFields is a list of field names (e.g. "Apks") to include in API
  462. // requests with the JSON null value. By default, fields with empty
  463. // values are omitted from API requests. However, any field with an
  464. // empty value appearing in NullFields will be sent to the server as
  465. // null. It is an error if a field in this list has a non-empty value.
  466. // This may be used to include null fields in Patch requests.
  467. NullFields []string `json:"-"`
  468. }
  469. func (s *ApksListResponse) MarshalJSON() ([]byte, error) {
  470. type NoMethod ApksListResponse
  471. raw := NoMethod(*s)
  472. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  473. }
  474. type AppDetails struct {
  475. // ContactEmail: The user-visible support email for this app.
  476. ContactEmail string `json:"contactEmail,omitempty"`
  477. // ContactPhone: The user-visible support telephone number for this app.
  478. ContactPhone string `json:"contactPhone,omitempty"`
  479. // ContactWebsite: The user-visible website for this app.
  480. ContactWebsite string `json:"contactWebsite,omitempty"`
  481. // DefaultLanguage: Default language code, in BCP 47 format (eg
  482. // "en-US").
  483. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  484. // ServerResponse contains the HTTP response code and headers from the
  485. // server.
  486. googleapi.ServerResponse `json:"-"`
  487. // ForceSendFields is a list of field names (e.g. "ContactEmail") to
  488. // unconditionally include in API requests. By default, fields with
  489. // empty values are omitted from API requests. However, any non-pointer,
  490. // non-interface field appearing in ForceSendFields will be sent to the
  491. // server regardless of whether the field is empty or not. This may be
  492. // used to include empty fields in Patch requests.
  493. ForceSendFields []string `json:"-"`
  494. // NullFields is a list of field names (e.g. "ContactEmail") to include
  495. // in API requests with the JSON null value. By default, fields with
  496. // empty values are omitted from API requests. However, any field with
  497. // an empty value appearing in NullFields will be sent to the server as
  498. // null. It is an error if a field in this list has a non-empty value.
  499. // This may be used to include null fields in Patch requests.
  500. NullFields []string `json:"-"`
  501. }
  502. func (s *AppDetails) MarshalJSON() ([]byte, error) {
  503. type NoMethod AppDetails
  504. raw := NoMethod(*s)
  505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  506. }
  507. // AppEdit: Represents an edit of an app. An edit allows clients to make
  508. // multiple changes before committing them in one operation.
  509. type AppEdit struct {
  510. // ExpiryTimeSeconds: The time at which the edit will expire and will be
  511. // no longer valid for use in any subsequent API calls (encoded as
  512. // seconds since the Epoch).
  513. ExpiryTimeSeconds string `json:"expiryTimeSeconds,omitempty"`
  514. // Id: The ID of the edit that can be used in subsequent API calls.
  515. Id string `json:"id,omitempty"`
  516. // ServerResponse contains the HTTP response code and headers from the
  517. // server.
  518. googleapi.ServerResponse `json:"-"`
  519. // ForceSendFields is a list of field names (e.g. "ExpiryTimeSeconds")
  520. // to unconditionally include in API requests. By default, fields with
  521. // empty values are omitted from API requests. However, any non-pointer,
  522. // non-interface field appearing in ForceSendFields will be sent to the
  523. // server regardless of whether the field is empty or not. This may be
  524. // used to include empty fields in Patch requests.
  525. ForceSendFields []string `json:"-"`
  526. // NullFields is a list of field names (e.g. "ExpiryTimeSeconds") to
  527. // include in API requests with the JSON null value. By default, fields
  528. // with empty values are omitted from API requests. However, any field
  529. // with an empty value appearing in NullFields will be sent to the
  530. // server as null. It is an error if a field in this list has a
  531. // non-empty value. This may be used to include null fields in Patch
  532. // requests.
  533. NullFields []string `json:"-"`
  534. }
  535. func (s *AppEdit) MarshalJSON() ([]byte, error) {
  536. type NoMethod AppEdit
  537. raw := NoMethod(*s)
  538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  539. }
  540. type Bundle struct {
  541. // Sha1: A sha1 hash of the upload payload, encoded as a hex string and
  542. // matching the output of the sha1sum command.
  543. Sha1 string `json:"sha1,omitempty"`
  544. // Sha256: A sha256 hash of the upload payload, encoded as a hex string
  545. // and matching the output of the sha256sum command.
  546. Sha256 string `json:"sha256,omitempty"`
  547. // VersionCode: The version code of the Android App Bundle. As specified
  548. // in the Android App Bundle's base module APK manifest file.
  549. VersionCode int64 `json:"versionCode,omitempty"`
  550. // ServerResponse contains the HTTP response code and headers from the
  551. // server.
  552. googleapi.ServerResponse `json:"-"`
  553. // ForceSendFields is a list of field names (e.g. "Sha1") to
  554. // unconditionally include in API requests. By default, fields with
  555. // empty values are omitted from API requests. However, any non-pointer,
  556. // non-interface field appearing in ForceSendFields will be sent to the
  557. // server regardless of whether the field is empty or not. This may be
  558. // used to include empty fields in Patch requests.
  559. ForceSendFields []string `json:"-"`
  560. // NullFields is a list of field names (e.g. "Sha1") to include in API
  561. // requests with the JSON null value. By default, fields with empty
  562. // values are omitted from API requests. However, any field with an
  563. // empty value appearing in NullFields will be sent to the server as
  564. // null. It is an error if a field in this list has a non-empty value.
  565. // This may be used to include null fields in Patch requests.
  566. NullFields []string `json:"-"`
  567. }
  568. func (s *Bundle) MarshalJSON() ([]byte, error) {
  569. type NoMethod Bundle
  570. raw := NoMethod(*s)
  571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  572. }
  573. type BundlesListResponse struct {
  574. Bundles []*Bundle `json:"bundles,omitempty"`
  575. // Kind: Identifies what kind of resource this is. Value: the fixed
  576. // string "androidpublisher#bundlesListResponse".
  577. Kind string `json:"kind,omitempty"`
  578. // ServerResponse contains the HTTP response code and headers from the
  579. // server.
  580. googleapi.ServerResponse `json:"-"`
  581. // ForceSendFields is a list of field names (e.g. "Bundles") to
  582. // unconditionally include in API requests. By default, fields with
  583. // empty values are omitted from API requests. However, any non-pointer,
  584. // non-interface field appearing in ForceSendFields will be sent to the
  585. // server regardless of whether the field is empty or not. This may be
  586. // used to include empty fields in Patch requests.
  587. ForceSendFields []string `json:"-"`
  588. // NullFields is a list of field names (e.g. "Bundles") to include in
  589. // API requests with the JSON null value. By default, fields with empty
  590. // values are omitted from API requests. However, any field with an
  591. // empty value appearing in NullFields will be sent to the server as
  592. // null. It is an error if a field in this list has a non-empty value.
  593. // This may be used to include null fields in Patch requests.
  594. NullFields []string `json:"-"`
  595. }
  596. func (s *BundlesListResponse) MarshalJSON() ([]byte, error) {
  597. type NoMethod BundlesListResponse
  598. raw := NoMethod(*s)
  599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  600. }
  601. type Comment struct {
  602. // DeveloperComment: A comment from a developer.
  603. DeveloperComment *DeveloperComment `json:"developerComment,omitempty"`
  604. // UserComment: A comment from a user.
  605. UserComment *UserComment `json:"userComment,omitempty"`
  606. // ForceSendFields is a list of field names (e.g. "DeveloperComment") to
  607. // unconditionally include in API requests. By default, fields with
  608. // empty values are omitted from API requests. However, any non-pointer,
  609. // non-interface field appearing in ForceSendFields will be sent to the
  610. // server regardless of whether the field is empty or not. This may be
  611. // used to include empty fields in Patch requests.
  612. ForceSendFields []string `json:"-"`
  613. // NullFields is a list of field names (e.g. "DeveloperComment") to
  614. // include in API requests with the JSON null value. By default, fields
  615. // with empty values are omitted from API requests. However, any field
  616. // with an empty value appearing in NullFields will be sent to the
  617. // server as null. It is an error if a field in this list has a
  618. // non-empty value. This may be used to include null fields in Patch
  619. // requests.
  620. NullFields []string `json:"-"`
  621. }
  622. func (s *Comment) MarshalJSON() ([]byte, error) {
  623. type NoMethod Comment
  624. raw := NoMethod(*s)
  625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  626. }
  627. // DeobfuscationFile: Represents a deobfuscation file.
  628. type DeobfuscationFile struct {
  629. // SymbolType: The type of the deobfuscation file.
  630. SymbolType string `json:"symbolType,omitempty"`
  631. // ForceSendFields is a list of field names (e.g. "SymbolType") to
  632. // unconditionally include in API requests. By default, fields with
  633. // empty values are omitted from API requests. However, any non-pointer,
  634. // non-interface field appearing in ForceSendFields will be sent to the
  635. // server regardless of whether the field is empty or not. This may be
  636. // used to include empty fields in Patch requests.
  637. ForceSendFields []string `json:"-"`
  638. // NullFields is a list of field names (e.g. "SymbolType") to include in
  639. // API requests with the JSON null value. By default, fields with empty
  640. // values are omitted from API requests. However, any field with an
  641. // empty value appearing in NullFields will be sent to the server as
  642. // null. It is an error if a field in this list has a non-empty value.
  643. // This may be used to include null fields in Patch requests.
  644. NullFields []string `json:"-"`
  645. }
  646. func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) {
  647. type NoMethod DeobfuscationFile
  648. raw := NoMethod(*s)
  649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  650. }
  651. type DeobfuscationFilesUploadResponse struct {
  652. DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"`
  653. // ServerResponse contains the HTTP response code and headers from the
  654. // server.
  655. googleapi.ServerResponse `json:"-"`
  656. // ForceSendFields is a list of field names (e.g. "DeobfuscationFile")
  657. // to unconditionally include in API requests. By default, fields with
  658. // empty values are omitted from API requests. However, any non-pointer,
  659. // non-interface field appearing in ForceSendFields will be sent to the
  660. // server regardless of whether the field is empty or not. This may be
  661. // used to include empty fields in Patch requests.
  662. ForceSendFields []string `json:"-"`
  663. // NullFields is a list of field names (e.g. "DeobfuscationFile") to
  664. // include in API requests with the JSON null value. By default, fields
  665. // with empty values are omitted from API requests. However, any field
  666. // with an empty value appearing in NullFields will be sent to the
  667. // server as null. It is an error if a field in this list has a
  668. // non-empty value. This may be used to include null fields in Patch
  669. // requests.
  670. NullFields []string `json:"-"`
  671. }
  672. func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) {
  673. type NoMethod DeobfuscationFilesUploadResponse
  674. raw := NoMethod(*s)
  675. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  676. }
  677. type DeveloperComment struct {
  678. // LastModified: The last time at which this comment was updated.
  679. LastModified *Timestamp `json:"lastModified,omitempty"`
  680. // Text: The content of the comment, i.e. reply body.
  681. Text string `json:"text,omitempty"`
  682. // ForceSendFields is a list of field names (e.g. "LastModified") to
  683. // unconditionally include in API requests. By default, fields with
  684. // empty values are omitted from API requests. However, any non-pointer,
  685. // non-interface field appearing in ForceSendFields will be sent to the
  686. // server regardless of whether the field is empty or not. This may be
  687. // used to include empty fields in Patch requests.
  688. ForceSendFields []string `json:"-"`
  689. // NullFields is a list of field names (e.g. "LastModified") to include
  690. // in API requests with the JSON null value. By default, fields with
  691. // empty values are omitted from API requests. However, any field with
  692. // an empty value appearing in NullFields will be sent to the server as
  693. // null. It is an error if a field in this list has a non-empty value.
  694. // This may be used to include null fields in Patch requests.
  695. NullFields []string `json:"-"`
  696. }
  697. func (s *DeveloperComment) MarshalJSON() ([]byte, error) {
  698. type NoMethod DeveloperComment
  699. raw := NoMethod(*s)
  700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  701. }
  702. type DeviceMetadata struct {
  703. // CpuMake: Device CPU make e.g. "Qualcomm"
  704. CpuMake string `json:"cpuMake,omitempty"`
  705. // CpuModel: Device CPU model e.g. "MSM8974"
  706. CpuModel string `json:"cpuModel,omitempty"`
  707. // DeviceClass: Device class (e.g. tablet)
  708. DeviceClass string `json:"deviceClass,omitempty"`
  709. // GlEsVersion: OpenGL version
  710. GlEsVersion int64 `json:"glEsVersion,omitempty"`
  711. // Manufacturer: Device manufacturer (e.g. Motorola)
  712. Manufacturer string `json:"manufacturer,omitempty"`
  713. // NativePlatform: Comma separated list of native platforms (e.g. "arm",
  714. // "arm7")
  715. NativePlatform string `json:"nativePlatform,omitempty"`
  716. // ProductName: Device model name (e.g. Droid)
  717. ProductName string `json:"productName,omitempty"`
  718. // RamMb: Device RAM in Megabytes e.g. "2048"
  719. RamMb int64 `json:"ramMb,omitempty"`
  720. // ScreenDensityDpi: Screen density in DPI
  721. ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"`
  722. // ScreenHeightPx: Screen height in pixels
  723. ScreenHeightPx int64 `json:"screenHeightPx,omitempty"`
  724. // ScreenWidthPx: Screen width in pixels
  725. ScreenWidthPx int64 `json:"screenWidthPx,omitempty"`
  726. // ForceSendFields is a list of field names (e.g. "CpuMake") to
  727. // unconditionally include in API requests. By default, fields with
  728. // empty values are omitted from API requests. However, any non-pointer,
  729. // non-interface field appearing in ForceSendFields will be sent to the
  730. // server regardless of whether the field is empty or not. This may be
  731. // used to include empty fields in Patch requests.
  732. ForceSendFields []string `json:"-"`
  733. // NullFields is a list of field names (e.g. "CpuMake") to include in
  734. // API requests with the JSON null value. By default, fields with empty
  735. // values are omitted from API requests. However, any field with an
  736. // empty value appearing in NullFields will be sent to the server as
  737. // null. It is an error if a field in this list has a non-empty value.
  738. // This may be used to include null fields in Patch requests.
  739. NullFields []string `json:"-"`
  740. }
  741. func (s *DeviceMetadata) MarshalJSON() ([]byte, error) {
  742. type NoMethod DeviceMetadata
  743. raw := NoMethod(*s)
  744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  745. }
  746. type ExpansionFile struct {
  747. // FileSize: If set this field indicates that this APK has an Expansion
  748. // File uploaded to it: this APK does not reference another APK's
  749. // Expansion File. The field's value is the size of the uploaded
  750. // Expansion File in bytes.
  751. FileSize int64 `json:"fileSize,omitempty,string"`
  752. // ReferencesVersion: If set this APK's Expansion File references
  753. // another APK's Expansion File. The file_size field will not be set.
  754. ReferencesVersion int64 `json:"referencesVersion,omitempty"`
  755. // ServerResponse contains the HTTP response code and headers from the
  756. // server.
  757. googleapi.ServerResponse `json:"-"`
  758. // ForceSendFields is a list of field names (e.g. "FileSize") to
  759. // unconditionally include in API requests. By default, fields with
  760. // empty values are omitted from API requests. However, any non-pointer,
  761. // non-interface field appearing in ForceSendFields will be sent to the
  762. // server regardless of whether the field is empty or not. This may be
  763. // used to include empty fields in Patch requests.
  764. ForceSendFields []string `json:"-"`
  765. // NullFields is a list of field names (e.g. "FileSize") to include in
  766. // API requests with the JSON null value. By default, fields with empty
  767. // values are omitted from API requests. However, any field with an
  768. // empty value appearing in NullFields will be sent to the server as
  769. // null. It is an error if a field in this list has a non-empty value.
  770. // This may be used to include null fields in Patch requests.
  771. NullFields []string `json:"-"`
  772. }
  773. func (s *ExpansionFile) MarshalJSON() ([]byte, error) {
  774. type NoMethod ExpansionFile
  775. raw := NoMethod(*s)
  776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  777. }
  778. type ExpansionFilesUploadResponse struct {
  779. ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"`
  780. // ServerResponse contains the HTTP response code and headers from the
  781. // server.
  782. googleapi.ServerResponse `json:"-"`
  783. // ForceSendFields is a list of field names (e.g. "ExpansionFile") to
  784. // unconditionally include in API requests. By default, fields with
  785. // empty values are omitted from API requests. However, any non-pointer,
  786. // non-interface field appearing in ForceSendFields will be sent to the
  787. // server regardless of whether the field is empty or not. This may be
  788. // used to include empty fields in Patch requests.
  789. ForceSendFields []string `json:"-"`
  790. // NullFields is a list of field names (e.g. "ExpansionFile") to include
  791. // in API requests with the JSON null value. By default, fields with
  792. // empty values are omitted from API requests. However, any field with
  793. // an empty value appearing in NullFields will be sent to the server as
  794. // null. It is an error if a field in this list has a non-empty value.
  795. // This may be used to include null fields in Patch requests.
  796. NullFields []string `json:"-"`
  797. }
  798. func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) {
  799. type NoMethod ExpansionFilesUploadResponse
  800. raw := NoMethod(*s)
  801. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  802. }
  803. // ExternallyHostedApk: Defines an APK available for this application
  804. // that is hosted externally and not uploaded to Google Play. This
  805. // function is only available to enterprises who are using Google Play
  806. // for Work, and whos application is restricted to the enterprise
  807. // private channel
  808. type ExternallyHostedApk struct {
  809. // ApplicationLabel: The application label.
  810. ApplicationLabel string `json:"applicationLabel,omitempty"`
  811. // CertificateBase64s: A certificate (or array of certificates if a
  812. // certificate-chain is used) used to signed this APK, represented as a
  813. // base64 encoded byte array.
  814. CertificateBase64s []string `json:"certificateBase64s,omitempty"`
  815. // ExternallyHostedUrl: The URL at which the APK is hosted. This must be
  816. // an https URL.
  817. ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"`
  818. // FileSha1Base64: The SHA1 checksum of this APK, represented as a
  819. // base64 encoded byte array.
  820. FileSha1Base64 string `json:"fileSha1Base64,omitempty"`
  821. // FileSha256Base64: The SHA256 checksum of this APK, represented as a
  822. // base64 encoded byte array.
  823. FileSha256Base64 string `json:"fileSha256Base64,omitempty"`
  824. // FileSize: The file size in bytes of this APK.
  825. FileSize int64 `json:"fileSize,omitempty,string"`
  826. // IconBase64: The icon image from the APK, as a base64 encoded byte
  827. // array.
  828. IconBase64 string `json:"iconBase64,omitempty"`
  829. // MaximumSdk: The maximum SDK supported by this APK (optional).
  830. MaximumSdk int64 `json:"maximumSdk,omitempty"`
  831. // MinimumSdk: The minimum SDK targeted by this APK.
  832. MinimumSdk int64 `json:"minimumSdk,omitempty"`
  833. // NativeCodes: The native code environments supported by this APK
  834. // (optional).
  835. NativeCodes []string `json:"nativeCodes,omitempty"`
  836. // PackageName: The package name.
  837. PackageName string `json:"packageName,omitempty"`
  838. // UsesFeatures: The features required by this APK (optional).
  839. UsesFeatures []string `json:"usesFeatures,omitempty"`
  840. // UsesPermissions: The permissions requested by this APK.
  841. UsesPermissions []*ExternallyHostedApkUsesPermission `json:"usesPermissions,omitempty"`
  842. // VersionCode: The version code of this APK.
  843. VersionCode int64 `json:"versionCode,omitempty"`
  844. // VersionName: The version name of this APK.
  845. VersionName string `json:"versionName,omitempty"`
  846. // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to
  847. // unconditionally include in API requests. By default, fields with
  848. // empty values are omitted from API requests. However, any non-pointer,
  849. // non-interface field appearing in ForceSendFields will be sent to the
  850. // server regardless of whether the field is empty or not. This may be
  851. // used to include empty fields in Patch requests.
  852. ForceSendFields []string `json:"-"`
  853. // NullFields is a list of field names (e.g. "ApplicationLabel") to
  854. // include in API requests with the JSON null value. By default, fields
  855. // with empty values are omitted from API requests. However, any field
  856. // with an empty value appearing in NullFields will be sent to the
  857. // server as null. It is an error if a field in this list has a
  858. // non-empty value. This may be used to include null fields in Patch
  859. // requests.
  860. NullFields []string `json:"-"`
  861. }
  862. func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) {
  863. type NoMethod ExternallyHostedApk
  864. raw := NoMethod(*s)
  865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  866. }
  867. // ExternallyHostedApkUsesPermission: A permission used by this APK.
  868. type ExternallyHostedApkUsesPermission struct {
  869. // MaxSdkVersion: Optionally, the maximum SDK version for which the
  870. // permission is required.
  871. MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"`
  872. // Name: The name of the permission requested.
  873. Name string `json:"name,omitempty"`
  874. // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to
  875. // unconditionally include in API requests. By default, fields with
  876. // empty values are omitted from API requests. However, any non-pointer,
  877. // non-interface field appearing in ForceSendFields will be sent to the
  878. // server regardless of whether the field is empty or not. This may be
  879. // used to include empty fields in Patch requests.
  880. ForceSendFields []string `json:"-"`
  881. // NullFields is a list of field names (e.g. "MaxSdkVersion") to include
  882. // in API requests with the JSON null value. By default, fields with
  883. // empty values are omitted from API requests. However, any field with
  884. // an empty value appearing in NullFields will be sent to the server as
  885. // null. It is an error if a field in this list has a non-empty value.
  886. // This may be used to include null fields in Patch requests.
  887. NullFields []string `json:"-"`
  888. }
  889. func (s *ExternallyHostedApkUsesPermission) MarshalJSON() ([]byte, error) {
  890. type NoMethod ExternallyHostedApkUsesPermission
  891. raw := NoMethod(*s)
  892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  893. }
  894. type Image struct {
  895. // Id: A unique id representing this image.
  896. Id string `json:"id,omitempty"`
  897. // Sha1: A sha1 hash of the image that was uploaded.
  898. Sha1 string `json:"sha1,omitempty"`
  899. // Url: A URL that will serve a preview of the image.
  900. Url string `json:"url,omitempty"`
  901. // ForceSendFields is a list of field names (e.g. "Id") to
  902. // unconditionally include in API requests. By default, fields with
  903. // empty values are omitted from API requests. However, any non-pointer,
  904. // non-interface field appearing in ForceSendFields will be sent to the
  905. // server regardless of whether the field is empty or not. This may be
  906. // used to include empty fields in Patch requests.
  907. ForceSendFields []string `json:"-"`
  908. // NullFields is a list of field names (e.g. "Id") to include in API
  909. // requests with the JSON null value. By default, fields with empty
  910. // values are omitted from API requests. However, any field with an
  911. // empty value appearing in NullFields will be sent to the server as
  912. // null. It is an error if a field in this list has a non-empty value.
  913. // This may be used to include null fields in Patch requests.
  914. NullFields []string `json:"-"`
  915. }
  916. func (s *Image) MarshalJSON() ([]byte, error) {
  917. type NoMethod Image
  918. raw := NoMethod(*s)
  919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  920. }
  921. type ImagesDeleteAllResponse struct {
  922. Deleted []*Image `json:"deleted,omitempty"`
  923. // ServerResponse contains the HTTP response code and headers from the
  924. // server.
  925. googleapi.ServerResponse `json:"-"`
  926. // ForceSendFields is a list of field names (e.g. "Deleted") to
  927. // unconditionally include in API requests. By default, fields with
  928. // empty values are omitted from API requests. However, any non-pointer,
  929. // non-interface field appearing in ForceSendFields will be sent to the
  930. // server regardless of whether the field is empty or not. This may be
  931. // used to include empty fields in Patch requests.
  932. ForceSendFields []string `json:"-"`
  933. // NullFields is a list of field names (e.g. "Deleted") to include in
  934. // API requests with the JSON null value. By default, fields with empty
  935. // values are omitted from API requests. However, any field with an
  936. // empty value appearing in NullFields will be sent to the server as
  937. // null. It is an error if a field in this list has a non-empty value.
  938. // This may be used to include null fields in Patch requests.
  939. NullFields []string `json:"-"`
  940. }
  941. func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) {
  942. type NoMethod ImagesDeleteAllResponse
  943. raw := NoMethod(*s)
  944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  945. }
  946. type ImagesListResponse struct {
  947. Images []*Image `json:"images,omitempty"`
  948. // ServerResponse contains the HTTP response code and headers from the
  949. // server.
  950. googleapi.ServerResponse `json:"-"`
  951. // ForceSendFields is a list of field names (e.g. "Images") to
  952. // unconditionally include in API requests. By default, fields with
  953. // empty values are omitted from API requests. However, any non-pointer,
  954. // non-interface field appearing in ForceSendFields will be sent to the
  955. // server regardless of whether the field is empty or not. This may be
  956. // used to include empty fields in Patch requests.
  957. ForceSendFields []string `json:"-"`
  958. // NullFields is a list of field names (e.g. "Images") to include in API
  959. // requests with the JSON null value. By default, fields with empty
  960. // values are omitted from API requests. However, any field with an
  961. // empty value appearing in NullFields will be sent to the server as
  962. // null. It is an error if a field in this list has a non-empty value.
  963. // This may be used to include null fields in Patch requests.
  964. NullFields []string `json:"-"`
  965. }
  966. func (s *ImagesListResponse) MarshalJSON() ([]byte, error) {
  967. type NoMethod ImagesListResponse
  968. raw := NoMethod(*s)
  969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  970. }
  971. type ImagesUploadResponse struct {
  972. Image *Image `json:"image,omitempty"`
  973. // ServerResponse contains the HTTP response code and headers from the
  974. // server.
  975. googleapi.ServerResponse `json:"-"`
  976. // ForceSendFields is a list of field names (e.g. "Image") to
  977. // unconditionally include in API requests. By default, fields with
  978. // empty values are omitted from API requests. However, any non-pointer,
  979. // non-interface field appearing in ForceSendFields will be sent to the
  980. // server regardless of whether the field is empty or not. This may be
  981. // used to include empty fields in Patch requests.
  982. ForceSendFields []string `json:"-"`
  983. // NullFields is a list of field names (e.g. "Image") to include in API
  984. // requests with the JSON null value. By default, fields with empty
  985. // values are omitted from API requests. However, any field with an
  986. // empty value appearing in NullFields will be sent to the server as
  987. // null. It is an error if a field in this list has a non-empty value.
  988. // This may be used to include null fields in Patch requests.
  989. NullFields []string `json:"-"`
  990. }
  991. func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) {
  992. type NoMethod ImagesUploadResponse
  993. raw := NoMethod(*s)
  994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  995. }
  996. type InAppProduct struct {
  997. // DefaultLanguage: The default language of the localized data, as
  998. // defined by BCP 47. e.g. "en-US", "en-GB".
  999. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1000. // DefaultPrice: Default price cannot be zero. In-app products can never
  1001. // be free. Default price is always in the developer's Checkout merchant
  1002. // currency.
  1003. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  1004. // GracePeriod: Grace period of the subscription, specified in ISO 8601
  1005. // format. It will allow developers to give their subscribers a grace
  1006. // period when the payment for the new recurrence period is declined.
  1007. // Acceptable values = "P3D" (three days) and "P7D" (seven days)
  1008. GracePeriod string `json:"gracePeriod,omitempty"`
  1009. // Listings: List of localized title and description data.
  1010. Listings map[string]InAppProductListing `json:"listings,omitempty"`
  1011. // PackageName: The package name of the parent app.
  1012. PackageName string `json:"packageName,omitempty"`
  1013. // Prices: Prices per buyer region. None of these prices should be zero.
  1014. // In-app products can never be free.
  1015. Prices map[string]Price `json:"prices,omitempty"`
  1016. // PurchaseType: Purchase type enum value. Unmodifiable after creation.
  1017. PurchaseType string `json:"purchaseType,omitempty"`
  1018. // Season: Definition of a season for a seasonal subscription. Can be
  1019. // defined only for yearly subscriptions.
  1020. Season *Season `json:"season,omitempty"`
  1021. // Sku: The stock-keeping-unit (SKU) of the product, unique within an
  1022. // app.
  1023. Sku string `json:"sku,omitempty"`
  1024. Status string `json:"status,omitempty"`
  1025. // SubscriptionPeriod: Subscription period, specified in ISO 8601
  1026. // format. Acceptable values are "P1W" (one week), "P1M" (one month),
  1027. // "P3M" (three months), "P6M" (six months), and "P1Y" (one year).
  1028. SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"`
  1029. // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable
  1030. // values are anything between "P7D" (seven days) and "P999D" (999
  1031. // days). Seasonal subscriptions cannot have a trial period.
  1032. TrialPeriod string `json:"trialPeriod,omitempty"`
  1033. // ServerResponse contains the HTTP response code and headers from the
  1034. // server.
  1035. googleapi.ServerResponse `json:"-"`
  1036. // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to
  1037. // unconditionally include in API requests. By default, fields with
  1038. // empty values are omitted from API requests. However, any non-pointer,
  1039. // non-interface field appearing in ForceSendFields will be sent to the
  1040. // server regardless of whether the field is empty or not. This may be
  1041. // used to include empty fields in Patch requests.
  1042. ForceSendFields []string `json:"-"`
  1043. // NullFields is a list of field names (e.g. "DefaultLanguage") to
  1044. // include in API requests with the JSON null value. By default, fields
  1045. // with empty values are omitted from API requests. However, any field
  1046. // with an empty value appearing in NullFields will be sent to the
  1047. // server as null. It is an error if a field in this list has a
  1048. // non-empty value. This may be used to include null fields in Patch
  1049. // requests.
  1050. NullFields []string `json:"-"`
  1051. }
  1052. func (s *InAppProduct) MarshalJSON() ([]byte, error) {
  1053. type NoMethod InAppProduct
  1054. raw := NoMethod(*s)
  1055. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1056. }
  1057. type InAppProductListing struct {
  1058. Description string `json:"description,omitempty"`
  1059. Title string `json:"title,omitempty"`
  1060. // ForceSendFields is a list of field names (e.g. "Description") to
  1061. // unconditionally include in API requests. By default, fields with
  1062. // empty values are omitted from API requests. However, any non-pointer,
  1063. // non-interface field appearing in ForceSendFields will be sent to the
  1064. // server regardless of whether the field is empty or not. This may be
  1065. // used to include empty fields in Patch requests.
  1066. ForceSendFields []string `json:"-"`
  1067. // NullFields is a list of field names (e.g. "Description") to include
  1068. // in API requests with the JSON null value. By default, fields with
  1069. // empty values are omitted from API requests. However, any field with
  1070. // an empty value appearing in NullFields will be sent to the server as
  1071. // null. It is an error if a field in this list has a non-empty value.
  1072. // This may be used to include null fields in Patch requests.
  1073. NullFields []string `json:"-"`
  1074. }
  1075. func (s *InAppProductListing) MarshalJSON() ([]byte, error) {
  1076. type NoMethod InAppProductListing
  1077. raw := NoMethod(*s)
  1078. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1079. }
  1080. type InappproductsListResponse struct {
  1081. Inappproduct []*InAppProduct `json:"inappproduct,omitempty"`
  1082. // Kind: Identifies what kind of resource this is. Value: the fixed
  1083. // string "androidpublisher#inappproductsListResponse".
  1084. Kind string `json:"kind,omitempty"`
  1085. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1086. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1087. // ServerResponse contains the HTTP response code and headers from the
  1088. // server.
  1089. googleapi.ServerResponse `json:"-"`
  1090. // ForceSendFields is a list of field names (e.g. "Inappproduct") to
  1091. // unconditionally include in API requests. By default, fields with
  1092. // empty values are omitted from API requests. However, any non-pointer,
  1093. // non-interface field appearing in ForceSendFields will be sent to the
  1094. // server regardless of whether the field is empty or not. This may be
  1095. // used to include empty fields in Patch requests.
  1096. ForceSendFields []string `json:"-"`
  1097. // NullFields is a list of field names (e.g. "Inappproduct") to include
  1098. // in API requests with the JSON null value. By default, fields with
  1099. // empty values are omitted from API requests. However, any field with
  1100. // an empty value appearing in NullFields will be sent to the server as
  1101. // null. It is an error if a field in this list has a non-empty value.
  1102. // This may be used to include null fields in Patch requests.
  1103. NullFields []string `json:"-"`
  1104. }
  1105. func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) {
  1106. type NoMethod InappproductsListResponse
  1107. raw := NoMethod(*s)
  1108. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1109. }
  1110. type Listing struct {
  1111. // FullDescription: Full description of the app; this may be up to 4000
  1112. // characters in length.
  1113. FullDescription string `json:"fullDescription,omitempty"`
  1114. // Language: Language localization code (for example, "de-AT" for
  1115. // Austrian German).
  1116. Language string `json:"language,omitempty"`
  1117. // ShortDescription: Short description of the app (previously known as
  1118. // promo text); this may be up to 80 characters in length.
  1119. ShortDescription string `json:"shortDescription,omitempty"`
  1120. // Title: App's localized title.
  1121. Title string `json:"title,omitempty"`
  1122. // Video: URL of a promotional YouTube video for the app.
  1123. Video string `json:"video,omitempty"`
  1124. // ServerResponse contains the HTTP response code and headers from the
  1125. // server.
  1126. googleapi.ServerResponse `json:"-"`
  1127. // ForceSendFields is a list of field names (e.g. "FullDescription") to
  1128. // unconditionally include in API requests. By default, fields with
  1129. // empty values are omitted from API requests. However, any non-pointer,
  1130. // non-interface field appearing in ForceSendFields will be sent to the
  1131. // server regardless of whether the field is empty or not. This may be
  1132. // used to include empty fields in Patch requests.
  1133. ForceSendFields []string `json:"-"`
  1134. // NullFields is a list of field names (e.g. "FullDescription") to
  1135. // include in API requests with the JSON null value. By default, fields
  1136. // with empty values are omitted from API requests. However, any field
  1137. // with an empty value appearing in NullFields will be sent to the
  1138. // server as null. It is an error if a field in this list has a
  1139. // non-empty value. This may be used to include null fields in Patch
  1140. // requests.
  1141. NullFields []string `json:"-"`
  1142. }
  1143. func (s *Listing) MarshalJSON() ([]byte, error) {
  1144. type NoMethod Listing
  1145. raw := NoMethod(*s)
  1146. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1147. }
  1148. type ListingsListResponse struct {
  1149. // Kind: Identifies what kind of resource this is. Value: the fixed
  1150. // string "androidpublisher#listingsListResponse".
  1151. Kind string `json:"kind,omitempty"`
  1152. Listings []*Listing `json:"listings,omitempty"`
  1153. // ServerResponse contains the HTTP response code and headers from the
  1154. // server.
  1155. googleapi.ServerResponse `json:"-"`
  1156. // ForceSendFields is a list of field names (e.g. "Kind") to
  1157. // unconditionally include in API requests. By default, fields with
  1158. // empty values are omitted from API requests. However, any non-pointer,
  1159. // non-interface field appearing in ForceSendFields will be sent to the
  1160. // server regardless of whether the field is empty or not. This may be
  1161. // used to include empty fields in Patch requests.
  1162. ForceSendFields []string `json:"-"`
  1163. // NullFields is a list of field names (e.g. "Kind") to include in API
  1164. // requests with the JSON null value. By default, fields with empty
  1165. // values are omitted from API requests. However, any field with an
  1166. // empty value appearing in NullFields will be sent to the server as
  1167. // null. It is an error if a field in this list has a non-empty value.
  1168. // This may be used to include null fields in Patch requests.
  1169. NullFields []string `json:"-"`
  1170. }
  1171. func (s *ListingsListResponse) MarshalJSON() ([]byte, error) {
  1172. type NoMethod ListingsListResponse
  1173. raw := NoMethod(*s)
  1174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1175. }
  1176. type MonthDay struct {
  1177. // Day: Day of a month, value in [1, 31] range. Valid range depends on
  1178. // the specified month.
  1179. Day int64 `json:"day,omitempty"`
  1180. // Month: Month of a year. e.g. 1 = JAN, 2 = FEB etc.
  1181. Month int64 `json:"month,omitempty"`
  1182. // ForceSendFields is a list of field names (e.g. "Day") to
  1183. // unconditionally include in API requests. By default, fields with
  1184. // empty values are omitted from API requests. However, any non-pointer,
  1185. // non-interface field appearing in ForceSendFields will be sent to the
  1186. // server regardless of whether the field is empty or not. This may be
  1187. // used to include empty fields in Patch requests.
  1188. ForceSendFields []string `json:"-"`
  1189. // NullFields is a list of field names (e.g. "Day") to include in API
  1190. // requests with the JSON null value. By default, fields with empty
  1191. // values are omitted from API requests. However, any field with an
  1192. // empty value appearing in NullFields will be sent to the server as
  1193. // null. It is an error if a field in this list has a non-empty value.
  1194. // This may be used to include null fields in Patch requests.
  1195. NullFields []string `json:"-"`
  1196. }
  1197. func (s *MonthDay) MarshalJSON() ([]byte, error) {
  1198. type NoMethod MonthDay
  1199. raw := NoMethod(*s)
  1200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1201. }
  1202. type PageInfo struct {
  1203. ResultPerPage int64 `json:"resultPerPage,omitempty"`
  1204. StartIndex int64 `json:"startIndex,omitempty"`
  1205. TotalResults int64 `json:"totalResults,omitempty"`
  1206. // ForceSendFields is a list of field names (e.g. "ResultPerPage") to
  1207. // unconditionally include in API requests. By default, fields with
  1208. // empty values are omitted from API requests. However, any non-pointer,
  1209. // non-interface field appearing in ForceSendFields will be sent to the
  1210. // server regardless of whether the field is empty or not. This may be
  1211. // used to include empty fields in Patch requests.
  1212. ForceSendFields []string `json:"-"`
  1213. // NullFields is a list of field names (e.g. "ResultPerPage") to include
  1214. // in API requests with the JSON null value. By default, fields with
  1215. // empty values are omitted from API requests. However, any field with
  1216. // an empty value appearing in NullFields will be sent to the server as
  1217. // null. It is an error if a field in this list has a non-empty value.
  1218. // This may be used to include null fields in Patch requests.
  1219. NullFields []string `json:"-"`
  1220. }
  1221. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  1222. type NoMethod PageInfo
  1223. raw := NoMethod(*s)
  1224. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1225. }
  1226. type Price struct {
  1227. // Currency: 3 letter Currency code, as defined by ISO 4217.
  1228. Currency string `json:"currency,omitempty"`
  1229. // PriceMicros: The price in millionths of the currency base unit
  1230. // represented as a string.
  1231. PriceMicros string `json:"priceMicros,omitempty"`
  1232. // ForceSendFields is a list of field names (e.g. "Currency") to
  1233. // unconditionally include in API requests. By default, fields with
  1234. // empty values are omitted from API requests. However, any non-pointer,
  1235. // non-interface field appearing in ForceSendFields will be sent to the
  1236. // server regardless of whether the field is empty or not. This may be
  1237. // used to include empty fields in Patch requests.
  1238. ForceSendFields []string `json:"-"`
  1239. // NullFields is a list of field names (e.g. "Currency") to include in
  1240. // API requests with the JSON null value. By default, fields with empty
  1241. // values are omitted from API requests. However, any field with an
  1242. // empty value appearing in NullFields will be sent to the server as
  1243. // null. It is an error if a field in this list has a non-empty value.
  1244. // This may be used to include null fields in Patch requests.
  1245. NullFields []string `json:"-"`
  1246. }
  1247. func (s *Price) MarshalJSON() ([]byte, error) {
  1248. type NoMethod Price
  1249. raw := NoMethod(*s)
  1250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1251. }
  1252. // ProductPurchase: A ProductPurchase resource indicates the status of a
  1253. // user's inapp product purchase.
  1254. type ProductPurchase struct {
  1255. // ConsumptionState: The consumption state of the inapp product.
  1256. // Possible values are:
  1257. // - Yet to be consumed
  1258. // - Consumed
  1259. ConsumptionState int64 `json:"consumptionState,omitempty"`
  1260. // DeveloperPayload: A developer-specified string that contains
  1261. // supplemental information about an order.
  1262. DeveloperPayload string `json:"developerPayload,omitempty"`
  1263. // Kind: This kind represents an inappPurchase object in the
  1264. // androidpublisher service.
  1265. Kind string `json:"kind,omitempty"`
  1266. // OrderId: The order id associated with the purchase of the inapp
  1267. // product.
  1268. OrderId string `json:"orderId,omitempty"`
  1269. // PurchaseState: The purchase state of the order. Possible values are:
  1270. //
  1271. // - Purchased
  1272. // - Canceled
  1273. PurchaseState int64 `json:"purchaseState,omitempty"`
  1274. // PurchaseTimeMillis: The time the product was purchased, in
  1275. // milliseconds since the epoch (Jan 1, 1970).
  1276. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1277. // PurchaseType: The type of purchase of the inapp product. This field
  1278. // is only set if this purchase was not made using the standard in-app
  1279. // billing flow. Possible values are:
  1280. // - Test (i.e. purchased from a license testing account)
  1281. // - Promo (i.e. purchased using a promo code)
  1282. // - Rewarded (i.e. from watching a video ad instead of paying)
  1283. PurchaseType *int64 `json:"purchaseType,omitempty"`
  1284. // ServerResponse contains the HTTP response code and headers from the
  1285. // server.
  1286. googleapi.ServerResponse `json:"-"`
  1287. // ForceSendFields is a list of field names (e.g. "ConsumptionState") to
  1288. // unconditionally include in API requests. By default, fields with
  1289. // empty values are omitted from API requests. However, any non-pointer,
  1290. // non-interface field appearing in ForceSendFields will be sent to the
  1291. // server regardless of whether the field is empty or not. This may be
  1292. // used to include empty fields in Patch requests.
  1293. ForceSendFields []string `json:"-"`
  1294. // NullFields is a list of field names (e.g. "ConsumptionState") to
  1295. // include in API requests with the JSON null value. By default, fields
  1296. // with empty values are omitted from API requests. However, any field
  1297. // with an empty value appearing in NullFields will be sent to the
  1298. // server as null. It is an error if a field in this list has a
  1299. // non-empty value. This may be used to include null fields in Patch
  1300. // requests.
  1301. NullFields []string `json:"-"`
  1302. }
  1303. func (s *ProductPurchase) MarshalJSON() ([]byte, error) {
  1304. type NoMethod ProductPurchase
  1305. raw := NoMethod(*s)
  1306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1307. }
  1308. type Prorate struct {
  1309. // DefaultPrice: Default price cannot be zero and must be less than the
  1310. // full subscription price. Default price is always in the developer's
  1311. // Checkout merchant currency. Targeted countries have their prices set
  1312. // automatically based on the default_price.
  1313. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  1314. // Start: Defines the first day on which the price takes effect.
  1315. Start *MonthDay `json:"start,omitempty"`
  1316. // ForceSendFields is a list of field names (e.g. "DefaultPrice") to
  1317. // unconditionally include in API requests. By default, fields with
  1318. // empty values are omitted from API requests. However, any non-pointer,
  1319. // non-interface field appearing in ForceSendFields will be sent to the
  1320. // server regardless of whether the field is empty or not. This may be
  1321. // used to include empty fields in Patch requests.
  1322. ForceSendFields []string `json:"-"`
  1323. // NullFields is a list of field names (e.g. "DefaultPrice") to include
  1324. // in API requests with the JSON null value. By default, fields with
  1325. // empty values are omitted from API requests. However, any field with
  1326. // an empty value appearing in NullFields will be sent to the server as
  1327. // null. It is an error if a field in this list has a non-empty value.
  1328. // This may be used to include null fields in Patch requests.
  1329. NullFields []string `json:"-"`
  1330. }
  1331. func (s *Prorate) MarshalJSON() ([]byte, error) {
  1332. type NoMethod Prorate
  1333. raw := NoMethod(*s)
  1334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1335. }
  1336. type Review struct {
  1337. // AuthorName: The name of the user who wrote the review.
  1338. AuthorName string `json:"authorName,omitempty"`
  1339. // Comments: A repeated field containing comments for the review.
  1340. Comments []*Comment `json:"comments,omitempty"`
  1341. // ReviewId: Unique identifier for this review.
  1342. ReviewId string `json:"reviewId,omitempty"`
  1343. // ServerResponse contains the HTTP response code and headers from the
  1344. // server.
  1345. googleapi.ServerResponse `json:"-"`
  1346. // ForceSendFields is a list of field names (e.g. "AuthorName") to
  1347. // unconditionally include in API requests. By default, fields with
  1348. // empty values are omitted from API requests. However, any non-pointer,
  1349. // non-interface field appearing in ForceSendFields will be sent to the
  1350. // server regardless of whether the field is empty or not. This may be
  1351. // used to include empty fields in Patch requests.
  1352. ForceSendFields []string `json:"-"`
  1353. // NullFields is a list of field names (e.g. "AuthorName") to include in
  1354. // API requests with the JSON null value. By default, fields with empty
  1355. // values are omitted from API requests. However, any field with an
  1356. // empty value appearing in NullFields will be sent to the server as
  1357. // null. It is an error if a field in this list has a non-empty value.
  1358. // This may be used to include null fields in Patch requests.
  1359. NullFields []string `json:"-"`
  1360. }
  1361. func (s *Review) MarshalJSON() ([]byte, error) {
  1362. type NoMethod Review
  1363. raw := NoMethod(*s)
  1364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1365. }
  1366. type ReviewReplyResult struct {
  1367. // LastEdited: The time at which the reply took effect.
  1368. LastEdited *Timestamp `json:"lastEdited,omitempty"`
  1369. // ReplyText: The reply text that was applied.
  1370. ReplyText string `json:"replyText,omitempty"`
  1371. // ForceSendFields is a list of field names (e.g. "LastEdited") to
  1372. // unconditionally include in API requests. By default, fields with
  1373. // empty values are omitted from API requests. However, any non-pointer,
  1374. // non-interface field appearing in ForceSendFields will be sent to the
  1375. // server regardless of whether the field is empty or not. This may be
  1376. // used to include empty fields in Patch requests.
  1377. ForceSendFields []string `json:"-"`
  1378. // NullFields is a list of field names (e.g. "LastEdited") to include in
  1379. // API requests with the JSON null value. By default, fields with empty
  1380. // values are omitted from API requests. However, any field with an
  1381. // empty value appearing in NullFields will be sent to the server as
  1382. // null. It is an error if a field in this list has a non-empty value.
  1383. // This may be used to include null fields in Patch requests.
  1384. NullFields []string `json:"-"`
  1385. }
  1386. func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) {
  1387. type NoMethod ReviewReplyResult
  1388. raw := NoMethod(*s)
  1389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1390. }
  1391. type ReviewsListResponse struct {
  1392. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1393. Reviews []*Review `json:"reviews,omitempty"`
  1394. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1395. // ServerResponse contains the HTTP response code and headers from the
  1396. // server.
  1397. googleapi.ServerResponse `json:"-"`
  1398. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  1399. // unconditionally include in API requests. By default, fields with
  1400. // empty values are omitted from API requests. However, any non-pointer,
  1401. // non-interface field appearing in ForceSendFields will be sent to the
  1402. // server regardless of whether the field is empty or not. This may be
  1403. // used to include empty fields in Patch requests.
  1404. ForceSendFields []string `json:"-"`
  1405. // NullFields is a list of field names (e.g. "PageInfo") to include in
  1406. // API requests with the JSON null value. By default, fields with empty
  1407. // values are omitted from API requests. However, any field with an
  1408. // empty value appearing in NullFields will be sent to the server as
  1409. // null. It is an error if a field in this list has a non-empty value.
  1410. // This may be used to include null fields in Patch requests.
  1411. NullFields []string `json:"-"`
  1412. }
  1413. func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) {
  1414. type NoMethod ReviewsListResponse
  1415. raw := NoMethod(*s)
  1416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1417. }
  1418. type ReviewsReplyRequest struct {
  1419. // ReplyText: The text to set as the reply. Replies of more than
  1420. // approximately 350 characters will be rejected. HTML tags will be
  1421. // stripped.
  1422. ReplyText string `json:"replyText,omitempty"`
  1423. // ForceSendFields is a list of field names (e.g. "ReplyText") to
  1424. // unconditionally include in API requests. By default, fields with
  1425. // empty values are omitted from API requests. However, any non-pointer,
  1426. // non-interface field appearing in ForceSendFields will be sent to the
  1427. // server regardless of whether the field is empty or not. This may be
  1428. // used to include empty fields in Patch requests.
  1429. ForceSendFields []string `json:"-"`
  1430. // NullFields is a list of field names (e.g. "ReplyText") to include in
  1431. // API requests with the JSON null value. By default, fields with empty
  1432. // values are omitted from API requests. However, any field with an
  1433. // empty value appearing in NullFields will be sent to the server as
  1434. // null. It is an error if a field in this list has a non-empty value.
  1435. // This may be used to include null fields in Patch requests.
  1436. NullFields []string `json:"-"`
  1437. }
  1438. func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) {
  1439. type NoMethod ReviewsReplyRequest
  1440. raw := NoMethod(*s)
  1441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1442. }
  1443. type ReviewsReplyResponse struct {
  1444. Result *ReviewReplyResult `json:"result,omitempty"`
  1445. // ServerResponse contains the HTTP response code and headers from the
  1446. // server.
  1447. googleapi.ServerResponse `json:"-"`
  1448. // ForceSendFields is a list of field names (e.g. "Result") to
  1449. // unconditionally include in API requests. By default, fields with
  1450. // empty values are omitted from API requests. However, any non-pointer,
  1451. // non-interface field appearing in ForceSendFields will be sent to the
  1452. // server regardless of whether the field is empty or not. This may be
  1453. // used to include empty fields in Patch requests.
  1454. ForceSendFields []string `json:"-"`
  1455. // NullFields is a list of field names (e.g. "Result") to include in API
  1456. // requests with the JSON null value. By default, fields with empty
  1457. // values are omitted from API requests. However, any field with an
  1458. // empty value appearing in NullFields will be sent to the server as
  1459. // null. It is an error if a field in this list has a non-empty value.
  1460. // This may be used to include null fields in Patch requests.
  1461. NullFields []string `json:"-"`
  1462. }
  1463. func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) {
  1464. type NoMethod ReviewsReplyResponse
  1465. raw := NoMethod(*s)
  1466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1467. }
  1468. type Season struct {
  1469. // End: Inclusive end date of the recurrence period.
  1470. End *MonthDay `json:"end,omitempty"`
  1471. // Prorations: Optionally present list of prorations for the season.
  1472. // Each proration is a one-off discounted entry into a subscription.
  1473. // Each proration contains the first date on which the discount is
  1474. // available and the new pricing information.
  1475. Prorations []*Prorate `json:"prorations,omitempty"`
  1476. // Start: Inclusive start date of the recurrence period.
  1477. Start *MonthDay `json:"start,omitempty"`
  1478. // ForceSendFields is a list of field names (e.g. "End") to
  1479. // unconditionally include in API requests. By default, fields with
  1480. // empty values are omitted from API requests. However, any non-pointer,
  1481. // non-interface field appearing in ForceSendFields will be sent to the
  1482. // server regardless of whether the field is empty or not. This may be
  1483. // used to include empty fields in Patch requests.
  1484. ForceSendFields []string `json:"-"`
  1485. // NullFields is a list of field names (e.g. "End") to include in API
  1486. // requests with the JSON null value. By default, fields with empty
  1487. // values are omitted from API requests. However, any field with an
  1488. // empty value appearing in NullFields will be sent to the server as
  1489. // null. It is an error if a field in this list has a non-empty value.
  1490. // This may be used to include null fields in Patch requests.
  1491. NullFields []string `json:"-"`
  1492. }
  1493. func (s *Season) MarshalJSON() ([]byte, error) {
  1494. type NoMethod Season
  1495. raw := NoMethod(*s)
  1496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1497. }
  1498. // SubscriptionCancelSurveyResult: Information provided by the user when
  1499. // they complete the subscription cancellation flow (cancellation reason
  1500. // survey).
  1501. type SubscriptionCancelSurveyResult struct {
  1502. // CancelSurveyReason: The cancellation reason the user chose in the
  1503. // survey. Possible values are:
  1504. // - Other
  1505. // - I don't use this service enough
  1506. // - Technical issues
  1507. // - Cost-related reasons
  1508. // - I found a better app
  1509. CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"`
  1510. // UserInputCancelReason: The customized input cancel reason from the
  1511. // user. Only present when cancelReason is 0.
  1512. UserInputCancelReason string `json:"userInputCancelReason,omitempty"`
  1513. // ForceSendFields is a list of field names (e.g. "CancelSurveyReason")
  1514. // to unconditionally include in API requests. By default, fields with
  1515. // empty values are omitted from API requests. However, any non-pointer,
  1516. // non-interface field appearing in ForceSendFields will be sent to the
  1517. // server regardless of whether the field is empty or not. This may be
  1518. // used to include empty fields in Patch requests.
  1519. ForceSendFields []string `json:"-"`
  1520. // NullFields is a list of field names (e.g. "CancelSurveyReason") to
  1521. // include in API requests with the JSON null value. By default, fields
  1522. // with empty values are omitted from API requests. However, any field
  1523. // with an empty value appearing in NullFields will be sent to the
  1524. // server as null. It is an error if a field in this list has a
  1525. // non-empty value. This may be used to include null fields in Patch
  1526. // requests.
  1527. NullFields []string `json:"-"`
  1528. }
  1529. func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) {
  1530. type NoMethod SubscriptionCancelSurveyResult
  1531. raw := NoMethod(*s)
  1532. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1533. }
  1534. // SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the
  1535. // data needed to defer a subscription purchase to a future expiry time.
  1536. type SubscriptionDeferralInfo struct {
  1537. // DesiredExpiryTimeMillis: The desired next expiry time to assign to
  1538. // the subscription, in milliseconds since the Epoch. The given time
  1539. // must be later/greater than the current expiry time for the
  1540. // subscription.
  1541. DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"`
  1542. // ExpectedExpiryTimeMillis: The expected expiry time for the
  1543. // subscription. If the current expiry time for the subscription is not
  1544. // the value specified here, the deferral will not occur.
  1545. ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"`
  1546. // ForceSendFields is a list of field names (e.g.
  1547. // "DesiredExpiryTimeMillis") to unconditionally include in API
  1548. // requests. By default, fields with empty values are omitted from API
  1549. // requests. However, any non-pointer, non-interface field appearing in
  1550. // ForceSendFields will be sent to the server regardless of whether the
  1551. // field is empty or not. This may be used to include empty fields in
  1552. // Patch requests.
  1553. ForceSendFields []string `json:"-"`
  1554. // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis")
  1555. // to include in API requests with the JSON null value. By default,
  1556. // fields with empty values are omitted from API requests. However, any
  1557. // field with an empty value appearing in NullFields will be sent to the
  1558. // server as null. It is an error if a field in this list has a
  1559. // non-empty value. This may be used to include null fields in Patch
  1560. // requests.
  1561. NullFields []string `json:"-"`
  1562. }
  1563. func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) {
  1564. type NoMethod SubscriptionDeferralInfo
  1565. raw := NoMethod(*s)
  1566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1567. }
  1568. // SubscriptionPriceChange: Contains the price change information for a
  1569. // subscription that can be used to control the user journey for the
  1570. // price change in the app. This can be in the form of seeking
  1571. // confirmation from the user or tailoring the experience for a
  1572. // successful conversion.
  1573. type SubscriptionPriceChange struct {
  1574. // NewPrice: The new price the subscription will renew with if the price
  1575. // change is accepted by the user.
  1576. NewPrice *Price `json:"newPrice,omitempty"`
  1577. // State: The current state of the price change. Possible values are:
  1578. //
  1579. // - Outstanding: State for a pending price change waiting for the user
  1580. // to agree. In this state, you can optionally seek confirmation from
  1581. // the user using the In-App API.
  1582. // - Accepted: State for an accepted price change that the subscription
  1583. // will renew with unless it's canceled. The price change takes effect
  1584. // on a future date when the subscription renews. Note that the change
  1585. // might not occur when the subscription is renewed next.
  1586. State int64 `json:"state,omitempty"`
  1587. // ForceSendFields is a list of field names (e.g. "NewPrice") to
  1588. // unconditionally include in API requests. By default, fields with
  1589. // empty values are omitted from API requests. However, any non-pointer,
  1590. // non-interface field appearing in ForceSendFields will be sent to the
  1591. // server regardless of whether the field is empty or not. This may be
  1592. // used to include empty fields in Patch requests.
  1593. ForceSendFields []string `json:"-"`
  1594. // NullFields is a list of field names (e.g. "NewPrice") to include in
  1595. // API requests with the JSON null value. By default, fields with empty
  1596. // values are omitted from API requests. However, any field with an
  1597. // empty value appearing in NullFields will be sent to the server as
  1598. // null. It is an error if a field in this list has a non-empty value.
  1599. // This may be used to include null fields in Patch requests.
  1600. NullFields []string `json:"-"`
  1601. }
  1602. func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) {
  1603. type NoMethod SubscriptionPriceChange
  1604. raw := NoMethod(*s)
  1605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1606. }
  1607. // SubscriptionPurchase: A SubscriptionPurchase resource indicates the
  1608. // status of a user's subscription purchase.
  1609. type SubscriptionPurchase struct {
  1610. // AutoRenewing: Whether the subscription will automatically be renewed
  1611. // when it reaches its current expiry time.
  1612. AutoRenewing bool `json:"autoRenewing,omitempty"`
  1613. // CancelReason: The reason why a subscription was canceled or is not
  1614. // auto-renewing. Possible values are:
  1615. // - User canceled the subscription
  1616. // - Subscription was canceled by the system, for example because of a
  1617. // billing problem
  1618. // - Subscription was replaced with a new subscription
  1619. // - Subscription was canceled by the developer
  1620. CancelReason *int64 `json:"cancelReason,omitempty"`
  1621. // CancelSurveyResult: Information provided by the user when they
  1622. // complete the subscription cancellation flow (cancellation reason
  1623. // survey).
  1624. CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"`
  1625. // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the
  1626. // user at the time the subscription was granted.
  1627. CountryCode string `json:"countryCode,omitempty"`
  1628. // DeveloperPayload: A developer-specified string that contains
  1629. // supplemental information about an order.
  1630. DeveloperPayload string `json:"developerPayload,omitempty"`
  1631. // EmailAddress: The email address of the user when the subscription was
  1632. // purchased. Only present for purchases made with 'Subscribe with
  1633. // Google'.
  1634. EmailAddress string `json:"emailAddress,omitempty"`
  1635. // ExpiryTimeMillis: Time at which the subscription will expire, in
  1636. // milliseconds since the Epoch.
  1637. ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"`
  1638. // FamilyName: The family name of the user when the subscription was
  1639. // purchased. Only present for purchases made with 'Subscribe with
  1640. // Google'.
  1641. FamilyName string `json:"familyName,omitempty"`
  1642. // GivenName: The given name of the user when the subscription was
  1643. // purchased. Only present for purchases made with 'Subscribe with
  1644. // Google'.
  1645. GivenName string `json:"givenName,omitempty"`
  1646. // Kind: This kind represents a subscriptionPurchase object in the
  1647. // androidpublisher service.
  1648. Kind string `json:"kind,omitempty"`
  1649. // LinkedPurchaseToken: The purchase token of the originating purchase
  1650. // if this subscription is one of the following:
  1651. // - Re-signup of a canceled but non-lapsed subscription
  1652. // - Upgrade/downgrade from a previous subscription For example,
  1653. // suppose a user originally signs up and you receive purchase token X,
  1654. // then the user cancels and goes through the resignup flow (before
  1655. // their subscription lapses) and you receive purchase token Y, and
  1656. // finally the user upgrades their subscription and you receive purchase
  1657. // token Z. If you call this API with purchase token Z, this field will
  1658. // be set to Y. If you call this API with purchase token Y, this field
  1659. // will be set to X. If you call this API with purchase token X, this
  1660. // field will not be set.
  1661. LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"`
  1662. // OrderId: The order id of the latest recurring order associated with
  1663. // the purchase of the subscription.
  1664. OrderId string `json:"orderId,omitempty"`
  1665. // PaymentState: The payment state of the subscription. Possible values
  1666. // are:
  1667. // - Payment pending
  1668. // - Payment received
  1669. // - Free trial
  1670. // - Pending deferred upgrade/downgrade
  1671. PaymentState *int64 `json:"paymentState,omitempty"`
  1672. // PriceAmountMicros: Price of the subscription, not including tax.
  1673. // Price is expressed in micro-units, where 1,000,000 micro-units
  1674. // represents one unit of the currency. For example, if the subscription
  1675. // price is €1.99, price_amount_micros is 1990000.
  1676. PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"`
  1677. // PriceChange: The latest price change information available. This is
  1678. // present only when there is an upcoming price change for the
  1679. // subscription yet to be applied.
  1680. //
  1681. // Once the subscription renews with the new price or the subscription
  1682. // is canceled, no price change information will be returned.
  1683. PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"`
  1684. // PriceCurrencyCode: ISO 4217 currency code for the subscription price.
  1685. // For example, if the price is specified in British pounds sterling,
  1686. // price_currency_code is "GBP".
  1687. PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"`
  1688. // ProfileId: The profile id of the user when the subscription was
  1689. // purchased. Only present for purchases made with 'Subscribe with
  1690. // Google'.
  1691. ProfileId string `json:"profileId,omitempty"`
  1692. // ProfileName: The profile name of the user when the subscription was
  1693. // purchased. Only present for purchases made with 'Subscribe with
  1694. // Google'.
  1695. ProfileName string `json:"profileName,omitempty"`
  1696. // PurchaseType: The type of purchase of the subscription. This field is
  1697. // only set if this purchase was not made using the standard in-app
  1698. // billing flow. Possible values are:
  1699. // - Test (i.e. purchased from a license testing account)
  1700. PurchaseType *int64 `json:"purchaseType,omitempty"`
  1701. // StartTimeMillis: Time at which the subscription was granted, in
  1702. // milliseconds since the Epoch.
  1703. StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"`
  1704. // UserCancellationTimeMillis: The time at which the subscription was
  1705. // canceled by the user, in milliseconds since the epoch. Only present
  1706. // if cancelReason is 0.
  1707. UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"`
  1708. // ServerResponse contains the HTTP response code and headers from the
  1709. // server.
  1710. googleapi.ServerResponse `json:"-"`
  1711. // ForceSendFields is a list of field names (e.g. "AutoRenewing") to
  1712. // unconditionally include in API requests. By default, fields with
  1713. // empty values are omitted from API requests. However, any non-pointer,
  1714. // non-interface field appearing in ForceSendFields will be sent to the
  1715. // server regardless of whether the field is empty or not. This may be
  1716. // used to include empty fields in Patch requests.
  1717. ForceSendFields []string `json:"-"`
  1718. // NullFields is a list of field names (e.g. "AutoRenewing") to include
  1719. // in API requests with the JSON null value. By default, fields with
  1720. // empty values are omitted from API requests. However, any field with
  1721. // an empty value appearing in NullFields will be sent to the server as
  1722. // null. It is an error if a field in this list has a non-empty value.
  1723. // This may be used to include null fields in Patch requests.
  1724. NullFields []string `json:"-"`
  1725. }
  1726. func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) {
  1727. type NoMethod SubscriptionPurchase
  1728. raw := NoMethod(*s)
  1729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1730. }
  1731. type SubscriptionPurchasesDeferRequest struct {
  1732. // DeferralInfo: The information about the new desired expiry time for
  1733. // the subscription.
  1734. DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"`
  1735. // ForceSendFields is a list of field names (e.g. "DeferralInfo") to
  1736. // unconditionally include in API requests. By default, fields with
  1737. // empty values are omitted from API requests. However, any non-pointer,
  1738. // non-interface field appearing in ForceSendFields will be sent to the
  1739. // server regardless of whether the field is empty or not. This may be
  1740. // used to include empty fields in Patch requests.
  1741. ForceSendFields []string `json:"-"`
  1742. // NullFields is a list of field names (e.g. "DeferralInfo") to include
  1743. // in API requests with the JSON null value. By default, fields with
  1744. // empty values are omitted from API requests. However, any field with
  1745. // an empty value appearing in NullFields will be sent to the server as
  1746. // null. It is an error if a field in this list has a non-empty value.
  1747. // This may be used to include null fields in Patch requests.
  1748. NullFields []string `json:"-"`
  1749. }
  1750. func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) {
  1751. type NoMethod SubscriptionPurchasesDeferRequest
  1752. raw := NoMethod(*s)
  1753. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1754. }
  1755. type SubscriptionPurchasesDeferResponse struct {
  1756. // NewExpiryTimeMillis: The new expiry time for the subscription in
  1757. // milliseconds since the Epoch.
  1758. NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"`
  1759. // ServerResponse contains the HTTP response code and headers from the
  1760. // server.
  1761. googleapi.ServerResponse `json:"-"`
  1762. // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis")
  1763. // to unconditionally include in API requests. By default, fields with
  1764. // empty values are omitted from API requests. However, any non-pointer,
  1765. // non-interface field appearing in ForceSendFields will be sent to the
  1766. // server regardless of whether the field is empty or not. This may be
  1767. // used to include empty fields in Patch requests.
  1768. ForceSendFields []string `json:"-"`
  1769. // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to
  1770. // include in API requests with the JSON null value. By default, fields
  1771. // with empty values are omitted from API requests. However, any field
  1772. // with an empty value appearing in NullFields will be sent to the
  1773. // server as null. It is an error if a field in this list has a
  1774. // non-empty value. This may be used to include null fields in Patch
  1775. // requests.
  1776. NullFields []string `json:"-"`
  1777. }
  1778. func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) {
  1779. type NoMethod SubscriptionPurchasesDeferResponse
  1780. raw := NoMethod(*s)
  1781. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1782. }
  1783. type Testers struct {
  1784. GoogleGroups []string `json:"googleGroups,omitempty"`
  1785. GooglePlusCommunities []string `json:"googlePlusCommunities,omitempty"`
  1786. // ServerResponse contains the HTTP response code and headers from the
  1787. // server.
  1788. googleapi.ServerResponse `json:"-"`
  1789. // ForceSendFields is a list of field names (e.g. "GoogleGroups") to
  1790. // unconditionally include in API requests. By default, fields with
  1791. // empty values are omitted from API requests. However, any non-pointer,
  1792. // non-interface field appearing in ForceSendFields will be sent to the
  1793. // server regardless of whether the field is empty or not. This may be
  1794. // used to include empty fields in Patch requests.
  1795. ForceSendFields []string `json:"-"`
  1796. // NullFields is a list of field names (e.g. "GoogleGroups") to include
  1797. // in API requests with the JSON null value. By default, fields with
  1798. // empty values are omitted from API requests. However, any field with
  1799. // an empty value appearing in NullFields will be sent to the server as
  1800. // null. It is an error if a field in this list has a non-empty value.
  1801. // This may be used to include null fields in Patch requests.
  1802. NullFields []string `json:"-"`
  1803. }
  1804. func (s *Testers) MarshalJSON() ([]byte, error) {
  1805. type NoMethod Testers
  1806. raw := NoMethod(*s)
  1807. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1808. }
  1809. type Timestamp struct {
  1810. Nanos int64 `json:"nanos,omitempty"`
  1811. Seconds int64 `json:"seconds,omitempty,string"`
  1812. // ForceSendFields is a list of field names (e.g. "Nanos") to
  1813. // unconditionally include in API requests. By default, fields with
  1814. // empty values are omitted from API requests. However, any non-pointer,
  1815. // non-interface field appearing in ForceSendFields will be sent to the
  1816. // server regardless of whether the field is empty or not. This may be
  1817. // used to include empty fields in Patch requests.
  1818. ForceSendFields []string `json:"-"`
  1819. // NullFields is a list of field names (e.g. "Nanos") to include in API
  1820. // requests with the JSON null value. By default, fields with empty
  1821. // values are omitted from API requests. However, any field with an
  1822. // empty value appearing in NullFields will be sent to the server as
  1823. // null. It is an error if a field in this list has a non-empty value.
  1824. // This may be used to include null fields in Patch requests.
  1825. NullFields []string `json:"-"`
  1826. }
  1827. func (s *Timestamp) MarshalJSON() ([]byte, error) {
  1828. type NoMethod Timestamp
  1829. raw := NoMethod(*s)
  1830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1831. }
  1832. type TokenPagination struct {
  1833. NextPageToken string `json:"nextPageToken,omitempty"`
  1834. PreviousPageToken string `json:"previousPageToken,omitempty"`
  1835. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1836. // unconditionally include in API requests. By default, fields with
  1837. // empty values are omitted from API requests. However, any non-pointer,
  1838. // non-interface field appearing in ForceSendFields will be sent to the
  1839. // server regardless of whether the field is empty or not. This may be
  1840. // used to include empty fields in Patch requests.
  1841. ForceSendFields []string `json:"-"`
  1842. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1843. // in API requests with the JSON null value. By default, fields with
  1844. // empty values are omitted from API requests. However, any field with
  1845. // an empty value appearing in NullFields will be sent to the server as
  1846. // null. It is an error if a field in this list has a non-empty value.
  1847. // This may be used to include null fields in Patch requests.
  1848. NullFields []string `json:"-"`
  1849. }
  1850. func (s *TokenPagination) MarshalJSON() ([]byte, error) {
  1851. type NoMethod TokenPagination
  1852. raw := NoMethod(*s)
  1853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1854. }
  1855. type Track struct {
  1856. // Track: Identifier for this track.
  1857. Track string `json:"track,omitempty"`
  1858. UserFraction float64 `json:"userFraction,omitempty"`
  1859. // VersionCodes: Version codes to make active on this track. Note that
  1860. // this list should contain all versions you wish to be active,
  1861. // including those you wish to retain from previous releases.
  1862. VersionCodes []int64 `json:"versionCodes,omitempty"`
  1863. // ServerResponse contains the HTTP response code and headers from the
  1864. // server.
  1865. googleapi.ServerResponse `json:"-"`
  1866. // ForceSendFields is a list of field names (e.g. "Track") to
  1867. // unconditionally include in API requests. By default, fields with
  1868. // empty values are omitted from API requests. However, any non-pointer,
  1869. // non-interface field appearing in ForceSendFields will be sent to the
  1870. // server regardless of whether the field is empty or not. This may be
  1871. // used to include empty fields in Patch requests.
  1872. ForceSendFields []string `json:"-"`
  1873. // NullFields is a list of field names (e.g. "Track") to include in API
  1874. // requests with the JSON null value. By default, fields with empty
  1875. // values are omitted from API requests. However, any field with an
  1876. // empty value appearing in NullFields will be sent to the server as
  1877. // null. It is an error if a field in this list has a non-empty value.
  1878. // This may be used to include null fields in Patch requests.
  1879. NullFields []string `json:"-"`
  1880. }
  1881. func (s *Track) MarshalJSON() ([]byte, error) {
  1882. type NoMethod Track
  1883. raw := NoMethod(*s)
  1884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1885. }
  1886. func (s *Track) UnmarshalJSON(data []byte) error {
  1887. type NoMethod Track
  1888. var s1 struct {
  1889. UserFraction gensupport.JSONFloat64 `json:"userFraction"`
  1890. *NoMethod
  1891. }
  1892. s1.NoMethod = (*NoMethod)(s)
  1893. if err := json.Unmarshal(data, &s1); err != nil {
  1894. return err
  1895. }
  1896. s.UserFraction = float64(s1.UserFraction)
  1897. return nil
  1898. }
  1899. type TracksListResponse struct {
  1900. // Kind: Identifies what kind of resource this is. Value: the fixed
  1901. // string "androidpublisher#tracksListResponse".
  1902. Kind string `json:"kind,omitempty"`
  1903. Tracks []*Track `json:"tracks,omitempty"`
  1904. // ServerResponse contains the HTTP response code and headers from the
  1905. // server.
  1906. googleapi.ServerResponse `json:"-"`
  1907. // ForceSendFields is a list of field names (e.g. "Kind") to
  1908. // unconditionally include in API requests. By default, fields with
  1909. // empty values are omitted from API requests. However, any non-pointer,
  1910. // non-interface field appearing in ForceSendFields will be sent to the
  1911. // server regardless of whether the field is empty or not. This may be
  1912. // used to include empty fields in Patch requests.
  1913. ForceSendFields []string `json:"-"`
  1914. // NullFields is a list of field names (e.g. "Kind") to include in API
  1915. // requests with the JSON null value. By default, fields with empty
  1916. // values are omitted from API requests. However, any field with an
  1917. // empty value appearing in NullFields will be sent to the server as
  1918. // null. It is an error if a field in this list has a non-empty value.
  1919. // This may be used to include null fields in Patch requests.
  1920. NullFields []string `json:"-"`
  1921. }
  1922. func (s *TracksListResponse) MarshalJSON() ([]byte, error) {
  1923. type NoMethod TracksListResponse
  1924. raw := NoMethod(*s)
  1925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1926. }
  1927. type UserComment struct {
  1928. // AndroidOsVersion: Integer Android SDK version of the user's device at
  1929. // the time the review was written, e.g. 23 is Marshmallow. May be
  1930. // absent.
  1931. AndroidOsVersion int64 `json:"androidOsVersion,omitempty"`
  1932. // AppVersionCode: Integer version code of the app as installed at the
  1933. // time the review was written. May be absent.
  1934. AppVersionCode int64 `json:"appVersionCode,omitempty"`
  1935. // AppVersionName: String version name of the app as installed at the
  1936. // time the review was written. May be absent.
  1937. AppVersionName string `json:"appVersionName,omitempty"`
  1938. // Device: Codename for the reviewer's device, e.g. klte, flounder. May
  1939. // be absent.
  1940. Device string `json:"device,omitempty"`
  1941. // DeviceMetadata: Some information about the characteristics of the
  1942. // user's device
  1943. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1944. // LastModified: The last time at which this comment was updated.
  1945. LastModified *Timestamp `json:"lastModified,omitempty"`
  1946. // OriginalText: Untranslated text of the review, in the case where the
  1947. // review has been translated. If the review has not been translated
  1948. // this is left blank.
  1949. OriginalText string `json:"originalText,omitempty"`
  1950. // ReviewerLanguage: Language code for the reviewer. This is taken from
  1951. // the device settings so is not guaranteed to match the language the
  1952. // review is written in. May be absent.
  1953. ReviewerLanguage string `json:"reviewerLanguage,omitempty"`
  1954. // StarRating: The star rating associated with the review, from 1 to 5.
  1955. StarRating int64 `json:"starRating,omitempty"`
  1956. // Text: The content of the comment, i.e. review body. In some cases
  1957. // users have been able to write a review with separate title and body;
  1958. // in those cases the title and body are concatenated and separated by a
  1959. // tab character.
  1960. Text string `json:"text,omitempty"`
  1961. // ThumbsDownCount: Number of users who have given this review a thumbs
  1962. // down
  1963. ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"`
  1964. // ThumbsUpCount: Number of users who have given this review a thumbs up
  1965. ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"`
  1966. // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to
  1967. // unconditionally include in API requests. By default, fields with
  1968. // empty values are omitted from API requests. However, any non-pointer,
  1969. // non-interface field appearing in ForceSendFields will be sent to the
  1970. // server regardless of whether the field is empty or not. This may be
  1971. // used to include empty fields in Patch requests.
  1972. ForceSendFields []string `json:"-"`
  1973. // NullFields is a list of field names (e.g. "AndroidOsVersion") to
  1974. // include in API requests with the JSON null value. By default, fields
  1975. // with empty values are omitted from API requests. However, any field
  1976. // with an empty value appearing in NullFields will be sent to the
  1977. // server as null. It is an error if a field in this list has a
  1978. // non-empty value. This may be used to include null fields in Patch
  1979. // requests.
  1980. NullFields []string `json:"-"`
  1981. }
  1982. func (s *UserComment) MarshalJSON() ([]byte, error) {
  1983. type NoMethod UserComment
  1984. raw := NoMethod(*s)
  1985. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1986. }
  1987. // VoidedPurchase: A VoidedPurchase resource indicates a purchase that
  1988. // was either canceled/refunded/charged-back.
  1989. type VoidedPurchase struct {
  1990. // Kind: This kind represents a voided purchase object in the
  1991. // androidpublisher service.
  1992. Kind string `json:"kind,omitempty"`
  1993. // PurchaseTimeMillis: The time at which the purchase was made, in
  1994. // milliseconds since the epoch (Jan 1, 1970).
  1995. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1996. // PurchaseToken: The token that was generated when a purchase was made.
  1997. // This uniquely identifies a purchase.
  1998. PurchaseToken string `json:"purchaseToken,omitempty"`
  1999. // VoidedTimeMillis: The time at which the purchase was
  2000. // canceled/refunded/charged-back, in milliseconds since the epoch (Jan
  2001. // 1, 1970).
  2002. VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"`
  2003. // ForceSendFields is a list of field names (e.g. "Kind") to
  2004. // unconditionally include in API requests. By default, fields with
  2005. // empty values are omitted from API requests. However, any non-pointer,
  2006. // non-interface field appearing in ForceSendFields will be sent to the
  2007. // server regardless of whether the field is empty or not. This may be
  2008. // used to include empty fields in Patch requests.
  2009. ForceSendFields []string `json:"-"`
  2010. // NullFields is a list of field names (e.g. "Kind") to include in API
  2011. // requests with the JSON null value. By default, fields with empty
  2012. // values are omitted from API requests. However, any field with an
  2013. // empty value appearing in NullFields will be sent to the server as
  2014. // null. It is an error if a field in this list has a non-empty value.
  2015. // This may be used to include null fields in Patch requests.
  2016. NullFields []string `json:"-"`
  2017. }
  2018. func (s *VoidedPurchase) MarshalJSON() ([]byte, error) {
  2019. type NoMethod VoidedPurchase
  2020. raw := NoMethod(*s)
  2021. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2022. }
  2023. type VoidedPurchasesListResponse struct {
  2024. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2025. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2026. VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"`
  2027. // ServerResponse contains the HTTP response code and headers from the
  2028. // server.
  2029. googleapi.ServerResponse `json:"-"`
  2030. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  2031. // unconditionally include in API requests. By default, fields with
  2032. // empty values are omitted from API requests. However, any non-pointer,
  2033. // non-interface field appearing in ForceSendFields will be sent to the
  2034. // server regardless of whether the field is empty or not. This may be
  2035. // used to include empty fields in Patch requests.
  2036. ForceSendFields []string `json:"-"`
  2037. // NullFields is a list of field names (e.g. "PageInfo") to include in
  2038. // API requests with the JSON null value. By default, fields with empty
  2039. // values are omitted from API requests. However, any field with an
  2040. // empty value appearing in NullFields will be sent to the server as
  2041. // null. It is an error if a field in this list has a non-empty value.
  2042. // This may be used to include null fields in Patch requests.
  2043. NullFields []string `json:"-"`
  2044. }
  2045. func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) {
  2046. type NoMethod VoidedPurchasesListResponse
  2047. raw := NoMethod(*s)
  2048. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2049. }
  2050. // method id "androidpublisher.edits.commit":
  2051. type EditsCommitCall struct {
  2052. s *Service
  2053. packageNameid string
  2054. editId string
  2055. urlParams_ gensupport.URLParams
  2056. ctx_ context.Context
  2057. header_ http.Header
  2058. }
  2059. // Commit: Commits/applies the changes made in this edit back to the
  2060. // app.
  2061. func (r *EditsService) Commit(packageNameid string, editId string) *EditsCommitCall {
  2062. c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2063. c.packageNameid = packageNameid
  2064. c.editId = editId
  2065. return c
  2066. }
  2067. // Fields allows partial responses to be retrieved. See
  2068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2069. // for more information.
  2070. func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall {
  2071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2072. return c
  2073. }
  2074. // Context sets the context to be used in this call's Do method. Any
  2075. // pending HTTP request will be aborted if the provided context is
  2076. // canceled.
  2077. func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall {
  2078. c.ctx_ = ctx
  2079. return c
  2080. }
  2081. // Header returns an http.Header that can be modified by the caller to
  2082. // add HTTP headers to the request.
  2083. func (c *EditsCommitCall) Header() http.Header {
  2084. if c.header_ == nil {
  2085. c.header_ = make(http.Header)
  2086. }
  2087. return c.header_
  2088. }
  2089. func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) {
  2090. reqHeaders := make(http.Header)
  2091. for k, v := range c.header_ {
  2092. reqHeaders[k] = v
  2093. }
  2094. reqHeaders.Set("User-Agent", c.s.userAgent())
  2095. var body io.Reader = nil
  2096. c.urlParams_.Set("alt", alt)
  2097. c.urlParams_.Set("prettyPrint", "false")
  2098. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:commit")
  2099. urls += "?" + c.urlParams_.Encode()
  2100. req, err := http.NewRequest("POST", urls, body)
  2101. if err != nil {
  2102. return nil, err
  2103. }
  2104. req.Header = reqHeaders
  2105. googleapi.Expand(req.URL, map[string]string{
  2106. "packageName": c.packageNameid,
  2107. "editId": c.editId,
  2108. })
  2109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2110. }
  2111. // Do executes the "androidpublisher.edits.commit" call.
  2112. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2113. // code is an error. Response headers are in either
  2114. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2115. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2116. // check whether the returned error was because http.StatusNotModified
  2117. // was returned.
  2118. func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2119. gensupport.SetOptions(c.urlParams_, opts...)
  2120. res, err := c.doRequest("json")
  2121. if res != nil && res.StatusCode == http.StatusNotModified {
  2122. if res.Body != nil {
  2123. res.Body.Close()
  2124. }
  2125. return nil, &googleapi.Error{
  2126. Code: res.StatusCode,
  2127. Header: res.Header,
  2128. }
  2129. }
  2130. if err != nil {
  2131. return nil, err
  2132. }
  2133. defer googleapi.CloseBody(res)
  2134. if err := googleapi.CheckResponse(res); err != nil {
  2135. return nil, err
  2136. }
  2137. ret := &AppEdit{
  2138. ServerResponse: googleapi.ServerResponse{
  2139. Header: res.Header,
  2140. HTTPStatusCode: res.StatusCode,
  2141. },
  2142. }
  2143. target := &ret
  2144. if err := gensupport.DecodeResponse(target, res); err != nil {
  2145. return nil, err
  2146. }
  2147. return ret, nil
  2148. // {
  2149. // "description": "Commits/applies the changes made in this edit back to the app.",
  2150. // "httpMethod": "POST",
  2151. // "id": "androidpublisher.edits.commit",
  2152. // "parameterOrder": [
  2153. // "packageName",
  2154. // "editId"
  2155. // ],
  2156. // "parameters": {
  2157. // "editId": {
  2158. // "description": "Unique identifier for this edit.",
  2159. // "location": "path",
  2160. // "required": true,
  2161. // "type": "string"
  2162. // },
  2163. // "packageName": {
  2164. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2165. // "location": "path",
  2166. // "required": true,
  2167. // "type": "string"
  2168. // }
  2169. // },
  2170. // "path": "{packageName}/edits/{editId}:commit",
  2171. // "response": {
  2172. // "$ref": "AppEdit"
  2173. // },
  2174. // "scopes": [
  2175. // "https://www.googleapis.com/auth/androidpublisher"
  2176. // ]
  2177. // }
  2178. }
  2179. // method id "androidpublisher.edits.delete":
  2180. type EditsDeleteCall struct {
  2181. s *Service
  2182. packageNameid string
  2183. editId string
  2184. urlParams_ gensupport.URLParams
  2185. ctx_ context.Context
  2186. header_ http.Header
  2187. }
  2188. // Delete: Deletes an edit for an app. Creating a new edit will
  2189. // automatically delete any of your previous edits so this method need
  2190. // only be called if you want to preemptively abandon an edit.
  2191. func (r *EditsService) Delete(packageNameid string, editId string) *EditsDeleteCall {
  2192. c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2193. c.packageNameid = packageNameid
  2194. c.editId = editId
  2195. return c
  2196. }
  2197. // Fields allows partial responses to be retrieved. See
  2198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2199. // for more information.
  2200. func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall {
  2201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2202. return c
  2203. }
  2204. // Context sets the context to be used in this call's Do method. Any
  2205. // pending HTTP request will be aborted if the provided context is
  2206. // canceled.
  2207. func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall {
  2208. c.ctx_ = ctx
  2209. return c
  2210. }
  2211. // Header returns an http.Header that can be modified by the caller to
  2212. // add HTTP headers to the request.
  2213. func (c *EditsDeleteCall) Header() http.Header {
  2214. if c.header_ == nil {
  2215. c.header_ = make(http.Header)
  2216. }
  2217. return c.header_
  2218. }
  2219. func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2220. reqHeaders := make(http.Header)
  2221. for k, v := range c.header_ {
  2222. reqHeaders[k] = v
  2223. }
  2224. reqHeaders.Set("User-Agent", c.s.userAgent())
  2225. var body io.Reader = nil
  2226. c.urlParams_.Set("alt", alt)
  2227. c.urlParams_.Set("prettyPrint", "false")
  2228. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2229. urls += "?" + c.urlParams_.Encode()
  2230. req, err := http.NewRequest("DELETE", urls, body)
  2231. if err != nil {
  2232. return nil, err
  2233. }
  2234. req.Header = reqHeaders
  2235. googleapi.Expand(req.URL, map[string]string{
  2236. "packageName": c.packageNameid,
  2237. "editId": c.editId,
  2238. })
  2239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2240. }
  2241. // Do executes the "androidpublisher.edits.delete" call.
  2242. func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2243. gensupport.SetOptions(c.urlParams_, opts...)
  2244. res, err := c.doRequest("json")
  2245. if err != nil {
  2246. return err
  2247. }
  2248. defer googleapi.CloseBody(res)
  2249. if err := googleapi.CheckResponse(res); err != nil {
  2250. return err
  2251. }
  2252. return nil
  2253. // {
  2254. // "description": "Deletes an edit for an app. Creating a new edit will automatically delete any of your previous edits so this method need only be called if you want to preemptively abandon an edit.",
  2255. // "httpMethod": "DELETE",
  2256. // "id": "androidpublisher.edits.delete",
  2257. // "parameterOrder": [
  2258. // "packageName",
  2259. // "editId"
  2260. // ],
  2261. // "parameters": {
  2262. // "editId": {
  2263. // "description": "Unique identifier for this edit.",
  2264. // "location": "path",
  2265. // "required": true,
  2266. // "type": "string"
  2267. // },
  2268. // "packageName": {
  2269. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2270. // "location": "path",
  2271. // "required": true,
  2272. // "type": "string"
  2273. // }
  2274. // },
  2275. // "path": "{packageName}/edits/{editId}",
  2276. // "scopes": [
  2277. // "https://www.googleapis.com/auth/androidpublisher"
  2278. // ]
  2279. // }
  2280. }
  2281. // method id "androidpublisher.edits.get":
  2282. type EditsGetCall struct {
  2283. s *Service
  2284. packageNameid string
  2285. editId string
  2286. urlParams_ gensupport.URLParams
  2287. ifNoneMatch_ string
  2288. ctx_ context.Context
  2289. header_ http.Header
  2290. }
  2291. // Get: Returns information about the edit specified. Calls will fail if
  2292. // the edit is no long active (e.g. has been deleted, superseded or
  2293. // expired).
  2294. func (r *EditsService) Get(packageNameid string, editId string) *EditsGetCall {
  2295. c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2296. c.packageNameid = packageNameid
  2297. c.editId = editId
  2298. return c
  2299. }
  2300. // Fields allows partial responses to be retrieved. See
  2301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2302. // for more information.
  2303. func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall {
  2304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2305. return c
  2306. }
  2307. // IfNoneMatch sets the optional parameter which makes the operation
  2308. // fail if the object's ETag matches the given value. This is useful for
  2309. // getting updates only after the object has changed since the last
  2310. // request. Use googleapi.IsNotModified to check whether the response
  2311. // error from Do is the result of In-None-Match.
  2312. func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall {
  2313. c.ifNoneMatch_ = entityTag
  2314. return c
  2315. }
  2316. // Context sets the context to be used in this call's Do method. Any
  2317. // pending HTTP request will be aborted if the provided context is
  2318. // canceled.
  2319. func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall {
  2320. c.ctx_ = ctx
  2321. return c
  2322. }
  2323. // Header returns an http.Header that can be modified by the caller to
  2324. // add HTTP headers to the request.
  2325. func (c *EditsGetCall) Header() http.Header {
  2326. if c.header_ == nil {
  2327. c.header_ = make(http.Header)
  2328. }
  2329. return c.header_
  2330. }
  2331. func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) {
  2332. reqHeaders := make(http.Header)
  2333. for k, v := range c.header_ {
  2334. reqHeaders[k] = v
  2335. }
  2336. reqHeaders.Set("User-Agent", c.s.userAgent())
  2337. if c.ifNoneMatch_ != "" {
  2338. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2339. }
  2340. var body io.Reader = nil
  2341. c.urlParams_.Set("alt", alt)
  2342. c.urlParams_.Set("prettyPrint", "false")
  2343. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2344. urls += "?" + c.urlParams_.Encode()
  2345. req, err := http.NewRequest("GET", urls, body)
  2346. if err != nil {
  2347. return nil, err
  2348. }
  2349. req.Header = reqHeaders
  2350. googleapi.Expand(req.URL, map[string]string{
  2351. "packageName": c.packageNameid,
  2352. "editId": c.editId,
  2353. })
  2354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2355. }
  2356. // Do executes the "androidpublisher.edits.get" call.
  2357. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2358. // code is an error. Response headers are in either
  2359. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2360. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2361. // check whether the returned error was because http.StatusNotModified
  2362. // was returned.
  2363. func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2364. gensupport.SetOptions(c.urlParams_, opts...)
  2365. res, err := c.doRequest("json")
  2366. if res != nil && res.StatusCode == http.StatusNotModified {
  2367. if res.Body != nil {
  2368. res.Body.Close()
  2369. }
  2370. return nil, &googleapi.Error{
  2371. Code: res.StatusCode,
  2372. Header: res.Header,
  2373. }
  2374. }
  2375. if err != nil {
  2376. return nil, err
  2377. }
  2378. defer googleapi.CloseBody(res)
  2379. if err := googleapi.CheckResponse(res); err != nil {
  2380. return nil, err
  2381. }
  2382. ret := &AppEdit{
  2383. ServerResponse: googleapi.ServerResponse{
  2384. Header: res.Header,
  2385. HTTPStatusCode: res.StatusCode,
  2386. },
  2387. }
  2388. target := &ret
  2389. if err := gensupport.DecodeResponse(target, res); err != nil {
  2390. return nil, err
  2391. }
  2392. return ret, nil
  2393. // {
  2394. // "description": "Returns information about the edit specified. Calls will fail if the edit is no long active (e.g. has been deleted, superseded or expired).",
  2395. // "httpMethod": "GET",
  2396. // "id": "androidpublisher.edits.get",
  2397. // "parameterOrder": [
  2398. // "packageName",
  2399. // "editId"
  2400. // ],
  2401. // "parameters": {
  2402. // "editId": {
  2403. // "description": "Unique identifier for this edit.",
  2404. // "location": "path",
  2405. // "required": true,
  2406. // "type": "string"
  2407. // },
  2408. // "packageName": {
  2409. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2410. // "location": "path",
  2411. // "required": true,
  2412. // "type": "string"
  2413. // }
  2414. // },
  2415. // "path": "{packageName}/edits/{editId}",
  2416. // "response": {
  2417. // "$ref": "AppEdit"
  2418. // },
  2419. // "scopes": [
  2420. // "https://www.googleapis.com/auth/androidpublisher"
  2421. // ]
  2422. // }
  2423. }
  2424. // method id "androidpublisher.edits.insert":
  2425. type EditsInsertCall struct {
  2426. s *Service
  2427. packageNameid string
  2428. appedit *AppEdit
  2429. urlParams_ gensupport.URLParams
  2430. ctx_ context.Context
  2431. header_ http.Header
  2432. }
  2433. // Insert: Creates a new edit for an app, populated with the app's
  2434. // current state.
  2435. func (r *EditsService) Insert(packageNameid string, appedit *AppEdit) *EditsInsertCall {
  2436. c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2437. c.packageNameid = packageNameid
  2438. c.appedit = appedit
  2439. return c
  2440. }
  2441. // Fields allows partial responses to be retrieved. See
  2442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2443. // for more information.
  2444. func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall {
  2445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2446. return c
  2447. }
  2448. // Context sets the context to be used in this call's Do method. Any
  2449. // pending HTTP request will be aborted if the provided context is
  2450. // canceled.
  2451. func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall {
  2452. c.ctx_ = ctx
  2453. return c
  2454. }
  2455. // Header returns an http.Header that can be modified by the caller to
  2456. // add HTTP headers to the request.
  2457. func (c *EditsInsertCall) Header() http.Header {
  2458. if c.header_ == nil {
  2459. c.header_ = make(http.Header)
  2460. }
  2461. return c.header_
  2462. }
  2463. func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) {
  2464. reqHeaders := make(http.Header)
  2465. for k, v := range c.header_ {
  2466. reqHeaders[k] = v
  2467. }
  2468. reqHeaders.Set("User-Agent", c.s.userAgent())
  2469. var body io.Reader = nil
  2470. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit)
  2471. if err != nil {
  2472. return nil, err
  2473. }
  2474. reqHeaders.Set("Content-Type", "application/json")
  2475. c.urlParams_.Set("alt", alt)
  2476. c.urlParams_.Set("prettyPrint", "false")
  2477. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits")
  2478. urls += "?" + c.urlParams_.Encode()
  2479. req, err := http.NewRequest("POST", urls, body)
  2480. if err != nil {
  2481. return nil, err
  2482. }
  2483. req.Header = reqHeaders
  2484. googleapi.Expand(req.URL, map[string]string{
  2485. "packageName": c.packageNameid,
  2486. })
  2487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2488. }
  2489. // Do executes the "androidpublisher.edits.insert" call.
  2490. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2491. // code is an error. Response headers are in either
  2492. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2493. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2494. // check whether the returned error was because http.StatusNotModified
  2495. // was returned.
  2496. func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2497. gensupport.SetOptions(c.urlParams_, opts...)
  2498. res, err := c.doRequest("json")
  2499. if res != nil && res.StatusCode == http.StatusNotModified {
  2500. if res.Body != nil {
  2501. res.Body.Close()
  2502. }
  2503. return nil, &googleapi.Error{
  2504. Code: res.StatusCode,
  2505. Header: res.Header,
  2506. }
  2507. }
  2508. if err != nil {
  2509. return nil, err
  2510. }
  2511. defer googleapi.CloseBody(res)
  2512. if err := googleapi.CheckResponse(res); err != nil {
  2513. return nil, err
  2514. }
  2515. ret := &AppEdit{
  2516. ServerResponse: googleapi.ServerResponse{
  2517. Header: res.Header,
  2518. HTTPStatusCode: res.StatusCode,
  2519. },
  2520. }
  2521. target := &ret
  2522. if err := gensupport.DecodeResponse(target, res); err != nil {
  2523. return nil, err
  2524. }
  2525. return ret, nil
  2526. // {
  2527. // "description": "Creates a new edit for an app, populated with the app's current state.",
  2528. // "httpMethod": "POST",
  2529. // "id": "androidpublisher.edits.insert",
  2530. // "parameterOrder": [
  2531. // "packageName"
  2532. // ],
  2533. // "parameters": {
  2534. // "packageName": {
  2535. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2536. // "location": "path",
  2537. // "required": true,
  2538. // "type": "string"
  2539. // }
  2540. // },
  2541. // "path": "{packageName}/edits",
  2542. // "request": {
  2543. // "$ref": "AppEdit"
  2544. // },
  2545. // "response": {
  2546. // "$ref": "AppEdit"
  2547. // },
  2548. // "scopes": [
  2549. // "https://www.googleapis.com/auth/androidpublisher"
  2550. // ]
  2551. // }
  2552. }
  2553. // method id "androidpublisher.edits.validate":
  2554. type EditsValidateCall struct {
  2555. s *Service
  2556. packageNameid string
  2557. editId string
  2558. urlParams_ gensupport.URLParams
  2559. ctx_ context.Context
  2560. header_ http.Header
  2561. }
  2562. // Validate: Checks that the edit can be successfully committed. The
  2563. // edit's changes are not applied to the live app.
  2564. func (r *EditsService) Validate(packageNameid string, editId string) *EditsValidateCall {
  2565. c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2566. c.packageNameid = packageNameid
  2567. c.editId = editId
  2568. return c
  2569. }
  2570. // Fields allows partial responses to be retrieved. See
  2571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2572. // for more information.
  2573. func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall {
  2574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2575. return c
  2576. }
  2577. // Context sets the context to be used in this call's Do method. Any
  2578. // pending HTTP request will be aborted if the provided context is
  2579. // canceled.
  2580. func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall {
  2581. c.ctx_ = ctx
  2582. return c
  2583. }
  2584. // Header returns an http.Header that can be modified by the caller to
  2585. // add HTTP headers to the request.
  2586. func (c *EditsValidateCall) Header() http.Header {
  2587. if c.header_ == nil {
  2588. c.header_ = make(http.Header)
  2589. }
  2590. return c.header_
  2591. }
  2592. func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) {
  2593. reqHeaders := make(http.Header)
  2594. for k, v := range c.header_ {
  2595. reqHeaders[k] = v
  2596. }
  2597. reqHeaders.Set("User-Agent", c.s.userAgent())
  2598. var body io.Reader = nil
  2599. c.urlParams_.Set("alt", alt)
  2600. c.urlParams_.Set("prettyPrint", "false")
  2601. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:validate")
  2602. urls += "?" + c.urlParams_.Encode()
  2603. req, err := http.NewRequest("POST", urls, body)
  2604. if err != nil {
  2605. return nil, err
  2606. }
  2607. req.Header = reqHeaders
  2608. googleapi.Expand(req.URL, map[string]string{
  2609. "packageName": c.packageNameid,
  2610. "editId": c.editId,
  2611. })
  2612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2613. }
  2614. // Do executes the "androidpublisher.edits.validate" call.
  2615. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2616. // code is an error. Response headers are in either
  2617. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2618. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2619. // check whether the returned error was because http.StatusNotModified
  2620. // was returned.
  2621. func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2622. gensupport.SetOptions(c.urlParams_, opts...)
  2623. res, err := c.doRequest("json")
  2624. if res != nil && res.StatusCode == http.StatusNotModified {
  2625. if res.Body != nil {
  2626. res.Body.Close()
  2627. }
  2628. return nil, &googleapi.Error{
  2629. Code: res.StatusCode,
  2630. Header: res.Header,
  2631. }
  2632. }
  2633. if err != nil {
  2634. return nil, err
  2635. }
  2636. defer googleapi.CloseBody(res)
  2637. if err := googleapi.CheckResponse(res); err != nil {
  2638. return nil, err
  2639. }
  2640. ret := &AppEdit{
  2641. ServerResponse: googleapi.ServerResponse{
  2642. Header: res.Header,
  2643. HTTPStatusCode: res.StatusCode,
  2644. },
  2645. }
  2646. target := &ret
  2647. if err := gensupport.DecodeResponse(target, res); err != nil {
  2648. return nil, err
  2649. }
  2650. return ret, nil
  2651. // {
  2652. // "description": "Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.",
  2653. // "httpMethod": "POST",
  2654. // "id": "androidpublisher.edits.validate",
  2655. // "parameterOrder": [
  2656. // "packageName",
  2657. // "editId"
  2658. // ],
  2659. // "parameters": {
  2660. // "editId": {
  2661. // "description": "Unique identifier for this edit.",
  2662. // "location": "path",
  2663. // "required": true,
  2664. // "type": "string"
  2665. // },
  2666. // "packageName": {
  2667. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2668. // "location": "path",
  2669. // "required": true,
  2670. // "type": "string"
  2671. // }
  2672. // },
  2673. // "path": "{packageName}/edits/{editId}:validate",
  2674. // "response": {
  2675. // "$ref": "AppEdit"
  2676. // },
  2677. // "scopes": [
  2678. // "https://www.googleapis.com/auth/androidpublisher"
  2679. // ]
  2680. // }
  2681. }
  2682. // method id "androidpublisher.edits.apklistings.delete":
  2683. type EditsApklistingsDeleteCall struct {
  2684. s *Service
  2685. packageNameid string
  2686. editId string
  2687. apkVersionCode int64
  2688. language string
  2689. urlParams_ gensupport.URLParams
  2690. ctx_ context.Context
  2691. header_ http.Header
  2692. }
  2693. // Delete: Deletes the APK-specific localized listing for a specified
  2694. // APK and language code.
  2695. func (r *EditsApklistingsService) Delete(packageNameid string, editId string, apkVersionCode int64, language string) *EditsApklistingsDeleteCall {
  2696. c := &EditsApklistingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2697. c.packageNameid = packageNameid
  2698. c.editId = editId
  2699. c.apkVersionCode = apkVersionCode
  2700. c.language = language
  2701. return c
  2702. }
  2703. // Fields allows partial responses to be retrieved. See
  2704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2705. // for more information.
  2706. func (c *EditsApklistingsDeleteCall) Fields(s ...googleapi.Field) *EditsApklistingsDeleteCall {
  2707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2708. return c
  2709. }
  2710. // Context sets the context to be used in this call's Do method. Any
  2711. // pending HTTP request will be aborted if the provided context is
  2712. // canceled.
  2713. func (c *EditsApklistingsDeleteCall) Context(ctx context.Context) *EditsApklistingsDeleteCall {
  2714. c.ctx_ = ctx
  2715. return c
  2716. }
  2717. // Header returns an http.Header that can be modified by the caller to
  2718. // add HTTP headers to the request.
  2719. func (c *EditsApklistingsDeleteCall) Header() http.Header {
  2720. if c.header_ == nil {
  2721. c.header_ = make(http.Header)
  2722. }
  2723. return c.header_
  2724. }
  2725. func (c *EditsApklistingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2726. reqHeaders := make(http.Header)
  2727. for k, v := range c.header_ {
  2728. reqHeaders[k] = v
  2729. }
  2730. reqHeaders.Set("User-Agent", c.s.userAgent())
  2731. var body io.Reader = nil
  2732. c.urlParams_.Set("alt", alt)
  2733. c.urlParams_.Set("prettyPrint", "false")
  2734. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  2735. urls += "?" + c.urlParams_.Encode()
  2736. req, err := http.NewRequest("DELETE", urls, body)
  2737. if err != nil {
  2738. return nil, err
  2739. }
  2740. req.Header = reqHeaders
  2741. googleapi.Expand(req.URL, map[string]string{
  2742. "packageName": c.packageNameid,
  2743. "editId": c.editId,
  2744. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  2745. "language": c.language,
  2746. })
  2747. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2748. }
  2749. // Do executes the "androidpublisher.edits.apklistings.delete" call.
  2750. func (c *EditsApklistingsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2751. gensupport.SetOptions(c.urlParams_, opts...)
  2752. res, err := c.doRequest("json")
  2753. if err != nil {
  2754. return err
  2755. }
  2756. defer googleapi.CloseBody(res)
  2757. if err := googleapi.CheckResponse(res); err != nil {
  2758. return err
  2759. }
  2760. return nil
  2761. // {
  2762. // "description": "Deletes the APK-specific localized listing for a specified APK and language code.",
  2763. // "httpMethod": "DELETE",
  2764. // "id": "androidpublisher.edits.apklistings.delete",
  2765. // "parameterOrder": [
  2766. // "packageName",
  2767. // "editId",
  2768. // "apkVersionCode",
  2769. // "language"
  2770. // ],
  2771. // "parameters": {
  2772. // "apkVersionCode": {
  2773. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  2774. // "format": "int32",
  2775. // "location": "path",
  2776. // "required": true,
  2777. // "type": "integer"
  2778. // },
  2779. // "editId": {
  2780. // "description": "Unique identifier for this edit.",
  2781. // "location": "path",
  2782. // "required": true,
  2783. // "type": "string"
  2784. // },
  2785. // "language": {
  2786. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  2787. // "location": "path",
  2788. // "required": true,
  2789. // "type": "string"
  2790. // },
  2791. // "packageName": {
  2792. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2793. // "location": "path",
  2794. // "required": true,
  2795. // "type": "string"
  2796. // }
  2797. // },
  2798. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  2799. // "scopes": [
  2800. // "https://www.googleapis.com/auth/androidpublisher"
  2801. // ]
  2802. // }
  2803. }
  2804. // method id "androidpublisher.edits.apklistings.deleteall":
  2805. type EditsApklistingsDeleteallCall struct {
  2806. s *Service
  2807. packageNameid string
  2808. editId string
  2809. apkVersionCode int64
  2810. urlParams_ gensupport.URLParams
  2811. ctx_ context.Context
  2812. header_ http.Header
  2813. }
  2814. // Deleteall: Deletes all the APK-specific localized listings for a
  2815. // specified APK.
  2816. func (r *EditsApklistingsService) Deleteall(packageNameid string, editId string, apkVersionCode int64) *EditsApklistingsDeleteallCall {
  2817. c := &EditsApklistingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2818. c.packageNameid = packageNameid
  2819. c.editId = editId
  2820. c.apkVersionCode = apkVersionCode
  2821. return c
  2822. }
  2823. // Fields allows partial responses to be retrieved. See
  2824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2825. // for more information.
  2826. func (c *EditsApklistingsDeleteallCall) Fields(s ...googleapi.Field) *EditsApklistingsDeleteallCall {
  2827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2828. return c
  2829. }
  2830. // Context sets the context to be used in this call's Do method. Any
  2831. // pending HTTP request will be aborted if the provided context is
  2832. // canceled.
  2833. func (c *EditsApklistingsDeleteallCall) Context(ctx context.Context) *EditsApklistingsDeleteallCall {
  2834. c.ctx_ = ctx
  2835. return c
  2836. }
  2837. // Header returns an http.Header that can be modified by the caller to
  2838. // add HTTP headers to the request.
  2839. func (c *EditsApklistingsDeleteallCall) Header() http.Header {
  2840. if c.header_ == nil {
  2841. c.header_ = make(http.Header)
  2842. }
  2843. return c.header_
  2844. }
  2845. func (c *EditsApklistingsDeleteallCall) doRequest(alt string) (*http.Response, error) {
  2846. reqHeaders := make(http.Header)
  2847. for k, v := range c.header_ {
  2848. reqHeaders[k] = v
  2849. }
  2850. reqHeaders.Set("User-Agent", c.s.userAgent())
  2851. var body io.Reader = nil
  2852. c.urlParams_.Set("alt", alt)
  2853. c.urlParams_.Set("prettyPrint", "false")
  2854. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings")
  2855. urls += "?" + c.urlParams_.Encode()
  2856. req, err := http.NewRequest("DELETE", urls, body)
  2857. if err != nil {
  2858. return nil, err
  2859. }
  2860. req.Header = reqHeaders
  2861. googleapi.Expand(req.URL, map[string]string{
  2862. "packageName": c.packageNameid,
  2863. "editId": c.editId,
  2864. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  2865. })
  2866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2867. }
  2868. // Do executes the "androidpublisher.edits.apklistings.deleteall" call.
  2869. func (c *EditsApklistingsDeleteallCall) Do(opts ...googleapi.CallOption) error {
  2870. gensupport.SetOptions(c.urlParams_, opts...)
  2871. res, err := c.doRequest("json")
  2872. if err != nil {
  2873. return err
  2874. }
  2875. defer googleapi.CloseBody(res)
  2876. if err := googleapi.CheckResponse(res); err != nil {
  2877. return err
  2878. }
  2879. return nil
  2880. // {
  2881. // "description": "Deletes all the APK-specific localized listings for a specified APK.",
  2882. // "httpMethod": "DELETE",
  2883. // "id": "androidpublisher.edits.apklistings.deleteall",
  2884. // "parameterOrder": [
  2885. // "packageName",
  2886. // "editId",
  2887. // "apkVersionCode"
  2888. // ],
  2889. // "parameters": {
  2890. // "apkVersionCode": {
  2891. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  2892. // "format": "int32",
  2893. // "location": "path",
  2894. // "required": true,
  2895. // "type": "integer"
  2896. // },
  2897. // "editId": {
  2898. // "description": "Unique identifier for this edit.",
  2899. // "location": "path",
  2900. // "required": true,
  2901. // "type": "string"
  2902. // },
  2903. // "packageName": {
  2904. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2905. // "location": "path",
  2906. // "required": true,
  2907. // "type": "string"
  2908. // }
  2909. // },
  2910. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings",
  2911. // "scopes": [
  2912. // "https://www.googleapis.com/auth/androidpublisher"
  2913. // ]
  2914. // }
  2915. }
  2916. // method id "androidpublisher.edits.apklistings.get":
  2917. type EditsApklistingsGetCall struct {
  2918. s *Service
  2919. packageNameid string
  2920. editId string
  2921. apkVersionCode int64
  2922. language string
  2923. urlParams_ gensupport.URLParams
  2924. ifNoneMatch_ string
  2925. ctx_ context.Context
  2926. header_ http.Header
  2927. }
  2928. // Get: Fetches the APK-specific localized listing for a specified APK
  2929. // and language code.
  2930. func (r *EditsApklistingsService) Get(packageNameid string, editId string, apkVersionCode int64, language string) *EditsApklistingsGetCall {
  2931. c := &EditsApklistingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2932. c.packageNameid = packageNameid
  2933. c.editId = editId
  2934. c.apkVersionCode = apkVersionCode
  2935. c.language = language
  2936. return c
  2937. }
  2938. // Fields allows partial responses to be retrieved. See
  2939. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2940. // for more information.
  2941. func (c *EditsApklistingsGetCall) Fields(s ...googleapi.Field) *EditsApklistingsGetCall {
  2942. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2943. return c
  2944. }
  2945. // IfNoneMatch sets the optional parameter which makes the operation
  2946. // fail if the object's ETag matches the given value. This is useful for
  2947. // getting updates only after the object has changed since the last
  2948. // request. Use googleapi.IsNotModified to check whether the response
  2949. // error from Do is the result of In-None-Match.
  2950. func (c *EditsApklistingsGetCall) IfNoneMatch(entityTag string) *EditsApklistingsGetCall {
  2951. c.ifNoneMatch_ = entityTag
  2952. return c
  2953. }
  2954. // Context sets the context to be used in this call's Do method. Any
  2955. // pending HTTP request will be aborted if the provided context is
  2956. // canceled.
  2957. func (c *EditsApklistingsGetCall) Context(ctx context.Context) *EditsApklistingsGetCall {
  2958. c.ctx_ = ctx
  2959. return c
  2960. }
  2961. // Header returns an http.Header that can be modified by the caller to
  2962. // add HTTP headers to the request.
  2963. func (c *EditsApklistingsGetCall) Header() http.Header {
  2964. if c.header_ == nil {
  2965. c.header_ = make(http.Header)
  2966. }
  2967. return c.header_
  2968. }
  2969. func (c *EditsApklistingsGetCall) doRequest(alt string) (*http.Response, error) {
  2970. reqHeaders := make(http.Header)
  2971. for k, v := range c.header_ {
  2972. reqHeaders[k] = v
  2973. }
  2974. reqHeaders.Set("User-Agent", c.s.userAgent())
  2975. if c.ifNoneMatch_ != "" {
  2976. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2977. }
  2978. var body io.Reader = nil
  2979. c.urlParams_.Set("alt", alt)
  2980. c.urlParams_.Set("prettyPrint", "false")
  2981. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  2982. urls += "?" + c.urlParams_.Encode()
  2983. req, err := http.NewRequest("GET", urls, body)
  2984. if err != nil {
  2985. return nil, err
  2986. }
  2987. req.Header = reqHeaders
  2988. googleapi.Expand(req.URL, map[string]string{
  2989. "packageName": c.packageNameid,
  2990. "editId": c.editId,
  2991. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  2992. "language": c.language,
  2993. })
  2994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2995. }
  2996. // Do executes the "androidpublisher.edits.apklistings.get" call.
  2997. // Exactly one of *ApkListing or error will be non-nil. Any non-2xx
  2998. // status code is an error. Response headers are in either
  2999. // *ApkListing.ServerResponse.Header or (if a response was returned at
  3000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3001. // to check whether the returned error was because
  3002. // http.StatusNotModified was returned.
  3003. func (c *EditsApklistingsGetCall) Do(opts ...googleapi.CallOption) (*ApkListing, error) {
  3004. gensupport.SetOptions(c.urlParams_, opts...)
  3005. res, err := c.doRequest("json")
  3006. if res != nil && res.StatusCode == http.StatusNotModified {
  3007. if res.Body != nil {
  3008. res.Body.Close()
  3009. }
  3010. return nil, &googleapi.Error{
  3011. Code: res.StatusCode,
  3012. Header: res.Header,
  3013. }
  3014. }
  3015. if err != nil {
  3016. return nil, err
  3017. }
  3018. defer googleapi.CloseBody(res)
  3019. if err := googleapi.CheckResponse(res); err != nil {
  3020. return nil, err
  3021. }
  3022. ret := &ApkListing{
  3023. ServerResponse: googleapi.ServerResponse{
  3024. Header: res.Header,
  3025. HTTPStatusCode: res.StatusCode,
  3026. },
  3027. }
  3028. target := &ret
  3029. if err := gensupport.DecodeResponse(target, res); err != nil {
  3030. return nil, err
  3031. }
  3032. return ret, nil
  3033. // {
  3034. // "description": "Fetches the APK-specific localized listing for a specified APK and language code.",
  3035. // "httpMethod": "GET",
  3036. // "id": "androidpublisher.edits.apklistings.get",
  3037. // "parameterOrder": [
  3038. // "packageName",
  3039. // "editId",
  3040. // "apkVersionCode",
  3041. // "language"
  3042. // ],
  3043. // "parameters": {
  3044. // "apkVersionCode": {
  3045. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3046. // "format": "int32",
  3047. // "location": "path",
  3048. // "required": true,
  3049. // "type": "integer"
  3050. // },
  3051. // "editId": {
  3052. // "description": "Unique identifier for this edit.",
  3053. // "location": "path",
  3054. // "required": true,
  3055. // "type": "string"
  3056. // },
  3057. // "language": {
  3058. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  3059. // "location": "path",
  3060. // "required": true,
  3061. // "type": "string"
  3062. // },
  3063. // "packageName": {
  3064. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3065. // "location": "path",
  3066. // "required": true,
  3067. // "type": "string"
  3068. // }
  3069. // },
  3070. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  3071. // "response": {
  3072. // "$ref": "ApkListing"
  3073. // },
  3074. // "scopes": [
  3075. // "https://www.googleapis.com/auth/androidpublisher"
  3076. // ]
  3077. // }
  3078. }
  3079. // method id "androidpublisher.edits.apklistings.list":
  3080. type EditsApklistingsListCall struct {
  3081. s *Service
  3082. packageNameid string
  3083. editId string
  3084. apkVersionCode int64
  3085. urlParams_ gensupport.URLParams
  3086. ifNoneMatch_ string
  3087. ctx_ context.Context
  3088. header_ http.Header
  3089. }
  3090. // List: Lists all the APK-specific localized listings for a specified
  3091. // APK.
  3092. func (r *EditsApklistingsService) List(packageNameid string, editId string, apkVersionCode int64) *EditsApklistingsListCall {
  3093. c := &EditsApklistingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3094. c.packageNameid = packageNameid
  3095. c.editId = editId
  3096. c.apkVersionCode = apkVersionCode
  3097. return c
  3098. }
  3099. // Fields allows partial responses to be retrieved. See
  3100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3101. // for more information.
  3102. func (c *EditsApklistingsListCall) Fields(s ...googleapi.Field) *EditsApklistingsListCall {
  3103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3104. return c
  3105. }
  3106. // IfNoneMatch sets the optional parameter which makes the operation
  3107. // fail if the object's ETag matches the given value. This is useful for
  3108. // getting updates only after the object has changed since the last
  3109. // request. Use googleapi.IsNotModified to check whether the response
  3110. // error from Do is the result of In-None-Match.
  3111. func (c *EditsApklistingsListCall) IfNoneMatch(entityTag string) *EditsApklistingsListCall {
  3112. c.ifNoneMatch_ = entityTag
  3113. return c
  3114. }
  3115. // Context sets the context to be used in this call's Do method. Any
  3116. // pending HTTP request will be aborted if the provided context is
  3117. // canceled.
  3118. func (c *EditsApklistingsListCall) Context(ctx context.Context) *EditsApklistingsListCall {
  3119. c.ctx_ = ctx
  3120. return c
  3121. }
  3122. // Header returns an http.Header that can be modified by the caller to
  3123. // add HTTP headers to the request.
  3124. func (c *EditsApklistingsListCall) Header() http.Header {
  3125. if c.header_ == nil {
  3126. c.header_ = make(http.Header)
  3127. }
  3128. return c.header_
  3129. }
  3130. func (c *EditsApklistingsListCall) doRequest(alt string) (*http.Response, error) {
  3131. reqHeaders := make(http.Header)
  3132. for k, v := range c.header_ {
  3133. reqHeaders[k] = v
  3134. }
  3135. reqHeaders.Set("User-Agent", c.s.userAgent())
  3136. if c.ifNoneMatch_ != "" {
  3137. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3138. }
  3139. var body io.Reader = nil
  3140. c.urlParams_.Set("alt", alt)
  3141. c.urlParams_.Set("prettyPrint", "false")
  3142. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings")
  3143. urls += "?" + c.urlParams_.Encode()
  3144. req, err := http.NewRequest("GET", urls, body)
  3145. if err != nil {
  3146. return nil, err
  3147. }
  3148. req.Header = reqHeaders
  3149. googleapi.Expand(req.URL, map[string]string{
  3150. "packageName": c.packageNameid,
  3151. "editId": c.editId,
  3152. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3153. })
  3154. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3155. }
  3156. // Do executes the "androidpublisher.edits.apklistings.list" call.
  3157. // Exactly one of *ApkListingsListResponse or error will be non-nil. Any
  3158. // non-2xx status code is an error. Response headers are in either
  3159. // *ApkListingsListResponse.ServerResponse.Header or (if a response was
  3160. // returned at all) in error.(*googleapi.Error).Header. Use
  3161. // googleapi.IsNotModified to check whether the returned error was
  3162. // because http.StatusNotModified was returned.
  3163. func (c *EditsApklistingsListCall) Do(opts ...googleapi.CallOption) (*ApkListingsListResponse, error) {
  3164. gensupport.SetOptions(c.urlParams_, opts...)
  3165. res, err := c.doRequest("json")
  3166. if res != nil && res.StatusCode == http.StatusNotModified {
  3167. if res.Body != nil {
  3168. res.Body.Close()
  3169. }
  3170. return nil, &googleapi.Error{
  3171. Code: res.StatusCode,
  3172. Header: res.Header,
  3173. }
  3174. }
  3175. if err != nil {
  3176. return nil, err
  3177. }
  3178. defer googleapi.CloseBody(res)
  3179. if err := googleapi.CheckResponse(res); err != nil {
  3180. return nil, err
  3181. }
  3182. ret := &ApkListingsListResponse{
  3183. ServerResponse: googleapi.ServerResponse{
  3184. Header: res.Header,
  3185. HTTPStatusCode: res.StatusCode,
  3186. },
  3187. }
  3188. target := &ret
  3189. if err := gensupport.DecodeResponse(target, res); err != nil {
  3190. return nil, err
  3191. }
  3192. return ret, nil
  3193. // {
  3194. // "description": "Lists all the APK-specific localized listings for a specified APK.",
  3195. // "httpMethod": "GET",
  3196. // "id": "androidpublisher.edits.apklistings.list",
  3197. // "parameterOrder": [
  3198. // "packageName",
  3199. // "editId",
  3200. // "apkVersionCode"
  3201. // ],
  3202. // "parameters": {
  3203. // "apkVersionCode": {
  3204. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3205. // "format": "int32",
  3206. // "location": "path",
  3207. // "required": true,
  3208. // "type": "integer"
  3209. // },
  3210. // "editId": {
  3211. // "description": "Unique identifier for this edit.",
  3212. // "location": "path",
  3213. // "required": true,
  3214. // "type": "string"
  3215. // },
  3216. // "packageName": {
  3217. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3218. // "location": "path",
  3219. // "required": true,
  3220. // "type": "string"
  3221. // }
  3222. // },
  3223. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings",
  3224. // "response": {
  3225. // "$ref": "ApkListingsListResponse"
  3226. // },
  3227. // "scopes": [
  3228. // "https://www.googleapis.com/auth/androidpublisher"
  3229. // ]
  3230. // }
  3231. }
  3232. // method id "androidpublisher.edits.apklistings.patch":
  3233. type EditsApklistingsPatchCall struct {
  3234. s *Service
  3235. packageNameid string
  3236. editId string
  3237. apkVersionCode int64
  3238. language string
  3239. apklisting *ApkListing
  3240. urlParams_ gensupport.URLParams
  3241. ctx_ context.Context
  3242. header_ http.Header
  3243. }
  3244. // Patch: Updates or creates the APK-specific localized listing for a
  3245. // specified APK and language code. This method supports patch
  3246. // semantics.
  3247. func (r *EditsApklistingsService) Patch(packageNameid string, editId string, apkVersionCode int64, language string, apklisting *ApkListing) *EditsApklistingsPatchCall {
  3248. c := &EditsApklistingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3249. c.packageNameid = packageNameid
  3250. c.editId = editId
  3251. c.apkVersionCode = apkVersionCode
  3252. c.language = language
  3253. c.apklisting = apklisting
  3254. return c
  3255. }
  3256. // Fields allows partial responses to be retrieved. See
  3257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3258. // for more information.
  3259. func (c *EditsApklistingsPatchCall) Fields(s ...googleapi.Field) *EditsApklistingsPatchCall {
  3260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3261. return c
  3262. }
  3263. // Context sets the context to be used in this call's Do method. Any
  3264. // pending HTTP request will be aborted if the provided context is
  3265. // canceled.
  3266. func (c *EditsApklistingsPatchCall) Context(ctx context.Context) *EditsApklistingsPatchCall {
  3267. c.ctx_ = ctx
  3268. return c
  3269. }
  3270. // Header returns an http.Header that can be modified by the caller to
  3271. // add HTTP headers to the request.
  3272. func (c *EditsApklistingsPatchCall) Header() http.Header {
  3273. if c.header_ == nil {
  3274. c.header_ = make(http.Header)
  3275. }
  3276. return c.header_
  3277. }
  3278. func (c *EditsApklistingsPatchCall) doRequest(alt string) (*http.Response, error) {
  3279. reqHeaders := make(http.Header)
  3280. for k, v := range c.header_ {
  3281. reqHeaders[k] = v
  3282. }
  3283. reqHeaders.Set("User-Agent", c.s.userAgent())
  3284. var body io.Reader = nil
  3285. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apklisting)
  3286. if err != nil {
  3287. return nil, err
  3288. }
  3289. reqHeaders.Set("Content-Type", "application/json")
  3290. c.urlParams_.Set("alt", alt)
  3291. c.urlParams_.Set("prettyPrint", "false")
  3292. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  3293. urls += "?" + c.urlParams_.Encode()
  3294. req, err := http.NewRequest("PATCH", urls, body)
  3295. if err != nil {
  3296. return nil, err
  3297. }
  3298. req.Header = reqHeaders
  3299. googleapi.Expand(req.URL, map[string]string{
  3300. "packageName": c.packageNameid,
  3301. "editId": c.editId,
  3302. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3303. "language": c.language,
  3304. })
  3305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3306. }
  3307. // Do executes the "androidpublisher.edits.apklistings.patch" call.
  3308. // Exactly one of *ApkListing or error will be non-nil. Any non-2xx
  3309. // status code is an error. Response headers are in either
  3310. // *ApkListing.ServerResponse.Header or (if a response was returned at
  3311. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3312. // to check whether the returned error was because
  3313. // http.StatusNotModified was returned.
  3314. func (c *EditsApklistingsPatchCall) Do(opts ...googleapi.CallOption) (*ApkListing, error) {
  3315. gensupport.SetOptions(c.urlParams_, opts...)
  3316. res, err := c.doRequest("json")
  3317. if res != nil && res.StatusCode == http.StatusNotModified {
  3318. if res.Body != nil {
  3319. res.Body.Close()
  3320. }
  3321. return nil, &googleapi.Error{
  3322. Code: res.StatusCode,
  3323. Header: res.Header,
  3324. }
  3325. }
  3326. if err != nil {
  3327. return nil, err
  3328. }
  3329. defer googleapi.CloseBody(res)
  3330. if err := googleapi.CheckResponse(res); err != nil {
  3331. return nil, err
  3332. }
  3333. ret := &ApkListing{
  3334. ServerResponse: googleapi.ServerResponse{
  3335. Header: res.Header,
  3336. HTTPStatusCode: res.StatusCode,
  3337. },
  3338. }
  3339. target := &ret
  3340. if err := gensupport.DecodeResponse(target, res); err != nil {
  3341. return nil, err
  3342. }
  3343. return ret, nil
  3344. // {
  3345. // "description": "Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics.",
  3346. // "httpMethod": "PATCH",
  3347. // "id": "androidpublisher.edits.apklistings.patch",
  3348. // "parameterOrder": [
  3349. // "packageName",
  3350. // "editId",
  3351. // "apkVersionCode",
  3352. // "language"
  3353. // ],
  3354. // "parameters": {
  3355. // "apkVersionCode": {
  3356. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3357. // "format": "int32",
  3358. // "location": "path",
  3359. // "required": true,
  3360. // "type": "integer"
  3361. // },
  3362. // "editId": {
  3363. // "description": "Unique identifier for this edit.",
  3364. // "location": "path",
  3365. // "required": true,
  3366. // "type": "string"
  3367. // },
  3368. // "language": {
  3369. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  3370. // "location": "path",
  3371. // "required": true,
  3372. // "type": "string"
  3373. // },
  3374. // "packageName": {
  3375. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3376. // "location": "path",
  3377. // "required": true,
  3378. // "type": "string"
  3379. // }
  3380. // },
  3381. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  3382. // "request": {
  3383. // "$ref": "ApkListing"
  3384. // },
  3385. // "response": {
  3386. // "$ref": "ApkListing"
  3387. // },
  3388. // "scopes": [
  3389. // "https://www.googleapis.com/auth/androidpublisher"
  3390. // ]
  3391. // }
  3392. }
  3393. // method id "androidpublisher.edits.apklistings.update":
  3394. type EditsApklistingsUpdateCall struct {
  3395. s *Service
  3396. packageNameid string
  3397. editId string
  3398. apkVersionCode int64
  3399. language string
  3400. apklisting *ApkListing
  3401. urlParams_ gensupport.URLParams
  3402. ctx_ context.Context
  3403. header_ http.Header
  3404. }
  3405. // Update: Updates or creates the APK-specific localized listing for a
  3406. // specified APK and language code.
  3407. func (r *EditsApklistingsService) Update(packageNameid string, editId string, apkVersionCode int64, language string, apklisting *ApkListing) *EditsApklistingsUpdateCall {
  3408. c := &EditsApklistingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3409. c.packageNameid = packageNameid
  3410. c.editId = editId
  3411. c.apkVersionCode = apkVersionCode
  3412. c.language = language
  3413. c.apklisting = apklisting
  3414. return c
  3415. }
  3416. // Fields allows partial responses to be retrieved. See
  3417. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3418. // for more information.
  3419. func (c *EditsApklistingsUpdateCall) Fields(s ...googleapi.Field) *EditsApklistingsUpdateCall {
  3420. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3421. return c
  3422. }
  3423. // Context sets the context to be used in this call's Do method. Any
  3424. // pending HTTP request will be aborted if the provided context is
  3425. // canceled.
  3426. func (c *EditsApklistingsUpdateCall) Context(ctx context.Context) *EditsApklistingsUpdateCall {
  3427. c.ctx_ = ctx
  3428. return c
  3429. }
  3430. // Header returns an http.Header that can be modified by the caller to
  3431. // add HTTP headers to the request.
  3432. func (c *EditsApklistingsUpdateCall) Header() http.Header {
  3433. if c.header_ == nil {
  3434. c.header_ = make(http.Header)
  3435. }
  3436. return c.header_
  3437. }
  3438. func (c *EditsApklistingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3439. reqHeaders := make(http.Header)
  3440. for k, v := range c.header_ {
  3441. reqHeaders[k] = v
  3442. }
  3443. reqHeaders.Set("User-Agent", c.s.userAgent())
  3444. var body io.Reader = nil
  3445. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apklisting)
  3446. if err != nil {
  3447. return nil, err
  3448. }
  3449. reqHeaders.Set("Content-Type", "application/json")
  3450. c.urlParams_.Set("alt", alt)
  3451. c.urlParams_.Set("prettyPrint", "false")
  3452. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  3453. urls += "?" + c.urlParams_.Encode()
  3454. req, err := http.NewRequest("PUT", urls, body)
  3455. if err != nil {
  3456. return nil, err
  3457. }
  3458. req.Header = reqHeaders
  3459. googleapi.Expand(req.URL, map[string]string{
  3460. "packageName": c.packageNameid,
  3461. "editId": c.editId,
  3462. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3463. "language": c.language,
  3464. })
  3465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3466. }
  3467. // Do executes the "androidpublisher.edits.apklistings.update" call.
  3468. // Exactly one of *ApkListing or error will be non-nil. Any non-2xx
  3469. // status code is an error. Response headers are in either
  3470. // *ApkListing.ServerResponse.Header or (if a response was returned at
  3471. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3472. // to check whether the returned error was because
  3473. // http.StatusNotModified was returned.
  3474. func (c *EditsApklistingsUpdateCall) Do(opts ...googleapi.CallOption) (*ApkListing, error) {
  3475. gensupport.SetOptions(c.urlParams_, opts...)
  3476. res, err := c.doRequest("json")
  3477. if res != nil && res.StatusCode == http.StatusNotModified {
  3478. if res.Body != nil {
  3479. res.Body.Close()
  3480. }
  3481. return nil, &googleapi.Error{
  3482. Code: res.StatusCode,
  3483. Header: res.Header,
  3484. }
  3485. }
  3486. if err != nil {
  3487. return nil, err
  3488. }
  3489. defer googleapi.CloseBody(res)
  3490. if err := googleapi.CheckResponse(res); err != nil {
  3491. return nil, err
  3492. }
  3493. ret := &ApkListing{
  3494. ServerResponse: googleapi.ServerResponse{
  3495. Header: res.Header,
  3496. HTTPStatusCode: res.StatusCode,
  3497. },
  3498. }
  3499. target := &ret
  3500. if err := gensupport.DecodeResponse(target, res); err != nil {
  3501. return nil, err
  3502. }
  3503. return ret, nil
  3504. // {
  3505. // "description": "Updates or creates the APK-specific localized listing for a specified APK and language code.",
  3506. // "httpMethod": "PUT",
  3507. // "id": "androidpublisher.edits.apklistings.update",
  3508. // "parameterOrder": [
  3509. // "packageName",
  3510. // "editId",
  3511. // "apkVersionCode",
  3512. // "language"
  3513. // ],
  3514. // "parameters": {
  3515. // "apkVersionCode": {
  3516. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3517. // "format": "int32",
  3518. // "location": "path",
  3519. // "required": true,
  3520. // "type": "integer"
  3521. // },
  3522. // "editId": {
  3523. // "description": "Unique identifier for this edit.",
  3524. // "location": "path",
  3525. // "required": true,
  3526. // "type": "string"
  3527. // },
  3528. // "language": {
  3529. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  3530. // "location": "path",
  3531. // "required": true,
  3532. // "type": "string"
  3533. // },
  3534. // "packageName": {
  3535. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3536. // "location": "path",
  3537. // "required": true,
  3538. // "type": "string"
  3539. // }
  3540. // },
  3541. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  3542. // "request": {
  3543. // "$ref": "ApkListing"
  3544. // },
  3545. // "response": {
  3546. // "$ref": "ApkListing"
  3547. // },
  3548. // "scopes": [
  3549. // "https://www.googleapis.com/auth/androidpublisher"
  3550. // ]
  3551. // }
  3552. }
  3553. // method id "androidpublisher.edits.apks.addexternallyhosted":
  3554. type EditsApksAddexternallyhostedCall struct {
  3555. s *Service
  3556. packageNameid string
  3557. editId string
  3558. apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest
  3559. urlParams_ gensupport.URLParams
  3560. ctx_ context.Context
  3561. header_ http.Header
  3562. }
  3563. // Addexternallyhosted: Creates a new APK without uploading the APK
  3564. // itself to Google Play, instead hosting the APK at a specified URL.
  3565. // This function is only available to enterprises using Google Play for
  3566. // Work whose application is configured to restrict distribution to the
  3567. // enterprise domain.
  3568. func (r *EditsApksService) Addexternallyhosted(packageNameid string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall {
  3569. c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3570. c.packageNameid = packageNameid
  3571. c.editId = editId
  3572. c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest
  3573. return c
  3574. }
  3575. // Fields allows partial responses to be retrieved. See
  3576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3577. // for more information.
  3578. func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall {
  3579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3580. return c
  3581. }
  3582. // Context sets the context to be used in this call's Do method. Any
  3583. // pending HTTP request will be aborted if the provided context is
  3584. // canceled.
  3585. func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall {
  3586. c.ctx_ = ctx
  3587. return c
  3588. }
  3589. // Header returns an http.Header that can be modified by the caller to
  3590. // add HTTP headers to the request.
  3591. func (c *EditsApksAddexternallyhostedCall) Header() http.Header {
  3592. if c.header_ == nil {
  3593. c.header_ = make(http.Header)
  3594. }
  3595. return c.header_
  3596. }
  3597. func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) {
  3598. reqHeaders := make(http.Header)
  3599. for k, v := range c.header_ {
  3600. reqHeaders[k] = v
  3601. }
  3602. reqHeaders.Set("User-Agent", c.s.userAgent())
  3603. var body io.Reader = nil
  3604. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest)
  3605. if err != nil {
  3606. return nil, err
  3607. }
  3608. reqHeaders.Set("Content-Type", "application/json")
  3609. c.urlParams_.Set("alt", alt)
  3610. c.urlParams_.Set("prettyPrint", "false")
  3611. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/externallyHosted")
  3612. urls += "?" + c.urlParams_.Encode()
  3613. req, err := http.NewRequest("POST", urls, body)
  3614. if err != nil {
  3615. return nil, err
  3616. }
  3617. req.Header = reqHeaders
  3618. googleapi.Expand(req.URL, map[string]string{
  3619. "packageName": c.packageNameid,
  3620. "editId": c.editId,
  3621. })
  3622. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3623. }
  3624. // Do executes the "androidpublisher.edits.apks.addexternallyhosted" call.
  3625. // Exactly one of *ApksAddExternallyHostedResponse or error will be
  3626. // non-nil. Any non-2xx status code is an error. Response headers are in
  3627. // either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if
  3628. // a response was returned at all) in error.(*googleapi.Error).Header.
  3629. // Use googleapi.IsNotModified to check whether the returned error was
  3630. // because http.StatusNotModified was returned.
  3631. func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) {
  3632. gensupport.SetOptions(c.urlParams_, opts...)
  3633. res, err := c.doRequest("json")
  3634. if res != nil && res.StatusCode == http.StatusNotModified {
  3635. if res.Body != nil {
  3636. res.Body.Close()
  3637. }
  3638. return nil, &googleapi.Error{
  3639. Code: res.StatusCode,
  3640. Header: res.Header,
  3641. }
  3642. }
  3643. if err != nil {
  3644. return nil, err
  3645. }
  3646. defer googleapi.CloseBody(res)
  3647. if err := googleapi.CheckResponse(res); err != nil {
  3648. return nil, err
  3649. }
  3650. ret := &ApksAddExternallyHostedResponse{
  3651. ServerResponse: googleapi.ServerResponse{
  3652. Header: res.Header,
  3653. HTTPStatusCode: res.StatusCode,
  3654. },
  3655. }
  3656. target := &ret
  3657. if err := gensupport.DecodeResponse(target, res); err != nil {
  3658. return nil, err
  3659. }
  3660. return ret, nil
  3661. // {
  3662. // "description": "Creates a new APK without uploading the APK itself to Google Play, instead hosting the APK at a specified URL. This function is only available to enterprises using Google Play for Work whose application is configured to restrict distribution to the enterprise domain.",
  3663. // "httpMethod": "POST",
  3664. // "id": "androidpublisher.edits.apks.addexternallyhosted",
  3665. // "parameterOrder": [
  3666. // "packageName",
  3667. // "editId"
  3668. // ],
  3669. // "parameters": {
  3670. // "editId": {
  3671. // "description": "Unique identifier for this edit.",
  3672. // "location": "path",
  3673. // "required": true,
  3674. // "type": "string"
  3675. // },
  3676. // "packageName": {
  3677. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3678. // "location": "path",
  3679. // "required": true,
  3680. // "type": "string"
  3681. // }
  3682. // },
  3683. // "path": "{packageName}/edits/{editId}/apks/externallyHosted",
  3684. // "request": {
  3685. // "$ref": "ApksAddExternallyHostedRequest"
  3686. // },
  3687. // "response": {
  3688. // "$ref": "ApksAddExternallyHostedResponse"
  3689. // },
  3690. // "scopes": [
  3691. // "https://www.googleapis.com/auth/androidpublisher"
  3692. // ]
  3693. // }
  3694. }
  3695. // method id "androidpublisher.edits.apks.list":
  3696. type EditsApksListCall struct {
  3697. s *Service
  3698. packageNameid string
  3699. editId string
  3700. urlParams_ gensupport.URLParams
  3701. ifNoneMatch_ string
  3702. ctx_ context.Context
  3703. header_ http.Header
  3704. }
  3705. // List:
  3706. func (r *EditsApksService) List(packageNameid string, editId string) *EditsApksListCall {
  3707. c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3708. c.packageNameid = packageNameid
  3709. c.editId = editId
  3710. return c
  3711. }
  3712. // Fields allows partial responses to be retrieved. See
  3713. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3714. // for more information.
  3715. func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall {
  3716. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3717. return c
  3718. }
  3719. // IfNoneMatch sets the optional parameter which makes the operation
  3720. // fail if the object's ETag matches the given value. This is useful for
  3721. // getting updates only after the object has changed since the last
  3722. // request. Use googleapi.IsNotModified to check whether the response
  3723. // error from Do is the result of In-None-Match.
  3724. func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall {
  3725. c.ifNoneMatch_ = entityTag
  3726. return c
  3727. }
  3728. // Context sets the context to be used in this call's Do method. Any
  3729. // pending HTTP request will be aborted if the provided context is
  3730. // canceled.
  3731. func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall {
  3732. c.ctx_ = ctx
  3733. return c
  3734. }
  3735. // Header returns an http.Header that can be modified by the caller to
  3736. // add HTTP headers to the request.
  3737. func (c *EditsApksListCall) Header() http.Header {
  3738. if c.header_ == nil {
  3739. c.header_ = make(http.Header)
  3740. }
  3741. return c.header_
  3742. }
  3743. func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) {
  3744. reqHeaders := make(http.Header)
  3745. for k, v := range c.header_ {
  3746. reqHeaders[k] = v
  3747. }
  3748. reqHeaders.Set("User-Agent", c.s.userAgent())
  3749. if c.ifNoneMatch_ != "" {
  3750. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3751. }
  3752. var body io.Reader = nil
  3753. c.urlParams_.Set("alt", alt)
  3754. c.urlParams_.Set("prettyPrint", "false")
  3755. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  3756. urls += "?" + c.urlParams_.Encode()
  3757. req, err := http.NewRequest("GET", urls, body)
  3758. if err != nil {
  3759. return nil, err
  3760. }
  3761. req.Header = reqHeaders
  3762. googleapi.Expand(req.URL, map[string]string{
  3763. "packageName": c.packageNameid,
  3764. "editId": c.editId,
  3765. })
  3766. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3767. }
  3768. // Do executes the "androidpublisher.edits.apks.list" call.
  3769. // Exactly one of *ApksListResponse or error will be non-nil. Any
  3770. // non-2xx status code is an error. Response headers are in either
  3771. // *ApksListResponse.ServerResponse.Header or (if a response was
  3772. // returned at all) in error.(*googleapi.Error).Header. Use
  3773. // googleapi.IsNotModified to check whether the returned error was
  3774. // because http.StatusNotModified was returned.
  3775. func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) {
  3776. gensupport.SetOptions(c.urlParams_, opts...)
  3777. res, err := c.doRequest("json")
  3778. if res != nil && res.StatusCode == http.StatusNotModified {
  3779. if res.Body != nil {
  3780. res.Body.Close()
  3781. }
  3782. return nil, &googleapi.Error{
  3783. Code: res.StatusCode,
  3784. Header: res.Header,
  3785. }
  3786. }
  3787. if err != nil {
  3788. return nil, err
  3789. }
  3790. defer googleapi.CloseBody(res)
  3791. if err := googleapi.CheckResponse(res); err != nil {
  3792. return nil, err
  3793. }
  3794. ret := &ApksListResponse{
  3795. ServerResponse: googleapi.ServerResponse{
  3796. Header: res.Header,
  3797. HTTPStatusCode: res.StatusCode,
  3798. },
  3799. }
  3800. target := &ret
  3801. if err := gensupport.DecodeResponse(target, res); err != nil {
  3802. return nil, err
  3803. }
  3804. return ret, nil
  3805. // {
  3806. // "httpMethod": "GET",
  3807. // "id": "androidpublisher.edits.apks.list",
  3808. // "parameterOrder": [
  3809. // "packageName",
  3810. // "editId"
  3811. // ],
  3812. // "parameters": {
  3813. // "editId": {
  3814. // "description": "Unique identifier for this edit.",
  3815. // "location": "path",
  3816. // "required": true,
  3817. // "type": "string"
  3818. // },
  3819. // "packageName": {
  3820. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3821. // "location": "path",
  3822. // "required": true,
  3823. // "type": "string"
  3824. // }
  3825. // },
  3826. // "path": "{packageName}/edits/{editId}/apks",
  3827. // "response": {
  3828. // "$ref": "ApksListResponse"
  3829. // },
  3830. // "scopes": [
  3831. // "https://www.googleapis.com/auth/androidpublisher"
  3832. // ]
  3833. // }
  3834. }
  3835. // method id "androidpublisher.edits.apks.upload":
  3836. type EditsApksUploadCall struct {
  3837. s *Service
  3838. packageNameid string
  3839. editId string
  3840. urlParams_ gensupport.URLParams
  3841. mediaInfo_ *gensupport.MediaInfo
  3842. ctx_ context.Context
  3843. header_ http.Header
  3844. }
  3845. // Upload:
  3846. func (r *EditsApksService) Upload(packageNameid string, editId string) *EditsApksUploadCall {
  3847. c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3848. c.packageNameid = packageNameid
  3849. c.editId = editId
  3850. return c
  3851. }
  3852. // Media specifies the media to upload in one or more chunks. The chunk
  3853. // size may be controlled by supplying a MediaOption generated by
  3854. // googleapi.ChunkSize. The chunk size defaults to
  3855. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3856. // upload request will be determined by sniffing the contents of r,
  3857. // unless a MediaOption generated by googleapi.ContentType is
  3858. // supplied.
  3859. // At most one of Media and ResumableMedia may be set.
  3860. func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall {
  3861. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3862. return c
  3863. }
  3864. // ResumableMedia specifies the media to upload in chunks and can be
  3865. // canceled with ctx.
  3866. //
  3867. // Deprecated: use Media instead.
  3868. //
  3869. // At most one of Media and ResumableMedia may be set. mediaType
  3870. // identifies the MIME media type of the upload, such as "image/png". If
  3871. // mediaType is "", it will be auto-detected. The provided ctx will
  3872. // supersede any context previously provided to the Context method.
  3873. func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall {
  3874. c.ctx_ = ctx
  3875. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3876. return c
  3877. }
  3878. // ProgressUpdater provides a callback function that will be called
  3879. // after every chunk. It should be a low-latency function in order to
  3880. // not slow down the upload operation. This should only be called when
  3881. // using ResumableMedia (as opposed to Media).
  3882. func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall {
  3883. c.mediaInfo_.SetProgressUpdater(pu)
  3884. return c
  3885. }
  3886. // Fields allows partial responses to be retrieved. See
  3887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3888. // for more information.
  3889. func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall {
  3890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3891. return c
  3892. }
  3893. // Context sets the context to be used in this call's Do method. Any
  3894. // pending HTTP request will be aborted if the provided context is
  3895. // canceled.
  3896. // This context will supersede any context previously provided to the
  3897. // ResumableMedia method.
  3898. func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall {
  3899. c.ctx_ = ctx
  3900. return c
  3901. }
  3902. // Header returns an http.Header that can be modified by the caller to
  3903. // add HTTP headers to the request.
  3904. func (c *EditsApksUploadCall) Header() http.Header {
  3905. if c.header_ == nil {
  3906. c.header_ = make(http.Header)
  3907. }
  3908. return c.header_
  3909. }
  3910. func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) {
  3911. reqHeaders := make(http.Header)
  3912. for k, v := range c.header_ {
  3913. reqHeaders[k] = v
  3914. }
  3915. reqHeaders.Set("User-Agent", c.s.userAgent())
  3916. var body io.Reader = nil
  3917. c.urlParams_.Set("alt", alt)
  3918. c.urlParams_.Set("prettyPrint", "false")
  3919. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  3920. if c.mediaInfo_ != nil {
  3921. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3922. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3923. }
  3924. if body == nil {
  3925. body = new(bytes.Buffer)
  3926. reqHeaders.Set("Content-Type", "application/json")
  3927. }
  3928. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3929. defer cleanup()
  3930. urls += "?" + c.urlParams_.Encode()
  3931. req, err := http.NewRequest("POST", urls, body)
  3932. if err != nil {
  3933. return nil, err
  3934. }
  3935. req.Header = reqHeaders
  3936. req.GetBody = getBody
  3937. googleapi.Expand(req.URL, map[string]string{
  3938. "packageName": c.packageNameid,
  3939. "editId": c.editId,
  3940. })
  3941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3942. }
  3943. // Do executes the "androidpublisher.edits.apks.upload" call.
  3944. // Exactly one of *Apk or error will be non-nil. Any non-2xx status code
  3945. // is an error. Response headers are in either
  3946. // *Apk.ServerResponse.Header or (if a response was returned at all) in
  3947. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3948. // whether the returned error was because http.StatusNotModified was
  3949. // returned.
  3950. func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) {
  3951. gensupport.SetOptions(c.urlParams_, opts...)
  3952. res, err := c.doRequest("json")
  3953. if res != nil && res.StatusCode == http.StatusNotModified {
  3954. if res.Body != nil {
  3955. res.Body.Close()
  3956. }
  3957. return nil, &googleapi.Error{
  3958. Code: res.StatusCode,
  3959. Header: res.Header,
  3960. }
  3961. }
  3962. if err != nil {
  3963. return nil, err
  3964. }
  3965. defer googleapi.CloseBody(res)
  3966. if err := googleapi.CheckResponse(res); err != nil {
  3967. return nil, err
  3968. }
  3969. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3970. if rx != nil {
  3971. rx.Client = c.s.client
  3972. rx.UserAgent = c.s.userAgent()
  3973. ctx := c.ctx_
  3974. if ctx == nil {
  3975. ctx = context.TODO()
  3976. }
  3977. res, err = rx.Upload(ctx)
  3978. if err != nil {
  3979. return nil, err
  3980. }
  3981. defer res.Body.Close()
  3982. if err := googleapi.CheckResponse(res); err != nil {
  3983. return nil, err
  3984. }
  3985. }
  3986. ret := &Apk{
  3987. ServerResponse: googleapi.ServerResponse{
  3988. Header: res.Header,
  3989. HTTPStatusCode: res.StatusCode,
  3990. },
  3991. }
  3992. target := &ret
  3993. if err := gensupport.DecodeResponse(target, res); err != nil {
  3994. return nil, err
  3995. }
  3996. return ret, nil
  3997. // {
  3998. // "httpMethod": "POST",
  3999. // "id": "androidpublisher.edits.apks.upload",
  4000. // "mediaUpload": {
  4001. // "accept": [
  4002. // "application/octet-stream",
  4003. // "application/vnd.android.package-archive"
  4004. // ],
  4005. // "maxSize": "1GB",
  4006. // "protocols": {
  4007. // "resumable": {
  4008. // "multipart": true,
  4009. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks"
  4010. // },
  4011. // "simple": {
  4012. // "multipart": true,
  4013. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks"
  4014. // }
  4015. // }
  4016. // },
  4017. // "parameterOrder": [
  4018. // "packageName",
  4019. // "editId"
  4020. // ],
  4021. // "parameters": {
  4022. // "editId": {
  4023. // "description": "Unique identifier for this edit.",
  4024. // "location": "path",
  4025. // "required": true,
  4026. // "type": "string"
  4027. // },
  4028. // "packageName": {
  4029. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4030. // "location": "path",
  4031. // "required": true,
  4032. // "type": "string"
  4033. // }
  4034. // },
  4035. // "path": "{packageName}/edits/{editId}/apks",
  4036. // "response": {
  4037. // "$ref": "Apk"
  4038. // },
  4039. // "scopes": [
  4040. // "https://www.googleapis.com/auth/androidpublisher"
  4041. // ],
  4042. // "supportsMediaUpload": true
  4043. // }
  4044. }
  4045. // method id "androidpublisher.edits.bundles.list":
  4046. type EditsBundlesListCall struct {
  4047. s *Service
  4048. packageNameid string
  4049. editId string
  4050. urlParams_ gensupport.URLParams
  4051. ifNoneMatch_ string
  4052. ctx_ context.Context
  4053. header_ http.Header
  4054. }
  4055. // List:
  4056. func (r *EditsBundlesService) List(packageNameid string, editId string) *EditsBundlesListCall {
  4057. c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4058. c.packageNameid = packageNameid
  4059. c.editId = editId
  4060. return c
  4061. }
  4062. // Fields allows partial responses to be retrieved. See
  4063. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4064. // for more information.
  4065. func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall {
  4066. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4067. return c
  4068. }
  4069. // IfNoneMatch sets the optional parameter which makes the operation
  4070. // fail if the object's ETag matches the given value. This is useful for
  4071. // getting updates only after the object has changed since the last
  4072. // request. Use googleapi.IsNotModified to check whether the response
  4073. // error from Do is the result of In-None-Match.
  4074. func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall {
  4075. c.ifNoneMatch_ = entityTag
  4076. return c
  4077. }
  4078. // Context sets the context to be used in this call's Do method. Any
  4079. // pending HTTP request will be aborted if the provided context is
  4080. // canceled.
  4081. func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall {
  4082. c.ctx_ = ctx
  4083. return c
  4084. }
  4085. // Header returns an http.Header that can be modified by the caller to
  4086. // add HTTP headers to the request.
  4087. func (c *EditsBundlesListCall) Header() http.Header {
  4088. if c.header_ == nil {
  4089. c.header_ = make(http.Header)
  4090. }
  4091. return c.header_
  4092. }
  4093. func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) {
  4094. reqHeaders := make(http.Header)
  4095. for k, v := range c.header_ {
  4096. reqHeaders[k] = v
  4097. }
  4098. reqHeaders.Set("User-Agent", c.s.userAgent())
  4099. if c.ifNoneMatch_ != "" {
  4100. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4101. }
  4102. var body io.Reader = nil
  4103. c.urlParams_.Set("alt", alt)
  4104. c.urlParams_.Set("prettyPrint", "false")
  4105. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  4106. urls += "?" + c.urlParams_.Encode()
  4107. req, err := http.NewRequest("GET", urls, body)
  4108. if err != nil {
  4109. return nil, err
  4110. }
  4111. req.Header = reqHeaders
  4112. googleapi.Expand(req.URL, map[string]string{
  4113. "packageName": c.packageNameid,
  4114. "editId": c.editId,
  4115. })
  4116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4117. }
  4118. // Do executes the "androidpublisher.edits.bundles.list" call.
  4119. // Exactly one of *BundlesListResponse or error will be non-nil. Any
  4120. // non-2xx status code is an error. Response headers are in either
  4121. // *BundlesListResponse.ServerResponse.Header or (if a response was
  4122. // returned at all) in error.(*googleapi.Error).Header. Use
  4123. // googleapi.IsNotModified to check whether the returned error was
  4124. // because http.StatusNotModified was returned.
  4125. func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) {
  4126. gensupport.SetOptions(c.urlParams_, opts...)
  4127. res, err := c.doRequest("json")
  4128. if res != nil && res.StatusCode == http.StatusNotModified {
  4129. if res.Body != nil {
  4130. res.Body.Close()
  4131. }
  4132. return nil, &googleapi.Error{
  4133. Code: res.StatusCode,
  4134. Header: res.Header,
  4135. }
  4136. }
  4137. if err != nil {
  4138. return nil, err
  4139. }
  4140. defer googleapi.CloseBody(res)
  4141. if err := googleapi.CheckResponse(res); err != nil {
  4142. return nil, err
  4143. }
  4144. ret := &BundlesListResponse{
  4145. ServerResponse: googleapi.ServerResponse{
  4146. Header: res.Header,
  4147. HTTPStatusCode: res.StatusCode,
  4148. },
  4149. }
  4150. target := &ret
  4151. if err := gensupport.DecodeResponse(target, res); err != nil {
  4152. return nil, err
  4153. }
  4154. return ret, nil
  4155. // {
  4156. // "httpMethod": "GET",
  4157. // "id": "androidpublisher.edits.bundles.list",
  4158. // "parameterOrder": [
  4159. // "packageName",
  4160. // "editId"
  4161. // ],
  4162. // "parameters": {
  4163. // "editId": {
  4164. // "description": "Unique identifier for this edit.",
  4165. // "location": "path",
  4166. // "required": true,
  4167. // "type": "string"
  4168. // },
  4169. // "packageName": {
  4170. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4171. // "location": "path",
  4172. // "required": true,
  4173. // "type": "string"
  4174. // }
  4175. // },
  4176. // "path": "{packageName}/edits/{editId}/bundles",
  4177. // "response": {
  4178. // "$ref": "BundlesListResponse"
  4179. // },
  4180. // "scopes": [
  4181. // "https://www.googleapis.com/auth/androidpublisher"
  4182. // ]
  4183. // }
  4184. }
  4185. // method id "androidpublisher.edits.bundles.upload":
  4186. type EditsBundlesUploadCall struct {
  4187. s *Service
  4188. packageNameid string
  4189. editId string
  4190. urlParams_ gensupport.URLParams
  4191. mediaInfo_ *gensupport.MediaInfo
  4192. ctx_ context.Context
  4193. header_ http.Header
  4194. }
  4195. // Upload: Uploads a new Android App Bundle to this edit. If you are
  4196. // using the Google API client libraries, please increase the timeout of
  4197. // the http request before calling this endpoint (a timeout of 2 minutes
  4198. // is recommended). See:
  4199. // https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in
  4200. // java.
  4201. func (r *EditsBundlesService) Upload(packageNameid string, editId string) *EditsBundlesUploadCall {
  4202. c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4203. c.packageNameid = packageNameid
  4204. c.editId = editId
  4205. return c
  4206. }
  4207. // AckBundleInstallationWarning sets the optional parameter
  4208. // "ackBundleInstallationWarning": Must be set to true if the bundle
  4209. // installation may trigger a warning on user devices (for example, if
  4210. // installation size may be over a threshold, typically 100 MB).
  4211. func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall {
  4212. c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning))
  4213. return c
  4214. }
  4215. // Media specifies the media to upload in one or more chunks. The chunk
  4216. // size may be controlled by supplying a MediaOption generated by
  4217. // googleapi.ChunkSize. The chunk size defaults to
  4218. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4219. // upload request will be determined by sniffing the contents of r,
  4220. // unless a MediaOption generated by googleapi.ContentType is
  4221. // supplied.
  4222. // At most one of Media and ResumableMedia may be set.
  4223. func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall {
  4224. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4225. return c
  4226. }
  4227. // ResumableMedia specifies the media to upload in chunks and can be
  4228. // canceled with ctx.
  4229. //
  4230. // Deprecated: use Media instead.
  4231. //
  4232. // At most one of Media and ResumableMedia may be set. mediaType
  4233. // identifies the MIME media type of the upload, such as "image/png". If
  4234. // mediaType is "", it will be auto-detected. The provided ctx will
  4235. // supersede any context previously provided to the Context method.
  4236. func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall {
  4237. c.ctx_ = ctx
  4238. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4239. return c
  4240. }
  4241. // ProgressUpdater provides a callback function that will be called
  4242. // after every chunk. It should be a low-latency function in order to
  4243. // not slow down the upload operation. This should only be called when
  4244. // using ResumableMedia (as opposed to Media).
  4245. func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall {
  4246. c.mediaInfo_.SetProgressUpdater(pu)
  4247. return c
  4248. }
  4249. // Fields allows partial responses to be retrieved. See
  4250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4251. // for more information.
  4252. func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall {
  4253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4254. return c
  4255. }
  4256. // Context sets the context to be used in this call's Do method. Any
  4257. // pending HTTP request will be aborted if the provided context is
  4258. // canceled.
  4259. // This context will supersede any context previously provided to the
  4260. // ResumableMedia method.
  4261. func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall {
  4262. c.ctx_ = ctx
  4263. return c
  4264. }
  4265. // Header returns an http.Header that can be modified by the caller to
  4266. // add HTTP headers to the request.
  4267. func (c *EditsBundlesUploadCall) Header() http.Header {
  4268. if c.header_ == nil {
  4269. c.header_ = make(http.Header)
  4270. }
  4271. return c.header_
  4272. }
  4273. func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) {
  4274. reqHeaders := make(http.Header)
  4275. for k, v := range c.header_ {
  4276. reqHeaders[k] = v
  4277. }
  4278. reqHeaders.Set("User-Agent", c.s.userAgent())
  4279. var body io.Reader = nil
  4280. c.urlParams_.Set("alt", alt)
  4281. c.urlParams_.Set("prettyPrint", "false")
  4282. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  4283. if c.mediaInfo_ != nil {
  4284. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  4285. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4286. }
  4287. if body == nil {
  4288. body = new(bytes.Buffer)
  4289. reqHeaders.Set("Content-Type", "application/json")
  4290. }
  4291. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4292. defer cleanup()
  4293. urls += "?" + c.urlParams_.Encode()
  4294. req, err := http.NewRequest("POST", urls, body)
  4295. if err != nil {
  4296. return nil, err
  4297. }
  4298. req.Header = reqHeaders
  4299. req.GetBody = getBody
  4300. googleapi.Expand(req.URL, map[string]string{
  4301. "packageName": c.packageNameid,
  4302. "editId": c.editId,
  4303. })
  4304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4305. }
  4306. // Do executes the "androidpublisher.edits.bundles.upload" call.
  4307. // Exactly one of *Bundle or error will be non-nil. Any non-2xx status
  4308. // code is an error. Response headers are in either
  4309. // *Bundle.ServerResponse.Header or (if a response was returned at all)
  4310. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4311. // check whether the returned error was because http.StatusNotModified
  4312. // was returned.
  4313. func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) {
  4314. gensupport.SetOptions(c.urlParams_, opts...)
  4315. res, err := c.doRequest("json")
  4316. if res != nil && res.StatusCode == http.StatusNotModified {
  4317. if res.Body != nil {
  4318. res.Body.Close()
  4319. }
  4320. return nil, &googleapi.Error{
  4321. Code: res.StatusCode,
  4322. Header: res.Header,
  4323. }
  4324. }
  4325. if err != nil {
  4326. return nil, err
  4327. }
  4328. defer googleapi.CloseBody(res)
  4329. if err := googleapi.CheckResponse(res); err != nil {
  4330. return nil, err
  4331. }
  4332. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4333. if rx != nil {
  4334. rx.Client = c.s.client
  4335. rx.UserAgent = c.s.userAgent()
  4336. ctx := c.ctx_
  4337. if ctx == nil {
  4338. ctx = context.TODO()
  4339. }
  4340. res, err = rx.Upload(ctx)
  4341. if err != nil {
  4342. return nil, err
  4343. }
  4344. defer res.Body.Close()
  4345. if err := googleapi.CheckResponse(res); err != nil {
  4346. return nil, err
  4347. }
  4348. }
  4349. ret := &Bundle{
  4350. ServerResponse: googleapi.ServerResponse{
  4351. Header: res.Header,
  4352. HTTPStatusCode: res.StatusCode,
  4353. },
  4354. }
  4355. target := &ret
  4356. if err := gensupport.DecodeResponse(target, res); err != nil {
  4357. return nil, err
  4358. }
  4359. return ret, nil
  4360. // {
  4361. // "description": "Uploads a new Android App Bundle to this edit. If you are using the Google API client libraries, please increase the timeout of the http request before calling this endpoint (a timeout of 2 minutes is recommended). See: https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in java.",
  4362. // "httpMethod": "POST",
  4363. // "id": "androidpublisher.edits.bundles.upload",
  4364. // "mediaUpload": {
  4365. // "accept": [
  4366. // "application/octet-stream"
  4367. // ],
  4368. // "maxSize": "2GB",
  4369. // "protocols": {
  4370. // "resumable": {
  4371. // "multipart": true,
  4372. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/bundles"
  4373. // },
  4374. // "simple": {
  4375. // "multipart": true,
  4376. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/bundles"
  4377. // }
  4378. // }
  4379. // },
  4380. // "parameterOrder": [
  4381. // "packageName",
  4382. // "editId"
  4383. // ],
  4384. // "parameters": {
  4385. // "ackBundleInstallationWarning": {
  4386. // "description": "Must be set to true if the bundle installation may trigger a warning on user devices (for example, if installation size may be over a threshold, typically 100 MB).",
  4387. // "location": "query",
  4388. // "type": "boolean"
  4389. // },
  4390. // "editId": {
  4391. // "description": "Unique identifier for this edit.",
  4392. // "location": "path",
  4393. // "required": true,
  4394. // "type": "string"
  4395. // },
  4396. // "packageName": {
  4397. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4398. // "location": "path",
  4399. // "required": true,
  4400. // "type": "string"
  4401. // }
  4402. // },
  4403. // "path": "{packageName}/edits/{editId}/bundles",
  4404. // "response": {
  4405. // "$ref": "Bundle"
  4406. // },
  4407. // "scopes": [
  4408. // "https://www.googleapis.com/auth/androidpublisher"
  4409. // ],
  4410. // "supportsMediaUpload": true
  4411. // }
  4412. }
  4413. // method id "androidpublisher.edits.deobfuscationfiles.upload":
  4414. type EditsDeobfuscationfilesUploadCall struct {
  4415. s *Service
  4416. packageNameid string
  4417. editId string
  4418. apkVersionCode int64
  4419. deobfuscationFileType string
  4420. urlParams_ gensupport.URLParams
  4421. mediaInfo_ *gensupport.MediaInfo
  4422. ctx_ context.Context
  4423. header_ http.Header
  4424. }
  4425. // Upload: Uploads the deobfuscation file of the specified APK. If a
  4426. // deobfuscation file already exists, it will be replaced.
  4427. func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall {
  4428. c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4429. c.packageNameid = packageNameid
  4430. c.editId = editId
  4431. c.apkVersionCode = apkVersionCode
  4432. c.deobfuscationFileType = deobfuscationFileType
  4433. return c
  4434. }
  4435. // Media specifies the media to upload in one or more chunks. The chunk
  4436. // size may be controlled by supplying a MediaOption generated by
  4437. // googleapi.ChunkSize. The chunk size defaults to
  4438. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4439. // upload request will be determined by sniffing the contents of r,
  4440. // unless a MediaOption generated by googleapi.ContentType is
  4441. // supplied.
  4442. // At most one of Media and ResumableMedia may be set.
  4443. func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall {
  4444. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4445. return c
  4446. }
  4447. // ResumableMedia specifies the media to upload in chunks and can be
  4448. // canceled with ctx.
  4449. //
  4450. // Deprecated: use Media instead.
  4451. //
  4452. // At most one of Media and ResumableMedia may be set. mediaType
  4453. // identifies the MIME media type of the upload, such as "image/png". If
  4454. // mediaType is "", it will be auto-detected. The provided ctx will
  4455. // supersede any context previously provided to the Context method.
  4456. func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall {
  4457. c.ctx_ = ctx
  4458. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4459. return c
  4460. }
  4461. // ProgressUpdater provides a callback function that will be called
  4462. // after every chunk. It should be a low-latency function in order to
  4463. // not slow down the upload operation. This should only be called when
  4464. // using ResumableMedia (as opposed to Media).
  4465. func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall {
  4466. c.mediaInfo_.SetProgressUpdater(pu)
  4467. return c
  4468. }
  4469. // Fields allows partial responses to be retrieved. See
  4470. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4471. // for more information.
  4472. func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall {
  4473. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4474. return c
  4475. }
  4476. // Context sets the context to be used in this call's Do method. Any
  4477. // pending HTTP request will be aborted if the provided context is
  4478. // canceled.
  4479. // This context will supersede any context previously provided to the
  4480. // ResumableMedia method.
  4481. func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall {
  4482. c.ctx_ = ctx
  4483. return c
  4484. }
  4485. // Header returns an http.Header that can be modified by the caller to
  4486. // add HTTP headers to the request.
  4487. func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header {
  4488. if c.header_ == nil {
  4489. c.header_ = make(http.Header)
  4490. }
  4491. return c.header_
  4492. }
  4493. func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  4494. reqHeaders := make(http.Header)
  4495. for k, v := range c.header_ {
  4496. reqHeaders[k] = v
  4497. }
  4498. reqHeaders.Set("User-Agent", c.s.userAgent())
  4499. var body io.Reader = nil
  4500. c.urlParams_.Set("alt", alt)
  4501. c.urlParams_.Set("prettyPrint", "false")
  4502. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}")
  4503. if c.mediaInfo_ != nil {
  4504. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  4505. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4506. }
  4507. if body == nil {
  4508. body = new(bytes.Buffer)
  4509. reqHeaders.Set("Content-Type", "application/json")
  4510. }
  4511. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4512. defer cleanup()
  4513. urls += "?" + c.urlParams_.Encode()
  4514. req, err := http.NewRequest("POST", urls, body)
  4515. if err != nil {
  4516. return nil, err
  4517. }
  4518. req.Header = reqHeaders
  4519. req.GetBody = getBody
  4520. googleapi.Expand(req.URL, map[string]string{
  4521. "packageName": c.packageNameid,
  4522. "editId": c.editId,
  4523. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4524. "deobfuscationFileType": c.deobfuscationFileType,
  4525. })
  4526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4527. }
  4528. // Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call.
  4529. // Exactly one of *DeobfuscationFilesUploadResponse or error will be
  4530. // non-nil. Any non-2xx status code is an error. Response headers are in
  4531. // either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if
  4532. // a response was returned at all) in error.(*googleapi.Error).Header.
  4533. // Use googleapi.IsNotModified to check whether the returned error was
  4534. // because http.StatusNotModified was returned.
  4535. func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) {
  4536. gensupport.SetOptions(c.urlParams_, opts...)
  4537. res, err := c.doRequest("json")
  4538. if res != nil && res.StatusCode == http.StatusNotModified {
  4539. if res.Body != nil {
  4540. res.Body.Close()
  4541. }
  4542. return nil, &googleapi.Error{
  4543. Code: res.StatusCode,
  4544. Header: res.Header,
  4545. }
  4546. }
  4547. if err != nil {
  4548. return nil, err
  4549. }
  4550. defer googleapi.CloseBody(res)
  4551. if err := googleapi.CheckResponse(res); err != nil {
  4552. return nil, err
  4553. }
  4554. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4555. if rx != nil {
  4556. rx.Client = c.s.client
  4557. rx.UserAgent = c.s.userAgent()
  4558. ctx := c.ctx_
  4559. if ctx == nil {
  4560. ctx = context.TODO()
  4561. }
  4562. res, err = rx.Upload(ctx)
  4563. if err != nil {
  4564. return nil, err
  4565. }
  4566. defer res.Body.Close()
  4567. if err := googleapi.CheckResponse(res); err != nil {
  4568. return nil, err
  4569. }
  4570. }
  4571. ret := &DeobfuscationFilesUploadResponse{
  4572. ServerResponse: googleapi.ServerResponse{
  4573. Header: res.Header,
  4574. HTTPStatusCode: res.StatusCode,
  4575. },
  4576. }
  4577. target := &ret
  4578. if err := gensupport.DecodeResponse(target, res); err != nil {
  4579. return nil, err
  4580. }
  4581. return ret, nil
  4582. // {
  4583. // "description": "Uploads the deobfuscation file of the specified APK. If a deobfuscation file already exists, it will be replaced.",
  4584. // "httpMethod": "POST",
  4585. // "id": "androidpublisher.edits.deobfuscationfiles.upload",
  4586. // "mediaUpload": {
  4587. // "accept": [
  4588. // "application/octet-stream"
  4589. // ],
  4590. // "maxSize": "300MB",
  4591. // "protocols": {
  4592. // "resumable": {
  4593. // "multipart": true,
  4594. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  4595. // },
  4596. // "simple": {
  4597. // "multipart": true,
  4598. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  4599. // }
  4600. // }
  4601. // },
  4602. // "parameterOrder": [
  4603. // "packageName",
  4604. // "editId",
  4605. // "apkVersionCode",
  4606. // "deobfuscationFileType"
  4607. // ],
  4608. // "parameters": {
  4609. // "apkVersionCode": {
  4610. // "description": "The version code of the APK whose deobfuscation file is being uploaded.",
  4611. // "format": "int32",
  4612. // "location": "path",
  4613. // "required": true,
  4614. // "type": "integer"
  4615. // },
  4616. // "deobfuscationFileType": {
  4617. // "enum": [
  4618. // "proguard"
  4619. // ],
  4620. // "enumDescriptions": [
  4621. // ""
  4622. // ],
  4623. // "location": "path",
  4624. // "required": true,
  4625. // "type": "string"
  4626. // },
  4627. // "editId": {
  4628. // "description": "Unique identifier for this edit.",
  4629. // "location": "path",
  4630. // "required": true,
  4631. // "type": "string"
  4632. // },
  4633. // "packageName": {
  4634. // "description": "Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, \"com.spiffygame\".",
  4635. // "location": "path",
  4636. // "required": true,
  4637. // "type": "string"
  4638. // }
  4639. // },
  4640. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}",
  4641. // "response": {
  4642. // "$ref": "DeobfuscationFilesUploadResponse"
  4643. // },
  4644. // "scopes": [
  4645. // "https://www.googleapis.com/auth/androidpublisher"
  4646. // ],
  4647. // "supportsMediaUpload": true
  4648. // }
  4649. }
  4650. // method id "androidpublisher.edits.details.get":
  4651. type EditsDetailsGetCall struct {
  4652. s *Service
  4653. packageNameid string
  4654. editId string
  4655. urlParams_ gensupport.URLParams
  4656. ifNoneMatch_ string
  4657. ctx_ context.Context
  4658. header_ http.Header
  4659. }
  4660. // Get: Fetches app details for this edit. This includes the default
  4661. // language and developer support contact information.
  4662. func (r *EditsDetailsService) Get(packageNameid string, editId string) *EditsDetailsGetCall {
  4663. c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4664. c.packageNameid = packageNameid
  4665. c.editId = editId
  4666. return c
  4667. }
  4668. // Fields allows partial responses to be retrieved. See
  4669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4670. // for more information.
  4671. func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall {
  4672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4673. return c
  4674. }
  4675. // IfNoneMatch sets the optional parameter which makes the operation
  4676. // fail if the object's ETag matches the given value. This is useful for
  4677. // getting updates only after the object has changed since the last
  4678. // request. Use googleapi.IsNotModified to check whether the response
  4679. // error from Do is the result of In-None-Match.
  4680. func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall {
  4681. c.ifNoneMatch_ = entityTag
  4682. return c
  4683. }
  4684. // Context sets the context to be used in this call's Do method. Any
  4685. // pending HTTP request will be aborted if the provided context is
  4686. // canceled.
  4687. func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall {
  4688. c.ctx_ = ctx
  4689. return c
  4690. }
  4691. // Header returns an http.Header that can be modified by the caller to
  4692. // add HTTP headers to the request.
  4693. func (c *EditsDetailsGetCall) Header() http.Header {
  4694. if c.header_ == nil {
  4695. c.header_ = make(http.Header)
  4696. }
  4697. return c.header_
  4698. }
  4699. func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) {
  4700. reqHeaders := make(http.Header)
  4701. for k, v := range c.header_ {
  4702. reqHeaders[k] = v
  4703. }
  4704. reqHeaders.Set("User-Agent", c.s.userAgent())
  4705. if c.ifNoneMatch_ != "" {
  4706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4707. }
  4708. var body io.Reader = nil
  4709. c.urlParams_.Set("alt", alt)
  4710. c.urlParams_.Set("prettyPrint", "false")
  4711. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4712. urls += "?" + c.urlParams_.Encode()
  4713. req, err := http.NewRequest("GET", urls, body)
  4714. if err != nil {
  4715. return nil, err
  4716. }
  4717. req.Header = reqHeaders
  4718. googleapi.Expand(req.URL, map[string]string{
  4719. "packageName": c.packageNameid,
  4720. "editId": c.editId,
  4721. })
  4722. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4723. }
  4724. // Do executes the "androidpublisher.edits.details.get" call.
  4725. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  4726. // status code is an error. Response headers are in either
  4727. // *AppDetails.ServerResponse.Header or (if a response was returned at
  4728. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4729. // to check whether the returned error was because
  4730. // http.StatusNotModified was returned.
  4731. func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  4732. gensupport.SetOptions(c.urlParams_, opts...)
  4733. res, err := c.doRequest("json")
  4734. if res != nil && res.StatusCode == http.StatusNotModified {
  4735. if res.Body != nil {
  4736. res.Body.Close()
  4737. }
  4738. return nil, &googleapi.Error{
  4739. Code: res.StatusCode,
  4740. Header: res.Header,
  4741. }
  4742. }
  4743. if err != nil {
  4744. return nil, err
  4745. }
  4746. defer googleapi.CloseBody(res)
  4747. if err := googleapi.CheckResponse(res); err != nil {
  4748. return nil, err
  4749. }
  4750. ret := &AppDetails{
  4751. ServerResponse: googleapi.ServerResponse{
  4752. Header: res.Header,
  4753. HTTPStatusCode: res.StatusCode,
  4754. },
  4755. }
  4756. target := &ret
  4757. if err := gensupport.DecodeResponse(target, res); err != nil {
  4758. return nil, err
  4759. }
  4760. return ret, nil
  4761. // {
  4762. // "description": "Fetches app details for this edit. This includes the default language and developer support contact information.",
  4763. // "httpMethod": "GET",
  4764. // "id": "androidpublisher.edits.details.get",
  4765. // "parameterOrder": [
  4766. // "packageName",
  4767. // "editId"
  4768. // ],
  4769. // "parameters": {
  4770. // "editId": {
  4771. // "description": "Unique identifier for this edit.",
  4772. // "location": "path",
  4773. // "required": true,
  4774. // "type": "string"
  4775. // },
  4776. // "packageName": {
  4777. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4778. // "location": "path",
  4779. // "required": true,
  4780. // "type": "string"
  4781. // }
  4782. // },
  4783. // "path": "{packageName}/edits/{editId}/details",
  4784. // "response": {
  4785. // "$ref": "AppDetails"
  4786. // },
  4787. // "scopes": [
  4788. // "https://www.googleapis.com/auth/androidpublisher"
  4789. // ]
  4790. // }
  4791. }
  4792. // method id "androidpublisher.edits.details.patch":
  4793. type EditsDetailsPatchCall struct {
  4794. s *Service
  4795. packageNameid string
  4796. editId string
  4797. appdetails *AppDetails
  4798. urlParams_ gensupport.URLParams
  4799. ctx_ context.Context
  4800. header_ http.Header
  4801. }
  4802. // Patch: Updates app details for this edit. This method supports patch
  4803. // semantics.
  4804. func (r *EditsDetailsService) Patch(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall {
  4805. c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4806. c.packageNameid = packageNameid
  4807. c.editId = editId
  4808. c.appdetails = appdetails
  4809. return c
  4810. }
  4811. // Fields allows partial responses to be retrieved. See
  4812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4813. // for more information.
  4814. func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall {
  4815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4816. return c
  4817. }
  4818. // Context sets the context to be used in this call's Do method. Any
  4819. // pending HTTP request will be aborted if the provided context is
  4820. // canceled.
  4821. func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall {
  4822. c.ctx_ = ctx
  4823. return c
  4824. }
  4825. // Header returns an http.Header that can be modified by the caller to
  4826. // add HTTP headers to the request.
  4827. func (c *EditsDetailsPatchCall) Header() http.Header {
  4828. if c.header_ == nil {
  4829. c.header_ = make(http.Header)
  4830. }
  4831. return c.header_
  4832. }
  4833. func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) {
  4834. reqHeaders := make(http.Header)
  4835. for k, v := range c.header_ {
  4836. reqHeaders[k] = v
  4837. }
  4838. reqHeaders.Set("User-Agent", c.s.userAgent())
  4839. var body io.Reader = nil
  4840. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  4841. if err != nil {
  4842. return nil, err
  4843. }
  4844. reqHeaders.Set("Content-Type", "application/json")
  4845. c.urlParams_.Set("alt", alt)
  4846. c.urlParams_.Set("prettyPrint", "false")
  4847. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4848. urls += "?" + c.urlParams_.Encode()
  4849. req, err := http.NewRequest("PATCH", urls, body)
  4850. if err != nil {
  4851. return nil, err
  4852. }
  4853. req.Header = reqHeaders
  4854. googleapi.Expand(req.URL, map[string]string{
  4855. "packageName": c.packageNameid,
  4856. "editId": c.editId,
  4857. })
  4858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4859. }
  4860. // Do executes the "androidpublisher.edits.details.patch" call.
  4861. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  4862. // status code is an error. Response headers are in either
  4863. // *AppDetails.ServerResponse.Header or (if a response was returned at
  4864. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4865. // to check whether the returned error was because
  4866. // http.StatusNotModified was returned.
  4867. func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  4868. gensupport.SetOptions(c.urlParams_, opts...)
  4869. res, err := c.doRequest("json")
  4870. if res != nil && res.StatusCode == http.StatusNotModified {
  4871. if res.Body != nil {
  4872. res.Body.Close()
  4873. }
  4874. return nil, &googleapi.Error{
  4875. Code: res.StatusCode,
  4876. Header: res.Header,
  4877. }
  4878. }
  4879. if err != nil {
  4880. return nil, err
  4881. }
  4882. defer googleapi.CloseBody(res)
  4883. if err := googleapi.CheckResponse(res); err != nil {
  4884. return nil, err
  4885. }
  4886. ret := &AppDetails{
  4887. ServerResponse: googleapi.ServerResponse{
  4888. Header: res.Header,
  4889. HTTPStatusCode: res.StatusCode,
  4890. },
  4891. }
  4892. target := &ret
  4893. if err := gensupport.DecodeResponse(target, res); err != nil {
  4894. return nil, err
  4895. }
  4896. return ret, nil
  4897. // {
  4898. // "description": "Updates app details for this edit. This method supports patch semantics.",
  4899. // "httpMethod": "PATCH",
  4900. // "id": "androidpublisher.edits.details.patch",
  4901. // "parameterOrder": [
  4902. // "packageName",
  4903. // "editId"
  4904. // ],
  4905. // "parameters": {
  4906. // "editId": {
  4907. // "description": "Unique identifier for this edit.",
  4908. // "location": "path",
  4909. // "required": true,
  4910. // "type": "string"
  4911. // },
  4912. // "packageName": {
  4913. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4914. // "location": "path",
  4915. // "required": true,
  4916. // "type": "string"
  4917. // }
  4918. // },
  4919. // "path": "{packageName}/edits/{editId}/details",
  4920. // "request": {
  4921. // "$ref": "AppDetails"
  4922. // },
  4923. // "response": {
  4924. // "$ref": "AppDetails"
  4925. // },
  4926. // "scopes": [
  4927. // "https://www.googleapis.com/auth/androidpublisher"
  4928. // ]
  4929. // }
  4930. }
  4931. // method id "androidpublisher.edits.details.update":
  4932. type EditsDetailsUpdateCall struct {
  4933. s *Service
  4934. packageNameid string
  4935. editId string
  4936. appdetails *AppDetails
  4937. urlParams_ gensupport.URLParams
  4938. ctx_ context.Context
  4939. header_ http.Header
  4940. }
  4941. // Update: Updates app details for this edit.
  4942. func (r *EditsDetailsService) Update(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall {
  4943. c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4944. c.packageNameid = packageNameid
  4945. c.editId = editId
  4946. c.appdetails = appdetails
  4947. return c
  4948. }
  4949. // Fields allows partial responses to be retrieved. See
  4950. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4951. // for more information.
  4952. func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall {
  4953. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4954. return c
  4955. }
  4956. // Context sets the context to be used in this call's Do method. Any
  4957. // pending HTTP request will be aborted if the provided context is
  4958. // canceled.
  4959. func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall {
  4960. c.ctx_ = ctx
  4961. return c
  4962. }
  4963. // Header returns an http.Header that can be modified by the caller to
  4964. // add HTTP headers to the request.
  4965. func (c *EditsDetailsUpdateCall) Header() http.Header {
  4966. if c.header_ == nil {
  4967. c.header_ = make(http.Header)
  4968. }
  4969. return c.header_
  4970. }
  4971. func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4972. reqHeaders := make(http.Header)
  4973. for k, v := range c.header_ {
  4974. reqHeaders[k] = v
  4975. }
  4976. reqHeaders.Set("User-Agent", c.s.userAgent())
  4977. var body io.Reader = nil
  4978. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  4979. if err != nil {
  4980. return nil, err
  4981. }
  4982. reqHeaders.Set("Content-Type", "application/json")
  4983. c.urlParams_.Set("alt", alt)
  4984. c.urlParams_.Set("prettyPrint", "false")
  4985. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4986. urls += "?" + c.urlParams_.Encode()
  4987. req, err := http.NewRequest("PUT", urls, body)
  4988. if err != nil {
  4989. return nil, err
  4990. }
  4991. req.Header = reqHeaders
  4992. googleapi.Expand(req.URL, map[string]string{
  4993. "packageName": c.packageNameid,
  4994. "editId": c.editId,
  4995. })
  4996. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4997. }
  4998. // Do executes the "androidpublisher.edits.details.update" call.
  4999. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  5000. // status code is an error. Response headers are in either
  5001. // *AppDetails.ServerResponse.Header or (if a response was returned at
  5002. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5003. // to check whether the returned error was because
  5004. // http.StatusNotModified was returned.
  5005. func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  5006. gensupport.SetOptions(c.urlParams_, opts...)
  5007. res, err := c.doRequest("json")
  5008. if res != nil && res.StatusCode == http.StatusNotModified {
  5009. if res.Body != nil {
  5010. res.Body.Close()
  5011. }
  5012. return nil, &googleapi.Error{
  5013. Code: res.StatusCode,
  5014. Header: res.Header,
  5015. }
  5016. }
  5017. if err != nil {
  5018. return nil, err
  5019. }
  5020. defer googleapi.CloseBody(res)
  5021. if err := googleapi.CheckResponse(res); err != nil {
  5022. return nil, err
  5023. }
  5024. ret := &AppDetails{
  5025. ServerResponse: googleapi.ServerResponse{
  5026. Header: res.Header,
  5027. HTTPStatusCode: res.StatusCode,
  5028. },
  5029. }
  5030. target := &ret
  5031. if err := gensupport.DecodeResponse(target, res); err != nil {
  5032. return nil, err
  5033. }
  5034. return ret, nil
  5035. // {
  5036. // "description": "Updates app details for this edit.",
  5037. // "httpMethod": "PUT",
  5038. // "id": "androidpublisher.edits.details.update",
  5039. // "parameterOrder": [
  5040. // "packageName",
  5041. // "editId"
  5042. // ],
  5043. // "parameters": {
  5044. // "editId": {
  5045. // "description": "Unique identifier for this edit.",
  5046. // "location": "path",
  5047. // "required": true,
  5048. // "type": "string"
  5049. // },
  5050. // "packageName": {
  5051. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5052. // "location": "path",
  5053. // "required": true,
  5054. // "type": "string"
  5055. // }
  5056. // },
  5057. // "path": "{packageName}/edits/{editId}/details",
  5058. // "request": {
  5059. // "$ref": "AppDetails"
  5060. // },
  5061. // "response": {
  5062. // "$ref": "AppDetails"
  5063. // },
  5064. // "scopes": [
  5065. // "https://www.googleapis.com/auth/androidpublisher"
  5066. // ]
  5067. // }
  5068. }
  5069. // method id "androidpublisher.edits.expansionfiles.get":
  5070. type EditsExpansionfilesGetCall struct {
  5071. s *Service
  5072. packageNameid string
  5073. editId string
  5074. apkVersionCode int64
  5075. expansionFileType string
  5076. urlParams_ gensupport.URLParams
  5077. ifNoneMatch_ string
  5078. ctx_ context.Context
  5079. header_ http.Header
  5080. }
  5081. // Get: Fetches the Expansion File configuration for the APK specified.
  5082. func (r *EditsExpansionfilesService) Get(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall {
  5083. c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5084. c.packageNameid = packageNameid
  5085. c.editId = editId
  5086. c.apkVersionCode = apkVersionCode
  5087. c.expansionFileType = expansionFileType
  5088. return c
  5089. }
  5090. // Fields allows partial responses to be retrieved. See
  5091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5092. // for more information.
  5093. func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall {
  5094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5095. return c
  5096. }
  5097. // IfNoneMatch sets the optional parameter which makes the operation
  5098. // fail if the object's ETag matches the given value. This is useful for
  5099. // getting updates only after the object has changed since the last
  5100. // request. Use googleapi.IsNotModified to check whether the response
  5101. // error from Do is the result of In-None-Match.
  5102. func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall {
  5103. c.ifNoneMatch_ = entityTag
  5104. return c
  5105. }
  5106. // Context sets the context to be used in this call's Do method. Any
  5107. // pending HTTP request will be aborted if the provided context is
  5108. // canceled.
  5109. func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall {
  5110. c.ctx_ = ctx
  5111. return c
  5112. }
  5113. // Header returns an http.Header that can be modified by the caller to
  5114. // add HTTP headers to the request.
  5115. func (c *EditsExpansionfilesGetCall) Header() http.Header {
  5116. if c.header_ == nil {
  5117. c.header_ = make(http.Header)
  5118. }
  5119. return c.header_
  5120. }
  5121. func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) {
  5122. reqHeaders := make(http.Header)
  5123. for k, v := range c.header_ {
  5124. reqHeaders[k] = v
  5125. }
  5126. reqHeaders.Set("User-Agent", c.s.userAgent())
  5127. if c.ifNoneMatch_ != "" {
  5128. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5129. }
  5130. var body io.Reader = nil
  5131. c.urlParams_.Set("alt", alt)
  5132. c.urlParams_.Set("prettyPrint", "false")
  5133. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5134. urls += "?" + c.urlParams_.Encode()
  5135. req, err := http.NewRequest("GET", urls, body)
  5136. if err != nil {
  5137. return nil, err
  5138. }
  5139. req.Header = reqHeaders
  5140. googleapi.Expand(req.URL, map[string]string{
  5141. "packageName": c.packageNameid,
  5142. "editId": c.editId,
  5143. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5144. "expansionFileType": c.expansionFileType,
  5145. })
  5146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5147. }
  5148. // Do executes the "androidpublisher.edits.expansionfiles.get" call.
  5149. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  5150. // status code is an error. Response headers are in either
  5151. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  5152. // at all) in error.(*googleapi.Error).Header. Use
  5153. // googleapi.IsNotModified to check whether the returned error was
  5154. // because http.StatusNotModified was returned.
  5155. func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  5156. gensupport.SetOptions(c.urlParams_, opts...)
  5157. res, err := c.doRequest("json")
  5158. if res != nil && res.StatusCode == http.StatusNotModified {
  5159. if res.Body != nil {
  5160. res.Body.Close()
  5161. }
  5162. return nil, &googleapi.Error{
  5163. Code: res.StatusCode,
  5164. Header: res.Header,
  5165. }
  5166. }
  5167. if err != nil {
  5168. return nil, err
  5169. }
  5170. defer googleapi.CloseBody(res)
  5171. if err := googleapi.CheckResponse(res); err != nil {
  5172. return nil, err
  5173. }
  5174. ret := &ExpansionFile{
  5175. ServerResponse: googleapi.ServerResponse{
  5176. Header: res.Header,
  5177. HTTPStatusCode: res.StatusCode,
  5178. },
  5179. }
  5180. target := &ret
  5181. if err := gensupport.DecodeResponse(target, res); err != nil {
  5182. return nil, err
  5183. }
  5184. return ret, nil
  5185. // {
  5186. // "description": "Fetches the Expansion File configuration for the APK specified.",
  5187. // "httpMethod": "GET",
  5188. // "id": "androidpublisher.edits.expansionfiles.get",
  5189. // "parameterOrder": [
  5190. // "packageName",
  5191. // "editId",
  5192. // "apkVersionCode",
  5193. // "expansionFileType"
  5194. // ],
  5195. // "parameters": {
  5196. // "apkVersionCode": {
  5197. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5198. // "format": "int32",
  5199. // "location": "path",
  5200. // "required": true,
  5201. // "type": "integer"
  5202. // },
  5203. // "editId": {
  5204. // "description": "Unique identifier for this edit.",
  5205. // "location": "path",
  5206. // "required": true,
  5207. // "type": "string"
  5208. // },
  5209. // "expansionFileType": {
  5210. // "enum": [
  5211. // "main",
  5212. // "patch"
  5213. // ],
  5214. // "enumDescriptions": [
  5215. // "",
  5216. // ""
  5217. // ],
  5218. // "location": "path",
  5219. // "required": true,
  5220. // "type": "string"
  5221. // },
  5222. // "packageName": {
  5223. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5224. // "location": "path",
  5225. // "required": true,
  5226. // "type": "string"
  5227. // }
  5228. // },
  5229. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5230. // "response": {
  5231. // "$ref": "ExpansionFile"
  5232. // },
  5233. // "scopes": [
  5234. // "https://www.googleapis.com/auth/androidpublisher"
  5235. // ]
  5236. // }
  5237. }
  5238. // method id "androidpublisher.edits.expansionfiles.patch":
  5239. type EditsExpansionfilesPatchCall struct {
  5240. s *Service
  5241. packageNameid string
  5242. editId string
  5243. apkVersionCode int64
  5244. expansionFileType string
  5245. expansionfile *ExpansionFile
  5246. urlParams_ gensupport.URLParams
  5247. ctx_ context.Context
  5248. header_ http.Header
  5249. }
  5250. // Patch: Updates the APK's Expansion File configuration to reference
  5251. // another APK's Expansion Files. To add a new Expansion File use the
  5252. // Upload method. This method supports patch semantics.
  5253. func (r *EditsExpansionfilesService) Patch(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall {
  5254. c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5255. c.packageNameid = packageNameid
  5256. c.editId = editId
  5257. c.apkVersionCode = apkVersionCode
  5258. c.expansionFileType = expansionFileType
  5259. c.expansionfile = expansionfile
  5260. return c
  5261. }
  5262. // Fields allows partial responses to be retrieved. See
  5263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5264. // for more information.
  5265. func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall {
  5266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5267. return c
  5268. }
  5269. // Context sets the context to be used in this call's Do method. Any
  5270. // pending HTTP request will be aborted if the provided context is
  5271. // canceled.
  5272. func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall {
  5273. c.ctx_ = ctx
  5274. return c
  5275. }
  5276. // Header returns an http.Header that can be modified by the caller to
  5277. // add HTTP headers to the request.
  5278. func (c *EditsExpansionfilesPatchCall) Header() http.Header {
  5279. if c.header_ == nil {
  5280. c.header_ = make(http.Header)
  5281. }
  5282. return c.header_
  5283. }
  5284. func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  5285. reqHeaders := make(http.Header)
  5286. for k, v := range c.header_ {
  5287. reqHeaders[k] = v
  5288. }
  5289. reqHeaders.Set("User-Agent", c.s.userAgent())
  5290. var body io.Reader = nil
  5291. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  5292. if err != nil {
  5293. return nil, err
  5294. }
  5295. reqHeaders.Set("Content-Type", "application/json")
  5296. c.urlParams_.Set("alt", alt)
  5297. c.urlParams_.Set("prettyPrint", "false")
  5298. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5299. urls += "?" + c.urlParams_.Encode()
  5300. req, err := http.NewRequest("PATCH", urls, body)
  5301. if err != nil {
  5302. return nil, err
  5303. }
  5304. req.Header = reqHeaders
  5305. googleapi.Expand(req.URL, map[string]string{
  5306. "packageName": c.packageNameid,
  5307. "editId": c.editId,
  5308. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5309. "expansionFileType": c.expansionFileType,
  5310. })
  5311. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5312. }
  5313. // Do executes the "androidpublisher.edits.expansionfiles.patch" call.
  5314. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  5315. // status code is an error. Response headers are in either
  5316. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  5317. // at all) in error.(*googleapi.Error).Header. Use
  5318. // googleapi.IsNotModified to check whether the returned error was
  5319. // because http.StatusNotModified was returned.
  5320. func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  5321. gensupport.SetOptions(c.urlParams_, opts...)
  5322. res, err := c.doRequest("json")
  5323. if res != nil && res.StatusCode == http.StatusNotModified {
  5324. if res.Body != nil {
  5325. res.Body.Close()
  5326. }
  5327. return nil, &googleapi.Error{
  5328. Code: res.StatusCode,
  5329. Header: res.Header,
  5330. }
  5331. }
  5332. if err != nil {
  5333. return nil, err
  5334. }
  5335. defer googleapi.CloseBody(res)
  5336. if err := googleapi.CheckResponse(res); err != nil {
  5337. return nil, err
  5338. }
  5339. ret := &ExpansionFile{
  5340. ServerResponse: googleapi.ServerResponse{
  5341. Header: res.Header,
  5342. HTTPStatusCode: res.StatusCode,
  5343. },
  5344. }
  5345. target := &ret
  5346. if err := gensupport.DecodeResponse(target, res); err != nil {
  5347. return nil, err
  5348. }
  5349. return ret, nil
  5350. // {
  5351. // "description": "Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method. This method supports patch semantics.",
  5352. // "httpMethod": "PATCH",
  5353. // "id": "androidpublisher.edits.expansionfiles.patch",
  5354. // "parameterOrder": [
  5355. // "packageName",
  5356. // "editId",
  5357. // "apkVersionCode",
  5358. // "expansionFileType"
  5359. // ],
  5360. // "parameters": {
  5361. // "apkVersionCode": {
  5362. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5363. // "format": "int32",
  5364. // "location": "path",
  5365. // "required": true,
  5366. // "type": "integer"
  5367. // },
  5368. // "editId": {
  5369. // "description": "Unique identifier for this edit.",
  5370. // "location": "path",
  5371. // "required": true,
  5372. // "type": "string"
  5373. // },
  5374. // "expansionFileType": {
  5375. // "enum": [
  5376. // "main",
  5377. // "patch"
  5378. // ],
  5379. // "enumDescriptions": [
  5380. // "",
  5381. // ""
  5382. // ],
  5383. // "location": "path",
  5384. // "required": true,
  5385. // "type": "string"
  5386. // },
  5387. // "packageName": {
  5388. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5389. // "location": "path",
  5390. // "required": true,
  5391. // "type": "string"
  5392. // }
  5393. // },
  5394. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5395. // "request": {
  5396. // "$ref": "ExpansionFile"
  5397. // },
  5398. // "response": {
  5399. // "$ref": "ExpansionFile"
  5400. // },
  5401. // "scopes": [
  5402. // "https://www.googleapis.com/auth/androidpublisher"
  5403. // ]
  5404. // }
  5405. }
  5406. // method id "androidpublisher.edits.expansionfiles.update":
  5407. type EditsExpansionfilesUpdateCall struct {
  5408. s *Service
  5409. packageNameid string
  5410. editId string
  5411. apkVersionCode int64
  5412. expansionFileType string
  5413. expansionfile *ExpansionFile
  5414. urlParams_ gensupport.URLParams
  5415. ctx_ context.Context
  5416. header_ http.Header
  5417. }
  5418. // Update: Updates the APK's Expansion File configuration to reference
  5419. // another APK's Expansion Files. To add a new Expansion File use the
  5420. // Upload method.
  5421. func (r *EditsExpansionfilesService) Update(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall {
  5422. c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5423. c.packageNameid = packageNameid
  5424. c.editId = editId
  5425. c.apkVersionCode = apkVersionCode
  5426. c.expansionFileType = expansionFileType
  5427. c.expansionfile = expansionfile
  5428. return c
  5429. }
  5430. // Fields allows partial responses to be retrieved. See
  5431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5432. // for more information.
  5433. func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall {
  5434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5435. return c
  5436. }
  5437. // Context sets the context to be used in this call's Do method. Any
  5438. // pending HTTP request will be aborted if the provided context is
  5439. // canceled.
  5440. func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall {
  5441. c.ctx_ = ctx
  5442. return c
  5443. }
  5444. // Header returns an http.Header that can be modified by the caller to
  5445. // add HTTP headers to the request.
  5446. func (c *EditsExpansionfilesUpdateCall) Header() http.Header {
  5447. if c.header_ == nil {
  5448. c.header_ = make(http.Header)
  5449. }
  5450. return c.header_
  5451. }
  5452. func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  5453. reqHeaders := make(http.Header)
  5454. for k, v := range c.header_ {
  5455. reqHeaders[k] = v
  5456. }
  5457. reqHeaders.Set("User-Agent", c.s.userAgent())
  5458. var body io.Reader = nil
  5459. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  5460. if err != nil {
  5461. return nil, err
  5462. }
  5463. reqHeaders.Set("Content-Type", "application/json")
  5464. c.urlParams_.Set("alt", alt)
  5465. c.urlParams_.Set("prettyPrint", "false")
  5466. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5467. urls += "?" + c.urlParams_.Encode()
  5468. req, err := http.NewRequest("PUT", urls, body)
  5469. if err != nil {
  5470. return nil, err
  5471. }
  5472. req.Header = reqHeaders
  5473. googleapi.Expand(req.URL, map[string]string{
  5474. "packageName": c.packageNameid,
  5475. "editId": c.editId,
  5476. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5477. "expansionFileType": c.expansionFileType,
  5478. })
  5479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5480. }
  5481. // Do executes the "androidpublisher.edits.expansionfiles.update" call.
  5482. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  5483. // status code is an error. Response headers are in either
  5484. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  5485. // at all) in error.(*googleapi.Error).Header. Use
  5486. // googleapi.IsNotModified to check whether the returned error was
  5487. // because http.StatusNotModified was returned.
  5488. func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  5489. gensupport.SetOptions(c.urlParams_, opts...)
  5490. res, err := c.doRequest("json")
  5491. if res != nil && res.StatusCode == http.StatusNotModified {
  5492. if res.Body != nil {
  5493. res.Body.Close()
  5494. }
  5495. return nil, &googleapi.Error{
  5496. Code: res.StatusCode,
  5497. Header: res.Header,
  5498. }
  5499. }
  5500. if err != nil {
  5501. return nil, err
  5502. }
  5503. defer googleapi.CloseBody(res)
  5504. if err := googleapi.CheckResponse(res); err != nil {
  5505. return nil, err
  5506. }
  5507. ret := &ExpansionFile{
  5508. ServerResponse: googleapi.ServerResponse{
  5509. Header: res.Header,
  5510. HTTPStatusCode: res.StatusCode,
  5511. },
  5512. }
  5513. target := &ret
  5514. if err := gensupport.DecodeResponse(target, res); err != nil {
  5515. return nil, err
  5516. }
  5517. return ret, nil
  5518. // {
  5519. // "description": "Updates the APK's Expansion File configuration to reference another APK's Expansion Files. To add a new Expansion File use the Upload method.",
  5520. // "httpMethod": "PUT",
  5521. // "id": "androidpublisher.edits.expansionfiles.update",
  5522. // "parameterOrder": [
  5523. // "packageName",
  5524. // "editId",
  5525. // "apkVersionCode",
  5526. // "expansionFileType"
  5527. // ],
  5528. // "parameters": {
  5529. // "apkVersionCode": {
  5530. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5531. // "format": "int32",
  5532. // "location": "path",
  5533. // "required": true,
  5534. // "type": "integer"
  5535. // },
  5536. // "editId": {
  5537. // "description": "Unique identifier for this edit.",
  5538. // "location": "path",
  5539. // "required": true,
  5540. // "type": "string"
  5541. // },
  5542. // "expansionFileType": {
  5543. // "enum": [
  5544. // "main",
  5545. // "patch"
  5546. // ],
  5547. // "enumDescriptions": [
  5548. // "",
  5549. // ""
  5550. // ],
  5551. // "location": "path",
  5552. // "required": true,
  5553. // "type": "string"
  5554. // },
  5555. // "packageName": {
  5556. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5557. // "location": "path",
  5558. // "required": true,
  5559. // "type": "string"
  5560. // }
  5561. // },
  5562. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5563. // "request": {
  5564. // "$ref": "ExpansionFile"
  5565. // },
  5566. // "response": {
  5567. // "$ref": "ExpansionFile"
  5568. // },
  5569. // "scopes": [
  5570. // "https://www.googleapis.com/auth/androidpublisher"
  5571. // ]
  5572. // }
  5573. }
  5574. // method id "androidpublisher.edits.expansionfiles.upload":
  5575. type EditsExpansionfilesUploadCall struct {
  5576. s *Service
  5577. packageNameid string
  5578. editId string
  5579. apkVersionCode int64
  5580. expansionFileType string
  5581. urlParams_ gensupport.URLParams
  5582. mediaInfo_ *gensupport.MediaInfo
  5583. ctx_ context.Context
  5584. header_ http.Header
  5585. }
  5586. // Upload: Uploads and attaches a new Expansion File to the APK
  5587. // specified.
  5588. func (r *EditsExpansionfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall {
  5589. c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5590. c.packageNameid = packageNameid
  5591. c.editId = editId
  5592. c.apkVersionCode = apkVersionCode
  5593. c.expansionFileType = expansionFileType
  5594. return c
  5595. }
  5596. // Media specifies the media to upload in one or more chunks. The chunk
  5597. // size may be controlled by supplying a MediaOption generated by
  5598. // googleapi.ChunkSize. The chunk size defaults to
  5599. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  5600. // upload request will be determined by sniffing the contents of r,
  5601. // unless a MediaOption generated by googleapi.ContentType is
  5602. // supplied.
  5603. // At most one of Media and ResumableMedia may be set.
  5604. func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall {
  5605. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  5606. return c
  5607. }
  5608. // ResumableMedia specifies the media to upload in chunks and can be
  5609. // canceled with ctx.
  5610. //
  5611. // Deprecated: use Media instead.
  5612. //
  5613. // At most one of Media and ResumableMedia may be set. mediaType
  5614. // identifies the MIME media type of the upload, such as "image/png". If
  5615. // mediaType is "", it will be auto-detected. The provided ctx will
  5616. // supersede any context previously provided to the Context method.
  5617. func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall {
  5618. c.ctx_ = ctx
  5619. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  5620. return c
  5621. }
  5622. // ProgressUpdater provides a callback function that will be called
  5623. // after every chunk. It should be a low-latency function in order to
  5624. // not slow down the upload operation. This should only be called when
  5625. // using ResumableMedia (as opposed to Media).
  5626. func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall {
  5627. c.mediaInfo_.SetProgressUpdater(pu)
  5628. return c
  5629. }
  5630. // Fields allows partial responses to be retrieved. See
  5631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5632. // for more information.
  5633. func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall {
  5634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5635. return c
  5636. }
  5637. // Context sets the context to be used in this call's Do method. Any
  5638. // pending HTTP request will be aborted if the provided context is
  5639. // canceled.
  5640. // This context will supersede any context previously provided to the
  5641. // ResumableMedia method.
  5642. func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall {
  5643. c.ctx_ = ctx
  5644. return c
  5645. }
  5646. // Header returns an http.Header that can be modified by the caller to
  5647. // add HTTP headers to the request.
  5648. func (c *EditsExpansionfilesUploadCall) Header() http.Header {
  5649. if c.header_ == nil {
  5650. c.header_ = make(http.Header)
  5651. }
  5652. return c.header_
  5653. }
  5654. func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  5655. reqHeaders := make(http.Header)
  5656. for k, v := range c.header_ {
  5657. reqHeaders[k] = v
  5658. }
  5659. reqHeaders.Set("User-Agent", c.s.userAgent())
  5660. var body io.Reader = nil
  5661. c.urlParams_.Set("alt", alt)
  5662. c.urlParams_.Set("prettyPrint", "false")
  5663. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5664. if c.mediaInfo_ != nil {
  5665. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  5666. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  5667. }
  5668. if body == nil {
  5669. body = new(bytes.Buffer)
  5670. reqHeaders.Set("Content-Type", "application/json")
  5671. }
  5672. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  5673. defer cleanup()
  5674. urls += "?" + c.urlParams_.Encode()
  5675. req, err := http.NewRequest("POST", urls, body)
  5676. if err != nil {
  5677. return nil, err
  5678. }
  5679. req.Header = reqHeaders
  5680. req.GetBody = getBody
  5681. googleapi.Expand(req.URL, map[string]string{
  5682. "packageName": c.packageNameid,
  5683. "editId": c.editId,
  5684. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5685. "expansionFileType": c.expansionFileType,
  5686. })
  5687. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5688. }
  5689. // Do executes the "androidpublisher.edits.expansionfiles.upload" call.
  5690. // Exactly one of *ExpansionFilesUploadResponse or error will be
  5691. // non-nil. Any non-2xx status code is an error. Response headers are in
  5692. // either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a
  5693. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5694. // googleapi.IsNotModified to check whether the returned error was
  5695. // because http.StatusNotModified was returned.
  5696. func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) {
  5697. gensupport.SetOptions(c.urlParams_, opts...)
  5698. res, err := c.doRequest("json")
  5699. if res != nil && res.StatusCode == http.StatusNotModified {
  5700. if res.Body != nil {
  5701. res.Body.Close()
  5702. }
  5703. return nil, &googleapi.Error{
  5704. Code: res.StatusCode,
  5705. Header: res.Header,
  5706. }
  5707. }
  5708. if err != nil {
  5709. return nil, err
  5710. }
  5711. defer googleapi.CloseBody(res)
  5712. if err := googleapi.CheckResponse(res); err != nil {
  5713. return nil, err
  5714. }
  5715. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  5716. if rx != nil {
  5717. rx.Client = c.s.client
  5718. rx.UserAgent = c.s.userAgent()
  5719. ctx := c.ctx_
  5720. if ctx == nil {
  5721. ctx = context.TODO()
  5722. }
  5723. res, err = rx.Upload(ctx)
  5724. if err != nil {
  5725. return nil, err
  5726. }
  5727. defer res.Body.Close()
  5728. if err := googleapi.CheckResponse(res); err != nil {
  5729. return nil, err
  5730. }
  5731. }
  5732. ret := &ExpansionFilesUploadResponse{
  5733. ServerResponse: googleapi.ServerResponse{
  5734. Header: res.Header,
  5735. HTTPStatusCode: res.StatusCode,
  5736. },
  5737. }
  5738. target := &ret
  5739. if err := gensupport.DecodeResponse(target, res); err != nil {
  5740. return nil, err
  5741. }
  5742. return ret, nil
  5743. // {
  5744. // "description": "Uploads and attaches a new Expansion File to the APK specified.",
  5745. // "httpMethod": "POST",
  5746. // "id": "androidpublisher.edits.expansionfiles.upload",
  5747. // "mediaUpload": {
  5748. // "accept": [
  5749. // "application/octet-stream"
  5750. // ],
  5751. // "maxSize": "2048MB",
  5752. // "protocols": {
  5753. // "resumable": {
  5754. // "multipart": true,
  5755. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  5756. // },
  5757. // "simple": {
  5758. // "multipart": true,
  5759. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  5760. // }
  5761. // }
  5762. // },
  5763. // "parameterOrder": [
  5764. // "packageName",
  5765. // "editId",
  5766. // "apkVersionCode",
  5767. // "expansionFileType"
  5768. // ],
  5769. // "parameters": {
  5770. // "apkVersionCode": {
  5771. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5772. // "format": "int32",
  5773. // "location": "path",
  5774. // "required": true,
  5775. // "type": "integer"
  5776. // },
  5777. // "editId": {
  5778. // "description": "Unique identifier for this edit.",
  5779. // "location": "path",
  5780. // "required": true,
  5781. // "type": "string"
  5782. // },
  5783. // "expansionFileType": {
  5784. // "enum": [
  5785. // "main",
  5786. // "patch"
  5787. // ],
  5788. // "enumDescriptions": [
  5789. // "",
  5790. // ""
  5791. // ],
  5792. // "location": "path",
  5793. // "required": true,
  5794. // "type": "string"
  5795. // },
  5796. // "packageName": {
  5797. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5798. // "location": "path",
  5799. // "required": true,
  5800. // "type": "string"
  5801. // }
  5802. // },
  5803. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5804. // "response": {
  5805. // "$ref": "ExpansionFilesUploadResponse"
  5806. // },
  5807. // "scopes": [
  5808. // "https://www.googleapis.com/auth/androidpublisher"
  5809. // ],
  5810. // "supportsMediaUpload": true
  5811. // }
  5812. }
  5813. // method id "androidpublisher.edits.images.delete":
  5814. type EditsImagesDeleteCall struct {
  5815. s *Service
  5816. packageNameid string
  5817. editId string
  5818. language string
  5819. imageType string
  5820. imageId string
  5821. urlParams_ gensupport.URLParams
  5822. ctx_ context.Context
  5823. header_ http.Header
  5824. }
  5825. // Delete: Deletes the image (specified by id) from the edit.
  5826. func (r *EditsImagesService) Delete(packageNameid string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall {
  5827. c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5828. c.packageNameid = packageNameid
  5829. c.editId = editId
  5830. c.language = language
  5831. c.imageType = imageType
  5832. c.imageId = imageId
  5833. return c
  5834. }
  5835. // Fields allows partial responses to be retrieved. See
  5836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5837. // for more information.
  5838. func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall {
  5839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5840. return c
  5841. }
  5842. // Context sets the context to be used in this call's Do method. Any
  5843. // pending HTTP request will be aborted if the provided context is
  5844. // canceled.
  5845. func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall {
  5846. c.ctx_ = ctx
  5847. return c
  5848. }
  5849. // Header returns an http.Header that can be modified by the caller to
  5850. // add HTTP headers to the request.
  5851. func (c *EditsImagesDeleteCall) Header() http.Header {
  5852. if c.header_ == nil {
  5853. c.header_ = make(http.Header)
  5854. }
  5855. return c.header_
  5856. }
  5857. func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5858. reqHeaders := make(http.Header)
  5859. for k, v := range c.header_ {
  5860. reqHeaders[k] = v
  5861. }
  5862. reqHeaders.Set("User-Agent", c.s.userAgent())
  5863. var body io.Reader = nil
  5864. c.urlParams_.Set("alt", alt)
  5865. c.urlParams_.Set("prettyPrint", "false")
  5866. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}")
  5867. urls += "?" + c.urlParams_.Encode()
  5868. req, err := http.NewRequest("DELETE", urls, body)
  5869. if err != nil {
  5870. return nil, err
  5871. }
  5872. req.Header = reqHeaders
  5873. googleapi.Expand(req.URL, map[string]string{
  5874. "packageName": c.packageNameid,
  5875. "editId": c.editId,
  5876. "language": c.language,
  5877. "imageType": c.imageType,
  5878. "imageId": c.imageId,
  5879. })
  5880. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5881. }
  5882. // Do executes the "androidpublisher.edits.images.delete" call.
  5883. func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  5884. gensupport.SetOptions(c.urlParams_, opts...)
  5885. res, err := c.doRequest("json")
  5886. if err != nil {
  5887. return err
  5888. }
  5889. defer googleapi.CloseBody(res)
  5890. if err := googleapi.CheckResponse(res); err != nil {
  5891. return err
  5892. }
  5893. return nil
  5894. // {
  5895. // "description": "Deletes the image (specified by id) from the edit.",
  5896. // "httpMethod": "DELETE",
  5897. // "id": "androidpublisher.edits.images.delete",
  5898. // "parameterOrder": [
  5899. // "packageName",
  5900. // "editId",
  5901. // "language",
  5902. // "imageType",
  5903. // "imageId"
  5904. // ],
  5905. // "parameters": {
  5906. // "editId": {
  5907. // "description": "Unique identifier for this edit.",
  5908. // "location": "path",
  5909. // "required": true,
  5910. // "type": "string"
  5911. // },
  5912. // "imageId": {
  5913. // "description": "Unique identifier an image within the set of images attached to this edit.",
  5914. // "location": "path",
  5915. // "required": true,
  5916. // "type": "string"
  5917. // },
  5918. // "imageType": {
  5919. // "enum": [
  5920. // "featureGraphic",
  5921. // "icon",
  5922. // "phoneScreenshots",
  5923. // "promoGraphic",
  5924. // "sevenInchScreenshots",
  5925. // "tenInchScreenshots",
  5926. // "tvBanner",
  5927. // "tvScreenshots",
  5928. // "wearScreenshots"
  5929. // ],
  5930. // "enumDescriptions": [
  5931. // "",
  5932. // "",
  5933. // "",
  5934. // "",
  5935. // "",
  5936. // "",
  5937. // "",
  5938. // "",
  5939. // ""
  5940. // ],
  5941. // "location": "path",
  5942. // "required": true,
  5943. // "type": "string"
  5944. // },
  5945. // "language": {
  5946. // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".",
  5947. // "location": "path",
  5948. // "required": true,
  5949. // "type": "string"
  5950. // },
  5951. // "packageName": {
  5952. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5953. // "location": "path",
  5954. // "required": true,
  5955. // "type": "string"
  5956. // }
  5957. // },
  5958. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}",
  5959. // "scopes": [
  5960. // "https://www.googleapis.com/auth/androidpublisher"
  5961. // ]
  5962. // }
  5963. }
  5964. // method id "androidpublisher.edits.images.deleteall":
  5965. type EditsImagesDeleteallCall struct {
  5966. s *Service
  5967. packageNameid string
  5968. editId string
  5969. language string
  5970. imageType string
  5971. urlParams_ gensupport.URLParams
  5972. ctx_ context.Context
  5973. header_ http.Header
  5974. }
  5975. // Deleteall: Deletes all images for the specified language and image
  5976. // type.
  5977. func (r *EditsImagesService) Deleteall(packageNameid string, editId string, language string, imageType string) *EditsImagesDeleteallCall {
  5978. c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5979. c.packageNameid = packageNameid
  5980. c.editId = editId
  5981. c.language = language
  5982. c.imageType = imageType
  5983. return c
  5984. }
  5985. // Fields allows partial responses to be retrieved. See
  5986. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5987. // for more information.
  5988. func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall {
  5989. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5990. return c
  5991. }
  5992. // Context sets the context to be used in this call's Do method. Any
  5993. // pending HTTP request will be aborted if the provided context is
  5994. // canceled.
  5995. func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall {
  5996. c.ctx_ = ctx
  5997. return c
  5998. }
  5999. // Header returns an http.Header that can be modified by the caller to
  6000. // add HTTP headers to the request.
  6001. func (c *EditsImagesDeleteallCall) Header() http.Header {
  6002. if c.header_ == nil {
  6003. c.header_ = make(http.Header)
  6004. }
  6005. return c.header_
  6006. }
  6007. func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) {
  6008. reqHeaders := make(http.Header)
  6009. for k, v := range c.header_ {
  6010. reqHeaders[k] = v
  6011. }
  6012. reqHeaders.Set("User-Agent", c.s.userAgent())
  6013. var body io.Reader = nil
  6014. c.urlParams_.Set("alt", alt)
  6015. c.urlParams_.Set("prettyPrint", "false")
  6016. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  6017. urls += "?" + c.urlParams_.Encode()
  6018. req, err := http.NewRequest("DELETE", urls, body)
  6019. if err != nil {
  6020. return nil, err
  6021. }
  6022. req.Header = reqHeaders
  6023. googleapi.Expand(req.URL, map[string]string{
  6024. "packageName": c.packageNameid,
  6025. "editId": c.editId,
  6026. "language": c.language,
  6027. "imageType": c.imageType,
  6028. })
  6029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6030. }
  6031. // Do executes the "androidpublisher.edits.images.deleteall" call.
  6032. // Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any
  6033. // non-2xx status code is an error. Response headers are in either
  6034. // *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was
  6035. // returned at all) in error.(*googleapi.Error).Header. Use
  6036. // googleapi.IsNotModified to check whether the returned error was
  6037. // because http.StatusNotModified was returned.
  6038. func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) {
  6039. gensupport.SetOptions(c.urlParams_, opts...)
  6040. res, err := c.doRequest("json")
  6041. if res != nil && res.StatusCode == http.StatusNotModified {
  6042. if res.Body != nil {
  6043. res.Body.Close()
  6044. }
  6045. return nil, &googleapi.Error{
  6046. Code: res.StatusCode,
  6047. Header: res.Header,
  6048. }
  6049. }
  6050. if err != nil {
  6051. return nil, err
  6052. }
  6053. defer googleapi.CloseBody(res)
  6054. if err := googleapi.CheckResponse(res); err != nil {
  6055. return nil, err
  6056. }
  6057. ret := &ImagesDeleteAllResponse{
  6058. ServerResponse: googleapi.ServerResponse{
  6059. Header: res.Header,
  6060. HTTPStatusCode: res.StatusCode,
  6061. },
  6062. }
  6063. target := &ret
  6064. if err := gensupport.DecodeResponse(target, res); err != nil {
  6065. return nil, err
  6066. }
  6067. return ret, nil
  6068. // {
  6069. // "description": "Deletes all images for the specified language and image type.",
  6070. // "httpMethod": "DELETE",
  6071. // "id": "androidpublisher.edits.images.deleteall",
  6072. // "parameterOrder": [
  6073. // "packageName",
  6074. // "editId",
  6075. // "language",
  6076. // "imageType"
  6077. // ],
  6078. // "parameters": {
  6079. // "editId": {
  6080. // "description": "Unique identifier for this edit.",
  6081. // "location": "path",
  6082. // "required": true,
  6083. // "type": "string"
  6084. // },
  6085. // "imageType": {
  6086. // "enum": [
  6087. // "featureGraphic",
  6088. // "icon",
  6089. // "phoneScreenshots",
  6090. // "promoGraphic",
  6091. // "sevenInchScreenshots",
  6092. // "tenInchScreenshots",
  6093. // "tvBanner",
  6094. // "tvScreenshots",
  6095. // "wearScreenshots"
  6096. // ],
  6097. // "enumDescriptions": [
  6098. // "",
  6099. // "",
  6100. // "",
  6101. // "",
  6102. // "",
  6103. // "",
  6104. // "",
  6105. // "",
  6106. // ""
  6107. // ],
  6108. // "location": "path",
  6109. // "required": true,
  6110. // "type": "string"
  6111. // },
  6112. // "language": {
  6113. // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".",
  6114. // "location": "path",
  6115. // "required": true,
  6116. // "type": "string"
  6117. // },
  6118. // "packageName": {
  6119. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6120. // "location": "path",
  6121. // "required": true,
  6122. // "type": "string"
  6123. // }
  6124. // },
  6125. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  6126. // "response": {
  6127. // "$ref": "ImagesDeleteAllResponse"
  6128. // },
  6129. // "scopes": [
  6130. // "https://www.googleapis.com/auth/androidpublisher"
  6131. // ]
  6132. // }
  6133. }
  6134. // method id "androidpublisher.edits.images.list":
  6135. type EditsImagesListCall struct {
  6136. s *Service
  6137. packageNameid string
  6138. editId string
  6139. language string
  6140. imageType string
  6141. urlParams_ gensupport.URLParams
  6142. ifNoneMatch_ string
  6143. ctx_ context.Context
  6144. header_ http.Header
  6145. }
  6146. // List: Lists all images for the specified language and image type.
  6147. func (r *EditsImagesService) List(packageNameid string, editId string, language string, imageType string) *EditsImagesListCall {
  6148. c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6149. c.packageNameid = packageNameid
  6150. c.editId = editId
  6151. c.language = language
  6152. c.imageType = imageType
  6153. return c
  6154. }
  6155. // Fields allows partial responses to be retrieved. See
  6156. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6157. // for more information.
  6158. func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall {
  6159. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6160. return c
  6161. }
  6162. // IfNoneMatch sets the optional parameter which makes the operation
  6163. // fail if the object's ETag matches the given value. This is useful for
  6164. // getting updates only after the object has changed since the last
  6165. // request. Use googleapi.IsNotModified to check whether the response
  6166. // error from Do is the result of In-None-Match.
  6167. func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall {
  6168. c.ifNoneMatch_ = entityTag
  6169. return c
  6170. }
  6171. // Context sets the context to be used in this call's Do method. Any
  6172. // pending HTTP request will be aborted if the provided context is
  6173. // canceled.
  6174. func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall {
  6175. c.ctx_ = ctx
  6176. return c
  6177. }
  6178. // Header returns an http.Header that can be modified by the caller to
  6179. // add HTTP headers to the request.
  6180. func (c *EditsImagesListCall) Header() http.Header {
  6181. if c.header_ == nil {
  6182. c.header_ = make(http.Header)
  6183. }
  6184. return c.header_
  6185. }
  6186. func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) {
  6187. reqHeaders := make(http.Header)
  6188. for k, v := range c.header_ {
  6189. reqHeaders[k] = v
  6190. }
  6191. reqHeaders.Set("User-Agent", c.s.userAgent())
  6192. if c.ifNoneMatch_ != "" {
  6193. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6194. }
  6195. var body io.Reader = nil
  6196. c.urlParams_.Set("alt", alt)
  6197. c.urlParams_.Set("prettyPrint", "false")
  6198. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  6199. urls += "?" + c.urlParams_.Encode()
  6200. req, err := http.NewRequest("GET", urls, body)
  6201. if err != nil {
  6202. return nil, err
  6203. }
  6204. req.Header = reqHeaders
  6205. googleapi.Expand(req.URL, map[string]string{
  6206. "packageName": c.packageNameid,
  6207. "editId": c.editId,
  6208. "language": c.language,
  6209. "imageType": c.imageType,
  6210. })
  6211. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6212. }
  6213. // Do executes the "androidpublisher.edits.images.list" call.
  6214. // Exactly one of *ImagesListResponse or error will be non-nil. Any
  6215. // non-2xx status code is an error. Response headers are in either
  6216. // *ImagesListResponse.ServerResponse.Header or (if a response was
  6217. // returned at all) in error.(*googleapi.Error).Header. Use
  6218. // googleapi.IsNotModified to check whether the returned error was
  6219. // because http.StatusNotModified was returned.
  6220. func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) {
  6221. gensupport.SetOptions(c.urlParams_, opts...)
  6222. res, err := c.doRequest("json")
  6223. if res != nil && res.StatusCode == http.StatusNotModified {
  6224. if res.Body != nil {
  6225. res.Body.Close()
  6226. }
  6227. return nil, &googleapi.Error{
  6228. Code: res.StatusCode,
  6229. Header: res.Header,
  6230. }
  6231. }
  6232. if err != nil {
  6233. return nil, err
  6234. }
  6235. defer googleapi.CloseBody(res)
  6236. if err := googleapi.CheckResponse(res); err != nil {
  6237. return nil, err
  6238. }
  6239. ret := &ImagesListResponse{
  6240. ServerResponse: googleapi.ServerResponse{
  6241. Header: res.Header,
  6242. HTTPStatusCode: res.StatusCode,
  6243. },
  6244. }
  6245. target := &ret
  6246. if err := gensupport.DecodeResponse(target, res); err != nil {
  6247. return nil, err
  6248. }
  6249. return ret, nil
  6250. // {
  6251. // "description": "Lists all images for the specified language and image type.",
  6252. // "httpMethod": "GET",
  6253. // "id": "androidpublisher.edits.images.list",
  6254. // "parameterOrder": [
  6255. // "packageName",
  6256. // "editId",
  6257. // "language",
  6258. // "imageType"
  6259. // ],
  6260. // "parameters": {
  6261. // "editId": {
  6262. // "description": "Unique identifier for this edit.",
  6263. // "location": "path",
  6264. // "required": true,
  6265. // "type": "string"
  6266. // },
  6267. // "imageType": {
  6268. // "enum": [
  6269. // "featureGraphic",
  6270. // "icon",
  6271. // "phoneScreenshots",
  6272. // "promoGraphic",
  6273. // "sevenInchScreenshots",
  6274. // "tenInchScreenshots",
  6275. // "tvBanner",
  6276. // "tvScreenshots",
  6277. // "wearScreenshots"
  6278. // ],
  6279. // "enumDescriptions": [
  6280. // "",
  6281. // "",
  6282. // "",
  6283. // "",
  6284. // "",
  6285. // "",
  6286. // "",
  6287. // "",
  6288. // ""
  6289. // ],
  6290. // "location": "path",
  6291. // "required": true,
  6292. // "type": "string"
  6293. // },
  6294. // "language": {
  6295. // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".",
  6296. // "location": "path",
  6297. // "required": true,
  6298. // "type": "string"
  6299. // },
  6300. // "packageName": {
  6301. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6302. // "location": "path",
  6303. // "required": true,
  6304. // "type": "string"
  6305. // }
  6306. // },
  6307. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  6308. // "response": {
  6309. // "$ref": "ImagesListResponse"
  6310. // },
  6311. // "scopes": [
  6312. // "https://www.googleapis.com/auth/androidpublisher"
  6313. // ]
  6314. // }
  6315. }
  6316. // method id "androidpublisher.edits.images.upload":
  6317. type EditsImagesUploadCall struct {
  6318. s *Service
  6319. packageNameid string
  6320. editId string
  6321. language string
  6322. imageType string
  6323. urlParams_ gensupport.URLParams
  6324. mediaInfo_ *gensupport.MediaInfo
  6325. ctx_ context.Context
  6326. header_ http.Header
  6327. }
  6328. // Upload: Uploads a new image and adds it to the list of images for the
  6329. // specified language and image type.
  6330. func (r *EditsImagesService) Upload(packageNameid string, editId string, language string, imageType string) *EditsImagesUploadCall {
  6331. c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6332. c.packageNameid = packageNameid
  6333. c.editId = editId
  6334. c.language = language
  6335. c.imageType = imageType
  6336. return c
  6337. }
  6338. // Media specifies the media to upload in one or more chunks. The chunk
  6339. // size may be controlled by supplying a MediaOption generated by
  6340. // googleapi.ChunkSize. The chunk size defaults to
  6341. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  6342. // upload request will be determined by sniffing the contents of r,
  6343. // unless a MediaOption generated by googleapi.ContentType is
  6344. // supplied.
  6345. // At most one of Media and ResumableMedia may be set.
  6346. func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall {
  6347. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  6348. return c
  6349. }
  6350. // ResumableMedia specifies the media to upload in chunks and can be
  6351. // canceled with ctx.
  6352. //
  6353. // Deprecated: use Media instead.
  6354. //
  6355. // At most one of Media and ResumableMedia may be set. mediaType
  6356. // identifies the MIME media type of the upload, such as "image/png". If
  6357. // mediaType is "", it will be auto-detected. The provided ctx will
  6358. // supersede any context previously provided to the Context method.
  6359. func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall {
  6360. c.ctx_ = ctx
  6361. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  6362. return c
  6363. }
  6364. // ProgressUpdater provides a callback function that will be called
  6365. // after every chunk. It should be a low-latency function in order to
  6366. // not slow down the upload operation. This should only be called when
  6367. // using ResumableMedia (as opposed to Media).
  6368. func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall {
  6369. c.mediaInfo_.SetProgressUpdater(pu)
  6370. return c
  6371. }
  6372. // Fields allows partial responses to be retrieved. See
  6373. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6374. // for more information.
  6375. func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall {
  6376. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6377. return c
  6378. }
  6379. // Context sets the context to be used in this call's Do method. Any
  6380. // pending HTTP request will be aborted if the provided context is
  6381. // canceled.
  6382. // This context will supersede any context previously provided to the
  6383. // ResumableMedia method.
  6384. func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall {
  6385. c.ctx_ = ctx
  6386. return c
  6387. }
  6388. // Header returns an http.Header that can be modified by the caller to
  6389. // add HTTP headers to the request.
  6390. func (c *EditsImagesUploadCall) Header() http.Header {
  6391. if c.header_ == nil {
  6392. c.header_ = make(http.Header)
  6393. }
  6394. return c.header_
  6395. }
  6396. func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) {
  6397. reqHeaders := make(http.Header)
  6398. for k, v := range c.header_ {
  6399. reqHeaders[k] = v
  6400. }
  6401. reqHeaders.Set("User-Agent", c.s.userAgent())
  6402. var body io.Reader = nil
  6403. c.urlParams_.Set("alt", alt)
  6404. c.urlParams_.Set("prettyPrint", "false")
  6405. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  6406. if c.mediaInfo_ != nil {
  6407. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  6408. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  6409. }
  6410. if body == nil {
  6411. body = new(bytes.Buffer)
  6412. reqHeaders.Set("Content-Type", "application/json")
  6413. }
  6414. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  6415. defer cleanup()
  6416. urls += "?" + c.urlParams_.Encode()
  6417. req, err := http.NewRequest("POST", urls, body)
  6418. if err != nil {
  6419. return nil, err
  6420. }
  6421. req.Header = reqHeaders
  6422. req.GetBody = getBody
  6423. googleapi.Expand(req.URL, map[string]string{
  6424. "packageName": c.packageNameid,
  6425. "editId": c.editId,
  6426. "language": c.language,
  6427. "imageType": c.imageType,
  6428. })
  6429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6430. }
  6431. // Do executes the "androidpublisher.edits.images.upload" call.
  6432. // Exactly one of *ImagesUploadResponse or error will be non-nil. Any
  6433. // non-2xx status code is an error. Response headers are in either
  6434. // *ImagesUploadResponse.ServerResponse.Header or (if a response was
  6435. // returned at all) in error.(*googleapi.Error).Header. Use
  6436. // googleapi.IsNotModified to check whether the returned error was
  6437. // because http.StatusNotModified was returned.
  6438. func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) {
  6439. gensupport.SetOptions(c.urlParams_, opts...)
  6440. res, err := c.doRequest("json")
  6441. if res != nil && res.StatusCode == http.StatusNotModified {
  6442. if res.Body != nil {
  6443. res.Body.Close()
  6444. }
  6445. return nil, &googleapi.Error{
  6446. Code: res.StatusCode,
  6447. Header: res.Header,
  6448. }
  6449. }
  6450. if err != nil {
  6451. return nil, err
  6452. }
  6453. defer googleapi.CloseBody(res)
  6454. if err := googleapi.CheckResponse(res); err != nil {
  6455. return nil, err
  6456. }
  6457. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  6458. if rx != nil {
  6459. rx.Client = c.s.client
  6460. rx.UserAgent = c.s.userAgent()
  6461. ctx := c.ctx_
  6462. if ctx == nil {
  6463. ctx = context.TODO()
  6464. }
  6465. res, err = rx.Upload(ctx)
  6466. if err != nil {
  6467. return nil, err
  6468. }
  6469. defer res.Body.Close()
  6470. if err := googleapi.CheckResponse(res); err != nil {
  6471. return nil, err
  6472. }
  6473. }
  6474. ret := &ImagesUploadResponse{
  6475. ServerResponse: googleapi.ServerResponse{
  6476. Header: res.Header,
  6477. HTTPStatusCode: res.StatusCode,
  6478. },
  6479. }
  6480. target := &ret
  6481. if err := gensupport.DecodeResponse(target, res); err != nil {
  6482. return nil, err
  6483. }
  6484. return ret, nil
  6485. // {
  6486. // "description": "Uploads a new image and adds it to the list of images for the specified language and image type.",
  6487. // "httpMethod": "POST",
  6488. // "id": "androidpublisher.edits.images.upload",
  6489. // "mediaUpload": {
  6490. // "accept": [
  6491. // "image/*"
  6492. // ],
  6493. // "maxSize": "15MB",
  6494. // "protocols": {
  6495. // "resumable": {
  6496. // "multipart": true,
  6497. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  6498. // },
  6499. // "simple": {
  6500. // "multipart": true,
  6501. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  6502. // }
  6503. // }
  6504. // },
  6505. // "parameterOrder": [
  6506. // "packageName",
  6507. // "editId",
  6508. // "language",
  6509. // "imageType"
  6510. // ],
  6511. // "parameters": {
  6512. // "editId": {
  6513. // "description": "Unique identifier for this edit.",
  6514. // "location": "path",
  6515. // "required": true,
  6516. // "type": "string"
  6517. // },
  6518. // "imageType": {
  6519. // "enum": [
  6520. // "featureGraphic",
  6521. // "icon",
  6522. // "phoneScreenshots",
  6523. // "promoGraphic",
  6524. // "sevenInchScreenshots",
  6525. // "tenInchScreenshots",
  6526. // "tvBanner",
  6527. // "tvScreenshots",
  6528. // "wearScreenshots"
  6529. // ],
  6530. // "enumDescriptions": [
  6531. // "",
  6532. // "",
  6533. // "",
  6534. // "",
  6535. // "",
  6536. // "",
  6537. // "",
  6538. // "",
  6539. // ""
  6540. // ],
  6541. // "location": "path",
  6542. // "required": true,
  6543. // "type": "string"
  6544. // },
  6545. // "language": {
  6546. // "description": "The language code (a BCP-47 language tag) of the localized listing whose images are to read or modified. For example, to select Austrian German, pass \"de-AT\".",
  6547. // "location": "path",
  6548. // "required": true,
  6549. // "type": "string"
  6550. // },
  6551. // "packageName": {
  6552. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6553. // "location": "path",
  6554. // "required": true,
  6555. // "type": "string"
  6556. // }
  6557. // },
  6558. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  6559. // "response": {
  6560. // "$ref": "ImagesUploadResponse"
  6561. // },
  6562. // "scopes": [
  6563. // "https://www.googleapis.com/auth/androidpublisher"
  6564. // ],
  6565. // "supportsMediaUpload": true
  6566. // }
  6567. }
  6568. // method id "androidpublisher.edits.listings.delete":
  6569. type EditsListingsDeleteCall struct {
  6570. s *Service
  6571. packageNameid string
  6572. editId string
  6573. language string
  6574. urlParams_ gensupport.URLParams
  6575. ctx_ context.Context
  6576. header_ http.Header
  6577. }
  6578. // Delete: Deletes the specified localized store listing from an edit.
  6579. func (r *EditsListingsService) Delete(packageNameid string, editId string, language string) *EditsListingsDeleteCall {
  6580. c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6581. c.packageNameid = packageNameid
  6582. c.editId = editId
  6583. c.language = language
  6584. return c
  6585. }
  6586. // Fields allows partial responses to be retrieved. See
  6587. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6588. // for more information.
  6589. func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall {
  6590. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6591. return c
  6592. }
  6593. // Context sets the context to be used in this call's Do method. Any
  6594. // pending HTTP request will be aborted if the provided context is
  6595. // canceled.
  6596. func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall {
  6597. c.ctx_ = ctx
  6598. return c
  6599. }
  6600. // Header returns an http.Header that can be modified by the caller to
  6601. // add HTTP headers to the request.
  6602. func (c *EditsListingsDeleteCall) Header() http.Header {
  6603. if c.header_ == nil {
  6604. c.header_ = make(http.Header)
  6605. }
  6606. return c.header_
  6607. }
  6608. func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6609. reqHeaders := make(http.Header)
  6610. for k, v := range c.header_ {
  6611. reqHeaders[k] = v
  6612. }
  6613. reqHeaders.Set("User-Agent", c.s.userAgent())
  6614. var body io.Reader = nil
  6615. c.urlParams_.Set("alt", alt)
  6616. c.urlParams_.Set("prettyPrint", "false")
  6617. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6618. urls += "?" + c.urlParams_.Encode()
  6619. req, err := http.NewRequest("DELETE", urls, body)
  6620. if err != nil {
  6621. return nil, err
  6622. }
  6623. req.Header = reqHeaders
  6624. googleapi.Expand(req.URL, map[string]string{
  6625. "packageName": c.packageNameid,
  6626. "editId": c.editId,
  6627. "language": c.language,
  6628. })
  6629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6630. }
  6631. // Do executes the "androidpublisher.edits.listings.delete" call.
  6632. func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6633. gensupport.SetOptions(c.urlParams_, opts...)
  6634. res, err := c.doRequest("json")
  6635. if err != nil {
  6636. return err
  6637. }
  6638. defer googleapi.CloseBody(res)
  6639. if err := googleapi.CheckResponse(res); err != nil {
  6640. return err
  6641. }
  6642. return nil
  6643. // {
  6644. // "description": "Deletes the specified localized store listing from an edit.",
  6645. // "httpMethod": "DELETE",
  6646. // "id": "androidpublisher.edits.listings.delete",
  6647. // "parameterOrder": [
  6648. // "packageName",
  6649. // "editId",
  6650. // "language"
  6651. // ],
  6652. // "parameters": {
  6653. // "editId": {
  6654. // "description": "Unique identifier for this edit.",
  6655. // "location": "path",
  6656. // "required": true,
  6657. // "type": "string"
  6658. // },
  6659. // "language": {
  6660. // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  6661. // "location": "path",
  6662. // "required": true,
  6663. // "type": "string"
  6664. // },
  6665. // "packageName": {
  6666. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6667. // "location": "path",
  6668. // "required": true,
  6669. // "type": "string"
  6670. // }
  6671. // },
  6672. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6673. // "scopes": [
  6674. // "https://www.googleapis.com/auth/androidpublisher"
  6675. // ]
  6676. // }
  6677. }
  6678. // method id "androidpublisher.edits.listings.deleteall":
  6679. type EditsListingsDeleteallCall struct {
  6680. s *Service
  6681. packageNameid string
  6682. editId string
  6683. urlParams_ gensupport.URLParams
  6684. ctx_ context.Context
  6685. header_ http.Header
  6686. }
  6687. // Deleteall: Deletes all localized listings from an edit.
  6688. func (r *EditsListingsService) Deleteall(packageNameid string, editId string) *EditsListingsDeleteallCall {
  6689. c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6690. c.packageNameid = packageNameid
  6691. c.editId = editId
  6692. return c
  6693. }
  6694. // Fields allows partial responses to be retrieved. See
  6695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6696. // for more information.
  6697. func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall {
  6698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6699. return c
  6700. }
  6701. // Context sets the context to be used in this call's Do method. Any
  6702. // pending HTTP request will be aborted if the provided context is
  6703. // canceled.
  6704. func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall {
  6705. c.ctx_ = ctx
  6706. return c
  6707. }
  6708. // Header returns an http.Header that can be modified by the caller to
  6709. // add HTTP headers to the request.
  6710. func (c *EditsListingsDeleteallCall) Header() http.Header {
  6711. if c.header_ == nil {
  6712. c.header_ = make(http.Header)
  6713. }
  6714. return c.header_
  6715. }
  6716. func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) {
  6717. reqHeaders := make(http.Header)
  6718. for k, v := range c.header_ {
  6719. reqHeaders[k] = v
  6720. }
  6721. reqHeaders.Set("User-Agent", c.s.userAgent())
  6722. var body io.Reader = nil
  6723. c.urlParams_.Set("alt", alt)
  6724. c.urlParams_.Set("prettyPrint", "false")
  6725. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  6726. urls += "?" + c.urlParams_.Encode()
  6727. req, err := http.NewRequest("DELETE", urls, body)
  6728. if err != nil {
  6729. return nil, err
  6730. }
  6731. req.Header = reqHeaders
  6732. googleapi.Expand(req.URL, map[string]string{
  6733. "packageName": c.packageNameid,
  6734. "editId": c.editId,
  6735. })
  6736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6737. }
  6738. // Do executes the "androidpublisher.edits.listings.deleteall" call.
  6739. func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error {
  6740. gensupport.SetOptions(c.urlParams_, opts...)
  6741. res, err := c.doRequest("json")
  6742. if err != nil {
  6743. return err
  6744. }
  6745. defer googleapi.CloseBody(res)
  6746. if err := googleapi.CheckResponse(res); err != nil {
  6747. return err
  6748. }
  6749. return nil
  6750. // {
  6751. // "description": "Deletes all localized listings from an edit.",
  6752. // "httpMethod": "DELETE",
  6753. // "id": "androidpublisher.edits.listings.deleteall",
  6754. // "parameterOrder": [
  6755. // "packageName",
  6756. // "editId"
  6757. // ],
  6758. // "parameters": {
  6759. // "editId": {
  6760. // "description": "Unique identifier for this edit.",
  6761. // "location": "path",
  6762. // "required": true,
  6763. // "type": "string"
  6764. // },
  6765. // "packageName": {
  6766. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6767. // "location": "path",
  6768. // "required": true,
  6769. // "type": "string"
  6770. // }
  6771. // },
  6772. // "path": "{packageName}/edits/{editId}/listings",
  6773. // "scopes": [
  6774. // "https://www.googleapis.com/auth/androidpublisher"
  6775. // ]
  6776. // }
  6777. }
  6778. // method id "androidpublisher.edits.listings.get":
  6779. type EditsListingsGetCall struct {
  6780. s *Service
  6781. packageNameid string
  6782. editId string
  6783. language string
  6784. urlParams_ gensupport.URLParams
  6785. ifNoneMatch_ string
  6786. ctx_ context.Context
  6787. header_ http.Header
  6788. }
  6789. // Get: Fetches information about a localized store listing.
  6790. func (r *EditsListingsService) Get(packageNameid string, editId string, language string) *EditsListingsGetCall {
  6791. c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6792. c.packageNameid = packageNameid
  6793. c.editId = editId
  6794. c.language = language
  6795. return c
  6796. }
  6797. // Fields allows partial responses to be retrieved. See
  6798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6799. // for more information.
  6800. func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall {
  6801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6802. return c
  6803. }
  6804. // IfNoneMatch sets the optional parameter which makes the operation
  6805. // fail if the object's ETag matches the given value. This is useful for
  6806. // getting updates only after the object has changed since the last
  6807. // request. Use googleapi.IsNotModified to check whether the response
  6808. // error from Do is the result of In-None-Match.
  6809. func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall {
  6810. c.ifNoneMatch_ = entityTag
  6811. return c
  6812. }
  6813. // Context sets the context to be used in this call's Do method. Any
  6814. // pending HTTP request will be aborted if the provided context is
  6815. // canceled.
  6816. func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall {
  6817. c.ctx_ = ctx
  6818. return c
  6819. }
  6820. // Header returns an http.Header that can be modified by the caller to
  6821. // add HTTP headers to the request.
  6822. func (c *EditsListingsGetCall) Header() http.Header {
  6823. if c.header_ == nil {
  6824. c.header_ = make(http.Header)
  6825. }
  6826. return c.header_
  6827. }
  6828. func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) {
  6829. reqHeaders := make(http.Header)
  6830. for k, v := range c.header_ {
  6831. reqHeaders[k] = v
  6832. }
  6833. reqHeaders.Set("User-Agent", c.s.userAgent())
  6834. if c.ifNoneMatch_ != "" {
  6835. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6836. }
  6837. var body io.Reader = nil
  6838. c.urlParams_.Set("alt", alt)
  6839. c.urlParams_.Set("prettyPrint", "false")
  6840. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6841. urls += "?" + c.urlParams_.Encode()
  6842. req, err := http.NewRequest("GET", urls, body)
  6843. if err != nil {
  6844. return nil, err
  6845. }
  6846. req.Header = reqHeaders
  6847. googleapi.Expand(req.URL, map[string]string{
  6848. "packageName": c.packageNameid,
  6849. "editId": c.editId,
  6850. "language": c.language,
  6851. })
  6852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6853. }
  6854. // Do executes the "androidpublisher.edits.listings.get" call.
  6855. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6856. // code is an error. Response headers are in either
  6857. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6858. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6859. // check whether the returned error was because http.StatusNotModified
  6860. // was returned.
  6861. func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6862. gensupport.SetOptions(c.urlParams_, opts...)
  6863. res, err := c.doRequest("json")
  6864. if res != nil && res.StatusCode == http.StatusNotModified {
  6865. if res.Body != nil {
  6866. res.Body.Close()
  6867. }
  6868. return nil, &googleapi.Error{
  6869. Code: res.StatusCode,
  6870. Header: res.Header,
  6871. }
  6872. }
  6873. if err != nil {
  6874. return nil, err
  6875. }
  6876. defer googleapi.CloseBody(res)
  6877. if err := googleapi.CheckResponse(res); err != nil {
  6878. return nil, err
  6879. }
  6880. ret := &Listing{
  6881. ServerResponse: googleapi.ServerResponse{
  6882. Header: res.Header,
  6883. HTTPStatusCode: res.StatusCode,
  6884. },
  6885. }
  6886. target := &ret
  6887. if err := gensupport.DecodeResponse(target, res); err != nil {
  6888. return nil, err
  6889. }
  6890. return ret, nil
  6891. // {
  6892. // "description": "Fetches information about a localized store listing.",
  6893. // "httpMethod": "GET",
  6894. // "id": "androidpublisher.edits.listings.get",
  6895. // "parameterOrder": [
  6896. // "packageName",
  6897. // "editId",
  6898. // "language"
  6899. // ],
  6900. // "parameters": {
  6901. // "editId": {
  6902. // "description": "Unique identifier for this edit.",
  6903. // "location": "path",
  6904. // "required": true,
  6905. // "type": "string"
  6906. // },
  6907. // "language": {
  6908. // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  6909. // "location": "path",
  6910. // "required": true,
  6911. // "type": "string"
  6912. // },
  6913. // "packageName": {
  6914. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6915. // "location": "path",
  6916. // "required": true,
  6917. // "type": "string"
  6918. // }
  6919. // },
  6920. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6921. // "response": {
  6922. // "$ref": "Listing"
  6923. // },
  6924. // "scopes": [
  6925. // "https://www.googleapis.com/auth/androidpublisher"
  6926. // ]
  6927. // }
  6928. }
  6929. // method id "androidpublisher.edits.listings.list":
  6930. type EditsListingsListCall struct {
  6931. s *Service
  6932. packageNameid string
  6933. editId string
  6934. urlParams_ gensupport.URLParams
  6935. ifNoneMatch_ string
  6936. ctx_ context.Context
  6937. header_ http.Header
  6938. }
  6939. // List: Returns all of the localized store listings attached to this
  6940. // edit.
  6941. func (r *EditsListingsService) List(packageNameid string, editId string) *EditsListingsListCall {
  6942. c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6943. c.packageNameid = packageNameid
  6944. c.editId = editId
  6945. return c
  6946. }
  6947. // Fields allows partial responses to be retrieved. See
  6948. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6949. // for more information.
  6950. func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall {
  6951. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6952. return c
  6953. }
  6954. // IfNoneMatch sets the optional parameter which makes the operation
  6955. // fail if the object's ETag matches the given value. This is useful for
  6956. // getting updates only after the object has changed since the last
  6957. // request. Use googleapi.IsNotModified to check whether the response
  6958. // error from Do is the result of In-None-Match.
  6959. func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall {
  6960. c.ifNoneMatch_ = entityTag
  6961. return c
  6962. }
  6963. // Context sets the context to be used in this call's Do method. Any
  6964. // pending HTTP request will be aborted if the provided context is
  6965. // canceled.
  6966. func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall {
  6967. c.ctx_ = ctx
  6968. return c
  6969. }
  6970. // Header returns an http.Header that can be modified by the caller to
  6971. // add HTTP headers to the request.
  6972. func (c *EditsListingsListCall) Header() http.Header {
  6973. if c.header_ == nil {
  6974. c.header_ = make(http.Header)
  6975. }
  6976. return c.header_
  6977. }
  6978. func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) {
  6979. reqHeaders := make(http.Header)
  6980. for k, v := range c.header_ {
  6981. reqHeaders[k] = v
  6982. }
  6983. reqHeaders.Set("User-Agent", c.s.userAgent())
  6984. if c.ifNoneMatch_ != "" {
  6985. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6986. }
  6987. var body io.Reader = nil
  6988. c.urlParams_.Set("alt", alt)
  6989. c.urlParams_.Set("prettyPrint", "false")
  6990. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  6991. urls += "?" + c.urlParams_.Encode()
  6992. req, err := http.NewRequest("GET", urls, body)
  6993. if err != nil {
  6994. return nil, err
  6995. }
  6996. req.Header = reqHeaders
  6997. googleapi.Expand(req.URL, map[string]string{
  6998. "packageName": c.packageNameid,
  6999. "editId": c.editId,
  7000. })
  7001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7002. }
  7003. // Do executes the "androidpublisher.edits.listings.list" call.
  7004. // Exactly one of *ListingsListResponse or error will be non-nil. Any
  7005. // non-2xx status code is an error. Response headers are in either
  7006. // *ListingsListResponse.ServerResponse.Header or (if a response was
  7007. // returned at all) in error.(*googleapi.Error).Header. Use
  7008. // googleapi.IsNotModified to check whether the returned error was
  7009. // because http.StatusNotModified was returned.
  7010. func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) {
  7011. gensupport.SetOptions(c.urlParams_, opts...)
  7012. res, err := c.doRequest("json")
  7013. if res != nil && res.StatusCode == http.StatusNotModified {
  7014. if res.Body != nil {
  7015. res.Body.Close()
  7016. }
  7017. return nil, &googleapi.Error{
  7018. Code: res.StatusCode,
  7019. Header: res.Header,
  7020. }
  7021. }
  7022. if err != nil {
  7023. return nil, err
  7024. }
  7025. defer googleapi.CloseBody(res)
  7026. if err := googleapi.CheckResponse(res); err != nil {
  7027. return nil, err
  7028. }
  7029. ret := &ListingsListResponse{
  7030. ServerResponse: googleapi.ServerResponse{
  7031. Header: res.Header,
  7032. HTTPStatusCode: res.StatusCode,
  7033. },
  7034. }
  7035. target := &ret
  7036. if err := gensupport.DecodeResponse(target, res); err != nil {
  7037. return nil, err
  7038. }
  7039. return ret, nil
  7040. // {
  7041. // "description": "Returns all of the localized store listings attached to this edit.",
  7042. // "httpMethod": "GET",
  7043. // "id": "androidpublisher.edits.listings.list",
  7044. // "parameterOrder": [
  7045. // "packageName",
  7046. // "editId"
  7047. // ],
  7048. // "parameters": {
  7049. // "editId": {
  7050. // "description": "Unique identifier for this edit.",
  7051. // "location": "path",
  7052. // "required": true,
  7053. // "type": "string"
  7054. // },
  7055. // "packageName": {
  7056. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7057. // "location": "path",
  7058. // "required": true,
  7059. // "type": "string"
  7060. // }
  7061. // },
  7062. // "path": "{packageName}/edits/{editId}/listings",
  7063. // "response": {
  7064. // "$ref": "ListingsListResponse"
  7065. // },
  7066. // "scopes": [
  7067. // "https://www.googleapis.com/auth/androidpublisher"
  7068. // ]
  7069. // }
  7070. }
  7071. // method id "androidpublisher.edits.listings.patch":
  7072. type EditsListingsPatchCall struct {
  7073. s *Service
  7074. packageNameid string
  7075. editId string
  7076. language string
  7077. listing *Listing
  7078. urlParams_ gensupport.URLParams
  7079. ctx_ context.Context
  7080. header_ http.Header
  7081. }
  7082. // Patch: Creates or updates a localized store listing. This method
  7083. // supports patch semantics.
  7084. func (r *EditsListingsService) Patch(packageNameid string, editId string, language string, listing *Listing) *EditsListingsPatchCall {
  7085. c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7086. c.packageNameid = packageNameid
  7087. c.editId = editId
  7088. c.language = language
  7089. c.listing = listing
  7090. return c
  7091. }
  7092. // Fields allows partial responses to be retrieved. See
  7093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7094. // for more information.
  7095. func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall {
  7096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7097. return c
  7098. }
  7099. // Context sets the context to be used in this call's Do method. Any
  7100. // pending HTTP request will be aborted if the provided context is
  7101. // canceled.
  7102. func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall {
  7103. c.ctx_ = ctx
  7104. return c
  7105. }
  7106. // Header returns an http.Header that can be modified by the caller to
  7107. // add HTTP headers to the request.
  7108. func (c *EditsListingsPatchCall) Header() http.Header {
  7109. if c.header_ == nil {
  7110. c.header_ = make(http.Header)
  7111. }
  7112. return c.header_
  7113. }
  7114. func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) {
  7115. reqHeaders := make(http.Header)
  7116. for k, v := range c.header_ {
  7117. reqHeaders[k] = v
  7118. }
  7119. reqHeaders.Set("User-Agent", c.s.userAgent())
  7120. var body io.Reader = nil
  7121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  7122. if err != nil {
  7123. return nil, err
  7124. }
  7125. reqHeaders.Set("Content-Type", "application/json")
  7126. c.urlParams_.Set("alt", alt)
  7127. c.urlParams_.Set("prettyPrint", "false")
  7128. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  7129. urls += "?" + c.urlParams_.Encode()
  7130. req, err := http.NewRequest("PATCH", urls, body)
  7131. if err != nil {
  7132. return nil, err
  7133. }
  7134. req.Header = reqHeaders
  7135. googleapi.Expand(req.URL, map[string]string{
  7136. "packageName": c.packageNameid,
  7137. "editId": c.editId,
  7138. "language": c.language,
  7139. })
  7140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7141. }
  7142. // Do executes the "androidpublisher.edits.listings.patch" call.
  7143. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  7144. // code is an error. Response headers are in either
  7145. // *Listing.ServerResponse.Header or (if a response was returned at all)
  7146. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7147. // check whether the returned error was because http.StatusNotModified
  7148. // was returned.
  7149. func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  7150. gensupport.SetOptions(c.urlParams_, opts...)
  7151. res, err := c.doRequest("json")
  7152. if res != nil && res.StatusCode == http.StatusNotModified {
  7153. if res.Body != nil {
  7154. res.Body.Close()
  7155. }
  7156. return nil, &googleapi.Error{
  7157. Code: res.StatusCode,
  7158. Header: res.Header,
  7159. }
  7160. }
  7161. if err != nil {
  7162. return nil, err
  7163. }
  7164. defer googleapi.CloseBody(res)
  7165. if err := googleapi.CheckResponse(res); err != nil {
  7166. return nil, err
  7167. }
  7168. ret := &Listing{
  7169. ServerResponse: googleapi.ServerResponse{
  7170. Header: res.Header,
  7171. HTTPStatusCode: res.StatusCode,
  7172. },
  7173. }
  7174. target := &ret
  7175. if err := gensupport.DecodeResponse(target, res); err != nil {
  7176. return nil, err
  7177. }
  7178. return ret, nil
  7179. // {
  7180. // "description": "Creates or updates a localized store listing. This method supports patch semantics.",
  7181. // "httpMethod": "PATCH",
  7182. // "id": "androidpublisher.edits.listings.patch",
  7183. // "parameterOrder": [
  7184. // "packageName",
  7185. // "editId",
  7186. // "language"
  7187. // ],
  7188. // "parameters": {
  7189. // "editId": {
  7190. // "description": "Unique identifier for this edit.",
  7191. // "location": "path",
  7192. // "required": true,
  7193. // "type": "string"
  7194. // },
  7195. // "language": {
  7196. // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  7197. // "location": "path",
  7198. // "required": true,
  7199. // "type": "string"
  7200. // },
  7201. // "packageName": {
  7202. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7203. // "location": "path",
  7204. // "required": true,
  7205. // "type": "string"
  7206. // }
  7207. // },
  7208. // "path": "{packageName}/edits/{editId}/listings/{language}",
  7209. // "request": {
  7210. // "$ref": "Listing"
  7211. // },
  7212. // "response": {
  7213. // "$ref": "Listing"
  7214. // },
  7215. // "scopes": [
  7216. // "https://www.googleapis.com/auth/androidpublisher"
  7217. // ]
  7218. // }
  7219. }
  7220. // method id "androidpublisher.edits.listings.update":
  7221. type EditsListingsUpdateCall struct {
  7222. s *Service
  7223. packageNameid string
  7224. editId string
  7225. language string
  7226. listing *Listing
  7227. urlParams_ gensupport.URLParams
  7228. ctx_ context.Context
  7229. header_ http.Header
  7230. }
  7231. // Update: Creates or updates a localized store listing.
  7232. func (r *EditsListingsService) Update(packageNameid string, editId string, language string, listing *Listing) *EditsListingsUpdateCall {
  7233. c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7234. c.packageNameid = packageNameid
  7235. c.editId = editId
  7236. c.language = language
  7237. c.listing = listing
  7238. return c
  7239. }
  7240. // Fields allows partial responses to be retrieved. See
  7241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7242. // for more information.
  7243. func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall {
  7244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7245. return c
  7246. }
  7247. // Context sets the context to be used in this call's Do method. Any
  7248. // pending HTTP request will be aborted if the provided context is
  7249. // canceled.
  7250. func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall {
  7251. c.ctx_ = ctx
  7252. return c
  7253. }
  7254. // Header returns an http.Header that can be modified by the caller to
  7255. // add HTTP headers to the request.
  7256. func (c *EditsListingsUpdateCall) Header() http.Header {
  7257. if c.header_ == nil {
  7258. c.header_ = make(http.Header)
  7259. }
  7260. return c.header_
  7261. }
  7262. func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7263. reqHeaders := make(http.Header)
  7264. for k, v := range c.header_ {
  7265. reqHeaders[k] = v
  7266. }
  7267. reqHeaders.Set("User-Agent", c.s.userAgent())
  7268. var body io.Reader = nil
  7269. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  7270. if err != nil {
  7271. return nil, err
  7272. }
  7273. reqHeaders.Set("Content-Type", "application/json")
  7274. c.urlParams_.Set("alt", alt)
  7275. c.urlParams_.Set("prettyPrint", "false")
  7276. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  7277. urls += "?" + c.urlParams_.Encode()
  7278. req, err := http.NewRequest("PUT", urls, body)
  7279. if err != nil {
  7280. return nil, err
  7281. }
  7282. req.Header = reqHeaders
  7283. googleapi.Expand(req.URL, map[string]string{
  7284. "packageName": c.packageNameid,
  7285. "editId": c.editId,
  7286. "language": c.language,
  7287. })
  7288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7289. }
  7290. // Do executes the "androidpublisher.edits.listings.update" call.
  7291. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  7292. // code is an error. Response headers are in either
  7293. // *Listing.ServerResponse.Header or (if a response was returned at all)
  7294. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7295. // check whether the returned error was because http.StatusNotModified
  7296. // was returned.
  7297. func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  7298. gensupport.SetOptions(c.urlParams_, opts...)
  7299. res, err := c.doRequest("json")
  7300. if res != nil && res.StatusCode == http.StatusNotModified {
  7301. if res.Body != nil {
  7302. res.Body.Close()
  7303. }
  7304. return nil, &googleapi.Error{
  7305. Code: res.StatusCode,
  7306. Header: res.Header,
  7307. }
  7308. }
  7309. if err != nil {
  7310. return nil, err
  7311. }
  7312. defer googleapi.CloseBody(res)
  7313. if err := googleapi.CheckResponse(res); err != nil {
  7314. return nil, err
  7315. }
  7316. ret := &Listing{
  7317. ServerResponse: googleapi.ServerResponse{
  7318. Header: res.Header,
  7319. HTTPStatusCode: res.StatusCode,
  7320. },
  7321. }
  7322. target := &ret
  7323. if err := gensupport.DecodeResponse(target, res); err != nil {
  7324. return nil, err
  7325. }
  7326. return ret, nil
  7327. // {
  7328. // "description": "Creates or updates a localized store listing.",
  7329. // "httpMethod": "PUT",
  7330. // "id": "androidpublisher.edits.listings.update",
  7331. // "parameterOrder": [
  7332. // "packageName",
  7333. // "editId",
  7334. // "language"
  7335. // ],
  7336. // "parameters": {
  7337. // "editId": {
  7338. // "description": "Unique identifier for this edit.",
  7339. // "location": "path",
  7340. // "required": true,
  7341. // "type": "string"
  7342. // },
  7343. // "language": {
  7344. // "description": "The language code (a BCP-47 language tag) of the localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  7345. // "location": "path",
  7346. // "required": true,
  7347. // "type": "string"
  7348. // },
  7349. // "packageName": {
  7350. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7351. // "location": "path",
  7352. // "required": true,
  7353. // "type": "string"
  7354. // }
  7355. // },
  7356. // "path": "{packageName}/edits/{editId}/listings/{language}",
  7357. // "request": {
  7358. // "$ref": "Listing"
  7359. // },
  7360. // "response": {
  7361. // "$ref": "Listing"
  7362. // },
  7363. // "scopes": [
  7364. // "https://www.googleapis.com/auth/androidpublisher"
  7365. // ]
  7366. // }
  7367. }
  7368. // method id "androidpublisher.edits.testers.get":
  7369. type EditsTestersGetCall struct {
  7370. s *Service
  7371. packageNameid string
  7372. editId string
  7373. track string
  7374. urlParams_ gensupport.URLParams
  7375. ifNoneMatch_ string
  7376. ctx_ context.Context
  7377. header_ http.Header
  7378. }
  7379. // Get:
  7380. func (r *EditsTestersService) Get(packageNameid string, editId string, track string) *EditsTestersGetCall {
  7381. c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7382. c.packageNameid = packageNameid
  7383. c.editId = editId
  7384. c.track = track
  7385. return c
  7386. }
  7387. // Fields allows partial responses to be retrieved. See
  7388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7389. // for more information.
  7390. func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall {
  7391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7392. return c
  7393. }
  7394. // IfNoneMatch sets the optional parameter which makes the operation
  7395. // fail if the object's ETag matches the given value. This is useful for
  7396. // getting updates only after the object has changed since the last
  7397. // request. Use googleapi.IsNotModified to check whether the response
  7398. // error from Do is the result of In-None-Match.
  7399. func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall {
  7400. c.ifNoneMatch_ = entityTag
  7401. return c
  7402. }
  7403. // Context sets the context to be used in this call's Do method. Any
  7404. // pending HTTP request will be aborted if the provided context is
  7405. // canceled.
  7406. func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall {
  7407. c.ctx_ = ctx
  7408. return c
  7409. }
  7410. // Header returns an http.Header that can be modified by the caller to
  7411. // add HTTP headers to the request.
  7412. func (c *EditsTestersGetCall) Header() http.Header {
  7413. if c.header_ == nil {
  7414. c.header_ = make(http.Header)
  7415. }
  7416. return c.header_
  7417. }
  7418. func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) {
  7419. reqHeaders := make(http.Header)
  7420. for k, v := range c.header_ {
  7421. reqHeaders[k] = v
  7422. }
  7423. reqHeaders.Set("User-Agent", c.s.userAgent())
  7424. if c.ifNoneMatch_ != "" {
  7425. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7426. }
  7427. var body io.Reader = nil
  7428. c.urlParams_.Set("alt", alt)
  7429. c.urlParams_.Set("prettyPrint", "false")
  7430. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  7431. urls += "?" + c.urlParams_.Encode()
  7432. req, err := http.NewRequest("GET", urls, body)
  7433. if err != nil {
  7434. return nil, err
  7435. }
  7436. req.Header = reqHeaders
  7437. googleapi.Expand(req.URL, map[string]string{
  7438. "packageName": c.packageNameid,
  7439. "editId": c.editId,
  7440. "track": c.track,
  7441. })
  7442. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7443. }
  7444. // Do executes the "androidpublisher.edits.testers.get" call.
  7445. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  7446. // code is an error. Response headers are in either
  7447. // *Testers.ServerResponse.Header or (if a response was returned at all)
  7448. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7449. // check whether the returned error was because http.StatusNotModified
  7450. // was returned.
  7451. func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  7452. gensupport.SetOptions(c.urlParams_, opts...)
  7453. res, err := c.doRequest("json")
  7454. if res != nil && res.StatusCode == http.StatusNotModified {
  7455. if res.Body != nil {
  7456. res.Body.Close()
  7457. }
  7458. return nil, &googleapi.Error{
  7459. Code: res.StatusCode,
  7460. Header: res.Header,
  7461. }
  7462. }
  7463. if err != nil {
  7464. return nil, err
  7465. }
  7466. defer googleapi.CloseBody(res)
  7467. if err := googleapi.CheckResponse(res); err != nil {
  7468. return nil, err
  7469. }
  7470. ret := &Testers{
  7471. ServerResponse: googleapi.ServerResponse{
  7472. Header: res.Header,
  7473. HTTPStatusCode: res.StatusCode,
  7474. },
  7475. }
  7476. target := &ret
  7477. if err := gensupport.DecodeResponse(target, res); err != nil {
  7478. return nil, err
  7479. }
  7480. return ret, nil
  7481. // {
  7482. // "httpMethod": "GET",
  7483. // "id": "androidpublisher.edits.testers.get",
  7484. // "parameterOrder": [
  7485. // "packageName",
  7486. // "editId",
  7487. // "track"
  7488. // ],
  7489. // "parameters": {
  7490. // "editId": {
  7491. // "description": "Unique identifier for this edit.",
  7492. // "location": "path",
  7493. // "required": true,
  7494. // "type": "string"
  7495. // },
  7496. // "packageName": {
  7497. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7498. // "location": "path",
  7499. // "required": true,
  7500. // "type": "string"
  7501. // },
  7502. // "track": {
  7503. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  7504. // "location": "path",
  7505. // "pattern": "(alpha|beta|production|rollout|internal)",
  7506. // "required": true,
  7507. // "type": "string"
  7508. // }
  7509. // },
  7510. // "path": "{packageName}/edits/{editId}/testers/{track}",
  7511. // "response": {
  7512. // "$ref": "Testers"
  7513. // },
  7514. // "scopes": [
  7515. // "https://www.googleapis.com/auth/androidpublisher"
  7516. // ]
  7517. // }
  7518. }
  7519. // method id "androidpublisher.edits.testers.patch":
  7520. type EditsTestersPatchCall struct {
  7521. s *Service
  7522. packageNameid string
  7523. editId string
  7524. track string
  7525. testers *Testers
  7526. urlParams_ gensupport.URLParams
  7527. ctx_ context.Context
  7528. header_ http.Header
  7529. }
  7530. // Patch:
  7531. func (r *EditsTestersService) Patch(packageNameid string, editId string, track string, testers *Testers) *EditsTestersPatchCall {
  7532. c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7533. c.packageNameid = packageNameid
  7534. c.editId = editId
  7535. c.track = track
  7536. c.testers = testers
  7537. return c
  7538. }
  7539. // Fields allows partial responses to be retrieved. See
  7540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7541. // for more information.
  7542. func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall {
  7543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7544. return c
  7545. }
  7546. // Context sets the context to be used in this call's Do method. Any
  7547. // pending HTTP request will be aborted if the provided context is
  7548. // canceled.
  7549. func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall {
  7550. c.ctx_ = ctx
  7551. return c
  7552. }
  7553. // Header returns an http.Header that can be modified by the caller to
  7554. // add HTTP headers to the request.
  7555. func (c *EditsTestersPatchCall) Header() http.Header {
  7556. if c.header_ == nil {
  7557. c.header_ = make(http.Header)
  7558. }
  7559. return c.header_
  7560. }
  7561. func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) {
  7562. reqHeaders := make(http.Header)
  7563. for k, v := range c.header_ {
  7564. reqHeaders[k] = v
  7565. }
  7566. reqHeaders.Set("User-Agent", c.s.userAgent())
  7567. var body io.Reader = nil
  7568. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  7569. if err != nil {
  7570. return nil, err
  7571. }
  7572. reqHeaders.Set("Content-Type", "application/json")
  7573. c.urlParams_.Set("alt", alt)
  7574. c.urlParams_.Set("prettyPrint", "false")
  7575. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  7576. urls += "?" + c.urlParams_.Encode()
  7577. req, err := http.NewRequest("PATCH", urls, body)
  7578. if err != nil {
  7579. return nil, err
  7580. }
  7581. req.Header = reqHeaders
  7582. googleapi.Expand(req.URL, map[string]string{
  7583. "packageName": c.packageNameid,
  7584. "editId": c.editId,
  7585. "track": c.track,
  7586. })
  7587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7588. }
  7589. // Do executes the "androidpublisher.edits.testers.patch" call.
  7590. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  7591. // code is an error. Response headers are in either
  7592. // *Testers.ServerResponse.Header or (if a response was returned at all)
  7593. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7594. // check whether the returned error was because http.StatusNotModified
  7595. // was returned.
  7596. func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  7597. gensupport.SetOptions(c.urlParams_, opts...)
  7598. res, err := c.doRequest("json")
  7599. if res != nil && res.StatusCode == http.StatusNotModified {
  7600. if res.Body != nil {
  7601. res.Body.Close()
  7602. }
  7603. return nil, &googleapi.Error{
  7604. Code: res.StatusCode,
  7605. Header: res.Header,
  7606. }
  7607. }
  7608. if err != nil {
  7609. return nil, err
  7610. }
  7611. defer googleapi.CloseBody(res)
  7612. if err := googleapi.CheckResponse(res); err != nil {
  7613. return nil, err
  7614. }
  7615. ret := &Testers{
  7616. ServerResponse: googleapi.ServerResponse{
  7617. Header: res.Header,
  7618. HTTPStatusCode: res.StatusCode,
  7619. },
  7620. }
  7621. target := &ret
  7622. if err := gensupport.DecodeResponse(target, res); err != nil {
  7623. return nil, err
  7624. }
  7625. return ret, nil
  7626. // {
  7627. // "httpMethod": "PATCH",
  7628. // "id": "androidpublisher.edits.testers.patch",
  7629. // "parameterOrder": [
  7630. // "packageName",
  7631. // "editId",
  7632. // "track"
  7633. // ],
  7634. // "parameters": {
  7635. // "editId": {
  7636. // "description": "Unique identifier for this edit.",
  7637. // "location": "path",
  7638. // "required": true,
  7639. // "type": "string"
  7640. // },
  7641. // "packageName": {
  7642. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7643. // "location": "path",
  7644. // "required": true,
  7645. // "type": "string"
  7646. // },
  7647. // "track": {
  7648. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  7649. // "location": "path",
  7650. // "pattern": "(alpha|beta|production|rollout|internal)",
  7651. // "required": true,
  7652. // "type": "string"
  7653. // }
  7654. // },
  7655. // "path": "{packageName}/edits/{editId}/testers/{track}",
  7656. // "request": {
  7657. // "$ref": "Testers"
  7658. // },
  7659. // "response": {
  7660. // "$ref": "Testers"
  7661. // },
  7662. // "scopes": [
  7663. // "https://www.googleapis.com/auth/androidpublisher"
  7664. // ]
  7665. // }
  7666. }
  7667. // method id "androidpublisher.edits.testers.update":
  7668. type EditsTestersUpdateCall struct {
  7669. s *Service
  7670. packageNameid string
  7671. editId string
  7672. track string
  7673. testers *Testers
  7674. urlParams_ gensupport.URLParams
  7675. ctx_ context.Context
  7676. header_ http.Header
  7677. }
  7678. // Update:
  7679. func (r *EditsTestersService) Update(packageNameid string, editId string, track string, testers *Testers) *EditsTestersUpdateCall {
  7680. c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7681. c.packageNameid = packageNameid
  7682. c.editId = editId
  7683. c.track = track
  7684. c.testers = testers
  7685. return c
  7686. }
  7687. // Fields allows partial responses to be retrieved. See
  7688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7689. // for more information.
  7690. func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall {
  7691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7692. return c
  7693. }
  7694. // Context sets the context to be used in this call's Do method. Any
  7695. // pending HTTP request will be aborted if the provided context is
  7696. // canceled.
  7697. func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall {
  7698. c.ctx_ = ctx
  7699. return c
  7700. }
  7701. // Header returns an http.Header that can be modified by the caller to
  7702. // add HTTP headers to the request.
  7703. func (c *EditsTestersUpdateCall) Header() http.Header {
  7704. if c.header_ == nil {
  7705. c.header_ = make(http.Header)
  7706. }
  7707. return c.header_
  7708. }
  7709. func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) {
  7710. reqHeaders := make(http.Header)
  7711. for k, v := range c.header_ {
  7712. reqHeaders[k] = v
  7713. }
  7714. reqHeaders.Set("User-Agent", c.s.userAgent())
  7715. var body io.Reader = nil
  7716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  7717. if err != nil {
  7718. return nil, err
  7719. }
  7720. reqHeaders.Set("Content-Type", "application/json")
  7721. c.urlParams_.Set("alt", alt)
  7722. c.urlParams_.Set("prettyPrint", "false")
  7723. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  7724. urls += "?" + c.urlParams_.Encode()
  7725. req, err := http.NewRequest("PUT", urls, body)
  7726. if err != nil {
  7727. return nil, err
  7728. }
  7729. req.Header = reqHeaders
  7730. googleapi.Expand(req.URL, map[string]string{
  7731. "packageName": c.packageNameid,
  7732. "editId": c.editId,
  7733. "track": c.track,
  7734. })
  7735. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7736. }
  7737. // Do executes the "androidpublisher.edits.testers.update" call.
  7738. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  7739. // code is an error. Response headers are in either
  7740. // *Testers.ServerResponse.Header or (if a response was returned at all)
  7741. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7742. // check whether the returned error was because http.StatusNotModified
  7743. // was returned.
  7744. func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  7745. gensupport.SetOptions(c.urlParams_, opts...)
  7746. res, err := c.doRequest("json")
  7747. if res != nil && res.StatusCode == http.StatusNotModified {
  7748. if res.Body != nil {
  7749. res.Body.Close()
  7750. }
  7751. return nil, &googleapi.Error{
  7752. Code: res.StatusCode,
  7753. Header: res.Header,
  7754. }
  7755. }
  7756. if err != nil {
  7757. return nil, err
  7758. }
  7759. defer googleapi.CloseBody(res)
  7760. if err := googleapi.CheckResponse(res); err != nil {
  7761. return nil, err
  7762. }
  7763. ret := &Testers{
  7764. ServerResponse: googleapi.ServerResponse{
  7765. Header: res.Header,
  7766. HTTPStatusCode: res.StatusCode,
  7767. },
  7768. }
  7769. target := &ret
  7770. if err := gensupport.DecodeResponse(target, res); err != nil {
  7771. return nil, err
  7772. }
  7773. return ret, nil
  7774. // {
  7775. // "httpMethod": "PUT",
  7776. // "id": "androidpublisher.edits.testers.update",
  7777. // "parameterOrder": [
  7778. // "packageName",
  7779. // "editId",
  7780. // "track"
  7781. // ],
  7782. // "parameters": {
  7783. // "editId": {
  7784. // "description": "Unique identifier for this edit.",
  7785. // "location": "path",
  7786. // "required": true,
  7787. // "type": "string"
  7788. // },
  7789. // "packageName": {
  7790. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7791. // "location": "path",
  7792. // "required": true,
  7793. // "type": "string"
  7794. // },
  7795. // "track": {
  7796. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  7797. // "location": "path",
  7798. // "pattern": "(alpha|beta|production|rollout|internal)",
  7799. // "required": true,
  7800. // "type": "string"
  7801. // }
  7802. // },
  7803. // "path": "{packageName}/edits/{editId}/testers/{track}",
  7804. // "request": {
  7805. // "$ref": "Testers"
  7806. // },
  7807. // "response": {
  7808. // "$ref": "Testers"
  7809. // },
  7810. // "scopes": [
  7811. // "https://www.googleapis.com/auth/androidpublisher"
  7812. // ]
  7813. // }
  7814. }
  7815. // method id "androidpublisher.edits.tracks.get":
  7816. type EditsTracksGetCall struct {
  7817. s *Service
  7818. packageNameid string
  7819. editId string
  7820. track string
  7821. urlParams_ gensupport.URLParams
  7822. ifNoneMatch_ string
  7823. ctx_ context.Context
  7824. header_ http.Header
  7825. }
  7826. // Get: Fetches the track configuration for the specified track type.
  7827. // Includes the APK version codes that are in this track.
  7828. func (r *EditsTracksService) Get(packageNameid string, editId string, track string) *EditsTracksGetCall {
  7829. c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7830. c.packageNameid = packageNameid
  7831. c.editId = editId
  7832. c.track = track
  7833. return c
  7834. }
  7835. // Fields allows partial responses to be retrieved. See
  7836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7837. // for more information.
  7838. func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall {
  7839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7840. return c
  7841. }
  7842. // IfNoneMatch sets the optional parameter which makes the operation
  7843. // fail if the object's ETag matches the given value. This is useful for
  7844. // getting updates only after the object has changed since the last
  7845. // request. Use googleapi.IsNotModified to check whether the response
  7846. // error from Do is the result of In-None-Match.
  7847. func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall {
  7848. c.ifNoneMatch_ = entityTag
  7849. return c
  7850. }
  7851. // Context sets the context to be used in this call's Do method. Any
  7852. // pending HTTP request will be aborted if the provided context is
  7853. // canceled.
  7854. func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall {
  7855. c.ctx_ = ctx
  7856. return c
  7857. }
  7858. // Header returns an http.Header that can be modified by the caller to
  7859. // add HTTP headers to the request.
  7860. func (c *EditsTracksGetCall) Header() http.Header {
  7861. if c.header_ == nil {
  7862. c.header_ = make(http.Header)
  7863. }
  7864. return c.header_
  7865. }
  7866. func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) {
  7867. reqHeaders := make(http.Header)
  7868. for k, v := range c.header_ {
  7869. reqHeaders[k] = v
  7870. }
  7871. reqHeaders.Set("User-Agent", c.s.userAgent())
  7872. if c.ifNoneMatch_ != "" {
  7873. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7874. }
  7875. var body io.Reader = nil
  7876. c.urlParams_.Set("alt", alt)
  7877. c.urlParams_.Set("prettyPrint", "false")
  7878. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7879. urls += "?" + c.urlParams_.Encode()
  7880. req, err := http.NewRequest("GET", urls, body)
  7881. if err != nil {
  7882. return nil, err
  7883. }
  7884. req.Header = reqHeaders
  7885. googleapi.Expand(req.URL, map[string]string{
  7886. "packageName": c.packageNameid,
  7887. "editId": c.editId,
  7888. "track": c.track,
  7889. })
  7890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7891. }
  7892. // Do executes the "androidpublisher.edits.tracks.get" call.
  7893. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7894. // code is an error. Response headers are in either
  7895. // *Track.ServerResponse.Header or (if a response was returned at all)
  7896. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7897. // check whether the returned error was because http.StatusNotModified
  7898. // was returned.
  7899. func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7900. gensupport.SetOptions(c.urlParams_, opts...)
  7901. res, err := c.doRequest("json")
  7902. if res != nil && res.StatusCode == http.StatusNotModified {
  7903. if res.Body != nil {
  7904. res.Body.Close()
  7905. }
  7906. return nil, &googleapi.Error{
  7907. Code: res.StatusCode,
  7908. Header: res.Header,
  7909. }
  7910. }
  7911. if err != nil {
  7912. return nil, err
  7913. }
  7914. defer googleapi.CloseBody(res)
  7915. if err := googleapi.CheckResponse(res); err != nil {
  7916. return nil, err
  7917. }
  7918. ret := &Track{
  7919. ServerResponse: googleapi.ServerResponse{
  7920. Header: res.Header,
  7921. HTTPStatusCode: res.StatusCode,
  7922. },
  7923. }
  7924. target := &ret
  7925. if err := gensupport.DecodeResponse(target, res); err != nil {
  7926. return nil, err
  7927. }
  7928. return ret, nil
  7929. // {
  7930. // "description": "Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track.",
  7931. // "httpMethod": "GET",
  7932. // "id": "androidpublisher.edits.tracks.get",
  7933. // "parameterOrder": [
  7934. // "packageName",
  7935. // "editId",
  7936. // "track"
  7937. // ],
  7938. // "parameters": {
  7939. // "editId": {
  7940. // "description": "Unique identifier for this edit.",
  7941. // "location": "path",
  7942. // "required": true,
  7943. // "type": "string"
  7944. // },
  7945. // "packageName": {
  7946. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7947. // "location": "path",
  7948. // "required": true,
  7949. // "type": "string"
  7950. // },
  7951. // "track": {
  7952. // "description": "The track to read or modify.",
  7953. // "location": "path",
  7954. // "required": true,
  7955. // "type": "string"
  7956. // }
  7957. // },
  7958. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7959. // "response": {
  7960. // "$ref": "Track"
  7961. // },
  7962. // "scopes": [
  7963. // "https://www.googleapis.com/auth/androidpublisher"
  7964. // ]
  7965. // }
  7966. }
  7967. // method id "androidpublisher.edits.tracks.list":
  7968. type EditsTracksListCall struct {
  7969. s *Service
  7970. packageNameid string
  7971. editId string
  7972. urlParams_ gensupport.URLParams
  7973. ifNoneMatch_ string
  7974. ctx_ context.Context
  7975. header_ http.Header
  7976. }
  7977. // List: Lists all the track configurations for this edit.
  7978. func (r *EditsTracksService) List(packageNameid string, editId string) *EditsTracksListCall {
  7979. c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7980. c.packageNameid = packageNameid
  7981. c.editId = editId
  7982. return c
  7983. }
  7984. // Fields allows partial responses to be retrieved. See
  7985. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7986. // for more information.
  7987. func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall {
  7988. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7989. return c
  7990. }
  7991. // IfNoneMatch sets the optional parameter which makes the operation
  7992. // fail if the object's ETag matches the given value. This is useful for
  7993. // getting updates only after the object has changed since the last
  7994. // request. Use googleapi.IsNotModified to check whether the response
  7995. // error from Do is the result of In-None-Match.
  7996. func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall {
  7997. c.ifNoneMatch_ = entityTag
  7998. return c
  7999. }
  8000. // Context sets the context to be used in this call's Do method. Any
  8001. // pending HTTP request will be aborted if the provided context is
  8002. // canceled.
  8003. func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall {
  8004. c.ctx_ = ctx
  8005. return c
  8006. }
  8007. // Header returns an http.Header that can be modified by the caller to
  8008. // add HTTP headers to the request.
  8009. func (c *EditsTracksListCall) Header() http.Header {
  8010. if c.header_ == nil {
  8011. c.header_ = make(http.Header)
  8012. }
  8013. return c.header_
  8014. }
  8015. func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) {
  8016. reqHeaders := make(http.Header)
  8017. for k, v := range c.header_ {
  8018. reqHeaders[k] = v
  8019. }
  8020. reqHeaders.Set("User-Agent", c.s.userAgent())
  8021. if c.ifNoneMatch_ != "" {
  8022. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8023. }
  8024. var body io.Reader = nil
  8025. c.urlParams_.Set("alt", alt)
  8026. c.urlParams_.Set("prettyPrint", "false")
  8027. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks")
  8028. urls += "?" + c.urlParams_.Encode()
  8029. req, err := http.NewRequest("GET", urls, body)
  8030. if err != nil {
  8031. return nil, err
  8032. }
  8033. req.Header = reqHeaders
  8034. googleapi.Expand(req.URL, map[string]string{
  8035. "packageName": c.packageNameid,
  8036. "editId": c.editId,
  8037. })
  8038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8039. }
  8040. // Do executes the "androidpublisher.edits.tracks.list" call.
  8041. // Exactly one of *TracksListResponse or error will be non-nil. Any
  8042. // non-2xx status code is an error. Response headers are in either
  8043. // *TracksListResponse.ServerResponse.Header or (if a response was
  8044. // returned at all) in error.(*googleapi.Error).Header. Use
  8045. // googleapi.IsNotModified to check whether the returned error was
  8046. // because http.StatusNotModified was returned.
  8047. func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) {
  8048. gensupport.SetOptions(c.urlParams_, opts...)
  8049. res, err := c.doRequest("json")
  8050. if res != nil && res.StatusCode == http.StatusNotModified {
  8051. if res.Body != nil {
  8052. res.Body.Close()
  8053. }
  8054. return nil, &googleapi.Error{
  8055. Code: res.StatusCode,
  8056. Header: res.Header,
  8057. }
  8058. }
  8059. if err != nil {
  8060. return nil, err
  8061. }
  8062. defer googleapi.CloseBody(res)
  8063. if err := googleapi.CheckResponse(res); err != nil {
  8064. return nil, err
  8065. }
  8066. ret := &TracksListResponse{
  8067. ServerResponse: googleapi.ServerResponse{
  8068. Header: res.Header,
  8069. HTTPStatusCode: res.StatusCode,
  8070. },
  8071. }
  8072. target := &ret
  8073. if err := gensupport.DecodeResponse(target, res); err != nil {
  8074. return nil, err
  8075. }
  8076. return ret, nil
  8077. // {
  8078. // "description": "Lists all the track configurations for this edit.",
  8079. // "httpMethod": "GET",
  8080. // "id": "androidpublisher.edits.tracks.list",
  8081. // "parameterOrder": [
  8082. // "packageName",
  8083. // "editId"
  8084. // ],
  8085. // "parameters": {
  8086. // "editId": {
  8087. // "description": "Unique identifier for this edit.",
  8088. // "location": "path",
  8089. // "required": true,
  8090. // "type": "string"
  8091. // },
  8092. // "packageName": {
  8093. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  8094. // "location": "path",
  8095. // "required": true,
  8096. // "type": "string"
  8097. // }
  8098. // },
  8099. // "path": "{packageName}/edits/{editId}/tracks",
  8100. // "response": {
  8101. // "$ref": "TracksListResponse"
  8102. // },
  8103. // "scopes": [
  8104. // "https://www.googleapis.com/auth/androidpublisher"
  8105. // ]
  8106. // }
  8107. }
  8108. // method id "androidpublisher.edits.tracks.patch":
  8109. type EditsTracksPatchCall struct {
  8110. s *Service
  8111. packageNameid string
  8112. editId string
  8113. track string
  8114. track2 *Track
  8115. urlParams_ gensupport.URLParams
  8116. ctx_ context.Context
  8117. header_ http.Header
  8118. }
  8119. // Patch: Updates the track configuration for the specified track type.
  8120. // When halted, the rollout track cannot be updated without adding new
  8121. // APKs, and adding new APKs will cause it to resume. This method
  8122. // supports patch semantics.
  8123. func (r *EditsTracksService) Patch(packageNameid string, editId string, track string, track2 *Track) *EditsTracksPatchCall {
  8124. c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8125. c.packageNameid = packageNameid
  8126. c.editId = editId
  8127. c.track = track
  8128. c.track2 = track2
  8129. return c
  8130. }
  8131. // Fields allows partial responses to be retrieved. See
  8132. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8133. // for more information.
  8134. func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall {
  8135. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8136. return c
  8137. }
  8138. // Context sets the context to be used in this call's Do method. Any
  8139. // pending HTTP request will be aborted if the provided context is
  8140. // canceled.
  8141. func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall {
  8142. c.ctx_ = ctx
  8143. return c
  8144. }
  8145. // Header returns an http.Header that can be modified by the caller to
  8146. // add HTTP headers to the request.
  8147. func (c *EditsTracksPatchCall) Header() http.Header {
  8148. if c.header_ == nil {
  8149. c.header_ = make(http.Header)
  8150. }
  8151. return c.header_
  8152. }
  8153. func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) {
  8154. reqHeaders := make(http.Header)
  8155. for k, v := range c.header_ {
  8156. reqHeaders[k] = v
  8157. }
  8158. reqHeaders.Set("User-Agent", c.s.userAgent())
  8159. var body io.Reader = nil
  8160. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  8161. if err != nil {
  8162. return nil, err
  8163. }
  8164. reqHeaders.Set("Content-Type", "application/json")
  8165. c.urlParams_.Set("alt", alt)
  8166. c.urlParams_.Set("prettyPrint", "false")
  8167. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  8168. urls += "?" + c.urlParams_.Encode()
  8169. req, err := http.NewRequest("PATCH", urls, body)
  8170. if err != nil {
  8171. return nil, err
  8172. }
  8173. req.Header = reqHeaders
  8174. googleapi.Expand(req.URL, map[string]string{
  8175. "packageName": c.packageNameid,
  8176. "editId": c.editId,
  8177. "track": c.track,
  8178. })
  8179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8180. }
  8181. // Do executes the "androidpublisher.edits.tracks.patch" call.
  8182. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  8183. // code is an error. Response headers are in either
  8184. // *Track.ServerResponse.Header or (if a response was returned at all)
  8185. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8186. // check whether the returned error was because http.StatusNotModified
  8187. // was returned.
  8188. func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  8189. gensupport.SetOptions(c.urlParams_, opts...)
  8190. res, err := c.doRequest("json")
  8191. if res != nil && res.StatusCode == http.StatusNotModified {
  8192. if res.Body != nil {
  8193. res.Body.Close()
  8194. }
  8195. return nil, &googleapi.Error{
  8196. Code: res.StatusCode,
  8197. Header: res.Header,
  8198. }
  8199. }
  8200. if err != nil {
  8201. return nil, err
  8202. }
  8203. defer googleapi.CloseBody(res)
  8204. if err := googleapi.CheckResponse(res); err != nil {
  8205. return nil, err
  8206. }
  8207. ret := &Track{
  8208. ServerResponse: googleapi.ServerResponse{
  8209. Header: res.Header,
  8210. HTTPStatusCode: res.StatusCode,
  8211. },
  8212. }
  8213. target := &ret
  8214. if err := gensupport.DecodeResponse(target, res); err != nil {
  8215. return nil, err
  8216. }
  8217. return ret, nil
  8218. // {
  8219. // "description": "Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume. This method supports patch semantics.",
  8220. // "httpMethod": "PATCH",
  8221. // "id": "androidpublisher.edits.tracks.patch",
  8222. // "parameterOrder": [
  8223. // "packageName",
  8224. // "editId",
  8225. // "track"
  8226. // ],
  8227. // "parameters": {
  8228. // "editId": {
  8229. // "description": "Unique identifier for this edit.",
  8230. // "location": "path",
  8231. // "required": true,
  8232. // "type": "string"
  8233. // },
  8234. // "packageName": {
  8235. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  8236. // "location": "path",
  8237. // "required": true,
  8238. // "type": "string"
  8239. // },
  8240. // "track": {
  8241. // "description": "The track to read or modify.",
  8242. // "location": "path",
  8243. // "required": true,
  8244. // "type": "string"
  8245. // }
  8246. // },
  8247. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  8248. // "request": {
  8249. // "$ref": "Track"
  8250. // },
  8251. // "response": {
  8252. // "$ref": "Track"
  8253. // },
  8254. // "scopes": [
  8255. // "https://www.googleapis.com/auth/androidpublisher"
  8256. // ]
  8257. // }
  8258. }
  8259. // method id "androidpublisher.edits.tracks.update":
  8260. type EditsTracksUpdateCall struct {
  8261. s *Service
  8262. packageNameid string
  8263. editId string
  8264. track string
  8265. track2 *Track
  8266. urlParams_ gensupport.URLParams
  8267. ctx_ context.Context
  8268. header_ http.Header
  8269. }
  8270. // Update: Updates the track configuration for the specified track type.
  8271. // When halted, the rollout track cannot be updated without adding new
  8272. // APKs, and adding new APKs will cause it to resume.
  8273. func (r *EditsTracksService) Update(packageNameid string, editId string, track string, track2 *Track) *EditsTracksUpdateCall {
  8274. c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8275. c.packageNameid = packageNameid
  8276. c.editId = editId
  8277. c.track = track
  8278. c.track2 = track2
  8279. return c
  8280. }
  8281. // Fields allows partial responses to be retrieved. See
  8282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8283. // for more information.
  8284. func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall {
  8285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8286. return c
  8287. }
  8288. // Context sets the context to be used in this call's Do method. Any
  8289. // pending HTTP request will be aborted if the provided context is
  8290. // canceled.
  8291. func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall {
  8292. c.ctx_ = ctx
  8293. return c
  8294. }
  8295. // Header returns an http.Header that can be modified by the caller to
  8296. // add HTTP headers to the request.
  8297. func (c *EditsTracksUpdateCall) Header() http.Header {
  8298. if c.header_ == nil {
  8299. c.header_ = make(http.Header)
  8300. }
  8301. return c.header_
  8302. }
  8303. func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) {
  8304. reqHeaders := make(http.Header)
  8305. for k, v := range c.header_ {
  8306. reqHeaders[k] = v
  8307. }
  8308. reqHeaders.Set("User-Agent", c.s.userAgent())
  8309. var body io.Reader = nil
  8310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  8311. if err != nil {
  8312. return nil, err
  8313. }
  8314. reqHeaders.Set("Content-Type", "application/json")
  8315. c.urlParams_.Set("alt", alt)
  8316. c.urlParams_.Set("prettyPrint", "false")
  8317. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  8318. urls += "?" + c.urlParams_.Encode()
  8319. req, err := http.NewRequest("PUT", urls, body)
  8320. if err != nil {
  8321. return nil, err
  8322. }
  8323. req.Header = reqHeaders
  8324. googleapi.Expand(req.URL, map[string]string{
  8325. "packageName": c.packageNameid,
  8326. "editId": c.editId,
  8327. "track": c.track,
  8328. })
  8329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8330. }
  8331. // Do executes the "androidpublisher.edits.tracks.update" call.
  8332. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  8333. // code is an error. Response headers are in either
  8334. // *Track.ServerResponse.Header or (if a response was returned at all)
  8335. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8336. // check whether the returned error was because http.StatusNotModified
  8337. // was returned.
  8338. func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  8339. gensupport.SetOptions(c.urlParams_, opts...)
  8340. res, err := c.doRequest("json")
  8341. if res != nil && res.StatusCode == http.StatusNotModified {
  8342. if res.Body != nil {
  8343. res.Body.Close()
  8344. }
  8345. return nil, &googleapi.Error{
  8346. Code: res.StatusCode,
  8347. Header: res.Header,
  8348. }
  8349. }
  8350. if err != nil {
  8351. return nil, err
  8352. }
  8353. defer googleapi.CloseBody(res)
  8354. if err := googleapi.CheckResponse(res); err != nil {
  8355. return nil, err
  8356. }
  8357. ret := &Track{
  8358. ServerResponse: googleapi.ServerResponse{
  8359. Header: res.Header,
  8360. HTTPStatusCode: res.StatusCode,
  8361. },
  8362. }
  8363. target := &ret
  8364. if err := gensupport.DecodeResponse(target, res); err != nil {
  8365. return nil, err
  8366. }
  8367. return ret, nil
  8368. // {
  8369. // "description": "Updates the track configuration for the specified track type. When halted, the rollout track cannot be updated without adding new APKs, and adding new APKs will cause it to resume.",
  8370. // "httpMethod": "PUT",
  8371. // "id": "androidpublisher.edits.tracks.update",
  8372. // "parameterOrder": [
  8373. // "packageName",
  8374. // "editId",
  8375. // "track"
  8376. // ],
  8377. // "parameters": {
  8378. // "editId": {
  8379. // "description": "Unique identifier for this edit.",
  8380. // "location": "path",
  8381. // "required": true,
  8382. // "type": "string"
  8383. // },
  8384. // "packageName": {
  8385. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  8386. // "location": "path",
  8387. // "required": true,
  8388. // "type": "string"
  8389. // },
  8390. // "track": {
  8391. // "description": "The track to read or modify.",
  8392. // "location": "path",
  8393. // "required": true,
  8394. // "type": "string"
  8395. // }
  8396. // },
  8397. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  8398. // "request": {
  8399. // "$ref": "Track"
  8400. // },
  8401. // "response": {
  8402. // "$ref": "Track"
  8403. // },
  8404. // "scopes": [
  8405. // "https://www.googleapis.com/auth/androidpublisher"
  8406. // ]
  8407. // }
  8408. }
  8409. // method id "androidpublisher.inappproducts.delete":
  8410. type InappproductsDeleteCall struct {
  8411. s *Service
  8412. packageNameid string
  8413. skuid string
  8414. urlParams_ gensupport.URLParams
  8415. ctx_ context.Context
  8416. header_ http.Header
  8417. }
  8418. // Delete: Delete an in-app product for an app.
  8419. func (r *InappproductsService) Delete(packageNameid string, skuid string) *InappproductsDeleteCall {
  8420. c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8421. c.packageNameid = packageNameid
  8422. c.skuid = skuid
  8423. return c
  8424. }
  8425. // Fields allows partial responses to be retrieved. See
  8426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8427. // for more information.
  8428. func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall {
  8429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8430. return c
  8431. }
  8432. // Context sets the context to be used in this call's Do method. Any
  8433. // pending HTTP request will be aborted if the provided context is
  8434. // canceled.
  8435. func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall {
  8436. c.ctx_ = ctx
  8437. return c
  8438. }
  8439. // Header returns an http.Header that can be modified by the caller to
  8440. // add HTTP headers to the request.
  8441. func (c *InappproductsDeleteCall) Header() http.Header {
  8442. if c.header_ == nil {
  8443. c.header_ = make(http.Header)
  8444. }
  8445. return c.header_
  8446. }
  8447. func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8448. reqHeaders := make(http.Header)
  8449. for k, v := range c.header_ {
  8450. reqHeaders[k] = v
  8451. }
  8452. reqHeaders.Set("User-Agent", c.s.userAgent())
  8453. var body io.Reader = nil
  8454. c.urlParams_.Set("alt", alt)
  8455. c.urlParams_.Set("prettyPrint", "false")
  8456. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8457. urls += "?" + c.urlParams_.Encode()
  8458. req, err := http.NewRequest("DELETE", urls, body)
  8459. if err != nil {
  8460. return nil, err
  8461. }
  8462. req.Header = reqHeaders
  8463. googleapi.Expand(req.URL, map[string]string{
  8464. "packageName": c.packageNameid,
  8465. "sku": c.skuid,
  8466. })
  8467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8468. }
  8469. // Do executes the "androidpublisher.inappproducts.delete" call.
  8470. func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8471. gensupport.SetOptions(c.urlParams_, opts...)
  8472. res, err := c.doRequest("json")
  8473. if err != nil {
  8474. return err
  8475. }
  8476. defer googleapi.CloseBody(res)
  8477. if err := googleapi.CheckResponse(res); err != nil {
  8478. return err
  8479. }
  8480. return nil
  8481. // {
  8482. // "description": "Delete an in-app product for an app.",
  8483. // "httpMethod": "DELETE",
  8484. // "id": "androidpublisher.inappproducts.delete",
  8485. // "parameterOrder": [
  8486. // "packageName",
  8487. // "sku"
  8488. // ],
  8489. // "parameters": {
  8490. // "packageName": {
  8491. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  8492. // "location": "path",
  8493. // "required": true,
  8494. // "type": "string"
  8495. // },
  8496. // "sku": {
  8497. // "description": "Unique identifier for the in-app product.",
  8498. // "location": "path",
  8499. // "required": true,
  8500. // "type": "string"
  8501. // }
  8502. // },
  8503. // "path": "{packageName}/inappproducts/{sku}",
  8504. // "scopes": [
  8505. // "https://www.googleapis.com/auth/androidpublisher"
  8506. // ]
  8507. // }
  8508. }
  8509. // method id "androidpublisher.inappproducts.get":
  8510. type InappproductsGetCall struct {
  8511. s *Service
  8512. packageName string
  8513. skuid string
  8514. urlParams_ gensupport.URLParams
  8515. ifNoneMatch_ string
  8516. ctx_ context.Context
  8517. header_ http.Header
  8518. }
  8519. // Get: Returns information about the in-app product specified.
  8520. func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall {
  8521. c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8522. c.packageName = packageName
  8523. c.skuid = skuid
  8524. return c
  8525. }
  8526. // Fields allows partial responses to be retrieved. See
  8527. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8528. // for more information.
  8529. func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall {
  8530. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8531. return c
  8532. }
  8533. // IfNoneMatch sets the optional parameter which makes the operation
  8534. // fail if the object's ETag matches the given value. This is useful for
  8535. // getting updates only after the object has changed since the last
  8536. // request. Use googleapi.IsNotModified to check whether the response
  8537. // error from Do is the result of In-None-Match.
  8538. func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall {
  8539. c.ifNoneMatch_ = entityTag
  8540. return c
  8541. }
  8542. // Context sets the context to be used in this call's Do method. Any
  8543. // pending HTTP request will be aborted if the provided context is
  8544. // canceled.
  8545. func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall {
  8546. c.ctx_ = ctx
  8547. return c
  8548. }
  8549. // Header returns an http.Header that can be modified by the caller to
  8550. // add HTTP headers to the request.
  8551. func (c *InappproductsGetCall) Header() http.Header {
  8552. if c.header_ == nil {
  8553. c.header_ = make(http.Header)
  8554. }
  8555. return c.header_
  8556. }
  8557. func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) {
  8558. reqHeaders := make(http.Header)
  8559. for k, v := range c.header_ {
  8560. reqHeaders[k] = v
  8561. }
  8562. reqHeaders.Set("User-Agent", c.s.userAgent())
  8563. if c.ifNoneMatch_ != "" {
  8564. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8565. }
  8566. var body io.Reader = nil
  8567. c.urlParams_.Set("alt", alt)
  8568. c.urlParams_.Set("prettyPrint", "false")
  8569. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8570. urls += "?" + c.urlParams_.Encode()
  8571. req, err := http.NewRequest("GET", urls, body)
  8572. if err != nil {
  8573. return nil, err
  8574. }
  8575. req.Header = reqHeaders
  8576. googleapi.Expand(req.URL, map[string]string{
  8577. "packageName": c.packageName,
  8578. "sku": c.skuid,
  8579. })
  8580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8581. }
  8582. // Do executes the "androidpublisher.inappproducts.get" call.
  8583. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8584. // status code is an error. Response headers are in either
  8585. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8586. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8587. // to check whether the returned error was because
  8588. // http.StatusNotModified was returned.
  8589. func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8590. gensupport.SetOptions(c.urlParams_, opts...)
  8591. res, err := c.doRequest("json")
  8592. if res != nil && res.StatusCode == http.StatusNotModified {
  8593. if res.Body != nil {
  8594. res.Body.Close()
  8595. }
  8596. return nil, &googleapi.Error{
  8597. Code: res.StatusCode,
  8598. Header: res.Header,
  8599. }
  8600. }
  8601. if err != nil {
  8602. return nil, err
  8603. }
  8604. defer googleapi.CloseBody(res)
  8605. if err := googleapi.CheckResponse(res); err != nil {
  8606. return nil, err
  8607. }
  8608. ret := &InAppProduct{
  8609. ServerResponse: googleapi.ServerResponse{
  8610. Header: res.Header,
  8611. HTTPStatusCode: res.StatusCode,
  8612. },
  8613. }
  8614. target := &ret
  8615. if err := gensupport.DecodeResponse(target, res); err != nil {
  8616. return nil, err
  8617. }
  8618. return ret, nil
  8619. // {
  8620. // "description": "Returns information about the in-app product specified.",
  8621. // "httpMethod": "GET",
  8622. // "id": "androidpublisher.inappproducts.get",
  8623. // "parameterOrder": [
  8624. // "packageName",
  8625. // "sku"
  8626. // ],
  8627. // "parameters": {
  8628. // "packageName": {
  8629. // "location": "path",
  8630. // "required": true,
  8631. // "type": "string"
  8632. // },
  8633. // "sku": {
  8634. // "description": "Unique identifier for the in-app product.",
  8635. // "location": "path",
  8636. // "required": true,
  8637. // "type": "string"
  8638. // }
  8639. // },
  8640. // "path": "{packageName}/inappproducts/{sku}",
  8641. // "response": {
  8642. // "$ref": "InAppProduct"
  8643. // },
  8644. // "scopes": [
  8645. // "https://www.googleapis.com/auth/androidpublisher"
  8646. // ]
  8647. // }
  8648. }
  8649. // method id "androidpublisher.inappproducts.insert":
  8650. type InappproductsInsertCall struct {
  8651. s *Service
  8652. packageNameid string
  8653. inappproduct *InAppProduct
  8654. urlParams_ gensupport.URLParams
  8655. ctx_ context.Context
  8656. header_ http.Header
  8657. }
  8658. // Insert: Creates a new in-app product for an app.
  8659. func (r *InappproductsService) Insert(packageNameid string, inappproduct *InAppProduct) *InappproductsInsertCall {
  8660. c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8661. c.packageNameid = packageNameid
  8662. c.inappproduct = inappproduct
  8663. return c
  8664. }
  8665. // AutoConvertMissingPrices sets the optional parameter
  8666. // "autoConvertMissingPrices": If true the prices for all regions
  8667. // targeted by the parent app that don't have a price specified for this
  8668. // in-app product will be auto converted to the target currency based on
  8669. // the default price. Defaults to false.
  8670. func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall {
  8671. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8672. return c
  8673. }
  8674. // Fields allows partial responses to be retrieved. See
  8675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8676. // for more information.
  8677. func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall {
  8678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8679. return c
  8680. }
  8681. // Context sets the context to be used in this call's Do method. Any
  8682. // pending HTTP request will be aborted if the provided context is
  8683. // canceled.
  8684. func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall {
  8685. c.ctx_ = ctx
  8686. return c
  8687. }
  8688. // Header returns an http.Header that can be modified by the caller to
  8689. // add HTTP headers to the request.
  8690. func (c *InappproductsInsertCall) Header() http.Header {
  8691. if c.header_ == nil {
  8692. c.header_ = make(http.Header)
  8693. }
  8694. return c.header_
  8695. }
  8696. func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) {
  8697. reqHeaders := make(http.Header)
  8698. for k, v := range c.header_ {
  8699. reqHeaders[k] = v
  8700. }
  8701. reqHeaders.Set("User-Agent", c.s.userAgent())
  8702. var body io.Reader = nil
  8703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8704. if err != nil {
  8705. return nil, err
  8706. }
  8707. reqHeaders.Set("Content-Type", "application/json")
  8708. c.urlParams_.Set("alt", alt)
  8709. c.urlParams_.Set("prettyPrint", "false")
  8710. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  8711. urls += "?" + c.urlParams_.Encode()
  8712. req, err := http.NewRequest("POST", urls, body)
  8713. if err != nil {
  8714. return nil, err
  8715. }
  8716. req.Header = reqHeaders
  8717. googleapi.Expand(req.URL, map[string]string{
  8718. "packageName": c.packageNameid,
  8719. })
  8720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8721. }
  8722. // Do executes the "androidpublisher.inappproducts.insert" call.
  8723. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8724. // status code is an error. Response headers are in either
  8725. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8726. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8727. // to check whether the returned error was because
  8728. // http.StatusNotModified was returned.
  8729. func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8730. gensupport.SetOptions(c.urlParams_, opts...)
  8731. res, err := c.doRequest("json")
  8732. if res != nil && res.StatusCode == http.StatusNotModified {
  8733. if res.Body != nil {
  8734. res.Body.Close()
  8735. }
  8736. return nil, &googleapi.Error{
  8737. Code: res.StatusCode,
  8738. Header: res.Header,
  8739. }
  8740. }
  8741. if err != nil {
  8742. return nil, err
  8743. }
  8744. defer googleapi.CloseBody(res)
  8745. if err := googleapi.CheckResponse(res); err != nil {
  8746. return nil, err
  8747. }
  8748. ret := &InAppProduct{
  8749. ServerResponse: googleapi.ServerResponse{
  8750. Header: res.Header,
  8751. HTTPStatusCode: res.StatusCode,
  8752. },
  8753. }
  8754. target := &ret
  8755. if err := gensupport.DecodeResponse(target, res); err != nil {
  8756. return nil, err
  8757. }
  8758. return ret, nil
  8759. // {
  8760. // "description": "Creates a new in-app product for an app.",
  8761. // "httpMethod": "POST",
  8762. // "id": "androidpublisher.inappproducts.insert",
  8763. // "parameterOrder": [
  8764. // "packageName"
  8765. // ],
  8766. // "parameters": {
  8767. // "autoConvertMissingPrices": {
  8768. // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.",
  8769. // "location": "query",
  8770. // "type": "boolean"
  8771. // },
  8772. // "packageName": {
  8773. // "description": "Unique identifier for the Android app; for example, \"com.spiffygame\".",
  8774. // "location": "path",
  8775. // "required": true,
  8776. // "type": "string"
  8777. // }
  8778. // },
  8779. // "path": "{packageName}/inappproducts",
  8780. // "request": {
  8781. // "$ref": "InAppProduct"
  8782. // },
  8783. // "response": {
  8784. // "$ref": "InAppProduct"
  8785. // },
  8786. // "scopes": [
  8787. // "https://www.googleapis.com/auth/androidpublisher"
  8788. // ]
  8789. // }
  8790. }
  8791. // method id "androidpublisher.inappproducts.list":
  8792. type InappproductsListCall struct {
  8793. s *Service
  8794. packageNameid string
  8795. urlParams_ gensupport.URLParams
  8796. ifNoneMatch_ string
  8797. ctx_ context.Context
  8798. header_ http.Header
  8799. }
  8800. // List: List all the in-app products for an Android app, both
  8801. // subscriptions and managed in-app products..
  8802. func (r *InappproductsService) List(packageNameid string) *InappproductsListCall {
  8803. c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8804. c.packageNameid = packageNameid
  8805. return c
  8806. }
  8807. // MaxResults sets the optional parameter "maxResults":
  8808. func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall {
  8809. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8810. return c
  8811. }
  8812. // StartIndex sets the optional parameter "startIndex":
  8813. func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall {
  8814. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  8815. return c
  8816. }
  8817. // Token sets the optional parameter "token":
  8818. func (c *InappproductsListCall) Token(token string) *InappproductsListCall {
  8819. c.urlParams_.Set("token", token)
  8820. return c
  8821. }
  8822. // Fields allows partial responses to be retrieved. See
  8823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8824. // for more information.
  8825. func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall {
  8826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8827. return c
  8828. }
  8829. // IfNoneMatch sets the optional parameter which makes the operation
  8830. // fail if the object's ETag matches the given value. This is useful for
  8831. // getting updates only after the object has changed since the last
  8832. // request. Use googleapi.IsNotModified to check whether the response
  8833. // error from Do is the result of In-None-Match.
  8834. func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall {
  8835. c.ifNoneMatch_ = entityTag
  8836. return c
  8837. }
  8838. // Context sets the context to be used in this call's Do method. Any
  8839. // pending HTTP request will be aborted if the provided context is
  8840. // canceled.
  8841. func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall {
  8842. c.ctx_ = ctx
  8843. return c
  8844. }
  8845. // Header returns an http.Header that can be modified by the caller to
  8846. // add HTTP headers to the request.
  8847. func (c *InappproductsListCall) Header() http.Header {
  8848. if c.header_ == nil {
  8849. c.header_ = make(http.Header)
  8850. }
  8851. return c.header_
  8852. }
  8853. func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) {
  8854. reqHeaders := make(http.Header)
  8855. for k, v := range c.header_ {
  8856. reqHeaders[k] = v
  8857. }
  8858. reqHeaders.Set("User-Agent", c.s.userAgent())
  8859. if c.ifNoneMatch_ != "" {
  8860. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8861. }
  8862. var body io.Reader = nil
  8863. c.urlParams_.Set("alt", alt)
  8864. c.urlParams_.Set("prettyPrint", "false")
  8865. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  8866. urls += "?" + c.urlParams_.Encode()
  8867. req, err := http.NewRequest("GET", urls, body)
  8868. if err != nil {
  8869. return nil, err
  8870. }
  8871. req.Header = reqHeaders
  8872. googleapi.Expand(req.URL, map[string]string{
  8873. "packageName": c.packageNameid,
  8874. })
  8875. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8876. }
  8877. // Do executes the "androidpublisher.inappproducts.list" call.
  8878. // Exactly one of *InappproductsListResponse or error will be non-nil.
  8879. // Any non-2xx status code is an error. Response headers are in either
  8880. // *InappproductsListResponse.ServerResponse.Header or (if a response
  8881. // was returned at all) in error.(*googleapi.Error).Header. Use
  8882. // googleapi.IsNotModified to check whether the returned error was
  8883. // because http.StatusNotModified was returned.
  8884. func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) {
  8885. gensupport.SetOptions(c.urlParams_, opts...)
  8886. res, err := c.doRequest("json")
  8887. if res != nil && res.StatusCode == http.StatusNotModified {
  8888. if res.Body != nil {
  8889. res.Body.Close()
  8890. }
  8891. return nil, &googleapi.Error{
  8892. Code: res.StatusCode,
  8893. Header: res.Header,
  8894. }
  8895. }
  8896. if err != nil {
  8897. return nil, err
  8898. }
  8899. defer googleapi.CloseBody(res)
  8900. if err := googleapi.CheckResponse(res); err != nil {
  8901. return nil, err
  8902. }
  8903. ret := &InappproductsListResponse{
  8904. ServerResponse: googleapi.ServerResponse{
  8905. Header: res.Header,
  8906. HTTPStatusCode: res.StatusCode,
  8907. },
  8908. }
  8909. target := &ret
  8910. if err := gensupport.DecodeResponse(target, res); err != nil {
  8911. return nil, err
  8912. }
  8913. return ret, nil
  8914. // {
  8915. // "description": "List all the in-app products for an Android app, both subscriptions and managed in-app products..",
  8916. // "httpMethod": "GET",
  8917. // "id": "androidpublisher.inappproducts.list",
  8918. // "parameterOrder": [
  8919. // "packageName"
  8920. // ],
  8921. // "parameters": {
  8922. // "maxResults": {
  8923. // "format": "uint32",
  8924. // "location": "query",
  8925. // "type": "integer"
  8926. // },
  8927. // "packageName": {
  8928. // "description": "Unique identifier for the Android app with in-app products; for example, \"com.spiffygame\".",
  8929. // "location": "path",
  8930. // "required": true,
  8931. // "type": "string"
  8932. // },
  8933. // "startIndex": {
  8934. // "format": "uint32",
  8935. // "location": "query",
  8936. // "type": "integer"
  8937. // },
  8938. // "token": {
  8939. // "location": "query",
  8940. // "type": "string"
  8941. // }
  8942. // },
  8943. // "path": "{packageName}/inappproducts",
  8944. // "response": {
  8945. // "$ref": "InappproductsListResponse"
  8946. // },
  8947. // "scopes": [
  8948. // "https://www.googleapis.com/auth/androidpublisher"
  8949. // ]
  8950. // }
  8951. }
  8952. // method id "androidpublisher.inappproducts.patch":
  8953. type InappproductsPatchCall struct {
  8954. s *Service
  8955. packageNameid string
  8956. skuid string
  8957. inappproduct *InAppProduct
  8958. urlParams_ gensupport.URLParams
  8959. ctx_ context.Context
  8960. header_ http.Header
  8961. }
  8962. // Patch: Updates the details of an in-app product. This method supports
  8963. // patch semantics.
  8964. func (r *InappproductsService) Patch(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall {
  8965. c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8966. c.packageNameid = packageNameid
  8967. c.skuid = skuid
  8968. c.inappproduct = inappproduct
  8969. return c
  8970. }
  8971. // AutoConvertMissingPrices sets the optional parameter
  8972. // "autoConvertMissingPrices": If true the prices for all regions
  8973. // targeted by the parent app that don't have a price specified for this
  8974. // in-app product will be auto converted to the target currency based on
  8975. // the default price. Defaults to false.
  8976. func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall {
  8977. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8978. return c
  8979. }
  8980. // Fields allows partial responses to be retrieved. See
  8981. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8982. // for more information.
  8983. func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall {
  8984. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8985. return c
  8986. }
  8987. // Context sets the context to be used in this call's Do method. Any
  8988. // pending HTTP request will be aborted if the provided context is
  8989. // canceled.
  8990. func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall {
  8991. c.ctx_ = ctx
  8992. return c
  8993. }
  8994. // Header returns an http.Header that can be modified by the caller to
  8995. // add HTTP headers to the request.
  8996. func (c *InappproductsPatchCall) Header() http.Header {
  8997. if c.header_ == nil {
  8998. c.header_ = make(http.Header)
  8999. }
  9000. return c.header_
  9001. }
  9002. func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) {
  9003. reqHeaders := make(http.Header)
  9004. for k, v := range c.header_ {
  9005. reqHeaders[k] = v
  9006. }
  9007. reqHeaders.Set("User-Agent", c.s.userAgent())
  9008. var body io.Reader = nil
  9009. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  9010. if err != nil {
  9011. return nil, err
  9012. }
  9013. reqHeaders.Set("Content-Type", "application/json")
  9014. c.urlParams_.Set("alt", alt)
  9015. c.urlParams_.Set("prettyPrint", "false")
  9016. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  9017. urls += "?" + c.urlParams_.Encode()
  9018. req, err := http.NewRequest("PATCH", urls, body)
  9019. if err != nil {
  9020. return nil, err
  9021. }
  9022. req.Header = reqHeaders
  9023. googleapi.Expand(req.URL, map[string]string{
  9024. "packageName": c.packageNameid,
  9025. "sku": c.skuid,
  9026. })
  9027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9028. }
  9029. // Do executes the "androidpublisher.inappproducts.patch" call.
  9030. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  9031. // status code is an error. Response headers are in either
  9032. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  9033. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9034. // to check whether the returned error was because
  9035. // http.StatusNotModified was returned.
  9036. func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  9037. gensupport.SetOptions(c.urlParams_, opts...)
  9038. res, err := c.doRequest("json")
  9039. if res != nil && res.StatusCode == http.StatusNotModified {
  9040. if res.Body != nil {
  9041. res.Body.Close()
  9042. }
  9043. return nil, &googleapi.Error{
  9044. Code: res.StatusCode,
  9045. Header: res.Header,
  9046. }
  9047. }
  9048. if err != nil {
  9049. return nil, err
  9050. }
  9051. defer googleapi.CloseBody(res)
  9052. if err := googleapi.CheckResponse(res); err != nil {
  9053. return nil, err
  9054. }
  9055. ret := &InAppProduct{
  9056. ServerResponse: googleapi.ServerResponse{
  9057. Header: res.Header,
  9058. HTTPStatusCode: res.StatusCode,
  9059. },
  9060. }
  9061. target := &ret
  9062. if err := gensupport.DecodeResponse(target, res); err != nil {
  9063. return nil, err
  9064. }
  9065. return ret, nil
  9066. // {
  9067. // "description": "Updates the details of an in-app product. This method supports patch semantics.",
  9068. // "httpMethod": "PATCH",
  9069. // "id": "androidpublisher.inappproducts.patch",
  9070. // "parameterOrder": [
  9071. // "packageName",
  9072. // "sku"
  9073. // ],
  9074. // "parameters": {
  9075. // "autoConvertMissingPrices": {
  9076. // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.",
  9077. // "location": "query",
  9078. // "type": "boolean"
  9079. // },
  9080. // "packageName": {
  9081. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  9082. // "location": "path",
  9083. // "required": true,
  9084. // "type": "string"
  9085. // },
  9086. // "sku": {
  9087. // "description": "Unique identifier for the in-app product.",
  9088. // "location": "path",
  9089. // "required": true,
  9090. // "type": "string"
  9091. // }
  9092. // },
  9093. // "path": "{packageName}/inappproducts/{sku}",
  9094. // "request": {
  9095. // "$ref": "InAppProduct"
  9096. // },
  9097. // "response": {
  9098. // "$ref": "InAppProduct"
  9099. // },
  9100. // "scopes": [
  9101. // "https://www.googleapis.com/auth/androidpublisher"
  9102. // ]
  9103. // }
  9104. }
  9105. // method id "androidpublisher.inappproducts.update":
  9106. type InappproductsUpdateCall struct {
  9107. s *Service
  9108. packageNameid string
  9109. skuid string
  9110. inappproduct *InAppProduct
  9111. urlParams_ gensupport.URLParams
  9112. ctx_ context.Context
  9113. header_ http.Header
  9114. }
  9115. // Update: Updates the details of an in-app product.
  9116. func (r *InappproductsService) Update(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall {
  9117. c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9118. c.packageNameid = packageNameid
  9119. c.skuid = skuid
  9120. c.inappproduct = inappproduct
  9121. return c
  9122. }
  9123. // AutoConvertMissingPrices sets the optional parameter
  9124. // "autoConvertMissingPrices": If true the prices for all regions
  9125. // targeted by the parent app that don't have a price specified for this
  9126. // in-app product will be auto converted to the target currency based on
  9127. // the default price. Defaults to false.
  9128. func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall {
  9129. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  9130. return c
  9131. }
  9132. // Fields allows partial responses to be retrieved. See
  9133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9134. // for more information.
  9135. func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall {
  9136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9137. return c
  9138. }
  9139. // Context sets the context to be used in this call's Do method. Any
  9140. // pending HTTP request will be aborted if the provided context is
  9141. // canceled.
  9142. func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall {
  9143. c.ctx_ = ctx
  9144. return c
  9145. }
  9146. // Header returns an http.Header that can be modified by the caller to
  9147. // add HTTP headers to the request.
  9148. func (c *InappproductsUpdateCall) Header() http.Header {
  9149. if c.header_ == nil {
  9150. c.header_ = make(http.Header)
  9151. }
  9152. return c.header_
  9153. }
  9154. func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) {
  9155. reqHeaders := make(http.Header)
  9156. for k, v := range c.header_ {
  9157. reqHeaders[k] = v
  9158. }
  9159. reqHeaders.Set("User-Agent", c.s.userAgent())
  9160. var body io.Reader = nil
  9161. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  9162. if err != nil {
  9163. return nil, err
  9164. }
  9165. reqHeaders.Set("Content-Type", "application/json")
  9166. c.urlParams_.Set("alt", alt)
  9167. c.urlParams_.Set("prettyPrint", "false")
  9168. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  9169. urls += "?" + c.urlParams_.Encode()
  9170. req, err := http.NewRequest("PUT", urls, body)
  9171. if err != nil {
  9172. return nil, err
  9173. }
  9174. req.Header = reqHeaders
  9175. googleapi.Expand(req.URL, map[string]string{
  9176. "packageName": c.packageNameid,
  9177. "sku": c.skuid,
  9178. })
  9179. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9180. }
  9181. // Do executes the "androidpublisher.inappproducts.update" call.
  9182. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  9183. // status code is an error. Response headers are in either
  9184. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  9185. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9186. // to check whether the returned error was because
  9187. // http.StatusNotModified was returned.
  9188. func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  9189. gensupport.SetOptions(c.urlParams_, opts...)
  9190. res, err := c.doRequest("json")
  9191. if res != nil && res.StatusCode == http.StatusNotModified {
  9192. if res.Body != nil {
  9193. res.Body.Close()
  9194. }
  9195. return nil, &googleapi.Error{
  9196. Code: res.StatusCode,
  9197. Header: res.Header,
  9198. }
  9199. }
  9200. if err != nil {
  9201. return nil, err
  9202. }
  9203. defer googleapi.CloseBody(res)
  9204. if err := googleapi.CheckResponse(res); err != nil {
  9205. return nil, err
  9206. }
  9207. ret := &InAppProduct{
  9208. ServerResponse: googleapi.ServerResponse{
  9209. Header: res.Header,
  9210. HTTPStatusCode: res.StatusCode,
  9211. },
  9212. }
  9213. target := &ret
  9214. if err := gensupport.DecodeResponse(target, res); err != nil {
  9215. return nil, err
  9216. }
  9217. return ret, nil
  9218. // {
  9219. // "description": "Updates the details of an in-app product.",
  9220. // "httpMethod": "PUT",
  9221. // "id": "androidpublisher.inappproducts.update",
  9222. // "parameterOrder": [
  9223. // "packageName",
  9224. // "sku"
  9225. // ],
  9226. // "parameters": {
  9227. // "autoConvertMissingPrices": {
  9228. // "description": "If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false.",
  9229. // "location": "query",
  9230. // "type": "boolean"
  9231. // },
  9232. // "packageName": {
  9233. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  9234. // "location": "path",
  9235. // "required": true,
  9236. // "type": "string"
  9237. // },
  9238. // "sku": {
  9239. // "description": "Unique identifier for the in-app product.",
  9240. // "location": "path",
  9241. // "required": true,
  9242. // "type": "string"
  9243. // }
  9244. // },
  9245. // "path": "{packageName}/inappproducts/{sku}",
  9246. // "request": {
  9247. // "$ref": "InAppProduct"
  9248. // },
  9249. // "response": {
  9250. // "$ref": "InAppProduct"
  9251. // },
  9252. // "scopes": [
  9253. // "https://www.googleapis.com/auth/androidpublisher"
  9254. // ]
  9255. // }
  9256. }
  9257. // method id "androidpublisher.orders.refund":
  9258. type OrdersRefundCall struct {
  9259. s *Service
  9260. packageName string
  9261. orderId string
  9262. urlParams_ gensupport.URLParams
  9263. ctx_ context.Context
  9264. header_ http.Header
  9265. }
  9266. // Refund: Refund a user's subscription or in-app purchase order.
  9267. func (r *OrdersService) Refund(packageName string, orderId string) *OrdersRefundCall {
  9268. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9269. c.packageName = packageName
  9270. c.orderId = orderId
  9271. return c
  9272. }
  9273. // Revoke sets the optional parameter "revoke": Whether to revoke the
  9274. // purchased item. If set to true, access to the subscription or in-app
  9275. // item will be terminated immediately. If the item is a recurring
  9276. // subscription, all future payments will also be terminated. Consumed
  9277. // in-app items need to be handled by developer's app. (optional)
  9278. func (c *OrdersRefundCall) Revoke(revoke bool) *OrdersRefundCall {
  9279. c.urlParams_.Set("revoke", fmt.Sprint(revoke))
  9280. return c
  9281. }
  9282. // Fields allows partial responses to be retrieved. See
  9283. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9284. // for more information.
  9285. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  9286. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9287. return c
  9288. }
  9289. // Context sets the context to be used in this call's Do method. Any
  9290. // pending HTTP request will be aborted if the provided context is
  9291. // canceled.
  9292. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  9293. c.ctx_ = ctx
  9294. return c
  9295. }
  9296. // Header returns an http.Header that can be modified by the caller to
  9297. // add HTTP headers to the request.
  9298. func (c *OrdersRefundCall) Header() http.Header {
  9299. if c.header_ == nil {
  9300. c.header_ = make(http.Header)
  9301. }
  9302. return c.header_
  9303. }
  9304. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  9305. reqHeaders := make(http.Header)
  9306. for k, v := range c.header_ {
  9307. reqHeaders[k] = v
  9308. }
  9309. reqHeaders.Set("User-Agent", c.s.userAgent())
  9310. var body io.Reader = nil
  9311. c.urlParams_.Set("alt", alt)
  9312. c.urlParams_.Set("prettyPrint", "false")
  9313. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/orders/{orderId}:refund")
  9314. urls += "?" + c.urlParams_.Encode()
  9315. req, err := http.NewRequest("POST", urls, body)
  9316. if err != nil {
  9317. return nil, err
  9318. }
  9319. req.Header = reqHeaders
  9320. googleapi.Expand(req.URL, map[string]string{
  9321. "packageName": c.packageName,
  9322. "orderId": c.orderId,
  9323. })
  9324. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9325. }
  9326. // Do executes the "androidpublisher.orders.refund" call.
  9327. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) error {
  9328. gensupport.SetOptions(c.urlParams_, opts...)
  9329. res, err := c.doRequest("json")
  9330. if err != nil {
  9331. return err
  9332. }
  9333. defer googleapi.CloseBody(res)
  9334. if err := googleapi.CheckResponse(res); err != nil {
  9335. return err
  9336. }
  9337. return nil
  9338. // {
  9339. // "description": "Refund a user's subscription or in-app purchase order.",
  9340. // "httpMethod": "POST",
  9341. // "id": "androidpublisher.orders.refund",
  9342. // "parameterOrder": [
  9343. // "packageName",
  9344. // "orderId"
  9345. // ],
  9346. // "parameters": {
  9347. // "orderId": {
  9348. // "description": "The order ID provided to the user when the subscription or in-app order was purchased.",
  9349. // "location": "path",
  9350. // "required": true,
  9351. // "type": "string"
  9352. // },
  9353. // "packageName": {
  9354. // "description": "The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing').",
  9355. // "location": "path",
  9356. // "required": true,
  9357. // "type": "string"
  9358. // },
  9359. // "revoke": {
  9360. // "description": "Whether to revoke the purchased item. If set to true, access to the subscription or in-app item will be terminated immediately. If the item is a recurring subscription, all future payments will also be terminated. Consumed in-app items need to be handled by developer's app. (optional)",
  9361. // "location": "query",
  9362. // "type": "boolean"
  9363. // }
  9364. // },
  9365. // "path": "{packageName}/orders/{orderId}:refund",
  9366. // "scopes": [
  9367. // "https://www.googleapis.com/auth/androidpublisher"
  9368. // ]
  9369. // }
  9370. }
  9371. // method id "androidpublisher.purchases.products.get":
  9372. type PurchasesProductsGetCall struct {
  9373. s *Service
  9374. packageName string
  9375. productId string
  9376. token string
  9377. urlParams_ gensupport.URLParams
  9378. ifNoneMatch_ string
  9379. ctx_ context.Context
  9380. header_ http.Header
  9381. }
  9382. // Get: Checks the purchase and consumption status of an inapp item.
  9383. func (r *PurchasesProductsService) Get(packageName string, productId string, token string) *PurchasesProductsGetCall {
  9384. c := &PurchasesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9385. c.packageName = packageName
  9386. c.productId = productId
  9387. c.token = token
  9388. return c
  9389. }
  9390. // Fields allows partial responses to be retrieved. See
  9391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9392. // for more information.
  9393. func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall {
  9394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9395. return c
  9396. }
  9397. // IfNoneMatch sets the optional parameter which makes the operation
  9398. // fail if the object's ETag matches the given value. This is useful for
  9399. // getting updates only after the object has changed since the last
  9400. // request. Use googleapi.IsNotModified to check whether the response
  9401. // error from Do is the result of In-None-Match.
  9402. func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall {
  9403. c.ifNoneMatch_ = entityTag
  9404. return c
  9405. }
  9406. // Context sets the context to be used in this call's Do method. Any
  9407. // pending HTTP request will be aborted if the provided context is
  9408. // canceled.
  9409. func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall {
  9410. c.ctx_ = ctx
  9411. return c
  9412. }
  9413. // Header returns an http.Header that can be modified by the caller to
  9414. // add HTTP headers to the request.
  9415. func (c *PurchasesProductsGetCall) Header() http.Header {
  9416. if c.header_ == nil {
  9417. c.header_ = make(http.Header)
  9418. }
  9419. return c.header_
  9420. }
  9421. func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) {
  9422. reqHeaders := make(http.Header)
  9423. for k, v := range c.header_ {
  9424. reqHeaders[k] = v
  9425. }
  9426. reqHeaders.Set("User-Agent", c.s.userAgent())
  9427. if c.ifNoneMatch_ != "" {
  9428. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9429. }
  9430. var body io.Reader = nil
  9431. c.urlParams_.Set("alt", alt)
  9432. c.urlParams_.Set("prettyPrint", "false")
  9433. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/products/{productId}/tokens/{token}")
  9434. urls += "?" + c.urlParams_.Encode()
  9435. req, err := http.NewRequest("GET", urls, body)
  9436. if err != nil {
  9437. return nil, err
  9438. }
  9439. req.Header = reqHeaders
  9440. googleapi.Expand(req.URL, map[string]string{
  9441. "packageName": c.packageName,
  9442. "productId": c.productId,
  9443. "token": c.token,
  9444. })
  9445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9446. }
  9447. // Do executes the "androidpublisher.purchases.products.get" call.
  9448. // Exactly one of *ProductPurchase or error will be non-nil. Any non-2xx
  9449. // status code is an error. Response headers are in either
  9450. // *ProductPurchase.ServerResponse.Header or (if a response was returned
  9451. // at all) in error.(*googleapi.Error).Header. Use
  9452. // googleapi.IsNotModified to check whether the returned error was
  9453. // because http.StatusNotModified was returned.
  9454. func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase, error) {
  9455. gensupport.SetOptions(c.urlParams_, opts...)
  9456. res, err := c.doRequest("json")
  9457. if res != nil && res.StatusCode == http.StatusNotModified {
  9458. if res.Body != nil {
  9459. res.Body.Close()
  9460. }
  9461. return nil, &googleapi.Error{
  9462. Code: res.StatusCode,
  9463. Header: res.Header,
  9464. }
  9465. }
  9466. if err != nil {
  9467. return nil, err
  9468. }
  9469. defer googleapi.CloseBody(res)
  9470. if err := googleapi.CheckResponse(res); err != nil {
  9471. return nil, err
  9472. }
  9473. ret := &ProductPurchase{
  9474. ServerResponse: googleapi.ServerResponse{
  9475. Header: res.Header,
  9476. HTTPStatusCode: res.StatusCode,
  9477. },
  9478. }
  9479. target := &ret
  9480. if err := gensupport.DecodeResponse(target, res); err != nil {
  9481. return nil, err
  9482. }
  9483. return ret, nil
  9484. // {
  9485. // "description": "Checks the purchase and consumption status of an inapp item.",
  9486. // "httpMethod": "GET",
  9487. // "id": "androidpublisher.purchases.products.get",
  9488. // "parameterOrder": [
  9489. // "packageName",
  9490. // "productId",
  9491. // "token"
  9492. // ],
  9493. // "parameters": {
  9494. // "packageName": {
  9495. // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').",
  9496. // "location": "path",
  9497. // "required": true,
  9498. // "type": "string"
  9499. // },
  9500. // "productId": {
  9501. // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').",
  9502. // "location": "path",
  9503. // "required": true,
  9504. // "type": "string"
  9505. // },
  9506. // "token": {
  9507. // "description": "The token provided to the user's device when the inapp product was purchased.",
  9508. // "location": "path",
  9509. // "required": true,
  9510. // "type": "string"
  9511. // }
  9512. // },
  9513. // "path": "{packageName}/purchases/products/{productId}/tokens/{token}",
  9514. // "response": {
  9515. // "$ref": "ProductPurchase"
  9516. // },
  9517. // "scopes": [
  9518. // "https://www.googleapis.com/auth/androidpublisher"
  9519. // ]
  9520. // }
  9521. }
  9522. // method id "androidpublisher.purchases.subscriptions.cancel":
  9523. type PurchasesSubscriptionsCancelCall struct {
  9524. s *Service
  9525. packageName string
  9526. subscriptionId string
  9527. token string
  9528. urlParams_ gensupport.URLParams
  9529. ctx_ context.Context
  9530. header_ http.Header
  9531. }
  9532. // Cancel: Cancels a user's subscription purchase. The subscription
  9533. // remains valid until its expiration time.
  9534. func (r *PurchasesSubscriptionsService) Cancel(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsCancelCall {
  9535. c := &PurchasesSubscriptionsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9536. c.packageName = packageName
  9537. c.subscriptionId = subscriptionId
  9538. c.token = token
  9539. return c
  9540. }
  9541. // Fields allows partial responses to be retrieved. See
  9542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9543. // for more information.
  9544. func (c *PurchasesSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsCancelCall {
  9545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9546. return c
  9547. }
  9548. // Context sets the context to be used in this call's Do method. Any
  9549. // pending HTTP request will be aborted if the provided context is
  9550. // canceled.
  9551. func (c *PurchasesSubscriptionsCancelCall) Context(ctx context.Context) *PurchasesSubscriptionsCancelCall {
  9552. c.ctx_ = ctx
  9553. return c
  9554. }
  9555. // Header returns an http.Header that can be modified by the caller to
  9556. // add HTTP headers to the request.
  9557. func (c *PurchasesSubscriptionsCancelCall) Header() http.Header {
  9558. if c.header_ == nil {
  9559. c.header_ = make(http.Header)
  9560. }
  9561. return c.header_
  9562. }
  9563. func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) {
  9564. reqHeaders := make(http.Header)
  9565. for k, v := range c.header_ {
  9566. reqHeaders[k] = v
  9567. }
  9568. reqHeaders.Set("User-Agent", c.s.userAgent())
  9569. var body io.Reader = nil
  9570. c.urlParams_.Set("alt", alt)
  9571. c.urlParams_.Set("prettyPrint", "false")
  9572. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel")
  9573. urls += "?" + c.urlParams_.Encode()
  9574. req, err := http.NewRequest("POST", urls, body)
  9575. if err != nil {
  9576. return nil, err
  9577. }
  9578. req.Header = reqHeaders
  9579. googleapi.Expand(req.URL, map[string]string{
  9580. "packageName": c.packageName,
  9581. "subscriptionId": c.subscriptionId,
  9582. "token": c.token,
  9583. })
  9584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9585. }
  9586. // Do executes the "androidpublisher.purchases.subscriptions.cancel" call.
  9587. func (c *PurchasesSubscriptionsCancelCall) Do(opts ...googleapi.CallOption) error {
  9588. gensupport.SetOptions(c.urlParams_, opts...)
  9589. res, err := c.doRequest("json")
  9590. if err != nil {
  9591. return err
  9592. }
  9593. defer googleapi.CloseBody(res)
  9594. if err := googleapi.CheckResponse(res); err != nil {
  9595. return err
  9596. }
  9597. return nil
  9598. // {
  9599. // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
  9600. // "httpMethod": "POST",
  9601. // "id": "androidpublisher.purchases.subscriptions.cancel",
  9602. // "parameterOrder": [
  9603. // "packageName",
  9604. // "subscriptionId",
  9605. // "token"
  9606. // ],
  9607. // "parameters": {
  9608. // "packageName": {
  9609. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9610. // "location": "path",
  9611. // "required": true,
  9612. // "type": "string"
  9613. // },
  9614. // "subscriptionId": {
  9615. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9616. // "location": "path",
  9617. // "required": true,
  9618. // "type": "string"
  9619. // },
  9620. // "token": {
  9621. // "description": "The token provided to the user's device when the subscription was purchased.",
  9622. // "location": "path",
  9623. // "required": true,
  9624. // "type": "string"
  9625. // }
  9626. // },
  9627. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel",
  9628. // "scopes": [
  9629. // "https://www.googleapis.com/auth/androidpublisher"
  9630. // ]
  9631. // }
  9632. }
  9633. // method id "androidpublisher.purchases.subscriptions.defer":
  9634. type PurchasesSubscriptionsDeferCall struct {
  9635. s *Service
  9636. packageName string
  9637. subscriptionId string
  9638. token string
  9639. subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest
  9640. urlParams_ gensupport.URLParams
  9641. ctx_ context.Context
  9642. header_ http.Header
  9643. }
  9644. // Defer: Defers a user's subscription purchase until a specified future
  9645. // expiration time.
  9646. func (r *PurchasesSubscriptionsService) Defer(packageName string, subscriptionId string, token string, subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest) *PurchasesSubscriptionsDeferCall {
  9647. c := &PurchasesSubscriptionsDeferCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9648. c.packageName = packageName
  9649. c.subscriptionId = subscriptionId
  9650. c.token = token
  9651. c.subscriptionpurchasesdeferrequest = subscriptionpurchasesdeferrequest
  9652. return c
  9653. }
  9654. // Fields allows partial responses to be retrieved. See
  9655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9656. // for more information.
  9657. func (c *PurchasesSubscriptionsDeferCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsDeferCall {
  9658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9659. return c
  9660. }
  9661. // Context sets the context to be used in this call's Do method. Any
  9662. // pending HTTP request will be aborted if the provided context is
  9663. // canceled.
  9664. func (c *PurchasesSubscriptionsDeferCall) Context(ctx context.Context) *PurchasesSubscriptionsDeferCall {
  9665. c.ctx_ = ctx
  9666. return c
  9667. }
  9668. // Header returns an http.Header that can be modified by the caller to
  9669. // add HTTP headers to the request.
  9670. func (c *PurchasesSubscriptionsDeferCall) Header() http.Header {
  9671. if c.header_ == nil {
  9672. c.header_ = make(http.Header)
  9673. }
  9674. return c.header_
  9675. }
  9676. func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) {
  9677. reqHeaders := make(http.Header)
  9678. for k, v := range c.header_ {
  9679. reqHeaders[k] = v
  9680. }
  9681. reqHeaders.Set("User-Agent", c.s.userAgent())
  9682. var body io.Reader = nil
  9683. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest)
  9684. if err != nil {
  9685. return nil, err
  9686. }
  9687. reqHeaders.Set("Content-Type", "application/json")
  9688. c.urlParams_.Set("alt", alt)
  9689. c.urlParams_.Set("prettyPrint", "false")
  9690. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer")
  9691. urls += "?" + c.urlParams_.Encode()
  9692. req, err := http.NewRequest("POST", urls, body)
  9693. if err != nil {
  9694. return nil, err
  9695. }
  9696. req.Header = reqHeaders
  9697. googleapi.Expand(req.URL, map[string]string{
  9698. "packageName": c.packageName,
  9699. "subscriptionId": c.subscriptionId,
  9700. "token": c.token,
  9701. })
  9702. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9703. }
  9704. // Do executes the "androidpublisher.purchases.subscriptions.defer" call.
  9705. // Exactly one of *SubscriptionPurchasesDeferResponse or error will be
  9706. // non-nil. Any non-2xx status code is an error. Response headers are in
  9707. // either *SubscriptionPurchasesDeferResponse.ServerResponse.Header or
  9708. // (if a response was returned at all) in
  9709. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9710. // whether the returned error was because http.StatusNotModified was
  9711. // returned.
  9712. func (c *PurchasesSubscriptionsDeferCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchasesDeferResponse, error) {
  9713. gensupport.SetOptions(c.urlParams_, opts...)
  9714. res, err := c.doRequest("json")
  9715. if res != nil && res.StatusCode == http.StatusNotModified {
  9716. if res.Body != nil {
  9717. res.Body.Close()
  9718. }
  9719. return nil, &googleapi.Error{
  9720. Code: res.StatusCode,
  9721. Header: res.Header,
  9722. }
  9723. }
  9724. if err != nil {
  9725. return nil, err
  9726. }
  9727. defer googleapi.CloseBody(res)
  9728. if err := googleapi.CheckResponse(res); err != nil {
  9729. return nil, err
  9730. }
  9731. ret := &SubscriptionPurchasesDeferResponse{
  9732. ServerResponse: googleapi.ServerResponse{
  9733. Header: res.Header,
  9734. HTTPStatusCode: res.StatusCode,
  9735. },
  9736. }
  9737. target := &ret
  9738. if err := gensupport.DecodeResponse(target, res); err != nil {
  9739. return nil, err
  9740. }
  9741. return ret, nil
  9742. // {
  9743. // "description": "Defers a user's subscription purchase until a specified future expiration time.",
  9744. // "httpMethod": "POST",
  9745. // "id": "androidpublisher.purchases.subscriptions.defer",
  9746. // "parameterOrder": [
  9747. // "packageName",
  9748. // "subscriptionId",
  9749. // "token"
  9750. // ],
  9751. // "parameters": {
  9752. // "packageName": {
  9753. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9754. // "location": "path",
  9755. // "required": true,
  9756. // "type": "string"
  9757. // },
  9758. // "subscriptionId": {
  9759. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9760. // "location": "path",
  9761. // "required": true,
  9762. // "type": "string"
  9763. // },
  9764. // "token": {
  9765. // "description": "The token provided to the user's device when the subscription was purchased.",
  9766. // "location": "path",
  9767. // "required": true,
  9768. // "type": "string"
  9769. // }
  9770. // },
  9771. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer",
  9772. // "request": {
  9773. // "$ref": "SubscriptionPurchasesDeferRequest"
  9774. // },
  9775. // "response": {
  9776. // "$ref": "SubscriptionPurchasesDeferResponse"
  9777. // },
  9778. // "scopes": [
  9779. // "https://www.googleapis.com/auth/androidpublisher"
  9780. // ]
  9781. // }
  9782. }
  9783. // method id "androidpublisher.purchases.subscriptions.get":
  9784. type PurchasesSubscriptionsGetCall struct {
  9785. s *Service
  9786. packageName string
  9787. subscriptionId string
  9788. token string
  9789. urlParams_ gensupport.URLParams
  9790. ifNoneMatch_ string
  9791. ctx_ context.Context
  9792. header_ http.Header
  9793. }
  9794. // Get: Checks whether a user's subscription purchase is valid and
  9795. // returns its expiry time.
  9796. func (r *PurchasesSubscriptionsService) Get(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsGetCall {
  9797. c := &PurchasesSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9798. c.packageName = packageName
  9799. c.subscriptionId = subscriptionId
  9800. c.token = token
  9801. return c
  9802. }
  9803. // Fields allows partial responses to be retrieved. See
  9804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9805. // for more information.
  9806. func (c *PurchasesSubscriptionsGetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsGetCall {
  9807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9808. return c
  9809. }
  9810. // IfNoneMatch sets the optional parameter which makes the operation
  9811. // fail if the object's ETag matches the given value. This is useful for
  9812. // getting updates only after the object has changed since the last
  9813. // request. Use googleapi.IsNotModified to check whether the response
  9814. // error from Do is the result of In-None-Match.
  9815. func (c *PurchasesSubscriptionsGetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsGetCall {
  9816. c.ifNoneMatch_ = entityTag
  9817. return c
  9818. }
  9819. // Context sets the context to be used in this call's Do method. Any
  9820. // pending HTTP request will be aborted if the provided context is
  9821. // canceled.
  9822. func (c *PurchasesSubscriptionsGetCall) Context(ctx context.Context) *PurchasesSubscriptionsGetCall {
  9823. c.ctx_ = ctx
  9824. return c
  9825. }
  9826. // Header returns an http.Header that can be modified by the caller to
  9827. // add HTTP headers to the request.
  9828. func (c *PurchasesSubscriptionsGetCall) Header() http.Header {
  9829. if c.header_ == nil {
  9830. c.header_ = make(http.Header)
  9831. }
  9832. return c.header_
  9833. }
  9834. func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  9835. reqHeaders := make(http.Header)
  9836. for k, v := range c.header_ {
  9837. reqHeaders[k] = v
  9838. }
  9839. reqHeaders.Set("User-Agent", c.s.userAgent())
  9840. if c.ifNoneMatch_ != "" {
  9841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9842. }
  9843. var body io.Reader = nil
  9844. c.urlParams_.Set("alt", alt)
  9845. c.urlParams_.Set("prettyPrint", "false")
  9846. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}")
  9847. urls += "?" + c.urlParams_.Encode()
  9848. req, err := http.NewRequest("GET", urls, body)
  9849. if err != nil {
  9850. return nil, err
  9851. }
  9852. req.Header = reqHeaders
  9853. googleapi.Expand(req.URL, map[string]string{
  9854. "packageName": c.packageName,
  9855. "subscriptionId": c.subscriptionId,
  9856. "token": c.token,
  9857. })
  9858. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9859. }
  9860. // Do executes the "androidpublisher.purchases.subscriptions.get" call.
  9861. // Exactly one of *SubscriptionPurchase or error will be non-nil. Any
  9862. // non-2xx status code is an error. Response headers are in either
  9863. // *SubscriptionPurchase.ServerResponse.Header or (if a response was
  9864. // returned at all) in error.(*googleapi.Error).Header. Use
  9865. // googleapi.IsNotModified to check whether the returned error was
  9866. // because http.StatusNotModified was returned.
  9867. func (c *PurchasesSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchase, error) {
  9868. gensupport.SetOptions(c.urlParams_, opts...)
  9869. res, err := c.doRequest("json")
  9870. if res != nil && res.StatusCode == http.StatusNotModified {
  9871. if res.Body != nil {
  9872. res.Body.Close()
  9873. }
  9874. return nil, &googleapi.Error{
  9875. Code: res.StatusCode,
  9876. Header: res.Header,
  9877. }
  9878. }
  9879. if err != nil {
  9880. return nil, err
  9881. }
  9882. defer googleapi.CloseBody(res)
  9883. if err := googleapi.CheckResponse(res); err != nil {
  9884. return nil, err
  9885. }
  9886. ret := &SubscriptionPurchase{
  9887. ServerResponse: googleapi.ServerResponse{
  9888. Header: res.Header,
  9889. HTTPStatusCode: res.StatusCode,
  9890. },
  9891. }
  9892. target := &ret
  9893. if err := gensupport.DecodeResponse(target, res); err != nil {
  9894. return nil, err
  9895. }
  9896. return ret, nil
  9897. // {
  9898. // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
  9899. // "httpMethod": "GET",
  9900. // "id": "androidpublisher.purchases.subscriptions.get",
  9901. // "parameterOrder": [
  9902. // "packageName",
  9903. // "subscriptionId",
  9904. // "token"
  9905. // ],
  9906. // "parameters": {
  9907. // "packageName": {
  9908. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9909. // "location": "path",
  9910. // "required": true,
  9911. // "type": "string"
  9912. // },
  9913. // "subscriptionId": {
  9914. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9915. // "location": "path",
  9916. // "required": true,
  9917. // "type": "string"
  9918. // },
  9919. // "token": {
  9920. // "description": "The token provided to the user's device when the subscription was purchased.",
  9921. // "location": "path",
  9922. // "required": true,
  9923. // "type": "string"
  9924. // }
  9925. // },
  9926. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}",
  9927. // "response": {
  9928. // "$ref": "SubscriptionPurchase"
  9929. // },
  9930. // "scopes": [
  9931. // "https://www.googleapis.com/auth/androidpublisher"
  9932. // ]
  9933. // }
  9934. }
  9935. // method id "androidpublisher.purchases.subscriptions.refund":
  9936. type PurchasesSubscriptionsRefundCall struct {
  9937. s *Service
  9938. packageName string
  9939. subscriptionId string
  9940. token string
  9941. urlParams_ gensupport.URLParams
  9942. ctx_ context.Context
  9943. header_ http.Header
  9944. }
  9945. // Refund: Refunds a user's subscription purchase, but the subscription
  9946. // remains valid until its expiration time and it will continue to
  9947. // recur.
  9948. func (r *PurchasesSubscriptionsService) Refund(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRefundCall {
  9949. c := &PurchasesSubscriptionsRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9950. c.packageName = packageName
  9951. c.subscriptionId = subscriptionId
  9952. c.token = token
  9953. return c
  9954. }
  9955. // Fields allows partial responses to be retrieved. See
  9956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9957. // for more information.
  9958. func (c *PurchasesSubscriptionsRefundCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRefundCall {
  9959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9960. return c
  9961. }
  9962. // Context sets the context to be used in this call's Do method. Any
  9963. // pending HTTP request will be aborted if the provided context is
  9964. // canceled.
  9965. func (c *PurchasesSubscriptionsRefundCall) Context(ctx context.Context) *PurchasesSubscriptionsRefundCall {
  9966. c.ctx_ = ctx
  9967. return c
  9968. }
  9969. // Header returns an http.Header that can be modified by the caller to
  9970. // add HTTP headers to the request.
  9971. func (c *PurchasesSubscriptionsRefundCall) Header() http.Header {
  9972. if c.header_ == nil {
  9973. c.header_ = make(http.Header)
  9974. }
  9975. return c.header_
  9976. }
  9977. func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) {
  9978. reqHeaders := make(http.Header)
  9979. for k, v := range c.header_ {
  9980. reqHeaders[k] = v
  9981. }
  9982. reqHeaders.Set("User-Agent", c.s.userAgent())
  9983. var body io.Reader = nil
  9984. c.urlParams_.Set("alt", alt)
  9985. c.urlParams_.Set("prettyPrint", "false")
  9986. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund")
  9987. urls += "?" + c.urlParams_.Encode()
  9988. req, err := http.NewRequest("POST", urls, body)
  9989. if err != nil {
  9990. return nil, err
  9991. }
  9992. req.Header = reqHeaders
  9993. googleapi.Expand(req.URL, map[string]string{
  9994. "packageName": c.packageName,
  9995. "subscriptionId": c.subscriptionId,
  9996. "token": c.token,
  9997. })
  9998. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9999. }
  10000. // Do executes the "androidpublisher.purchases.subscriptions.refund" call.
  10001. func (c *PurchasesSubscriptionsRefundCall) Do(opts ...googleapi.CallOption) error {
  10002. gensupport.SetOptions(c.urlParams_, opts...)
  10003. res, err := c.doRequest("json")
  10004. if err != nil {
  10005. return err
  10006. }
  10007. defer googleapi.CloseBody(res)
  10008. if err := googleapi.CheckResponse(res); err != nil {
  10009. return err
  10010. }
  10011. return nil
  10012. // {
  10013. // "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.",
  10014. // "httpMethod": "POST",
  10015. // "id": "androidpublisher.purchases.subscriptions.refund",
  10016. // "parameterOrder": [
  10017. // "packageName",
  10018. // "subscriptionId",
  10019. // "token"
  10020. // ],
  10021. // "parameters": {
  10022. // "packageName": {
  10023. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  10024. // "location": "path",
  10025. // "required": true,
  10026. // "type": "string"
  10027. // },
  10028. // "subscriptionId": {
  10029. // "description": "The purchased subscription ID (for example, 'monthly001').",
  10030. // "location": "path",
  10031. // "required": true,
  10032. // "type": "string"
  10033. // },
  10034. // "token": {
  10035. // "description": "The token provided to the user's device when the subscription was purchased.",
  10036. // "location": "path",
  10037. // "required": true,
  10038. // "type": "string"
  10039. // }
  10040. // },
  10041. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund",
  10042. // "scopes": [
  10043. // "https://www.googleapis.com/auth/androidpublisher"
  10044. // ]
  10045. // }
  10046. }
  10047. // method id "androidpublisher.purchases.subscriptions.revoke":
  10048. type PurchasesSubscriptionsRevokeCall struct {
  10049. s *Service
  10050. packageName string
  10051. subscriptionId string
  10052. token string
  10053. urlParams_ gensupport.URLParams
  10054. ctx_ context.Context
  10055. header_ http.Header
  10056. }
  10057. // Revoke: Refunds and immediately revokes a user's subscription
  10058. // purchase. Access to the subscription will be terminated immediately
  10059. // and it will stop recurring.
  10060. func (r *PurchasesSubscriptionsService) Revoke(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRevokeCall {
  10061. c := &PurchasesSubscriptionsRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10062. c.packageName = packageName
  10063. c.subscriptionId = subscriptionId
  10064. c.token = token
  10065. return c
  10066. }
  10067. // Fields allows partial responses to be retrieved. See
  10068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10069. // for more information.
  10070. func (c *PurchasesSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRevokeCall {
  10071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10072. return c
  10073. }
  10074. // Context sets the context to be used in this call's Do method. Any
  10075. // pending HTTP request will be aborted if the provided context is
  10076. // canceled.
  10077. func (c *PurchasesSubscriptionsRevokeCall) Context(ctx context.Context) *PurchasesSubscriptionsRevokeCall {
  10078. c.ctx_ = ctx
  10079. return c
  10080. }
  10081. // Header returns an http.Header that can be modified by the caller to
  10082. // add HTTP headers to the request.
  10083. func (c *PurchasesSubscriptionsRevokeCall) Header() http.Header {
  10084. if c.header_ == nil {
  10085. c.header_ = make(http.Header)
  10086. }
  10087. return c.header_
  10088. }
  10089. func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) {
  10090. reqHeaders := make(http.Header)
  10091. for k, v := range c.header_ {
  10092. reqHeaders[k] = v
  10093. }
  10094. reqHeaders.Set("User-Agent", c.s.userAgent())
  10095. var body io.Reader = nil
  10096. c.urlParams_.Set("alt", alt)
  10097. c.urlParams_.Set("prettyPrint", "false")
  10098. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke")
  10099. urls += "?" + c.urlParams_.Encode()
  10100. req, err := http.NewRequest("POST", urls, body)
  10101. if err != nil {
  10102. return nil, err
  10103. }
  10104. req.Header = reqHeaders
  10105. googleapi.Expand(req.URL, map[string]string{
  10106. "packageName": c.packageName,
  10107. "subscriptionId": c.subscriptionId,
  10108. "token": c.token,
  10109. })
  10110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10111. }
  10112. // Do executes the "androidpublisher.purchases.subscriptions.revoke" call.
  10113. func (c *PurchasesSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) error {
  10114. gensupport.SetOptions(c.urlParams_, opts...)
  10115. res, err := c.doRequest("json")
  10116. if err != nil {
  10117. return err
  10118. }
  10119. defer googleapi.CloseBody(res)
  10120. if err := googleapi.CheckResponse(res); err != nil {
  10121. return err
  10122. }
  10123. return nil
  10124. // {
  10125. // "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.",
  10126. // "httpMethod": "POST",
  10127. // "id": "androidpublisher.purchases.subscriptions.revoke",
  10128. // "parameterOrder": [
  10129. // "packageName",
  10130. // "subscriptionId",
  10131. // "token"
  10132. // ],
  10133. // "parameters": {
  10134. // "packageName": {
  10135. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  10136. // "location": "path",
  10137. // "required": true,
  10138. // "type": "string"
  10139. // },
  10140. // "subscriptionId": {
  10141. // "description": "The purchased subscription ID (for example, 'monthly001').",
  10142. // "location": "path",
  10143. // "required": true,
  10144. // "type": "string"
  10145. // },
  10146. // "token": {
  10147. // "description": "The token provided to the user's device when the subscription was purchased.",
  10148. // "location": "path",
  10149. // "required": true,
  10150. // "type": "string"
  10151. // }
  10152. // },
  10153. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke",
  10154. // "scopes": [
  10155. // "https://www.googleapis.com/auth/androidpublisher"
  10156. // ]
  10157. // }
  10158. }
  10159. // method id "androidpublisher.purchases.voidedpurchases.list":
  10160. type PurchasesVoidedpurchasesListCall struct {
  10161. s *Service
  10162. packageName string
  10163. urlParams_ gensupport.URLParams
  10164. ifNoneMatch_ string
  10165. ctx_ context.Context
  10166. header_ http.Header
  10167. }
  10168. // List: Lists the purchases that were canceled, refunded or
  10169. // charged-back.
  10170. func (r *PurchasesVoidedpurchasesService) List(packageName string) *PurchasesVoidedpurchasesListCall {
  10171. c := &PurchasesVoidedpurchasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10172. c.packageName = packageName
  10173. return c
  10174. }
  10175. // EndTime sets the optional parameter "endTime": The time, in
  10176. // milliseconds since the Epoch, of the newest voided in-app product
  10177. // purchase that you want to see in the response. The value of this
  10178. // parameter cannot be greater than the current time and is ignored if a
  10179. // pagination token is set. Default value is current time. Note: This
  10180. // filter is applied on the time at which the record is seen as voided
  10181. // by our systems and not the actual voided time returned in the
  10182. // response.
  10183. func (c *PurchasesVoidedpurchasesListCall) EndTime(endTime int64) *PurchasesVoidedpurchasesListCall {
  10184. c.urlParams_.Set("endTime", fmt.Sprint(endTime))
  10185. return c
  10186. }
  10187. // MaxResults sets the optional parameter "maxResults":
  10188. func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResults int64) *PurchasesVoidedpurchasesListCall {
  10189. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10190. return c
  10191. }
  10192. // StartIndex sets the optional parameter "startIndex":
  10193. func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndex int64) *PurchasesVoidedpurchasesListCall {
  10194. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  10195. return c
  10196. }
  10197. // StartTime sets the optional parameter "startTime": The time, in
  10198. // milliseconds since the Epoch, of the oldest voided in-app product
  10199. // purchase that you want to see in the response. The value of this
  10200. // parameter cannot be older than 30 days and is ignored if a pagination
  10201. // token is set. Default value is current time minus 30 days. Note: This
  10202. // filter is applied on the time at which the record is seen as voided
  10203. // by our systems and not the actual voided time returned in the
  10204. // response.
  10205. func (c *PurchasesVoidedpurchasesListCall) StartTime(startTime int64) *PurchasesVoidedpurchasesListCall {
  10206. c.urlParams_.Set("startTime", fmt.Sprint(startTime))
  10207. return c
  10208. }
  10209. // Token sets the optional parameter "token":
  10210. func (c *PurchasesVoidedpurchasesListCall) Token(token string) *PurchasesVoidedpurchasesListCall {
  10211. c.urlParams_.Set("token", token)
  10212. return c
  10213. }
  10214. // Fields allows partial responses to be retrieved. See
  10215. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10216. // for more information.
  10217. func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall {
  10218. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10219. return c
  10220. }
  10221. // IfNoneMatch sets the optional parameter which makes the operation
  10222. // fail if the object's ETag matches the given value. This is useful for
  10223. // getting updates only after the object has changed since the last
  10224. // request. Use googleapi.IsNotModified to check whether the response
  10225. // error from Do is the result of In-None-Match.
  10226. func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTag string) *PurchasesVoidedpurchasesListCall {
  10227. c.ifNoneMatch_ = entityTag
  10228. return c
  10229. }
  10230. // Context sets the context to be used in this call's Do method. Any
  10231. // pending HTTP request will be aborted if the provided context is
  10232. // canceled.
  10233. func (c *PurchasesVoidedpurchasesListCall) Context(ctx context.Context) *PurchasesVoidedpurchasesListCall {
  10234. c.ctx_ = ctx
  10235. return c
  10236. }
  10237. // Header returns an http.Header that can be modified by the caller to
  10238. // add HTTP headers to the request.
  10239. func (c *PurchasesVoidedpurchasesListCall) Header() http.Header {
  10240. if c.header_ == nil {
  10241. c.header_ = make(http.Header)
  10242. }
  10243. return c.header_
  10244. }
  10245. func (c *PurchasesVoidedpurchasesListCall) doRequest(alt string) (*http.Response, error) {
  10246. reqHeaders := make(http.Header)
  10247. for k, v := range c.header_ {
  10248. reqHeaders[k] = v
  10249. }
  10250. reqHeaders.Set("User-Agent", c.s.userAgent())
  10251. if c.ifNoneMatch_ != "" {
  10252. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10253. }
  10254. var body io.Reader = nil
  10255. c.urlParams_.Set("alt", alt)
  10256. c.urlParams_.Set("prettyPrint", "false")
  10257. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/voidedpurchases")
  10258. urls += "?" + c.urlParams_.Encode()
  10259. req, err := http.NewRequest("GET", urls, body)
  10260. if err != nil {
  10261. return nil, err
  10262. }
  10263. req.Header = reqHeaders
  10264. googleapi.Expand(req.URL, map[string]string{
  10265. "packageName": c.packageName,
  10266. })
  10267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10268. }
  10269. // Do executes the "androidpublisher.purchases.voidedpurchases.list" call.
  10270. // Exactly one of *VoidedPurchasesListResponse or error will be non-nil.
  10271. // Any non-2xx status code is an error. Response headers are in either
  10272. // *VoidedPurchasesListResponse.ServerResponse.Header or (if a response
  10273. // was returned at all) in error.(*googleapi.Error).Header. Use
  10274. // googleapi.IsNotModified to check whether the returned error was
  10275. // because http.StatusNotModified was returned.
  10276. func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse, error) {
  10277. gensupport.SetOptions(c.urlParams_, opts...)
  10278. res, err := c.doRequest("json")
  10279. if res != nil && res.StatusCode == http.StatusNotModified {
  10280. if res.Body != nil {
  10281. res.Body.Close()
  10282. }
  10283. return nil, &googleapi.Error{
  10284. Code: res.StatusCode,
  10285. Header: res.Header,
  10286. }
  10287. }
  10288. if err != nil {
  10289. return nil, err
  10290. }
  10291. defer googleapi.CloseBody(res)
  10292. if err := googleapi.CheckResponse(res); err != nil {
  10293. return nil, err
  10294. }
  10295. ret := &VoidedPurchasesListResponse{
  10296. ServerResponse: googleapi.ServerResponse{
  10297. Header: res.Header,
  10298. HTTPStatusCode: res.StatusCode,
  10299. },
  10300. }
  10301. target := &ret
  10302. if err := gensupport.DecodeResponse(target, res); err != nil {
  10303. return nil, err
  10304. }
  10305. return ret, nil
  10306. // {
  10307. // "description": "Lists the purchases that were canceled, refunded or charged-back.",
  10308. // "httpMethod": "GET",
  10309. // "id": "androidpublisher.purchases.voidedpurchases.list",
  10310. // "parameterOrder": [
  10311. // "packageName"
  10312. // ],
  10313. // "parameters": {
  10314. // "endTime": {
  10315. // "description": "The time, in milliseconds since the Epoch, of the newest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be greater than the current time and is ignored if a pagination token is set. Default value is current time. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.",
  10316. // "format": "int64",
  10317. // "location": "query",
  10318. // "type": "string"
  10319. // },
  10320. // "maxResults": {
  10321. // "format": "uint32",
  10322. // "location": "query",
  10323. // "type": "integer"
  10324. // },
  10325. // "packageName": {
  10326. // "description": "The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing').",
  10327. // "location": "path",
  10328. // "required": true,
  10329. // "type": "string"
  10330. // },
  10331. // "startIndex": {
  10332. // "format": "uint32",
  10333. // "location": "query",
  10334. // "type": "integer"
  10335. // },
  10336. // "startTime": {
  10337. // "description": "The time, in milliseconds since the Epoch, of the oldest voided in-app product purchase that you want to see in the response. The value of this parameter cannot be older than 30 days and is ignored if a pagination token is set. Default value is current time minus 30 days. Note: This filter is applied on the time at which the record is seen as voided by our systems and not the actual voided time returned in the response.",
  10338. // "format": "int64",
  10339. // "location": "query",
  10340. // "type": "string"
  10341. // },
  10342. // "token": {
  10343. // "location": "query",
  10344. // "type": "string"
  10345. // }
  10346. // },
  10347. // "path": "{packageName}/purchases/voidedpurchases",
  10348. // "response": {
  10349. // "$ref": "VoidedPurchasesListResponse"
  10350. // },
  10351. // "scopes": [
  10352. // "https://www.googleapis.com/auth/androidpublisher"
  10353. // ]
  10354. // }
  10355. }
  10356. // method id "androidpublisher.reviews.get":
  10357. type ReviewsGetCall struct {
  10358. s *Service
  10359. packageNameid string
  10360. reviewId string
  10361. urlParams_ gensupport.URLParams
  10362. ifNoneMatch_ string
  10363. ctx_ context.Context
  10364. header_ http.Header
  10365. }
  10366. // Get: Returns a single review.
  10367. func (r *ReviewsService) Get(packageNameid string, reviewId string) *ReviewsGetCall {
  10368. c := &ReviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10369. c.packageNameid = packageNameid
  10370. c.reviewId = reviewId
  10371. return c
  10372. }
  10373. // TranslationLanguage sets the optional parameter
  10374. // "translationLanguage":
  10375. func (c *ReviewsGetCall) TranslationLanguage(translationLanguage string) *ReviewsGetCall {
  10376. c.urlParams_.Set("translationLanguage", translationLanguage)
  10377. return c
  10378. }
  10379. // Fields allows partial responses to be retrieved. See
  10380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10381. // for more information.
  10382. func (c *ReviewsGetCall) Fields(s ...googleapi.Field) *ReviewsGetCall {
  10383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10384. return c
  10385. }
  10386. // IfNoneMatch sets the optional parameter which makes the operation
  10387. // fail if the object's ETag matches the given value. This is useful for
  10388. // getting updates only after the object has changed since the last
  10389. // request. Use googleapi.IsNotModified to check whether the response
  10390. // error from Do is the result of In-None-Match.
  10391. func (c *ReviewsGetCall) IfNoneMatch(entityTag string) *ReviewsGetCall {
  10392. c.ifNoneMatch_ = entityTag
  10393. return c
  10394. }
  10395. // Context sets the context to be used in this call's Do method. Any
  10396. // pending HTTP request will be aborted if the provided context is
  10397. // canceled.
  10398. func (c *ReviewsGetCall) Context(ctx context.Context) *ReviewsGetCall {
  10399. c.ctx_ = ctx
  10400. return c
  10401. }
  10402. // Header returns an http.Header that can be modified by the caller to
  10403. // add HTTP headers to the request.
  10404. func (c *ReviewsGetCall) Header() http.Header {
  10405. if c.header_ == nil {
  10406. c.header_ = make(http.Header)
  10407. }
  10408. return c.header_
  10409. }
  10410. func (c *ReviewsGetCall) doRequest(alt string) (*http.Response, error) {
  10411. reqHeaders := make(http.Header)
  10412. for k, v := range c.header_ {
  10413. reqHeaders[k] = v
  10414. }
  10415. reqHeaders.Set("User-Agent", c.s.userAgent())
  10416. if c.ifNoneMatch_ != "" {
  10417. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10418. }
  10419. var body io.Reader = nil
  10420. c.urlParams_.Set("alt", alt)
  10421. c.urlParams_.Set("prettyPrint", "false")
  10422. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}")
  10423. urls += "?" + c.urlParams_.Encode()
  10424. req, err := http.NewRequest("GET", urls, body)
  10425. if err != nil {
  10426. return nil, err
  10427. }
  10428. req.Header = reqHeaders
  10429. googleapi.Expand(req.URL, map[string]string{
  10430. "packageName": c.packageNameid,
  10431. "reviewId": c.reviewId,
  10432. })
  10433. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10434. }
  10435. // Do executes the "androidpublisher.reviews.get" call.
  10436. // Exactly one of *Review or error will be non-nil. Any non-2xx status
  10437. // code is an error. Response headers are in either
  10438. // *Review.ServerResponse.Header or (if a response was returned at all)
  10439. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10440. // check whether the returned error was because http.StatusNotModified
  10441. // was returned.
  10442. func (c *ReviewsGetCall) Do(opts ...googleapi.CallOption) (*Review, error) {
  10443. gensupport.SetOptions(c.urlParams_, opts...)
  10444. res, err := c.doRequest("json")
  10445. if res != nil && res.StatusCode == http.StatusNotModified {
  10446. if res.Body != nil {
  10447. res.Body.Close()
  10448. }
  10449. return nil, &googleapi.Error{
  10450. Code: res.StatusCode,
  10451. Header: res.Header,
  10452. }
  10453. }
  10454. if err != nil {
  10455. return nil, err
  10456. }
  10457. defer googleapi.CloseBody(res)
  10458. if err := googleapi.CheckResponse(res); err != nil {
  10459. return nil, err
  10460. }
  10461. ret := &Review{
  10462. ServerResponse: googleapi.ServerResponse{
  10463. Header: res.Header,
  10464. HTTPStatusCode: res.StatusCode,
  10465. },
  10466. }
  10467. target := &ret
  10468. if err := gensupport.DecodeResponse(target, res); err != nil {
  10469. return nil, err
  10470. }
  10471. return ret, nil
  10472. // {
  10473. // "description": "Returns a single review.",
  10474. // "httpMethod": "GET",
  10475. // "id": "androidpublisher.reviews.get",
  10476. // "parameterOrder": [
  10477. // "packageName",
  10478. // "reviewId"
  10479. // ],
  10480. // "parameters": {
  10481. // "packageName": {
  10482. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  10483. // "location": "path",
  10484. // "required": true,
  10485. // "type": "string"
  10486. // },
  10487. // "reviewId": {
  10488. // "location": "path",
  10489. // "required": true,
  10490. // "type": "string"
  10491. // },
  10492. // "translationLanguage": {
  10493. // "location": "query",
  10494. // "type": "string"
  10495. // }
  10496. // },
  10497. // "path": "{packageName}/reviews/{reviewId}",
  10498. // "response": {
  10499. // "$ref": "Review"
  10500. // },
  10501. // "scopes": [
  10502. // "https://www.googleapis.com/auth/androidpublisher"
  10503. // ]
  10504. // }
  10505. }
  10506. // method id "androidpublisher.reviews.list":
  10507. type ReviewsListCall struct {
  10508. s *Service
  10509. packageNameid string
  10510. urlParams_ gensupport.URLParams
  10511. ifNoneMatch_ string
  10512. ctx_ context.Context
  10513. header_ http.Header
  10514. }
  10515. // List: Returns a list of reviews. Only reviews from last week will be
  10516. // returned.
  10517. func (r *ReviewsService) List(packageNameid string) *ReviewsListCall {
  10518. c := &ReviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10519. c.packageNameid = packageNameid
  10520. return c
  10521. }
  10522. // MaxResults sets the optional parameter "maxResults":
  10523. func (c *ReviewsListCall) MaxResults(maxResults int64) *ReviewsListCall {
  10524. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10525. return c
  10526. }
  10527. // StartIndex sets the optional parameter "startIndex":
  10528. func (c *ReviewsListCall) StartIndex(startIndex int64) *ReviewsListCall {
  10529. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  10530. return c
  10531. }
  10532. // Token sets the optional parameter "token":
  10533. func (c *ReviewsListCall) Token(token string) *ReviewsListCall {
  10534. c.urlParams_.Set("token", token)
  10535. return c
  10536. }
  10537. // TranslationLanguage sets the optional parameter
  10538. // "translationLanguage":
  10539. func (c *ReviewsListCall) TranslationLanguage(translationLanguage string) *ReviewsListCall {
  10540. c.urlParams_.Set("translationLanguage", translationLanguage)
  10541. return c
  10542. }
  10543. // Fields allows partial responses to be retrieved. See
  10544. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10545. // for more information.
  10546. func (c *ReviewsListCall) Fields(s ...googleapi.Field) *ReviewsListCall {
  10547. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10548. return c
  10549. }
  10550. // IfNoneMatch sets the optional parameter which makes the operation
  10551. // fail if the object's ETag matches the given value. This is useful for
  10552. // getting updates only after the object has changed since the last
  10553. // request. Use googleapi.IsNotModified to check whether the response
  10554. // error from Do is the result of In-None-Match.
  10555. func (c *ReviewsListCall) IfNoneMatch(entityTag string) *ReviewsListCall {
  10556. c.ifNoneMatch_ = entityTag
  10557. return c
  10558. }
  10559. // Context sets the context to be used in this call's Do method. Any
  10560. // pending HTTP request will be aborted if the provided context is
  10561. // canceled.
  10562. func (c *ReviewsListCall) Context(ctx context.Context) *ReviewsListCall {
  10563. c.ctx_ = ctx
  10564. return c
  10565. }
  10566. // Header returns an http.Header that can be modified by the caller to
  10567. // add HTTP headers to the request.
  10568. func (c *ReviewsListCall) Header() http.Header {
  10569. if c.header_ == nil {
  10570. c.header_ = make(http.Header)
  10571. }
  10572. return c.header_
  10573. }
  10574. func (c *ReviewsListCall) doRequest(alt string) (*http.Response, error) {
  10575. reqHeaders := make(http.Header)
  10576. for k, v := range c.header_ {
  10577. reqHeaders[k] = v
  10578. }
  10579. reqHeaders.Set("User-Agent", c.s.userAgent())
  10580. if c.ifNoneMatch_ != "" {
  10581. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10582. }
  10583. var body io.Reader = nil
  10584. c.urlParams_.Set("alt", alt)
  10585. c.urlParams_.Set("prettyPrint", "false")
  10586. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews")
  10587. urls += "?" + c.urlParams_.Encode()
  10588. req, err := http.NewRequest("GET", urls, body)
  10589. if err != nil {
  10590. return nil, err
  10591. }
  10592. req.Header = reqHeaders
  10593. googleapi.Expand(req.URL, map[string]string{
  10594. "packageName": c.packageNameid,
  10595. })
  10596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10597. }
  10598. // Do executes the "androidpublisher.reviews.list" call.
  10599. // Exactly one of *ReviewsListResponse or error will be non-nil. Any
  10600. // non-2xx status code is an error. Response headers are in either
  10601. // *ReviewsListResponse.ServerResponse.Header or (if a response was
  10602. // returned at all) in error.(*googleapi.Error).Header. Use
  10603. // googleapi.IsNotModified to check whether the returned error was
  10604. // because http.StatusNotModified was returned.
  10605. func (c *ReviewsListCall) Do(opts ...googleapi.CallOption) (*ReviewsListResponse, error) {
  10606. gensupport.SetOptions(c.urlParams_, opts...)
  10607. res, err := c.doRequest("json")
  10608. if res != nil && res.StatusCode == http.StatusNotModified {
  10609. if res.Body != nil {
  10610. res.Body.Close()
  10611. }
  10612. return nil, &googleapi.Error{
  10613. Code: res.StatusCode,
  10614. Header: res.Header,
  10615. }
  10616. }
  10617. if err != nil {
  10618. return nil, err
  10619. }
  10620. defer googleapi.CloseBody(res)
  10621. if err := googleapi.CheckResponse(res); err != nil {
  10622. return nil, err
  10623. }
  10624. ret := &ReviewsListResponse{
  10625. ServerResponse: googleapi.ServerResponse{
  10626. Header: res.Header,
  10627. HTTPStatusCode: res.StatusCode,
  10628. },
  10629. }
  10630. target := &ret
  10631. if err := gensupport.DecodeResponse(target, res); err != nil {
  10632. return nil, err
  10633. }
  10634. return ret, nil
  10635. // {
  10636. // "description": "Returns a list of reviews. Only reviews from last week will be returned.",
  10637. // "httpMethod": "GET",
  10638. // "id": "androidpublisher.reviews.list",
  10639. // "parameterOrder": [
  10640. // "packageName"
  10641. // ],
  10642. // "parameters": {
  10643. // "maxResults": {
  10644. // "format": "uint32",
  10645. // "location": "query",
  10646. // "type": "integer"
  10647. // },
  10648. // "packageName": {
  10649. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  10650. // "location": "path",
  10651. // "required": true,
  10652. // "type": "string"
  10653. // },
  10654. // "startIndex": {
  10655. // "format": "uint32",
  10656. // "location": "query",
  10657. // "type": "integer"
  10658. // },
  10659. // "token": {
  10660. // "location": "query",
  10661. // "type": "string"
  10662. // },
  10663. // "translationLanguage": {
  10664. // "location": "query",
  10665. // "type": "string"
  10666. // }
  10667. // },
  10668. // "path": "{packageName}/reviews",
  10669. // "response": {
  10670. // "$ref": "ReviewsListResponse"
  10671. // },
  10672. // "scopes": [
  10673. // "https://www.googleapis.com/auth/androidpublisher"
  10674. // ]
  10675. // }
  10676. }
  10677. // method id "androidpublisher.reviews.reply":
  10678. type ReviewsReplyCall struct {
  10679. s *Service
  10680. packageNameid string
  10681. reviewId string
  10682. reviewsreplyrequest *ReviewsReplyRequest
  10683. urlParams_ gensupport.URLParams
  10684. ctx_ context.Context
  10685. header_ http.Header
  10686. }
  10687. // Reply: Reply to a single review, or update an existing reply.
  10688. func (r *ReviewsService) Reply(packageNameid string, reviewId string, reviewsreplyrequest *ReviewsReplyRequest) *ReviewsReplyCall {
  10689. c := &ReviewsReplyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10690. c.packageNameid = packageNameid
  10691. c.reviewId = reviewId
  10692. c.reviewsreplyrequest = reviewsreplyrequest
  10693. return c
  10694. }
  10695. // Fields allows partial responses to be retrieved. See
  10696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10697. // for more information.
  10698. func (c *ReviewsReplyCall) Fields(s ...googleapi.Field) *ReviewsReplyCall {
  10699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10700. return c
  10701. }
  10702. // Context sets the context to be used in this call's Do method. Any
  10703. // pending HTTP request will be aborted if the provided context is
  10704. // canceled.
  10705. func (c *ReviewsReplyCall) Context(ctx context.Context) *ReviewsReplyCall {
  10706. c.ctx_ = ctx
  10707. return c
  10708. }
  10709. // Header returns an http.Header that can be modified by the caller to
  10710. // add HTTP headers to the request.
  10711. func (c *ReviewsReplyCall) Header() http.Header {
  10712. if c.header_ == nil {
  10713. c.header_ = make(http.Header)
  10714. }
  10715. return c.header_
  10716. }
  10717. func (c *ReviewsReplyCall) doRequest(alt string) (*http.Response, error) {
  10718. reqHeaders := make(http.Header)
  10719. for k, v := range c.header_ {
  10720. reqHeaders[k] = v
  10721. }
  10722. reqHeaders.Set("User-Agent", c.s.userAgent())
  10723. var body io.Reader = nil
  10724. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reviewsreplyrequest)
  10725. if err != nil {
  10726. return nil, err
  10727. }
  10728. reqHeaders.Set("Content-Type", "application/json")
  10729. c.urlParams_.Set("alt", alt)
  10730. c.urlParams_.Set("prettyPrint", "false")
  10731. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}:reply")
  10732. urls += "?" + c.urlParams_.Encode()
  10733. req, err := http.NewRequest("POST", urls, body)
  10734. if err != nil {
  10735. return nil, err
  10736. }
  10737. req.Header = reqHeaders
  10738. googleapi.Expand(req.URL, map[string]string{
  10739. "packageName": c.packageNameid,
  10740. "reviewId": c.reviewId,
  10741. })
  10742. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10743. }
  10744. // Do executes the "androidpublisher.reviews.reply" call.
  10745. // Exactly one of *ReviewsReplyResponse or error will be non-nil. Any
  10746. // non-2xx status code is an error. Response headers are in either
  10747. // *ReviewsReplyResponse.ServerResponse.Header or (if a response was
  10748. // returned at all) in error.(*googleapi.Error).Header. Use
  10749. // googleapi.IsNotModified to check whether the returned error was
  10750. // because http.StatusNotModified was returned.
  10751. func (c *ReviewsReplyCall) Do(opts ...googleapi.CallOption) (*ReviewsReplyResponse, error) {
  10752. gensupport.SetOptions(c.urlParams_, opts...)
  10753. res, err := c.doRequest("json")
  10754. if res != nil && res.StatusCode == http.StatusNotModified {
  10755. if res.Body != nil {
  10756. res.Body.Close()
  10757. }
  10758. return nil, &googleapi.Error{
  10759. Code: res.StatusCode,
  10760. Header: res.Header,
  10761. }
  10762. }
  10763. if err != nil {
  10764. return nil, err
  10765. }
  10766. defer googleapi.CloseBody(res)
  10767. if err := googleapi.CheckResponse(res); err != nil {
  10768. return nil, err
  10769. }
  10770. ret := &ReviewsReplyResponse{
  10771. ServerResponse: googleapi.ServerResponse{
  10772. Header: res.Header,
  10773. HTTPStatusCode: res.StatusCode,
  10774. },
  10775. }
  10776. target := &ret
  10777. if err := gensupport.DecodeResponse(target, res); err != nil {
  10778. return nil, err
  10779. }
  10780. return ret, nil
  10781. // {
  10782. // "description": "Reply to a single review, or update an existing reply.",
  10783. // "httpMethod": "POST",
  10784. // "id": "androidpublisher.reviews.reply",
  10785. // "parameterOrder": [
  10786. // "packageName",
  10787. // "reviewId"
  10788. // ],
  10789. // "parameters": {
  10790. // "packageName": {
  10791. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  10792. // "location": "path",
  10793. // "required": true,
  10794. // "type": "string"
  10795. // },
  10796. // "reviewId": {
  10797. // "location": "path",
  10798. // "required": true,
  10799. // "type": "string"
  10800. // }
  10801. // },
  10802. // "path": "{packageName}/reviews/{reviewId}:reply",
  10803. // "request": {
  10804. // "$ref": "ReviewsReplyRequest"
  10805. // },
  10806. // "response": {
  10807. // "$ref": "ReviewsReplyResponse"
  10808. // },
  10809. // "scopes": [
  10810. // "https://www.googleapis.com/auth/androidpublisher"
  10811. // ]
  10812. // }
  10813. }