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

10897 lines
364 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/v3"
  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/v3"
  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:v3"
  67. const apiName = "androidpublisher"
  68. const apiVersion = "v3"
  69. const basePath = "https://www.googleapis.com/androidpublisher/v3/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.Apks = NewEditsApksService(s)
  131. rs.Bundles = NewEditsBundlesService(s)
  132. rs.Deobfuscationfiles = NewEditsDeobfuscationfilesService(s)
  133. rs.Details = NewEditsDetailsService(s)
  134. rs.Expansionfiles = NewEditsExpansionfilesService(s)
  135. rs.Images = NewEditsImagesService(s)
  136. rs.Listings = NewEditsListingsService(s)
  137. rs.Testers = NewEditsTestersService(s)
  138. rs.Tracks = NewEditsTracksService(s)
  139. return rs
  140. }
  141. type EditsService struct {
  142. s *Service
  143. Apks *EditsApksService
  144. Bundles *EditsBundlesService
  145. Deobfuscationfiles *EditsDeobfuscationfilesService
  146. Details *EditsDetailsService
  147. Expansionfiles *EditsExpansionfilesService
  148. Images *EditsImagesService
  149. Listings *EditsListingsService
  150. Testers *EditsTestersService
  151. Tracks *EditsTracksService
  152. }
  153. func NewEditsApksService(s *Service) *EditsApksService {
  154. rs := &EditsApksService{s: s}
  155. return rs
  156. }
  157. type EditsApksService struct {
  158. s *Service
  159. }
  160. func NewEditsBundlesService(s *Service) *EditsBundlesService {
  161. rs := &EditsBundlesService{s: s}
  162. return rs
  163. }
  164. type EditsBundlesService struct {
  165. s *Service
  166. }
  167. func NewEditsDeobfuscationfilesService(s *Service) *EditsDeobfuscationfilesService {
  168. rs := &EditsDeobfuscationfilesService{s: s}
  169. return rs
  170. }
  171. type EditsDeobfuscationfilesService struct {
  172. s *Service
  173. }
  174. func NewEditsDetailsService(s *Service) *EditsDetailsService {
  175. rs := &EditsDetailsService{s: s}
  176. return rs
  177. }
  178. type EditsDetailsService struct {
  179. s *Service
  180. }
  181. func NewEditsExpansionfilesService(s *Service) *EditsExpansionfilesService {
  182. rs := &EditsExpansionfilesService{s: s}
  183. return rs
  184. }
  185. type EditsExpansionfilesService struct {
  186. s *Service
  187. }
  188. func NewEditsImagesService(s *Service) *EditsImagesService {
  189. rs := &EditsImagesService{s: s}
  190. return rs
  191. }
  192. type EditsImagesService struct {
  193. s *Service
  194. }
  195. func NewEditsListingsService(s *Service) *EditsListingsService {
  196. rs := &EditsListingsService{s: s}
  197. return rs
  198. }
  199. type EditsListingsService struct {
  200. s *Service
  201. }
  202. func NewEditsTestersService(s *Service) *EditsTestersService {
  203. rs := &EditsTestersService{s: s}
  204. return rs
  205. }
  206. type EditsTestersService struct {
  207. s *Service
  208. }
  209. func NewEditsTracksService(s *Service) *EditsTracksService {
  210. rs := &EditsTracksService{s: s}
  211. return rs
  212. }
  213. type EditsTracksService struct {
  214. s *Service
  215. }
  216. func NewInappproductsService(s *Service) *InappproductsService {
  217. rs := &InappproductsService{s: s}
  218. return rs
  219. }
  220. type InappproductsService struct {
  221. s *Service
  222. }
  223. func NewOrdersService(s *Service) *OrdersService {
  224. rs := &OrdersService{s: s}
  225. return rs
  226. }
  227. type OrdersService struct {
  228. s *Service
  229. }
  230. func NewPurchasesService(s *Service) *PurchasesService {
  231. rs := &PurchasesService{s: s}
  232. rs.Products = NewPurchasesProductsService(s)
  233. rs.Subscriptions = NewPurchasesSubscriptionsService(s)
  234. rs.Voidedpurchases = NewPurchasesVoidedpurchasesService(s)
  235. return rs
  236. }
  237. type PurchasesService struct {
  238. s *Service
  239. Products *PurchasesProductsService
  240. Subscriptions *PurchasesSubscriptionsService
  241. Voidedpurchases *PurchasesVoidedpurchasesService
  242. }
  243. func NewPurchasesProductsService(s *Service) *PurchasesProductsService {
  244. rs := &PurchasesProductsService{s: s}
  245. return rs
  246. }
  247. type PurchasesProductsService struct {
  248. s *Service
  249. }
  250. func NewPurchasesSubscriptionsService(s *Service) *PurchasesSubscriptionsService {
  251. rs := &PurchasesSubscriptionsService{s: s}
  252. return rs
  253. }
  254. type PurchasesSubscriptionsService struct {
  255. s *Service
  256. }
  257. func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService {
  258. rs := &PurchasesVoidedpurchasesService{s: s}
  259. return rs
  260. }
  261. type PurchasesVoidedpurchasesService struct {
  262. s *Service
  263. }
  264. func NewReviewsService(s *Service) *ReviewsService {
  265. rs := &ReviewsService{s: s}
  266. return rs
  267. }
  268. type ReviewsService struct {
  269. s *Service
  270. }
  271. type Apk struct {
  272. // Binary: Information about the binary payload of this APK.
  273. Binary *ApkBinary `json:"binary,omitempty"`
  274. // VersionCode: The version code of the APK, as specified in the APK's
  275. // manifest file.
  276. VersionCode int64 `json:"versionCode,omitempty"`
  277. // ServerResponse contains the HTTP response code and headers from the
  278. // server.
  279. googleapi.ServerResponse `json:"-"`
  280. // ForceSendFields is a list of field names (e.g. "Binary") to
  281. // unconditionally include in API requests. By default, fields with
  282. // empty values are omitted from API requests. However, any non-pointer,
  283. // non-interface field appearing in ForceSendFields will be sent to the
  284. // server regardless of whether the field is empty or not. This may be
  285. // used to include empty fields in Patch requests.
  286. ForceSendFields []string `json:"-"`
  287. // NullFields is a list of field names (e.g. "Binary") to include in API
  288. // requests with the JSON null value. By default, fields with empty
  289. // values are omitted from API requests. However, any field with an
  290. // empty value appearing in NullFields will be sent to the server as
  291. // null. It is an error if a field in this list has a non-empty value.
  292. // This may be used to include null fields in Patch requests.
  293. NullFields []string `json:"-"`
  294. }
  295. func (s *Apk) MarshalJSON() ([]byte, error) {
  296. type NoMethod Apk
  297. raw := NoMethod(*s)
  298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  299. }
  300. // ApkBinary: Represents the binary payload of an APK.
  301. type ApkBinary struct {
  302. // Sha1: A sha1 hash of the APK payload, encoded as a hex string and
  303. // matching the output of the sha1sum command.
  304. Sha1 string `json:"sha1,omitempty"`
  305. // Sha256: A sha256 hash of the APK payload, encoded as a hex string and
  306. // matching the output of the sha256sum command.
  307. Sha256 string `json:"sha256,omitempty"`
  308. // ForceSendFields is a list of field names (e.g. "Sha1") to
  309. // unconditionally include in API requests. By default, fields with
  310. // empty values are omitted from API requests. However, any non-pointer,
  311. // non-interface field appearing in ForceSendFields will be sent to the
  312. // server regardless of whether the field is empty or not. This may be
  313. // used to include empty fields in Patch requests.
  314. ForceSendFields []string `json:"-"`
  315. // NullFields is a list of field names (e.g. "Sha1") to include in API
  316. // requests with the JSON null value. By default, fields with empty
  317. // values are omitted from API requests. However, any field with an
  318. // empty value appearing in NullFields will be sent to the server as
  319. // null. It is an error if a field in this list has a non-empty value.
  320. // This may be used to include null fields in Patch requests.
  321. NullFields []string `json:"-"`
  322. }
  323. func (s *ApkBinary) MarshalJSON() ([]byte, error) {
  324. type NoMethod ApkBinary
  325. raw := NoMethod(*s)
  326. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  327. }
  328. type ApksAddExternallyHostedRequest struct {
  329. // ExternallyHostedApk: The definition of the externally-hosted APK and
  330. // where it is located.
  331. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  332. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  333. // to unconditionally include in API requests. By default, fields with
  334. // empty values are omitted from API requests. However, any non-pointer,
  335. // non-interface field appearing in ForceSendFields will be sent to the
  336. // server regardless of whether the field is empty or not. This may be
  337. // used to include empty fields in Patch requests.
  338. ForceSendFields []string `json:"-"`
  339. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  340. // include in API requests with the JSON null value. By default, fields
  341. // with empty values are omitted from API requests. However, any field
  342. // with an empty value appearing in NullFields will be sent to the
  343. // server as null. It is an error if a field in this list has a
  344. // non-empty value. This may be used to include null fields in Patch
  345. // requests.
  346. NullFields []string `json:"-"`
  347. }
  348. func (s *ApksAddExternallyHostedRequest) MarshalJSON() ([]byte, error) {
  349. type NoMethod ApksAddExternallyHostedRequest
  350. raw := NoMethod(*s)
  351. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  352. }
  353. type ApksAddExternallyHostedResponse struct {
  354. // ExternallyHostedApk: The definition of the externally-hosted APK and
  355. // where it is located.
  356. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  357. // ServerResponse contains the HTTP response code and headers from the
  358. // server.
  359. googleapi.ServerResponse `json:"-"`
  360. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  361. // to unconditionally include in API requests. By default, fields with
  362. // empty values are omitted from API requests. However, any non-pointer,
  363. // non-interface field appearing in ForceSendFields will be sent to the
  364. // server regardless of whether the field is empty or not. This may be
  365. // used to include empty fields in Patch requests.
  366. ForceSendFields []string `json:"-"`
  367. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  368. // include in API requests with the JSON null value. By default, fields
  369. // with empty values are omitted from API requests. However, any field
  370. // with an empty value appearing in NullFields will be sent to the
  371. // server as null. It is an error if a field in this list has a
  372. // non-empty value. This may be used to include null fields in Patch
  373. // requests.
  374. NullFields []string `json:"-"`
  375. }
  376. func (s *ApksAddExternallyHostedResponse) MarshalJSON() ([]byte, error) {
  377. type NoMethod ApksAddExternallyHostedResponse
  378. raw := NoMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  380. }
  381. type ApksListResponse struct {
  382. Apks []*Apk `json:"apks,omitempty"`
  383. // Kind: Identifies what kind of resource this is. Value: the fixed
  384. // string "androidpublisher#apksListResponse".
  385. Kind string `json:"kind,omitempty"`
  386. // ServerResponse contains the HTTP response code and headers from the
  387. // server.
  388. googleapi.ServerResponse `json:"-"`
  389. // ForceSendFields is a list of field names (e.g. "Apks") to
  390. // unconditionally include in API requests. By default, fields with
  391. // empty values are omitted from API requests. However, any non-pointer,
  392. // non-interface field appearing in ForceSendFields will be sent to the
  393. // server regardless of whether the field is empty or not. This may be
  394. // used to include empty fields in Patch requests.
  395. ForceSendFields []string `json:"-"`
  396. // NullFields is a list of field names (e.g. "Apks") to include in API
  397. // requests with the JSON null value. By default, fields with empty
  398. // values are omitted from API requests. However, any field with an
  399. // empty value appearing in NullFields will be sent to the server as
  400. // null. It is an error if a field in this list has a non-empty value.
  401. // This may be used to include null fields in Patch requests.
  402. NullFields []string `json:"-"`
  403. }
  404. func (s *ApksListResponse) MarshalJSON() ([]byte, error) {
  405. type NoMethod ApksListResponse
  406. raw := NoMethod(*s)
  407. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  408. }
  409. type AppDetails struct {
  410. // ContactEmail: The user-visible support email for this app.
  411. ContactEmail string `json:"contactEmail,omitempty"`
  412. // ContactPhone: The user-visible support telephone number for this app.
  413. ContactPhone string `json:"contactPhone,omitempty"`
  414. // ContactWebsite: The user-visible website for this app.
  415. ContactWebsite string `json:"contactWebsite,omitempty"`
  416. // DefaultLanguage: Default language code, in BCP 47 format (eg
  417. // "en-US").
  418. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  419. // ServerResponse contains the HTTP response code and headers from the
  420. // server.
  421. googleapi.ServerResponse `json:"-"`
  422. // ForceSendFields is a list of field names (e.g. "ContactEmail") to
  423. // unconditionally include in API requests. By default, fields with
  424. // empty values are omitted from API requests. However, any non-pointer,
  425. // non-interface field appearing in ForceSendFields will be sent to the
  426. // server regardless of whether the field is empty or not. This may be
  427. // used to include empty fields in Patch requests.
  428. ForceSendFields []string `json:"-"`
  429. // NullFields is a list of field names (e.g. "ContactEmail") to include
  430. // in API requests with the JSON null value. By default, fields with
  431. // empty values are omitted from API requests. However, any field with
  432. // an empty value appearing in NullFields will be sent to the server as
  433. // null. It is an error if a field in this list has a non-empty value.
  434. // This may be used to include null fields in Patch requests.
  435. NullFields []string `json:"-"`
  436. }
  437. func (s *AppDetails) MarshalJSON() ([]byte, error) {
  438. type NoMethod AppDetails
  439. raw := NoMethod(*s)
  440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  441. }
  442. // AppEdit: Represents an edit of an app. An edit allows clients to make
  443. // multiple changes before committing them in one operation.
  444. type AppEdit struct {
  445. // ExpiryTimeSeconds: The time at which the edit will expire and will be
  446. // no longer valid for use in any subsequent API calls (encoded as
  447. // seconds since the Epoch).
  448. ExpiryTimeSeconds string `json:"expiryTimeSeconds,omitempty"`
  449. // Id: The ID of the edit that can be used in subsequent API calls.
  450. Id string `json:"id,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. "ExpiryTimeSeconds")
  455. // to 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. "ExpiryTimeSeconds") to
  462. // include in API requests with the JSON null value. By default, fields
  463. // with empty values are omitted from API requests. However, any field
  464. // with an empty value appearing in NullFields will be sent to the
  465. // server as null. It is an error if a field in this list has a
  466. // non-empty value. This may be used to include null fields in Patch
  467. // requests.
  468. NullFields []string `json:"-"`
  469. }
  470. func (s *AppEdit) MarshalJSON() ([]byte, error) {
  471. type NoMethod AppEdit
  472. raw := NoMethod(*s)
  473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  474. }
  475. type Bundle struct {
  476. // Sha1: A sha1 hash of the upload payload, encoded as a hex string and
  477. // matching the output of the sha1sum command.
  478. Sha1 string `json:"sha1,omitempty"`
  479. // Sha256: A sha256 hash of the upload payload, encoded as a hex string
  480. // and matching the output of the sha256sum command.
  481. Sha256 string `json:"sha256,omitempty"`
  482. // VersionCode: The version code of the Android App Bundle. As specified
  483. // in the Android App Bundle's base module APK manifest file.
  484. VersionCode int64 `json:"versionCode,omitempty"`
  485. // ServerResponse contains the HTTP response code and headers from the
  486. // server.
  487. googleapi.ServerResponse `json:"-"`
  488. // ForceSendFields is a list of field names (e.g. "Sha1") to
  489. // unconditionally include in API requests. By default, fields with
  490. // empty values are omitted from API requests. However, any non-pointer,
  491. // non-interface field appearing in ForceSendFields will be sent to the
  492. // server regardless of whether the field is empty or not. This may be
  493. // used to include empty fields in Patch requests.
  494. ForceSendFields []string `json:"-"`
  495. // NullFields is a list of field names (e.g. "Sha1") to include in API
  496. // requests with the JSON null value. By default, fields with empty
  497. // values are omitted from API requests. However, any field with an
  498. // empty value appearing in NullFields will be sent to the server as
  499. // null. It is an error if a field in this list has a non-empty value.
  500. // This may be used to include null fields in Patch requests.
  501. NullFields []string `json:"-"`
  502. }
  503. func (s *Bundle) MarshalJSON() ([]byte, error) {
  504. type NoMethod Bundle
  505. raw := NoMethod(*s)
  506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  507. }
  508. type BundlesListResponse struct {
  509. Bundles []*Bundle `json:"bundles,omitempty"`
  510. // Kind: Identifies what kind of resource this is. Value: the fixed
  511. // string "androidpublisher#bundlesListResponse".
  512. Kind string `json:"kind,omitempty"`
  513. // ServerResponse contains the HTTP response code and headers from the
  514. // server.
  515. googleapi.ServerResponse `json:"-"`
  516. // ForceSendFields is a list of field names (e.g. "Bundles") to
  517. // unconditionally include in API requests. By default, fields with
  518. // empty values are omitted from API requests. However, any non-pointer,
  519. // non-interface field appearing in ForceSendFields will be sent to the
  520. // server regardless of whether the field is empty or not. This may be
  521. // used to include empty fields in Patch requests.
  522. ForceSendFields []string `json:"-"`
  523. // NullFields is a list of field names (e.g. "Bundles") to include in
  524. // API requests with the JSON null value. By default, fields with empty
  525. // values are omitted from API requests. However, any field with an
  526. // empty value appearing in NullFields will be sent to the server as
  527. // null. It is an error if a field in this list has a non-empty value.
  528. // This may be used to include null fields in Patch requests.
  529. NullFields []string `json:"-"`
  530. }
  531. func (s *BundlesListResponse) MarshalJSON() ([]byte, error) {
  532. type NoMethod BundlesListResponse
  533. raw := NoMethod(*s)
  534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  535. }
  536. type Comment struct {
  537. // DeveloperComment: A comment from a developer.
  538. DeveloperComment *DeveloperComment `json:"developerComment,omitempty"`
  539. // UserComment: A comment from a user.
  540. UserComment *UserComment `json:"userComment,omitempty"`
  541. // ForceSendFields is a list of field names (e.g. "DeveloperComment") to
  542. // unconditionally include in API requests. By default, fields with
  543. // empty values are omitted from API requests. However, any non-pointer,
  544. // non-interface field appearing in ForceSendFields will be sent to the
  545. // server regardless of whether the field is empty or not. This may be
  546. // used to include empty fields in Patch requests.
  547. ForceSendFields []string `json:"-"`
  548. // NullFields is a list of field names (e.g. "DeveloperComment") to
  549. // include in API requests with the JSON null value. By default, fields
  550. // with empty values are omitted from API requests. However, any field
  551. // with an empty value appearing in NullFields will be sent to the
  552. // server as null. It is an error if a field in this list has a
  553. // non-empty value. This may be used to include null fields in Patch
  554. // requests.
  555. NullFields []string `json:"-"`
  556. }
  557. func (s *Comment) MarshalJSON() ([]byte, error) {
  558. type NoMethod Comment
  559. raw := NoMethod(*s)
  560. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  561. }
  562. // DeobfuscationFile: Represents a deobfuscation file.
  563. type DeobfuscationFile struct {
  564. // SymbolType: The type of the deobfuscation file.
  565. SymbolType string `json:"symbolType,omitempty"`
  566. // ForceSendFields is a list of field names (e.g. "SymbolType") to
  567. // unconditionally include in API requests. By default, fields with
  568. // empty values are omitted from API requests. However, any non-pointer,
  569. // non-interface field appearing in ForceSendFields will be sent to the
  570. // server regardless of whether the field is empty or not. This may be
  571. // used to include empty fields in Patch requests.
  572. ForceSendFields []string `json:"-"`
  573. // NullFields is a list of field names (e.g. "SymbolType") to include in
  574. // API requests with the JSON null value. By default, fields with empty
  575. // values are omitted from API requests. However, any field with an
  576. // empty value appearing in NullFields will be sent to the server as
  577. // null. It is an error if a field in this list has a non-empty value.
  578. // This may be used to include null fields in Patch requests.
  579. NullFields []string `json:"-"`
  580. }
  581. func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) {
  582. type NoMethod DeobfuscationFile
  583. raw := NoMethod(*s)
  584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  585. }
  586. type DeobfuscationFilesUploadResponse struct {
  587. DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"`
  588. // ServerResponse contains the HTTP response code and headers from the
  589. // server.
  590. googleapi.ServerResponse `json:"-"`
  591. // ForceSendFields is a list of field names (e.g. "DeobfuscationFile")
  592. // to unconditionally include in API requests. By default, fields with
  593. // empty values are omitted from API requests. However, any non-pointer,
  594. // non-interface field appearing in ForceSendFields will be sent to the
  595. // server regardless of whether the field is empty or not. This may be
  596. // used to include empty fields in Patch requests.
  597. ForceSendFields []string `json:"-"`
  598. // NullFields is a list of field names (e.g. "DeobfuscationFile") to
  599. // include in API requests with the JSON null value. By default, fields
  600. // with empty values are omitted from API requests. However, any field
  601. // with an empty value appearing in NullFields will be sent to the
  602. // server as null. It is an error if a field in this list has a
  603. // non-empty value. This may be used to include null fields in Patch
  604. // requests.
  605. NullFields []string `json:"-"`
  606. }
  607. func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) {
  608. type NoMethod DeobfuscationFilesUploadResponse
  609. raw := NoMethod(*s)
  610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  611. }
  612. type DeveloperComment struct {
  613. // LastModified: The last time at which this comment was updated.
  614. LastModified *Timestamp `json:"lastModified,omitempty"`
  615. // Text: The content of the comment, i.e. reply body.
  616. Text string `json:"text,omitempty"`
  617. // ForceSendFields is a list of field names (e.g. "LastModified") to
  618. // unconditionally include in API requests. By default, fields with
  619. // empty values are omitted from API requests. However, any non-pointer,
  620. // non-interface field appearing in ForceSendFields will be sent to the
  621. // server regardless of whether the field is empty or not. This may be
  622. // used to include empty fields in Patch requests.
  623. ForceSendFields []string `json:"-"`
  624. // NullFields is a list of field names (e.g. "LastModified") to include
  625. // in API requests with the JSON null value. By default, fields with
  626. // empty values are omitted from API requests. However, any field with
  627. // an empty value appearing in NullFields will be sent to the server as
  628. // null. It is an error if a field in this list has a non-empty value.
  629. // This may be used to include null fields in Patch requests.
  630. NullFields []string `json:"-"`
  631. }
  632. func (s *DeveloperComment) MarshalJSON() ([]byte, error) {
  633. type NoMethod DeveloperComment
  634. raw := NoMethod(*s)
  635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  636. }
  637. type DeviceMetadata struct {
  638. // CpuMake: Device CPU make e.g. "Qualcomm"
  639. CpuMake string `json:"cpuMake,omitempty"`
  640. // CpuModel: Device CPU model e.g. "MSM8974"
  641. CpuModel string `json:"cpuModel,omitempty"`
  642. // DeviceClass: Device class (e.g. tablet)
  643. DeviceClass string `json:"deviceClass,omitempty"`
  644. // GlEsVersion: OpenGL version
  645. GlEsVersion int64 `json:"glEsVersion,omitempty"`
  646. // Manufacturer: Device manufacturer (e.g. Motorola)
  647. Manufacturer string `json:"manufacturer,omitempty"`
  648. // NativePlatform: Comma separated list of native platforms (e.g. "arm",
  649. // "arm7")
  650. NativePlatform string `json:"nativePlatform,omitempty"`
  651. // ProductName: Device model name (e.g. Droid)
  652. ProductName string `json:"productName,omitempty"`
  653. // RamMb: Device RAM in Megabytes e.g. "2048"
  654. RamMb int64 `json:"ramMb,omitempty"`
  655. // ScreenDensityDpi: Screen density in DPI
  656. ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"`
  657. // ScreenHeightPx: Screen height in pixels
  658. ScreenHeightPx int64 `json:"screenHeightPx,omitempty"`
  659. // ScreenWidthPx: Screen width in pixels
  660. ScreenWidthPx int64 `json:"screenWidthPx,omitempty"`
  661. // ForceSendFields is a list of field names (e.g. "CpuMake") to
  662. // unconditionally include in API requests. By default, fields with
  663. // empty values are omitted from API requests. However, any non-pointer,
  664. // non-interface field appearing in ForceSendFields will be sent to the
  665. // server regardless of whether the field is empty or not. This may be
  666. // used to include empty fields in Patch requests.
  667. ForceSendFields []string `json:"-"`
  668. // NullFields is a list of field names (e.g. "CpuMake") to include in
  669. // API requests with the JSON null value. By default, fields with empty
  670. // values are omitted from API requests. However, any field with an
  671. // empty value appearing in NullFields will be sent to the server as
  672. // null. It is an error if a field in this list has a non-empty value.
  673. // This may be used to include null fields in Patch requests.
  674. NullFields []string `json:"-"`
  675. }
  676. func (s *DeviceMetadata) MarshalJSON() ([]byte, error) {
  677. type NoMethod DeviceMetadata
  678. raw := NoMethod(*s)
  679. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  680. }
  681. type ExpansionFile struct {
  682. // FileSize: If set this field indicates that this APK has an Expansion
  683. // File uploaded to it: this APK does not reference another APK's
  684. // Expansion File. The field's value is the size of the uploaded
  685. // Expansion File in bytes.
  686. FileSize int64 `json:"fileSize,omitempty,string"`
  687. // ReferencesVersion: If set this APK's Expansion File references
  688. // another APK's Expansion File. The file_size field will not be set.
  689. ReferencesVersion int64 `json:"referencesVersion,omitempty"`
  690. // ServerResponse contains the HTTP response code and headers from the
  691. // server.
  692. googleapi.ServerResponse `json:"-"`
  693. // ForceSendFields is a list of field names (e.g. "FileSize") to
  694. // unconditionally include in API requests. By default, fields with
  695. // empty values are omitted from API requests. However, any non-pointer,
  696. // non-interface field appearing in ForceSendFields will be sent to the
  697. // server regardless of whether the field is empty or not. This may be
  698. // used to include empty fields in Patch requests.
  699. ForceSendFields []string `json:"-"`
  700. // NullFields is a list of field names (e.g. "FileSize") to include in
  701. // API requests with the JSON null value. By default, fields with empty
  702. // values are omitted from API requests. However, any field with an
  703. // empty value appearing in NullFields will be sent to the server as
  704. // null. It is an error if a field in this list has a non-empty value.
  705. // This may be used to include null fields in Patch requests.
  706. NullFields []string `json:"-"`
  707. }
  708. func (s *ExpansionFile) MarshalJSON() ([]byte, error) {
  709. type NoMethod ExpansionFile
  710. raw := NoMethod(*s)
  711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  712. }
  713. type ExpansionFilesUploadResponse struct {
  714. ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"`
  715. // ServerResponse contains the HTTP response code and headers from the
  716. // server.
  717. googleapi.ServerResponse `json:"-"`
  718. // ForceSendFields is a list of field names (e.g. "ExpansionFile") to
  719. // unconditionally include in API requests. By default, fields with
  720. // empty values are omitted from API requests. However, any non-pointer,
  721. // non-interface field appearing in ForceSendFields will be sent to the
  722. // server regardless of whether the field is empty or not. This may be
  723. // used to include empty fields in Patch requests.
  724. ForceSendFields []string `json:"-"`
  725. // NullFields is a list of field names (e.g. "ExpansionFile") to include
  726. // in API requests with the JSON null value. By default, fields with
  727. // empty values are omitted from API requests. However, any field with
  728. // an empty value appearing in NullFields will be sent to the server as
  729. // null. It is an error if a field in this list has a non-empty value.
  730. // This may be used to include null fields in Patch requests.
  731. NullFields []string `json:"-"`
  732. }
  733. func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) {
  734. type NoMethod ExpansionFilesUploadResponse
  735. raw := NoMethod(*s)
  736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  737. }
  738. // ExternallyHostedApk: Defines an APK available for this application
  739. // that is hosted externally and not uploaded to Google Play. This
  740. // function is only available to enterprises who are using Google Play
  741. // for Work, and whos application is restricted to the enterprise
  742. // private channel
  743. type ExternallyHostedApk struct {
  744. // ApplicationLabel: The application label.
  745. ApplicationLabel string `json:"applicationLabel,omitempty"`
  746. // CertificateBase64s: A certificate (or array of certificates if a
  747. // certificate-chain is used) used to signed this APK, represented as a
  748. // base64 encoded byte array.
  749. CertificateBase64s []string `json:"certificateBase64s,omitempty"`
  750. // ExternallyHostedUrl: The URL at which the APK is hosted. This must be
  751. // an https URL.
  752. ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"`
  753. // FileSha1Base64: The SHA1 checksum of this APK, represented as a
  754. // base64 encoded byte array.
  755. FileSha1Base64 string `json:"fileSha1Base64,omitempty"`
  756. // FileSha256Base64: The SHA256 checksum of this APK, represented as a
  757. // base64 encoded byte array.
  758. FileSha256Base64 string `json:"fileSha256Base64,omitempty"`
  759. // FileSize: The file size in bytes of this APK.
  760. FileSize int64 `json:"fileSize,omitempty,string"`
  761. // IconBase64: The icon image from the APK, as a base64 encoded byte
  762. // array.
  763. IconBase64 string `json:"iconBase64,omitempty"`
  764. // MaximumSdk: The maximum SDK supported by this APK (optional).
  765. MaximumSdk int64 `json:"maximumSdk,omitempty"`
  766. // MinimumSdk: The minimum SDK targeted by this APK.
  767. MinimumSdk int64 `json:"minimumSdk,omitempty"`
  768. // NativeCodes: The native code environments supported by this APK
  769. // (optional).
  770. NativeCodes []string `json:"nativeCodes,omitempty"`
  771. // PackageName: The package name.
  772. PackageName string `json:"packageName,omitempty"`
  773. // UsesFeatures: The features required by this APK (optional).
  774. UsesFeatures []string `json:"usesFeatures,omitempty"`
  775. // UsesPermissions: The permissions requested by this APK.
  776. UsesPermissions []*ExternallyHostedApkUsesPermission `json:"usesPermissions,omitempty"`
  777. // VersionCode: The version code of this APK.
  778. VersionCode int64 `json:"versionCode,omitempty"`
  779. // VersionName: The version name of this APK.
  780. VersionName string `json:"versionName,omitempty"`
  781. // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to
  782. // unconditionally include in API requests. By default, fields with
  783. // empty values are omitted from API requests. However, any non-pointer,
  784. // non-interface field appearing in ForceSendFields will be sent to the
  785. // server regardless of whether the field is empty or not. This may be
  786. // used to include empty fields in Patch requests.
  787. ForceSendFields []string `json:"-"`
  788. // NullFields is a list of field names (e.g. "ApplicationLabel") to
  789. // include in API requests with the JSON null value. By default, fields
  790. // with empty values are omitted from API requests. However, any field
  791. // with an empty value appearing in NullFields will be sent to the
  792. // server as null. It is an error if a field in this list has a
  793. // non-empty value. This may be used to include null fields in Patch
  794. // requests.
  795. NullFields []string `json:"-"`
  796. }
  797. func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) {
  798. type NoMethod ExternallyHostedApk
  799. raw := NoMethod(*s)
  800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  801. }
  802. // ExternallyHostedApkUsesPermission: A permission used by this APK.
  803. type ExternallyHostedApkUsesPermission struct {
  804. // MaxSdkVersion: Optionally, the maximum SDK version for which the
  805. // permission is required.
  806. MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"`
  807. // Name: The name of the permission requested.
  808. Name string `json:"name,omitempty"`
  809. // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to
  810. // unconditionally include in API requests. By default, fields with
  811. // empty values are omitted from API requests. However, any non-pointer,
  812. // non-interface field appearing in ForceSendFields will be sent to the
  813. // server regardless of whether the field is empty or not. This may be
  814. // used to include empty fields in Patch requests.
  815. ForceSendFields []string `json:"-"`
  816. // NullFields is a list of field names (e.g. "MaxSdkVersion") to include
  817. // in API requests with the JSON null value. By default, fields with
  818. // empty values are omitted from API requests. However, any field with
  819. // an empty value appearing in NullFields will be sent to the server as
  820. // null. It is an error if a field in this list has a non-empty value.
  821. // This may be used to include null fields in Patch requests.
  822. NullFields []string `json:"-"`
  823. }
  824. func (s *ExternallyHostedApkUsesPermission) MarshalJSON() ([]byte, error) {
  825. type NoMethod ExternallyHostedApkUsesPermission
  826. raw := NoMethod(*s)
  827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  828. }
  829. type Image struct {
  830. // Id: A unique id representing this image.
  831. Id string `json:"id,omitempty"`
  832. // Sha1: A sha1 hash of the image that was uploaded.
  833. Sha1 string `json:"sha1,omitempty"`
  834. // Url: A URL that will serve a preview of the image.
  835. Url string `json:"url,omitempty"`
  836. // ForceSendFields is a list of field names (e.g. "Id") to
  837. // unconditionally include in API requests. By default, fields with
  838. // empty values are omitted from API requests. However, any non-pointer,
  839. // non-interface field appearing in ForceSendFields will be sent to the
  840. // server regardless of whether the field is empty or not. This may be
  841. // used to include empty fields in Patch requests.
  842. ForceSendFields []string `json:"-"`
  843. // NullFields is a list of field names (e.g. "Id") to include in API
  844. // requests with the JSON null value. By default, fields with empty
  845. // values are omitted from API requests. However, any field with an
  846. // empty value appearing in NullFields will be sent to the server as
  847. // null. It is an error if a field in this list has a non-empty value.
  848. // This may be used to include null fields in Patch requests.
  849. NullFields []string `json:"-"`
  850. }
  851. func (s *Image) MarshalJSON() ([]byte, error) {
  852. type NoMethod Image
  853. raw := NoMethod(*s)
  854. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  855. }
  856. type ImagesDeleteAllResponse struct {
  857. Deleted []*Image `json:"deleted,omitempty"`
  858. // ServerResponse contains the HTTP response code and headers from the
  859. // server.
  860. googleapi.ServerResponse `json:"-"`
  861. // ForceSendFields is a list of field names (e.g. "Deleted") to
  862. // unconditionally include in API requests. By default, fields with
  863. // empty values are omitted from API requests. However, any non-pointer,
  864. // non-interface field appearing in ForceSendFields will be sent to the
  865. // server regardless of whether the field is empty or not. This may be
  866. // used to include empty fields in Patch requests.
  867. ForceSendFields []string `json:"-"`
  868. // NullFields is a list of field names (e.g. "Deleted") to include in
  869. // API requests with the JSON null value. By default, fields with empty
  870. // values are omitted from API requests. However, any field with an
  871. // empty value appearing in NullFields will be sent to the server as
  872. // null. It is an error if a field in this list has a non-empty value.
  873. // This may be used to include null fields in Patch requests.
  874. NullFields []string `json:"-"`
  875. }
  876. func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) {
  877. type NoMethod ImagesDeleteAllResponse
  878. raw := NoMethod(*s)
  879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  880. }
  881. type ImagesListResponse struct {
  882. Images []*Image `json:"images,omitempty"`
  883. // ServerResponse contains the HTTP response code and headers from the
  884. // server.
  885. googleapi.ServerResponse `json:"-"`
  886. // ForceSendFields is a list of field names (e.g. "Images") to
  887. // unconditionally include in API requests. By default, fields with
  888. // empty values are omitted from API requests. However, any non-pointer,
  889. // non-interface field appearing in ForceSendFields will be sent to the
  890. // server regardless of whether the field is empty or not. This may be
  891. // used to include empty fields in Patch requests.
  892. ForceSendFields []string `json:"-"`
  893. // NullFields is a list of field names (e.g. "Images") to include in API
  894. // requests with the JSON null value. By default, fields with empty
  895. // values are omitted from API requests. However, any field with an
  896. // empty value appearing in NullFields will be sent to the server as
  897. // null. It is an error if a field in this list has a non-empty value.
  898. // This may be used to include null fields in Patch requests.
  899. NullFields []string `json:"-"`
  900. }
  901. func (s *ImagesListResponse) MarshalJSON() ([]byte, error) {
  902. type NoMethod ImagesListResponse
  903. raw := NoMethod(*s)
  904. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  905. }
  906. type ImagesUploadResponse struct {
  907. Image *Image `json:"image,omitempty"`
  908. // ServerResponse contains the HTTP response code and headers from the
  909. // server.
  910. googleapi.ServerResponse `json:"-"`
  911. // ForceSendFields is a list of field names (e.g. "Image") to
  912. // unconditionally include in API requests. By default, fields with
  913. // empty values are omitted from API requests. However, any non-pointer,
  914. // non-interface field appearing in ForceSendFields will be sent to the
  915. // server regardless of whether the field is empty or not. This may be
  916. // used to include empty fields in Patch requests.
  917. ForceSendFields []string `json:"-"`
  918. // NullFields is a list of field names (e.g. "Image") to include in API
  919. // requests with the JSON null value. By default, fields with empty
  920. // values are omitted from API requests. However, any field with an
  921. // empty value appearing in NullFields will be sent to the server as
  922. // null. It is an error if a field in this list has a non-empty value.
  923. // This may be used to include null fields in Patch requests.
  924. NullFields []string `json:"-"`
  925. }
  926. func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) {
  927. type NoMethod ImagesUploadResponse
  928. raw := NoMethod(*s)
  929. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  930. }
  931. type InAppProduct struct {
  932. // DefaultLanguage: The default language of the localized data, as
  933. // defined by BCP 47. e.g. "en-US", "en-GB".
  934. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  935. // DefaultPrice: Default price cannot be zero. In-app products can never
  936. // be free. Default price is always in the developer's Checkout merchant
  937. // currency.
  938. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  939. // GracePeriod: Grace period of the subscription, specified in ISO 8601
  940. // format. It will allow developers to give their subscribers a grace
  941. // period when the payment for the new recurrence period is declined.
  942. // Acceptable values = "P3D" (three days) and "P7D" (seven days)
  943. GracePeriod string `json:"gracePeriod,omitempty"`
  944. // Listings: List of localized title and description data.
  945. Listings map[string]InAppProductListing `json:"listings,omitempty"`
  946. // PackageName: The package name of the parent app.
  947. PackageName string `json:"packageName,omitempty"`
  948. // Prices: Prices per buyer region. None of these prices should be zero.
  949. // In-app products can never be free.
  950. Prices map[string]Price `json:"prices,omitempty"`
  951. // PurchaseType: Purchase type enum value. Unmodifiable after creation.
  952. PurchaseType string `json:"purchaseType,omitempty"`
  953. // Season: Definition of a season for a seasonal subscription. Can be
  954. // defined only for yearly subscriptions.
  955. Season *Season `json:"season,omitempty"`
  956. // Sku: The stock-keeping-unit (SKU) of the product, unique within an
  957. // app.
  958. Sku string `json:"sku,omitempty"`
  959. Status string `json:"status,omitempty"`
  960. // SubscriptionPeriod: Subscription period, specified in ISO 8601
  961. // format. Acceptable values are "P1W" (one week), "P1M" (one month),
  962. // "P3M" (three months), "P6M" (six months), and "P1Y" (one year).
  963. SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"`
  964. // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable
  965. // values are anything between "P7D" (seven days) and "P999D" (999
  966. // days). Seasonal subscriptions cannot have a trial period.
  967. TrialPeriod string `json:"trialPeriod,omitempty"`
  968. // ServerResponse contains the HTTP response code and headers from the
  969. // server.
  970. googleapi.ServerResponse `json:"-"`
  971. // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to
  972. // unconditionally include in API requests. By default, fields with
  973. // empty values are omitted from API requests. However, any non-pointer,
  974. // non-interface field appearing in ForceSendFields will be sent to the
  975. // server regardless of whether the field is empty or not. This may be
  976. // used to include empty fields in Patch requests.
  977. ForceSendFields []string `json:"-"`
  978. // NullFields is a list of field names (e.g. "DefaultLanguage") to
  979. // include in API requests with the JSON null value. By default, fields
  980. // with empty values are omitted from API requests. However, any field
  981. // with an empty value appearing in NullFields will be sent to the
  982. // server as null. It is an error if a field in this list has a
  983. // non-empty value. This may be used to include null fields in Patch
  984. // requests.
  985. NullFields []string `json:"-"`
  986. }
  987. func (s *InAppProduct) MarshalJSON() ([]byte, error) {
  988. type NoMethod InAppProduct
  989. raw := NoMethod(*s)
  990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  991. }
  992. type InAppProductListing struct {
  993. Description string `json:"description,omitempty"`
  994. Title string `json:"title,omitempty"`
  995. // ForceSendFields is a list of field names (e.g. "Description") to
  996. // unconditionally include in API requests. By default, fields with
  997. // empty values are omitted from API requests. However, any non-pointer,
  998. // non-interface field appearing in ForceSendFields will be sent to the
  999. // server regardless of whether the field is empty or not. This may be
  1000. // used to include empty fields in Patch requests.
  1001. ForceSendFields []string `json:"-"`
  1002. // NullFields is a list of field names (e.g. "Description") to include
  1003. // in API requests with the JSON null value. By default, fields with
  1004. // empty values are omitted from API requests. However, any field with
  1005. // an empty value appearing in NullFields will be sent to the server as
  1006. // null. It is an error if a field in this list has a non-empty value.
  1007. // This may be used to include null fields in Patch requests.
  1008. NullFields []string `json:"-"`
  1009. }
  1010. func (s *InAppProductListing) MarshalJSON() ([]byte, error) {
  1011. type NoMethod InAppProductListing
  1012. raw := NoMethod(*s)
  1013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1014. }
  1015. type InappproductsListResponse struct {
  1016. Inappproduct []*InAppProduct `json:"inappproduct,omitempty"`
  1017. // Kind: Identifies what kind of resource this is. Value: the fixed
  1018. // string "androidpublisher#inappproductsListResponse".
  1019. Kind string `json:"kind,omitempty"`
  1020. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1021. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1022. // ServerResponse contains the HTTP response code and headers from the
  1023. // server.
  1024. googleapi.ServerResponse `json:"-"`
  1025. // ForceSendFields is a list of field names (e.g. "Inappproduct") to
  1026. // unconditionally include in API requests. By default, fields with
  1027. // empty values are omitted from API requests. However, any non-pointer,
  1028. // non-interface field appearing in ForceSendFields will be sent to the
  1029. // server regardless of whether the field is empty or not. This may be
  1030. // used to include empty fields in Patch requests.
  1031. ForceSendFields []string `json:"-"`
  1032. // NullFields is a list of field names (e.g. "Inappproduct") to include
  1033. // in API requests with the JSON null value. By default, fields with
  1034. // empty values are omitted from API requests. However, any field with
  1035. // an empty value appearing in NullFields will be sent to the server as
  1036. // null. It is an error if a field in this list has a non-empty value.
  1037. // This may be used to include null fields in Patch requests.
  1038. NullFields []string `json:"-"`
  1039. }
  1040. func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) {
  1041. type NoMethod InappproductsListResponse
  1042. raw := NoMethod(*s)
  1043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1044. }
  1045. type Listing struct {
  1046. // FullDescription: Full description of the app; this may be up to 4000
  1047. // characters in length.
  1048. FullDescription string `json:"fullDescription,omitempty"`
  1049. // Language: Language localization code (for example, "de-AT" for
  1050. // Austrian German).
  1051. Language string `json:"language,omitempty"`
  1052. // ShortDescription: Short description of the app (previously known as
  1053. // promo text); this may be up to 80 characters in length.
  1054. ShortDescription string `json:"shortDescription,omitempty"`
  1055. // Title: App's localized title.
  1056. Title string `json:"title,omitempty"`
  1057. // Video: URL of a promotional YouTube video for the app.
  1058. Video string `json:"video,omitempty"`
  1059. // ServerResponse contains the HTTP response code and headers from the
  1060. // server.
  1061. googleapi.ServerResponse `json:"-"`
  1062. // ForceSendFields is a list of field names (e.g. "FullDescription") to
  1063. // unconditionally include in API requests. By default, fields with
  1064. // empty values are omitted from API requests. However, any non-pointer,
  1065. // non-interface field appearing in ForceSendFields will be sent to the
  1066. // server regardless of whether the field is empty or not. This may be
  1067. // used to include empty fields in Patch requests.
  1068. ForceSendFields []string `json:"-"`
  1069. // NullFields is a list of field names (e.g. "FullDescription") to
  1070. // include in API requests with the JSON null value. By default, fields
  1071. // with empty values are omitted from API requests. However, any field
  1072. // with an empty value appearing in NullFields will be sent to the
  1073. // server as null. It is an error if a field in this list has a
  1074. // non-empty value. This may be used to include null fields in Patch
  1075. // requests.
  1076. NullFields []string `json:"-"`
  1077. }
  1078. func (s *Listing) MarshalJSON() ([]byte, error) {
  1079. type NoMethod Listing
  1080. raw := NoMethod(*s)
  1081. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1082. }
  1083. type ListingsListResponse struct {
  1084. // Kind: Identifies what kind of resource this is. Value: the fixed
  1085. // string "androidpublisher#listingsListResponse".
  1086. Kind string `json:"kind,omitempty"`
  1087. Listings []*Listing `json:"listings,omitempty"`
  1088. // ServerResponse contains the HTTP response code and headers from the
  1089. // server.
  1090. googleapi.ServerResponse `json:"-"`
  1091. // ForceSendFields is a list of field names (e.g. "Kind") to
  1092. // unconditionally include in API requests. By default, fields with
  1093. // empty values are omitted from API requests. However, any non-pointer,
  1094. // non-interface field appearing in ForceSendFields will be sent to the
  1095. // server regardless of whether the field is empty or not. This may be
  1096. // used to include empty fields in Patch requests.
  1097. ForceSendFields []string `json:"-"`
  1098. // NullFields is a list of field names (e.g. "Kind") to include in API
  1099. // requests with the JSON null value. By default, fields with empty
  1100. // values are omitted from API requests. However, any field with an
  1101. // empty value appearing in NullFields will be sent to the server as
  1102. // null. It is an error if a field in this list has a non-empty value.
  1103. // This may be used to include null fields in Patch requests.
  1104. NullFields []string `json:"-"`
  1105. }
  1106. func (s *ListingsListResponse) MarshalJSON() ([]byte, error) {
  1107. type NoMethod ListingsListResponse
  1108. raw := NoMethod(*s)
  1109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1110. }
  1111. type LocalizedText struct {
  1112. // Language: The language code, in BCP 47 format (eg "en-US").
  1113. Language string `json:"language,omitempty"`
  1114. // Text: The text in the given `language`.
  1115. Text string `json:"text,omitempty"`
  1116. // ForceSendFields is a list of field names (e.g. "Language") to
  1117. // unconditionally include in API requests. By default, fields with
  1118. // empty values are omitted from API requests. However, any non-pointer,
  1119. // non-interface field appearing in ForceSendFields will be sent to the
  1120. // server regardless of whether the field is empty or not. This may be
  1121. // used to include empty fields in Patch requests.
  1122. ForceSendFields []string `json:"-"`
  1123. // NullFields is a list of field names (e.g. "Language") to include in
  1124. // API requests with the JSON null value. By default, fields with empty
  1125. // values are omitted from API requests. However, any field with an
  1126. // empty value appearing in NullFields will be sent to the server as
  1127. // null. It is an error if a field in this list has a non-empty value.
  1128. // This may be used to include null fields in Patch requests.
  1129. NullFields []string `json:"-"`
  1130. }
  1131. func (s *LocalizedText) MarshalJSON() ([]byte, error) {
  1132. type NoMethod LocalizedText
  1133. raw := NoMethod(*s)
  1134. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1135. }
  1136. type MonthDay struct {
  1137. // Day: Day of a month, value in [1, 31] range. Valid range depends on
  1138. // the specified month.
  1139. Day int64 `json:"day,omitempty"`
  1140. // Month: Month of a year. e.g. 1 = JAN, 2 = FEB etc.
  1141. Month int64 `json:"month,omitempty"`
  1142. // ForceSendFields is a list of field names (e.g. "Day") to
  1143. // unconditionally include in API requests. By default, fields with
  1144. // empty values are omitted from API requests. However, any non-pointer,
  1145. // non-interface field appearing in ForceSendFields will be sent to the
  1146. // server regardless of whether the field is empty or not. This may be
  1147. // used to include empty fields in Patch requests.
  1148. ForceSendFields []string `json:"-"`
  1149. // NullFields is a list of field names (e.g. "Day") to include in API
  1150. // requests with the JSON null value. By default, fields with empty
  1151. // values are omitted from API requests. However, any field with an
  1152. // empty value appearing in NullFields will be sent to the server as
  1153. // null. It is an error if a field in this list has a non-empty value.
  1154. // This may be used to include null fields in Patch requests.
  1155. NullFields []string `json:"-"`
  1156. }
  1157. func (s *MonthDay) MarshalJSON() ([]byte, error) {
  1158. type NoMethod MonthDay
  1159. raw := NoMethod(*s)
  1160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1161. }
  1162. type PageInfo struct {
  1163. ResultPerPage int64 `json:"resultPerPage,omitempty"`
  1164. StartIndex int64 `json:"startIndex,omitempty"`
  1165. TotalResults int64 `json:"totalResults,omitempty"`
  1166. // ForceSendFields is a list of field names (e.g. "ResultPerPage") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "ResultPerPage") to include
  1174. // in API requests with the JSON null value. By default, fields with
  1175. // empty values are omitted from API requests. However, any field with
  1176. // an empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  1182. type NoMethod PageInfo
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. type Price struct {
  1187. // Currency: 3 letter Currency code, as defined by ISO 4217.
  1188. Currency string `json:"currency,omitempty"`
  1189. // PriceMicros: The price in millionths of the currency base unit
  1190. // represented as a string.
  1191. PriceMicros string `json:"priceMicros,omitempty"`
  1192. // ForceSendFields is a list of field names (e.g. "Currency") to
  1193. // unconditionally include in API requests. By default, fields with
  1194. // empty values are omitted from API requests. However, any non-pointer,
  1195. // non-interface field appearing in ForceSendFields will be sent to the
  1196. // server regardless of whether the field is empty or not. This may be
  1197. // used to include empty fields in Patch requests.
  1198. ForceSendFields []string `json:"-"`
  1199. // NullFields is a list of field names (e.g. "Currency") to include in
  1200. // API requests with the JSON null value. By default, fields with empty
  1201. // values are omitted from API requests. However, any field with an
  1202. // empty value appearing in NullFields will be sent to the server as
  1203. // null. It is an error if a field in this list has a non-empty value.
  1204. // This may be used to include null fields in Patch requests.
  1205. NullFields []string `json:"-"`
  1206. }
  1207. func (s *Price) MarshalJSON() ([]byte, error) {
  1208. type NoMethod Price
  1209. raw := NoMethod(*s)
  1210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1211. }
  1212. // ProductPurchase: A ProductPurchase resource indicates the status of a
  1213. // user's inapp product purchase.
  1214. type ProductPurchase struct {
  1215. // ConsumptionState: The consumption state of the inapp product.
  1216. // Possible values are:
  1217. // - Yet to be consumed
  1218. // - Consumed
  1219. ConsumptionState int64 `json:"consumptionState,omitempty"`
  1220. // DeveloperPayload: A developer-specified string that contains
  1221. // supplemental information about an order.
  1222. DeveloperPayload string `json:"developerPayload,omitempty"`
  1223. // Kind: This kind represents an inappPurchase object in the
  1224. // androidpublisher service.
  1225. Kind string `json:"kind,omitempty"`
  1226. // OrderId: The order id associated with the purchase of the inapp
  1227. // product.
  1228. OrderId string `json:"orderId,omitempty"`
  1229. // PurchaseState: The purchase state of the order. Possible values are:
  1230. //
  1231. // - Purchased
  1232. // - Canceled
  1233. PurchaseState int64 `json:"purchaseState,omitempty"`
  1234. // PurchaseTimeMillis: The time the product was purchased, in
  1235. // milliseconds since the epoch (Jan 1, 1970).
  1236. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1237. // PurchaseType: The type of purchase of the inapp product. This field
  1238. // is only set if this purchase was not made using the standard in-app
  1239. // billing flow. Possible values are:
  1240. // - Test (i.e. purchased from a license testing account)
  1241. // - Promo (i.e. purchased using a promo code)
  1242. // - Rewarded (i.e. from watching a video ad instead of paying)
  1243. PurchaseType *int64 `json:"purchaseType,omitempty"`
  1244. // ServerResponse contains the HTTP response code and headers from the
  1245. // server.
  1246. googleapi.ServerResponse `json:"-"`
  1247. // ForceSendFields is a list of field names (e.g. "ConsumptionState") to
  1248. // unconditionally include in API requests. By default, fields with
  1249. // empty values are omitted from API requests. However, any non-pointer,
  1250. // non-interface field appearing in ForceSendFields will be sent to the
  1251. // server regardless of whether the field is empty or not. This may be
  1252. // used to include empty fields in Patch requests.
  1253. ForceSendFields []string `json:"-"`
  1254. // NullFields is a list of field names (e.g. "ConsumptionState") to
  1255. // include in API requests with the JSON null value. By default, fields
  1256. // with empty values are omitted from API requests. However, any field
  1257. // with an empty value appearing in NullFields will be sent to the
  1258. // server as null. It is an error if a field in this list has a
  1259. // non-empty value. This may be used to include null fields in Patch
  1260. // requests.
  1261. NullFields []string `json:"-"`
  1262. }
  1263. func (s *ProductPurchase) MarshalJSON() ([]byte, error) {
  1264. type NoMethod ProductPurchase
  1265. raw := NoMethod(*s)
  1266. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1267. }
  1268. type Prorate struct {
  1269. // DefaultPrice: Default price cannot be zero and must be less than the
  1270. // full subscription price. Default price is always in the developer's
  1271. // Checkout merchant currency. Targeted countries have their prices set
  1272. // automatically based on the default_price.
  1273. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  1274. // Start: Defines the first day on which the price takes effect.
  1275. Start *MonthDay `json:"start,omitempty"`
  1276. // ForceSendFields is a list of field names (e.g. "DefaultPrice") to
  1277. // unconditionally include in API requests. By default, fields with
  1278. // empty values are omitted from API requests. However, any non-pointer,
  1279. // non-interface field appearing in ForceSendFields will be sent to the
  1280. // server regardless of whether the field is empty or not. This may be
  1281. // used to include empty fields in Patch requests.
  1282. ForceSendFields []string `json:"-"`
  1283. // NullFields is a list of field names (e.g. "DefaultPrice") to include
  1284. // in API requests with the JSON null value. By default, fields with
  1285. // empty values are omitted from API requests. However, any field with
  1286. // an empty value appearing in NullFields will be sent to the server as
  1287. // null. It is an error if a field in this list has a non-empty value.
  1288. // This may be used to include null fields in Patch requests.
  1289. NullFields []string `json:"-"`
  1290. }
  1291. func (s *Prorate) MarshalJSON() ([]byte, error) {
  1292. type NoMethod Prorate
  1293. raw := NoMethod(*s)
  1294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1295. }
  1296. type Review struct {
  1297. // AuthorName: The name of the user who wrote the review.
  1298. AuthorName string `json:"authorName,omitempty"`
  1299. // Comments: A repeated field containing comments for the review.
  1300. Comments []*Comment `json:"comments,omitempty"`
  1301. // ReviewId: Unique identifier for this review.
  1302. ReviewId string `json:"reviewId,omitempty"`
  1303. // ServerResponse contains the HTTP response code and headers from the
  1304. // server.
  1305. googleapi.ServerResponse `json:"-"`
  1306. // ForceSendFields is a list of field names (e.g. "AuthorName") to
  1307. // unconditionally include in API requests. By default, fields with
  1308. // empty values are omitted from API requests. However, any non-pointer,
  1309. // non-interface field appearing in ForceSendFields will be sent to the
  1310. // server regardless of whether the field is empty or not. This may be
  1311. // used to include empty fields in Patch requests.
  1312. ForceSendFields []string `json:"-"`
  1313. // NullFields is a list of field names (e.g. "AuthorName") to include in
  1314. // API requests with the JSON null value. By default, fields with empty
  1315. // values are omitted from API requests. However, any field with an
  1316. // empty value appearing in NullFields will be sent to the server as
  1317. // null. It is an error if a field in this list has a non-empty value.
  1318. // This may be used to include null fields in Patch requests.
  1319. NullFields []string `json:"-"`
  1320. }
  1321. func (s *Review) MarshalJSON() ([]byte, error) {
  1322. type NoMethod Review
  1323. raw := NoMethod(*s)
  1324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1325. }
  1326. type ReviewReplyResult struct {
  1327. // LastEdited: The time at which the reply took effect.
  1328. LastEdited *Timestamp `json:"lastEdited,omitempty"`
  1329. // ReplyText: The reply text that was applied.
  1330. ReplyText string `json:"replyText,omitempty"`
  1331. // ForceSendFields is a list of field names (e.g. "LastEdited") to
  1332. // unconditionally include in API requests. By default, fields with
  1333. // empty values are omitted from API requests. However, any non-pointer,
  1334. // non-interface field appearing in ForceSendFields will be sent to the
  1335. // server regardless of whether the field is empty or not. This may be
  1336. // used to include empty fields in Patch requests.
  1337. ForceSendFields []string `json:"-"`
  1338. // NullFields is a list of field names (e.g. "LastEdited") to include in
  1339. // API requests with the JSON null value. By default, fields with empty
  1340. // values are omitted from API requests. However, any field with an
  1341. // empty value appearing in NullFields will be sent to the server as
  1342. // null. It is an error if a field in this list has a non-empty value.
  1343. // This may be used to include null fields in Patch requests.
  1344. NullFields []string `json:"-"`
  1345. }
  1346. func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) {
  1347. type NoMethod ReviewReplyResult
  1348. raw := NoMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1350. }
  1351. type ReviewsListResponse struct {
  1352. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1353. Reviews []*Review `json:"reviews,omitempty"`
  1354. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1355. // ServerResponse contains the HTTP response code and headers from the
  1356. // server.
  1357. googleapi.ServerResponse `json:"-"`
  1358. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  1359. // unconditionally include in API requests. By default, fields with
  1360. // empty values are omitted from API requests. However, any non-pointer,
  1361. // non-interface field appearing in ForceSendFields will be sent to the
  1362. // server regardless of whether the field is empty or not. This may be
  1363. // used to include empty fields in Patch requests.
  1364. ForceSendFields []string `json:"-"`
  1365. // NullFields is a list of field names (e.g. "PageInfo") to include in
  1366. // API requests with the JSON null value. By default, fields with empty
  1367. // values are omitted from API requests. However, any field with an
  1368. // empty value appearing in NullFields will be sent to the server as
  1369. // null. It is an error if a field in this list has a non-empty value.
  1370. // This may be used to include null fields in Patch requests.
  1371. NullFields []string `json:"-"`
  1372. }
  1373. func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) {
  1374. type NoMethod ReviewsListResponse
  1375. raw := NoMethod(*s)
  1376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1377. }
  1378. type ReviewsReplyRequest struct {
  1379. // ReplyText: The text to set as the reply. Replies of more than
  1380. // approximately 350 characters will be rejected. HTML tags will be
  1381. // stripped.
  1382. ReplyText string `json:"replyText,omitempty"`
  1383. // ForceSendFields is a list of field names (e.g. "ReplyText") to
  1384. // unconditionally include in API requests. By default, fields with
  1385. // empty values are omitted from API requests. However, any non-pointer,
  1386. // non-interface field appearing in ForceSendFields will be sent to the
  1387. // server regardless of whether the field is empty or not. This may be
  1388. // used to include empty fields in Patch requests.
  1389. ForceSendFields []string `json:"-"`
  1390. // NullFields is a list of field names (e.g. "ReplyText") to include in
  1391. // API requests with the JSON null value. By default, fields with empty
  1392. // values are omitted from API requests. However, any field with an
  1393. // empty value appearing in NullFields will be sent to the server as
  1394. // null. It is an error if a field in this list has a non-empty value.
  1395. // This may be used to include null fields in Patch requests.
  1396. NullFields []string `json:"-"`
  1397. }
  1398. func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) {
  1399. type NoMethod ReviewsReplyRequest
  1400. raw := NoMethod(*s)
  1401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1402. }
  1403. type ReviewsReplyResponse struct {
  1404. Result *ReviewReplyResult `json:"result,omitempty"`
  1405. // ServerResponse contains the HTTP response code and headers from the
  1406. // server.
  1407. googleapi.ServerResponse `json:"-"`
  1408. // ForceSendFields is a list of field names (e.g. "Result") to
  1409. // unconditionally include in API requests. By default, fields with
  1410. // empty values are omitted from API requests. However, any non-pointer,
  1411. // non-interface field appearing in ForceSendFields will be sent to the
  1412. // server regardless of whether the field is empty or not. This may be
  1413. // used to include empty fields in Patch requests.
  1414. ForceSendFields []string `json:"-"`
  1415. // NullFields is a list of field names (e.g. "Result") to include in API
  1416. // requests with the JSON null value. By default, fields with empty
  1417. // values are omitted from API requests. However, any field with an
  1418. // empty value appearing in NullFields will be sent to the server as
  1419. // null. It is an error if a field in this list has a non-empty value.
  1420. // This may be used to include null fields in Patch requests.
  1421. NullFields []string `json:"-"`
  1422. }
  1423. func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) {
  1424. type NoMethod ReviewsReplyResponse
  1425. raw := NoMethod(*s)
  1426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1427. }
  1428. type Season struct {
  1429. // End: Inclusive end date of the recurrence period.
  1430. End *MonthDay `json:"end,omitempty"`
  1431. // Prorations: Optionally present list of prorations for the season.
  1432. // Each proration is a one-off discounted entry into a subscription.
  1433. // Each proration contains the first date on which the discount is
  1434. // available and the new pricing information.
  1435. Prorations []*Prorate `json:"prorations,omitempty"`
  1436. // Start: Inclusive start date of the recurrence period.
  1437. Start *MonthDay `json:"start,omitempty"`
  1438. // ForceSendFields is a list of field names (e.g. "End") to
  1439. // unconditionally include in API requests. By default, fields with
  1440. // empty values are omitted from API requests. However, any non-pointer,
  1441. // non-interface field appearing in ForceSendFields will be sent to the
  1442. // server regardless of whether the field is empty or not. This may be
  1443. // used to include empty fields in Patch requests.
  1444. ForceSendFields []string `json:"-"`
  1445. // NullFields is a list of field names (e.g. "End") to include in API
  1446. // requests with the JSON null value. By default, fields with empty
  1447. // values are omitted from API requests. However, any field with an
  1448. // empty value appearing in NullFields will be sent to the server as
  1449. // null. It is an error if a field in this list has a non-empty value.
  1450. // This may be used to include null fields in Patch requests.
  1451. NullFields []string `json:"-"`
  1452. }
  1453. func (s *Season) MarshalJSON() ([]byte, error) {
  1454. type NoMethod Season
  1455. raw := NoMethod(*s)
  1456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1457. }
  1458. // SubscriptionCancelSurveyResult: Information provided by the user when
  1459. // they complete the subscription cancellation flow (cancellation reason
  1460. // survey).
  1461. type SubscriptionCancelSurveyResult struct {
  1462. // CancelSurveyReason: The cancellation reason the user chose in the
  1463. // survey. Possible values are:
  1464. // - Other
  1465. // - I don't use this service enough
  1466. // - Technical issues
  1467. // - Cost-related reasons
  1468. // - I found a better app
  1469. CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"`
  1470. // UserInputCancelReason: The customized input cancel reason from the
  1471. // user. Only present when cancelReason is 0.
  1472. UserInputCancelReason string `json:"userInputCancelReason,omitempty"`
  1473. // ForceSendFields is a list of field names (e.g. "CancelSurveyReason")
  1474. // to unconditionally include in API requests. By default, fields with
  1475. // empty values are omitted from API requests. However, any non-pointer,
  1476. // non-interface field appearing in ForceSendFields will be sent to the
  1477. // server regardless of whether the field is empty or not. This may be
  1478. // used to include empty fields in Patch requests.
  1479. ForceSendFields []string `json:"-"`
  1480. // NullFields is a list of field names (e.g. "CancelSurveyReason") to
  1481. // include in API requests with the JSON null value. By default, fields
  1482. // with empty values are omitted from API requests. However, any field
  1483. // with an empty value appearing in NullFields will be sent to the
  1484. // server as null. It is an error if a field in this list has a
  1485. // non-empty value. This may be used to include null fields in Patch
  1486. // requests.
  1487. NullFields []string `json:"-"`
  1488. }
  1489. func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) {
  1490. type NoMethod SubscriptionCancelSurveyResult
  1491. raw := NoMethod(*s)
  1492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1493. }
  1494. // SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the
  1495. // data needed to defer a subscription purchase to a future expiry time.
  1496. type SubscriptionDeferralInfo struct {
  1497. // DesiredExpiryTimeMillis: The desired next expiry time to assign to
  1498. // the subscription, in milliseconds since the Epoch. The given time
  1499. // must be later/greater than the current expiry time for the
  1500. // subscription.
  1501. DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"`
  1502. // ExpectedExpiryTimeMillis: The expected expiry time for the
  1503. // subscription. If the current expiry time for the subscription is not
  1504. // the value specified here, the deferral will not occur.
  1505. ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"`
  1506. // ForceSendFields is a list of field names (e.g.
  1507. // "DesiredExpiryTimeMillis") to unconditionally include in API
  1508. // requests. By default, fields with empty values are omitted from API
  1509. // requests. However, any non-pointer, non-interface field appearing in
  1510. // ForceSendFields will be sent to the server regardless of whether the
  1511. // field is empty or not. This may be used to include empty fields in
  1512. // Patch requests.
  1513. ForceSendFields []string `json:"-"`
  1514. // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis")
  1515. // to include in API requests with the JSON null value. By default,
  1516. // fields with empty values are omitted from API requests. However, any
  1517. // field with an empty value appearing in NullFields will be sent to the
  1518. // server as null. It is an error if a field in this list has a
  1519. // non-empty value. This may be used to include null fields in Patch
  1520. // requests.
  1521. NullFields []string `json:"-"`
  1522. }
  1523. func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) {
  1524. type NoMethod SubscriptionDeferralInfo
  1525. raw := NoMethod(*s)
  1526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1527. }
  1528. // SubscriptionPriceChange: Contains the price change information for a
  1529. // subscription that can be used to control the user journey for the
  1530. // price change in the app. This can be in the form of seeking
  1531. // confirmation from the user or tailoring the experience for a
  1532. // successful conversion.
  1533. type SubscriptionPriceChange struct {
  1534. // NewPrice: The new price the subscription will renew with if the price
  1535. // change is accepted by the user.
  1536. NewPrice *Price `json:"newPrice,omitempty"`
  1537. // State: The current state of the price change. Possible values are:
  1538. //
  1539. // - Outstanding: State for a pending price change waiting for the user
  1540. // to agree. In this state, you can optionally seek confirmation from
  1541. // the user using the In-App API.
  1542. // - Accepted: State for an accepted price change that the subscription
  1543. // will renew with unless it's canceled. The price change takes effect
  1544. // on a future date when the subscription renews. Note that the change
  1545. // might not occur when the subscription is renewed next.
  1546. State int64 `json:"state,omitempty"`
  1547. // ForceSendFields is a list of field names (e.g. "NewPrice") to
  1548. // unconditionally include in API requests. By default, fields with
  1549. // empty values are omitted from API requests. However, any non-pointer,
  1550. // non-interface field appearing in ForceSendFields will be sent to the
  1551. // server regardless of whether the field is empty or not. This may be
  1552. // used to include empty fields in Patch requests.
  1553. ForceSendFields []string `json:"-"`
  1554. // NullFields is a list of field names (e.g. "NewPrice") to include in
  1555. // API requests with the JSON null value. By default, fields with empty
  1556. // values are omitted from API requests. However, any field with an
  1557. // empty value appearing in NullFields will be sent to the server as
  1558. // null. It is an error if a field in this list has a non-empty value.
  1559. // This may be used to include null fields in Patch requests.
  1560. NullFields []string `json:"-"`
  1561. }
  1562. func (s *SubscriptionPriceChange) MarshalJSON() ([]byte, error) {
  1563. type NoMethod SubscriptionPriceChange
  1564. raw := NoMethod(*s)
  1565. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1566. }
  1567. // SubscriptionPurchase: A SubscriptionPurchase resource indicates the
  1568. // status of a user's subscription purchase.
  1569. type SubscriptionPurchase struct {
  1570. // AutoRenewing: Whether the subscription will automatically be renewed
  1571. // when it reaches its current expiry time.
  1572. AutoRenewing bool `json:"autoRenewing,omitempty"`
  1573. // AutoResumeTimeMillis: Time at which the subscription will be
  1574. // automatically resumed, in milliseconds since the Epoch. Only present
  1575. // if the user has requested to pause the subscription.
  1576. AutoResumeTimeMillis int64 `json:"autoResumeTimeMillis,omitempty,string"`
  1577. // CancelReason: The reason why a subscription was canceled or is not
  1578. // auto-renewing. Possible values are:
  1579. // - User canceled the subscription
  1580. // - Subscription was canceled by the system, for example because of a
  1581. // billing problem
  1582. // - Subscription was replaced with a new subscription
  1583. // - Subscription was canceled by the developer
  1584. CancelReason int64 `json:"cancelReason,omitempty"`
  1585. // CancelSurveyResult: Information provided by the user when they
  1586. // complete the subscription cancellation flow (cancellation reason
  1587. // survey).
  1588. CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"`
  1589. // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the
  1590. // user at the time the subscription was granted.
  1591. CountryCode string `json:"countryCode,omitempty"`
  1592. // DeveloperPayload: A developer-specified string that contains
  1593. // supplemental information about an order.
  1594. DeveloperPayload string `json:"developerPayload,omitempty"`
  1595. // EmailAddress: The email address of the user when the subscription was
  1596. // purchased. Only present for purchases made with 'Subscribe with
  1597. // Google'.
  1598. EmailAddress string `json:"emailAddress,omitempty"`
  1599. // ExpiryTimeMillis: Time at which the subscription will expire, in
  1600. // milliseconds since the Epoch.
  1601. ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"`
  1602. // FamilyName: The family name of the user when the subscription was
  1603. // purchased. Only present for purchases made with 'Subscribe with
  1604. // Google'.
  1605. FamilyName string `json:"familyName,omitempty"`
  1606. // GivenName: The given name of the user when the subscription was
  1607. // purchased. Only present for purchases made with 'Subscribe with
  1608. // Google'.
  1609. GivenName string `json:"givenName,omitempty"`
  1610. // Kind: This kind represents a subscriptionPurchase object in the
  1611. // androidpublisher service.
  1612. Kind string `json:"kind,omitempty"`
  1613. // LinkedPurchaseToken: The purchase token of the originating purchase
  1614. // if this subscription is one of the following:
  1615. // - Re-signup of a canceled but non-lapsed subscription
  1616. // - Upgrade/downgrade from a previous subscription For example,
  1617. // suppose a user originally signs up and you receive purchase token X,
  1618. // then the user cancels and goes through the resignup flow (before
  1619. // their subscription lapses) and you receive purchase token Y, and
  1620. // finally the user upgrades their subscription and you receive purchase
  1621. // token Z. If you call this API with purchase token Z, this field will
  1622. // be set to Y. If you call this API with purchase token Y, this field
  1623. // will be set to X. If you call this API with purchase token X, this
  1624. // field will not be set.
  1625. LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"`
  1626. // OrderId: The order id of the latest recurring order associated with
  1627. // the purchase of the subscription.
  1628. OrderId string `json:"orderId,omitempty"`
  1629. // PaymentState: The payment state of the subscription. Possible values
  1630. // are:
  1631. // - Payment pending
  1632. // - Payment received
  1633. // - Free trial
  1634. // - Pending deferred upgrade/downgrade
  1635. PaymentState int64 `json:"paymentState,omitempty"`
  1636. // PriceAmountMicros: Price of the subscription, not including tax.
  1637. // Price is expressed in micro-units, where 1,000,000 micro-units
  1638. // represents one unit of the currency. For example, if the subscription
  1639. // price is €1.99, price_amount_micros is 1990000.
  1640. PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"`
  1641. // PriceChange: The latest price change information available. This is
  1642. // present only when there is an upcoming price change for the
  1643. // subscription yet to be applied.
  1644. //
  1645. // Once the subscription renews with the new price or the subscription
  1646. // is canceled, no price change information will be returned.
  1647. PriceChange *SubscriptionPriceChange `json:"priceChange,omitempty"`
  1648. // PriceCurrencyCode: ISO 4217 currency code for the subscription price.
  1649. // For example, if the price is specified in British pounds sterling,
  1650. // price_currency_code is "GBP".
  1651. PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"`
  1652. // ProfileId: The profile id of the user when the subscription was
  1653. // purchased. Only present for purchases made with 'Subscribe with
  1654. // Google'.
  1655. ProfileId string `json:"profileId,omitempty"`
  1656. // ProfileName: The profile name of the user when the subscription was
  1657. // purchased. Only present for purchases made with 'Subscribe with
  1658. // Google'.
  1659. ProfileName string `json:"profileName,omitempty"`
  1660. // PurchaseType: The type of purchase of the subscription. This field is
  1661. // only set if this purchase was not made using the standard in-app
  1662. // billing flow. Possible values are:
  1663. // - Test (i.e. purchased from a license testing account)
  1664. PurchaseType *int64 `json:"purchaseType,omitempty"`
  1665. // StartTimeMillis: Time at which the subscription was granted, in
  1666. // milliseconds since the Epoch.
  1667. StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"`
  1668. // UserCancellationTimeMillis: The time at which the subscription was
  1669. // canceled by the user, in milliseconds since the epoch. Only present
  1670. // if cancelReason is 0.
  1671. UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"`
  1672. // ServerResponse contains the HTTP response code and headers from the
  1673. // server.
  1674. googleapi.ServerResponse `json:"-"`
  1675. // ForceSendFields is a list of field names (e.g. "AutoRenewing") to
  1676. // unconditionally include in API requests. By default, fields with
  1677. // empty values are omitted from API requests. However, any non-pointer,
  1678. // non-interface field appearing in ForceSendFields will be sent to the
  1679. // server regardless of whether the field is empty or not. This may be
  1680. // used to include empty fields in Patch requests.
  1681. ForceSendFields []string `json:"-"`
  1682. // NullFields is a list of field names (e.g. "AutoRenewing") to include
  1683. // in API requests with the JSON null value. By default, fields with
  1684. // empty values are omitted from API requests. However, any field with
  1685. // an empty value appearing in NullFields will be sent to the server as
  1686. // null. It is an error if a field in this list has a non-empty value.
  1687. // This may be used to include null fields in Patch requests.
  1688. NullFields []string `json:"-"`
  1689. }
  1690. func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) {
  1691. type NoMethod SubscriptionPurchase
  1692. raw := NoMethod(*s)
  1693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1694. }
  1695. type SubscriptionPurchasesDeferRequest struct {
  1696. // DeferralInfo: The information about the new desired expiry time for
  1697. // the subscription.
  1698. DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"`
  1699. // ForceSendFields is a list of field names (e.g. "DeferralInfo") to
  1700. // unconditionally include in API requests. By default, fields with
  1701. // empty values are omitted from API requests. However, any non-pointer,
  1702. // non-interface field appearing in ForceSendFields will be sent to the
  1703. // server regardless of whether the field is empty or not. This may be
  1704. // used to include empty fields in Patch requests.
  1705. ForceSendFields []string `json:"-"`
  1706. // NullFields is a list of field names (e.g. "DeferralInfo") to include
  1707. // in API requests with the JSON null value. By default, fields with
  1708. // empty values are omitted from API requests. However, any field with
  1709. // an empty value appearing in NullFields will be sent to the server as
  1710. // null. It is an error if a field in this list has a non-empty value.
  1711. // This may be used to include null fields in Patch requests.
  1712. NullFields []string `json:"-"`
  1713. }
  1714. func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) {
  1715. type NoMethod SubscriptionPurchasesDeferRequest
  1716. raw := NoMethod(*s)
  1717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1718. }
  1719. type SubscriptionPurchasesDeferResponse struct {
  1720. // NewExpiryTimeMillis: The new expiry time for the subscription in
  1721. // milliseconds since the Epoch.
  1722. NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"`
  1723. // ServerResponse contains the HTTP response code and headers from the
  1724. // server.
  1725. googleapi.ServerResponse `json:"-"`
  1726. // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis")
  1727. // to unconditionally include in API requests. By default, fields with
  1728. // empty values are omitted from API requests. However, any non-pointer,
  1729. // non-interface field appearing in ForceSendFields will be sent to the
  1730. // server regardless of whether the field is empty or not. This may be
  1731. // used to include empty fields in Patch requests.
  1732. ForceSendFields []string `json:"-"`
  1733. // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to
  1734. // include in API requests with the JSON null value. By default, fields
  1735. // with empty values are omitted from API requests. However, any field
  1736. // with an empty value appearing in NullFields will be sent to the
  1737. // server as null. It is an error if a field in this list has a
  1738. // non-empty value. This may be used to include null fields in Patch
  1739. // requests.
  1740. NullFields []string `json:"-"`
  1741. }
  1742. func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) {
  1743. type NoMethod SubscriptionPurchasesDeferResponse
  1744. raw := NoMethod(*s)
  1745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1746. }
  1747. type Testers struct {
  1748. GoogleGroups []string `json:"googleGroups,omitempty"`
  1749. GooglePlusCommunities []string `json:"googlePlusCommunities,omitempty"`
  1750. // ServerResponse contains the HTTP response code and headers from the
  1751. // server.
  1752. googleapi.ServerResponse `json:"-"`
  1753. // ForceSendFields is a list of field names (e.g. "GoogleGroups") to
  1754. // unconditionally include in API requests. By default, fields with
  1755. // empty values are omitted from API requests. However, any non-pointer,
  1756. // non-interface field appearing in ForceSendFields will be sent to the
  1757. // server regardless of whether the field is empty or not. This may be
  1758. // used to include empty fields in Patch requests.
  1759. ForceSendFields []string `json:"-"`
  1760. // NullFields is a list of field names (e.g. "GoogleGroups") to include
  1761. // in API requests with the JSON null value. By default, fields with
  1762. // empty values are omitted from API requests. However, any field with
  1763. // an empty value appearing in NullFields will be sent to the server as
  1764. // null. It is an error if a field in this list has a non-empty value.
  1765. // This may be used to include null fields in Patch requests.
  1766. NullFields []string `json:"-"`
  1767. }
  1768. func (s *Testers) MarshalJSON() ([]byte, error) {
  1769. type NoMethod Testers
  1770. raw := NoMethod(*s)
  1771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1772. }
  1773. type Timestamp struct {
  1774. Nanos int64 `json:"nanos,omitempty"`
  1775. Seconds int64 `json:"seconds,omitempty,string"`
  1776. // ForceSendFields is a list of field names (e.g. "Nanos") to
  1777. // unconditionally include in API requests. By default, fields with
  1778. // empty values are omitted from API requests. However, any non-pointer,
  1779. // non-interface field appearing in ForceSendFields will be sent to the
  1780. // server regardless of whether the field is empty or not. This may be
  1781. // used to include empty fields in Patch requests.
  1782. ForceSendFields []string `json:"-"`
  1783. // NullFields is a list of field names (e.g. "Nanos") to include in API
  1784. // requests with the JSON null value. By default, fields with empty
  1785. // values are omitted from API requests. However, any field with an
  1786. // empty value appearing in NullFields will be sent to the server as
  1787. // null. It is an error if a field in this list has a non-empty value.
  1788. // This may be used to include null fields in Patch requests.
  1789. NullFields []string `json:"-"`
  1790. }
  1791. func (s *Timestamp) MarshalJSON() ([]byte, error) {
  1792. type NoMethod Timestamp
  1793. raw := NoMethod(*s)
  1794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1795. }
  1796. type TokenPagination struct {
  1797. NextPageToken string `json:"nextPageToken,omitempty"`
  1798. PreviousPageToken string `json:"previousPageToken,omitempty"`
  1799. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1800. // unconditionally include in API requests. By default, fields with
  1801. // empty values are omitted from API requests. However, any non-pointer,
  1802. // non-interface field appearing in ForceSendFields will be sent to the
  1803. // server regardless of whether the field is empty or not. This may be
  1804. // used to include empty fields in Patch requests.
  1805. ForceSendFields []string `json:"-"`
  1806. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1807. // in API requests with the JSON null value. By default, fields with
  1808. // empty values are omitted from API requests. However, any field with
  1809. // an empty value appearing in NullFields will be sent to the server as
  1810. // null. It is an error if a field in this list has a non-empty value.
  1811. // This may be used to include null fields in Patch requests.
  1812. NullFields []string `json:"-"`
  1813. }
  1814. func (s *TokenPagination) MarshalJSON() ([]byte, error) {
  1815. type NoMethod TokenPagination
  1816. raw := NoMethod(*s)
  1817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1818. }
  1819. type Track struct {
  1820. // Releases: A list of all active releases in this track during a read
  1821. // request. On an update request, it represents desired changes.
  1822. Releases []*TrackRelease `json:"releases,omitempty"`
  1823. // Track: Identifier for this track.
  1824. Track string `json:"track,omitempty"`
  1825. // ServerResponse contains the HTTP response code and headers from the
  1826. // server.
  1827. googleapi.ServerResponse `json:"-"`
  1828. // ForceSendFields is a list of field names (e.g. "Releases") to
  1829. // unconditionally include in API requests. By default, fields with
  1830. // empty values are omitted from API requests. However, any non-pointer,
  1831. // non-interface field appearing in ForceSendFields will be sent to the
  1832. // server regardless of whether the field is empty or not. This may be
  1833. // used to include empty fields in Patch requests.
  1834. ForceSendFields []string `json:"-"`
  1835. // NullFields is a list of field names (e.g. "Releases") to include in
  1836. // API requests with the JSON null value. By default, fields with empty
  1837. // values are omitted from API requests. However, any field with an
  1838. // empty value appearing in NullFields will be sent to the server as
  1839. // null. It is an error if a field in this list has a non-empty value.
  1840. // This may be used to include null fields in Patch requests.
  1841. NullFields []string `json:"-"`
  1842. }
  1843. func (s *Track) MarshalJSON() ([]byte, error) {
  1844. type NoMethod Track
  1845. raw := NoMethod(*s)
  1846. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1847. }
  1848. type TrackRelease struct {
  1849. // Name: The release name, used to identify this release in the Play
  1850. // Console UI. Not required to be unique. This is optional, if not set
  1851. // it will be generated from the version_name in the APKs.
  1852. Name string `json:"name,omitempty"`
  1853. // ReleaseNotes: The description of what is new in the app in this
  1854. // release.
  1855. ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"`
  1856. // Status: The desired status of this release.
  1857. Status string `json:"status,omitempty"`
  1858. // UserFraction: Fraction of users who are eligible to receive the
  1859. // release. 0 < fraction < 1. To be set, release status must be
  1860. // "inProgress" or "halted".
  1861. UserFraction float64 `json:"userFraction,omitempty"`
  1862. // VersionCodes: A list of all version codes of APKs that will be
  1863. // exposed to the users of this track when this release is rolled out.
  1864. // Note that this list should contain all versions you wish to be
  1865. // active, including those you wish to retain from previous releases.
  1866. VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"`
  1867. // ForceSendFields is a list of field names (e.g. "Name") to
  1868. // unconditionally include in API requests. By default, fields with
  1869. // empty values are omitted from API requests. However, any non-pointer,
  1870. // non-interface field appearing in ForceSendFields will be sent to the
  1871. // server regardless of whether the field is empty or not. This may be
  1872. // used to include empty fields in Patch requests.
  1873. ForceSendFields []string `json:"-"`
  1874. // NullFields is a list of field names (e.g. "Name") to include in API
  1875. // requests with the JSON null value. By default, fields with empty
  1876. // values are omitted from API requests. However, any field with an
  1877. // empty value appearing in NullFields will be sent to the server as
  1878. // null. It is an error if a field in this list has a non-empty value.
  1879. // This may be used to include null fields in Patch requests.
  1880. NullFields []string `json:"-"`
  1881. }
  1882. func (s *TrackRelease) MarshalJSON() ([]byte, error) {
  1883. type NoMethod TrackRelease
  1884. raw := NoMethod(*s)
  1885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1886. }
  1887. func (s *TrackRelease) UnmarshalJSON(data []byte) error {
  1888. type NoMethod TrackRelease
  1889. var s1 struct {
  1890. UserFraction gensupport.JSONFloat64 `json:"userFraction"`
  1891. *NoMethod
  1892. }
  1893. s1.NoMethod = (*NoMethod)(s)
  1894. if err := json.Unmarshal(data, &s1); err != nil {
  1895. return err
  1896. }
  1897. s.UserFraction = float64(s1.UserFraction)
  1898. return nil
  1899. }
  1900. type TracksListResponse struct {
  1901. // Kind: Identifies what kind of resource this is. Value: the fixed
  1902. // string "androidpublisher#tracksListResponse".
  1903. Kind string `json:"kind,omitempty"`
  1904. Tracks []*Track `json:"tracks,omitempty"`
  1905. // ServerResponse contains the HTTP response code and headers from the
  1906. // server.
  1907. googleapi.ServerResponse `json:"-"`
  1908. // ForceSendFields is a list of field names (e.g. "Kind") to
  1909. // unconditionally include in API requests. By default, fields with
  1910. // empty values are omitted from API requests. However, any non-pointer,
  1911. // non-interface field appearing in ForceSendFields will be sent to the
  1912. // server regardless of whether the field is empty or not. This may be
  1913. // used to include empty fields in Patch requests.
  1914. ForceSendFields []string `json:"-"`
  1915. // NullFields is a list of field names (e.g. "Kind") to include in API
  1916. // requests with the JSON null value. By default, fields with empty
  1917. // values are omitted from API requests. However, any field with an
  1918. // empty value appearing in NullFields will be sent to the server as
  1919. // null. It is an error if a field in this list has a non-empty value.
  1920. // This may be used to include null fields in Patch requests.
  1921. NullFields []string `json:"-"`
  1922. }
  1923. func (s *TracksListResponse) MarshalJSON() ([]byte, error) {
  1924. type NoMethod TracksListResponse
  1925. raw := NoMethod(*s)
  1926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1927. }
  1928. type UserComment struct {
  1929. // AndroidOsVersion: Integer Android SDK version of the user's device at
  1930. // the time the review was written, e.g. 23 is Marshmallow. May be
  1931. // absent.
  1932. AndroidOsVersion int64 `json:"androidOsVersion,omitempty"`
  1933. // AppVersionCode: Integer version code of the app as installed at the
  1934. // time the review was written. May be absent.
  1935. AppVersionCode int64 `json:"appVersionCode,omitempty"`
  1936. // AppVersionName: String version name of the app as installed at the
  1937. // time the review was written. May be absent.
  1938. AppVersionName string `json:"appVersionName,omitempty"`
  1939. // Device: Codename for the reviewer's device, e.g. klte, flounder. May
  1940. // be absent.
  1941. Device string `json:"device,omitempty"`
  1942. // DeviceMetadata: Some information about the characteristics of the
  1943. // user's device
  1944. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1945. // LastModified: The last time at which this comment was updated.
  1946. LastModified *Timestamp `json:"lastModified,omitempty"`
  1947. // OriginalText: Untranslated text of the review, in the case where the
  1948. // review has been translated. If the review has not been translated
  1949. // this is left blank.
  1950. OriginalText string `json:"originalText,omitempty"`
  1951. // ReviewerLanguage: Language code for the reviewer. This is taken from
  1952. // the device settings so is not guaranteed to match the language the
  1953. // review is written in. May be absent.
  1954. ReviewerLanguage string `json:"reviewerLanguage,omitempty"`
  1955. // StarRating: The star rating associated with the review, from 1 to 5.
  1956. StarRating int64 `json:"starRating,omitempty"`
  1957. // Text: The content of the comment, i.e. review body. In some cases
  1958. // users have been able to write a review with separate title and body;
  1959. // in those cases the title and body are concatenated and separated by a
  1960. // tab character.
  1961. Text string `json:"text,omitempty"`
  1962. // ThumbsDownCount: Number of users who have given this review a thumbs
  1963. // down
  1964. ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"`
  1965. // ThumbsUpCount: Number of users who have given this review a thumbs up
  1966. ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"`
  1967. // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to
  1968. // unconditionally include in API requests. By default, fields with
  1969. // empty values are omitted from API requests. However, any non-pointer,
  1970. // non-interface field appearing in ForceSendFields will be sent to the
  1971. // server regardless of whether the field is empty or not. This may be
  1972. // used to include empty fields in Patch requests.
  1973. ForceSendFields []string `json:"-"`
  1974. // NullFields is a list of field names (e.g. "AndroidOsVersion") to
  1975. // include in API requests with the JSON null value. By default, fields
  1976. // with empty values are omitted from API requests. However, any field
  1977. // with an empty value appearing in NullFields will be sent to the
  1978. // server as null. It is an error if a field in this list has a
  1979. // non-empty value. This may be used to include null fields in Patch
  1980. // requests.
  1981. NullFields []string `json:"-"`
  1982. }
  1983. func (s *UserComment) MarshalJSON() ([]byte, error) {
  1984. type NoMethod UserComment
  1985. raw := NoMethod(*s)
  1986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1987. }
  1988. // VoidedPurchase: A VoidedPurchase resource indicates a purchase that
  1989. // was either canceled/refunded/charged-back.
  1990. type VoidedPurchase struct {
  1991. // Kind: This kind represents a voided purchase object in the
  1992. // androidpublisher service.
  1993. Kind string `json:"kind,omitempty"`
  1994. // PurchaseTimeMillis: The time at which the purchase was made, in
  1995. // milliseconds since the epoch (Jan 1, 1970).
  1996. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1997. // PurchaseToken: The token that was generated when a purchase was made.
  1998. // This uniquely identifies a purchase.
  1999. PurchaseToken string `json:"purchaseToken,omitempty"`
  2000. // VoidedTimeMillis: The time at which the purchase was
  2001. // canceled/refunded/charged-back, in milliseconds since the epoch (Jan
  2002. // 1, 1970).
  2003. VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"`
  2004. // ForceSendFields is a list of field names (e.g. "Kind") to
  2005. // unconditionally include in API requests. By default, fields with
  2006. // empty values are omitted from API requests. However, any non-pointer,
  2007. // non-interface field appearing in ForceSendFields will be sent to the
  2008. // server regardless of whether the field is empty or not. This may be
  2009. // used to include empty fields in Patch requests.
  2010. ForceSendFields []string `json:"-"`
  2011. // NullFields is a list of field names (e.g. "Kind") to include in API
  2012. // requests with the JSON null value. By default, fields with empty
  2013. // values are omitted from API requests. However, any field with an
  2014. // empty value appearing in NullFields will be sent to the server as
  2015. // null. It is an error if a field in this list has a non-empty value.
  2016. // This may be used to include null fields in Patch requests.
  2017. NullFields []string `json:"-"`
  2018. }
  2019. func (s *VoidedPurchase) MarshalJSON() ([]byte, error) {
  2020. type NoMethod VoidedPurchase
  2021. raw := NoMethod(*s)
  2022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2023. }
  2024. type VoidedPurchasesListResponse struct {
  2025. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2026. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2027. VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"`
  2028. // ServerResponse contains the HTTP response code and headers from the
  2029. // server.
  2030. googleapi.ServerResponse `json:"-"`
  2031. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  2032. // unconditionally include in API requests. By default, fields with
  2033. // empty values are omitted from API requests. However, any non-pointer,
  2034. // non-interface field appearing in ForceSendFields will be sent to the
  2035. // server regardless of whether the field is empty or not. This may be
  2036. // used to include empty fields in Patch requests.
  2037. ForceSendFields []string `json:"-"`
  2038. // NullFields is a list of field names (e.g. "PageInfo") to include in
  2039. // API requests with the JSON null value. By default, fields with empty
  2040. // values are omitted from API requests. However, any field with an
  2041. // empty value appearing in NullFields will be sent to the server as
  2042. // null. It is an error if a field in this list has a non-empty value.
  2043. // This may be used to include null fields in Patch requests.
  2044. NullFields []string `json:"-"`
  2045. }
  2046. func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) {
  2047. type NoMethod VoidedPurchasesListResponse
  2048. raw := NoMethod(*s)
  2049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2050. }
  2051. // method id "androidpublisher.edits.commit":
  2052. type EditsCommitCall struct {
  2053. s *Service
  2054. packageNameid string
  2055. editId string
  2056. urlParams_ gensupport.URLParams
  2057. ctx_ context.Context
  2058. header_ http.Header
  2059. }
  2060. // Commit: Commits/applies the changes made in this edit back to the
  2061. // app.
  2062. func (r *EditsService) Commit(packageNameid string, editId string) *EditsCommitCall {
  2063. c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2064. c.packageNameid = packageNameid
  2065. c.editId = editId
  2066. return c
  2067. }
  2068. // Fields allows partial responses to be retrieved. See
  2069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2070. // for more information.
  2071. func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall {
  2072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2073. return c
  2074. }
  2075. // Context sets the context to be used in this call's Do method. Any
  2076. // pending HTTP request will be aborted if the provided context is
  2077. // canceled.
  2078. func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall {
  2079. c.ctx_ = ctx
  2080. return c
  2081. }
  2082. // Header returns an http.Header that can be modified by the caller to
  2083. // add HTTP headers to the request.
  2084. func (c *EditsCommitCall) Header() http.Header {
  2085. if c.header_ == nil {
  2086. c.header_ = make(http.Header)
  2087. }
  2088. return c.header_
  2089. }
  2090. func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) {
  2091. reqHeaders := make(http.Header)
  2092. for k, v := range c.header_ {
  2093. reqHeaders[k] = v
  2094. }
  2095. reqHeaders.Set("User-Agent", c.s.userAgent())
  2096. var body io.Reader = nil
  2097. c.urlParams_.Set("alt", alt)
  2098. c.urlParams_.Set("prettyPrint", "false")
  2099. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:commit")
  2100. urls += "?" + c.urlParams_.Encode()
  2101. req, err := http.NewRequest("POST", urls, body)
  2102. if err != nil {
  2103. return nil, err
  2104. }
  2105. req.Header = reqHeaders
  2106. googleapi.Expand(req.URL, map[string]string{
  2107. "packageName": c.packageNameid,
  2108. "editId": c.editId,
  2109. })
  2110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2111. }
  2112. // Do executes the "androidpublisher.edits.commit" call.
  2113. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2114. // code is an error. Response headers are in either
  2115. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2116. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2117. // check whether the returned error was because http.StatusNotModified
  2118. // was returned.
  2119. func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2120. gensupport.SetOptions(c.urlParams_, opts...)
  2121. res, err := c.doRequest("json")
  2122. if res != nil && res.StatusCode == http.StatusNotModified {
  2123. if res.Body != nil {
  2124. res.Body.Close()
  2125. }
  2126. return nil, &googleapi.Error{
  2127. Code: res.StatusCode,
  2128. Header: res.Header,
  2129. }
  2130. }
  2131. if err != nil {
  2132. return nil, err
  2133. }
  2134. defer googleapi.CloseBody(res)
  2135. if err := googleapi.CheckResponse(res); err != nil {
  2136. return nil, err
  2137. }
  2138. ret := &AppEdit{
  2139. ServerResponse: googleapi.ServerResponse{
  2140. Header: res.Header,
  2141. HTTPStatusCode: res.StatusCode,
  2142. },
  2143. }
  2144. target := &ret
  2145. if err := gensupport.DecodeResponse(target, res); err != nil {
  2146. return nil, err
  2147. }
  2148. return ret, nil
  2149. // {
  2150. // "description": "Commits/applies the changes made in this edit back to the app.",
  2151. // "httpMethod": "POST",
  2152. // "id": "androidpublisher.edits.commit",
  2153. // "parameterOrder": [
  2154. // "packageName",
  2155. // "editId"
  2156. // ],
  2157. // "parameters": {
  2158. // "editId": {
  2159. // "description": "Unique identifier for this edit.",
  2160. // "location": "path",
  2161. // "required": true,
  2162. // "type": "string"
  2163. // },
  2164. // "packageName": {
  2165. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2166. // "location": "path",
  2167. // "required": true,
  2168. // "type": "string"
  2169. // }
  2170. // },
  2171. // "path": "{packageName}/edits/{editId}:commit",
  2172. // "response": {
  2173. // "$ref": "AppEdit"
  2174. // },
  2175. // "scopes": [
  2176. // "https://www.googleapis.com/auth/androidpublisher"
  2177. // ]
  2178. // }
  2179. }
  2180. // method id "androidpublisher.edits.delete":
  2181. type EditsDeleteCall struct {
  2182. s *Service
  2183. packageNameid string
  2184. editId string
  2185. urlParams_ gensupport.URLParams
  2186. ctx_ context.Context
  2187. header_ http.Header
  2188. }
  2189. // Delete: Deletes an edit for an app. Creating a new edit will
  2190. // automatically delete any of your previous edits so this method need
  2191. // only be called if you want to preemptively abandon an edit.
  2192. func (r *EditsService) Delete(packageNameid string, editId string) *EditsDeleteCall {
  2193. c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2194. c.packageNameid = packageNameid
  2195. c.editId = editId
  2196. return c
  2197. }
  2198. // Fields allows partial responses to be retrieved. See
  2199. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2200. // for more information.
  2201. func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall {
  2202. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2203. return c
  2204. }
  2205. // Context sets the context to be used in this call's Do method. Any
  2206. // pending HTTP request will be aborted if the provided context is
  2207. // canceled.
  2208. func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall {
  2209. c.ctx_ = ctx
  2210. return c
  2211. }
  2212. // Header returns an http.Header that can be modified by the caller to
  2213. // add HTTP headers to the request.
  2214. func (c *EditsDeleteCall) Header() http.Header {
  2215. if c.header_ == nil {
  2216. c.header_ = make(http.Header)
  2217. }
  2218. return c.header_
  2219. }
  2220. func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2221. reqHeaders := make(http.Header)
  2222. for k, v := range c.header_ {
  2223. reqHeaders[k] = v
  2224. }
  2225. reqHeaders.Set("User-Agent", c.s.userAgent())
  2226. var body io.Reader = nil
  2227. c.urlParams_.Set("alt", alt)
  2228. c.urlParams_.Set("prettyPrint", "false")
  2229. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2230. urls += "?" + c.urlParams_.Encode()
  2231. req, err := http.NewRequest("DELETE", urls, body)
  2232. if err != nil {
  2233. return nil, err
  2234. }
  2235. req.Header = reqHeaders
  2236. googleapi.Expand(req.URL, map[string]string{
  2237. "packageName": c.packageNameid,
  2238. "editId": c.editId,
  2239. })
  2240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2241. }
  2242. // Do executes the "androidpublisher.edits.delete" call.
  2243. func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2244. gensupport.SetOptions(c.urlParams_, opts...)
  2245. res, err := c.doRequest("json")
  2246. if err != nil {
  2247. return err
  2248. }
  2249. defer googleapi.CloseBody(res)
  2250. if err := googleapi.CheckResponse(res); err != nil {
  2251. return err
  2252. }
  2253. return nil
  2254. // {
  2255. // "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.",
  2256. // "httpMethod": "DELETE",
  2257. // "id": "androidpublisher.edits.delete",
  2258. // "parameterOrder": [
  2259. // "packageName",
  2260. // "editId"
  2261. // ],
  2262. // "parameters": {
  2263. // "editId": {
  2264. // "description": "Unique identifier for this edit.",
  2265. // "location": "path",
  2266. // "required": true,
  2267. // "type": "string"
  2268. // },
  2269. // "packageName": {
  2270. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2271. // "location": "path",
  2272. // "required": true,
  2273. // "type": "string"
  2274. // }
  2275. // },
  2276. // "path": "{packageName}/edits/{editId}",
  2277. // "scopes": [
  2278. // "https://www.googleapis.com/auth/androidpublisher"
  2279. // ]
  2280. // }
  2281. }
  2282. // method id "androidpublisher.edits.get":
  2283. type EditsGetCall struct {
  2284. s *Service
  2285. packageNameid string
  2286. editId string
  2287. urlParams_ gensupport.URLParams
  2288. ifNoneMatch_ string
  2289. ctx_ context.Context
  2290. header_ http.Header
  2291. }
  2292. // Get: Returns information about the edit specified. Calls will fail if
  2293. // the edit is no long active (e.g. has been deleted, superseded or
  2294. // expired).
  2295. func (r *EditsService) Get(packageNameid string, editId string) *EditsGetCall {
  2296. c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2297. c.packageNameid = packageNameid
  2298. c.editId = editId
  2299. return c
  2300. }
  2301. // Fields allows partial responses to be retrieved. See
  2302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2303. // for more information.
  2304. func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall {
  2305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2306. return c
  2307. }
  2308. // IfNoneMatch sets the optional parameter which makes the operation
  2309. // fail if the object's ETag matches the given value. This is useful for
  2310. // getting updates only after the object has changed since the last
  2311. // request. Use googleapi.IsNotModified to check whether the response
  2312. // error from Do is the result of In-None-Match.
  2313. func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall {
  2314. c.ifNoneMatch_ = entityTag
  2315. return c
  2316. }
  2317. // Context sets the context to be used in this call's Do method. Any
  2318. // pending HTTP request will be aborted if the provided context is
  2319. // canceled.
  2320. func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall {
  2321. c.ctx_ = ctx
  2322. return c
  2323. }
  2324. // Header returns an http.Header that can be modified by the caller to
  2325. // add HTTP headers to the request.
  2326. func (c *EditsGetCall) Header() http.Header {
  2327. if c.header_ == nil {
  2328. c.header_ = make(http.Header)
  2329. }
  2330. return c.header_
  2331. }
  2332. func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) {
  2333. reqHeaders := make(http.Header)
  2334. for k, v := range c.header_ {
  2335. reqHeaders[k] = v
  2336. }
  2337. reqHeaders.Set("User-Agent", c.s.userAgent())
  2338. if c.ifNoneMatch_ != "" {
  2339. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2340. }
  2341. var body io.Reader = nil
  2342. c.urlParams_.Set("alt", alt)
  2343. c.urlParams_.Set("prettyPrint", "false")
  2344. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2345. urls += "?" + c.urlParams_.Encode()
  2346. req, err := http.NewRequest("GET", urls, body)
  2347. if err != nil {
  2348. return nil, err
  2349. }
  2350. req.Header = reqHeaders
  2351. googleapi.Expand(req.URL, map[string]string{
  2352. "packageName": c.packageNameid,
  2353. "editId": c.editId,
  2354. })
  2355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2356. }
  2357. // Do executes the "androidpublisher.edits.get" call.
  2358. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2359. // code is an error. Response headers are in either
  2360. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2361. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2362. // check whether the returned error was because http.StatusNotModified
  2363. // was returned.
  2364. func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2365. gensupport.SetOptions(c.urlParams_, opts...)
  2366. res, err := c.doRequest("json")
  2367. if res != nil && res.StatusCode == http.StatusNotModified {
  2368. if res.Body != nil {
  2369. res.Body.Close()
  2370. }
  2371. return nil, &googleapi.Error{
  2372. Code: res.StatusCode,
  2373. Header: res.Header,
  2374. }
  2375. }
  2376. if err != nil {
  2377. return nil, err
  2378. }
  2379. defer googleapi.CloseBody(res)
  2380. if err := googleapi.CheckResponse(res); err != nil {
  2381. return nil, err
  2382. }
  2383. ret := &AppEdit{
  2384. ServerResponse: googleapi.ServerResponse{
  2385. Header: res.Header,
  2386. HTTPStatusCode: res.StatusCode,
  2387. },
  2388. }
  2389. target := &ret
  2390. if err := gensupport.DecodeResponse(target, res); err != nil {
  2391. return nil, err
  2392. }
  2393. return ret, nil
  2394. // {
  2395. // "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).",
  2396. // "httpMethod": "GET",
  2397. // "id": "androidpublisher.edits.get",
  2398. // "parameterOrder": [
  2399. // "packageName",
  2400. // "editId"
  2401. // ],
  2402. // "parameters": {
  2403. // "editId": {
  2404. // "description": "Unique identifier for this edit.",
  2405. // "location": "path",
  2406. // "required": true,
  2407. // "type": "string"
  2408. // },
  2409. // "packageName": {
  2410. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2411. // "location": "path",
  2412. // "required": true,
  2413. // "type": "string"
  2414. // }
  2415. // },
  2416. // "path": "{packageName}/edits/{editId}",
  2417. // "response": {
  2418. // "$ref": "AppEdit"
  2419. // },
  2420. // "scopes": [
  2421. // "https://www.googleapis.com/auth/androidpublisher"
  2422. // ]
  2423. // }
  2424. }
  2425. // method id "androidpublisher.edits.insert":
  2426. type EditsInsertCall struct {
  2427. s *Service
  2428. packageNameid string
  2429. appedit *AppEdit
  2430. urlParams_ gensupport.URLParams
  2431. ctx_ context.Context
  2432. header_ http.Header
  2433. }
  2434. // Insert: Creates a new edit for an app, populated with the app's
  2435. // current state.
  2436. func (r *EditsService) Insert(packageNameid string, appedit *AppEdit) *EditsInsertCall {
  2437. c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2438. c.packageNameid = packageNameid
  2439. c.appedit = appedit
  2440. return c
  2441. }
  2442. // Fields allows partial responses to be retrieved. See
  2443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2444. // for more information.
  2445. func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall {
  2446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2447. return c
  2448. }
  2449. // Context sets the context to be used in this call's Do method. Any
  2450. // pending HTTP request will be aborted if the provided context is
  2451. // canceled.
  2452. func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall {
  2453. c.ctx_ = ctx
  2454. return c
  2455. }
  2456. // Header returns an http.Header that can be modified by the caller to
  2457. // add HTTP headers to the request.
  2458. func (c *EditsInsertCall) Header() http.Header {
  2459. if c.header_ == nil {
  2460. c.header_ = make(http.Header)
  2461. }
  2462. return c.header_
  2463. }
  2464. func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) {
  2465. reqHeaders := make(http.Header)
  2466. for k, v := range c.header_ {
  2467. reqHeaders[k] = v
  2468. }
  2469. reqHeaders.Set("User-Agent", c.s.userAgent())
  2470. var body io.Reader = nil
  2471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit)
  2472. if err != nil {
  2473. return nil, err
  2474. }
  2475. reqHeaders.Set("Content-Type", "application/json")
  2476. c.urlParams_.Set("alt", alt)
  2477. c.urlParams_.Set("prettyPrint", "false")
  2478. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits")
  2479. urls += "?" + c.urlParams_.Encode()
  2480. req, err := http.NewRequest("POST", urls, body)
  2481. if err != nil {
  2482. return nil, err
  2483. }
  2484. req.Header = reqHeaders
  2485. googleapi.Expand(req.URL, map[string]string{
  2486. "packageName": c.packageNameid,
  2487. })
  2488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2489. }
  2490. // Do executes the "androidpublisher.edits.insert" call.
  2491. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2492. // code is an error. Response headers are in either
  2493. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2494. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2495. // check whether the returned error was because http.StatusNotModified
  2496. // was returned.
  2497. func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2498. gensupport.SetOptions(c.urlParams_, opts...)
  2499. res, err := c.doRequest("json")
  2500. if res != nil && res.StatusCode == http.StatusNotModified {
  2501. if res.Body != nil {
  2502. res.Body.Close()
  2503. }
  2504. return nil, &googleapi.Error{
  2505. Code: res.StatusCode,
  2506. Header: res.Header,
  2507. }
  2508. }
  2509. if err != nil {
  2510. return nil, err
  2511. }
  2512. defer googleapi.CloseBody(res)
  2513. if err := googleapi.CheckResponse(res); err != nil {
  2514. return nil, err
  2515. }
  2516. ret := &AppEdit{
  2517. ServerResponse: googleapi.ServerResponse{
  2518. Header: res.Header,
  2519. HTTPStatusCode: res.StatusCode,
  2520. },
  2521. }
  2522. target := &ret
  2523. if err := gensupport.DecodeResponse(target, res); err != nil {
  2524. return nil, err
  2525. }
  2526. return ret, nil
  2527. // {
  2528. // "description": "Creates a new edit for an app, populated with the app's current state.",
  2529. // "httpMethod": "POST",
  2530. // "id": "androidpublisher.edits.insert",
  2531. // "parameterOrder": [
  2532. // "packageName"
  2533. // ],
  2534. // "parameters": {
  2535. // "packageName": {
  2536. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2537. // "location": "path",
  2538. // "required": true,
  2539. // "type": "string"
  2540. // }
  2541. // },
  2542. // "path": "{packageName}/edits",
  2543. // "request": {
  2544. // "$ref": "AppEdit"
  2545. // },
  2546. // "response": {
  2547. // "$ref": "AppEdit"
  2548. // },
  2549. // "scopes": [
  2550. // "https://www.googleapis.com/auth/androidpublisher"
  2551. // ]
  2552. // }
  2553. }
  2554. // method id "androidpublisher.edits.validate":
  2555. type EditsValidateCall struct {
  2556. s *Service
  2557. packageNameid string
  2558. editId string
  2559. urlParams_ gensupport.URLParams
  2560. ctx_ context.Context
  2561. header_ http.Header
  2562. }
  2563. // Validate: Checks that the edit can be successfully committed. The
  2564. // edit's changes are not applied to the live app.
  2565. func (r *EditsService) Validate(packageNameid string, editId string) *EditsValidateCall {
  2566. c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2567. c.packageNameid = packageNameid
  2568. c.editId = editId
  2569. return c
  2570. }
  2571. // Fields allows partial responses to be retrieved. See
  2572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2573. // for more information.
  2574. func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall {
  2575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2576. return c
  2577. }
  2578. // Context sets the context to be used in this call's Do method. Any
  2579. // pending HTTP request will be aborted if the provided context is
  2580. // canceled.
  2581. func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall {
  2582. c.ctx_ = ctx
  2583. return c
  2584. }
  2585. // Header returns an http.Header that can be modified by the caller to
  2586. // add HTTP headers to the request.
  2587. func (c *EditsValidateCall) Header() http.Header {
  2588. if c.header_ == nil {
  2589. c.header_ = make(http.Header)
  2590. }
  2591. return c.header_
  2592. }
  2593. func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) {
  2594. reqHeaders := make(http.Header)
  2595. for k, v := range c.header_ {
  2596. reqHeaders[k] = v
  2597. }
  2598. reqHeaders.Set("User-Agent", c.s.userAgent())
  2599. var body io.Reader = nil
  2600. c.urlParams_.Set("alt", alt)
  2601. c.urlParams_.Set("prettyPrint", "false")
  2602. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:validate")
  2603. urls += "?" + c.urlParams_.Encode()
  2604. req, err := http.NewRequest("POST", urls, body)
  2605. if err != nil {
  2606. return nil, err
  2607. }
  2608. req.Header = reqHeaders
  2609. googleapi.Expand(req.URL, map[string]string{
  2610. "packageName": c.packageNameid,
  2611. "editId": c.editId,
  2612. })
  2613. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2614. }
  2615. // Do executes the "androidpublisher.edits.validate" call.
  2616. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2617. // code is an error. Response headers are in either
  2618. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2619. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2620. // check whether the returned error was because http.StatusNotModified
  2621. // was returned.
  2622. func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2623. gensupport.SetOptions(c.urlParams_, opts...)
  2624. res, err := c.doRequest("json")
  2625. if res != nil && res.StatusCode == http.StatusNotModified {
  2626. if res.Body != nil {
  2627. res.Body.Close()
  2628. }
  2629. return nil, &googleapi.Error{
  2630. Code: res.StatusCode,
  2631. Header: res.Header,
  2632. }
  2633. }
  2634. if err != nil {
  2635. return nil, err
  2636. }
  2637. defer googleapi.CloseBody(res)
  2638. if err := googleapi.CheckResponse(res); err != nil {
  2639. return nil, err
  2640. }
  2641. ret := &AppEdit{
  2642. ServerResponse: googleapi.ServerResponse{
  2643. Header: res.Header,
  2644. HTTPStatusCode: res.StatusCode,
  2645. },
  2646. }
  2647. target := &ret
  2648. if err := gensupport.DecodeResponse(target, res); err != nil {
  2649. return nil, err
  2650. }
  2651. return ret, nil
  2652. // {
  2653. // "description": "Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.",
  2654. // "httpMethod": "POST",
  2655. // "id": "androidpublisher.edits.validate",
  2656. // "parameterOrder": [
  2657. // "packageName",
  2658. // "editId"
  2659. // ],
  2660. // "parameters": {
  2661. // "editId": {
  2662. // "description": "Unique identifier for this edit.",
  2663. // "location": "path",
  2664. // "required": true,
  2665. // "type": "string"
  2666. // },
  2667. // "packageName": {
  2668. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2669. // "location": "path",
  2670. // "required": true,
  2671. // "type": "string"
  2672. // }
  2673. // },
  2674. // "path": "{packageName}/edits/{editId}:validate",
  2675. // "response": {
  2676. // "$ref": "AppEdit"
  2677. // },
  2678. // "scopes": [
  2679. // "https://www.googleapis.com/auth/androidpublisher"
  2680. // ]
  2681. // }
  2682. }
  2683. // method id "androidpublisher.edits.apks.addexternallyhosted":
  2684. type EditsApksAddexternallyhostedCall struct {
  2685. s *Service
  2686. packageNameid string
  2687. editId string
  2688. apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest
  2689. urlParams_ gensupport.URLParams
  2690. ctx_ context.Context
  2691. header_ http.Header
  2692. }
  2693. // Addexternallyhosted: Creates a new APK without uploading the APK
  2694. // itself to Google Play, instead hosting the APK at a specified URL.
  2695. // This function is only available to enterprises using Google Play for
  2696. // Work whose application is configured to restrict distribution to the
  2697. // enterprise domain.
  2698. func (r *EditsApksService) Addexternallyhosted(packageNameid string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall {
  2699. c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2700. c.packageNameid = packageNameid
  2701. c.editId = editId
  2702. c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest
  2703. return c
  2704. }
  2705. // Fields allows partial responses to be retrieved. See
  2706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2707. // for more information.
  2708. func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall {
  2709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2710. return c
  2711. }
  2712. // Context sets the context to be used in this call's Do method. Any
  2713. // pending HTTP request will be aborted if the provided context is
  2714. // canceled.
  2715. func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall {
  2716. c.ctx_ = ctx
  2717. return c
  2718. }
  2719. // Header returns an http.Header that can be modified by the caller to
  2720. // add HTTP headers to the request.
  2721. func (c *EditsApksAddexternallyhostedCall) Header() http.Header {
  2722. if c.header_ == nil {
  2723. c.header_ = make(http.Header)
  2724. }
  2725. return c.header_
  2726. }
  2727. func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) {
  2728. reqHeaders := make(http.Header)
  2729. for k, v := range c.header_ {
  2730. reqHeaders[k] = v
  2731. }
  2732. reqHeaders.Set("User-Agent", c.s.userAgent())
  2733. var body io.Reader = nil
  2734. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest)
  2735. if err != nil {
  2736. return nil, err
  2737. }
  2738. reqHeaders.Set("Content-Type", "application/json")
  2739. c.urlParams_.Set("alt", alt)
  2740. c.urlParams_.Set("prettyPrint", "false")
  2741. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/externallyHosted")
  2742. urls += "?" + c.urlParams_.Encode()
  2743. req, err := http.NewRequest("POST", urls, body)
  2744. if err != nil {
  2745. return nil, err
  2746. }
  2747. req.Header = reqHeaders
  2748. googleapi.Expand(req.URL, map[string]string{
  2749. "packageName": c.packageNameid,
  2750. "editId": c.editId,
  2751. })
  2752. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2753. }
  2754. // Do executes the "androidpublisher.edits.apks.addexternallyhosted" call.
  2755. // Exactly one of *ApksAddExternallyHostedResponse or error will be
  2756. // non-nil. Any non-2xx status code is an error. Response headers are in
  2757. // either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if
  2758. // a response was returned at all) in error.(*googleapi.Error).Header.
  2759. // Use googleapi.IsNotModified to check whether the returned error was
  2760. // because http.StatusNotModified was returned.
  2761. func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) {
  2762. gensupport.SetOptions(c.urlParams_, opts...)
  2763. res, err := c.doRequest("json")
  2764. if res != nil && res.StatusCode == http.StatusNotModified {
  2765. if res.Body != nil {
  2766. res.Body.Close()
  2767. }
  2768. return nil, &googleapi.Error{
  2769. Code: res.StatusCode,
  2770. Header: res.Header,
  2771. }
  2772. }
  2773. if err != nil {
  2774. return nil, err
  2775. }
  2776. defer googleapi.CloseBody(res)
  2777. if err := googleapi.CheckResponse(res); err != nil {
  2778. return nil, err
  2779. }
  2780. ret := &ApksAddExternallyHostedResponse{
  2781. ServerResponse: googleapi.ServerResponse{
  2782. Header: res.Header,
  2783. HTTPStatusCode: res.StatusCode,
  2784. },
  2785. }
  2786. target := &ret
  2787. if err := gensupport.DecodeResponse(target, res); err != nil {
  2788. return nil, err
  2789. }
  2790. return ret, nil
  2791. // {
  2792. // "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.",
  2793. // "httpMethod": "POST",
  2794. // "id": "androidpublisher.edits.apks.addexternallyhosted",
  2795. // "parameterOrder": [
  2796. // "packageName",
  2797. // "editId"
  2798. // ],
  2799. // "parameters": {
  2800. // "editId": {
  2801. // "description": "Unique identifier for this edit.",
  2802. // "location": "path",
  2803. // "required": true,
  2804. // "type": "string"
  2805. // },
  2806. // "packageName": {
  2807. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2808. // "location": "path",
  2809. // "required": true,
  2810. // "type": "string"
  2811. // }
  2812. // },
  2813. // "path": "{packageName}/edits/{editId}/apks/externallyHosted",
  2814. // "request": {
  2815. // "$ref": "ApksAddExternallyHostedRequest"
  2816. // },
  2817. // "response": {
  2818. // "$ref": "ApksAddExternallyHostedResponse"
  2819. // },
  2820. // "scopes": [
  2821. // "https://www.googleapis.com/auth/androidpublisher"
  2822. // ]
  2823. // }
  2824. }
  2825. // method id "androidpublisher.edits.apks.list":
  2826. type EditsApksListCall struct {
  2827. s *Service
  2828. packageNameid string
  2829. editId string
  2830. urlParams_ gensupport.URLParams
  2831. ifNoneMatch_ string
  2832. ctx_ context.Context
  2833. header_ http.Header
  2834. }
  2835. // List:
  2836. func (r *EditsApksService) List(packageNameid string, editId string) *EditsApksListCall {
  2837. c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2838. c.packageNameid = packageNameid
  2839. c.editId = editId
  2840. return c
  2841. }
  2842. // Fields allows partial responses to be retrieved. See
  2843. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2844. // for more information.
  2845. func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall {
  2846. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2847. return c
  2848. }
  2849. // IfNoneMatch sets the optional parameter which makes the operation
  2850. // fail if the object's ETag matches the given value. This is useful for
  2851. // getting updates only after the object has changed since the last
  2852. // request. Use googleapi.IsNotModified to check whether the response
  2853. // error from Do is the result of In-None-Match.
  2854. func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall {
  2855. c.ifNoneMatch_ = entityTag
  2856. return c
  2857. }
  2858. // Context sets the context to be used in this call's Do method. Any
  2859. // pending HTTP request will be aborted if the provided context is
  2860. // canceled.
  2861. func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall {
  2862. c.ctx_ = ctx
  2863. return c
  2864. }
  2865. // Header returns an http.Header that can be modified by the caller to
  2866. // add HTTP headers to the request.
  2867. func (c *EditsApksListCall) Header() http.Header {
  2868. if c.header_ == nil {
  2869. c.header_ = make(http.Header)
  2870. }
  2871. return c.header_
  2872. }
  2873. func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) {
  2874. reqHeaders := make(http.Header)
  2875. for k, v := range c.header_ {
  2876. reqHeaders[k] = v
  2877. }
  2878. reqHeaders.Set("User-Agent", c.s.userAgent())
  2879. if c.ifNoneMatch_ != "" {
  2880. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2881. }
  2882. var body io.Reader = nil
  2883. c.urlParams_.Set("alt", alt)
  2884. c.urlParams_.Set("prettyPrint", "false")
  2885. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  2886. urls += "?" + c.urlParams_.Encode()
  2887. req, err := http.NewRequest("GET", urls, body)
  2888. if err != nil {
  2889. return nil, err
  2890. }
  2891. req.Header = reqHeaders
  2892. googleapi.Expand(req.URL, map[string]string{
  2893. "packageName": c.packageNameid,
  2894. "editId": c.editId,
  2895. })
  2896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2897. }
  2898. // Do executes the "androidpublisher.edits.apks.list" call.
  2899. // Exactly one of *ApksListResponse or error will be non-nil. Any
  2900. // non-2xx status code is an error. Response headers are in either
  2901. // *ApksListResponse.ServerResponse.Header or (if a response was
  2902. // returned at all) in error.(*googleapi.Error).Header. Use
  2903. // googleapi.IsNotModified to check whether the returned error was
  2904. // because http.StatusNotModified was returned.
  2905. func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) {
  2906. gensupport.SetOptions(c.urlParams_, opts...)
  2907. res, err := c.doRequest("json")
  2908. if res != nil && res.StatusCode == http.StatusNotModified {
  2909. if res.Body != nil {
  2910. res.Body.Close()
  2911. }
  2912. return nil, &googleapi.Error{
  2913. Code: res.StatusCode,
  2914. Header: res.Header,
  2915. }
  2916. }
  2917. if err != nil {
  2918. return nil, err
  2919. }
  2920. defer googleapi.CloseBody(res)
  2921. if err := googleapi.CheckResponse(res); err != nil {
  2922. return nil, err
  2923. }
  2924. ret := &ApksListResponse{
  2925. ServerResponse: googleapi.ServerResponse{
  2926. Header: res.Header,
  2927. HTTPStatusCode: res.StatusCode,
  2928. },
  2929. }
  2930. target := &ret
  2931. if err := gensupport.DecodeResponse(target, res); err != nil {
  2932. return nil, err
  2933. }
  2934. return ret, nil
  2935. // {
  2936. // "httpMethod": "GET",
  2937. // "id": "androidpublisher.edits.apks.list",
  2938. // "parameterOrder": [
  2939. // "packageName",
  2940. // "editId"
  2941. // ],
  2942. // "parameters": {
  2943. // "editId": {
  2944. // "description": "Unique identifier for this edit.",
  2945. // "location": "path",
  2946. // "required": true,
  2947. // "type": "string"
  2948. // },
  2949. // "packageName": {
  2950. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2951. // "location": "path",
  2952. // "required": true,
  2953. // "type": "string"
  2954. // }
  2955. // },
  2956. // "path": "{packageName}/edits/{editId}/apks",
  2957. // "response": {
  2958. // "$ref": "ApksListResponse"
  2959. // },
  2960. // "scopes": [
  2961. // "https://www.googleapis.com/auth/androidpublisher"
  2962. // ]
  2963. // }
  2964. }
  2965. // method id "androidpublisher.edits.apks.upload":
  2966. type EditsApksUploadCall struct {
  2967. s *Service
  2968. packageNameid string
  2969. editId string
  2970. urlParams_ gensupport.URLParams
  2971. mediaInfo_ *gensupport.MediaInfo
  2972. ctx_ context.Context
  2973. header_ http.Header
  2974. }
  2975. // Upload:
  2976. func (r *EditsApksService) Upload(packageNameid string, editId string) *EditsApksUploadCall {
  2977. c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2978. c.packageNameid = packageNameid
  2979. c.editId = editId
  2980. return c
  2981. }
  2982. // Media specifies the media to upload in one or more chunks. The chunk
  2983. // size may be controlled by supplying a MediaOption generated by
  2984. // googleapi.ChunkSize. The chunk size defaults to
  2985. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  2986. // upload request will be determined by sniffing the contents of r,
  2987. // unless a MediaOption generated by googleapi.ContentType is
  2988. // supplied.
  2989. // At most one of Media and ResumableMedia may be set.
  2990. func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall {
  2991. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  2992. return c
  2993. }
  2994. // ResumableMedia specifies the media to upload in chunks and can be
  2995. // canceled with ctx.
  2996. //
  2997. // Deprecated: use Media instead.
  2998. //
  2999. // At most one of Media and ResumableMedia may be set. mediaType
  3000. // identifies the MIME media type of the upload, such as "image/png". If
  3001. // mediaType is "", it will be auto-detected. The provided ctx will
  3002. // supersede any context previously provided to the Context method.
  3003. func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall {
  3004. c.ctx_ = ctx
  3005. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3006. return c
  3007. }
  3008. // ProgressUpdater provides a callback function that will be called
  3009. // after every chunk. It should be a low-latency function in order to
  3010. // not slow down the upload operation. This should only be called when
  3011. // using ResumableMedia (as opposed to Media).
  3012. func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall {
  3013. c.mediaInfo_.SetProgressUpdater(pu)
  3014. return c
  3015. }
  3016. // Fields allows partial responses to be retrieved. See
  3017. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3018. // for more information.
  3019. func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall {
  3020. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3021. return c
  3022. }
  3023. // Context sets the context to be used in this call's Do method. Any
  3024. // pending HTTP request will be aborted if the provided context is
  3025. // canceled.
  3026. // This context will supersede any context previously provided to the
  3027. // ResumableMedia method.
  3028. func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall {
  3029. c.ctx_ = ctx
  3030. return c
  3031. }
  3032. // Header returns an http.Header that can be modified by the caller to
  3033. // add HTTP headers to the request.
  3034. func (c *EditsApksUploadCall) Header() http.Header {
  3035. if c.header_ == nil {
  3036. c.header_ = make(http.Header)
  3037. }
  3038. return c.header_
  3039. }
  3040. func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) {
  3041. reqHeaders := make(http.Header)
  3042. for k, v := range c.header_ {
  3043. reqHeaders[k] = v
  3044. }
  3045. reqHeaders.Set("User-Agent", c.s.userAgent())
  3046. var body io.Reader = nil
  3047. c.urlParams_.Set("alt", alt)
  3048. c.urlParams_.Set("prettyPrint", "false")
  3049. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  3050. if c.mediaInfo_ != nil {
  3051. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3052. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3053. }
  3054. if body == nil {
  3055. body = new(bytes.Buffer)
  3056. reqHeaders.Set("Content-Type", "application/json")
  3057. }
  3058. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3059. defer cleanup()
  3060. urls += "?" + c.urlParams_.Encode()
  3061. req, err := http.NewRequest("POST", urls, body)
  3062. if err != nil {
  3063. return nil, err
  3064. }
  3065. req.Header = reqHeaders
  3066. req.GetBody = getBody
  3067. googleapi.Expand(req.URL, map[string]string{
  3068. "packageName": c.packageNameid,
  3069. "editId": c.editId,
  3070. })
  3071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3072. }
  3073. // Do executes the "androidpublisher.edits.apks.upload" call.
  3074. // Exactly one of *Apk or error will be non-nil. Any non-2xx status code
  3075. // is an error. Response headers are in either
  3076. // *Apk.ServerResponse.Header or (if a response was returned at all) in
  3077. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3078. // whether the returned error was because http.StatusNotModified was
  3079. // returned.
  3080. func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) {
  3081. gensupport.SetOptions(c.urlParams_, opts...)
  3082. res, err := c.doRequest("json")
  3083. if res != nil && res.StatusCode == http.StatusNotModified {
  3084. if res.Body != nil {
  3085. res.Body.Close()
  3086. }
  3087. return nil, &googleapi.Error{
  3088. Code: res.StatusCode,
  3089. Header: res.Header,
  3090. }
  3091. }
  3092. if err != nil {
  3093. return nil, err
  3094. }
  3095. defer googleapi.CloseBody(res)
  3096. if err := googleapi.CheckResponse(res); err != nil {
  3097. return nil, err
  3098. }
  3099. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3100. if rx != nil {
  3101. rx.Client = c.s.client
  3102. rx.UserAgent = c.s.userAgent()
  3103. ctx := c.ctx_
  3104. if ctx == nil {
  3105. ctx = context.TODO()
  3106. }
  3107. res, err = rx.Upload(ctx)
  3108. if err != nil {
  3109. return nil, err
  3110. }
  3111. defer res.Body.Close()
  3112. if err := googleapi.CheckResponse(res); err != nil {
  3113. return nil, err
  3114. }
  3115. }
  3116. ret := &Apk{
  3117. ServerResponse: googleapi.ServerResponse{
  3118. Header: res.Header,
  3119. HTTPStatusCode: res.StatusCode,
  3120. },
  3121. }
  3122. target := &ret
  3123. if err := gensupport.DecodeResponse(target, res); err != nil {
  3124. return nil, err
  3125. }
  3126. return ret, nil
  3127. // {
  3128. // "httpMethod": "POST",
  3129. // "id": "androidpublisher.edits.apks.upload",
  3130. // "mediaUpload": {
  3131. // "accept": [
  3132. // "application/octet-stream",
  3133. // "application/vnd.android.package-archive"
  3134. // ],
  3135. // "maxSize": "1GB",
  3136. // "protocols": {
  3137. // "resumable": {
  3138. // "multipart": true,
  3139. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks"
  3140. // },
  3141. // "simple": {
  3142. // "multipart": true,
  3143. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks"
  3144. // }
  3145. // }
  3146. // },
  3147. // "parameterOrder": [
  3148. // "packageName",
  3149. // "editId"
  3150. // ],
  3151. // "parameters": {
  3152. // "editId": {
  3153. // "description": "Unique identifier for this edit.",
  3154. // "location": "path",
  3155. // "required": true,
  3156. // "type": "string"
  3157. // },
  3158. // "packageName": {
  3159. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3160. // "location": "path",
  3161. // "required": true,
  3162. // "type": "string"
  3163. // }
  3164. // },
  3165. // "path": "{packageName}/edits/{editId}/apks",
  3166. // "response": {
  3167. // "$ref": "Apk"
  3168. // },
  3169. // "scopes": [
  3170. // "https://www.googleapis.com/auth/androidpublisher"
  3171. // ],
  3172. // "supportsMediaUpload": true
  3173. // }
  3174. }
  3175. // method id "androidpublisher.edits.bundles.list":
  3176. type EditsBundlesListCall struct {
  3177. s *Service
  3178. packageNameid string
  3179. editId string
  3180. urlParams_ gensupport.URLParams
  3181. ifNoneMatch_ string
  3182. ctx_ context.Context
  3183. header_ http.Header
  3184. }
  3185. // List:
  3186. func (r *EditsBundlesService) List(packageNameid string, editId string) *EditsBundlesListCall {
  3187. c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3188. c.packageNameid = packageNameid
  3189. c.editId = editId
  3190. return c
  3191. }
  3192. // Fields allows partial responses to be retrieved. See
  3193. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3194. // for more information.
  3195. func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall {
  3196. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3197. return c
  3198. }
  3199. // IfNoneMatch sets the optional parameter which makes the operation
  3200. // fail if the object's ETag matches the given value. This is useful for
  3201. // getting updates only after the object has changed since the last
  3202. // request. Use googleapi.IsNotModified to check whether the response
  3203. // error from Do is the result of In-None-Match.
  3204. func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall {
  3205. c.ifNoneMatch_ = entityTag
  3206. return c
  3207. }
  3208. // Context sets the context to be used in this call's Do method. Any
  3209. // pending HTTP request will be aborted if the provided context is
  3210. // canceled.
  3211. func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall {
  3212. c.ctx_ = ctx
  3213. return c
  3214. }
  3215. // Header returns an http.Header that can be modified by the caller to
  3216. // add HTTP headers to the request.
  3217. func (c *EditsBundlesListCall) Header() http.Header {
  3218. if c.header_ == nil {
  3219. c.header_ = make(http.Header)
  3220. }
  3221. return c.header_
  3222. }
  3223. func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) {
  3224. reqHeaders := make(http.Header)
  3225. for k, v := range c.header_ {
  3226. reqHeaders[k] = v
  3227. }
  3228. reqHeaders.Set("User-Agent", c.s.userAgent())
  3229. if c.ifNoneMatch_ != "" {
  3230. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3231. }
  3232. var body io.Reader = nil
  3233. c.urlParams_.Set("alt", alt)
  3234. c.urlParams_.Set("prettyPrint", "false")
  3235. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  3236. urls += "?" + c.urlParams_.Encode()
  3237. req, err := http.NewRequest("GET", urls, body)
  3238. if err != nil {
  3239. return nil, err
  3240. }
  3241. req.Header = reqHeaders
  3242. googleapi.Expand(req.URL, map[string]string{
  3243. "packageName": c.packageNameid,
  3244. "editId": c.editId,
  3245. })
  3246. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3247. }
  3248. // Do executes the "androidpublisher.edits.bundles.list" call.
  3249. // Exactly one of *BundlesListResponse or error will be non-nil. Any
  3250. // non-2xx status code is an error. Response headers are in either
  3251. // *BundlesListResponse.ServerResponse.Header or (if a response was
  3252. // returned at all) in error.(*googleapi.Error).Header. Use
  3253. // googleapi.IsNotModified to check whether the returned error was
  3254. // because http.StatusNotModified was returned.
  3255. func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) {
  3256. gensupport.SetOptions(c.urlParams_, opts...)
  3257. res, err := c.doRequest("json")
  3258. if res != nil && res.StatusCode == http.StatusNotModified {
  3259. if res.Body != nil {
  3260. res.Body.Close()
  3261. }
  3262. return nil, &googleapi.Error{
  3263. Code: res.StatusCode,
  3264. Header: res.Header,
  3265. }
  3266. }
  3267. if err != nil {
  3268. return nil, err
  3269. }
  3270. defer googleapi.CloseBody(res)
  3271. if err := googleapi.CheckResponse(res); err != nil {
  3272. return nil, err
  3273. }
  3274. ret := &BundlesListResponse{
  3275. ServerResponse: googleapi.ServerResponse{
  3276. Header: res.Header,
  3277. HTTPStatusCode: res.StatusCode,
  3278. },
  3279. }
  3280. target := &ret
  3281. if err := gensupport.DecodeResponse(target, res); err != nil {
  3282. return nil, err
  3283. }
  3284. return ret, nil
  3285. // {
  3286. // "httpMethod": "GET",
  3287. // "id": "androidpublisher.edits.bundles.list",
  3288. // "parameterOrder": [
  3289. // "packageName",
  3290. // "editId"
  3291. // ],
  3292. // "parameters": {
  3293. // "editId": {
  3294. // "description": "Unique identifier for this edit.",
  3295. // "location": "path",
  3296. // "required": true,
  3297. // "type": "string"
  3298. // },
  3299. // "packageName": {
  3300. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3301. // "location": "path",
  3302. // "required": true,
  3303. // "type": "string"
  3304. // }
  3305. // },
  3306. // "path": "{packageName}/edits/{editId}/bundles",
  3307. // "response": {
  3308. // "$ref": "BundlesListResponse"
  3309. // },
  3310. // "scopes": [
  3311. // "https://www.googleapis.com/auth/androidpublisher"
  3312. // ]
  3313. // }
  3314. }
  3315. // method id "androidpublisher.edits.bundles.upload":
  3316. type EditsBundlesUploadCall struct {
  3317. s *Service
  3318. packageNameid string
  3319. editId string
  3320. urlParams_ gensupport.URLParams
  3321. mediaInfo_ *gensupport.MediaInfo
  3322. ctx_ context.Context
  3323. header_ http.Header
  3324. }
  3325. // Upload: Uploads a new Android App Bundle to this edit. If you are
  3326. // using the Google API client libraries, please increase the timeout of
  3327. // the http request before calling this endpoint (a timeout of 2 minutes
  3328. // is recommended). See:
  3329. // https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in
  3330. // java.
  3331. func (r *EditsBundlesService) Upload(packageNameid string, editId string) *EditsBundlesUploadCall {
  3332. c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3333. c.packageNameid = packageNameid
  3334. c.editId = editId
  3335. return c
  3336. }
  3337. // AckBundleInstallationWarning sets the optional parameter
  3338. // "ackBundleInstallationWarning": Must be set to true if the bundle
  3339. // installation may trigger a warning on user devices (for example, if
  3340. // installation size may be over a threshold, typically 100 MB).
  3341. func (c *EditsBundlesUploadCall) AckBundleInstallationWarning(ackBundleInstallationWarning bool) *EditsBundlesUploadCall {
  3342. c.urlParams_.Set("ackBundleInstallationWarning", fmt.Sprint(ackBundleInstallationWarning))
  3343. return c
  3344. }
  3345. // Media specifies the media to upload in one or more chunks. The chunk
  3346. // size may be controlled by supplying a MediaOption generated by
  3347. // googleapi.ChunkSize. The chunk size defaults to
  3348. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3349. // upload request will be determined by sniffing the contents of r,
  3350. // unless a MediaOption generated by googleapi.ContentType is
  3351. // supplied.
  3352. // At most one of Media and ResumableMedia may be set.
  3353. func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall {
  3354. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3355. return c
  3356. }
  3357. // ResumableMedia specifies the media to upload in chunks and can be
  3358. // canceled with ctx.
  3359. //
  3360. // Deprecated: use Media instead.
  3361. //
  3362. // At most one of Media and ResumableMedia may be set. mediaType
  3363. // identifies the MIME media type of the upload, such as "image/png". If
  3364. // mediaType is "", it will be auto-detected. The provided ctx will
  3365. // supersede any context previously provided to the Context method.
  3366. func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall {
  3367. c.ctx_ = ctx
  3368. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3369. return c
  3370. }
  3371. // ProgressUpdater provides a callback function that will be called
  3372. // after every chunk. It should be a low-latency function in order to
  3373. // not slow down the upload operation. This should only be called when
  3374. // using ResumableMedia (as opposed to Media).
  3375. func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall {
  3376. c.mediaInfo_.SetProgressUpdater(pu)
  3377. return c
  3378. }
  3379. // Fields allows partial responses to be retrieved. See
  3380. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3381. // for more information.
  3382. func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall {
  3383. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3384. return c
  3385. }
  3386. // Context sets the context to be used in this call's Do method. Any
  3387. // pending HTTP request will be aborted if the provided context is
  3388. // canceled.
  3389. // This context will supersede any context previously provided to the
  3390. // ResumableMedia method.
  3391. func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall {
  3392. c.ctx_ = ctx
  3393. return c
  3394. }
  3395. // Header returns an http.Header that can be modified by the caller to
  3396. // add HTTP headers to the request.
  3397. func (c *EditsBundlesUploadCall) Header() http.Header {
  3398. if c.header_ == nil {
  3399. c.header_ = make(http.Header)
  3400. }
  3401. return c.header_
  3402. }
  3403. func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) {
  3404. reqHeaders := make(http.Header)
  3405. for k, v := range c.header_ {
  3406. reqHeaders[k] = v
  3407. }
  3408. reqHeaders.Set("User-Agent", c.s.userAgent())
  3409. var body io.Reader = nil
  3410. c.urlParams_.Set("alt", alt)
  3411. c.urlParams_.Set("prettyPrint", "false")
  3412. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  3413. if c.mediaInfo_ != nil {
  3414. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3415. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3416. }
  3417. if body == nil {
  3418. body = new(bytes.Buffer)
  3419. reqHeaders.Set("Content-Type", "application/json")
  3420. }
  3421. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3422. defer cleanup()
  3423. urls += "?" + c.urlParams_.Encode()
  3424. req, err := http.NewRequest("POST", urls, body)
  3425. if err != nil {
  3426. return nil, err
  3427. }
  3428. req.Header = reqHeaders
  3429. req.GetBody = getBody
  3430. googleapi.Expand(req.URL, map[string]string{
  3431. "packageName": c.packageNameid,
  3432. "editId": c.editId,
  3433. })
  3434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3435. }
  3436. // Do executes the "androidpublisher.edits.bundles.upload" call.
  3437. // Exactly one of *Bundle or error will be non-nil. Any non-2xx status
  3438. // code is an error. Response headers are in either
  3439. // *Bundle.ServerResponse.Header or (if a response was returned at all)
  3440. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3441. // check whether the returned error was because http.StatusNotModified
  3442. // was returned.
  3443. func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) {
  3444. gensupport.SetOptions(c.urlParams_, opts...)
  3445. res, err := c.doRequest("json")
  3446. if res != nil && res.StatusCode == http.StatusNotModified {
  3447. if res.Body != nil {
  3448. res.Body.Close()
  3449. }
  3450. return nil, &googleapi.Error{
  3451. Code: res.StatusCode,
  3452. Header: res.Header,
  3453. }
  3454. }
  3455. if err != nil {
  3456. return nil, err
  3457. }
  3458. defer googleapi.CloseBody(res)
  3459. if err := googleapi.CheckResponse(res); err != nil {
  3460. return nil, err
  3461. }
  3462. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3463. if rx != nil {
  3464. rx.Client = c.s.client
  3465. rx.UserAgent = c.s.userAgent()
  3466. ctx := c.ctx_
  3467. if ctx == nil {
  3468. ctx = context.TODO()
  3469. }
  3470. res, err = rx.Upload(ctx)
  3471. if err != nil {
  3472. return nil, err
  3473. }
  3474. defer res.Body.Close()
  3475. if err := googleapi.CheckResponse(res); err != nil {
  3476. return nil, err
  3477. }
  3478. }
  3479. ret := &Bundle{
  3480. ServerResponse: googleapi.ServerResponse{
  3481. Header: res.Header,
  3482. HTTPStatusCode: res.StatusCode,
  3483. },
  3484. }
  3485. target := &ret
  3486. if err := gensupport.DecodeResponse(target, res); err != nil {
  3487. return nil, err
  3488. }
  3489. return ret, nil
  3490. // {
  3491. // "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.",
  3492. // "httpMethod": "POST",
  3493. // "id": "androidpublisher.edits.bundles.upload",
  3494. // "mediaUpload": {
  3495. // "accept": [
  3496. // "application/octet-stream"
  3497. // ],
  3498. // "maxSize": "2GB",
  3499. // "protocols": {
  3500. // "resumable": {
  3501. // "multipart": true,
  3502. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles"
  3503. // },
  3504. // "simple": {
  3505. // "multipart": true,
  3506. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles"
  3507. // }
  3508. // }
  3509. // },
  3510. // "parameterOrder": [
  3511. // "packageName",
  3512. // "editId"
  3513. // ],
  3514. // "parameters": {
  3515. // "ackBundleInstallationWarning": {
  3516. // "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).",
  3517. // "location": "query",
  3518. // "type": "boolean"
  3519. // },
  3520. // "editId": {
  3521. // "description": "Unique identifier for this edit.",
  3522. // "location": "path",
  3523. // "required": true,
  3524. // "type": "string"
  3525. // },
  3526. // "packageName": {
  3527. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3528. // "location": "path",
  3529. // "required": true,
  3530. // "type": "string"
  3531. // }
  3532. // },
  3533. // "path": "{packageName}/edits/{editId}/bundles",
  3534. // "response": {
  3535. // "$ref": "Bundle"
  3536. // },
  3537. // "scopes": [
  3538. // "https://www.googleapis.com/auth/androidpublisher"
  3539. // ],
  3540. // "supportsMediaUpload": true
  3541. // }
  3542. }
  3543. // method id "androidpublisher.edits.deobfuscationfiles.upload":
  3544. type EditsDeobfuscationfilesUploadCall struct {
  3545. s *Service
  3546. packageNameid string
  3547. editId string
  3548. apkVersionCode int64
  3549. deobfuscationFileType string
  3550. urlParams_ gensupport.URLParams
  3551. mediaInfo_ *gensupport.MediaInfo
  3552. ctx_ context.Context
  3553. header_ http.Header
  3554. }
  3555. // Upload: Uploads the deobfuscation file of the specified APK. If a
  3556. // deobfuscation file already exists, it will be replaced.
  3557. func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall {
  3558. c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3559. c.packageNameid = packageNameid
  3560. c.editId = editId
  3561. c.apkVersionCode = apkVersionCode
  3562. c.deobfuscationFileType = deobfuscationFileType
  3563. return c
  3564. }
  3565. // Media specifies the media to upload in one or more chunks. The chunk
  3566. // size may be controlled by supplying a MediaOption generated by
  3567. // googleapi.ChunkSize. The chunk size defaults to
  3568. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3569. // upload request will be determined by sniffing the contents of r,
  3570. // unless a MediaOption generated by googleapi.ContentType is
  3571. // supplied.
  3572. // At most one of Media and ResumableMedia may be set.
  3573. func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall {
  3574. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3575. return c
  3576. }
  3577. // ResumableMedia specifies the media to upload in chunks and can be
  3578. // canceled with ctx.
  3579. //
  3580. // Deprecated: use Media instead.
  3581. //
  3582. // At most one of Media and ResumableMedia may be set. mediaType
  3583. // identifies the MIME media type of the upload, such as "image/png". If
  3584. // mediaType is "", it will be auto-detected. The provided ctx will
  3585. // supersede any context previously provided to the Context method.
  3586. func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall {
  3587. c.ctx_ = ctx
  3588. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3589. return c
  3590. }
  3591. // ProgressUpdater provides a callback function that will be called
  3592. // after every chunk. It should be a low-latency function in order to
  3593. // not slow down the upload operation. This should only be called when
  3594. // using ResumableMedia (as opposed to Media).
  3595. func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall {
  3596. c.mediaInfo_.SetProgressUpdater(pu)
  3597. return c
  3598. }
  3599. // Fields allows partial responses to be retrieved. See
  3600. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3601. // for more information.
  3602. func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall {
  3603. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3604. return c
  3605. }
  3606. // Context sets the context to be used in this call's Do method. Any
  3607. // pending HTTP request will be aborted if the provided context is
  3608. // canceled.
  3609. // This context will supersede any context previously provided to the
  3610. // ResumableMedia method.
  3611. func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall {
  3612. c.ctx_ = ctx
  3613. return c
  3614. }
  3615. // Header returns an http.Header that can be modified by the caller to
  3616. // add HTTP headers to the request.
  3617. func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header {
  3618. if c.header_ == nil {
  3619. c.header_ = make(http.Header)
  3620. }
  3621. return c.header_
  3622. }
  3623. func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  3624. reqHeaders := make(http.Header)
  3625. for k, v := range c.header_ {
  3626. reqHeaders[k] = v
  3627. }
  3628. reqHeaders.Set("User-Agent", c.s.userAgent())
  3629. var body io.Reader = nil
  3630. c.urlParams_.Set("alt", alt)
  3631. c.urlParams_.Set("prettyPrint", "false")
  3632. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}")
  3633. if c.mediaInfo_ != nil {
  3634. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3635. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3636. }
  3637. if body == nil {
  3638. body = new(bytes.Buffer)
  3639. reqHeaders.Set("Content-Type", "application/json")
  3640. }
  3641. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3642. defer cleanup()
  3643. urls += "?" + c.urlParams_.Encode()
  3644. req, err := http.NewRequest("POST", urls, body)
  3645. if err != nil {
  3646. return nil, err
  3647. }
  3648. req.Header = reqHeaders
  3649. req.GetBody = getBody
  3650. googleapi.Expand(req.URL, map[string]string{
  3651. "packageName": c.packageNameid,
  3652. "editId": c.editId,
  3653. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3654. "deobfuscationFileType": c.deobfuscationFileType,
  3655. })
  3656. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3657. }
  3658. // Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call.
  3659. // Exactly one of *DeobfuscationFilesUploadResponse or error will be
  3660. // non-nil. Any non-2xx status code is an error. Response headers are in
  3661. // either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if
  3662. // a response was returned at all) in error.(*googleapi.Error).Header.
  3663. // Use googleapi.IsNotModified to check whether the returned error was
  3664. // because http.StatusNotModified was returned.
  3665. func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) {
  3666. gensupport.SetOptions(c.urlParams_, opts...)
  3667. res, err := c.doRequest("json")
  3668. if res != nil && res.StatusCode == http.StatusNotModified {
  3669. if res.Body != nil {
  3670. res.Body.Close()
  3671. }
  3672. return nil, &googleapi.Error{
  3673. Code: res.StatusCode,
  3674. Header: res.Header,
  3675. }
  3676. }
  3677. if err != nil {
  3678. return nil, err
  3679. }
  3680. defer googleapi.CloseBody(res)
  3681. if err := googleapi.CheckResponse(res); err != nil {
  3682. return nil, err
  3683. }
  3684. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3685. if rx != nil {
  3686. rx.Client = c.s.client
  3687. rx.UserAgent = c.s.userAgent()
  3688. ctx := c.ctx_
  3689. if ctx == nil {
  3690. ctx = context.TODO()
  3691. }
  3692. res, err = rx.Upload(ctx)
  3693. if err != nil {
  3694. return nil, err
  3695. }
  3696. defer res.Body.Close()
  3697. if err := googleapi.CheckResponse(res); err != nil {
  3698. return nil, err
  3699. }
  3700. }
  3701. ret := &DeobfuscationFilesUploadResponse{
  3702. ServerResponse: googleapi.ServerResponse{
  3703. Header: res.Header,
  3704. HTTPStatusCode: res.StatusCode,
  3705. },
  3706. }
  3707. target := &ret
  3708. if err := gensupport.DecodeResponse(target, res); err != nil {
  3709. return nil, err
  3710. }
  3711. return ret, nil
  3712. // {
  3713. // "description": "Uploads the deobfuscation file of the specified APK. If a deobfuscation file already exists, it will be replaced.",
  3714. // "httpMethod": "POST",
  3715. // "id": "androidpublisher.edits.deobfuscationfiles.upload",
  3716. // "mediaUpload": {
  3717. // "accept": [
  3718. // "application/octet-stream"
  3719. // ],
  3720. // "maxSize": "300MB",
  3721. // "protocols": {
  3722. // "resumable": {
  3723. // "multipart": true,
  3724. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  3725. // },
  3726. // "simple": {
  3727. // "multipart": true,
  3728. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  3729. // }
  3730. // }
  3731. // },
  3732. // "parameterOrder": [
  3733. // "packageName",
  3734. // "editId",
  3735. // "apkVersionCode",
  3736. // "deobfuscationFileType"
  3737. // ],
  3738. // "parameters": {
  3739. // "apkVersionCode": {
  3740. // "description": "The version code of the APK whose deobfuscation file is being uploaded.",
  3741. // "format": "int32",
  3742. // "location": "path",
  3743. // "required": true,
  3744. // "type": "integer"
  3745. // },
  3746. // "deobfuscationFileType": {
  3747. // "enum": [
  3748. // "proguard"
  3749. // ],
  3750. // "enumDescriptions": [
  3751. // ""
  3752. // ],
  3753. // "location": "path",
  3754. // "required": true,
  3755. // "type": "string"
  3756. // },
  3757. // "editId": {
  3758. // "description": "Unique identifier for this edit.",
  3759. // "location": "path",
  3760. // "required": true,
  3761. // "type": "string"
  3762. // },
  3763. // "packageName": {
  3764. // "description": "Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, \"com.spiffygame\".",
  3765. // "location": "path",
  3766. // "required": true,
  3767. // "type": "string"
  3768. // }
  3769. // },
  3770. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}",
  3771. // "response": {
  3772. // "$ref": "DeobfuscationFilesUploadResponse"
  3773. // },
  3774. // "scopes": [
  3775. // "https://www.googleapis.com/auth/androidpublisher"
  3776. // ],
  3777. // "supportsMediaUpload": true
  3778. // }
  3779. }
  3780. // method id "androidpublisher.edits.details.get":
  3781. type EditsDetailsGetCall struct {
  3782. s *Service
  3783. packageNameid string
  3784. editId string
  3785. urlParams_ gensupport.URLParams
  3786. ifNoneMatch_ string
  3787. ctx_ context.Context
  3788. header_ http.Header
  3789. }
  3790. // Get: Fetches app details for this edit. This includes the default
  3791. // language and developer support contact information.
  3792. func (r *EditsDetailsService) Get(packageNameid string, editId string) *EditsDetailsGetCall {
  3793. c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3794. c.packageNameid = packageNameid
  3795. c.editId = editId
  3796. return c
  3797. }
  3798. // Fields allows partial responses to be retrieved. See
  3799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3800. // for more information.
  3801. func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall {
  3802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3803. return c
  3804. }
  3805. // IfNoneMatch sets the optional parameter which makes the operation
  3806. // fail if the object's ETag matches the given value. This is useful for
  3807. // getting updates only after the object has changed since the last
  3808. // request. Use googleapi.IsNotModified to check whether the response
  3809. // error from Do is the result of In-None-Match.
  3810. func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall {
  3811. c.ifNoneMatch_ = entityTag
  3812. return c
  3813. }
  3814. // Context sets the context to be used in this call's Do method. Any
  3815. // pending HTTP request will be aborted if the provided context is
  3816. // canceled.
  3817. func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall {
  3818. c.ctx_ = ctx
  3819. return c
  3820. }
  3821. // Header returns an http.Header that can be modified by the caller to
  3822. // add HTTP headers to the request.
  3823. func (c *EditsDetailsGetCall) Header() http.Header {
  3824. if c.header_ == nil {
  3825. c.header_ = make(http.Header)
  3826. }
  3827. return c.header_
  3828. }
  3829. func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) {
  3830. reqHeaders := make(http.Header)
  3831. for k, v := range c.header_ {
  3832. reqHeaders[k] = v
  3833. }
  3834. reqHeaders.Set("User-Agent", c.s.userAgent())
  3835. if c.ifNoneMatch_ != "" {
  3836. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3837. }
  3838. var body io.Reader = nil
  3839. c.urlParams_.Set("alt", alt)
  3840. c.urlParams_.Set("prettyPrint", "false")
  3841. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  3842. urls += "?" + c.urlParams_.Encode()
  3843. req, err := http.NewRequest("GET", urls, body)
  3844. if err != nil {
  3845. return nil, err
  3846. }
  3847. req.Header = reqHeaders
  3848. googleapi.Expand(req.URL, map[string]string{
  3849. "packageName": c.packageNameid,
  3850. "editId": c.editId,
  3851. })
  3852. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3853. }
  3854. // Do executes the "androidpublisher.edits.details.get" call.
  3855. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  3856. // status code is an error. Response headers are in either
  3857. // *AppDetails.ServerResponse.Header or (if a response was returned at
  3858. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3859. // to check whether the returned error was because
  3860. // http.StatusNotModified was returned.
  3861. func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  3862. gensupport.SetOptions(c.urlParams_, opts...)
  3863. res, err := c.doRequest("json")
  3864. if res != nil && res.StatusCode == http.StatusNotModified {
  3865. if res.Body != nil {
  3866. res.Body.Close()
  3867. }
  3868. return nil, &googleapi.Error{
  3869. Code: res.StatusCode,
  3870. Header: res.Header,
  3871. }
  3872. }
  3873. if err != nil {
  3874. return nil, err
  3875. }
  3876. defer googleapi.CloseBody(res)
  3877. if err := googleapi.CheckResponse(res); err != nil {
  3878. return nil, err
  3879. }
  3880. ret := &AppDetails{
  3881. ServerResponse: googleapi.ServerResponse{
  3882. Header: res.Header,
  3883. HTTPStatusCode: res.StatusCode,
  3884. },
  3885. }
  3886. target := &ret
  3887. if err := gensupport.DecodeResponse(target, res); err != nil {
  3888. return nil, err
  3889. }
  3890. return ret, nil
  3891. // {
  3892. // "description": "Fetches app details for this edit. This includes the default language and developer support contact information.",
  3893. // "httpMethod": "GET",
  3894. // "id": "androidpublisher.edits.details.get",
  3895. // "parameterOrder": [
  3896. // "packageName",
  3897. // "editId"
  3898. // ],
  3899. // "parameters": {
  3900. // "editId": {
  3901. // "description": "Unique identifier for this edit.",
  3902. // "location": "path",
  3903. // "required": true,
  3904. // "type": "string"
  3905. // },
  3906. // "packageName": {
  3907. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3908. // "location": "path",
  3909. // "required": true,
  3910. // "type": "string"
  3911. // }
  3912. // },
  3913. // "path": "{packageName}/edits/{editId}/details",
  3914. // "response": {
  3915. // "$ref": "AppDetails"
  3916. // },
  3917. // "scopes": [
  3918. // "https://www.googleapis.com/auth/androidpublisher"
  3919. // ]
  3920. // }
  3921. }
  3922. // method id "androidpublisher.edits.details.patch":
  3923. type EditsDetailsPatchCall struct {
  3924. s *Service
  3925. packageNameid string
  3926. editId string
  3927. appdetails *AppDetails
  3928. urlParams_ gensupport.URLParams
  3929. ctx_ context.Context
  3930. header_ http.Header
  3931. }
  3932. // Patch: Updates app details for this edit. This method supports patch
  3933. // semantics.
  3934. func (r *EditsDetailsService) Patch(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall {
  3935. c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3936. c.packageNameid = packageNameid
  3937. c.editId = editId
  3938. c.appdetails = appdetails
  3939. return c
  3940. }
  3941. // Fields allows partial responses to be retrieved. See
  3942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3943. // for more information.
  3944. func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall {
  3945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3946. return c
  3947. }
  3948. // Context sets the context to be used in this call's Do method. Any
  3949. // pending HTTP request will be aborted if the provided context is
  3950. // canceled.
  3951. func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall {
  3952. c.ctx_ = ctx
  3953. return c
  3954. }
  3955. // Header returns an http.Header that can be modified by the caller to
  3956. // add HTTP headers to the request.
  3957. func (c *EditsDetailsPatchCall) Header() http.Header {
  3958. if c.header_ == nil {
  3959. c.header_ = make(http.Header)
  3960. }
  3961. return c.header_
  3962. }
  3963. func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) {
  3964. reqHeaders := make(http.Header)
  3965. for k, v := range c.header_ {
  3966. reqHeaders[k] = v
  3967. }
  3968. reqHeaders.Set("User-Agent", c.s.userAgent())
  3969. var body io.Reader = nil
  3970. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  3971. if err != nil {
  3972. return nil, err
  3973. }
  3974. reqHeaders.Set("Content-Type", "application/json")
  3975. c.urlParams_.Set("alt", alt)
  3976. c.urlParams_.Set("prettyPrint", "false")
  3977. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  3978. urls += "?" + c.urlParams_.Encode()
  3979. req, err := http.NewRequest("PATCH", urls, body)
  3980. if err != nil {
  3981. return nil, err
  3982. }
  3983. req.Header = reqHeaders
  3984. googleapi.Expand(req.URL, map[string]string{
  3985. "packageName": c.packageNameid,
  3986. "editId": c.editId,
  3987. })
  3988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3989. }
  3990. // Do executes the "androidpublisher.edits.details.patch" call.
  3991. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  3992. // status code is an error. Response headers are in either
  3993. // *AppDetails.ServerResponse.Header or (if a response was returned at
  3994. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3995. // to check whether the returned error was because
  3996. // http.StatusNotModified was returned.
  3997. func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  3998. gensupport.SetOptions(c.urlParams_, opts...)
  3999. res, err := c.doRequest("json")
  4000. if res != nil && res.StatusCode == http.StatusNotModified {
  4001. if res.Body != nil {
  4002. res.Body.Close()
  4003. }
  4004. return nil, &googleapi.Error{
  4005. Code: res.StatusCode,
  4006. Header: res.Header,
  4007. }
  4008. }
  4009. if err != nil {
  4010. return nil, err
  4011. }
  4012. defer googleapi.CloseBody(res)
  4013. if err := googleapi.CheckResponse(res); err != nil {
  4014. return nil, err
  4015. }
  4016. ret := &AppDetails{
  4017. ServerResponse: googleapi.ServerResponse{
  4018. Header: res.Header,
  4019. HTTPStatusCode: res.StatusCode,
  4020. },
  4021. }
  4022. target := &ret
  4023. if err := gensupport.DecodeResponse(target, res); err != nil {
  4024. return nil, err
  4025. }
  4026. return ret, nil
  4027. // {
  4028. // "description": "Updates app details for this edit. This method supports patch semantics.",
  4029. // "httpMethod": "PATCH",
  4030. // "id": "androidpublisher.edits.details.patch",
  4031. // "parameterOrder": [
  4032. // "packageName",
  4033. // "editId"
  4034. // ],
  4035. // "parameters": {
  4036. // "editId": {
  4037. // "description": "Unique identifier for this edit.",
  4038. // "location": "path",
  4039. // "required": true,
  4040. // "type": "string"
  4041. // },
  4042. // "packageName": {
  4043. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4044. // "location": "path",
  4045. // "required": true,
  4046. // "type": "string"
  4047. // }
  4048. // },
  4049. // "path": "{packageName}/edits/{editId}/details",
  4050. // "request": {
  4051. // "$ref": "AppDetails"
  4052. // },
  4053. // "response": {
  4054. // "$ref": "AppDetails"
  4055. // },
  4056. // "scopes": [
  4057. // "https://www.googleapis.com/auth/androidpublisher"
  4058. // ]
  4059. // }
  4060. }
  4061. // method id "androidpublisher.edits.details.update":
  4062. type EditsDetailsUpdateCall struct {
  4063. s *Service
  4064. packageNameid string
  4065. editId string
  4066. appdetails *AppDetails
  4067. urlParams_ gensupport.URLParams
  4068. ctx_ context.Context
  4069. header_ http.Header
  4070. }
  4071. // Update: Updates app details for this edit.
  4072. func (r *EditsDetailsService) Update(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall {
  4073. c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4074. c.packageNameid = packageNameid
  4075. c.editId = editId
  4076. c.appdetails = appdetails
  4077. return c
  4078. }
  4079. // Fields allows partial responses to be retrieved. See
  4080. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4081. // for more information.
  4082. func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall {
  4083. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4084. return c
  4085. }
  4086. // Context sets the context to be used in this call's Do method. Any
  4087. // pending HTTP request will be aborted if the provided context is
  4088. // canceled.
  4089. func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall {
  4090. c.ctx_ = ctx
  4091. return c
  4092. }
  4093. // Header returns an http.Header that can be modified by the caller to
  4094. // add HTTP headers to the request.
  4095. func (c *EditsDetailsUpdateCall) Header() http.Header {
  4096. if c.header_ == nil {
  4097. c.header_ = make(http.Header)
  4098. }
  4099. return c.header_
  4100. }
  4101. func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4102. reqHeaders := make(http.Header)
  4103. for k, v := range c.header_ {
  4104. reqHeaders[k] = v
  4105. }
  4106. reqHeaders.Set("User-Agent", c.s.userAgent())
  4107. var body io.Reader = nil
  4108. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  4109. if err != nil {
  4110. return nil, err
  4111. }
  4112. reqHeaders.Set("Content-Type", "application/json")
  4113. c.urlParams_.Set("alt", alt)
  4114. c.urlParams_.Set("prettyPrint", "false")
  4115. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4116. urls += "?" + c.urlParams_.Encode()
  4117. req, err := http.NewRequest("PUT", urls, body)
  4118. if err != nil {
  4119. return nil, err
  4120. }
  4121. req.Header = reqHeaders
  4122. googleapi.Expand(req.URL, map[string]string{
  4123. "packageName": c.packageNameid,
  4124. "editId": c.editId,
  4125. })
  4126. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4127. }
  4128. // Do executes the "androidpublisher.edits.details.update" call.
  4129. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  4130. // status code is an error. Response headers are in either
  4131. // *AppDetails.ServerResponse.Header or (if a response was returned at
  4132. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4133. // to check whether the returned error was because
  4134. // http.StatusNotModified was returned.
  4135. func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  4136. gensupport.SetOptions(c.urlParams_, opts...)
  4137. res, err := c.doRequest("json")
  4138. if res != nil && res.StatusCode == http.StatusNotModified {
  4139. if res.Body != nil {
  4140. res.Body.Close()
  4141. }
  4142. return nil, &googleapi.Error{
  4143. Code: res.StatusCode,
  4144. Header: res.Header,
  4145. }
  4146. }
  4147. if err != nil {
  4148. return nil, err
  4149. }
  4150. defer googleapi.CloseBody(res)
  4151. if err := googleapi.CheckResponse(res); err != nil {
  4152. return nil, err
  4153. }
  4154. ret := &AppDetails{
  4155. ServerResponse: googleapi.ServerResponse{
  4156. Header: res.Header,
  4157. HTTPStatusCode: res.StatusCode,
  4158. },
  4159. }
  4160. target := &ret
  4161. if err := gensupport.DecodeResponse(target, res); err != nil {
  4162. return nil, err
  4163. }
  4164. return ret, nil
  4165. // {
  4166. // "description": "Updates app details for this edit.",
  4167. // "httpMethod": "PUT",
  4168. // "id": "androidpublisher.edits.details.update",
  4169. // "parameterOrder": [
  4170. // "packageName",
  4171. // "editId"
  4172. // ],
  4173. // "parameters": {
  4174. // "editId": {
  4175. // "description": "Unique identifier for this edit.",
  4176. // "location": "path",
  4177. // "required": true,
  4178. // "type": "string"
  4179. // },
  4180. // "packageName": {
  4181. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4182. // "location": "path",
  4183. // "required": true,
  4184. // "type": "string"
  4185. // }
  4186. // },
  4187. // "path": "{packageName}/edits/{editId}/details",
  4188. // "request": {
  4189. // "$ref": "AppDetails"
  4190. // },
  4191. // "response": {
  4192. // "$ref": "AppDetails"
  4193. // },
  4194. // "scopes": [
  4195. // "https://www.googleapis.com/auth/androidpublisher"
  4196. // ]
  4197. // }
  4198. }
  4199. // method id "androidpublisher.edits.expansionfiles.get":
  4200. type EditsExpansionfilesGetCall struct {
  4201. s *Service
  4202. packageNameid string
  4203. editId string
  4204. apkVersionCode int64
  4205. expansionFileType string
  4206. urlParams_ gensupport.URLParams
  4207. ifNoneMatch_ string
  4208. ctx_ context.Context
  4209. header_ http.Header
  4210. }
  4211. // Get: Fetches the Expansion File configuration for the APK specified.
  4212. func (r *EditsExpansionfilesService) Get(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall {
  4213. c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4214. c.packageNameid = packageNameid
  4215. c.editId = editId
  4216. c.apkVersionCode = apkVersionCode
  4217. c.expansionFileType = expansionFileType
  4218. return c
  4219. }
  4220. // Fields allows partial responses to be retrieved. See
  4221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4222. // for more information.
  4223. func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall {
  4224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4225. return c
  4226. }
  4227. // IfNoneMatch sets the optional parameter which makes the operation
  4228. // fail if the object's ETag matches the given value. This is useful for
  4229. // getting updates only after the object has changed since the last
  4230. // request. Use googleapi.IsNotModified to check whether the response
  4231. // error from Do is the result of In-None-Match.
  4232. func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall {
  4233. c.ifNoneMatch_ = entityTag
  4234. return c
  4235. }
  4236. // Context sets the context to be used in this call's Do method. Any
  4237. // pending HTTP request will be aborted if the provided context is
  4238. // canceled.
  4239. func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall {
  4240. c.ctx_ = ctx
  4241. return c
  4242. }
  4243. // Header returns an http.Header that can be modified by the caller to
  4244. // add HTTP headers to the request.
  4245. func (c *EditsExpansionfilesGetCall) Header() http.Header {
  4246. if c.header_ == nil {
  4247. c.header_ = make(http.Header)
  4248. }
  4249. return c.header_
  4250. }
  4251. func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) {
  4252. reqHeaders := make(http.Header)
  4253. for k, v := range c.header_ {
  4254. reqHeaders[k] = v
  4255. }
  4256. reqHeaders.Set("User-Agent", c.s.userAgent())
  4257. if c.ifNoneMatch_ != "" {
  4258. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4259. }
  4260. var body io.Reader = nil
  4261. c.urlParams_.Set("alt", alt)
  4262. c.urlParams_.Set("prettyPrint", "false")
  4263. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4264. urls += "?" + c.urlParams_.Encode()
  4265. req, err := http.NewRequest("GET", urls, body)
  4266. if err != nil {
  4267. return nil, err
  4268. }
  4269. req.Header = reqHeaders
  4270. googleapi.Expand(req.URL, map[string]string{
  4271. "packageName": c.packageNameid,
  4272. "editId": c.editId,
  4273. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4274. "expansionFileType": c.expansionFileType,
  4275. })
  4276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4277. }
  4278. // Do executes the "androidpublisher.edits.expansionfiles.get" call.
  4279. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4280. // status code is an error. Response headers are in either
  4281. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4282. // at all) in error.(*googleapi.Error).Header. Use
  4283. // googleapi.IsNotModified to check whether the returned error was
  4284. // because http.StatusNotModified was returned.
  4285. func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4286. gensupport.SetOptions(c.urlParams_, opts...)
  4287. res, err := c.doRequest("json")
  4288. if res != nil && res.StatusCode == http.StatusNotModified {
  4289. if res.Body != nil {
  4290. res.Body.Close()
  4291. }
  4292. return nil, &googleapi.Error{
  4293. Code: res.StatusCode,
  4294. Header: res.Header,
  4295. }
  4296. }
  4297. if err != nil {
  4298. return nil, err
  4299. }
  4300. defer googleapi.CloseBody(res)
  4301. if err := googleapi.CheckResponse(res); err != nil {
  4302. return nil, err
  4303. }
  4304. ret := &ExpansionFile{
  4305. ServerResponse: googleapi.ServerResponse{
  4306. Header: res.Header,
  4307. HTTPStatusCode: res.StatusCode,
  4308. },
  4309. }
  4310. target := &ret
  4311. if err := gensupport.DecodeResponse(target, res); err != nil {
  4312. return nil, err
  4313. }
  4314. return ret, nil
  4315. // {
  4316. // "description": "Fetches the Expansion File configuration for the APK specified.",
  4317. // "httpMethod": "GET",
  4318. // "id": "androidpublisher.edits.expansionfiles.get",
  4319. // "parameterOrder": [
  4320. // "packageName",
  4321. // "editId",
  4322. // "apkVersionCode",
  4323. // "expansionFileType"
  4324. // ],
  4325. // "parameters": {
  4326. // "apkVersionCode": {
  4327. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4328. // "format": "int32",
  4329. // "location": "path",
  4330. // "required": true,
  4331. // "type": "integer"
  4332. // },
  4333. // "editId": {
  4334. // "description": "Unique identifier for this edit.",
  4335. // "location": "path",
  4336. // "required": true,
  4337. // "type": "string"
  4338. // },
  4339. // "expansionFileType": {
  4340. // "enum": [
  4341. // "main",
  4342. // "patch"
  4343. // ],
  4344. // "enumDescriptions": [
  4345. // "",
  4346. // ""
  4347. // ],
  4348. // "location": "path",
  4349. // "required": true,
  4350. // "type": "string"
  4351. // },
  4352. // "packageName": {
  4353. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4354. // "location": "path",
  4355. // "required": true,
  4356. // "type": "string"
  4357. // }
  4358. // },
  4359. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4360. // "response": {
  4361. // "$ref": "ExpansionFile"
  4362. // },
  4363. // "scopes": [
  4364. // "https://www.googleapis.com/auth/androidpublisher"
  4365. // ]
  4366. // }
  4367. }
  4368. // method id "androidpublisher.edits.expansionfiles.patch":
  4369. type EditsExpansionfilesPatchCall struct {
  4370. s *Service
  4371. packageNameid string
  4372. editId string
  4373. apkVersionCode int64
  4374. expansionFileType string
  4375. expansionfile *ExpansionFile
  4376. urlParams_ gensupport.URLParams
  4377. ctx_ context.Context
  4378. header_ http.Header
  4379. }
  4380. // Patch: Updates the APK's Expansion File configuration to reference
  4381. // another APK's Expansion Files. To add a new Expansion File use the
  4382. // Upload method. This method supports patch semantics.
  4383. func (r *EditsExpansionfilesService) Patch(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall {
  4384. c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4385. c.packageNameid = packageNameid
  4386. c.editId = editId
  4387. c.apkVersionCode = apkVersionCode
  4388. c.expansionFileType = expansionFileType
  4389. c.expansionfile = expansionfile
  4390. return c
  4391. }
  4392. // Fields allows partial responses to be retrieved. See
  4393. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4394. // for more information.
  4395. func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall {
  4396. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4397. return c
  4398. }
  4399. // Context sets the context to be used in this call's Do method. Any
  4400. // pending HTTP request will be aborted if the provided context is
  4401. // canceled.
  4402. func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall {
  4403. c.ctx_ = ctx
  4404. return c
  4405. }
  4406. // Header returns an http.Header that can be modified by the caller to
  4407. // add HTTP headers to the request.
  4408. func (c *EditsExpansionfilesPatchCall) Header() http.Header {
  4409. if c.header_ == nil {
  4410. c.header_ = make(http.Header)
  4411. }
  4412. return c.header_
  4413. }
  4414. func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  4415. reqHeaders := make(http.Header)
  4416. for k, v := range c.header_ {
  4417. reqHeaders[k] = v
  4418. }
  4419. reqHeaders.Set("User-Agent", c.s.userAgent())
  4420. var body io.Reader = nil
  4421. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  4422. if err != nil {
  4423. return nil, err
  4424. }
  4425. reqHeaders.Set("Content-Type", "application/json")
  4426. c.urlParams_.Set("alt", alt)
  4427. c.urlParams_.Set("prettyPrint", "false")
  4428. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4429. urls += "?" + c.urlParams_.Encode()
  4430. req, err := http.NewRequest("PATCH", urls, body)
  4431. if err != nil {
  4432. return nil, err
  4433. }
  4434. req.Header = reqHeaders
  4435. googleapi.Expand(req.URL, map[string]string{
  4436. "packageName": c.packageNameid,
  4437. "editId": c.editId,
  4438. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4439. "expansionFileType": c.expansionFileType,
  4440. })
  4441. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4442. }
  4443. // Do executes the "androidpublisher.edits.expansionfiles.patch" call.
  4444. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4445. // status code is an error. Response headers are in either
  4446. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4447. // at all) in error.(*googleapi.Error).Header. Use
  4448. // googleapi.IsNotModified to check whether the returned error was
  4449. // because http.StatusNotModified was returned.
  4450. func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4451. gensupport.SetOptions(c.urlParams_, opts...)
  4452. res, err := c.doRequest("json")
  4453. if res != nil && res.StatusCode == http.StatusNotModified {
  4454. if res.Body != nil {
  4455. res.Body.Close()
  4456. }
  4457. return nil, &googleapi.Error{
  4458. Code: res.StatusCode,
  4459. Header: res.Header,
  4460. }
  4461. }
  4462. if err != nil {
  4463. return nil, err
  4464. }
  4465. defer googleapi.CloseBody(res)
  4466. if err := googleapi.CheckResponse(res); err != nil {
  4467. return nil, err
  4468. }
  4469. ret := &ExpansionFile{
  4470. ServerResponse: googleapi.ServerResponse{
  4471. Header: res.Header,
  4472. HTTPStatusCode: res.StatusCode,
  4473. },
  4474. }
  4475. target := &ret
  4476. if err := gensupport.DecodeResponse(target, res); err != nil {
  4477. return nil, err
  4478. }
  4479. return ret, nil
  4480. // {
  4481. // "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.",
  4482. // "httpMethod": "PATCH",
  4483. // "id": "androidpublisher.edits.expansionfiles.patch",
  4484. // "parameterOrder": [
  4485. // "packageName",
  4486. // "editId",
  4487. // "apkVersionCode",
  4488. // "expansionFileType"
  4489. // ],
  4490. // "parameters": {
  4491. // "apkVersionCode": {
  4492. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4493. // "format": "int32",
  4494. // "location": "path",
  4495. // "required": true,
  4496. // "type": "integer"
  4497. // },
  4498. // "editId": {
  4499. // "description": "Unique identifier for this edit.",
  4500. // "location": "path",
  4501. // "required": true,
  4502. // "type": "string"
  4503. // },
  4504. // "expansionFileType": {
  4505. // "enum": [
  4506. // "main",
  4507. // "patch"
  4508. // ],
  4509. // "enumDescriptions": [
  4510. // "",
  4511. // ""
  4512. // ],
  4513. // "location": "path",
  4514. // "required": true,
  4515. // "type": "string"
  4516. // },
  4517. // "packageName": {
  4518. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4519. // "location": "path",
  4520. // "required": true,
  4521. // "type": "string"
  4522. // }
  4523. // },
  4524. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4525. // "request": {
  4526. // "$ref": "ExpansionFile"
  4527. // },
  4528. // "response": {
  4529. // "$ref": "ExpansionFile"
  4530. // },
  4531. // "scopes": [
  4532. // "https://www.googleapis.com/auth/androidpublisher"
  4533. // ]
  4534. // }
  4535. }
  4536. // method id "androidpublisher.edits.expansionfiles.update":
  4537. type EditsExpansionfilesUpdateCall struct {
  4538. s *Service
  4539. packageNameid string
  4540. editId string
  4541. apkVersionCode int64
  4542. expansionFileType string
  4543. expansionfile *ExpansionFile
  4544. urlParams_ gensupport.URLParams
  4545. ctx_ context.Context
  4546. header_ http.Header
  4547. }
  4548. // Update: Updates the APK's Expansion File configuration to reference
  4549. // another APK's Expansion Files. To add a new Expansion File use the
  4550. // Upload method.
  4551. func (r *EditsExpansionfilesService) Update(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall {
  4552. c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4553. c.packageNameid = packageNameid
  4554. c.editId = editId
  4555. c.apkVersionCode = apkVersionCode
  4556. c.expansionFileType = expansionFileType
  4557. c.expansionfile = expansionfile
  4558. return c
  4559. }
  4560. // Fields allows partial responses to be retrieved. See
  4561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4562. // for more information.
  4563. func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall {
  4564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4565. return c
  4566. }
  4567. // Context sets the context to be used in this call's Do method. Any
  4568. // pending HTTP request will be aborted if the provided context is
  4569. // canceled.
  4570. func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall {
  4571. c.ctx_ = ctx
  4572. return c
  4573. }
  4574. // Header returns an http.Header that can be modified by the caller to
  4575. // add HTTP headers to the request.
  4576. func (c *EditsExpansionfilesUpdateCall) Header() http.Header {
  4577. if c.header_ == nil {
  4578. c.header_ = make(http.Header)
  4579. }
  4580. return c.header_
  4581. }
  4582. func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  4583. reqHeaders := make(http.Header)
  4584. for k, v := range c.header_ {
  4585. reqHeaders[k] = v
  4586. }
  4587. reqHeaders.Set("User-Agent", c.s.userAgent())
  4588. var body io.Reader = nil
  4589. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  4590. if err != nil {
  4591. return nil, err
  4592. }
  4593. reqHeaders.Set("Content-Type", "application/json")
  4594. c.urlParams_.Set("alt", alt)
  4595. c.urlParams_.Set("prettyPrint", "false")
  4596. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4597. urls += "?" + c.urlParams_.Encode()
  4598. req, err := http.NewRequest("PUT", urls, body)
  4599. if err != nil {
  4600. return nil, err
  4601. }
  4602. req.Header = reqHeaders
  4603. googleapi.Expand(req.URL, map[string]string{
  4604. "packageName": c.packageNameid,
  4605. "editId": c.editId,
  4606. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4607. "expansionFileType": c.expansionFileType,
  4608. })
  4609. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4610. }
  4611. // Do executes the "androidpublisher.edits.expansionfiles.update" call.
  4612. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4613. // status code is an error. Response headers are in either
  4614. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4615. // at all) in error.(*googleapi.Error).Header. Use
  4616. // googleapi.IsNotModified to check whether the returned error was
  4617. // because http.StatusNotModified was returned.
  4618. func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4619. gensupport.SetOptions(c.urlParams_, opts...)
  4620. res, err := c.doRequest("json")
  4621. if res != nil && res.StatusCode == http.StatusNotModified {
  4622. if res.Body != nil {
  4623. res.Body.Close()
  4624. }
  4625. return nil, &googleapi.Error{
  4626. Code: res.StatusCode,
  4627. Header: res.Header,
  4628. }
  4629. }
  4630. if err != nil {
  4631. return nil, err
  4632. }
  4633. defer googleapi.CloseBody(res)
  4634. if err := googleapi.CheckResponse(res); err != nil {
  4635. return nil, err
  4636. }
  4637. ret := &ExpansionFile{
  4638. ServerResponse: googleapi.ServerResponse{
  4639. Header: res.Header,
  4640. HTTPStatusCode: res.StatusCode,
  4641. },
  4642. }
  4643. target := &ret
  4644. if err := gensupport.DecodeResponse(target, res); err != nil {
  4645. return nil, err
  4646. }
  4647. return ret, nil
  4648. // {
  4649. // "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.",
  4650. // "httpMethod": "PUT",
  4651. // "id": "androidpublisher.edits.expansionfiles.update",
  4652. // "parameterOrder": [
  4653. // "packageName",
  4654. // "editId",
  4655. // "apkVersionCode",
  4656. // "expansionFileType"
  4657. // ],
  4658. // "parameters": {
  4659. // "apkVersionCode": {
  4660. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4661. // "format": "int32",
  4662. // "location": "path",
  4663. // "required": true,
  4664. // "type": "integer"
  4665. // },
  4666. // "editId": {
  4667. // "description": "Unique identifier for this edit.",
  4668. // "location": "path",
  4669. // "required": true,
  4670. // "type": "string"
  4671. // },
  4672. // "expansionFileType": {
  4673. // "enum": [
  4674. // "main",
  4675. // "patch"
  4676. // ],
  4677. // "enumDescriptions": [
  4678. // "",
  4679. // ""
  4680. // ],
  4681. // "location": "path",
  4682. // "required": true,
  4683. // "type": "string"
  4684. // },
  4685. // "packageName": {
  4686. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4687. // "location": "path",
  4688. // "required": true,
  4689. // "type": "string"
  4690. // }
  4691. // },
  4692. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4693. // "request": {
  4694. // "$ref": "ExpansionFile"
  4695. // },
  4696. // "response": {
  4697. // "$ref": "ExpansionFile"
  4698. // },
  4699. // "scopes": [
  4700. // "https://www.googleapis.com/auth/androidpublisher"
  4701. // ]
  4702. // }
  4703. }
  4704. // method id "androidpublisher.edits.expansionfiles.upload":
  4705. type EditsExpansionfilesUploadCall struct {
  4706. s *Service
  4707. packageNameid string
  4708. editId string
  4709. apkVersionCode int64
  4710. expansionFileType string
  4711. urlParams_ gensupport.URLParams
  4712. mediaInfo_ *gensupport.MediaInfo
  4713. ctx_ context.Context
  4714. header_ http.Header
  4715. }
  4716. // Upload: Uploads and attaches a new Expansion File to the APK
  4717. // specified.
  4718. func (r *EditsExpansionfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall {
  4719. c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4720. c.packageNameid = packageNameid
  4721. c.editId = editId
  4722. c.apkVersionCode = apkVersionCode
  4723. c.expansionFileType = expansionFileType
  4724. return c
  4725. }
  4726. // Media specifies the media to upload in one or more chunks. The chunk
  4727. // size may be controlled by supplying a MediaOption generated by
  4728. // googleapi.ChunkSize. The chunk size defaults to
  4729. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4730. // upload request will be determined by sniffing the contents of r,
  4731. // unless a MediaOption generated by googleapi.ContentType is
  4732. // supplied.
  4733. // At most one of Media and ResumableMedia may be set.
  4734. func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall {
  4735. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4736. return c
  4737. }
  4738. // ResumableMedia specifies the media to upload in chunks and can be
  4739. // canceled with ctx.
  4740. //
  4741. // Deprecated: use Media instead.
  4742. //
  4743. // At most one of Media and ResumableMedia may be set. mediaType
  4744. // identifies the MIME media type of the upload, such as "image/png". If
  4745. // mediaType is "", it will be auto-detected. The provided ctx will
  4746. // supersede any context previously provided to the Context method.
  4747. func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall {
  4748. c.ctx_ = ctx
  4749. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4750. return c
  4751. }
  4752. // ProgressUpdater provides a callback function that will be called
  4753. // after every chunk. It should be a low-latency function in order to
  4754. // not slow down the upload operation. This should only be called when
  4755. // using ResumableMedia (as opposed to Media).
  4756. func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall {
  4757. c.mediaInfo_.SetProgressUpdater(pu)
  4758. return c
  4759. }
  4760. // Fields allows partial responses to be retrieved. See
  4761. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4762. // for more information.
  4763. func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall {
  4764. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4765. return c
  4766. }
  4767. // Context sets the context to be used in this call's Do method. Any
  4768. // pending HTTP request will be aborted if the provided context is
  4769. // canceled.
  4770. // This context will supersede any context previously provided to the
  4771. // ResumableMedia method.
  4772. func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall {
  4773. c.ctx_ = ctx
  4774. return c
  4775. }
  4776. // Header returns an http.Header that can be modified by the caller to
  4777. // add HTTP headers to the request.
  4778. func (c *EditsExpansionfilesUploadCall) Header() http.Header {
  4779. if c.header_ == nil {
  4780. c.header_ = make(http.Header)
  4781. }
  4782. return c.header_
  4783. }
  4784. func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  4785. reqHeaders := make(http.Header)
  4786. for k, v := range c.header_ {
  4787. reqHeaders[k] = v
  4788. }
  4789. reqHeaders.Set("User-Agent", c.s.userAgent())
  4790. var body io.Reader = nil
  4791. c.urlParams_.Set("alt", alt)
  4792. c.urlParams_.Set("prettyPrint", "false")
  4793. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4794. if c.mediaInfo_ != nil {
  4795. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  4796. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4797. }
  4798. if body == nil {
  4799. body = new(bytes.Buffer)
  4800. reqHeaders.Set("Content-Type", "application/json")
  4801. }
  4802. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4803. defer cleanup()
  4804. urls += "?" + c.urlParams_.Encode()
  4805. req, err := http.NewRequest("POST", urls, body)
  4806. if err != nil {
  4807. return nil, err
  4808. }
  4809. req.Header = reqHeaders
  4810. req.GetBody = getBody
  4811. googleapi.Expand(req.URL, map[string]string{
  4812. "packageName": c.packageNameid,
  4813. "editId": c.editId,
  4814. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4815. "expansionFileType": c.expansionFileType,
  4816. })
  4817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4818. }
  4819. // Do executes the "androidpublisher.edits.expansionfiles.upload" call.
  4820. // Exactly one of *ExpansionFilesUploadResponse or error will be
  4821. // non-nil. Any non-2xx status code is an error. Response headers are in
  4822. // either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a
  4823. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4824. // googleapi.IsNotModified to check whether the returned error was
  4825. // because http.StatusNotModified was returned.
  4826. func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) {
  4827. gensupport.SetOptions(c.urlParams_, opts...)
  4828. res, err := c.doRequest("json")
  4829. if res != nil && res.StatusCode == http.StatusNotModified {
  4830. if res.Body != nil {
  4831. res.Body.Close()
  4832. }
  4833. return nil, &googleapi.Error{
  4834. Code: res.StatusCode,
  4835. Header: res.Header,
  4836. }
  4837. }
  4838. if err != nil {
  4839. return nil, err
  4840. }
  4841. defer googleapi.CloseBody(res)
  4842. if err := googleapi.CheckResponse(res); err != nil {
  4843. return nil, err
  4844. }
  4845. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4846. if rx != nil {
  4847. rx.Client = c.s.client
  4848. rx.UserAgent = c.s.userAgent()
  4849. ctx := c.ctx_
  4850. if ctx == nil {
  4851. ctx = context.TODO()
  4852. }
  4853. res, err = rx.Upload(ctx)
  4854. if err != nil {
  4855. return nil, err
  4856. }
  4857. defer res.Body.Close()
  4858. if err := googleapi.CheckResponse(res); err != nil {
  4859. return nil, err
  4860. }
  4861. }
  4862. ret := &ExpansionFilesUploadResponse{
  4863. ServerResponse: googleapi.ServerResponse{
  4864. Header: res.Header,
  4865. HTTPStatusCode: res.StatusCode,
  4866. },
  4867. }
  4868. target := &ret
  4869. if err := gensupport.DecodeResponse(target, res); err != nil {
  4870. return nil, err
  4871. }
  4872. return ret, nil
  4873. // {
  4874. // "description": "Uploads and attaches a new Expansion File to the APK specified.",
  4875. // "httpMethod": "POST",
  4876. // "id": "androidpublisher.edits.expansionfiles.upload",
  4877. // "mediaUpload": {
  4878. // "accept": [
  4879. // "application/octet-stream"
  4880. // ],
  4881. // "maxSize": "2048MB",
  4882. // "protocols": {
  4883. // "resumable": {
  4884. // "multipart": true,
  4885. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  4886. // },
  4887. // "simple": {
  4888. // "multipart": true,
  4889. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  4890. // }
  4891. // }
  4892. // },
  4893. // "parameterOrder": [
  4894. // "packageName",
  4895. // "editId",
  4896. // "apkVersionCode",
  4897. // "expansionFileType"
  4898. // ],
  4899. // "parameters": {
  4900. // "apkVersionCode": {
  4901. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4902. // "format": "int32",
  4903. // "location": "path",
  4904. // "required": true,
  4905. // "type": "integer"
  4906. // },
  4907. // "editId": {
  4908. // "description": "Unique identifier for this edit.",
  4909. // "location": "path",
  4910. // "required": true,
  4911. // "type": "string"
  4912. // },
  4913. // "expansionFileType": {
  4914. // "enum": [
  4915. // "main",
  4916. // "patch"
  4917. // ],
  4918. // "enumDescriptions": [
  4919. // "",
  4920. // ""
  4921. // ],
  4922. // "location": "path",
  4923. // "required": true,
  4924. // "type": "string"
  4925. // },
  4926. // "packageName": {
  4927. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4928. // "location": "path",
  4929. // "required": true,
  4930. // "type": "string"
  4931. // }
  4932. // },
  4933. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4934. // "response": {
  4935. // "$ref": "ExpansionFilesUploadResponse"
  4936. // },
  4937. // "scopes": [
  4938. // "https://www.googleapis.com/auth/androidpublisher"
  4939. // ],
  4940. // "supportsMediaUpload": true
  4941. // }
  4942. }
  4943. // method id "androidpublisher.edits.images.delete":
  4944. type EditsImagesDeleteCall struct {
  4945. s *Service
  4946. packageNameid string
  4947. editId string
  4948. language string
  4949. imageType string
  4950. imageId string
  4951. urlParams_ gensupport.URLParams
  4952. ctx_ context.Context
  4953. header_ http.Header
  4954. }
  4955. // Delete: Deletes the image (specified by id) from the edit.
  4956. func (r *EditsImagesService) Delete(packageNameid string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall {
  4957. c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4958. c.packageNameid = packageNameid
  4959. c.editId = editId
  4960. c.language = language
  4961. c.imageType = imageType
  4962. c.imageId = imageId
  4963. return c
  4964. }
  4965. // Fields allows partial responses to be retrieved. See
  4966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4967. // for more information.
  4968. func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall {
  4969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4970. return c
  4971. }
  4972. // Context sets the context to be used in this call's Do method. Any
  4973. // pending HTTP request will be aborted if the provided context is
  4974. // canceled.
  4975. func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall {
  4976. c.ctx_ = ctx
  4977. return c
  4978. }
  4979. // Header returns an http.Header that can be modified by the caller to
  4980. // add HTTP headers to the request.
  4981. func (c *EditsImagesDeleteCall) Header() http.Header {
  4982. if c.header_ == nil {
  4983. c.header_ = make(http.Header)
  4984. }
  4985. return c.header_
  4986. }
  4987. func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4988. reqHeaders := make(http.Header)
  4989. for k, v := range c.header_ {
  4990. reqHeaders[k] = v
  4991. }
  4992. reqHeaders.Set("User-Agent", c.s.userAgent())
  4993. var body io.Reader = nil
  4994. c.urlParams_.Set("alt", alt)
  4995. c.urlParams_.Set("prettyPrint", "false")
  4996. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}")
  4997. urls += "?" + c.urlParams_.Encode()
  4998. req, err := http.NewRequest("DELETE", urls, body)
  4999. if err != nil {
  5000. return nil, err
  5001. }
  5002. req.Header = reqHeaders
  5003. googleapi.Expand(req.URL, map[string]string{
  5004. "packageName": c.packageNameid,
  5005. "editId": c.editId,
  5006. "language": c.language,
  5007. "imageType": c.imageType,
  5008. "imageId": c.imageId,
  5009. })
  5010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5011. }
  5012. // Do executes the "androidpublisher.edits.images.delete" call.
  5013. func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  5014. gensupport.SetOptions(c.urlParams_, opts...)
  5015. res, err := c.doRequest("json")
  5016. if err != nil {
  5017. return err
  5018. }
  5019. defer googleapi.CloseBody(res)
  5020. if err := googleapi.CheckResponse(res); err != nil {
  5021. return err
  5022. }
  5023. return nil
  5024. // {
  5025. // "description": "Deletes the image (specified by id) from the edit.",
  5026. // "httpMethod": "DELETE",
  5027. // "id": "androidpublisher.edits.images.delete",
  5028. // "parameterOrder": [
  5029. // "packageName",
  5030. // "editId",
  5031. // "language",
  5032. // "imageType",
  5033. // "imageId"
  5034. // ],
  5035. // "parameters": {
  5036. // "editId": {
  5037. // "description": "Unique identifier for this edit.",
  5038. // "location": "path",
  5039. // "required": true,
  5040. // "type": "string"
  5041. // },
  5042. // "imageId": {
  5043. // "description": "Unique identifier an image within the set of images attached to this edit.",
  5044. // "location": "path",
  5045. // "required": true,
  5046. // "type": "string"
  5047. // },
  5048. // "imageType": {
  5049. // "enum": [
  5050. // "featureGraphic",
  5051. // "icon",
  5052. // "phoneScreenshots",
  5053. // "promoGraphic",
  5054. // "sevenInchScreenshots",
  5055. // "tenInchScreenshots",
  5056. // "tvBanner",
  5057. // "tvScreenshots",
  5058. // "wearScreenshots"
  5059. // ],
  5060. // "enumDescriptions": [
  5061. // "",
  5062. // "",
  5063. // "",
  5064. // "",
  5065. // "",
  5066. // "",
  5067. // "",
  5068. // "",
  5069. // ""
  5070. // ],
  5071. // "location": "path",
  5072. // "required": true,
  5073. // "type": "string"
  5074. // },
  5075. // "language": {
  5076. // "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\".",
  5077. // "location": "path",
  5078. // "required": true,
  5079. // "type": "string"
  5080. // },
  5081. // "packageName": {
  5082. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5083. // "location": "path",
  5084. // "required": true,
  5085. // "type": "string"
  5086. // }
  5087. // },
  5088. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}",
  5089. // "scopes": [
  5090. // "https://www.googleapis.com/auth/androidpublisher"
  5091. // ]
  5092. // }
  5093. }
  5094. // method id "androidpublisher.edits.images.deleteall":
  5095. type EditsImagesDeleteallCall struct {
  5096. s *Service
  5097. packageNameid string
  5098. editId string
  5099. language string
  5100. imageType string
  5101. urlParams_ gensupport.URLParams
  5102. ctx_ context.Context
  5103. header_ http.Header
  5104. }
  5105. // Deleteall: Deletes all images for the specified language and image
  5106. // type.
  5107. func (r *EditsImagesService) Deleteall(packageNameid string, editId string, language string, imageType string) *EditsImagesDeleteallCall {
  5108. c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5109. c.packageNameid = packageNameid
  5110. c.editId = editId
  5111. c.language = language
  5112. c.imageType = imageType
  5113. return c
  5114. }
  5115. // Fields allows partial responses to be retrieved. See
  5116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5117. // for more information.
  5118. func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall {
  5119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5120. return c
  5121. }
  5122. // Context sets the context to be used in this call's Do method. Any
  5123. // pending HTTP request will be aborted if the provided context is
  5124. // canceled.
  5125. func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall {
  5126. c.ctx_ = ctx
  5127. return c
  5128. }
  5129. // Header returns an http.Header that can be modified by the caller to
  5130. // add HTTP headers to the request.
  5131. func (c *EditsImagesDeleteallCall) Header() http.Header {
  5132. if c.header_ == nil {
  5133. c.header_ = make(http.Header)
  5134. }
  5135. return c.header_
  5136. }
  5137. func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) {
  5138. reqHeaders := make(http.Header)
  5139. for k, v := range c.header_ {
  5140. reqHeaders[k] = v
  5141. }
  5142. reqHeaders.Set("User-Agent", c.s.userAgent())
  5143. var body io.Reader = nil
  5144. c.urlParams_.Set("alt", alt)
  5145. c.urlParams_.Set("prettyPrint", "false")
  5146. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5147. urls += "?" + c.urlParams_.Encode()
  5148. req, err := http.NewRequest("DELETE", urls, body)
  5149. if err != nil {
  5150. return nil, err
  5151. }
  5152. req.Header = reqHeaders
  5153. googleapi.Expand(req.URL, map[string]string{
  5154. "packageName": c.packageNameid,
  5155. "editId": c.editId,
  5156. "language": c.language,
  5157. "imageType": c.imageType,
  5158. })
  5159. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5160. }
  5161. // Do executes the "androidpublisher.edits.images.deleteall" call.
  5162. // Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any
  5163. // non-2xx status code is an error. Response headers are in either
  5164. // *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was
  5165. // returned at all) in error.(*googleapi.Error).Header. Use
  5166. // googleapi.IsNotModified to check whether the returned error was
  5167. // because http.StatusNotModified was returned.
  5168. func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) {
  5169. gensupport.SetOptions(c.urlParams_, opts...)
  5170. res, err := c.doRequest("json")
  5171. if res != nil && res.StatusCode == http.StatusNotModified {
  5172. if res.Body != nil {
  5173. res.Body.Close()
  5174. }
  5175. return nil, &googleapi.Error{
  5176. Code: res.StatusCode,
  5177. Header: res.Header,
  5178. }
  5179. }
  5180. if err != nil {
  5181. return nil, err
  5182. }
  5183. defer googleapi.CloseBody(res)
  5184. if err := googleapi.CheckResponse(res); err != nil {
  5185. return nil, err
  5186. }
  5187. ret := &ImagesDeleteAllResponse{
  5188. ServerResponse: googleapi.ServerResponse{
  5189. Header: res.Header,
  5190. HTTPStatusCode: res.StatusCode,
  5191. },
  5192. }
  5193. target := &ret
  5194. if err := gensupport.DecodeResponse(target, res); err != nil {
  5195. return nil, err
  5196. }
  5197. return ret, nil
  5198. // {
  5199. // "description": "Deletes all images for the specified language and image type.",
  5200. // "httpMethod": "DELETE",
  5201. // "id": "androidpublisher.edits.images.deleteall",
  5202. // "parameterOrder": [
  5203. // "packageName",
  5204. // "editId",
  5205. // "language",
  5206. // "imageType"
  5207. // ],
  5208. // "parameters": {
  5209. // "editId": {
  5210. // "description": "Unique identifier for this edit.",
  5211. // "location": "path",
  5212. // "required": true,
  5213. // "type": "string"
  5214. // },
  5215. // "imageType": {
  5216. // "enum": [
  5217. // "featureGraphic",
  5218. // "icon",
  5219. // "phoneScreenshots",
  5220. // "promoGraphic",
  5221. // "sevenInchScreenshots",
  5222. // "tenInchScreenshots",
  5223. // "tvBanner",
  5224. // "tvScreenshots",
  5225. // "wearScreenshots"
  5226. // ],
  5227. // "enumDescriptions": [
  5228. // "",
  5229. // "",
  5230. // "",
  5231. // "",
  5232. // "",
  5233. // "",
  5234. // "",
  5235. // "",
  5236. // ""
  5237. // ],
  5238. // "location": "path",
  5239. // "required": true,
  5240. // "type": "string"
  5241. // },
  5242. // "language": {
  5243. // "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\".",
  5244. // "location": "path",
  5245. // "required": true,
  5246. // "type": "string"
  5247. // },
  5248. // "packageName": {
  5249. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5250. // "location": "path",
  5251. // "required": true,
  5252. // "type": "string"
  5253. // }
  5254. // },
  5255. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5256. // "response": {
  5257. // "$ref": "ImagesDeleteAllResponse"
  5258. // },
  5259. // "scopes": [
  5260. // "https://www.googleapis.com/auth/androidpublisher"
  5261. // ]
  5262. // }
  5263. }
  5264. // method id "androidpublisher.edits.images.list":
  5265. type EditsImagesListCall struct {
  5266. s *Service
  5267. packageNameid string
  5268. editId string
  5269. language string
  5270. imageType string
  5271. urlParams_ gensupport.URLParams
  5272. ifNoneMatch_ string
  5273. ctx_ context.Context
  5274. header_ http.Header
  5275. }
  5276. // List: Lists all images for the specified language and image type.
  5277. func (r *EditsImagesService) List(packageNameid string, editId string, language string, imageType string) *EditsImagesListCall {
  5278. c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5279. c.packageNameid = packageNameid
  5280. c.editId = editId
  5281. c.language = language
  5282. c.imageType = imageType
  5283. return c
  5284. }
  5285. // Fields allows partial responses to be retrieved. See
  5286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5287. // for more information.
  5288. func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall {
  5289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5290. return c
  5291. }
  5292. // IfNoneMatch sets the optional parameter which makes the operation
  5293. // fail if the object's ETag matches the given value. This is useful for
  5294. // getting updates only after the object has changed since the last
  5295. // request. Use googleapi.IsNotModified to check whether the response
  5296. // error from Do is the result of In-None-Match.
  5297. func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall {
  5298. c.ifNoneMatch_ = entityTag
  5299. return c
  5300. }
  5301. // Context sets the context to be used in this call's Do method. Any
  5302. // pending HTTP request will be aborted if the provided context is
  5303. // canceled.
  5304. func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall {
  5305. c.ctx_ = ctx
  5306. return c
  5307. }
  5308. // Header returns an http.Header that can be modified by the caller to
  5309. // add HTTP headers to the request.
  5310. func (c *EditsImagesListCall) Header() http.Header {
  5311. if c.header_ == nil {
  5312. c.header_ = make(http.Header)
  5313. }
  5314. return c.header_
  5315. }
  5316. func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) {
  5317. reqHeaders := make(http.Header)
  5318. for k, v := range c.header_ {
  5319. reqHeaders[k] = v
  5320. }
  5321. reqHeaders.Set("User-Agent", c.s.userAgent())
  5322. if c.ifNoneMatch_ != "" {
  5323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5324. }
  5325. var body io.Reader = nil
  5326. c.urlParams_.Set("alt", alt)
  5327. c.urlParams_.Set("prettyPrint", "false")
  5328. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5329. urls += "?" + c.urlParams_.Encode()
  5330. req, err := http.NewRequest("GET", urls, body)
  5331. if err != nil {
  5332. return nil, err
  5333. }
  5334. req.Header = reqHeaders
  5335. googleapi.Expand(req.URL, map[string]string{
  5336. "packageName": c.packageNameid,
  5337. "editId": c.editId,
  5338. "language": c.language,
  5339. "imageType": c.imageType,
  5340. })
  5341. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5342. }
  5343. // Do executes the "androidpublisher.edits.images.list" call.
  5344. // Exactly one of *ImagesListResponse or error will be non-nil. Any
  5345. // non-2xx status code is an error. Response headers are in either
  5346. // *ImagesListResponse.ServerResponse.Header or (if a response was
  5347. // returned at all) in error.(*googleapi.Error).Header. Use
  5348. // googleapi.IsNotModified to check whether the returned error was
  5349. // because http.StatusNotModified was returned.
  5350. func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) {
  5351. gensupport.SetOptions(c.urlParams_, opts...)
  5352. res, err := c.doRequest("json")
  5353. if res != nil && res.StatusCode == http.StatusNotModified {
  5354. if res.Body != nil {
  5355. res.Body.Close()
  5356. }
  5357. return nil, &googleapi.Error{
  5358. Code: res.StatusCode,
  5359. Header: res.Header,
  5360. }
  5361. }
  5362. if err != nil {
  5363. return nil, err
  5364. }
  5365. defer googleapi.CloseBody(res)
  5366. if err := googleapi.CheckResponse(res); err != nil {
  5367. return nil, err
  5368. }
  5369. ret := &ImagesListResponse{
  5370. ServerResponse: googleapi.ServerResponse{
  5371. Header: res.Header,
  5372. HTTPStatusCode: res.StatusCode,
  5373. },
  5374. }
  5375. target := &ret
  5376. if err := gensupport.DecodeResponse(target, res); err != nil {
  5377. return nil, err
  5378. }
  5379. return ret, nil
  5380. // {
  5381. // "description": "Lists all images for the specified language and image type.",
  5382. // "httpMethod": "GET",
  5383. // "id": "androidpublisher.edits.images.list",
  5384. // "parameterOrder": [
  5385. // "packageName",
  5386. // "editId",
  5387. // "language",
  5388. // "imageType"
  5389. // ],
  5390. // "parameters": {
  5391. // "editId": {
  5392. // "description": "Unique identifier for this edit.",
  5393. // "location": "path",
  5394. // "required": true,
  5395. // "type": "string"
  5396. // },
  5397. // "imageType": {
  5398. // "enum": [
  5399. // "featureGraphic",
  5400. // "icon",
  5401. // "phoneScreenshots",
  5402. // "promoGraphic",
  5403. // "sevenInchScreenshots",
  5404. // "tenInchScreenshots",
  5405. // "tvBanner",
  5406. // "tvScreenshots",
  5407. // "wearScreenshots"
  5408. // ],
  5409. // "enumDescriptions": [
  5410. // "",
  5411. // "",
  5412. // "",
  5413. // "",
  5414. // "",
  5415. // "",
  5416. // "",
  5417. // "",
  5418. // ""
  5419. // ],
  5420. // "location": "path",
  5421. // "required": true,
  5422. // "type": "string"
  5423. // },
  5424. // "language": {
  5425. // "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\".",
  5426. // "location": "path",
  5427. // "required": true,
  5428. // "type": "string"
  5429. // },
  5430. // "packageName": {
  5431. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5432. // "location": "path",
  5433. // "required": true,
  5434. // "type": "string"
  5435. // }
  5436. // },
  5437. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5438. // "response": {
  5439. // "$ref": "ImagesListResponse"
  5440. // },
  5441. // "scopes": [
  5442. // "https://www.googleapis.com/auth/androidpublisher"
  5443. // ]
  5444. // }
  5445. }
  5446. // method id "androidpublisher.edits.images.upload":
  5447. type EditsImagesUploadCall struct {
  5448. s *Service
  5449. packageNameid string
  5450. editId string
  5451. language string
  5452. imageType string
  5453. urlParams_ gensupport.URLParams
  5454. mediaInfo_ *gensupport.MediaInfo
  5455. ctx_ context.Context
  5456. header_ http.Header
  5457. }
  5458. // Upload: Uploads a new image and adds it to the list of images for the
  5459. // specified language and image type.
  5460. func (r *EditsImagesService) Upload(packageNameid string, editId string, language string, imageType string) *EditsImagesUploadCall {
  5461. c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5462. c.packageNameid = packageNameid
  5463. c.editId = editId
  5464. c.language = language
  5465. c.imageType = imageType
  5466. return c
  5467. }
  5468. // Media specifies the media to upload in one or more chunks. The chunk
  5469. // size may be controlled by supplying a MediaOption generated by
  5470. // googleapi.ChunkSize. The chunk size defaults to
  5471. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  5472. // upload request will be determined by sniffing the contents of r,
  5473. // unless a MediaOption generated by googleapi.ContentType is
  5474. // supplied.
  5475. // At most one of Media and ResumableMedia may be set.
  5476. func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall {
  5477. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  5478. return c
  5479. }
  5480. // ResumableMedia specifies the media to upload in chunks and can be
  5481. // canceled with ctx.
  5482. //
  5483. // Deprecated: use Media instead.
  5484. //
  5485. // At most one of Media and ResumableMedia may be set. mediaType
  5486. // identifies the MIME media type of the upload, such as "image/png". If
  5487. // mediaType is "", it will be auto-detected. The provided ctx will
  5488. // supersede any context previously provided to the Context method.
  5489. func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall {
  5490. c.ctx_ = ctx
  5491. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  5492. return c
  5493. }
  5494. // ProgressUpdater provides a callback function that will be called
  5495. // after every chunk. It should be a low-latency function in order to
  5496. // not slow down the upload operation. This should only be called when
  5497. // using ResumableMedia (as opposed to Media).
  5498. func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall {
  5499. c.mediaInfo_.SetProgressUpdater(pu)
  5500. return c
  5501. }
  5502. // Fields allows partial responses to be retrieved. See
  5503. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5504. // for more information.
  5505. func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall {
  5506. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5507. return c
  5508. }
  5509. // Context sets the context to be used in this call's Do method. Any
  5510. // pending HTTP request will be aborted if the provided context is
  5511. // canceled.
  5512. // This context will supersede any context previously provided to the
  5513. // ResumableMedia method.
  5514. func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall {
  5515. c.ctx_ = ctx
  5516. return c
  5517. }
  5518. // Header returns an http.Header that can be modified by the caller to
  5519. // add HTTP headers to the request.
  5520. func (c *EditsImagesUploadCall) Header() http.Header {
  5521. if c.header_ == nil {
  5522. c.header_ = make(http.Header)
  5523. }
  5524. return c.header_
  5525. }
  5526. func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) {
  5527. reqHeaders := make(http.Header)
  5528. for k, v := range c.header_ {
  5529. reqHeaders[k] = v
  5530. }
  5531. reqHeaders.Set("User-Agent", c.s.userAgent())
  5532. var body io.Reader = nil
  5533. c.urlParams_.Set("alt", alt)
  5534. c.urlParams_.Set("prettyPrint", "false")
  5535. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5536. if c.mediaInfo_ != nil {
  5537. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  5538. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  5539. }
  5540. if body == nil {
  5541. body = new(bytes.Buffer)
  5542. reqHeaders.Set("Content-Type", "application/json")
  5543. }
  5544. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  5545. defer cleanup()
  5546. urls += "?" + c.urlParams_.Encode()
  5547. req, err := http.NewRequest("POST", urls, body)
  5548. if err != nil {
  5549. return nil, err
  5550. }
  5551. req.Header = reqHeaders
  5552. req.GetBody = getBody
  5553. googleapi.Expand(req.URL, map[string]string{
  5554. "packageName": c.packageNameid,
  5555. "editId": c.editId,
  5556. "language": c.language,
  5557. "imageType": c.imageType,
  5558. })
  5559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5560. }
  5561. // Do executes the "androidpublisher.edits.images.upload" call.
  5562. // Exactly one of *ImagesUploadResponse or error will be non-nil. Any
  5563. // non-2xx status code is an error. Response headers are in either
  5564. // *ImagesUploadResponse.ServerResponse.Header or (if a response was
  5565. // returned at all) in error.(*googleapi.Error).Header. Use
  5566. // googleapi.IsNotModified to check whether the returned error was
  5567. // because http.StatusNotModified was returned.
  5568. func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) {
  5569. gensupport.SetOptions(c.urlParams_, opts...)
  5570. res, err := c.doRequest("json")
  5571. if res != nil && res.StatusCode == http.StatusNotModified {
  5572. if res.Body != nil {
  5573. res.Body.Close()
  5574. }
  5575. return nil, &googleapi.Error{
  5576. Code: res.StatusCode,
  5577. Header: res.Header,
  5578. }
  5579. }
  5580. if err != nil {
  5581. return nil, err
  5582. }
  5583. defer googleapi.CloseBody(res)
  5584. if err := googleapi.CheckResponse(res); err != nil {
  5585. return nil, err
  5586. }
  5587. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  5588. if rx != nil {
  5589. rx.Client = c.s.client
  5590. rx.UserAgent = c.s.userAgent()
  5591. ctx := c.ctx_
  5592. if ctx == nil {
  5593. ctx = context.TODO()
  5594. }
  5595. res, err = rx.Upload(ctx)
  5596. if err != nil {
  5597. return nil, err
  5598. }
  5599. defer res.Body.Close()
  5600. if err := googleapi.CheckResponse(res); err != nil {
  5601. return nil, err
  5602. }
  5603. }
  5604. ret := &ImagesUploadResponse{
  5605. ServerResponse: googleapi.ServerResponse{
  5606. Header: res.Header,
  5607. HTTPStatusCode: res.StatusCode,
  5608. },
  5609. }
  5610. target := &ret
  5611. if err := gensupport.DecodeResponse(target, res); err != nil {
  5612. return nil, err
  5613. }
  5614. return ret, nil
  5615. // {
  5616. // "description": "Uploads a new image and adds it to the list of images for the specified language and image type.",
  5617. // "httpMethod": "POST",
  5618. // "id": "androidpublisher.edits.images.upload",
  5619. // "mediaUpload": {
  5620. // "accept": [
  5621. // "image/*"
  5622. // ],
  5623. // "maxSize": "15MB",
  5624. // "protocols": {
  5625. // "resumable": {
  5626. // "multipart": true,
  5627. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  5628. // },
  5629. // "simple": {
  5630. // "multipart": true,
  5631. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  5632. // }
  5633. // }
  5634. // },
  5635. // "parameterOrder": [
  5636. // "packageName",
  5637. // "editId",
  5638. // "language",
  5639. // "imageType"
  5640. // ],
  5641. // "parameters": {
  5642. // "editId": {
  5643. // "description": "Unique identifier for this edit.",
  5644. // "location": "path",
  5645. // "required": true,
  5646. // "type": "string"
  5647. // },
  5648. // "imageType": {
  5649. // "enum": [
  5650. // "featureGraphic",
  5651. // "icon",
  5652. // "phoneScreenshots",
  5653. // "promoGraphic",
  5654. // "sevenInchScreenshots",
  5655. // "tenInchScreenshots",
  5656. // "tvBanner",
  5657. // "tvScreenshots",
  5658. // "wearScreenshots"
  5659. // ],
  5660. // "enumDescriptions": [
  5661. // "",
  5662. // "",
  5663. // "",
  5664. // "",
  5665. // "",
  5666. // "",
  5667. // "",
  5668. // "",
  5669. // ""
  5670. // ],
  5671. // "location": "path",
  5672. // "required": true,
  5673. // "type": "string"
  5674. // },
  5675. // "language": {
  5676. // "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\".",
  5677. // "location": "path",
  5678. // "required": true,
  5679. // "type": "string"
  5680. // },
  5681. // "packageName": {
  5682. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5683. // "location": "path",
  5684. // "required": true,
  5685. // "type": "string"
  5686. // }
  5687. // },
  5688. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5689. // "response": {
  5690. // "$ref": "ImagesUploadResponse"
  5691. // },
  5692. // "scopes": [
  5693. // "https://www.googleapis.com/auth/androidpublisher"
  5694. // ],
  5695. // "supportsMediaUpload": true
  5696. // }
  5697. }
  5698. // method id "androidpublisher.edits.listings.delete":
  5699. type EditsListingsDeleteCall struct {
  5700. s *Service
  5701. packageNameid string
  5702. editId string
  5703. language string
  5704. urlParams_ gensupport.URLParams
  5705. ctx_ context.Context
  5706. header_ http.Header
  5707. }
  5708. // Delete: Deletes the specified localized store listing from an edit.
  5709. func (r *EditsListingsService) Delete(packageNameid string, editId string, language string) *EditsListingsDeleteCall {
  5710. c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5711. c.packageNameid = packageNameid
  5712. c.editId = editId
  5713. c.language = language
  5714. return c
  5715. }
  5716. // Fields allows partial responses to be retrieved. See
  5717. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5718. // for more information.
  5719. func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall {
  5720. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5721. return c
  5722. }
  5723. // Context sets the context to be used in this call's Do method. Any
  5724. // pending HTTP request will be aborted if the provided context is
  5725. // canceled.
  5726. func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall {
  5727. c.ctx_ = ctx
  5728. return c
  5729. }
  5730. // Header returns an http.Header that can be modified by the caller to
  5731. // add HTTP headers to the request.
  5732. func (c *EditsListingsDeleteCall) Header() http.Header {
  5733. if c.header_ == nil {
  5734. c.header_ = make(http.Header)
  5735. }
  5736. return c.header_
  5737. }
  5738. func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5739. reqHeaders := make(http.Header)
  5740. for k, v := range c.header_ {
  5741. reqHeaders[k] = v
  5742. }
  5743. reqHeaders.Set("User-Agent", c.s.userAgent())
  5744. var body io.Reader = nil
  5745. c.urlParams_.Set("alt", alt)
  5746. c.urlParams_.Set("prettyPrint", "false")
  5747. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  5748. urls += "?" + c.urlParams_.Encode()
  5749. req, err := http.NewRequest("DELETE", urls, body)
  5750. if err != nil {
  5751. return nil, err
  5752. }
  5753. req.Header = reqHeaders
  5754. googleapi.Expand(req.URL, map[string]string{
  5755. "packageName": c.packageNameid,
  5756. "editId": c.editId,
  5757. "language": c.language,
  5758. })
  5759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5760. }
  5761. // Do executes the "androidpublisher.edits.listings.delete" call.
  5762. func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5763. gensupport.SetOptions(c.urlParams_, opts...)
  5764. res, err := c.doRequest("json")
  5765. if err != nil {
  5766. return err
  5767. }
  5768. defer googleapi.CloseBody(res)
  5769. if err := googleapi.CheckResponse(res); err != nil {
  5770. return err
  5771. }
  5772. return nil
  5773. // {
  5774. // "description": "Deletes the specified localized store listing from an edit.",
  5775. // "httpMethod": "DELETE",
  5776. // "id": "androidpublisher.edits.listings.delete",
  5777. // "parameterOrder": [
  5778. // "packageName",
  5779. // "editId",
  5780. // "language"
  5781. // ],
  5782. // "parameters": {
  5783. // "editId": {
  5784. // "description": "Unique identifier for this edit.",
  5785. // "location": "path",
  5786. // "required": true,
  5787. // "type": "string"
  5788. // },
  5789. // "language": {
  5790. // "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\".",
  5791. // "location": "path",
  5792. // "required": true,
  5793. // "type": "string"
  5794. // },
  5795. // "packageName": {
  5796. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5797. // "location": "path",
  5798. // "required": true,
  5799. // "type": "string"
  5800. // }
  5801. // },
  5802. // "path": "{packageName}/edits/{editId}/listings/{language}",
  5803. // "scopes": [
  5804. // "https://www.googleapis.com/auth/androidpublisher"
  5805. // ]
  5806. // }
  5807. }
  5808. // method id "androidpublisher.edits.listings.deleteall":
  5809. type EditsListingsDeleteallCall struct {
  5810. s *Service
  5811. packageNameid string
  5812. editId string
  5813. urlParams_ gensupport.URLParams
  5814. ctx_ context.Context
  5815. header_ http.Header
  5816. }
  5817. // Deleteall: Deletes all localized listings from an edit.
  5818. func (r *EditsListingsService) Deleteall(packageNameid string, editId string) *EditsListingsDeleteallCall {
  5819. c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5820. c.packageNameid = packageNameid
  5821. c.editId = editId
  5822. return c
  5823. }
  5824. // Fields allows partial responses to be retrieved. See
  5825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5826. // for more information.
  5827. func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall {
  5828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5829. return c
  5830. }
  5831. // Context sets the context to be used in this call's Do method. Any
  5832. // pending HTTP request will be aborted if the provided context is
  5833. // canceled.
  5834. func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall {
  5835. c.ctx_ = ctx
  5836. return c
  5837. }
  5838. // Header returns an http.Header that can be modified by the caller to
  5839. // add HTTP headers to the request.
  5840. func (c *EditsListingsDeleteallCall) Header() http.Header {
  5841. if c.header_ == nil {
  5842. c.header_ = make(http.Header)
  5843. }
  5844. return c.header_
  5845. }
  5846. func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) {
  5847. reqHeaders := make(http.Header)
  5848. for k, v := range c.header_ {
  5849. reqHeaders[k] = v
  5850. }
  5851. reqHeaders.Set("User-Agent", c.s.userAgent())
  5852. var body io.Reader = nil
  5853. c.urlParams_.Set("alt", alt)
  5854. c.urlParams_.Set("prettyPrint", "false")
  5855. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  5856. urls += "?" + c.urlParams_.Encode()
  5857. req, err := http.NewRequest("DELETE", urls, body)
  5858. if err != nil {
  5859. return nil, err
  5860. }
  5861. req.Header = reqHeaders
  5862. googleapi.Expand(req.URL, map[string]string{
  5863. "packageName": c.packageNameid,
  5864. "editId": c.editId,
  5865. })
  5866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5867. }
  5868. // Do executes the "androidpublisher.edits.listings.deleteall" call.
  5869. func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error {
  5870. gensupport.SetOptions(c.urlParams_, opts...)
  5871. res, err := c.doRequest("json")
  5872. if err != nil {
  5873. return err
  5874. }
  5875. defer googleapi.CloseBody(res)
  5876. if err := googleapi.CheckResponse(res); err != nil {
  5877. return err
  5878. }
  5879. return nil
  5880. // {
  5881. // "description": "Deletes all localized listings from an edit.",
  5882. // "httpMethod": "DELETE",
  5883. // "id": "androidpublisher.edits.listings.deleteall",
  5884. // "parameterOrder": [
  5885. // "packageName",
  5886. // "editId"
  5887. // ],
  5888. // "parameters": {
  5889. // "editId": {
  5890. // "description": "Unique identifier for this edit.",
  5891. // "location": "path",
  5892. // "required": true,
  5893. // "type": "string"
  5894. // },
  5895. // "packageName": {
  5896. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5897. // "location": "path",
  5898. // "required": true,
  5899. // "type": "string"
  5900. // }
  5901. // },
  5902. // "path": "{packageName}/edits/{editId}/listings",
  5903. // "scopes": [
  5904. // "https://www.googleapis.com/auth/androidpublisher"
  5905. // ]
  5906. // }
  5907. }
  5908. // method id "androidpublisher.edits.listings.get":
  5909. type EditsListingsGetCall struct {
  5910. s *Service
  5911. packageNameid string
  5912. editId string
  5913. language string
  5914. urlParams_ gensupport.URLParams
  5915. ifNoneMatch_ string
  5916. ctx_ context.Context
  5917. header_ http.Header
  5918. }
  5919. // Get: Fetches information about a localized store listing.
  5920. func (r *EditsListingsService) Get(packageNameid string, editId string, language string) *EditsListingsGetCall {
  5921. c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5922. c.packageNameid = packageNameid
  5923. c.editId = editId
  5924. c.language = language
  5925. return c
  5926. }
  5927. // Fields allows partial responses to be retrieved. See
  5928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5929. // for more information.
  5930. func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall {
  5931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5932. return c
  5933. }
  5934. // IfNoneMatch sets the optional parameter which makes the operation
  5935. // fail if the object's ETag matches the given value. This is useful for
  5936. // getting updates only after the object has changed since the last
  5937. // request. Use googleapi.IsNotModified to check whether the response
  5938. // error from Do is the result of In-None-Match.
  5939. func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall {
  5940. c.ifNoneMatch_ = entityTag
  5941. return c
  5942. }
  5943. // Context sets the context to be used in this call's Do method. Any
  5944. // pending HTTP request will be aborted if the provided context is
  5945. // canceled.
  5946. func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall {
  5947. c.ctx_ = ctx
  5948. return c
  5949. }
  5950. // Header returns an http.Header that can be modified by the caller to
  5951. // add HTTP headers to the request.
  5952. func (c *EditsListingsGetCall) Header() http.Header {
  5953. if c.header_ == nil {
  5954. c.header_ = make(http.Header)
  5955. }
  5956. return c.header_
  5957. }
  5958. func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) {
  5959. reqHeaders := make(http.Header)
  5960. for k, v := range c.header_ {
  5961. reqHeaders[k] = v
  5962. }
  5963. reqHeaders.Set("User-Agent", c.s.userAgent())
  5964. if c.ifNoneMatch_ != "" {
  5965. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5966. }
  5967. var body io.Reader = nil
  5968. c.urlParams_.Set("alt", alt)
  5969. c.urlParams_.Set("prettyPrint", "false")
  5970. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  5971. urls += "?" + c.urlParams_.Encode()
  5972. req, err := http.NewRequest("GET", urls, body)
  5973. if err != nil {
  5974. return nil, err
  5975. }
  5976. req.Header = reqHeaders
  5977. googleapi.Expand(req.URL, map[string]string{
  5978. "packageName": c.packageNameid,
  5979. "editId": c.editId,
  5980. "language": c.language,
  5981. })
  5982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5983. }
  5984. // Do executes the "androidpublisher.edits.listings.get" call.
  5985. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  5986. // code is an error. Response headers are in either
  5987. // *Listing.ServerResponse.Header or (if a response was returned at all)
  5988. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5989. // check whether the returned error was because http.StatusNotModified
  5990. // was returned.
  5991. func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  5992. gensupport.SetOptions(c.urlParams_, opts...)
  5993. res, err := c.doRequest("json")
  5994. if res != nil && res.StatusCode == http.StatusNotModified {
  5995. if res.Body != nil {
  5996. res.Body.Close()
  5997. }
  5998. return nil, &googleapi.Error{
  5999. Code: res.StatusCode,
  6000. Header: res.Header,
  6001. }
  6002. }
  6003. if err != nil {
  6004. return nil, err
  6005. }
  6006. defer googleapi.CloseBody(res)
  6007. if err := googleapi.CheckResponse(res); err != nil {
  6008. return nil, err
  6009. }
  6010. ret := &Listing{
  6011. ServerResponse: googleapi.ServerResponse{
  6012. Header: res.Header,
  6013. HTTPStatusCode: res.StatusCode,
  6014. },
  6015. }
  6016. target := &ret
  6017. if err := gensupport.DecodeResponse(target, res); err != nil {
  6018. return nil, err
  6019. }
  6020. return ret, nil
  6021. // {
  6022. // "description": "Fetches information about a localized store listing.",
  6023. // "httpMethod": "GET",
  6024. // "id": "androidpublisher.edits.listings.get",
  6025. // "parameterOrder": [
  6026. // "packageName",
  6027. // "editId",
  6028. // "language"
  6029. // ],
  6030. // "parameters": {
  6031. // "editId": {
  6032. // "description": "Unique identifier for this edit.",
  6033. // "location": "path",
  6034. // "required": true,
  6035. // "type": "string"
  6036. // },
  6037. // "language": {
  6038. // "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\".",
  6039. // "location": "path",
  6040. // "required": true,
  6041. // "type": "string"
  6042. // },
  6043. // "packageName": {
  6044. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6045. // "location": "path",
  6046. // "required": true,
  6047. // "type": "string"
  6048. // }
  6049. // },
  6050. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6051. // "response": {
  6052. // "$ref": "Listing"
  6053. // },
  6054. // "scopes": [
  6055. // "https://www.googleapis.com/auth/androidpublisher"
  6056. // ]
  6057. // }
  6058. }
  6059. // method id "androidpublisher.edits.listings.list":
  6060. type EditsListingsListCall struct {
  6061. s *Service
  6062. packageNameid string
  6063. editId string
  6064. urlParams_ gensupport.URLParams
  6065. ifNoneMatch_ string
  6066. ctx_ context.Context
  6067. header_ http.Header
  6068. }
  6069. // List: Returns all of the localized store listings attached to this
  6070. // edit.
  6071. func (r *EditsListingsService) List(packageNameid string, editId string) *EditsListingsListCall {
  6072. c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6073. c.packageNameid = packageNameid
  6074. c.editId = editId
  6075. return c
  6076. }
  6077. // Fields allows partial responses to be retrieved. See
  6078. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6079. // for more information.
  6080. func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall {
  6081. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6082. return c
  6083. }
  6084. // IfNoneMatch sets the optional parameter which makes the operation
  6085. // fail if the object's ETag matches the given value. This is useful for
  6086. // getting updates only after the object has changed since the last
  6087. // request. Use googleapi.IsNotModified to check whether the response
  6088. // error from Do is the result of In-None-Match.
  6089. func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall {
  6090. c.ifNoneMatch_ = entityTag
  6091. return c
  6092. }
  6093. // Context sets the context to be used in this call's Do method. Any
  6094. // pending HTTP request will be aborted if the provided context is
  6095. // canceled.
  6096. func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall {
  6097. c.ctx_ = ctx
  6098. return c
  6099. }
  6100. // Header returns an http.Header that can be modified by the caller to
  6101. // add HTTP headers to the request.
  6102. func (c *EditsListingsListCall) Header() http.Header {
  6103. if c.header_ == nil {
  6104. c.header_ = make(http.Header)
  6105. }
  6106. return c.header_
  6107. }
  6108. func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) {
  6109. reqHeaders := make(http.Header)
  6110. for k, v := range c.header_ {
  6111. reqHeaders[k] = v
  6112. }
  6113. reqHeaders.Set("User-Agent", c.s.userAgent())
  6114. if c.ifNoneMatch_ != "" {
  6115. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6116. }
  6117. var body io.Reader = nil
  6118. c.urlParams_.Set("alt", alt)
  6119. c.urlParams_.Set("prettyPrint", "false")
  6120. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  6121. urls += "?" + c.urlParams_.Encode()
  6122. req, err := http.NewRequest("GET", urls, body)
  6123. if err != nil {
  6124. return nil, err
  6125. }
  6126. req.Header = reqHeaders
  6127. googleapi.Expand(req.URL, map[string]string{
  6128. "packageName": c.packageNameid,
  6129. "editId": c.editId,
  6130. })
  6131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6132. }
  6133. // Do executes the "androidpublisher.edits.listings.list" call.
  6134. // Exactly one of *ListingsListResponse or error will be non-nil. Any
  6135. // non-2xx status code is an error. Response headers are in either
  6136. // *ListingsListResponse.ServerResponse.Header or (if a response was
  6137. // returned at all) in error.(*googleapi.Error).Header. Use
  6138. // googleapi.IsNotModified to check whether the returned error was
  6139. // because http.StatusNotModified was returned.
  6140. func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) {
  6141. gensupport.SetOptions(c.urlParams_, opts...)
  6142. res, err := c.doRequest("json")
  6143. if res != nil && res.StatusCode == http.StatusNotModified {
  6144. if res.Body != nil {
  6145. res.Body.Close()
  6146. }
  6147. return nil, &googleapi.Error{
  6148. Code: res.StatusCode,
  6149. Header: res.Header,
  6150. }
  6151. }
  6152. if err != nil {
  6153. return nil, err
  6154. }
  6155. defer googleapi.CloseBody(res)
  6156. if err := googleapi.CheckResponse(res); err != nil {
  6157. return nil, err
  6158. }
  6159. ret := &ListingsListResponse{
  6160. ServerResponse: googleapi.ServerResponse{
  6161. Header: res.Header,
  6162. HTTPStatusCode: res.StatusCode,
  6163. },
  6164. }
  6165. target := &ret
  6166. if err := gensupport.DecodeResponse(target, res); err != nil {
  6167. return nil, err
  6168. }
  6169. return ret, nil
  6170. // {
  6171. // "description": "Returns all of the localized store listings attached to this edit.",
  6172. // "httpMethod": "GET",
  6173. // "id": "androidpublisher.edits.listings.list",
  6174. // "parameterOrder": [
  6175. // "packageName",
  6176. // "editId"
  6177. // ],
  6178. // "parameters": {
  6179. // "editId": {
  6180. // "description": "Unique identifier for this edit.",
  6181. // "location": "path",
  6182. // "required": true,
  6183. // "type": "string"
  6184. // },
  6185. // "packageName": {
  6186. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6187. // "location": "path",
  6188. // "required": true,
  6189. // "type": "string"
  6190. // }
  6191. // },
  6192. // "path": "{packageName}/edits/{editId}/listings",
  6193. // "response": {
  6194. // "$ref": "ListingsListResponse"
  6195. // },
  6196. // "scopes": [
  6197. // "https://www.googleapis.com/auth/androidpublisher"
  6198. // ]
  6199. // }
  6200. }
  6201. // method id "androidpublisher.edits.listings.patch":
  6202. type EditsListingsPatchCall struct {
  6203. s *Service
  6204. packageNameid string
  6205. editId string
  6206. language string
  6207. listing *Listing
  6208. urlParams_ gensupport.URLParams
  6209. ctx_ context.Context
  6210. header_ http.Header
  6211. }
  6212. // Patch: Creates or updates a localized store listing. This method
  6213. // supports patch semantics.
  6214. func (r *EditsListingsService) Patch(packageNameid string, editId string, language string, listing *Listing) *EditsListingsPatchCall {
  6215. c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6216. c.packageNameid = packageNameid
  6217. c.editId = editId
  6218. c.language = language
  6219. c.listing = listing
  6220. return c
  6221. }
  6222. // Fields allows partial responses to be retrieved. See
  6223. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6224. // for more information.
  6225. func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall {
  6226. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6227. return c
  6228. }
  6229. // Context sets the context to be used in this call's Do method. Any
  6230. // pending HTTP request will be aborted if the provided context is
  6231. // canceled.
  6232. func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall {
  6233. c.ctx_ = ctx
  6234. return c
  6235. }
  6236. // Header returns an http.Header that can be modified by the caller to
  6237. // add HTTP headers to the request.
  6238. func (c *EditsListingsPatchCall) Header() http.Header {
  6239. if c.header_ == nil {
  6240. c.header_ = make(http.Header)
  6241. }
  6242. return c.header_
  6243. }
  6244. func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) {
  6245. reqHeaders := make(http.Header)
  6246. for k, v := range c.header_ {
  6247. reqHeaders[k] = v
  6248. }
  6249. reqHeaders.Set("User-Agent", c.s.userAgent())
  6250. var body io.Reader = nil
  6251. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  6252. if err != nil {
  6253. return nil, err
  6254. }
  6255. reqHeaders.Set("Content-Type", "application/json")
  6256. c.urlParams_.Set("alt", alt)
  6257. c.urlParams_.Set("prettyPrint", "false")
  6258. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6259. urls += "?" + c.urlParams_.Encode()
  6260. req, err := http.NewRequest("PATCH", urls, body)
  6261. if err != nil {
  6262. return nil, err
  6263. }
  6264. req.Header = reqHeaders
  6265. googleapi.Expand(req.URL, map[string]string{
  6266. "packageName": c.packageNameid,
  6267. "editId": c.editId,
  6268. "language": c.language,
  6269. })
  6270. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6271. }
  6272. // Do executes the "androidpublisher.edits.listings.patch" call.
  6273. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6274. // code is an error. Response headers are in either
  6275. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6276. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6277. // check whether the returned error was because http.StatusNotModified
  6278. // was returned.
  6279. func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6280. gensupport.SetOptions(c.urlParams_, opts...)
  6281. res, err := c.doRequest("json")
  6282. if res != nil && res.StatusCode == http.StatusNotModified {
  6283. if res.Body != nil {
  6284. res.Body.Close()
  6285. }
  6286. return nil, &googleapi.Error{
  6287. Code: res.StatusCode,
  6288. Header: res.Header,
  6289. }
  6290. }
  6291. if err != nil {
  6292. return nil, err
  6293. }
  6294. defer googleapi.CloseBody(res)
  6295. if err := googleapi.CheckResponse(res); err != nil {
  6296. return nil, err
  6297. }
  6298. ret := &Listing{
  6299. ServerResponse: googleapi.ServerResponse{
  6300. Header: res.Header,
  6301. HTTPStatusCode: res.StatusCode,
  6302. },
  6303. }
  6304. target := &ret
  6305. if err := gensupport.DecodeResponse(target, res); err != nil {
  6306. return nil, err
  6307. }
  6308. return ret, nil
  6309. // {
  6310. // "description": "Creates or updates a localized store listing. This method supports patch semantics.",
  6311. // "httpMethod": "PATCH",
  6312. // "id": "androidpublisher.edits.listings.patch",
  6313. // "parameterOrder": [
  6314. // "packageName",
  6315. // "editId",
  6316. // "language"
  6317. // ],
  6318. // "parameters": {
  6319. // "editId": {
  6320. // "description": "Unique identifier for this edit.",
  6321. // "location": "path",
  6322. // "required": true,
  6323. // "type": "string"
  6324. // },
  6325. // "language": {
  6326. // "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\".",
  6327. // "location": "path",
  6328. // "required": true,
  6329. // "type": "string"
  6330. // },
  6331. // "packageName": {
  6332. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6333. // "location": "path",
  6334. // "required": true,
  6335. // "type": "string"
  6336. // }
  6337. // },
  6338. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6339. // "request": {
  6340. // "$ref": "Listing"
  6341. // },
  6342. // "response": {
  6343. // "$ref": "Listing"
  6344. // },
  6345. // "scopes": [
  6346. // "https://www.googleapis.com/auth/androidpublisher"
  6347. // ]
  6348. // }
  6349. }
  6350. // method id "androidpublisher.edits.listings.update":
  6351. type EditsListingsUpdateCall struct {
  6352. s *Service
  6353. packageNameid string
  6354. editId string
  6355. language string
  6356. listing *Listing
  6357. urlParams_ gensupport.URLParams
  6358. ctx_ context.Context
  6359. header_ http.Header
  6360. }
  6361. // Update: Creates or updates a localized store listing.
  6362. func (r *EditsListingsService) Update(packageNameid string, editId string, language string, listing *Listing) *EditsListingsUpdateCall {
  6363. c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6364. c.packageNameid = packageNameid
  6365. c.editId = editId
  6366. c.language = language
  6367. c.listing = listing
  6368. return c
  6369. }
  6370. // Fields allows partial responses to be retrieved. See
  6371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6372. // for more information.
  6373. func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall {
  6374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6375. return c
  6376. }
  6377. // Context sets the context to be used in this call's Do method. Any
  6378. // pending HTTP request will be aborted if the provided context is
  6379. // canceled.
  6380. func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall {
  6381. c.ctx_ = ctx
  6382. return c
  6383. }
  6384. // Header returns an http.Header that can be modified by the caller to
  6385. // add HTTP headers to the request.
  6386. func (c *EditsListingsUpdateCall) Header() http.Header {
  6387. if c.header_ == nil {
  6388. c.header_ = make(http.Header)
  6389. }
  6390. return c.header_
  6391. }
  6392. func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6393. reqHeaders := make(http.Header)
  6394. for k, v := range c.header_ {
  6395. reqHeaders[k] = v
  6396. }
  6397. reqHeaders.Set("User-Agent", c.s.userAgent())
  6398. var body io.Reader = nil
  6399. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  6400. if err != nil {
  6401. return nil, err
  6402. }
  6403. reqHeaders.Set("Content-Type", "application/json")
  6404. c.urlParams_.Set("alt", alt)
  6405. c.urlParams_.Set("prettyPrint", "false")
  6406. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6407. urls += "?" + c.urlParams_.Encode()
  6408. req, err := http.NewRequest("PUT", urls, body)
  6409. if err != nil {
  6410. return nil, err
  6411. }
  6412. req.Header = reqHeaders
  6413. googleapi.Expand(req.URL, map[string]string{
  6414. "packageName": c.packageNameid,
  6415. "editId": c.editId,
  6416. "language": c.language,
  6417. })
  6418. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6419. }
  6420. // Do executes the "androidpublisher.edits.listings.update" call.
  6421. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6422. // code is an error. Response headers are in either
  6423. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6424. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6425. // check whether the returned error was because http.StatusNotModified
  6426. // was returned.
  6427. func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6428. gensupport.SetOptions(c.urlParams_, opts...)
  6429. res, err := c.doRequest("json")
  6430. if res != nil && res.StatusCode == http.StatusNotModified {
  6431. if res.Body != nil {
  6432. res.Body.Close()
  6433. }
  6434. return nil, &googleapi.Error{
  6435. Code: res.StatusCode,
  6436. Header: res.Header,
  6437. }
  6438. }
  6439. if err != nil {
  6440. return nil, err
  6441. }
  6442. defer googleapi.CloseBody(res)
  6443. if err := googleapi.CheckResponse(res); err != nil {
  6444. return nil, err
  6445. }
  6446. ret := &Listing{
  6447. ServerResponse: googleapi.ServerResponse{
  6448. Header: res.Header,
  6449. HTTPStatusCode: res.StatusCode,
  6450. },
  6451. }
  6452. target := &ret
  6453. if err := gensupport.DecodeResponse(target, res); err != nil {
  6454. return nil, err
  6455. }
  6456. return ret, nil
  6457. // {
  6458. // "description": "Creates or updates a localized store listing.",
  6459. // "httpMethod": "PUT",
  6460. // "id": "androidpublisher.edits.listings.update",
  6461. // "parameterOrder": [
  6462. // "packageName",
  6463. // "editId",
  6464. // "language"
  6465. // ],
  6466. // "parameters": {
  6467. // "editId": {
  6468. // "description": "Unique identifier for this edit.",
  6469. // "location": "path",
  6470. // "required": true,
  6471. // "type": "string"
  6472. // },
  6473. // "language": {
  6474. // "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\".",
  6475. // "location": "path",
  6476. // "required": true,
  6477. // "type": "string"
  6478. // },
  6479. // "packageName": {
  6480. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6481. // "location": "path",
  6482. // "required": true,
  6483. // "type": "string"
  6484. // }
  6485. // },
  6486. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6487. // "request": {
  6488. // "$ref": "Listing"
  6489. // },
  6490. // "response": {
  6491. // "$ref": "Listing"
  6492. // },
  6493. // "scopes": [
  6494. // "https://www.googleapis.com/auth/androidpublisher"
  6495. // ]
  6496. // }
  6497. }
  6498. // method id "androidpublisher.edits.testers.get":
  6499. type EditsTestersGetCall struct {
  6500. s *Service
  6501. packageNameid string
  6502. editId string
  6503. track string
  6504. urlParams_ gensupport.URLParams
  6505. ifNoneMatch_ string
  6506. ctx_ context.Context
  6507. header_ http.Header
  6508. }
  6509. // Get:
  6510. func (r *EditsTestersService) Get(packageNameid string, editId string, track string) *EditsTestersGetCall {
  6511. c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6512. c.packageNameid = packageNameid
  6513. c.editId = editId
  6514. c.track = track
  6515. return c
  6516. }
  6517. // Fields allows partial responses to be retrieved. See
  6518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6519. // for more information.
  6520. func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall {
  6521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6522. return c
  6523. }
  6524. // IfNoneMatch sets the optional parameter which makes the operation
  6525. // fail if the object's ETag matches the given value. This is useful for
  6526. // getting updates only after the object has changed since the last
  6527. // request. Use googleapi.IsNotModified to check whether the response
  6528. // error from Do is the result of In-None-Match.
  6529. func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall {
  6530. c.ifNoneMatch_ = entityTag
  6531. return c
  6532. }
  6533. // Context sets the context to be used in this call's Do method. Any
  6534. // pending HTTP request will be aborted if the provided context is
  6535. // canceled.
  6536. func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall {
  6537. c.ctx_ = ctx
  6538. return c
  6539. }
  6540. // Header returns an http.Header that can be modified by the caller to
  6541. // add HTTP headers to the request.
  6542. func (c *EditsTestersGetCall) Header() http.Header {
  6543. if c.header_ == nil {
  6544. c.header_ = make(http.Header)
  6545. }
  6546. return c.header_
  6547. }
  6548. func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) {
  6549. reqHeaders := make(http.Header)
  6550. for k, v := range c.header_ {
  6551. reqHeaders[k] = v
  6552. }
  6553. reqHeaders.Set("User-Agent", c.s.userAgent())
  6554. if c.ifNoneMatch_ != "" {
  6555. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6556. }
  6557. var body io.Reader = nil
  6558. c.urlParams_.Set("alt", alt)
  6559. c.urlParams_.Set("prettyPrint", "false")
  6560. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  6561. urls += "?" + c.urlParams_.Encode()
  6562. req, err := http.NewRequest("GET", urls, body)
  6563. if err != nil {
  6564. return nil, err
  6565. }
  6566. req.Header = reqHeaders
  6567. googleapi.Expand(req.URL, map[string]string{
  6568. "packageName": c.packageNameid,
  6569. "editId": c.editId,
  6570. "track": c.track,
  6571. })
  6572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6573. }
  6574. // Do executes the "androidpublisher.edits.testers.get" call.
  6575. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  6576. // code is an error. Response headers are in either
  6577. // *Testers.ServerResponse.Header or (if a response was returned at all)
  6578. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6579. // check whether the returned error was because http.StatusNotModified
  6580. // was returned.
  6581. func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  6582. gensupport.SetOptions(c.urlParams_, opts...)
  6583. res, err := c.doRequest("json")
  6584. if res != nil && res.StatusCode == http.StatusNotModified {
  6585. if res.Body != nil {
  6586. res.Body.Close()
  6587. }
  6588. return nil, &googleapi.Error{
  6589. Code: res.StatusCode,
  6590. Header: res.Header,
  6591. }
  6592. }
  6593. if err != nil {
  6594. return nil, err
  6595. }
  6596. defer googleapi.CloseBody(res)
  6597. if err := googleapi.CheckResponse(res); err != nil {
  6598. return nil, err
  6599. }
  6600. ret := &Testers{
  6601. ServerResponse: googleapi.ServerResponse{
  6602. Header: res.Header,
  6603. HTTPStatusCode: res.StatusCode,
  6604. },
  6605. }
  6606. target := &ret
  6607. if err := gensupport.DecodeResponse(target, res); err != nil {
  6608. return nil, err
  6609. }
  6610. return ret, nil
  6611. // {
  6612. // "httpMethod": "GET",
  6613. // "id": "androidpublisher.edits.testers.get",
  6614. // "parameterOrder": [
  6615. // "packageName",
  6616. // "editId",
  6617. // "track"
  6618. // ],
  6619. // "parameters": {
  6620. // "editId": {
  6621. // "description": "Unique identifier for this edit.",
  6622. // "location": "path",
  6623. // "required": true,
  6624. // "type": "string"
  6625. // },
  6626. // "packageName": {
  6627. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6628. // "location": "path",
  6629. // "required": true,
  6630. // "type": "string"
  6631. // },
  6632. // "track": {
  6633. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  6634. // "location": "path",
  6635. // "pattern": "(alpha|beta|production|rollout|internal)",
  6636. // "required": true,
  6637. // "type": "string"
  6638. // }
  6639. // },
  6640. // "path": "{packageName}/edits/{editId}/testers/{track}",
  6641. // "response": {
  6642. // "$ref": "Testers"
  6643. // },
  6644. // "scopes": [
  6645. // "https://www.googleapis.com/auth/androidpublisher"
  6646. // ]
  6647. // }
  6648. }
  6649. // method id "androidpublisher.edits.testers.patch":
  6650. type EditsTestersPatchCall struct {
  6651. s *Service
  6652. packageNameid string
  6653. editId string
  6654. track string
  6655. testers *Testers
  6656. urlParams_ gensupport.URLParams
  6657. ctx_ context.Context
  6658. header_ http.Header
  6659. }
  6660. // Patch:
  6661. func (r *EditsTestersService) Patch(packageNameid string, editId string, track string, testers *Testers) *EditsTestersPatchCall {
  6662. c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6663. c.packageNameid = packageNameid
  6664. c.editId = editId
  6665. c.track = track
  6666. c.testers = testers
  6667. return c
  6668. }
  6669. // Fields allows partial responses to be retrieved. See
  6670. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6671. // for more information.
  6672. func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall {
  6673. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6674. return c
  6675. }
  6676. // Context sets the context to be used in this call's Do method. Any
  6677. // pending HTTP request will be aborted if the provided context is
  6678. // canceled.
  6679. func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall {
  6680. c.ctx_ = ctx
  6681. return c
  6682. }
  6683. // Header returns an http.Header that can be modified by the caller to
  6684. // add HTTP headers to the request.
  6685. func (c *EditsTestersPatchCall) Header() http.Header {
  6686. if c.header_ == nil {
  6687. c.header_ = make(http.Header)
  6688. }
  6689. return c.header_
  6690. }
  6691. func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) {
  6692. reqHeaders := make(http.Header)
  6693. for k, v := range c.header_ {
  6694. reqHeaders[k] = v
  6695. }
  6696. reqHeaders.Set("User-Agent", c.s.userAgent())
  6697. var body io.Reader = nil
  6698. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  6699. if err != nil {
  6700. return nil, err
  6701. }
  6702. reqHeaders.Set("Content-Type", "application/json")
  6703. c.urlParams_.Set("alt", alt)
  6704. c.urlParams_.Set("prettyPrint", "false")
  6705. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  6706. urls += "?" + c.urlParams_.Encode()
  6707. req, err := http.NewRequest("PATCH", urls, body)
  6708. if err != nil {
  6709. return nil, err
  6710. }
  6711. req.Header = reqHeaders
  6712. googleapi.Expand(req.URL, map[string]string{
  6713. "packageName": c.packageNameid,
  6714. "editId": c.editId,
  6715. "track": c.track,
  6716. })
  6717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6718. }
  6719. // Do executes the "androidpublisher.edits.testers.patch" call.
  6720. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  6721. // code is an error. Response headers are in either
  6722. // *Testers.ServerResponse.Header or (if a response was returned at all)
  6723. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6724. // check whether the returned error was because http.StatusNotModified
  6725. // was returned.
  6726. func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  6727. gensupport.SetOptions(c.urlParams_, opts...)
  6728. res, err := c.doRequest("json")
  6729. if res != nil && res.StatusCode == http.StatusNotModified {
  6730. if res.Body != nil {
  6731. res.Body.Close()
  6732. }
  6733. return nil, &googleapi.Error{
  6734. Code: res.StatusCode,
  6735. Header: res.Header,
  6736. }
  6737. }
  6738. if err != nil {
  6739. return nil, err
  6740. }
  6741. defer googleapi.CloseBody(res)
  6742. if err := googleapi.CheckResponse(res); err != nil {
  6743. return nil, err
  6744. }
  6745. ret := &Testers{
  6746. ServerResponse: googleapi.ServerResponse{
  6747. Header: res.Header,
  6748. HTTPStatusCode: res.StatusCode,
  6749. },
  6750. }
  6751. target := &ret
  6752. if err := gensupport.DecodeResponse(target, res); err != nil {
  6753. return nil, err
  6754. }
  6755. return ret, nil
  6756. // {
  6757. // "httpMethod": "PATCH",
  6758. // "id": "androidpublisher.edits.testers.patch",
  6759. // "parameterOrder": [
  6760. // "packageName",
  6761. // "editId",
  6762. // "track"
  6763. // ],
  6764. // "parameters": {
  6765. // "editId": {
  6766. // "description": "Unique identifier for this edit.",
  6767. // "location": "path",
  6768. // "required": true,
  6769. // "type": "string"
  6770. // },
  6771. // "packageName": {
  6772. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6773. // "location": "path",
  6774. // "required": true,
  6775. // "type": "string"
  6776. // },
  6777. // "track": {
  6778. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  6779. // "location": "path",
  6780. // "pattern": "(alpha|beta|production|rollout|internal)",
  6781. // "required": true,
  6782. // "type": "string"
  6783. // }
  6784. // },
  6785. // "path": "{packageName}/edits/{editId}/testers/{track}",
  6786. // "request": {
  6787. // "$ref": "Testers"
  6788. // },
  6789. // "response": {
  6790. // "$ref": "Testers"
  6791. // },
  6792. // "scopes": [
  6793. // "https://www.googleapis.com/auth/androidpublisher"
  6794. // ]
  6795. // }
  6796. }
  6797. // method id "androidpublisher.edits.testers.update":
  6798. type EditsTestersUpdateCall struct {
  6799. s *Service
  6800. packageNameid string
  6801. editId string
  6802. track string
  6803. testers *Testers
  6804. urlParams_ gensupport.URLParams
  6805. ctx_ context.Context
  6806. header_ http.Header
  6807. }
  6808. // Update:
  6809. func (r *EditsTestersService) Update(packageNameid string, editId string, track string, testers *Testers) *EditsTestersUpdateCall {
  6810. c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6811. c.packageNameid = packageNameid
  6812. c.editId = editId
  6813. c.track = track
  6814. c.testers = testers
  6815. return c
  6816. }
  6817. // Fields allows partial responses to be retrieved. See
  6818. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6819. // for more information.
  6820. func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall {
  6821. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6822. return c
  6823. }
  6824. // Context sets the context to be used in this call's Do method. Any
  6825. // pending HTTP request will be aborted if the provided context is
  6826. // canceled.
  6827. func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall {
  6828. c.ctx_ = ctx
  6829. return c
  6830. }
  6831. // Header returns an http.Header that can be modified by the caller to
  6832. // add HTTP headers to the request.
  6833. func (c *EditsTestersUpdateCall) Header() http.Header {
  6834. if c.header_ == nil {
  6835. c.header_ = make(http.Header)
  6836. }
  6837. return c.header_
  6838. }
  6839. func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) {
  6840. reqHeaders := make(http.Header)
  6841. for k, v := range c.header_ {
  6842. reqHeaders[k] = v
  6843. }
  6844. reqHeaders.Set("User-Agent", c.s.userAgent())
  6845. var body io.Reader = nil
  6846. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  6847. if err != nil {
  6848. return nil, err
  6849. }
  6850. reqHeaders.Set("Content-Type", "application/json")
  6851. c.urlParams_.Set("alt", alt)
  6852. c.urlParams_.Set("prettyPrint", "false")
  6853. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  6854. urls += "?" + c.urlParams_.Encode()
  6855. req, err := http.NewRequest("PUT", urls, body)
  6856. if err != nil {
  6857. return nil, err
  6858. }
  6859. req.Header = reqHeaders
  6860. googleapi.Expand(req.URL, map[string]string{
  6861. "packageName": c.packageNameid,
  6862. "editId": c.editId,
  6863. "track": c.track,
  6864. })
  6865. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6866. }
  6867. // Do executes the "androidpublisher.edits.testers.update" call.
  6868. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  6869. // code is an error. Response headers are in either
  6870. // *Testers.ServerResponse.Header or (if a response was returned at all)
  6871. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6872. // check whether the returned error was because http.StatusNotModified
  6873. // was returned.
  6874. func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  6875. gensupport.SetOptions(c.urlParams_, opts...)
  6876. res, err := c.doRequest("json")
  6877. if res != nil && res.StatusCode == http.StatusNotModified {
  6878. if res.Body != nil {
  6879. res.Body.Close()
  6880. }
  6881. return nil, &googleapi.Error{
  6882. Code: res.StatusCode,
  6883. Header: res.Header,
  6884. }
  6885. }
  6886. if err != nil {
  6887. return nil, err
  6888. }
  6889. defer googleapi.CloseBody(res)
  6890. if err := googleapi.CheckResponse(res); err != nil {
  6891. return nil, err
  6892. }
  6893. ret := &Testers{
  6894. ServerResponse: googleapi.ServerResponse{
  6895. Header: res.Header,
  6896. HTTPStatusCode: res.StatusCode,
  6897. },
  6898. }
  6899. target := &ret
  6900. if err := gensupport.DecodeResponse(target, res); err != nil {
  6901. return nil, err
  6902. }
  6903. return ret, nil
  6904. // {
  6905. // "httpMethod": "PUT",
  6906. // "id": "androidpublisher.edits.testers.update",
  6907. // "parameterOrder": [
  6908. // "packageName",
  6909. // "editId",
  6910. // "track"
  6911. // ],
  6912. // "parameters": {
  6913. // "editId": {
  6914. // "description": "Unique identifier for this edit.",
  6915. // "location": "path",
  6916. // "required": true,
  6917. // "type": "string"
  6918. // },
  6919. // "packageName": {
  6920. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6921. // "location": "path",
  6922. // "required": true,
  6923. // "type": "string"
  6924. // },
  6925. // "track": {
  6926. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  6927. // "location": "path",
  6928. // "pattern": "(alpha|beta|production|rollout|internal)",
  6929. // "required": true,
  6930. // "type": "string"
  6931. // }
  6932. // },
  6933. // "path": "{packageName}/edits/{editId}/testers/{track}",
  6934. // "request": {
  6935. // "$ref": "Testers"
  6936. // },
  6937. // "response": {
  6938. // "$ref": "Testers"
  6939. // },
  6940. // "scopes": [
  6941. // "https://www.googleapis.com/auth/androidpublisher"
  6942. // ]
  6943. // }
  6944. }
  6945. // method id "androidpublisher.edits.tracks.get":
  6946. type EditsTracksGetCall struct {
  6947. s *Service
  6948. packageNameid string
  6949. editId string
  6950. track string
  6951. urlParams_ gensupport.URLParams
  6952. ifNoneMatch_ string
  6953. ctx_ context.Context
  6954. header_ http.Header
  6955. }
  6956. // Get: Fetches the track configuration for the specified track type.
  6957. // Includes the APK version codes that are in this track.
  6958. func (r *EditsTracksService) Get(packageNameid string, editId string, track string) *EditsTracksGetCall {
  6959. c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6960. c.packageNameid = packageNameid
  6961. c.editId = editId
  6962. c.track = track
  6963. return c
  6964. }
  6965. // Fields allows partial responses to be retrieved. See
  6966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6967. // for more information.
  6968. func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall {
  6969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6970. return c
  6971. }
  6972. // IfNoneMatch sets the optional parameter which makes the operation
  6973. // fail if the object's ETag matches the given value. This is useful for
  6974. // getting updates only after the object has changed since the last
  6975. // request. Use googleapi.IsNotModified to check whether the response
  6976. // error from Do is the result of In-None-Match.
  6977. func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall {
  6978. c.ifNoneMatch_ = entityTag
  6979. return c
  6980. }
  6981. // Context sets the context to be used in this call's Do method. Any
  6982. // pending HTTP request will be aborted if the provided context is
  6983. // canceled.
  6984. func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall {
  6985. c.ctx_ = ctx
  6986. return c
  6987. }
  6988. // Header returns an http.Header that can be modified by the caller to
  6989. // add HTTP headers to the request.
  6990. func (c *EditsTracksGetCall) Header() http.Header {
  6991. if c.header_ == nil {
  6992. c.header_ = make(http.Header)
  6993. }
  6994. return c.header_
  6995. }
  6996. func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) {
  6997. reqHeaders := make(http.Header)
  6998. for k, v := range c.header_ {
  6999. reqHeaders[k] = v
  7000. }
  7001. reqHeaders.Set("User-Agent", c.s.userAgent())
  7002. if c.ifNoneMatch_ != "" {
  7003. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7004. }
  7005. var body io.Reader = nil
  7006. c.urlParams_.Set("alt", alt)
  7007. c.urlParams_.Set("prettyPrint", "false")
  7008. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7009. urls += "?" + c.urlParams_.Encode()
  7010. req, err := http.NewRequest("GET", urls, body)
  7011. if err != nil {
  7012. return nil, err
  7013. }
  7014. req.Header = reqHeaders
  7015. googleapi.Expand(req.URL, map[string]string{
  7016. "packageName": c.packageNameid,
  7017. "editId": c.editId,
  7018. "track": c.track,
  7019. })
  7020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7021. }
  7022. // Do executes the "androidpublisher.edits.tracks.get" call.
  7023. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7024. // code is an error. Response headers are in either
  7025. // *Track.ServerResponse.Header or (if a response was returned at all)
  7026. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7027. // check whether the returned error was because http.StatusNotModified
  7028. // was returned.
  7029. func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7030. gensupport.SetOptions(c.urlParams_, opts...)
  7031. res, err := c.doRequest("json")
  7032. if res != nil && res.StatusCode == http.StatusNotModified {
  7033. if res.Body != nil {
  7034. res.Body.Close()
  7035. }
  7036. return nil, &googleapi.Error{
  7037. Code: res.StatusCode,
  7038. Header: res.Header,
  7039. }
  7040. }
  7041. if err != nil {
  7042. return nil, err
  7043. }
  7044. defer googleapi.CloseBody(res)
  7045. if err := googleapi.CheckResponse(res); err != nil {
  7046. return nil, err
  7047. }
  7048. ret := &Track{
  7049. ServerResponse: googleapi.ServerResponse{
  7050. Header: res.Header,
  7051. HTTPStatusCode: res.StatusCode,
  7052. },
  7053. }
  7054. target := &ret
  7055. if err := gensupport.DecodeResponse(target, res); err != nil {
  7056. return nil, err
  7057. }
  7058. return ret, nil
  7059. // {
  7060. // "description": "Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track.",
  7061. // "httpMethod": "GET",
  7062. // "id": "androidpublisher.edits.tracks.get",
  7063. // "parameterOrder": [
  7064. // "packageName",
  7065. // "editId",
  7066. // "track"
  7067. // ],
  7068. // "parameters": {
  7069. // "editId": {
  7070. // "description": "Unique identifier for this edit.",
  7071. // "location": "path",
  7072. // "required": true,
  7073. // "type": "string"
  7074. // },
  7075. // "packageName": {
  7076. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7077. // "location": "path",
  7078. // "required": true,
  7079. // "type": "string"
  7080. // },
  7081. // "track": {
  7082. // "description": "The track to read or modify.",
  7083. // "location": "path",
  7084. // "required": true,
  7085. // "type": "string"
  7086. // }
  7087. // },
  7088. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7089. // "response": {
  7090. // "$ref": "Track"
  7091. // },
  7092. // "scopes": [
  7093. // "https://www.googleapis.com/auth/androidpublisher"
  7094. // ]
  7095. // }
  7096. }
  7097. // method id "androidpublisher.edits.tracks.list":
  7098. type EditsTracksListCall struct {
  7099. s *Service
  7100. packageNameid string
  7101. editId string
  7102. urlParams_ gensupport.URLParams
  7103. ifNoneMatch_ string
  7104. ctx_ context.Context
  7105. header_ http.Header
  7106. }
  7107. // List: Lists all the track configurations for this edit.
  7108. func (r *EditsTracksService) List(packageNameid string, editId string) *EditsTracksListCall {
  7109. c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7110. c.packageNameid = packageNameid
  7111. c.editId = editId
  7112. return c
  7113. }
  7114. // Fields allows partial responses to be retrieved. See
  7115. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7116. // for more information.
  7117. func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall {
  7118. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7119. return c
  7120. }
  7121. // IfNoneMatch sets the optional parameter which makes the operation
  7122. // fail if the object's ETag matches the given value. This is useful for
  7123. // getting updates only after the object has changed since the last
  7124. // request. Use googleapi.IsNotModified to check whether the response
  7125. // error from Do is the result of In-None-Match.
  7126. func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall {
  7127. c.ifNoneMatch_ = entityTag
  7128. return c
  7129. }
  7130. // Context sets the context to be used in this call's Do method. Any
  7131. // pending HTTP request will be aborted if the provided context is
  7132. // canceled.
  7133. func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall {
  7134. c.ctx_ = ctx
  7135. return c
  7136. }
  7137. // Header returns an http.Header that can be modified by the caller to
  7138. // add HTTP headers to the request.
  7139. func (c *EditsTracksListCall) Header() http.Header {
  7140. if c.header_ == nil {
  7141. c.header_ = make(http.Header)
  7142. }
  7143. return c.header_
  7144. }
  7145. func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) {
  7146. reqHeaders := make(http.Header)
  7147. for k, v := range c.header_ {
  7148. reqHeaders[k] = v
  7149. }
  7150. reqHeaders.Set("User-Agent", c.s.userAgent())
  7151. if c.ifNoneMatch_ != "" {
  7152. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7153. }
  7154. var body io.Reader = nil
  7155. c.urlParams_.Set("alt", alt)
  7156. c.urlParams_.Set("prettyPrint", "false")
  7157. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks")
  7158. urls += "?" + c.urlParams_.Encode()
  7159. req, err := http.NewRequest("GET", urls, body)
  7160. if err != nil {
  7161. return nil, err
  7162. }
  7163. req.Header = reqHeaders
  7164. googleapi.Expand(req.URL, map[string]string{
  7165. "packageName": c.packageNameid,
  7166. "editId": c.editId,
  7167. })
  7168. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7169. }
  7170. // Do executes the "androidpublisher.edits.tracks.list" call.
  7171. // Exactly one of *TracksListResponse or error will be non-nil. Any
  7172. // non-2xx status code is an error. Response headers are in either
  7173. // *TracksListResponse.ServerResponse.Header or (if a response was
  7174. // returned at all) in error.(*googleapi.Error).Header. Use
  7175. // googleapi.IsNotModified to check whether the returned error was
  7176. // because http.StatusNotModified was returned.
  7177. func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) {
  7178. gensupport.SetOptions(c.urlParams_, opts...)
  7179. res, err := c.doRequest("json")
  7180. if res != nil && res.StatusCode == http.StatusNotModified {
  7181. if res.Body != nil {
  7182. res.Body.Close()
  7183. }
  7184. return nil, &googleapi.Error{
  7185. Code: res.StatusCode,
  7186. Header: res.Header,
  7187. }
  7188. }
  7189. if err != nil {
  7190. return nil, err
  7191. }
  7192. defer googleapi.CloseBody(res)
  7193. if err := googleapi.CheckResponse(res); err != nil {
  7194. return nil, err
  7195. }
  7196. ret := &TracksListResponse{
  7197. ServerResponse: googleapi.ServerResponse{
  7198. Header: res.Header,
  7199. HTTPStatusCode: res.StatusCode,
  7200. },
  7201. }
  7202. target := &ret
  7203. if err := gensupport.DecodeResponse(target, res); err != nil {
  7204. return nil, err
  7205. }
  7206. return ret, nil
  7207. // {
  7208. // "description": "Lists all the track configurations for this edit.",
  7209. // "httpMethod": "GET",
  7210. // "id": "androidpublisher.edits.tracks.list",
  7211. // "parameterOrder": [
  7212. // "packageName",
  7213. // "editId"
  7214. // ],
  7215. // "parameters": {
  7216. // "editId": {
  7217. // "description": "Unique identifier for this edit.",
  7218. // "location": "path",
  7219. // "required": true,
  7220. // "type": "string"
  7221. // },
  7222. // "packageName": {
  7223. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7224. // "location": "path",
  7225. // "required": true,
  7226. // "type": "string"
  7227. // }
  7228. // },
  7229. // "path": "{packageName}/edits/{editId}/tracks",
  7230. // "response": {
  7231. // "$ref": "TracksListResponse"
  7232. // },
  7233. // "scopes": [
  7234. // "https://www.googleapis.com/auth/androidpublisher"
  7235. // ]
  7236. // }
  7237. }
  7238. // method id "androidpublisher.edits.tracks.patch":
  7239. type EditsTracksPatchCall struct {
  7240. s *Service
  7241. packageNameid string
  7242. editId string
  7243. track string
  7244. track2 *Track
  7245. urlParams_ gensupport.URLParams
  7246. ctx_ context.Context
  7247. header_ http.Header
  7248. }
  7249. // Patch: Updates the track configuration for the specified track type.
  7250. // When halted, the rollout track cannot be updated without adding new
  7251. // APKs, and adding new APKs will cause it to resume. This method
  7252. // supports patch semantics.
  7253. func (r *EditsTracksService) Patch(packageNameid string, editId string, track string, track2 *Track) *EditsTracksPatchCall {
  7254. c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7255. c.packageNameid = packageNameid
  7256. c.editId = editId
  7257. c.track = track
  7258. c.track2 = track2
  7259. return c
  7260. }
  7261. // Fields allows partial responses to be retrieved. See
  7262. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7263. // for more information.
  7264. func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall {
  7265. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7266. return c
  7267. }
  7268. // Context sets the context to be used in this call's Do method. Any
  7269. // pending HTTP request will be aborted if the provided context is
  7270. // canceled.
  7271. func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall {
  7272. c.ctx_ = ctx
  7273. return c
  7274. }
  7275. // Header returns an http.Header that can be modified by the caller to
  7276. // add HTTP headers to the request.
  7277. func (c *EditsTracksPatchCall) Header() http.Header {
  7278. if c.header_ == nil {
  7279. c.header_ = make(http.Header)
  7280. }
  7281. return c.header_
  7282. }
  7283. func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) {
  7284. reqHeaders := make(http.Header)
  7285. for k, v := range c.header_ {
  7286. reqHeaders[k] = v
  7287. }
  7288. reqHeaders.Set("User-Agent", c.s.userAgent())
  7289. var body io.Reader = nil
  7290. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  7291. if err != nil {
  7292. return nil, err
  7293. }
  7294. reqHeaders.Set("Content-Type", "application/json")
  7295. c.urlParams_.Set("alt", alt)
  7296. c.urlParams_.Set("prettyPrint", "false")
  7297. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7298. urls += "?" + c.urlParams_.Encode()
  7299. req, err := http.NewRequest("PATCH", urls, body)
  7300. if err != nil {
  7301. return nil, err
  7302. }
  7303. req.Header = reqHeaders
  7304. googleapi.Expand(req.URL, map[string]string{
  7305. "packageName": c.packageNameid,
  7306. "editId": c.editId,
  7307. "track": c.track,
  7308. })
  7309. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7310. }
  7311. // Do executes the "androidpublisher.edits.tracks.patch" call.
  7312. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7313. // code is an error. Response headers are in either
  7314. // *Track.ServerResponse.Header or (if a response was returned at all)
  7315. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7316. // check whether the returned error was because http.StatusNotModified
  7317. // was returned.
  7318. func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7319. gensupport.SetOptions(c.urlParams_, opts...)
  7320. res, err := c.doRequest("json")
  7321. if res != nil && res.StatusCode == http.StatusNotModified {
  7322. if res.Body != nil {
  7323. res.Body.Close()
  7324. }
  7325. return nil, &googleapi.Error{
  7326. Code: res.StatusCode,
  7327. Header: res.Header,
  7328. }
  7329. }
  7330. if err != nil {
  7331. return nil, err
  7332. }
  7333. defer googleapi.CloseBody(res)
  7334. if err := googleapi.CheckResponse(res); err != nil {
  7335. return nil, err
  7336. }
  7337. ret := &Track{
  7338. ServerResponse: googleapi.ServerResponse{
  7339. Header: res.Header,
  7340. HTTPStatusCode: res.StatusCode,
  7341. },
  7342. }
  7343. target := &ret
  7344. if err := gensupport.DecodeResponse(target, res); err != nil {
  7345. return nil, err
  7346. }
  7347. return ret, nil
  7348. // {
  7349. // "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.",
  7350. // "httpMethod": "PATCH",
  7351. // "id": "androidpublisher.edits.tracks.patch",
  7352. // "parameterOrder": [
  7353. // "packageName",
  7354. // "editId",
  7355. // "track"
  7356. // ],
  7357. // "parameters": {
  7358. // "editId": {
  7359. // "description": "Unique identifier for this edit.",
  7360. // "location": "path",
  7361. // "required": true,
  7362. // "type": "string"
  7363. // },
  7364. // "packageName": {
  7365. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7366. // "location": "path",
  7367. // "required": true,
  7368. // "type": "string"
  7369. // },
  7370. // "track": {
  7371. // "description": "The track to read or modify.",
  7372. // "location": "path",
  7373. // "required": true,
  7374. // "type": "string"
  7375. // }
  7376. // },
  7377. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7378. // "request": {
  7379. // "$ref": "Track"
  7380. // },
  7381. // "response": {
  7382. // "$ref": "Track"
  7383. // },
  7384. // "scopes": [
  7385. // "https://www.googleapis.com/auth/androidpublisher"
  7386. // ]
  7387. // }
  7388. }
  7389. // method id "androidpublisher.edits.tracks.update":
  7390. type EditsTracksUpdateCall struct {
  7391. s *Service
  7392. packageNameid string
  7393. editId string
  7394. track string
  7395. track2 *Track
  7396. urlParams_ gensupport.URLParams
  7397. ctx_ context.Context
  7398. header_ http.Header
  7399. }
  7400. // Update: Updates the track configuration for the specified track type.
  7401. // When halted, the rollout track cannot be updated without adding new
  7402. // APKs, and adding new APKs will cause it to resume.
  7403. func (r *EditsTracksService) Update(packageNameid string, editId string, track string, track2 *Track) *EditsTracksUpdateCall {
  7404. c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7405. c.packageNameid = packageNameid
  7406. c.editId = editId
  7407. c.track = track
  7408. c.track2 = track2
  7409. return c
  7410. }
  7411. // Fields allows partial responses to be retrieved. See
  7412. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7413. // for more information.
  7414. func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall {
  7415. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7416. return c
  7417. }
  7418. // Context sets the context to be used in this call's Do method. Any
  7419. // pending HTTP request will be aborted if the provided context is
  7420. // canceled.
  7421. func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall {
  7422. c.ctx_ = ctx
  7423. return c
  7424. }
  7425. // Header returns an http.Header that can be modified by the caller to
  7426. // add HTTP headers to the request.
  7427. func (c *EditsTracksUpdateCall) Header() http.Header {
  7428. if c.header_ == nil {
  7429. c.header_ = make(http.Header)
  7430. }
  7431. return c.header_
  7432. }
  7433. func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) {
  7434. reqHeaders := make(http.Header)
  7435. for k, v := range c.header_ {
  7436. reqHeaders[k] = v
  7437. }
  7438. reqHeaders.Set("User-Agent", c.s.userAgent())
  7439. var body io.Reader = nil
  7440. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  7441. if err != nil {
  7442. return nil, err
  7443. }
  7444. reqHeaders.Set("Content-Type", "application/json")
  7445. c.urlParams_.Set("alt", alt)
  7446. c.urlParams_.Set("prettyPrint", "false")
  7447. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7448. urls += "?" + c.urlParams_.Encode()
  7449. req, err := http.NewRequest("PUT", urls, body)
  7450. if err != nil {
  7451. return nil, err
  7452. }
  7453. req.Header = reqHeaders
  7454. googleapi.Expand(req.URL, map[string]string{
  7455. "packageName": c.packageNameid,
  7456. "editId": c.editId,
  7457. "track": c.track,
  7458. })
  7459. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7460. }
  7461. // Do executes the "androidpublisher.edits.tracks.update" call.
  7462. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7463. // code is an error. Response headers are in either
  7464. // *Track.ServerResponse.Header or (if a response was returned at all)
  7465. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7466. // check whether the returned error was because http.StatusNotModified
  7467. // was returned.
  7468. func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7469. gensupport.SetOptions(c.urlParams_, opts...)
  7470. res, err := c.doRequest("json")
  7471. if res != nil && res.StatusCode == http.StatusNotModified {
  7472. if res.Body != nil {
  7473. res.Body.Close()
  7474. }
  7475. return nil, &googleapi.Error{
  7476. Code: res.StatusCode,
  7477. Header: res.Header,
  7478. }
  7479. }
  7480. if err != nil {
  7481. return nil, err
  7482. }
  7483. defer googleapi.CloseBody(res)
  7484. if err := googleapi.CheckResponse(res); err != nil {
  7485. return nil, err
  7486. }
  7487. ret := &Track{
  7488. ServerResponse: googleapi.ServerResponse{
  7489. Header: res.Header,
  7490. HTTPStatusCode: res.StatusCode,
  7491. },
  7492. }
  7493. target := &ret
  7494. if err := gensupport.DecodeResponse(target, res); err != nil {
  7495. return nil, err
  7496. }
  7497. return ret, nil
  7498. // {
  7499. // "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.",
  7500. // "httpMethod": "PUT",
  7501. // "id": "androidpublisher.edits.tracks.update",
  7502. // "parameterOrder": [
  7503. // "packageName",
  7504. // "editId",
  7505. // "track"
  7506. // ],
  7507. // "parameters": {
  7508. // "editId": {
  7509. // "description": "Unique identifier for this edit.",
  7510. // "location": "path",
  7511. // "required": true,
  7512. // "type": "string"
  7513. // },
  7514. // "packageName": {
  7515. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7516. // "location": "path",
  7517. // "required": true,
  7518. // "type": "string"
  7519. // },
  7520. // "track": {
  7521. // "description": "The track to read or modify.",
  7522. // "location": "path",
  7523. // "required": true,
  7524. // "type": "string"
  7525. // }
  7526. // },
  7527. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7528. // "request": {
  7529. // "$ref": "Track"
  7530. // },
  7531. // "response": {
  7532. // "$ref": "Track"
  7533. // },
  7534. // "scopes": [
  7535. // "https://www.googleapis.com/auth/androidpublisher"
  7536. // ]
  7537. // }
  7538. }
  7539. // method id "androidpublisher.inappproducts.delete":
  7540. type InappproductsDeleteCall struct {
  7541. s *Service
  7542. packageNameid string
  7543. skuid string
  7544. urlParams_ gensupport.URLParams
  7545. ctx_ context.Context
  7546. header_ http.Header
  7547. }
  7548. // Delete: Delete an in-app product for an app.
  7549. func (r *InappproductsService) Delete(packageNameid string, skuid string) *InappproductsDeleteCall {
  7550. c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7551. c.packageNameid = packageNameid
  7552. c.skuid = skuid
  7553. return c
  7554. }
  7555. // Fields allows partial responses to be retrieved. See
  7556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7557. // for more information.
  7558. func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall {
  7559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7560. return c
  7561. }
  7562. // Context sets the context to be used in this call's Do method. Any
  7563. // pending HTTP request will be aborted if the provided context is
  7564. // canceled.
  7565. func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall {
  7566. c.ctx_ = ctx
  7567. return c
  7568. }
  7569. // Header returns an http.Header that can be modified by the caller to
  7570. // add HTTP headers to the request.
  7571. func (c *InappproductsDeleteCall) Header() http.Header {
  7572. if c.header_ == nil {
  7573. c.header_ = make(http.Header)
  7574. }
  7575. return c.header_
  7576. }
  7577. func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7578. reqHeaders := make(http.Header)
  7579. for k, v := range c.header_ {
  7580. reqHeaders[k] = v
  7581. }
  7582. reqHeaders.Set("User-Agent", c.s.userAgent())
  7583. var body io.Reader = nil
  7584. c.urlParams_.Set("alt", alt)
  7585. c.urlParams_.Set("prettyPrint", "false")
  7586. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  7587. urls += "?" + c.urlParams_.Encode()
  7588. req, err := http.NewRequest("DELETE", urls, body)
  7589. if err != nil {
  7590. return nil, err
  7591. }
  7592. req.Header = reqHeaders
  7593. googleapi.Expand(req.URL, map[string]string{
  7594. "packageName": c.packageNameid,
  7595. "sku": c.skuid,
  7596. })
  7597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7598. }
  7599. // Do executes the "androidpublisher.inappproducts.delete" call.
  7600. func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7601. gensupport.SetOptions(c.urlParams_, opts...)
  7602. res, err := c.doRequest("json")
  7603. if err != nil {
  7604. return err
  7605. }
  7606. defer googleapi.CloseBody(res)
  7607. if err := googleapi.CheckResponse(res); err != nil {
  7608. return err
  7609. }
  7610. return nil
  7611. // {
  7612. // "description": "Delete an in-app product for an app.",
  7613. // "httpMethod": "DELETE",
  7614. // "id": "androidpublisher.inappproducts.delete",
  7615. // "parameterOrder": [
  7616. // "packageName",
  7617. // "sku"
  7618. // ],
  7619. // "parameters": {
  7620. // "packageName": {
  7621. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  7622. // "location": "path",
  7623. // "required": true,
  7624. // "type": "string"
  7625. // },
  7626. // "sku": {
  7627. // "description": "Unique identifier for the in-app product.",
  7628. // "location": "path",
  7629. // "required": true,
  7630. // "type": "string"
  7631. // }
  7632. // },
  7633. // "path": "{packageName}/inappproducts/{sku}",
  7634. // "scopes": [
  7635. // "https://www.googleapis.com/auth/androidpublisher"
  7636. // ]
  7637. // }
  7638. }
  7639. // method id "androidpublisher.inappproducts.get":
  7640. type InappproductsGetCall struct {
  7641. s *Service
  7642. packageName string
  7643. skuid string
  7644. urlParams_ gensupport.URLParams
  7645. ifNoneMatch_ string
  7646. ctx_ context.Context
  7647. header_ http.Header
  7648. }
  7649. // Get: Returns information about the in-app product specified.
  7650. func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall {
  7651. c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7652. c.packageName = packageName
  7653. c.skuid = skuid
  7654. return c
  7655. }
  7656. // Fields allows partial responses to be retrieved. See
  7657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7658. // for more information.
  7659. func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall {
  7660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7661. return c
  7662. }
  7663. // IfNoneMatch sets the optional parameter which makes the operation
  7664. // fail if the object's ETag matches the given value. This is useful for
  7665. // getting updates only after the object has changed since the last
  7666. // request. Use googleapi.IsNotModified to check whether the response
  7667. // error from Do is the result of In-None-Match.
  7668. func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall {
  7669. c.ifNoneMatch_ = entityTag
  7670. return c
  7671. }
  7672. // Context sets the context to be used in this call's Do method. Any
  7673. // pending HTTP request will be aborted if the provided context is
  7674. // canceled.
  7675. func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall {
  7676. c.ctx_ = ctx
  7677. return c
  7678. }
  7679. // Header returns an http.Header that can be modified by the caller to
  7680. // add HTTP headers to the request.
  7681. func (c *InappproductsGetCall) Header() http.Header {
  7682. if c.header_ == nil {
  7683. c.header_ = make(http.Header)
  7684. }
  7685. return c.header_
  7686. }
  7687. func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) {
  7688. reqHeaders := make(http.Header)
  7689. for k, v := range c.header_ {
  7690. reqHeaders[k] = v
  7691. }
  7692. reqHeaders.Set("User-Agent", c.s.userAgent())
  7693. if c.ifNoneMatch_ != "" {
  7694. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7695. }
  7696. var body io.Reader = nil
  7697. c.urlParams_.Set("alt", alt)
  7698. c.urlParams_.Set("prettyPrint", "false")
  7699. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  7700. urls += "?" + c.urlParams_.Encode()
  7701. req, err := http.NewRequest("GET", urls, body)
  7702. if err != nil {
  7703. return nil, err
  7704. }
  7705. req.Header = reqHeaders
  7706. googleapi.Expand(req.URL, map[string]string{
  7707. "packageName": c.packageName,
  7708. "sku": c.skuid,
  7709. })
  7710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7711. }
  7712. // Do executes the "androidpublisher.inappproducts.get" call.
  7713. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  7714. // status code is an error. Response headers are in either
  7715. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  7716. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7717. // to check whether the returned error was because
  7718. // http.StatusNotModified was returned.
  7719. func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  7720. gensupport.SetOptions(c.urlParams_, opts...)
  7721. res, err := c.doRequest("json")
  7722. if res != nil && res.StatusCode == http.StatusNotModified {
  7723. if res.Body != nil {
  7724. res.Body.Close()
  7725. }
  7726. return nil, &googleapi.Error{
  7727. Code: res.StatusCode,
  7728. Header: res.Header,
  7729. }
  7730. }
  7731. if err != nil {
  7732. return nil, err
  7733. }
  7734. defer googleapi.CloseBody(res)
  7735. if err := googleapi.CheckResponse(res); err != nil {
  7736. return nil, err
  7737. }
  7738. ret := &InAppProduct{
  7739. ServerResponse: googleapi.ServerResponse{
  7740. Header: res.Header,
  7741. HTTPStatusCode: res.StatusCode,
  7742. },
  7743. }
  7744. target := &ret
  7745. if err := gensupport.DecodeResponse(target, res); err != nil {
  7746. return nil, err
  7747. }
  7748. return ret, nil
  7749. // {
  7750. // "description": "Returns information about the in-app product specified.",
  7751. // "httpMethod": "GET",
  7752. // "id": "androidpublisher.inappproducts.get",
  7753. // "parameterOrder": [
  7754. // "packageName",
  7755. // "sku"
  7756. // ],
  7757. // "parameters": {
  7758. // "packageName": {
  7759. // "location": "path",
  7760. // "required": true,
  7761. // "type": "string"
  7762. // },
  7763. // "sku": {
  7764. // "description": "Unique identifier for the in-app product.",
  7765. // "location": "path",
  7766. // "required": true,
  7767. // "type": "string"
  7768. // }
  7769. // },
  7770. // "path": "{packageName}/inappproducts/{sku}",
  7771. // "response": {
  7772. // "$ref": "InAppProduct"
  7773. // },
  7774. // "scopes": [
  7775. // "https://www.googleapis.com/auth/androidpublisher"
  7776. // ]
  7777. // }
  7778. }
  7779. // method id "androidpublisher.inappproducts.insert":
  7780. type InappproductsInsertCall struct {
  7781. s *Service
  7782. packageNameid string
  7783. inappproduct *InAppProduct
  7784. urlParams_ gensupport.URLParams
  7785. ctx_ context.Context
  7786. header_ http.Header
  7787. }
  7788. // Insert: Creates a new in-app product for an app.
  7789. func (r *InappproductsService) Insert(packageNameid string, inappproduct *InAppProduct) *InappproductsInsertCall {
  7790. c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7791. c.packageNameid = packageNameid
  7792. c.inappproduct = inappproduct
  7793. return c
  7794. }
  7795. // AutoConvertMissingPrices sets the optional parameter
  7796. // "autoConvertMissingPrices": If true the prices for all regions
  7797. // targeted by the parent app that don't have a price specified for this
  7798. // in-app product will be auto converted to the target currency based on
  7799. // the default price. Defaults to false.
  7800. func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall {
  7801. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  7802. return c
  7803. }
  7804. // Fields allows partial responses to be retrieved. See
  7805. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7806. // for more information.
  7807. func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall {
  7808. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7809. return c
  7810. }
  7811. // Context sets the context to be used in this call's Do method. Any
  7812. // pending HTTP request will be aborted if the provided context is
  7813. // canceled.
  7814. func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall {
  7815. c.ctx_ = ctx
  7816. return c
  7817. }
  7818. // Header returns an http.Header that can be modified by the caller to
  7819. // add HTTP headers to the request.
  7820. func (c *InappproductsInsertCall) Header() http.Header {
  7821. if c.header_ == nil {
  7822. c.header_ = make(http.Header)
  7823. }
  7824. return c.header_
  7825. }
  7826. func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) {
  7827. reqHeaders := make(http.Header)
  7828. for k, v := range c.header_ {
  7829. reqHeaders[k] = v
  7830. }
  7831. reqHeaders.Set("User-Agent", c.s.userAgent())
  7832. var body io.Reader = nil
  7833. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  7834. if err != nil {
  7835. return nil, err
  7836. }
  7837. reqHeaders.Set("Content-Type", "application/json")
  7838. c.urlParams_.Set("alt", alt)
  7839. c.urlParams_.Set("prettyPrint", "false")
  7840. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  7841. urls += "?" + c.urlParams_.Encode()
  7842. req, err := http.NewRequest("POST", urls, body)
  7843. if err != nil {
  7844. return nil, err
  7845. }
  7846. req.Header = reqHeaders
  7847. googleapi.Expand(req.URL, map[string]string{
  7848. "packageName": c.packageNameid,
  7849. })
  7850. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7851. }
  7852. // Do executes the "androidpublisher.inappproducts.insert" call.
  7853. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  7854. // status code is an error. Response headers are in either
  7855. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  7856. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7857. // to check whether the returned error was because
  7858. // http.StatusNotModified was returned.
  7859. func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  7860. gensupport.SetOptions(c.urlParams_, opts...)
  7861. res, err := c.doRequest("json")
  7862. if res != nil && res.StatusCode == http.StatusNotModified {
  7863. if res.Body != nil {
  7864. res.Body.Close()
  7865. }
  7866. return nil, &googleapi.Error{
  7867. Code: res.StatusCode,
  7868. Header: res.Header,
  7869. }
  7870. }
  7871. if err != nil {
  7872. return nil, err
  7873. }
  7874. defer googleapi.CloseBody(res)
  7875. if err := googleapi.CheckResponse(res); err != nil {
  7876. return nil, err
  7877. }
  7878. ret := &InAppProduct{
  7879. ServerResponse: googleapi.ServerResponse{
  7880. Header: res.Header,
  7881. HTTPStatusCode: res.StatusCode,
  7882. },
  7883. }
  7884. target := &ret
  7885. if err := gensupport.DecodeResponse(target, res); err != nil {
  7886. return nil, err
  7887. }
  7888. return ret, nil
  7889. // {
  7890. // "description": "Creates a new in-app product for an app.",
  7891. // "httpMethod": "POST",
  7892. // "id": "androidpublisher.inappproducts.insert",
  7893. // "parameterOrder": [
  7894. // "packageName"
  7895. // ],
  7896. // "parameters": {
  7897. // "autoConvertMissingPrices": {
  7898. // "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.",
  7899. // "location": "query",
  7900. // "type": "boolean"
  7901. // },
  7902. // "packageName": {
  7903. // "description": "Unique identifier for the Android app; for example, \"com.spiffygame\".",
  7904. // "location": "path",
  7905. // "required": true,
  7906. // "type": "string"
  7907. // }
  7908. // },
  7909. // "path": "{packageName}/inappproducts",
  7910. // "request": {
  7911. // "$ref": "InAppProduct"
  7912. // },
  7913. // "response": {
  7914. // "$ref": "InAppProduct"
  7915. // },
  7916. // "scopes": [
  7917. // "https://www.googleapis.com/auth/androidpublisher"
  7918. // ]
  7919. // }
  7920. }
  7921. // method id "androidpublisher.inappproducts.list":
  7922. type InappproductsListCall struct {
  7923. s *Service
  7924. packageNameid string
  7925. urlParams_ gensupport.URLParams
  7926. ifNoneMatch_ string
  7927. ctx_ context.Context
  7928. header_ http.Header
  7929. }
  7930. // List: List all the in-app products for an Android app, both
  7931. // subscriptions and managed in-app products..
  7932. func (r *InappproductsService) List(packageNameid string) *InappproductsListCall {
  7933. c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7934. c.packageNameid = packageNameid
  7935. return c
  7936. }
  7937. // MaxResults sets the optional parameter "maxResults":
  7938. func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall {
  7939. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7940. return c
  7941. }
  7942. // StartIndex sets the optional parameter "startIndex":
  7943. func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall {
  7944. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  7945. return c
  7946. }
  7947. // Token sets the optional parameter "token":
  7948. func (c *InappproductsListCall) Token(token string) *InappproductsListCall {
  7949. c.urlParams_.Set("token", token)
  7950. return c
  7951. }
  7952. // Fields allows partial responses to be retrieved. See
  7953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7954. // for more information.
  7955. func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall {
  7956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7957. return c
  7958. }
  7959. // IfNoneMatch sets the optional parameter which makes the operation
  7960. // fail if the object's ETag matches the given value. This is useful for
  7961. // getting updates only after the object has changed since the last
  7962. // request. Use googleapi.IsNotModified to check whether the response
  7963. // error from Do is the result of In-None-Match.
  7964. func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall {
  7965. c.ifNoneMatch_ = entityTag
  7966. return c
  7967. }
  7968. // Context sets the context to be used in this call's Do method. Any
  7969. // pending HTTP request will be aborted if the provided context is
  7970. // canceled.
  7971. func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall {
  7972. c.ctx_ = ctx
  7973. return c
  7974. }
  7975. // Header returns an http.Header that can be modified by the caller to
  7976. // add HTTP headers to the request.
  7977. func (c *InappproductsListCall) Header() http.Header {
  7978. if c.header_ == nil {
  7979. c.header_ = make(http.Header)
  7980. }
  7981. return c.header_
  7982. }
  7983. func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) {
  7984. reqHeaders := make(http.Header)
  7985. for k, v := range c.header_ {
  7986. reqHeaders[k] = v
  7987. }
  7988. reqHeaders.Set("User-Agent", c.s.userAgent())
  7989. if c.ifNoneMatch_ != "" {
  7990. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7991. }
  7992. var body io.Reader = nil
  7993. c.urlParams_.Set("alt", alt)
  7994. c.urlParams_.Set("prettyPrint", "false")
  7995. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  7996. urls += "?" + c.urlParams_.Encode()
  7997. req, err := http.NewRequest("GET", urls, body)
  7998. if err != nil {
  7999. return nil, err
  8000. }
  8001. req.Header = reqHeaders
  8002. googleapi.Expand(req.URL, map[string]string{
  8003. "packageName": c.packageNameid,
  8004. })
  8005. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8006. }
  8007. // Do executes the "androidpublisher.inappproducts.list" call.
  8008. // Exactly one of *InappproductsListResponse or error will be non-nil.
  8009. // Any non-2xx status code is an error. Response headers are in either
  8010. // *InappproductsListResponse.ServerResponse.Header or (if a response
  8011. // was returned at all) in error.(*googleapi.Error).Header. Use
  8012. // googleapi.IsNotModified to check whether the returned error was
  8013. // because http.StatusNotModified was returned.
  8014. func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) {
  8015. gensupport.SetOptions(c.urlParams_, opts...)
  8016. res, err := c.doRequest("json")
  8017. if res != nil && res.StatusCode == http.StatusNotModified {
  8018. if res.Body != nil {
  8019. res.Body.Close()
  8020. }
  8021. return nil, &googleapi.Error{
  8022. Code: res.StatusCode,
  8023. Header: res.Header,
  8024. }
  8025. }
  8026. if err != nil {
  8027. return nil, err
  8028. }
  8029. defer googleapi.CloseBody(res)
  8030. if err := googleapi.CheckResponse(res); err != nil {
  8031. return nil, err
  8032. }
  8033. ret := &InappproductsListResponse{
  8034. ServerResponse: googleapi.ServerResponse{
  8035. Header: res.Header,
  8036. HTTPStatusCode: res.StatusCode,
  8037. },
  8038. }
  8039. target := &ret
  8040. if err := gensupport.DecodeResponse(target, res); err != nil {
  8041. return nil, err
  8042. }
  8043. return ret, nil
  8044. // {
  8045. // "description": "List all the in-app products for an Android app, both subscriptions and managed in-app products..",
  8046. // "httpMethod": "GET",
  8047. // "id": "androidpublisher.inappproducts.list",
  8048. // "parameterOrder": [
  8049. // "packageName"
  8050. // ],
  8051. // "parameters": {
  8052. // "maxResults": {
  8053. // "format": "uint32",
  8054. // "location": "query",
  8055. // "type": "integer"
  8056. // },
  8057. // "packageName": {
  8058. // "description": "Unique identifier for the Android app with in-app products; for example, \"com.spiffygame\".",
  8059. // "location": "path",
  8060. // "required": true,
  8061. // "type": "string"
  8062. // },
  8063. // "startIndex": {
  8064. // "format": "uint32",
  8065. // "location": "query",
  8066. // "type": "integer"
  8067. // },
  8068. // "token": {
  8069. // "location": "query",
  8070. // "type": "string"
  8071. // }
  8072. // },
  8073. // "path": "{packageName}/inappproducts",
  8074. // "response": {
  8075. // "$ref": "InappproductsListResponse"
  8076. // },
  8077. // "scopes": [
  8078. // "https://www.googleapis.com/auth/androidpublisher"
  8079. // ]
  8080. // }
  8081. }
  8082. // method id "androidpublisher.inappproducts.patch":
  8083. type InappproductsPatchCall struct {
  8084. s *Service
  8085. packageNameid string
  8086. skuid string
  8087. inappproduct *InAppProduct
  8088. urlParams_ gensupport.URLParams
  8089. ctx_ context.Context
  8090. header_ http.Header
  8091. }
  8092. // Patch: Updates the details of an in-app product. This method supports
  8093. // patch semantics.
  8094. func (r *InappproductsService) Patch(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall {
  8095. c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8096. c.packageNameid = packageNameid
  8097. c.skuid = skuid
  8098. c.inappproduct = inappproduct
  8099. return c
  8100. }
  8101. // AutoConvertMissingPrices sets the optional parameter
  8102. // "autoConvertMissingPrices": If true the prices for all regions
  8103. // targeted by the parent app that don't have a price specified for this
  8104. // in-app product will be auto converted to the target currency based on
  8105. // the default price. Defaults to false.
  8106. func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall {
  8107. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8108. return c
  8109. }
  8110. // Fields allows partial responses to be retrieved. See
  8111. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8112. // for more information.
  8113. func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall {
  8114. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8115. return c
  8116. }
  8117. // Context sets the context to be used in this call's Do method. Any
  8118. // pending HTTP request will be aborted if the provided context is
  8119. // canceled.
  8120. func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall {
  8121. c.ctx_ = ctx
  8122. return c
  8123. }
  8124. // Header returns an http.Header that can be modified by the caller to
  8125. // add HTTP headers to the request.
  8126. func (c *InappproductsPatchCall) Header() http.Header {
  8127. if c.header_ == nil {
  8128. c.header_ = make(http.Header)
  8129. }
  8130. return c.header_
  8131. }
  8132. func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) {
  8133. reqHeaders := make(http.Header)
  8134. for k, v := range c.header_ {
  8135. reqHeaders[k] = v
  8136. }
  8137. reqHeaders.Set("User-Agent", c.s.userAgent())
  8138. var body io.Reader = nil
  8139. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8140. if err != nil {
  8141. return nil, err
  8142. }
  8143. reqHeaders.Set("Content-Type", "application/json")
  8144. c.urlParams_.Set("alt", alt)
  8145. c.urlParams_.Set("prettyPrint", "false")
  8146. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8147. urls += "?" + c.urlParams_.Encode()
  8148. req, err := http.NewRequest("PATCH", urls, body)
  8149. if err != nil {
  8150. return nil, err
  8151. }
  8152. req.Header = reqHeaders
  8153. googleapi.Expand(req.URL, map[string]string{
  8154. "packageName": c.packageNameid,
  8155. "sku": c.skuid,
  8156. })
  8157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8158. }
  8159. // Do executes the "androidpublisher.inappproducts.patch" call.
  8160. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8161. // status code is an error. Response headers are in either
  8162. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8163. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8164. // to check whether the returned error was because
  8165. // http.StatusNotModified was returned.
  8166. func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8167. gensupport.SetOptions(c.urlParams_, opts...)
  8168. res, err := c.doRequest("json")
  8169. if res != nil && res.StatusCode == http.StatusNotModified {
  8170. if res.Body != nil {
  8171. res.Body.Close()
  8172. }
  8173. return nil, &googleapi.Error{
  8174. Code: res.StatusCode,
  8175. Header: res.Header,
  8176. }
  8177. }
  8178. if err != nil {
  8179. return nil, err
  8180. }
  8181. defer googleapi.CloseBody(res)
  8182. if err := googleapi.CheckResponse(res); err != nil {
  8183. return nil, err
  8184. }
  8185. ret := &InAppProduct{
  8186. ServerResponse: googleapi.ServerResponse{
  8187. Header: res.Header,
  8188. HTTPStatusCode: res.StatusCode,
  8189. },
  8190. }
  8191. target := &ret
  8192. if err := gensupport.DecodeResponse(target, res); err != nil {
  8193. return nil, err
  8194. }
  8195. return ret, nil
  8196. // {
  8197. // "description": "Updates the details of an in-app product. This method supports patch semantics.",
  8198. // "httpMethod": "PATCH",
  8199. // "id": "androidpublisher.inappproducts.patch",
  8200. // "parameterOrder": [
  8201. // "packageName",
  8202. // "sku"
  8203. // ],
  8204. // "parameters": {
  8205. // "autoConvertMissingPrices": {
  8206. // "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.",
  8207. // "location": "query",
  8208. // "type": "boolean"
  8209. // },
  8210. // "packageName": {
  8211. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  8212. // "location": "path",
  8213. // "required": true,
  8214. // "type": "string"
  8215. // },
  8216. // "sku": {
  8217. // "description": "Unique identifier for the in-app product.",
  8218. // "location": "path",
  8219. // "required": true,
  8220. // "type": "string"
  8221. // }
  8222. // },
  8223. // "path": "{packageName}/inappproducts/{sku}",
  8224. // "request": {
  8225. // "$ref": "InAppProduct"
  8226. // },
  8227. // "response": {
  8228. // "$ref": "InAppProduct"
  8229. // },
  8230. // "scopes": [
  8231. // "https://www.googleapis.com/auth/androidpublisher"
  8232. // ]
  8233. // }
  8234. }
  8235. // method id "androidpublisher.inappproducts.update":
  8236. type InappproductsUpdateCall struct {
  8237. s *Service
  8238. packageNameid string
  8239. skuid string
  8240. inappproduct *InAppProduct
  8241. urlParams_ gensupport.URLParams
  8242. ctx_ context.Context
  8243. header_ http.Header
  8244. }
  8245. // Update: Updates the details of an in-app product.
  8246. func (r *InappproductsService) Update(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall {
  8247. c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8248. c.packageNameid = packageNameid
  8249. c.skuid = skuid
  8250. c.inappproduct = inappproduct
  8251. return c
  8252. }
  8253. // AutoConvertMissingPrices sets the optional parameter
  8254. // "autoConvertMissingPrices": If true the prices for all regions
  8255. // targeted by the parent app that don't have a price specified for this
  8256. // in-app product will be auto converted to the target currency based on
  8257. // the default price. Defaults to false.
  8258. func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall {
  8259. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8260. return c
  8261. }
  8262. // Fields allows partial responses to be retrieved. See
  8263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8264. // for more information.
  8265. func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall {
  8266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8267. return c
  8268. }
  8269. // Context sets the context to be used in this call's Do method. Any
  8270. // pending HTTP request will be aborted if the provided context is
  8271. // canceled.
  8272. func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall {
  8273. c.ctx_ = ctx
  8274. return c
  8275. }
  8276. // Header returns an http.Header that can be modified by the caller to
  8277. // add HTTP headers to the request.
  8278. func (c *InappproductsUpdateCall) Header() http.Header {
  8279. if c.header_ == nil {
  8280. c.header_ = make(http.Header)
  8281. }
  8282. return c.header_
  8283. }
  8284. func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8285. reqHeaders := make(http.Header)
  8286. for k, v := range c.header_ {
  8287. reqHeaders[k] = v
  8288. }
  8289. reqHeaders.Set("User-Agent", c.s.userAgent())
  8290. var body io.Reader = nil
  8291. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8292. if err != nil {
  8293. return nil, err
  8294. }
  8295. reqHeaders.Set("Content-Type", "application/json")
  8296. c.urlParams_.Set("alt", alt)
  8297. c.urlParams_.Set("prettyPrint", "false")
  8298. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8299. urls += "?" + c.urlParams_.Encode()
  8300. req, err := http.NewRequest("PUT", urls, body)
  8301. if err != nil {
  8302. return nil, err
  8303. }
  8304. req.Header = reqHeaders
  8305. googleapi.Expand(req.URL, map[string]string{
  8306. "packageName": c.packageNameid,
  8307. "sku": c.skuid,
  8308. })
  8309. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8310. }
  8311. // Do executes the "androidpublisher.inappproducts.update" call.
  8312. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8313. // status code is an error. Response headers are in either
  8314. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8315. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8316. // to check whether the returned error was because
  8317. // http.StatusNotModified was returned.
  8318. func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8319. gensupport.SetOptions(c.urlParams_, opts...)
  8320. res, err := c.doRequest("json")
  8321. if res != nil && res.StatusCode == http.StatusNotModified {
  8322. if res.Body != nil {
  8323. res.Body.Close()
  8324. }
  8325. return nil, &googleapi.Error{
  8326. Code: res.StatusCode,
  8327. Header: res.Header,
  8328. }
  8329. }
  8330. if err != nil {
  8331. return nil, err
  8332. }
  8333. defer googleapi.CloseBody(res)
  8334. if err := googleapi.CheckResponse(res); err != nil {
  8335. return nil, err
  8336. }
  8337. ret := &InAppProduct{
  8338. ServerResponse: googleapi.ServerResponse{
  8339. Header: res.Header,
  8340. HTTPStatusCode: res.StatusCode,
  8341. },
  8342. }
  8343. target := &ret
  8344. if err := gensupport.DecodeResponse(target, res); err != nil {
  8345. return nil, err
  8346. }
  8347. return ret, nil
  8348. // {
  8349. // "description": "Updates the details of an in-app product.",
  8350. // "httpMethod": "PUT",
  8351. // "id": "androidpublisher.inappproducts.update",
  8352. // "parameterOrder": [
  8353. // "packageName",
  8354. // "sku"
  8355. // ],
  8356. // "parameters": {
  8357. // "autoConvertMissingPrices": {
  8358. // "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.",
  8359. // "location": "query",
  8360. // "type": "boolean"
  8361. // },
  8362. // "packageName": {
  8363. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  8364. // "location": "path",
  8365. // "required": true,
  8366. // "type": "string"
  8367. // },
  8368. // "sku": {
  8369. // "description": "Unique identifier for the in-app product.",
  8370. // "location": "path",
  8371. // "required": true,
  8372. // "type": "string"
  8373. // }
  8374. // },
  8375. // "path": "{packageName}/inappproducts/{sku}",
  8376. // "request": {
  8377. // "$ref": "InAppProduct"
  8378. // },
  8379. // "response": {
  8380. // "$ref": "InAppProduct"
  8381. // },
  8382. // "scopes": [
  8383. // "https://www.googleapis.com/auth/androidpublisher"
  8384. // ]
  8385. // }
  8386. }
  8387. // method id "androidpublisher.orders.refund":
  8388. type OrdersRefundCall struct {
  8389. s *Service
  8390. packageName string
  8391. orderId string
  8392. urlParams_ gensupport.URLParams
  8393. ctx_ context.Context
  8394. header_ http.Header
  8395. }
  8396. // Refund: Refund a user's subscription or in-app purchase order.
  8397. func (r *OrdersService) Refund(packageName string, orderId string) *OrdersRefundCall {
  8398. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8399. c.packageName = packageName
  8400. c.orderId = orderId
  8401. return c
  8402. }
  8403. // Revoke sets the optional parameter "revoke": Whether to revoke the
  8404. // purchased item. If set to true, access to the subscription or in-app
  8405. // item will be terminated immediately. If the item is a recurring
  8406. // subscription, all future payments will also be terminated. Consumed
  8407. // in-app items need to be handled by developer's app. (optional)
  8408. func (c *OrdersRefundCall) Revoke(revoke bool) *OrdersRefundCall {
  8409. c.urlParams_.Set("revoke", fmt.Sprint(revoke))
  8410. return c
  8411. }
  8412. // Fields allows partial responses to be retrieved. See
  8413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8414. // for more information.
  8415. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  8416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8417. return c
  8418. }
  8419. // Context sets the context to be used in this call's Do method. Any
  8420. // pending HTTP request will be aborted if the provided context is
  8421. // canceled.
  8422. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  8423. c.ctx_ = ctx
  8424. return c
  8425. }
  8426. // Header returns an http.Header that can be modified by the caller to
  8427. // add HTTP headers to the request.
  8428. func (c *OrdersRefundCall) Header() http.Header {
  8429. if c.header_ == nil {
  8430. c.header_ = make(http.Header)
  8431. }
  8432. return c.header_
  8433. }
  8434. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  8435. reqHeaders := make(http.Header)
  8436. for k, v := range c.header_ {
  8437. reqHeaders[k] = v
  8438. }
  8439. reqHeaders.Set("User-Agent", c.s.userAgent())
  8440. var body io.Reader = nil
  8441. c.urlParams_.Set("alt", alt)
  8442. c.urlParams_.Set("prettyPrint", "false")
  8443. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/orders/{orderId}:refund")
  8444. urls += "?" + c.urlParams_.Encode()
  8445. req, err := http.NewRequest("POST", urls, body)
  8446. if err != nil {
  8447. return nil, err
  8448. }
  8449. req.Header = reqHeaders
  8450. googleapi.Expand(req.URL, map[string]string{
  8451. "packageName": c.packageName,
  8452. "orderId": c.orderId,
  8453. })
  8454. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8455. }
  8456. // Do executes the "androidpublisher.orders.refund" call.
  8457. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) error {
  8458. gensupport.SetOptions(c.urlParams_, opts...)
  8459. res, err := c.doRequest("json")
  8460. if err != nil {
  8461. return err
  8462. }
  8463. defer googleapi.CloseBody(res)
  8464. if err := googleapi.CheckResponse(res); err != nil {
  8465. return err
  8466. }
  8467. return nil
  8468. // {
  8469. // "description": "Refund a user's subscription or in-app purchase order.",
  8470. // "httpMethod": "POST",
  8471. // "id": "androidpublisher.orders.refund",
  8472. // "parameterOrder": [
  8473. // "packageName",
  8474. // "orderId"
  8475. // ],
  8476. // "parameters": {
  8477. // "orderId": {
  8478. // "description": "The order ID provided to the user when the subscription or in-app order was purchased.",
  8479. // "location": "path",
  8480. // "required": true,
  8481. // "type": "string"
  8482. // },
  8483. // "packageName": {
  8484. // "description": "The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing').",
  8485. // "location": "path",
  8486. // "required": true,
  8487. // "type": "string"
  8488. // },
  8489. // "revoke": {
  8490. // "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)",
  8491. // "location": "query",
  8492. // "type": "boolean"
  8493. // }
  8494. // },
  8495. // "path": "{packageName}/orders/{orderId}:refund",
  8496. // "scopes": [
  8497. // "https://www.googleapis.com/auth/androidpublisher"
  8498. // ]
  8499. // }
  8500. }
  8501. // method id "androidpublisher.purchases.products.get":
  8502. type PurchasesProductsGetCall struct {
  8503. s *Service
  8504. packageName string
  8505. productId string
  8506. token string
  8507. urlParams_ gensupport.URLParams
  8508. ifNoneMatch_ string
  8509. ctx_ context.Context
  8510. header_ http.Header
  8511. }
  8512. // Get: Checks the purchase and consumption status of an inapp item.
  8513. func (r *PurchasesProductsService) Get(packageName string, productId string, token string) *PurchasesProductsGetCall {
  8514. c := &PurchasesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8515. c.packageName = packageName
  8516. c.productId = productId
  8517. c.token = token
  8518. return c
  8519. }
  8520. // Fields allows partial responses to be retrieved. See
  8521. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8522. // for more information.
  8523. func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall {
  8524. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8525. return c
  8526. }
  8527. // IfNoneMatch sets the optional parameter which makes the operation
  8528. // fail if the object's ETag matches the given value. This is useful for
  8529. // getting updates only after the object has changed since the last
  8530. // request. Use googleapi.IsNotModified to check whether the response
  8531. // error from Do is the result of In-None-Match.
  8532. func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall {
  8533. c.ifNoneMatch_ = entityTag
  8534. return c
  8535. }
  8536. // Context sets the context to be used in this call's Do method. Any
  8537. // pending HTTP request will be aborted if the provided context is
  8538. // canceled.
  8539. func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall {
  8540. c.ctx_ = ctx
  8541. return c
  8542. }
  8543. // Header returns an http.Header that can be modified by the caller to
  8544. // add HTTP headers to the request.
  8545. func (c *PurchasesProductsGetCall) Header() http.Header {
  8546. if c.header_ == nil {
  8547. c.header_ = make(http.Header)
  8548. }
  8549. return c.header_
  8550. }
  8551. func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) {
  8552. reqHeaders := make(http.Header)
  8553. for k, v := range c.header_ {
  8554. reqHeaders[k] = v
  8555. }
  8556. reqHeaders.Set("User-Agent", c.s.userAgent())
  8557. if c.ifNoneMatch_ != "" {
  8558. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8559. }
  8560. var body io.Reader = nil
  8561. c.urlParams_.Set("alt", alt)
  8562. c.urlParams_.Set("prettyPrint", "false")
  8563. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/products/{productId}/tokens/{token}")
  8564. urls += "?" + c.urlParams_.Encode()
  8565. req, err := http.NewRequest("GET", urls, body)
  8566. if err != nil {
  8567. return nil, err
  8568. }
  8569. req.Header = reqHeaders
  8570. googleapi.Expand(req.URL, map[string]string{
  8571. "packageName": c.packageName,
  8572. "productId": c.productId,
  8573. "token": c.token,
  8574. })
  8575. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8576. }
  8577. // Do executes the "androidpublisher.purchases.products.get" call.
  8578. // Exactly one of *ProductPurchase or error will be non-nil. Any non-2xx
  8579. // status code is an error. Response headers are in either
  8580. // *ProductPurchase.ServerResponse.Header or (if a response was returned
  8581. // at all) in error.(*googleapi.Error).Header. Use
  8582. // googleapi.IsNotModified to check whether the returned error was
  8583. // because http.StatusNotModified was returned.
  8584. func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase, error) {
  8585. gensupport.SetOptions(c.urlParams_, opts...)
  8586. res, err := c.doRequest("json")
  8587. if res != nil && res.StatusCode == http.StatusNotModified {
  8588. if res.Body != nil {
  8589. res.Body.Close()
  8590. }
  8591. return nil, &googleapi.Error{
  8592. Code: res.StatusCode,
  8593. Header: res.Header,
  8594. }
  8595. }
  8596. if err != nil {
  8597. return nil, err
  8598. }
  8599. defer googleapi.CloseBody(res)
  8600. if err := googleapi.CheckResponse(res); err != nil {
  8601. return nil, err
  8602. }
  8603. ret := &ProductPurchase{
  8604. ServerResponse: googleapi.ServerResponse{
  8605. Header: res.Header,
  8606. HTTPStatusCode: res.StatusCode,
  8607. },
  8608. }
  8609. target := &ret
  8610. if err := gensupport.DecodeResponse(target, res); err != nil {
  8611. return nil, err
  8612. }
  8613. return ret, nil
  8614. // {
  8615. // "description": "Checks the purchase and consumption status of an inapp item.",
  8616. // "httpMethod": "GET",
  8617. // "id": "androidpublisher.purchases.products.get",
  8618. // "parameterOrder": [
  8619. // "packageName",
  8620. // "productId",
  8621. // "token"
  8622. // ],
  8623. // "parameters": {
  8624. // "packageName": {
  8625. // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').",
  8626. // "location": "path",
  8627. // "required": true,
  8628. // "type": "string"
  8629. // },
  8630. // "productId": {
  8631. // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').",
  8632. // "location": "path",
  8633. // "required": true,
  8634. // "type": "string"
  8635. // },
  8636. // "token": {
  8637. // "description": "The token provided to the user's device when the inapp product was purchased.",
  8638. // "location": "path",
  8639. // "required": true,
  8640. // "type": "string"
  8641. // }
  8642. // },
  8643. // "path": "{packageName}/purchases/products/{productId}/tokens/{token}",
  8644. // "response": {
  8645. // "$ref": "ProductPurchase"
  8646. // },
  8647. // "scopes": [
  8648. // "https://www.googleapis.com/auth/androidpublisher"
  8649. // ]
  8650. // }
  8651. }
  8652. // method id "androidpublisher.purchases.subscriptions.cancel":
  8653. type PurchasesSubscriptionsCancelCall struct {
  8654. s *Service
  8655. packageName string
  8656. subscriptionId string
  8657. token string
  8658. urlParams_ gensupport.URLParams
  8659. ctx_ context.Context
  8660. header_ http.Header
  8661. }
  8662. // Cancel: Cancels a user's subscription purchase. The subscription
  8663. // remains valid until its expiration time.
  8664. func (r *PurchasesSubscriptionsService) Cancel(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsCancelCall {
  8665. c := &PurchasesSubscriptionsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8666. c.packageName = packageName
  8667. c.subscriptionId = subscriptionId
  8668. c.token = token
  8669. return c
  8670. }
  8671. // Fields allows partial responses to be retrieved. See
  8672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8673. // for more information.
  8674. func (c *PurchasesSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsCancelCall {
  8675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8676. return c
  8677. }
  8678. // Context sets the context to be used in this call's Do method. Any
  8679. // pending HTTP request will be aborted if the provided context is
  8680. // canceled.
  8681. func (c *PurchasesSubscriptionsCancelCall) Context(ctx context.Context) *PurchasesSubscriptionsCancelCall {
  8682. c.ctx_ = ctx
  8683. return c
  8684. }
  8685. // Header returns an http.Header that can be modified by the caller to
  8686. // add HTTP headers to the request.
  8687. func (c *PurchasesSubscriptionsCancelCall) Header() http.Header {
  8688. if c.header_ == nil {
  8689. c.header_ = make(http.Header)
  8690. }
  8691. return c.header_
  8692. }
  8693. func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) {
  8694. reqHeaders := make(http.Header)
  8695. for k, v := range c.header_ {
  8696. reqHeaders[k] = v
  8697. }
  8698. reqHeaders.Set("User-Agent", c.s.userAgent())
  8699. var body io.Reader = nil
  8700. c.urlParams_.Set("alt", alt)
  8701. c.urlParams_.Set("prettyPrint", "false")
  8702. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel")
  8703. urls += "?" + c.urlParams_.Encode()
  8704. req, err := http.NewRequest("POST", urls, body)
  8705. if err != nil {
  8706. return nil, err
  8707. }
  8708. req.Header = reqHeaders
  8709. googleapi.Expand(req.URL, map[string]string{
  8710. "packageName": c.packageName,
  8711. "subscriptionId": c.subscriptionId,
  8712. "token": c.token,
  8713. })
  8714. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8715. }
  8716. // Do executes the "androidpublisher.purchases.subscriptions.cancel" call.
  8717. func (c *PurchasesSubscriptionsCancelCall) Do(opts ...googleapi.CallOption) error {
  8718. gensupport.SetOptions(c.urlParams_, opts...)
  8719. res, err := c.doRequest("json")
  8720. if err != nil {
  8721. return err
  8722. }
  8723. defer googleapi.CloseBody(res)
  8724. if err := googleapi.CheckResponse(res); err != nil {
  8725. return err
  8726. }
  8727. return nil
  8728. // {
  8729. // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
  8730. // "httpMethod": "POST",
  8731. // "id": "androidpublisher.purchases.subscriptions.cancel",
  8732. // "parameterOrder": [
  8733. // "packageName",
  8734. // "subscriptionId",
  8735. // "token"
  8736. // ],
  8737. // "parameters": {
  8738. // "packageName": {
  8739. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8740. // "location": "path",
  8741. // "required": true,
  8742. // "type": "string"
  8743. // },
  8744. // "subscriptionId": {
  8745. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8746. // "location": "path",
  8747. // "required": true,
  8748. // "type": "string"
  8749. // },
  8750. // "token": {
  8751. // "description": "The token provided to the user's device when the subscription was purchased.",
  8752. // "location": "path",
  8753. // "required": true,
  8754. // "type": "string"
  8755. // }
  8756. // },
  8757. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel",
  8758. // "scopes": [
  8759. // "https://www.googleapis.com/auth/androidpublisher"
  8760. // ]
  8761. // }
  8762. }
  8763. // method id "androidpublisher.purchases.subscriptions.defer":
  8764. type PurchasesSubscriptionsDeferCall struct {
  8765. s *Service
  8766. packageName string
  8767. subscriptionId string
  8768. token string
  8769. subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest
  8770. urlParams_ gensupport.URLParams
  8771. ctx_ context.Context
  8772. header_ http.Header
  8773. }
  8774. // Defer: Defers a user's subscription purchase until a specified future
  8775. // expiration time.
  8776. func (r *PurchasesSubscriptionsService) Defer(packageName string, subscriptionId string, token string, subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest) *PurchasesSubscriptionsDeferCall {
  8777. c := &PurchasesSubscriptionsDeferCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8778. c.packageName = packageName
  8779. c.subscriptionId = subscriptionId
  8780. c.token = token
  8781. c.subscriptionpurchasesdeferrequest = subscriptionpurchasesdeferrequest
  8782. return c
  8783. }
  8784. // Fields allows partial responses to be retrieved. See
  8785. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8786. // for more information.
  8787. func (c *PurchasesSubscriptionsDeferCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsDeferCall {
  8788. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8789. return c
  8790. }
  8791. // Context sets the context to be used in this call's Do method. Any
  8792. // pending HTTP request will be aborted if the provided context is
  8793. // canceled.
  8794. func (c *PurchasesSubscriptionsDeferCall) Context(ctx context.Context) *PurchasesSubscriptionsDeferCall {
  8795. c.ctx_ = ctx
  8796. return c
  8797. }
  8798. // Header returns an http.Header that can be modified by the caller to
  8799. // add HTTP headers to the request.
  8800. func (c *PurchasesSubscriptionsDeferCall) Header() http.Header {
  8801. if c.header_ == nil {
  8802. c.header_ = make(http.Header)
  8803. }
  8804. return c.header_
  8805. }
  8806. func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) {
  8807. reqHeaders := make(http.Header)
  8808. for k, v := range c.header_ {
  8809. reqHeaders[k] = v
  8810. }
  8811. reqHeaders.Set("User-Agent", c.s.userAgent())
  8812. var body io.Reader = nil
  8813. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest)
  8814. if err != nil {
  8815. return nil, err
  8816. }
  8817. reqHeaders.Set("Content-Type", "application/json")
  8818. c.urlParams_.Set("alt", alt)
  8819. c.urlParams_.Set("prettyPrint", "false")
  8820. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer")
  8821. urls += "?" + c.urlParams_.Encode()
  8822. req, err := http.NewRequest("POST", urls, body)
  8823. if err != nil {
  8824. return nil, err
  8825. }
  8826. req.Header = reqHeaders
  8827. googleapi.Expand(req.URL, map[string]string{
  8828. "packageName": c.packageName,
  8829. "subscriptionId": c.subscriptionId,
  8830. "token": c.token,
  8831. })
  8832. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8833. }
  8834. // Do executes the "androidpublisher.purchases.subscriptions.defer" call.
  8835. // Exactly one of *SubscriptionPurchasesDeferResponse or error will be
  8836. // non-nil. Any non-2xx status code is an error. Response headers are in
  8837. // either *SubscriptionPurchasesDeferResponse.ServerResponse.Header or
  8838. // (if a response was returned at all) in
  8839. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8840. // whether the returned error was because http.StatusNotModified was
  8841. // returned.
  8842. func (c *PurchasesSubscriptionsDeferCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchasesDeferResponse, error) {
  8843. gensupport.SetOptions(c.urlParams_, opts...)
  8844. res, err := c.doRequest("json")
  8845. if res != nil && res.StatusCode == http.StatusNotModified {
  8846. if res.Body != nil {
  8847. res.Body.Close()
  8848. }
  8849. return nil, &googleapi.Error{
  8850. Code: res.StatusCode,
  8851. Header: res.Header,
  8852. }
  8853. }
  8854. if err != nil {
  8855. return nil, err
  8856. }
  8857. defer googleapi.CloseBody(res)
  8858. if err := googleapi.CheckResponse(res); err != nil {
  8859. return nil, err
  8860. }
  8861. ret := &SubscriptionPurchasesDeferResponse{
  8862. ServerResponse: googleapi.ServerResponse{
  8863. Header: res.Header,
  8864. HTTPStatusCode: res.StatusCode,
  8865. },
  8866. }
  8867. target := &ret
  8868. if err := gensupport.DecodeResponse(target, res); err != nil {
  8869. return nil, err
  8870. }
  8871. return ret, nil
  8872. // {
  8873. // "description": "Defers a user's subscription purchase until a specified future expiration time.",
  8874. // "httpMethod": "POST",
  8875. // "id": "androidpublisher.purchases.subscriptions.defer",
  8876. // "parameterOrder": [
  8877. // "packageName",
  8878. // "subscriptionId",
  8879. // "token"
  8880. // ],
  8881. // "parameters": {
  8882. // "packageName": {
  8883. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8884. // "location": "path",
  8885. // "required": true,
  8886. // "type": "string"
  8887. // },
  8888. // "subscriptionId": {
  8889. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8890. // "location": "path",
  8891. // "required": true,
  8892. // "type": "string"
  8893. // },
  8894. // "token": {
  8895. // "description": "The token provided to the user's device when the subscription was purchased.",
  8896. // "location": "path",
  8897. // "required": true,
  8898. // "type": "string"
  8899. // }
  8900. // },
  8901. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer",
  8902. // "request": {
  8903. // "$ref": "SubscriptionPurchasesDeferRequest"
  8904. // },
  8905. // "response": {
  8906. // "$ref": "SubscriptionPurchasesDeferResponse"
  8907. // },
  8908. // "scopes": [
  8909. // "https://www.googleapis.com/auth/androidpublisher"
  8910. // ]
  8911. // }
  8912. }
  8913. // method id "androidpublisher.purchases.subscriptions.get":
  8914. type PurchasesSubscriptionsGetCall struct {
  8915. s *Service
  8916. packageName string
  8917. subscriptionId string
  8918. token string
  8919. urlParams_ gensupport.URLParams
  8920. ifNoneMatch_ string
  8921. ctx_ context.Context
  8922. header_ http.Header
  8923. }
  8924. // Get: Checks whether a user's subscription purchase is valid and
  8925. // returns its expiry time.
  8926. func (r *PurchasesSubscriptionsService) Get(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsGetCall {
  8927. c := &PurchasesSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8928. c.packageName = packageName
  8929. c.subscriptionId = subscriptionId
  8930. c.token = token
  8931. return c
  8932. }
  8933. // Fields allows partial responses to be retrieved. See
  8934. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8935. // for more information.
  8936. func (c *PurchasesSubscriptionsGetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsGetCall {
  8937. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8938. return c
  8939. }
  8940. // IfNoneMatch sets the optional parameter which makes the operation
  8941. // fail if the object's ETag matches the given value. This is useful for
  8942. // getting updates only after the object has changed since the last
  8943. // request. Use googleapi.IsNotModified to check whether the response
  8944. // error from Do is the result of In-None-Match.
  8945. func (c *PurchasesSubscriptionsGetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsGetCall {
  8946. c.ifNoneMatch_ = entityTag
  8947. return c
  8948. }
  8949. // Context sets the context to be used in this call's Do method. Any
  8950. // pending HTTP request will be aborted if the provided context is
  8951. // canceled.
  8952. func (c *PurchasesSubscriptionsGetCall) Context(ctx context.Context) *PurchasesSubscriptionsGetCall {
  8953. c.ctx_ = ctx
  8954. return c
  8955. }
  8956. // Header returns an http.Header that can be modified by the caller to
  8957. // add HTTP headers to the request.
  8958. func (c *PurchasesSubscriptionsGetCall) Header() http.Header {
  8959. if c.header_ == nil {
  8960. c.header_ = make(http.Header)
  8961. }
  8962. return c.header_
  8963. }
  8964. func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  8965. reqHeaders := make(http.Header)
  8966. for k, v := range c.header_ {
  8967. reqHeaders[k] = v
  8968. }
  8969. reqHeaders.Set("User-Agent", c.s.userAgent())
  8970. if c.ifNoneMatch_ != "" {
  8971. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8972. }
  8973. var body io.Reader = nil
  8974. c.urlParams_.Set("alt", alt)
  8975. c.urlParams_.Set("prettyPrint", "false")
  8976. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}")
  8977. urls += "?" + c.urlParams_.Encode()
  8978. req, err := http.NewRequest("GET", urls, body)
  8979. if err != nil {
  8980. return nil, err
  8981. }
  8982. req.Header = reqHeaders
  8983. googleapi.Expand(req.URL, map[string]string{
  8984. "packageName": c.packageName,
  8985. "subscriptionId": c.subscriptionId,
  8986. "token": c.token,
  8987. })
  8988. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8989. }
  8990. // Do executes the "androidpublisher.purchases.subscriptions.get" call.
  8991. // Exactly one of *SubscriptionPurchase or error will be non-nil. Any
  8992. // non-2xx status code is an error. Response headers are in either
  8993. // *SubscriptionPurchase.ServerResponse.Header or (if a response was
  8994. // returned at all) in error.(*googleapi.Error).Header. Use
  8995. // googleapi.IsNotModified to check whether the returned error was
  8996. // because http.StatusNotModified was returned.
  8997. func (c *PurchasesSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchase, error) {
  8998. gensupport.SetOptions(c.urlParams_, opts...)
  8999. res, err := c.doRequest("json")
  9000. if res != nil && res.StatusCode == http.StatusNotModified {
  9001. if res.Body != nil {
  9002. res.Body.Close()
  9003. }
  9004. return nil, &googleapi.Error{
  9005. Code: res.StatusCode,
  9006. Header: res.Header,
  9007. }
  9008. }
  9009. if err != nil {
  9010. return nil, err
  9011. }
  9012. defer googleapi.CloseBody(res)
  9013. if err := googleapi.CheckResponse(res); err != nil {
  9014. return nil, err
  9015. }
  9016. ret := &SubscriptionPurchase{
  9017. ServerResponse: googleapi.ServerResponse{
  9018. Header: res.Header,
  9019. HTTPStatusCode: res.StatusCode,
  9020. },
  9021. }
  9022. target := &ret
  9023. if err := gensupport.DecodeResponse(target, res); err != nil {
  9024. return nil, err
  9025. }
  9026. return ret, nil
  9027. // {
  9028. // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
  9029. // "httpMethod": "GET",
  9030. // "id": "androidpublisher.purchases.subscriptions.get",
  9031. // "parameterOrder": [
  9032. // "packageName",
  9033. // "subscriptionId",
  9034. // "token"
  9035. // ],
  9036. // "parameters": {
  9037. // "packageName": {
  9038. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9039. // "location": "path",
  9040. // "required": true,
  9041. // "type": "string"
  9042. // },
  9043. // "subscriptionId": {
  9044. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9045. // "location": "path",
  9046. // "required": true,
  9047. // "type": "string"
  9048. // },
  9049. // "token": {
  9050. // "description": "The token provided to the user's device when the subscription was purchased.",
  9051. // "location": "path",
  9052. // "required": true,
  9053. // "type": "string"
  9054. // }
  9055. // },
  9056. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}",
  9057. // "response": {
  9058. // "$ref": "SubscriptionPurchase"
  9059. // },
  9060. // "scopes": [
  9061. // "https://www.googleapis.com/auth/androidpublisher"
  9062. // ]
  9063. // }
  9064. }
  9065. // method id "androidpublisher.purchases.subscriptions.refund":
  9066. type PurchasesSubscriptionsRefundCall struct {
  9067. s *Service
  9068. packageName string
  9069. subscriptionId string
  9070. token string
  9071. urlParams_ gensupport.URLParams
  9072. ctx_ context.Context
  9073. header_ http.Header
  9074. }
  9075. // Refund: Refunds a user's subscription purchase, but the subscription
  9076. // remains valid until its expiration time and it will continue to
  9077. // recur.
  9078. func (r *PurchasesSubscriptionsService) Refund(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRefundCall {
  9079. c := &PurchasesSubscriptionsRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9080. c.packageName = packageName
  9081. c.subscriptionId = subscriptionId
  9082. c.token = token
  9083. return c
  9084. }
  9085. // Fields allows partial responses to be retrieved. See
  9086. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9087. // for more information.
  9088. func (c *PurchasesSubscriptionsRefundCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRefundCall {
  9089. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9090. return c
  9091. }
  9092. // Context sets the context to be used in this call's Do method. Any
  9093. // pending HTTP request will be aborted if the provided context is
  9094. // canceled.
  9095. func (c *PurchasesSubscriptionsRefundCall) Context(ctx context.Context) *PurchasesSubscriptionsRefundCall {
  9096. c.ctx_ = ctx
  9097. return c
  9098. }
  9099. // Header returns an http.Header that can be modified by the caller to
  9100. // add HTTP headers to the request.
  9101. func (c *PurchasesSubscriptionsRefundCall) Header() http.Header {
  9102. if c.header_ == nil {
  9103. c.header_ = make(http.Header)
  9104. }
  9105. return c.header_
  9106. }
  9107. func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) {
  9108. reqHeaders := make(http.Header)
  9109. for k, v := range c.header_ {
  9110. reqHeaders[k] = v
  9111. }
  9112. reqHeaders.Set("User-Agent", c.s.userAgent())
  9113. var body io.Reader = nil
  9114. c.urlParams_.Set("alt", alt)
  9115. c.urlParams_.Set("prettyPrint", "false")
  9116. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund")
  9117. urls += "?" + c.urlParams_.Encode()
  9118. req, err := http.NewRequest("POST", urls, body)
  9119. if err != nil {
  9120. return nil, err
  9121. }
  9122. req.Header = reqHeaders
  9123. googleapi.Expand(req.URL, map[string]string{
  9124. "packageName": c.packageName,
  9125. "subscriptionId": c.subscriptionId,
  9126. "token": c.token,
  9127. })
  9128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9129. }
  9130. // Do executes the "androidpublisher.purchases.subscriptions.refund" call.
  9131. func (c *PurchasesSubscriptionsRefundCall) Do(opts ...googleapi.CallOption) error {
  9132. gensupport.SetOptions(c.urlParams_, opts...)
  9133. res, err := c.doRequest("json")
  9134. if err != nil {
  9135. return err
  9136. }
  9137. defer googleapi.CloseBody(res)
  9138. if err := googleapi.CheckResponse(res); err != nil {
  9139. return err
  9140. }
  9141. return nil
  9142. // {
  9143. // "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.",
  9144. // "httpMethod": "POST",
  9145. // "id": "androidpublisher.purchases.subscriptions.refund",
  9146. // "parameterOrder": [
  9147. // "packageName",
  9148. // "subscriptionId",
  9149. // "token"
  9150. // ],
  9151. // "parameters": {
  9152. // "packageName": {
  9153. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9154. // "location": "path",
  9155. // "required": true,
  9156. // "type": "string"
  9157. // },
  9158. // "subscriptionId": {
  9159. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9160. // "location": "path",
  9161. // "required": true,
  9162. // "type": "string"
  9163. // },
  9164. // "token": {
  9165. // "description": "The token provided to the user's device when the subscription was purchased.",
  9166. // "location": "path",
  9167. // "required": true,
  9168. // "type": "string"
  9169. // }
  9170. // },
  9171. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund",
  9172. // "scopes": [
  9173. // "https://www.googleapis.com/auth/androidpublisher"
  9174. // ]
  9175. // }
  9176. }
  9177. // method id "androidpublisher.purchases.subscriptions.revoke":
  9178. type PurchasesSubscriptionsRevokeCall struct {
  9179. s *Service
  9180. packageName string
  9181. subscriptionId string
  9182. token string
  9183. urlParams_ gensupport.URLParams
  9184. ctx_ context.Context
  9185. header_ http.Header
  9186. }
  9187. // Revoke: Refunds and immediately revokes a user's subscription
  9188. // purchase. Access to the subscription will be terminated immediately
  9189. // and it will stop recurring.
  9190. func (r *PurchasesSubscriptionsService) Revoke(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRevokeCall {
  9191. c := &PurchasesSubscriptionsRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9192. c.packageName = packageName
  9193. c.subscriptionId = subscriptionId
  9194. c.token = token
  9195. return c
  9196. }
  9197. // Fields allows partial responses to be retrieved. See
  9198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9199. // for more information.
  9200. func (c *PurchasesSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRevokeCall {
  9201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9202. return c
  9203. }
  9204. // Context sets the context to be used in this call's Do method. Any
  9205. // pending HTTP request will be aborted if the provided context is
  9206. // canceled.
  9207. func (c *PurchasesSubscriptionsRevokeCall) Context(ctx context.Context) *PurchasesSubscriptionsRevokeCall {
  9208. c.ctx_ = ctx
  9209. return c
  9210. }
  9211. // Header returns an http.Header that can be modified by the caller to
  9212. // add HTTP headers to the request.
  9213. func (c *PurchasesSubscriptionsRevokeCall) Header() http.Header {
  9214. if c.header_ == nil {
  9215. c.header_ = make(http.Header)
  9216. }
  9217. return c.header_
  9218. }
  9219. func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) {
  9220. reqHeaders := make(http.Header)
  9221. for k, v := range c.header_ {
  9222. reqHeaders[k] = v
  9223. }
  9224. reqHeaders.Set("User-Agent", c.s.userAgent())
  9225. var body io.Reader = nil
  9226. c.urlParams_.Set("alt", alt)
  9227. c.urlParams_.Set("prettyPrint", "false")
  9228. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke")
  9229. urls += "?" + c.urlParams_.Encode()
  9230. req, err := http.NewRequest("POST", urls, body)
  9231. if err != nil {
  9232. return nil, err
  9233. }
  9234. req.Header = reqHeaders
  9235. googleapi.Expand(req.URL, map[string]string{
  9236. "packageName": c.packageName,
  9237. "subscriptionId": c.subscriptionId,
  9238. "token": c.token,
  9239. })
  9240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9241. }
  9242. // Do executes the "androidpublisher.purchases.subscriptions.revoke" call.
  9243. func (c *PurchasesSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) error {
  9244. gensupport.SetOptions(c.urlParams_, opts...)
  9245. res, err := c.doRequest("json")
  9246. if err != nil {
  9247. return err
  9248. }
  9249. defer googleapi.CloseBody(res)
  9250. if err := googleapi.CheckResponse(res); err != nil {
  9251. return err
  9252. }
  9253. return nil
  9254. // {
  9255. // "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.",
  9256. // "httpMethod": "POST",
  9257. // "id": "androidpublisher.purchases.subscriptions.revoke",
  9258. // "parameterOrder": [
  9259. // "packageName",
  9260. // "subscriptionId",
  9261. // "token"
  9262. // ],
  9263. // "parameters": {
  9264. // "packageName": {
  9265. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9266. // "location": "path",
  9267. // "required": true,
  9268. // "type": "string"
  9269. // },
  9270. // "subscriptionId": {
  9271. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9272. // "location": "path",
  9273. // "required": true,
  9274. // "type": "string"
  9275. // },
  9276. // "token": {
  9277. // "description": "The token provided to the user's device when the subscription was purchased.",
  9278. // "location": "path",
  9279. // "required": true,
  9280. // "type": "string"
  9281. // }
  9282. // },
  9283. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke",
  9284. // "scopes": [
  9285. // "https://www.googleapis.com/auth/androidpublisher"
  9286. // ]
  9287. // }
  9288. }
  9289. // method id "androidpublisher.purchases.voidedpurchases.list":
  9290. type PurchasesVoidedpurchasesListCall struct {
  9291. s *Service
  9292. packageName string
  9293. urlParams_ gensupport.URLParams
  9294. ifNoneMatch_ string
  9295. ctx_ context.Context
  9296. header_ http.Header
  9297. }
  9298. // List: Lists the purchases that were canceled, refunded or
  9299. // charged-back.
  9300. func (r *PurchasesVoidedpurchasesService) List(packageName string) *PurchasesVoidedpurchasesListCall {
  9301. c := &PurchasesVoidedpurchasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9302. c.packageName = packageName
  9303. return c
  9304. }
  9305. // EndTime sets the optional parameter "endTime": The time, in
  9306. // milliseconds since the Epoch, of the newest voided in-app product
  9307. // purchase that you want to see in the response. The value of this
  9308. // parameter cannot be greater than the current time and is ignored if a
  9309. // pagination token is set. Default value is current time. Note: This
  9310. // filter is applied on the time at which the record is seen as voided
  9311. // by our systems and not the actual voided time returned in the
  9312. // response.
  9313. func (c *PurchasesVoidedpurchasesListCall) EndTime(endTime int64) *PurchasesVoidedpurchasesListCall {
  9314. c.urlParams_.Set("endTime", fmt.Sprint(endTime))
  9315. return c
  9316. }
  9317. // MaxResults sets the optional parameter "maxResults":
  9318. func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResults int64) *PurchasesVoidedpurchasesListCall {
  9319. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9320. return c
  9321. }
  9322. // StartIndex sets the optional parameter "startIndex":
  9323. func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndex int64) *PurchasesVoidedpurchasesListCall {
  9324. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9325. return c
  9326. }
  9327. // StartTime sets the optional parameter "startTime": The time, in
  9328. // milliseconds since the Epoch, of the oldest voided in-app product
  9329. // purchase that you want to see in the response. The value of this
  9330. // parameter cannot be older than 30 days and is ignored if a pagination
  9331. // token is set. Default value is current time minus 30 days. Note: This
  9332. // filter is applied on the time at which the record is seen as voided
  9333. // by our systems and not the actual voided time returned in the
  9334. // response.
  9335. func (c *PurchasesVoidedpurchasesListCall) StartTime(startTime int64) *PurchasesVoidedpurchasesListCall {
  9336. c.urlParams_.Set("startTime", fmt.Sprint(startTime))
  9337. return c
  9338. }
  9339. // Token sets the optional parameter "token":
  9340. func (c *PurchasesVoidedpurchasesListCall) Token(token string) *PurchasesVoidedpurchasesListCall {
  9341. c.urlParams_.Set("token", token)
  9342. return c
  9343. }
  9344. // Fields allows partial responses to be retrieved. See
  9345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9346. // for more information.
  9347. func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall {
  9348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9349. return c
  9350. }
  9351. // IfNoneMatch sets the optional parameter which makes the operation
  9352. // fail if the object's ETag matches the given value. This is useful for
  9353. // getting updates only after the object has changed since the last
  9354. // request. Use googleapi.IsNotModified to check whether the response
  9355. // error from Do is the result of In-None-Match.
  9356. func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTag string) *PurchasesVoidedpurchasesListCall {
  9357. c.ifNoneMatch_ = entityTag
  9358. return c
  9359. }
  9360. // Context sets the context to be used in this call's Do method. Any
  9361. // pending HTTP request will be aborted if the provided context is
  9362. // canceled.
  9363. func (c *PurchasesVoidedpurchasesListCall) Context(ctx context.Context) *PurchasesVoidedpurchasesListCall {
  9364. c.ctx_ = ctx
  9365. return c
  9366. }
  9367. // Header returns an http.Header that can be modified by the caller to
  9368. // add HTTP headers to the request.
  9369. func (c *PurchasesVoidedpurchasesListCall) Header() http.Header {
  9370. if c.header_ == nil {
  9371. c.header_ = make(http.Header)
  9372. }
  9373. return c.header_
  9374. }
  9375. func (c *PurchasesVoidedpurchasesListCall) doRequest(alt string) (*http.Response, error) {
  9376. reqHeaders := make(http.Header)
  9377. for k, v := range c.header_ {
  9378. reqHeaders[k] = v
  9379. }
  9380. reqHeaders.Set("User-Agent", c.s.userAgent())
  9381. if c.ifNoneMatch_ != "" {
  9382. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9383. }
  9384. var body io.Reader = nil
  9385. c.urlParams_.Set("alt", alt)
  9386. c.urlParams_.Set("prettyPrint", "false")
  9387. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/voidedpurchases")
  9388. urls += "?" + c.urlParams_.Encode()
  9389. req, err := http.NewRequest("GET", urls, body)
  9390. if err != nil {
  9391. return nil, err
  9392. }
  9393. req.Header = reqHeaders
  9394. googleapi.Expand(req.URL, map[string]string{
  9395. "packageName": c.packageName,
  9396. })
  9397. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9398. }
  9399. // Do executes the "androidpublisher.purchases.voidedpurchases.list" call.
  9400. // Exactly one of *VoidedPurchasesListResponse or error will be non-nil.
  9401. // Any non-2xx status code is an error. Response headers are in either
  9402. // *VoidedPurchasesListResponse.ServerResponse.Header or (if a response
  9403. // was returned at all) in error.(*googleapi.Error).Header. Use
  9404. // googleapi.IsNotModified to check whether the returned error was
  9405. // because http.StatusNotModified was returned.
  9406. func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse, error) {
  9407. gensupport.SetOptions(c.urlParams_, opts...)
  9408. res, err := c.doRequest("json")
  9409. if res != nil && res.StatusCode == http.StatusNotModified {
  9410. if res.Body != nil {
  9411. res.Body.Close()
  9412. }
  9413. return nil, &googleapi.Error{
  9414. Code: res.StatusCode,
  9415. Header: res.Header,
  9416. }
  9417. }
  9418. if err != nil {
  9419. return nil, err
  9420. }
  9421. defer googleapi.CloseBody(res)
  9422. if err := googleapi.CheckResponse(res); err != nil {
  9423. return nil, err
  9424. }
  9425. ret := &VoidedPurchasesListResponse{
  9426. ServerResponse: googleapi.ServerResponse{
  9427. Header: res.Header,
  9428. HTTPStatusCode: res.StatusCode,
  9429. },
  9430. }
  9431. target := &ret
  9432. if err := gensupport.DecodeResponse(target, res); err != nil {
  9433. return nil, err
  9434. }
  9435. return ret, nil
  9436. // {
  9437. // "description": "Lists the purchases that were canceled, refunded or charged-back.",
  9438. // "httpMethod": "GET",
  9439. // "id": "androidpublisher.purchases.voidedpurchases.list",
  9440. // "parameterOrder": [
  9441. // "packageName"
  9442. // ],
  9443. // "parameters": {
  9444. // "endTime": {
  9445. // "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.",
  9446. // "format": "int64",
  9447. // "location": "query",
  9448. // "type": "string"
  9449. // },
  9450. // "maxResults": {
  9451. // "format": "uint32",
  9452. // "location": "query",
  9453. // "type": "integer"
  9454. // },
  9455. // "packageName": {
  9456. // "description": "The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing').",
  9457. // "location": "path",
  9458. // "required": true,
  9459. // "type": "string"
  9460. // },
  9461. // "startIndex": {
  9462. // "format": "uint32",
  9463. // "location": "query",
  9464. // "type": "integer"
  9465. // },
  9466. // "startTime": {
  9467. // "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.",
  9468. // "format": "int64",
  9469. // "location": "query",
  9470. // "type": "string"
  9471. // },
  9472. // "token": {
  9473. // "location": "query",
  9474. // "type": "string"
  9475. // }
  9476. // },
  9477. // "path": "{packageName}/purchases/voidedpurchases",
  9478. // "response": {
  9479. // "$ref": "VoidedPurchasesListResponse"
  9480. // },
  9481. // "scopes": [
  9482. // "https://www.googleapis.com/auth/androidpublisher"
  9483. // ]
  9484. // }
  9485. }
  9486. // method id "androidpublisher.reviews.get":
  9487. type ReviewsGetCall struct {
  9488. s *Service
  9489. packageNameid string
  9490. reviewId string
  9491. urlParams_ gensupport.URLParams
  9492. ifNoneMatch_ string
  9493. ctx_ context.Context
  9494. header_ http.Header
  9495. }
  9496. // Get: Returns a single review.
  9497. func (r *ReviewsService) Get(packageNameid string, reviewId string) *ReviewsGetCall {
  9498. c := &ReviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9499. c.packageNameid = packageNameid
  9500. c.reviewId = reviewId
  9501. return c
  9502. }
  9503. // TranslationLanguage sets the optional parameter
  9504. // "translationLanguage":
  9505. func (c *ReviewsGetCall) TranslationLanguage(translationLanguage string) *ReviewsGetCall {
  9506. c.urlParams_.Set("translationLanguage", translationLanguage)
  9507. return c
  9508. }
  9509. // Fields allows partial responses to be retrieved. See
  9510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9511. // for more information.
  9512. func (c *ReviewsGetCall) Fields(s ...googleapi.Field) *ReviewsGetCall {
  9513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9514. return c
  9515. }
  9516. // IfNoneMatch sets the optional parameter which makes the operation
  9517. // fail if the object's ETag matches the given value. This is useful for
  9518. // getting updates only after the object has changed since the last
  9519. // request. Use googleapi.IsNotModified to check whether the response
  9520. // error from Do is the result of In-None-Match.
  9521. func (c *ReviewsGetCall) IfNoneMatch(entityTag string) *ReviewsGetCall {
  9522. c.ifNoneMatch_ = entityTag
  9523. return c
  9524. }
  9525. // Context sets the context to be used in this call's Do method. Any
  9526. // pending HTTP request will be aborted if the provided context is
  9527. // canceled.
  9528. func (c *ReviewsGetCall) Context(ctx context.Context) *ReviewsGetCall {
  9529. c.ctx_ = ctx
  9530. return c
  9531. }
  9532. // Header returns an http.Header that can be modified by the caller to
  9533. // add HTTP headers to the request.
  9534. func (c *ReviewsGetCall) Header() http.Header {
  9535. if c.header_ == nil {
  9536. c.header_ = make(http.Header)
  9537. }
  9538. return c.header_
  9539. }
  9540. func (c *ReviewsGetCall) doRequest(alt string) (*http.Response, error) {
  9541. reqHeaders := make(http.Header)
  9542. for k, v := range c.header_ {
  9543. reqHeaders[k] = v
  9544. }
  9545. reqHeaders.Set("User-Agent", c.s.userAgent())
  9546. if c.ifNoneMatch_ != "" {
  9547. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9548. }
  9549. var body io.Reader = nil
  9550. c.urlParams_.Set("alt", alt)
  9551. c.urlParams_.Set("prettyPrint", "false")
  9552. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}")
  9553. urls += "?" + c.urlParams_.Encode()
  9554. req, err := http.NewRequest("GET", urls, body)
  9555. if err != nil {
  9556. return nil, err
  9557. }
  9558. req.Header = reqHeaders
  9559. googleapi.Expand(req.URL, map[string]string{
  9560. "packageName": c.packageNameid,
  9561. "reviewId": c.reviewId,
  9562. })
  9563. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9564. }
  9565. // Do executes the "androidpublisher.reviews.get" call.
  9566. // Exactly one of *Review or error will be non-nil. Any non-2xx status
  9567. // code is an error. Response headers are in either
  9568. // *Review.ServerResponse.Header or (if a response was returned at all)
  9569. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9570. // check whether the returned error was because http.StatusNotModified
  9571. // was returned.
  9572. func (c *ReviewsGetCall) Do(opts ...googleapi.CallOption) (*Review, error) {
  9573. gensupport.SetOptions(c.urlParams_, opts...)
  9574. res, err := c.doRequest("json")
  9575. if res != nil && res.StatusCode == http.StatusNotModified {
  9576. if res.Body != nil {
  9577. res.Body.Close()
  9578. }
  9579. return nil, &googleapi.Error{
  9580. Code: res.StatusCode,
  9581. Header: res.Header,
  9582. }
  9583. }
  9584. if err != nil {
  9585. return nil, err
  9586. }
  9587. defer googleapi.CloseBody(res)
  9588. if err := googleapi.CheckResponse(res); err != nil {
  9589. return nil, err
  9590. }
  9591. ret := &Review{
  9592. ServerResponse: googleapi.ServerResponse{
  9593. Header: res.Header,
  9594. HTTPStatusCode: res.StatusCode,
  9595. },
  9596. }
  9597. target := &ret
  9598. if err := gensupport.DecodeResponse(target, res); err != nil {
  9599. return nil, err
  9600. }
  9601. return ret, nil
  9602. // {
  9603. // "description": "Returns a single review.",
  9604. // "httpMethod": "GET",
  9605. // "id": "androidpublisher.reviews.get",
  9606. // "parameterOrder": [
  9607. // "packageName",
  9608. // "reviewId"
  9609. // ],
  9610. // "parameters": {
  9611. // "packageName": {
  9612. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  9613. // "location": "path",
  9614. // "required": true,
  9615. // "type": "string"
  9616. // },
  9617. // "reviewId": {
  9618. // "location": "path",
  9619. // "required": true,
  9620. // "type": "string"
  9621. // },
  9622. // "translationLanguage": {
  9623. // "location": "query",
  9624. // "type": "string"
  9625. // }
  9626. // },
  9627. // "path": "{packageName}/reviews/{reviewId}",
  9628. // "response": {
  9629. // "$ref": "Review"
  9630. // },
  9631. // "scopes": [
  9632. // "https://www.googleapis.com/auth/androidpublisher"
  9633. // ]
  9634. // }
  9635. }
  9636. // method id "androidpublisher.reviews.list":
  9637. type ReviewsListCall struct {
  9638. s *Service
  9639. packageNameid string
  9640. urlParams_ gensupport.URLParams
  9641. ifNoneMatch_ string
  9642. ctx_ context.Context
  9643. header_ http.Header
  9644. }
  9645. // List: Returns a list of reviews. Only reviews from last week will be
  9646. // returned.
  9647. func (r *ReviewsService) List(packageNameid string) *ReviewsListCall {
  9648. c := &ReviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9649. c.packageNameid = packageNameid
  9650. return c
  9651. }
  9652. // MaxResults sets the optional parameter "maxResults":
  9653. func (c *ReviewsListCall) MaxResults(maxResults int64) *ReviewsListCall {
  9654. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9655. return c
  9656. }
  9657. // StartIndex sets the optional parameter "startIndex":
  9658. func (c *ReviewsListCall) StartIndex(startIndex int64) *ReviewsListCall {
  9659. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9660. return c
  9661. }
  9662. // Token sets the optional parameter "token":
  9663. func (c *ReviewsListCall) Token(token string) *ReviewsListCall {
  9664. c.urlParams_.Set("token", token)
  9665. return c
  9666. }
  9667. // TranslationLanguage sets the optional parameter
  9668. // "translationLanguage":
  9669. func (c *ReviewsListCall) TranslationLanguage(translationLanguage string) *ReviewsListCall {
  9670. c.urlParams_.Set("translationLanguage", translationLanguage)
  9671. return c
  9672. }
  9673. // Fields allows partial responses to be retrieved. See
  9674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9675. // for more information.
  9676. func (c *ReviewsListCall) Fields(s ...googleapi.Field) *ReviewsListCall {
  9677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9678. return c
  9679. }
  9680. // IfNoneMatch sets the optional parameter which makes the operation
  9681. // fail if the object's ETag matches the given value. This is useful for
  9682. // getting updates only after the object has changed since the last
  9683. // request. Use googleapi.IsNotModified to check whether the response
  9684. // error from Do is the result of In-None-Match.
  9685. func (c *ReviewsListCall) IfNoneMatch(entityTag string) *ReviewsListCall {
  9686. c.ifNoneMatch_ = entityTag
  9687. return c
  9688. }
  9689. // Context sets the context to be used in this call's Do method. Any
  9690. // pending HTTP request will be aborted if the provided context is
  9691. // canceled.
  9692. func (c *ReviewsListCall) Context(ctx context.Context) *ReviewsListCall {
  9693. c.ctx_ = ctx
  9694. return c
  9695. }
  9696. // Header returns an http.Header that can be modified by the caller to
  9697. // add HTTP headers to the request.
  9698. func (c *ReviewsListCall) Header() http.Header {
  9699. if c.header_ == nil {
  9700. c.header_ = make(http.Header)
  9701. }
  9702. return c.header_
  9703. }
  9704. func (c *ReviewsListCall) doRequest(alt string) (*http.Response, error) {
  9705. reqHeaders := make(http.Header)
  9706. for k, v := range c.header_ {
  9707. reqHeaders[k] = v
  9708. }
  9709. reqHeaders.Set("User-Agent", c.s.userAgent())
  9710. if c.ifNoneMatch_ != "" {
  9711. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9712. }
  9713. var body io.Reader = nil
  9714. c.urlParams_.Set("alt", alt)
  9715. c.urlParams_.Set("prettyPrint", "false")
  9716. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews")
  9717. urls += "?" + c.urlParams_.Encode()
  9718. req, err := http.NewRequest("GET", urls, body)
  9719. if err != nil {
  9720. return nil, err
  9721. }
  9722. req.Header = reqHeaders
  9723. googleapi.Expand(req.URL, map[string]string{
  9724. "packageName": c.packageNameid,
  9725. })
  9726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9727. }
  9728. // Do executes the "androidpublisher.reviews.list" call.
  9729. // Exactly one of *ReviewsListResponse or error will be non-nil. Any
  9730. // non-2xx status code is an error. Response headers are in either
  9731. // *ReviewsListResponse.ServerResponse.Header or (if a response was
  9732. // returned at all) in error.(*googleapi.Error).Header. Use
  9733. // googleapi.IsNotModified to check whether the returned error was
  9734. // because http.StatusNotModified was returned.
  9735. func (c *ReviewsListCall) Do(opts ...googleapi.CallOption) (*ReviewsListResponse, error) {
  9736. gensupport.SetOptions(c.urlParams_, opts...)
  9737. res, err := c.doRequest("json")
  9738. if res != nil && res.StatusCode == http.StatusNotModified {
  9739. if res.Body != nil {
  9740. res.Body.Close()
  9741. }
  9742. return nil, &googleapi.Error{
  9743. Code: res.StatusCode,
  9744. Header: res.Header,
  9745. }
  9746. }
  9747. if err != nil {
  9748. return nil, err
  9749. }
  9750. defer googleapi.CloseBody(res)
  9751. if err := googleapi.CheckResponse(res); err != nil {
  9752. return nil, err
  9753. }
  9754. ret := &ReviewsListResponse{
  9755. ServerResponse: googleapi.ServerResponse{
  9756. Header: res.Header,
  9757. HTTPStatusCode: res.StatusCode,
  9758. },
  9759. }
  9760. target := &ret
  9761. if err := gensupport.DecodeResponse(target, res); err != nil {
  9762. return nil, err
  9763. }
  9764. return ret, nil
  9765. // {
  9766. // "description": "Returns a list of reviews. Only reviews from last week will be returned.",
  9767. // "httpMethod": "GET",
  9768. // "id": "androidpublisher.reviews.list",
  9769. // "parameterOrder": [
  9770. // "packageName"
  9771. // ],
  9772. // "parameters": {
  9773. // "maxResults": {
  9774. // "format": "uint32",
  9775. // "location": "query",
  9776. // "type": "integer"
  9777. // },
  9778. // "packageName": {
  9779. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  9780. // "location": "path",
  9781. // "required": true,
  9782. // "type": "string"
  9783. // },
  9784. // "startIndex": {
  9785. // "format": "uint32",
  9786. // "location": "query",
  9787. // "type": "integer"
  9788. // },
  9789. // "token": {
  9790. // "location": "query",
  9791. // "type": "string"
  9792. // },
  9793. // "translationLanguage": {
  9794. // "location": "query",
  9795. // "type": "string"
  9796. // }
  9797. // },
  9798. // "path": "{packageName}/reviews",
  9799. // "response": {
  9800. // "$ref": "ReviewsListResponse"
  9801. // },
  9802. // "scopes": [
  9803. // "https://www.googleapis.com/auth/androidpublisher"
  9804. // ]
  9805. // }
  9806. }
  9807. // method id "androidpublisher.reviews.reply":
  9808. type ReviewsReplyCall struct {
  9809. s *Service
  9810. packageNameid string
  9811. reviewId string
  9812. reviewsreplyrequest *ReviewsReplyRequest
  9813. urlParams_ gensupport.URLParams
  9814. ctx_ context.Context
  9815. header_ http.Header
  9816. }
  9817. // Reply: Reply to a single review, or update an existing reply.
  9818. func (r *ReviewsService) Reply(packageNameid string, reviewId string, reviewsreplyrequest *ReviewsReplyRequest) *ReviewsReplyCall {
  9819. c := &ReviewsReplyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9820. c.packageNameid = packageNameid
  9821. c.reviewId = reviewId
  9822. c.reviewsreplyrequest = reviewsreplyrequest
  9823. return c
  9824. }
  9825. // Fields allows partial responses to be retrieved. See
  9826. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9827. // for more information.
  9828. func (c *ReviewsReplyCall) Fields(s ...googleapi.Field) *ReviewsReplyCall {
  9829. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9830. return c
  9831. }
  9832. // Context sets the context to be used in this call's Do method. Any
  9833. // pending HTTP request will be aborted if the provided context is
  9834. // canceled.
  9835. func (c *ReviewsReplyCall) Context(ctx context.Context) *ReviewsReplyCall {
  9836. c.ctx_ = ctx
  9837. return c
  9838. }
  9839. // Header returns an http.Header that can be modified by the caller to
  9840. // add HTTP headers to the request.
  9841. func (c *ReviewsReplyCall) Header() http.Header {
  9842. if c.header_ == nil {
  9843. c.header_ = make(http.Header)
  9844. }
  9845. return c.header_
  9846. }
  9847. func (c *ReviewsReplyCall) doRequest(alt string) (*http.Response, error) {
  9848. reqHeaders := make(http.Header)
  9849. for k, v := range c.header_ {
  9850. reqHeaders[k] = v
  9851. }
  9852. reqHeaders.Set("User-Agent", c.s.userAgent())
  9853. var body io.Reader = nil
  9854. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reviewsreplyrequest)
  9855. if err != nil {
  9856. return nil, err
  9857. }
  9858. reqHeaders.Set("Content-Type", "application/json")
  9859. c.urlParams_.Set("alt", alt)
  9860. c.urlParams_.Set("prettyPrint", "false")
  9861. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}:reply")
  9862. urls += "?" + c.urlParams_.Encode()
  9863. req, err := http.NewRequest("POST", urls, body)
  9864. if err != nil {
  9865. return nil, err
  9866. }
  9867. req.Header = reqHeaders
  9868. googleapi.Expand(req.URL, map[string]string{
  9869. "packageName": c.packageNameid,
  9870. "reviewId": c.reviewId,
  9871. })
  9872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9873. }
  9874. // Do executes the "androidpublisher.reviews.reply" call.
  9875. // Exactly one of *ReviewsReplyResponse or error will be non-nil. Any
  9876. // non-2xx status code is an error. Response headers are in either
  9877. // *ReviewsReplyResponse.ServerResponse.Header or (if a response was
  9878. // returned at all) in error.(*googleapi.Error).Header. Use
  9879. // googleapi.IsNotModified to check whether the returned error was
  9880. // because http.StatusNotModified was returned.
  9881. func (c *ReviewsReplyCall) Do(opts ...googleapi.CallOption) (*ReviewsReplyResponse, error) {
  9882. gensupport.SetOptions(c.urlParams_, opts...)
  9883. res, err := c.doRequest("json")
  9884. if res != nil && res.StatusCode == http.StatusNotModified {
  9885. if res.Body != nil {
  9886. res.Body.Close()
  9887. }
  9888. return nil, &googleapi.Error{
  9889. Code: res.StatusCode,
  9890. Header: res.Header,
  9891. }
  9892. }
  9893. if err != nil {
  9894. return nil, err
  9895. }
  9896. defer googleapi.CloseBody(res)
  9897. if err := googleapi.CheckResponse(res); err != nil {
  9898. return nil, err
  9899. }
  9900. ret := &ReviewsReplyResponse{
  9901. ServerResponse: googleapi.ServerResponse{
  9902. Header: res.Header,
  9903. HTTPStatusCode: res.StatusCode,
  9904. },
  9905. }
  9906. target := &ret
  9907. if err := gensupport.DecodeResponse(target, res); err != nil {
  9908. return nil, err
  9909. }
  9910. return ret, nil
  9911. // {
  9912. // "description": "Reply to a single review, or update an existing reply.",
  9913. // "httpMethod": "POST",
  9914. // "id": "androidpublisher.reviews.reply",
  9915. // "parameterOrder": [
  9916. // "packageName",
  9917. // "reviewId"
  9918. // ],
  9919. // "parameters": {
  9920. // "packageName": {
  9921. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  9922. // "location": "path",
  9923. // "required": true,
  9924. // "type": "string"
  9925. // },
  9926. // "reviewId": {
  9927. // "location": "path",
  9928. // "required": true,
  9929. // "type": "string"
  9930. // }
  9931. // },
  9932. // "path": "{packageName}/reviews/{reviewId}:reply",
  9933. // "request": {
  9934. // "$ref": "ReviewsReplyRequest"
  9935. // },
  9936. // "response": {
  9937. // "$ref": "ReviewsReplyResponse"
  9938. // },
  9939. // "scopes": [
  9940. // "https://www.googleapis.com/auth/androidpublisher"
  9941. // ]
  9942. // }
  9943. }