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.
 
 
 

11470 lines
383 KiB

  1. // Package androidpublisher provides access to the Google Play Developer API.
  2. //
  3. // See https://developers.google.com/android-publisher
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/androidpublisher/v2"
  8. // ...
  9. // androidpublisherService, err := androidpublisher.New(oauthHttpClient)
  10. package androidpublisher // import "google.golang.org/api/androidpublisher/v2"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "androidpublisher:v2"
  41. const apiName = "androidpublisher"
  42. const apiVersion = "v2"
  43. const basePath = "https://www.googleapis.com/androidpublisher/v2/applications/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your Google Play Developer account
  47. AndroidpublisherScope = "https://www.googleapis.com/auth/androidpublisher"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Edits = NewEditsService(s)
  55. s.Inappproducts = NewInappproductsService(s)
  56. s.Orders = NewOrdersService(s)
  57. s.Purchases = NewPurchasesService(s)
  58. s.Reviews = NewReviewsService(s)
  59. return s, nil
  60. }
  61. type Service struct {
  62. client *http.Client
  63. BasePath string // API endpoint base URL
  64. UserAgent string // optional additional User-Agent fragment
  65. Edits *EditsService
  66. Inappproducts *InappproductsService
  67. Orders *OrdersService
  68. Purchases *PurchasesService
  69. Reviews *ReviewsService
  70. }
  71. func (s *Service) userAgent() string {
  72. if s.UserAgent == "" {
  73. return googleapi.UserAgent
  74. }
  75. return googleapi.UserAgent + " " + s.UserAgent
  76. }
  77. func NewEditsService(s *Service) *EditsService {
  78. rs := &EditsService{s: s}
  79. rs.Apklistings = NewEditsApklistingsService(s)
  80. rs.Apks = NewEditsApksService(s)
  81. rs.Bundles = NewEditsBundlesService(s)
  82. rs.Deobfuscationfiles = NewEditsDeobfuscationfilesService(s)
  83. rs.Details = NewEditsDetailsService(s)
  84. rs.Expansionfiles = NewEditsExpansionfilesService(s)
  85. rs.Images = NewEditsImagesService(s)
  86. rs.Listings = NewEditsListingsService(s)
  87. rs.Testers = NewEditsTestersService(s)
  88. rs.Tracks = NewEditsTracksService(s)
  89. return rs
  90. }
  91. type EditsService struct {
  92. s *Service
  93. Apklistings *EditsApklistingsService
  94. Apks *EditsApksService
  95. Bundles *EditsBundlesService
  96. Deobfuscationfiles *EditsDeobfuscationfilesService
  97. Details *EditsDetailsService
  98. Expansionfiles *EditsExpansionfilesService
  99. Images *EditsImagesService
  100. Listings *EditsListingsService
  101. Testers *EditsTestersService
  102. Tracks *EditsTracksService
  103. }
  104. func NewEditsApklistingsService(s *Service) *EditsApklistingsService {
  105. rs := &EditsApklistingsService{s: s}
  106. return rs
  107. }
  108. type EditsApklistingsService struct {
  109. s *Service
  110. }
  111. func NewEditsApksService(s *Service) *EditsApksService {
  112. rs := &EditsApksService{s: s}
  113. return rs
  114. }
  115. type EditsApksService struct {
  116. s *Service
  117. }
  118. func NewEditsBundlesService(s *Service) *EditsBundlesService {
  119. rs := &EditsBundlesService{s: s}
  120. return rs
  121. }
  122. type EditsBundlesService struct {
  123. s *Service
  124. }
  125. func NewEditsDeobfuscationfilesService(s *Service) *EditsDeobfuscationfilesService {
  126. rs := &EditsDeobfuscationfilesService{s: s}
  127. return rs
  128. }
  129. type EditsDeobfuscationfilesService struct {
  130. s *Service
  131. }
  132. func NewEditsDetailsService(s *Service) *EditsDetailsService {
  133. rs := &EditsDetailsService{s: s}
  134. return rs
  135. }
  136. type EditsDetailsService struct {
  137. s *Service
  138. }
  139. func NewEditsExpansionfilesService(s *Service) *EditsExpansionfilesService {
  140. rs := &EditsExpansionfilesService{s: s}
  141. return rs
  142. }
  143. type EditsExpansionfilesService struct {
  144. s *Service
  145. }
  146. func NewEditsImagesService(s *Service) *EditsImagesService {
  147. rs := &EditsImagesService{s: s}
  148. return rs
  149. }
  150. type EditsImagesService struct {
  151. s *Service
  152. }
  153. func NewEditsListingsService(s *Service) *EditsListingsService {
  154. rs := &EditsListingsService{s: s}
  155. return rs
  156. }
  157. type EditsListingsService struct {
  158. s *Service
  159. }
  160. func NewEditsTestersService(s *Service) *EditsTestersService {
  161. rs := &EditsTestersService{s: s}
  162. return rs
  163. }
  164. type EditsTestersService struct {
  165. s *Service
  166. }
  167. func NewEditsTracksService(s *Service) *EditsTracksService {
  168. rs := &EditsTracksService{s: s}
  169. return rs
  170. }
  171. type EditsTracksService struct {
  172. s *Service
  173. }
  174. func NewInappproductsService(s *Service) *InappproductsService {
  175. rs := &InappproductsService{s: s}
  176. return rs
  177. }
  178. type InappproductsService struct {
  179. s *Service
  180. }
  181. func NewOrdersService(s *Service) *OrdersService {
  182. rs := &OrdersService{s: s}
  183. return rs
  184. }
  185. type OrdersService struct {
  186. s *Service
  187. }
  188. func NewPurchasesService(s *Service) *PurchasesService {
  189. rs := &PurchasesService{s: s}
  190. rs.Products = NewPurchasesProductsService(s)
  191. rs.Subscriptions = NewPurchasesSubscriptionsService(s)
  192. rs.Voidedpurchases = NewPurchasesVoidedpurchasesService(s)
  193. return rs
  194. }
  195. type PurchasesService struct {
  196. s *Service
  197. Products *PurchasesProductsService
  198. Subscriptions *PurchasesSubscriptionsService
  199. Voidedpurchases *PurchasesVoidedpurchasesService
  200. }
  201. func NewPurchasesProductsService(s *Service) *PurchasesProductsService {
  202. rs := &PurchasesProductsService{s: s}
  203. return rs
  204. }
  205. type PurchasesProductsService struct {
  206. s *Service
  207. }
  208. func NewPurchasesSubscriptionsService(s *Service) *PurchasesSubscriptionsService {
  209. rs := &PurchasesSubscriptionsService{s: s}
  210. return rs
  211. }
  212. type PurchasesSubscriptionsService struct {
  213. s *Service
  214. }
  215. func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService {
  216. rs := &PurchasesVoidedpurchasesService{s: s}
  217. return rs
  218. }
  219. type PurchasesVoidedpurchasesService struct {
  220. s *Service
  221. }
  222. func NewReviewsService(s *Service) *ReviewsService {
  223. rs := &ReviewsService{s: s}
  224. return rs
  225. }
  226. type ReviewsService struct {
  227. s *Service
  228. }
  229. type Apk struct {
  230. // Binary: Information about the binary payload of this APK.
  231. Binary *ApkBinary `json:"binary,omitempty"`
  232. // VersionCode: The version code of the APK, as specified in the APK's
  233. // manifest file.
  234. VersionCode int64 `json:"versionCode,omitempty"`
  235. // ServerResponse contains the HTTP response code and headers from the
  236. // server.
  237. googleapi.ServerResponse `json:"-"`
  238. // ForceSendFields is a list of field names (e.g. "Binary") to
  239. // unconditionally include in API requests. By default, fields with
  240. // empty values are omitted from API requests. However, any non-pointer,
  241. // non-interface field appearing in ForceSendFields will be sent to the
  242. // server regardless of whether the field is empty or not. This may be
  243. // used to include empty fields in Patch requests.
  244. ForceSendFields []string `json:"-"`
  245. // NullFields is a list of field names (e.g. "Binary") to include in API
  246. // requests with the JSON null value. By default, fields with empty
  247. // values are omitted from API requests. However, any field with an
  248. // empty value appearing in NullFields will be sent to the server as
  249. // null. It is an error if a field in this list has a non-empty value.
  250. // This may be used to include null fields in Patch requests.
  251. NullFields []string `json:"-"`
  252. }
  253. func (s *Apk) MarshalJSON() ([]byte, error) {
  254. type NoMethod Apk
  255. raw := NoMethod(*s)
  256. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  257. }
  258. // ApkBinary: Represents the binary payload of an APK.
  259. type ApkBinary struct {
  260. // Sha1: A sha1 hash of the APK payload, encoded as a hex string and
  261. // matching the output of the sha1sum command.
  262. Sha1 string `json:"sha1,omitempty"`
  263. // Sha256: A sha256 hash of the APK payload, encoded as a hex string and
  264. // matching the output of the sha256sum command.
  265. Sha256 string `json:"sha256,omitempty"`
  266. // ForceSendFields is a list of field names (e.g. "Sha1") to
  267. // unconditionally include in API requests. By default, fields with
  268. // empty values are omitted from API requests. However, any non-pointer,
  269. // non-interface field appearing in ForceSendFields will be sent to the
  270. // server regardless of whether the field is empty or not. This may be
  271. // used to include empty fields in Patch requests.
  272. ForceSendFields []string `json:"-"`
  273. // NullFields is a list of field names (e.g. "Sha1") to include in API
  274. // requests with the JSON null value. By default, fields with empty
  275. // values are omitted from API requests. However, any field with an
  276. // empty value appearing in NullFields will be sent to the server as
  277. // null. It is an error if a field in this list has a non-empty value.
  278. // This may be used to include null fields in Patch requests.
  279. NullFields []string `json:"-"`
  280. }
  281. func (s *ApkBinary) MarshalJSON() ([]byte, error) {
  282. type NoMethod ApkBinary
  283. raw := NoMethod(*s)
  284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  285. }
  286. type ApkListing struct {
  287. // Language: The language code, in BCP 47 format (eg "en-US").
  288. Language string `json:"language,omitempty"`
  289. // RecentChanges: Describe what's new in your APK.
  290. RecentChanges string `json:"recentChanges,omitempty"`
  291. // ServerResponse contains the HTTP response code and headers from the
  292. // server.
  293. googleapi.ServerResponse `json:"-"`
  294. // ForceSendFields is a list of field names (e.g. "Language") to
  295. // unconditionally include in API requests. By default, fields with
  296. // empty values are omitted from API requests. However, any non-pointer,
  297. // non-interface field appearing in ForceSendFields will be sent to the
  298. // server regardless of whether the field is empty or not. This may be
  299. // used to include empty fields in Patch requests.
  300. ForceSendFields []string `json:"-"`
  301. // NullFields is a list of field names (e.g. "Language") to include in
  302. // API requests with the JSON null value. By default, fields with empty
  303. // values are omitted from API requests. However, any field with an
  304. // empty value appearing in NullFields will be sent to the server as
  305. // null. It is an error if a field in this list has a non-empty value.
  306. // This may be used to include null fields in Patch requests.
  307. NullFields []string `json:"-"`
  308. }
  309. func (s *ApkListing) MarshalJSON() ([]byte, error) {
  310. type NoMethod ApkListing
  311. raw := NoMethod(*s)
  312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  313. }
  314. type ApkListingsListResponse struct {
  315. // Kind: Identifies what kind of resource this is. Value: the fixed
  316. // string "androidpublisher#apkListingsListResponse".
  317. Kind string `json:"kind,omitempty"`
  318. Listings []*ApkListing `json:"listings,omitempty"`
  319. // ServerResponse contains the HTTP response code and headers from the
  320. // server.
  321. googleapi.ServerResponse `json:"-"`
  322. // ForceSendFields is a list of field names (e.g. "Kind") to
  323. // unconditionally include in API requests. By default, fields with
  324. // empty values are omitted from API requests. However, any non-pointer,
  325. // non-interface field appearing in ForceSendFields will be sent to the
  326. // server regardless of whether the field is empty or not. This may be
  327. // used to include empty fields in Patch requests.
  328. ForceSendFields []string `json:"-"`
  329. // NullFields is a list of field names (e.g. "Kind") to include in API
  330. // requests with the JSON null value. By default, fields with empty
  331. // values are omitted from API requests. However, any field with an
  332. // empty value appearing in NullFields will be sent to the server as
  333. // null. It is an error if a field in this list has a non-empty value.
  334. // This may be used to include null fields in Patch requests.
  335. NullFields []string `json:"-"`
  336. }
  337. func (s *ApkListingsListResponse) MarshalJSON() ([]byte, error) {
  338. type NoMethod ApkListingsListResponse
  339. raw := NoMethod(*s)
  340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  341. }
  342. type ApksAddExternallyHostedRequest struct {
  343. // ExternallyHostedApk: The definition of the externally-hosted APK and
  344. // where it is located.
  345. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  346. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  347. // to unconditionally include in API requests. By default, fields with
  348. // empty values are omitted from API requests. However, any non-pointer,
  349. // non-interface field appearing in ForceSendFields will be sent to the
  350. // server regardless of whether the field is empty or not. This may be
  351. // used to include empty fields in Patch requests.
  352. ForceSendFields []string `json:"-"`
  353. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  354. // include in API requests with the JSON null value. By default, fields
  355. // with empty values are omitted from API requests. However, any field
  356. // with an empty value appearing in NullFields will be sent to the
  357. // server as null. It is an error if a field in this list has a
  358. // non-empty value. This may be used to include null fields in Patch
  359. // requests.
  360. NullFields []string `json:"-"`
  361. }
  362. func (s *ApksAddExternallyHostedRequest) MarshalJSON() ([]byte, error) {
  363. type NoMethod ApksAddExternallyHostedRequest
  364. raw := NoMethod(*s)
  365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  366. }
  367. type ApksAddExternallyHostedResponse struct {
  368. // ExternallyHostedApk: The definition of the externally-hosted APK and
  369. // where it is located.
  370. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  371. // ServerResponse contains the HTTP response code and headers from the
  372. // server.
  373. googleapi.ServerResponse `json:"-"`
  374. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  375. // to unconditionally include in API requests. By default, fields with
  376. // empty values are omitted from API requests. However, any non-pointer,
  377. // non-interface field appearing in ForceSendFields will be sent to the
  378. // server regardless of whether the field is empty or not. This may be
  379. // used to include empty fields in Patch requests.
  380. ForceSendFields []string `json:"-"`
  381. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  382. // include in API requests with the JSON null value. By default, fields
  383. // with empty values are omitted from API requests. However, any field
  384. // with an empty value appearing in NullFields will be sent to the
  385. // server as null. It is an error if a field in this list has a
  386. // non-empty value. This may be used to include null fields in Patch
  387. // requests.
  388. NullFields []string `json:"-"`
  389. }
  390. func (s *ApksAddExternallyHostedResponse) MarshalJSON() ([]byte, error) {
  391. type NoMethod ApksAddExternallyHostedResponse
  392. raw := NoMethod(*s)
  393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  394. }
  395. type ApksListResponse struct {
  396. Apks []*Apk `json:"apks,omitempty"`
  397. // Kind: Identifies what kind of resource this is. Value: the fixed
  398. // string "androidpublisher#apksListResponse".
  399. Kind string `json:"kind,omitempty"`
  400. // ServerResponse contains the HTTP response code and headers from the
  401. // server.
  402. googleapi.ServerResponse `json:"-"`
  403. // ForceSendFields is a list of field names (e.g. "Apks") to
  404. // unconditionally include in API requests. By default, fields with
  405. // empty values are omitted from API requests. However, any non-pointer,
  406. // non-interface field appearing in ForceSendFields will be sent to the
  407. // server regardless of whether the field is empty or not. This may be
  408. // used to include empty fields in Patch requests.
  409. ForceSendFields []string `json:"-"`
  410. // NullFields is a list of field names (e.g. "Apks") to include in API
  411. // requests with the JSON null value. By default, fields with empty
  412. // values are omitted from API requests. However, any field with an
  413. // empty value appearing in NullFields will be sent to the server as
  414. // null. It is an error if a field in this list has a non-empty value.
  415. // This may be used to include null fields in Patch requests.
  416. NullFields []string `json:"-"`
  417. }
  418. func (s *ApksListResponse) MarshalJSON() ([]byte, error) {
  419. type NoMethod ApksListResponse
  420. raw := NoMethod(*s)
  421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  422. }
  423. type AppDetails struct {
  424. // ContactEmail: The user-visible support email for this app.
  425. ContactEmail string `json:"contactEmail,omitempty"`
  426. // ContactPhone: The user-visible support telephone number for this app.
  427. ContactPhone string `json:"contactPhone,omitempty"`
  428. // ContactWebsite: The user-visible website for this app.
  429. ContactWebsite string `json:"contactWebsite,omitempty"`
  430. // DefaultLanguage: Default language code, in BCP 47 format (eg
  431. // "en-US").
  432. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  433. // ServerResponse contains the HTTP response code and headers from the
  434. // server.
  435. googleapi.ServerResponse `json:"-"`
  436. // ForceSendFields is a list of field names (e.g. "ContactEmail") to
  437. // unconditionally include in API requests. By default, fields with
  438. // empty values are omitted from API requests. However, any non-pointer,
  439. // non-interface field appearing in ForceSendFields will be sent to the
  440. // server regardless of whether the field is empty or not. This may be
  441. // used to include empty fields in Patch requests.
  442. ForceSendFields []string `json:"-"`
  443. // NullFields is a list of field names (e.g. "ContactEmail") to include
  444. // in API requests with the JSON null value. By default, fields with
  445. // empty values are omitted from API requests. However, any field with
  446. // an empty value appearing in NullFields will be sent to the server as
  447. // null. It is an error if a field in this list has a non-empty value.
  448. // This may be used to include null fields in Patch requests.
  449. NullFields []string `json:"-"`
  450. }
  451. func (s *AppDetails) MarshalJSON() ([]byte, error) {
  452. type NoMethod AppDetails
  453. raw := NoMethod(*s)
  454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  455. }
  456. // AppEdit: Represents an edit of an app. An edit allows clients to make
  457. // multiple changes before committing them in one operation.
  458. type AppEdit struct {
  459. // ExpiryTimeSeconds: The time at which the edit will expire and will be
  460. // no longer valid for use in any subsequent API calls (encoded as
  461. // seconds since the Epoch).
  462. ExpiryTimeSeconds string `json:"expiryTimeSeconds,omitempty"`
  463. // Id: The ID of the edit that can be used in subsequent API calls.
  464. Id string `json:"id,omitempty"`
  465. // ServerResponse contains the HTTP response code and headers from the
  466. // server.
  467. googleapi.ServerResponse `json:"-"`
  468. // ForceSendFields is a list of field names (e.g. "ExpiryTimeSeconds")
  469. // to unconditionally include in API requests. By default, fields with
  470. // empty values are omitted from API requests. However, any non-pointer,
  471. // non-interface field appearing in ForceSendFields will be sent to the
  472. // server regardless of whether the field is empty or not. This may be
  473. // used to include empty fields in Patch requests.
  474. ForceSendFields []string `json:"-"`
  475. // NullFields is a list of field names (e.g. "ExpiryTimeSeconds") to
  476. // include in API requests with the JSON null value. By default, fields
  477. // with empty values are omitted from API requests. However, any field
  478. // with an empty value appearing in NullFields will be sent to the
  479. // server as null. It is an error if a field in this list has a
  480. // non-empty value. This may be used to include null fields in Patch
  481. // requests.
  482. NullFields []string `json:"-"`
  483. }
  484. func (s *AppEdit) MarshalJSON() ([]byte, error) {
  485. type NoMethod AppEdit
  486. raw := NoMethod(*s)
  487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  488. }
  489. type Bundle struct {
  490. // Sha1: A sha1 hash of the upload payload, encoded as a hex string and
  491. // matching the output of the sha1sum command.
  492. Sha1 string `json:"sha1,omitempty"`
  493. // Sha256: A sha256 hash of the upload payload, encoded as a hex string
  494. // and matching the output of the sha256sum command.
  495. Sha256 string `json:"sha256,omitempty"`
  496. // VersionCode: The version code of the Android App Bundle. As specified
  497. // in the Android App Bundle's base module APK manifest file.
  498. VersionCode int64 `json:"versionCode,omitempty"`
  499. // ServerResponse contains the HTTP response code and headers from the
  500. // server.
  501. googleapi.ServerResponse `json:"-"`
  502. // ForceSendFields is a list of field names (e.g. "Sha1") to
  503. // unconditionally include in API requests. By default, fields with
  504. // empty values are omitted from API requests. However, any non-pointer,
  505. // non-interface field appearing in ForceSendFields will be sent to the
  506. // server regardless of whether the field is empty or not. This may be
  507. // used to include empty fields in Patch requests.
  508. ForceSendFields []string `json:"-"`
  509. // NullFields is a list of field names (e.g. "Sha1") to include in API
  510. // requests with the JSON null value. By default, fields with empty
  511. // values are omitted from API requests. However, any field with an
  512. // empty value appearing in NullFields will be sent to the server as
  513. // null. It is an error if a field in this list has a non-empty value.
  514. // This may be used to include null fields in Patch requests.
  515. NullFields []string `json:"-"`
  516. }
  517. func (s *Bundle) MarshalJSON() ([]byte, error) {
  518. type NoMethod Bundle
  519. raw := NoMethod(*s)
  520. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  521. }
  522. type BundlesListResponse struct {
  523. Bundles []*Bundle `json:"bundles,omitempty"`
  524. // Kind: Identifies what kind of resource this is. Value: the fixed
  525. // string "androidpublisher#bundlesListResponse".
  526. Kind string `json:"kind,omitempty"`
  527. // ServerResponse contains the HTTP response code and headers from the
  528. // server.
  529. googleapi.ServerResponse `json:"-"`
  530. // ForceSendFields is a list of field names (e.g. "Bundles") to
  531. // unconditionally include in API requests. By default, fields with
  532. // empty values are omitted from API requests. However, any non-pointer,
  533. // non-interface field appearing in ForceSendFields will be sent to the
  534. // server regardless of whether the field is empty or not. This may be
  535. // used to include empty fields in Patch requests.
  536. ForceSendFields []string `json:"-"`
  537. // NullFields is a list of field names (e.g. "Bundles") to include in
  538. // API requests with the JSON null value. By default, fields with empty
  539. // values are omitted from API requests. However, any field with an
  540. // empty value appearing in NullFields will be sent to the server as
  541. // null. It is an error if a field in this list has a non-empty value.
  542. // This may be used to include null fields in Patch requests.
  543. NullFields []string `json:"-"`
  544. }
  545. func (s *BundlesListResponse) MarshalJSON() ([]byte, error) {
  546. type NoMethod BundlesListResponse
  547. raw := NoMethod(*s)
  548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  549. }
  550. type Comment struct {
  551. // DeveloperComment: A comment from a developer.
  552. DeveloperComment *DeveloperComment `json:"developerComment,omitempty"`
  553. // UserComment: A comment from a user.
  554. UserComment *UserComment `json:"userComment,omitempty"`
  555. // ForceSendFields is a list of field names (e.g. "DeveloperComment") to
  556. // unconditionally include in API requests. By default, fields with
  557. // empty values are omitted from API requests. However, any non-pointer,
  558. // non-interface field appearing in ForceSendFields will be sent to the
  559. // server regardless of whether the field is empty or not. This may be
  560. // used to include empty fields in Patch requests.
  561. ForceSendFields []string `json:"-"`
  562. // NullFields is a list of field names (e.g. "DeveloperComment") to
  563. // include in API requests with the JSON null value. By default, fields
  564. // with empty values are omitted from API requests. However, any field
  565. // with an empty value appearing in NullFields will be sent to the
  566. // server as null. It is an error if a field in this list has a
  567. // non-empty value. This may be used to include null fields in Patch
  568. // requests.
  569. NullFields []string `json:"-"`
  570. }
  571. func (s *Comment) MarshalJSON() ([]byte, error) {
  572. type NoMethod Comment
  573. raw := NoMethod(*s)
  574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  575. }
  576. // DeobfuscationFile: Represents a deobfuscation file.
  577. type DeobfuscationFile struct {
  578. // SymbolType: The type of the deobfuscation file.
  579. SymbolType string `json:"symbolType,omitempty"`
  580. // ForceSendFields is a list of field names (e.g. "SymbolType") to
  581. // unconditionally include in API requests. By default, fields with
  582. // empty values are omitted from API requests. However, any non-pointer,
  583. // non-interface field appearing in ForceSendFields will be sent to the
  584. // server regardless of whether the field is empty or not. This may be
  585. // used to include empty fields in Patch requests.
  586. ForceSendFields []string `json:"-"`
  587. // NullFields is a list of field names (e.g. "SymbolType") to include in
  588. // API requests with the JSON null value. By default, fields with empty
  589. // values are omitted from API requests. However, any field with an
  590. // empty value appearing in NullFields will be sent to the server as
  591. // null. It is an error if a field in this list has a non-empty value.
  592. // This may be used to include null fields in Patch requests.
  593. NullFields []string `json:"-"`
  594. }
  595. func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) {
  596. type NoMethod DeobfuscationFile
  597. raw := NoMethod(*s)
  598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  599. }
  600. type DeobfuscationFilesUploadResponse struct {
  601. DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"`
  602. // ServerResponse contains the HTTP response code and headers from the
  603. // server.
  604. googleapi.ServerResponse `json:"-"`
  605. // ForceSendFields is a list of field names (e.g. "DeobfuscationFile")
  606. // to unconditionally include in API requests. By default, fields with
  607. // empty values are omitted from API requests. However, any non-pointer,
  608. // non-interface field appearing in ForceSendFields will be sent to the
  609. // server regardless of whether the field is empty or not. This may be
  610. // used to include empty fields in Patch requests.
  611. ForceSendFields []string `json:"-"`
  612. // NullFields is a list of field names (e.g. "DeobfuscationFile") to
  613. // include in API requests with the JSON null value. By default, fields
  614. // with empty values are omitted from API requests. However, any field
  615. // with an empty value appearing in NullFields will be sent to the
  616. // server as null. It is an error if a field in this list has a
  617. // non-empty value. This may be used to include null fields in Patch
  618. // requests.
  619. NullFields []string `json:"-"`
  620. }
  621. func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) {
  622. type NoMethod DeobfuscationFilesUploadResponse
  623. raw := NoMethod(*s)
  624. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  625. }
  626. type DeveloperComment struct {
  627. // LastModified: The last time at which this comment was updated.
  628. LastModified *Timestamp `json:"lastModified,omitempty"`
  629. // Text: The content of the comment, i.e. reply body.
  630. Text string `json:"text,omitempty"`
  631. // ForceSendFields is a list of field names (e.g. "LastModified") to
  632. // unconditionally include in API requests. By default, fields with
  633. // empty values are omitted from API requests. However, any non-pointer,
  634. // non-interface field appearing in ForceSendFields will be sent to the
  635. // server regardless of whether the field is empty or not. This may be
  636. // used to include empty fields in Patch requests.
  637. ForceSendFields []string `json:"-"`
  638. // NullFields is a list of field names (e.g. "LastModified") to include
  639. // in API requests with the JSON null value. By default, fields with
  640. // empty values are omitted from API requests. However, any field with
  641. // an empty value appearing in NullFields will be sent to the server as
  642. // null. It is an error if a field in this list has a non-empty value.
  643. // This may be used to include null fields in Patch requests.
  644. NullFields []string `json:"-"`
  645. }
  646. func (s *DeveloperComment) MarshalJSON() ([]byte, error) {
  647. type NoMethod DeveloperComment
  648. raw := NoMethod(*s)
  649. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  650. }
  651. type DeviceMetadata struct {
  652. // CpuMake: Device CPU make e.g. "Qualcomm"
  653. CpuMake string `json:"cpuMake,omitempty"`
  654. // CpuModel: Device CPU model e.g. "MSM8974"
  655. CpuModel string `json:"cpuModel,omitempty"`
  656. // DeviceClass: Device class (e.g. tablet)
  657. DeviceClass string `json:"deviceClass,omitempty"`
  658. // GlEsVersion: OpenGL version
  659. GlEsVersion int64 `json:"glEsVersion,omitempty"`
  660. // Manufacturer: Device manufacturer (e.g. Motorola)
  661. Manufacturer string `json:"manufacturer,omitempty"`
  662. // NativePlatform: Comma separated list of native platforms (e.g. "arm",
  663. // "arm7")
  664. NativePlatform string `json:"nativePlatform,omitempty"`
  665. // ProductName: Device model name (e.g. Droid)
  666. ProductName string `json:"productName,omitempty"`
  667. // RamMb: Device RAM in Megabytes e.g. "2048"
  668. RamMb int64 `json:"ramMb,omitempty"`
  669. // ScreenDensityDpi: Screen density in DPI
  670. ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"`
  671. // ScreenHeightPx: Screen height in pixels
  672. ScreenHeightPx int64 `json:"screenHeightPx,omitempty"`
  673. // ScreenWidthPx: Screen width in pixels
  674. ScreenWidthPx int64 `json:"screenWidthPx,omitempty"`
  675. // ForceSendFields is a list of field names (e.g. "CpuMake") to
  676. // unconditionally include in API requests. By default, fields with
  677. // empty values are omitted from API requests. However, any non-pointer,
  678. // non-interface field appearing in ForceSendFields will be sent to the
  679. // server regardless of whether the field is empty or not. This may be
  680. // used to include empty fields in Patch requests.
  681. ForceSendFields []string `json:"-"`
  682. // NullFields is a list of field names (e.g. "CpuMake") to include in
  683. // API requests with the JSON null value. By default, fields with empty
  684. // values are omitted from API requests. However, any field with an
  685. // empty value appearing in NullFields will be sent to the server as
  686. // null. It is an error if a field in this list has a non-empty value.
  687. // This may be used to include null fields in Patch requests.
  688. NullFields []string `json:"-"`
  689. }
  690. func (s *DeviceMetadata) MarshalJSON() ([]byte, error) {
  691. type NoMethod DeviceMetadata
  692. raw := NoMethod(*s)
  693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  694. }
  695. type ExpansionFile struct {
  696. // FileSize: If set this field indicates that this APK has an Expansion
  697. // File uploaded to it: this APK does not reference another APK's
  698. // Expansion File. The field's value is the size of the uploaded
  699. // Expansion File in bytes.
  700. FileSize int64 `json:"fileSize,omitempty,string"`
  701. // ReferencesVersion: If set this APK's Expansion File references
  702. // another APK's Expansion File. The file_size field will not be set.
  703. ReferencesVersion int64 `json:"referencesVersion,omitempty"`
  704. // ServerResponse contains the HTTP response code and headers from the
  705. // server.
  706. googleapi.ServerResponse `json:"-"`
  707. // ForceSendFields is a list of field names (e.g. "FileSize") to
  708. // unconditionally include in API requests. By default, fields with
  709. // empty values are omitted from API requests. However, any non-pointer,
  710. // non-interface field appearing in ForceSendFields will be sent to the
  711. // server regardless of whether the field is empty or not. This may be
  712. // used to include empty fields in Patch requests.
  713. ForceSendFields []string `json:"-"`
  714. // NullFields is a list of field names (e.g. "FileSize") to include in
  715. // API requests with the JSON null value. By default, fields with empty
  716. // values are omitted from API requests. However, any field with an
  717. // empty value appearing in NullFields will be sent to the server as
  718. // null. It is an error if a field in this list has a non-empty value.
  719. // This may be used to include null fields in Patch requests.
  720. NullFields []string `json:"-"`
  721. }
  722. func (s *ExpansionFile) MarshalJSON() ([]byte, error) {
  723. type NoMethod ExpansionFile
  724. raw := NoMethod(*s)
  725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  726. }
  727. type ExpansionFilesUploadResponse struct {
  728. ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"`
  729. // ServerResponse contains the HTTP response code and headers from the
  730. // server.
  731. googleapi.ServerResponse `json:"-"`
  732. // ForceSendFields is a list of field names (e.g. "ExpansionFile") to
  733. // unconditionally include in API requests. By default, fields with
  734. // empty values are omitted from API requests. However, any non-pointer,
  735. // non-interface field appearing in ForceSendFields will be sent to the
  736. // server regardless of whether the field is empty or not. This may be
  737. // used to include empty fields in Patch requests.
  738. ForceSendFields []string `json:"-"`
  739. // NullFields is a list of field names (e.g. "ExpansionFile") to include
  740. // in API requests with the JSON null value. By default, fields with
  741. // empty values are omitted from API requests. However, any field with
  742. // an empty value appearing in NullFields will be sent to the server as
  743. // null. It is an error if a field in this list has a non-empty value.
  744. // This may be used to include null fields in Patch requests.
  745. NullFields []string `json:"-"`
  746. }
  747. func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) {
  748. type NoMethod ExpansionFilesUploadResponse
  749. raw := NoMethod(*s)
  750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  751. }
  752. // ExternallyHostedApk: Defines an APK available for this application
  753. // that is hosted externally and not uploaded to Google Play. This
  754. // function is only available to enterprises who are using Google Play
  755. // for Work, and whos application is restricted to the enterprise
  756. // private channel
  757. type ExternallyHostedApk struct {
  758. // ApplicationLabel: The application label.
  759. ApplicationLabel string `json:"applicationLabel,omitempty"`
  760. // CertificateBase64s: A certificate (or array of certificates if a
  761. // certificate-chain is used) used to signed this APK, represented as a
  762. // base64 encoded byte array.
  763. CertificateBase64s []string `json:"certificateBase64s,omitempty"`
  764. // ExternallyHostedUrl: The URL at which the APK is hosted. This must be
  765. // an https URL.
  766. ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"`
  767. // FileSha1Base64: The SHA1 checksum of this APK, represented as a
  768. // base64 encoded byte array.
  769. FileSha1Base64 string `json:"fileSha1Base64,omitempty"`
  770. // FileSha256Base64: The SHA256 checksum of this APK, represented as a
  771. // base64 encoded byte array.
  772. FileSha256Base64 string `json:"fileSha256Base64,omitempty"`
  773. // FileSize: The file size in bytes of this APK.
  774. FileSize int64 `json:"fileSize,omitempty,string"`
  775. // IconBase64: The icon image from the APK, as a base64 encoded byte
  776. // array.
  777. IconBase64 string `json:"iconBase64,omitempty"`
  778. // MaximumSdk: The maximum SDK supported by this APK (optional).
  779. MaximumSdk int64 `json:"maximumSdk,omitempty"`
  780. // MinimumSdk: The minimum SDK targeted by this APK.
  781. MinimumSdk int64 `json:"minimumSdk,omitempty"`
  782. // NativeCodes: The native code environments supported by this APK
  783. // (optional).
  784. NativeCodes []string `json:"nativeCodes,omitempty"`
  785. // PackageName: The package name.
  786. PackageName string `json:"packageName,omitempty"`
  787. // UsesFeatures: The features required by this APK (optional).
  788. UsesFeatures []string `json:"usesFeatures,omitempty"`
  789. // UsesPermissions: The permissions requested by this APK.
  790. UsesPermissions []*ExternallyHostedApkUsesPermission `json:"usesPermissions,omitempty"`
  791. // VersionCode: The version code of this APK.
  792. VersionCode int64 `json:"versionCode,omitempty"`
  793. // VersionName: The version name of this APK.
  794. VersionName string `json:"versionName,omitempty"`
  795. // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to
  796. // unconditionally include in API requests. By default, fields with
  797. // empty values are omitted from API requests. However, any non-pointer,
  798. // non-interface field appearing in ForceSendFields will be sent to the
  799. // server regardless of whether the field is empty or not. This may be
  800. // used to include empty fields in Patch requests.
  801. ForceSendFields []string `json:"-"`
  802. // NullFields is a list of field names (e.g. "ApplicationLabel") to
  803. // include in API requests with the JSON null value. By default, fields
  804. // with empty values are omitted from API requests. However, any field
  805. // with an empty value appearing in NullFields will be sent to the
  806. // server as null. It is an error if a field in this list has a
  807. // non-empty value. This may be used to include null fields in Patch
  808. // requests.
  809. NullFields []string `json:"-"`
  810. }
  811. func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) {
  812. type NoMethod ExternallyHostedApk
  813. raw := NoMethod(*s)
  814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  815. }
  816. // ExternallyHostedApkUsesPermission: A permission used by this APK.
  817. type ExternallyHostedApkUsesPermission struct {
  818. // MaxSdkVersion: Optionally, the maximum SDK version for which the
  819. // permission is required.
  820. MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"`
  821. // Name: The name of the permission requested.
  822. Name string `json:"name,omitempty"`
  823. // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to
  824. // unconditionally include in API requests. By default, fields with
  825. // empty values are omitted from API requests. However, any non-pointer,
  826. // non-interface field appearing in ForceSendFields will be sent to the
  827. // server regardless of whether the field is empty or not. This may be
  828. // used to include empty fields in Patch requests.
  829. ForceSendFields []string `json:"-"`
  830. // NullFields is a list of field names (e.g. "MaxSdkVersion") to include
  831. // in API requests with the JSON null value. By default, fields with
  832. // empty values are omitted from API requests. However, any field with
  833. // an empty value appearing in NullFields will be sent to the server as
  834. // null. It is an error if a field in this list has a non-empty value.
  835. // This may be used to include null fields in Patch requests.
  836. NullFields []string `json:"-"`
  837. }
  838. func (s *ExternallyHostedApkUsesPermission) MarshalJSON() ([]byte, error) {
  839. type NoMethod ExternallyHostedApkUsesPermission
  840. raw := NoMethod(*s)
  841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  842. }
  843. type Image struct {
  844. // Id: A unique id representing this image.
  845. Id string `json:"id,omitempty"`
  846. // Sha1: A sha1 hash of the image that was uploaded.
  847. Sha1 string `json:"sha1,omitempty"`
  848. // Url: A URL that will serve a preview of the image.
  849. Url string `json:"url,omitempty"`
  850. // ForceSendFields is a list of field names (e.g. "Id") to
  851. // unconditionally include in API requests. By default, fields with
  852. // empty values are omitted from API requests. However, any non-pointer,
  853. // non-interface field appearing in ForceSendFields will be sent to the
  854. // server regardless of whether the field is empty or not. This may be
  855. // used to include empty fields in Patch requests.
  856. ForceSendFields []string `json:"-"`
  857. // NullFields is a list of field names (e.g. "Id") to include in API
  858. // requests with the JSON null value. By default, fields with empty
  859. // values are omitted from API requests. However, any field with an
  860. // empty value appearing in NullFields will be sent to the server as
  861. // null. It is an error if a field in this list has a non-empty value.
  862. // This may be used to include null fields in Patch requests.
  863. NullFields []string `json:"-"`
  864. }
  865. func (s *Image) MarshalJSON() ([]byte, error) {
  866. type NoMethod Image
  867. raw := NoMethod(*s)
  868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  869. }
  870. type ImagesDeleteAllResponse struct {
  871. Deleted []*Image `json:"deleted,omitempty"`
  872. // ServerResponse contains the HTTP response code and headers from the
  873. // server.
  874. googleapi.ServerResponse `json:"-"`
  875. // ForceSendFields is a list of field names (e.g. "Deleted") to
  876. // unconditionally include in API requests. By default, fields with
  877. // empty values are omitted from API requests. However, any non-pointer,
  878. // non-interface field appearing in ForceSendFields will be sent to the
  879. // server regardless of whether the field is empty or not. This may be
  880. // used to include empty fields in Patch requests.
  881. ForceSendFields []string `json:"-"`
  882. // NullFields is a list of field names (e.g. "Deleted") to include in
  883. // API requests with the JSON null value. By default, fields with empty
  884. // values are omitted from API requests. However, any field with an
  885. // empty value appearing in NullFields will be sent to the server as
  886. // null. It is an error if a field in this list has a non-empty value.
  887. // This may be used to include null fields in Patch requests.
  888. NullFields []string `json:"-"`
  889. }
  890. func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) {
  891. type NoMethod ImagesDeleteAllResponse
  892. raw := NoMethod(*s)
  893. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  894. }
  895. type ImagesListResponse struct {
  896. Images []*Image `json:"images,omitempty"`
  897. // ServerResponse contains the HTTP response code and headers from the
  898. // server.
  899. googleapi.ServerResponse `json:"-"`
  900. // ForceSendFields is a list of field names (e.g. "Images") to
  901. // unconditionally include in API requests. By default, fields with
  902. // empty values are omitted from API requests. However, any non-pointer,
  903. // non-interface field appearing in ForceSendFields will be sent to the
  904. // server regardless of whether the field is empty or not. This may be
  905. // used to include empty fields in Patch requests.
  906. ForceSendFields []string `json:"-"`
  907. // NullFields is a list of field names (e.g. "Images") to include in API
  908. // requests with the JSON null value. By default, fields with empty
  909. // values are omitted from API requests. However, any field with an
  910. // empty value appearing in NullFields will be sent to the server as
  911. // null. It is an error if a field in this list has a non-empty value.
  912. // This may be used to include null fields in Patch requests.
  913. NullFields []string `json:"-"`
  914. }
  915. func (s *ImagesListResponse) MarshalJSON() ([]byte, error) {
  916. type NoMethod ImagesListResponse
  917. raw := NoMethod(*s)
  918. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  919. }
  920. type ImagesUploadResponse struct {
  921. Image *Image `json:"image,omitempty"`
  922. // ServerResponse contains the HTTP response code and headers from the
  923. // server.
  924. googleapi.ServerResponse `json:"-"`
  925. // ForceSendFields is a list of field names (e.g. "Image") to
  926. // unconditionally include in API requests. By default, fields with
  927. // empty values are omitted from API requests. However, any non-pointer,
  928. // non-interface field appearing in ForceSendFields will be sent to the
  929. // server regardless of whether the field is empty or not. This may be
  930. // used to include empty fields in Patch requests.
  931. ForceSendFields []string `json:"-"`
  932. // NullFields is a list of field names (e.g. "Image") to include in API
  933. // requests with the JSON null value. By default, fields with empty
  934. // values are omitted from API requests. However, any field with an
  935. // empty value appearing in NullFields will be sent to the server as
  936. // null. It is an error if a field in this list has a non-empty value.
  937. // This may be used to include null fields in Patch requests.
  938. NullFields []string `json:"-"`
  939. }
  940. func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) {
  941. type NoMethod ImagesUploadResponse
  942. raw := NoMethod(*s)
  943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  944. }
  945. type InAppProduct struct {
  946. // DefaultLanguage: The default language of the localized data, as
  947. // defined by BCP 47. e.g. "en-US", "en-GB".
  948. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  949. // DefaultPrice: Default price cannot be zero. In-app products can never
  950. // be free. Default price is always in the developer's Checkout merchant
  951. // currency.
  952. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  953. // GracePeriod: Grace period of the subscription, specified in ISO 8601
  954. // format. It will allow developers to give their subscribers a grace
  955. // period when the payment for the new recurrence period is declined.
  956. // Acceptable values = "P3D" (three days) and "P7D" (seven days)
  957. GracePeriod string `json:"gracePeriod,omitempty"`
  958. // Listings: List of localized title and description data.
  959. Listings map[string]InAppProductListing `json:"listings,omitempty"`
  960. // PackageName: The package name of the parent app.
  961. PackageName string `json:"packageName,omitempty"`
  962. // Prices: Prices per buyer region. None of these prices should be zero.
  963. // In-app products can never be free.
  964. Prices map[string]Price `json:"prices,omitempty"`
  965. // PurchaseType: Purchase type enum value. Unmodifiable after creation.
  966. PurchaseType string `json:"purchaseType,omitempty"`
  967. // Season: Definition of a season for a seasonal subscription. Can be
  968. // defined only for yearly subscriptions.
  969. Season *Season `json:"season,omitempty"`
  970. // Sku: The stock-keeping-unit (SKU) of the product, unique within an
  971. // app.
  972. Sku string `json:"sku,omitempty"`
  973. Status string `json:"status,omitempty"`
  974. // SubscriptionPeriod: Subscription period, specified in ISO 8601
  975. // format. Acceptable values are "P1W" (one week), "P1M" (one month),
  976. // "P3M" (three months), "P6M" (six months), and "P1Y" (one year).
  977. SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"`
  978. // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable
  979. // values are anything between "P7D" (seven days) and "P999D" (999
  980. // days). Seasonal subscriptions cannot have a trial period.
  981. TrialPeriod string `json:"trialPeriod,omitempty"`
  982. // ServerResponse contains the HTTP response code and headers from the
  983. // server.
  984. googleapi.ServerResponse `json:"-"`
  985. // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to
  986. // unconditionally include in API requests. By default, fields with
  987. // empty values are omitted from API requests. However, any non-pointer,
  988. // non-interface field appearing in ForceSendFields will be sent to the
  989. // server regardless of whether the field is empty or not. This may be
  990. // used to include empty fields in Patch requests.
  991. ForceSendFields []string `json:"-"`
  992. // NullFields is a list of field names (e.g. "DefaultLanguage") to
  993. // include in API requests with the JSON null value. By default, fields
  994. // with empty values are omitted from API requests. However, any field
  995. // with an empty value appearing in NullFields will be sent to the
  996. // server as null. It is an error if a field in this list has a
  997. // non-empty value. This may be used to include null fields in Patch
  998. // requests.
  999. NullFields []string `json:"-"`
  1000. }
  1001. func (s *InAppProduct) MarshalJSON() ([]byte, error) {
  1002. type NoMethod InAppProduct
  1003. raw := NoMethod(*s)
  1004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1005. }
  1006. type InAppProductListing struct {
  1007. Description string `json:"description,omitempty"`
  1008. Title string `json:"title,omitempty"`
  1009. // ForceSendFields is a list of field names (e.g. "Description") to
  1010. // unconditionally include in API requests. By default, fields with
  1011. // empty values are omitted from API requests. However, any non-pointer,
  1012. // non-interface field appearing in ForceSendFields will be sent to the
  1013. // server regardless of whether the field is empty or not. This may be
  1014. // used to include empty fields in Patch requests.
  1015. ForceSendFields []string `json:"-"`
  1016. // NullFields is a list of field names (e.g. "Description") to include
  1017. // in API requests with the JSON null value. By default, fields with
  1018. // empty values are omitted from API requests. However, any field with
  1019. // an empty value appearing in NullFields will be sent to the server as
  1020. // null. It is an error if a field in this list has a non-empty value.
  1021. // This may be used to include null fields in Patch requests.
  1022. NullFields []string `json:"-"`
  1023. }
  1024. func (s *InAppProductListing) MarshalJSON() ([]byte, error) {
  1025. type NoMethod InAppProductListing
  1026. raw := NoMethod(*s)
  1027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1028. }
  1029. type InappproductsListResponse struct {
  1030. Inappproduct []*InAppProduct `json:"inappproduct,omitempty"`
  1031. // Kind: Identifies what kind of resource this is. Value: the fixed
  1032. // string "androidpublisher#inappproductsListResponse".
  1033. Kind string `json:"kind,omitempty"`
  1034. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1035. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1036. // ServerResponse contains the HTTP response code and headers from the
  1037. // server.
  1038. googleapi.ServerResponse `json:"-"`
  1039. // ForceSendFields is a list of field names (e.g. "Inappproduct") to
  1040. // unconditionally include in API requests. By default, fields with
  1041. // empty values are omitted from API requests. However, any non-pointer,
  1042. // non-interface field appearing in ForceSendFields will be sent to the
  1043. // server regardless of whether the field is empty or not. This may be
  1044. // used to include empty fields in Patch requests.
  1045. ForceSendFields []string `json:"-"`
  1046. // NullFields is a list of field names (e.g. "Inappproduct") to include
  1047. // in API requests with the JSON null value. By default, fields with
  1048. // empty values are omitted from API requests. However, any field with
  1049. // an empty value appearing in NullFields will be sent to the server as
  1050. // null. It is an error if a field in this list has a non-empty value.
  1051. // This may be used to include null fields in Patch requests.
  1052. NullFields []string `json:"-"`
  1053. }
  1054. func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) {
  1055. type NoMethod InappproductsListResponse
  1056. raw := NoMethod(*s)
  1057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1058. }
  1059. type Listing struct {
  1060. // FullDescription: Full description of the app; this may be up to 4000
  1061. // characters in length.
  1062. FullDescription string `json:"fullDescription,omitempty"`
  1063. // Language: Language localization code (for example, "de-AT" for
  1064. // Austrian German).
  1065. Language string `json:"language,omitempty"`
  1066. // ShortDescription: Short description of the app (previously known as
  1067. // promo text); this may be up to 80 characters in length.
  1068. ShortDescription string `json:"shortDescription,omitempty"`
  1069. // Title: App's localized title.
  1070. Title string `json:"title,omitempty"`
  1071. // Video: URL of a promotional YouTube video for the app.
  1072. Video string `json:"video,omitempty"`
  1073. // ServerResponse contains the HTTP response code and headers from the
  1074. // server.
  1075. googleapi.ServerResponse `json:"-"`
  1076. // ForceSendFields is a list of field names (e.g. "FullDescription") to
  1077. // unconditionally include in API requests. By default, fields with
  1078. // empty values are omitted from API requests. However, any non-pointer,
  1079. // non-interface field appearing in ForceSendFields will be sent to the
  1080. // server regardless of whether the field is empty or not. This may be
  1081. // used to include empty fields in Patch requests.
  1082. ForceSendFields []string `json:"-"`
  1083. // NullFields is a list of field names (e.g. "FullDescription") to
  1084. // include in API requests with the JSON null value. By default, fields
  1085. // with empty values are omitted from API requests. However, any field
  1086. // with an empty value appearing in NullFields will be sent to the
  1087. // server as null. It is an error if a field in this list has a
  1088. // non-empty value. This may be used to include null fields in Patch
  1089. // requests.
  1090. NullFields []string `json:"-"`
  1091. }
  1092. func (s *Listing) MarshalJSON() ([]byte, error) {
  1093. type NoMethod Listing
  1094. raw := NoMethod(*s)
  1095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1096. }
  1097. type ListingsListResponse struct {
  1098. // Kind: Identifies what kind of resource this is. Value: the fixed
  1099. // string "androidpublisher#listingsListResponse".
  1100. Kind string `json:"kind,omitempty"`
  1101. Listings []*Listing `json:"listings,omitempty"`
  1102. // ServerResponse contains the HTTP response code and headers from the
  1103. // server.
  1104. googleapi.ServerResponse `json:"-"`
  1105. // ForceSendFields is a list of field names (e.g. "Kind") to
  1106. // unconditionally include in API requests. By default, fields with
  1107. // empty values are omitted from API requests. However, any non-pointer,
  1108. // non-interface field appearing in ForceSendFields will be sent to the
  1109. // server regardless of whether the field is empty or not. This may be
  1110. // used to include empty fields in Patch requests.
  1111. ForceSendFields []string `json:"-"`
  1112. // NullFields is a list of field names (e.g. "Kind") to include in API
  1113. // requests with the JSON null value. By default, fields with empty
  1114. // values are omitted from API requests. However, any field with an
  1115. // empty value appearing in NullFields will be sent to the server as
  1116. // null. It is an error if a field in this list has a non-empty value.
  1117. // This may be used to include null fields in Patch requests.
  1118. NullFields []string `json:"-"`
  1119. }
  1120. func (s *ListingsListResponse) MarshalJSON() ([]byte, error) {
  1121. type NoMethod ListingsListResponse
  1122. raw := NoMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1124. }
  1125. type MonthDay struct {
  1126. // Day: Day of a month, value in [1, 31] range. Valid range depends on
  1127. // the specified month.
  1128. Day int64 `json:"day,omitempty"`
  1129. // Month: Month of a year. e.g. 1 = JAN, 2 = FEB etc.
  1130. Month int64 `json:"month,omitempty"`
  1131. // ForceSendFields is a list of field names (e.g. "Day") to
  1132. // unconditionally include in API requests. By default, fields with
  1133. // empty values are omitted from API requests. However, any non-pointer,
  1134. // non-interface field appearing in ForceSendFields will be sent to the
  1135. // server regardless of whether the field is empty or not. This may be
  1136. // used to include empty fields in Patch requests.
  1137. ForceSendFields []string `json:"-"`
  1138. // NullFields is a list of field names (e.g. "Day") to include in API
  1139. // requests with the JSON null value. By default, fields with empty
  1140. // values are omitted from API requests. However, any field with an
  1141. // empty value appearing in NullFields will be sent to the server as
  1142. // null. It is an error if a field in this list has a non-empty value.
  1143. // This may be used to include null fields in Patch requests.
  1144. NullFields []string `json:"-"`
  1145. }
  1146. func (s *MonthDay) MarshalJSON() ([]byte, error) {
  1147. type NoMethod MonthDay
  1148. raw := NoMethod(*s)
  1149. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1150. }
  1151. type PageInfo struct {
  1152. ResultPerPage int64 `json:"resultPerPage,omitempty"`
  1153. StartIndex int64 `json:"startIndex,omitempty"`
  1154. TotalResults int64 `json:"totalResults,omitempty"`
  1155. // ForceSendFields is a list of field names (e.g. "ResultPerPage") to
  1156. // unconditionally include in API requests. By default, fields with
  1157. // empty values are omitted from API requests. However, any non-pointer,
  1158. // non-interface field appearing in ForceSendFields will be sent to the
  1159. // server regardless of whether the field is empty or not. This may be
  1160. // used to include empty fields in Patch requests.
  1161. ForceSendFields []string `json:"-"`
  1162. // NullFields is a list of field names (e.g. "ResultPerPage") to include
  1163. // in API requests with the JSON null value. By default, fields with
  1164. // empty values are omitted from API requests. However, any field with
  1165. // an empty value appearing in NullFields will be sent to the server as
  1166. // null. It is an error if a field in this list has a non-empty value.
  1167. // This may be used to include null fields in Patch requests.
  1168. NullFields []string `json:"-"`
  1169. }
  1170. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  1171. type NoMethod PageInfo
  1172. raw := NoMethod(*s)
  1173. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1174. }
  1175. type Price struct {
  1176. // Currency: 3 letter Currency code, as defined by ISO 4217.
  1177. Currency string `json:"currency,omitempty"`
  1178. // PriceMicros: The price in millionths of the currency base unit
  1179. // represented as a string.
  1180. PriceMicros string `json:"priceMicros,omitempty"`
  1181. // ForceSendFields is a list of field names (e.g. "Currency") to
  1182. // unconditionally include in API requests. By default, fields with
  1183. // empty values are omitted from API requests. However, any non-pointer,
  1184. // non-interface field appearing in ForceSendFields will be sent to the
  1185. // server regardless of whether the field is empty or not. This may be
  1186. // used to include empty fields in Patch requests.
  1187. ForceSendFields []string `json:"-"`
  1188. // NullFields is a list of field names (e.g. "Currency") to include in
  1189. // API requests with the JSON null value. By default, fields with empty
  1190. // values are omitted from API requests. However, any field with an
  1191. // empty value appearing in NullFields will be sent to the server as
  1192. // null. It is an error if a field in this list has a non-empty value.
  1193. // This may be used to include null fields in Patch requests.
  1194. NullFields []string `json:"-"`
  1195. }
  1196. func (s *Price) MarshalJSON() ([]byte, error) {
  1197. type NoMethod Price
  1198. raw := NoMethod(*s)
  1199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1200. }
  1201. // ProductPurchase: A ProductPurchase resource indicates the status of a
  1202. // user's inapp product purchase.
  1203. type ProductPurchase struct {
  1204. // ConsumptionState: The consumption state of the inapp product.
  1205. // Possible values are:
  1206. // - Yet to be consumed
  1207. // - Consumed
  1208. ConsumptionState int64 `json:"consumptionState,omitempty"`
  1209. // DeveloperPayload: A developer-specified string that contains
  1210. // supplemental information about an order.
  1211. DeveloperPayload string `json:"developerPayload,omitempty"`
  1212. // Kind: This kind represents an inappPurchase object in the
  1213. // androidpublisher service.
  1214. Kind string `json:"kind,omitempty"`
  1215. // OrderId: The order id associated with the purchase of the inapp
  1216. // product.
  1217. OrderId string `json:"orderId,omitempty"`
  1218. // PurchaseState: The purchase state of the order. Possible values are:
  1219. //
  1220. // - Purchased
  1221. // - Canceled
  1222. PurchaseState int64 `json:"purchaseState,omitempty"`
  1223. // PurchaseTimeMillis: The time the product was purchased, in
  1224. // milliseconds since the epoch (Jan 1, 1970).
  1225. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1226. // PurchaseType: The type of purchase of the inapp product. This field
  1227. // is only set if this purchase was not made using the standard in-app
  1228. // billing flow. Possible values are:
  1229. // - Test (i.e. purchased from a license testing account)
  1230. // - Promo (i.e. purchased using a promo code)
  1231. PurchaseType int64 `json:"purchaseType,omitempty"`
  1232. // ServerResponse contains the HTTP response code and headers from the
  1233. // server.
  1234. googleapi.ServerResponse `json:"-"`
  1235. // ForceSendFields is a list of field names (e.g. "ConsumptionState") to
  1236. // unconditionally include in API requests. By default, fields with
  1237. // empty values are omitted from API requests. However, any non-pointer,
  1238. // non-interface field appearing in ForceSendFields will be sent to the
  1239. // server regardless of whether the field is empty or not. This may be
  1240. // used to include empty fields in Patch requests.
  1241. ForceSendFields []string `json:"-"`
  1242. // NullFields is a list of field names (e.g. "ConsumptionState") to
  1243. // include in API requests with the JSON null value. By default, fields
  1244. // with empty values are omitted from API requests. However, any field
  1245. // with an empty value appearing in NullFields will be sent to the
  1246. // server as null. It is an error if a field in this list has a
  1247. // non-empty value. This may be used to include null fields in Patch
  1248. // requests.
  1249. NullFields []string `json:"-"`
  1250. }
  1251. func (s *ProductPurchase) MarshalJSON() ([]byte, error) {
  1252. type NoMethod ProductPurchase
  1253. raw := NoMethod(*s)
  1254. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1255. }
  1256. type Prorate struct {
  1257. // DefaultPrice: Default price cannot be zero and must be less than the
  1258. // full subscription price. Default price is always in the developer's
  1259. // Checkout merchant currency. Targeted countries have their prices set
  1260. // automatically based on the default_price.
  1261. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  1262. // Start: Defines the first day on which the price takes effect.
  1263. Start *MonthDay `json:"start,omitempty"`
  1264. // ForceSendFields is a list of field names (e.g. "DefaultPrice") to
  1265. // unconditionally include in API requests. By default, fields with
  1266. // empty values are omitted from API requests. However, any non-pointer,
  1267. // non-interface field appearing in ForceSendFields will be sent to the
  1268. // server regardless of whether the field is empty or not. This may be
  1269. // used to include empty fields in Patch requests.
  1270. ForceSendFields []string `json:"-"`
  1271. // NullFields is a list of field names (e.g. "DefaultPrice") to include
  1272. // in API requests with the JSON null value. By default, fields with
  1273. // empty values are omitted from API requests. However, any field with
  1274. // an empty value appearing in NullFields will be sent to the server as
  1275. // null. It is an error if a field in this list has a non-empty value.
  1276. // This may be used to include null fields in Patch requests.
  1277. NullFields []string `json:"-"`
  1278. }
  1279. func (s *Prorate) MarshalJSON() ([]byte, error) {
  1280. type NoMethod Prorate
  1281. raw := NoMethod(*s)
  1282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1283. }
  1284. type Review struct {
  1285. // AuthorName: The name of the user who wrote the review.
  1286. AuthorName string `json:"authorName,omitempty"`
  1287. // Comments: A repeated field containing comments for the review.
  1288. Comments []*Comment `json:"comments,omitempty"`
  1289. // ReviewId: Unique identifier for this review.
  1290. ReviewId string `json:"reviewId,omitempty"`
  1291. // ServerResponse contains the HTTP response code and headers from the
  1292. // server.
  1293. googleapi.ServerResponse `json:"-"`
  1294. // ForceSendFields is a list of field names (e.g. "AuthorName") to
  1295. // unconditionally include in API requests. By default, fields with
  1296. // empty values are omitted from API requests. However, any non-pointer,
  1297. // non-interface field appearing in ForceSendFields will be sent to the
  1298. // server regardless of whether the field is empty or not. This may be
  1299. // used to include empty fields in Patch requests.
  1300. ForceSendFields []string `json:"-"`
  1301. // NullFields is a list of field names (e.g. "AuthorName") to include in
  1302. // API requests with the JSON null value. By default, fields with empty
  1303. // values are omitted from API requests. However, any field with an
  1304. // empty value appearing in NullFields will be sent to the server as
  1305. // null. It is an error if a field in this list has a non-empty value.
  1306. // This may be used to include null fields in Patch requests.
  1307. NullFields []string `json:"-"`
  1308. }
  1309. func (s *Review) MarshalJSON() ([]byte, error) {
  1310. type NoMethod Review
  1311. raw := NoMethod(*s)
  1312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1313. }
  1314. type ReviewReplyResult struct {
  1315. // LastEdited: The time at which the reply took effect.
  1316. LastEdited *Timestamp `json:"lastEdited,omitempty"`
  1317. // ReplyText: The reply text that was applied.
  1318. ReplyText string `json:"replyText,omitempty"`
  1319. // ForceSendFields is a list of field names (e.g. "LastEdited") to
  1320. // unconditionally include in API requests. By default, fields with
  1321. // empty values are omitted from API requests. However, any non-pointer,
  1322. // non-interface field appearing in ForceSendFields will be sent to the
  1323. // server regardless of whether the field is empty or not. This may be
  1324. // used to include empty fields in Patch requests.
  1325. ForceSendFields []string `json:"-"`
  1326. // NullFields is a list of field names (e.g. "LastEdited") to include in
  1327. // API requests with the JSON null value. By default, fields with empty
  1328. // values are omitted from API requests. However, any field with an
  1329. // empty value appearing in NullFields will be sent to the server as
  1330. // null. It is an error if a field in this list has a non-empty value.
  1331. // This may be used to include null fields in Patch requests.
  1332. NullFields []string `json:"-"`
  1333. }
  1334. func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) {
  1335. type NoMethod ReviewReplyResult
  1336. raw := NoMethod(*s)
  1337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1338. }
  1339. type ReviewsListResponse struct {
  1340. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1341. Reviews []*Review `json:"reviews,omitempty"`
  1342. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1343. // ServerResponse contains the HTTP response code and headers from the
  1344. // server.
  1345. googleapi.ServerResponse `json:"-"`
  1346. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  1347. // unconditionally include in API requests. By default, fields with
  1348. // empty values are omitted from API requests. However, any non-pointer,
  1349. // non-interface field appearing in ForceSendFields will be sent to the
  1350. // server regardless of whether the field is empty or not. This may be
  1351. // used to include empty fields in Patch requests.
  1352. ForceSendFields []string `json:"-"`
  1353. // NullFields is a list of field names (e.g. "PageInfo") to include in
  1354. // API requests with the JSON null value. By default, fields with empty
  1355. // values are omitted from API requests. However, any field with an
  1356. // empty value appearing in NullFields will be sent to the server as
  1357. // null. It is an error if a field in this list has a non-empty value.
  1358. // This may be used to include null fields in Patch requests.
  1359. NullFields []string `json:"-"`
  1360. }
  1361. func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) {
  1362. type NoMethod ReviewsListResponse
  1363. raw := NoMethod(*s)
  1364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1365. }
  1366. type ReviewsReplyRequest struct {
  1367. // ReplyText: The text to set as the reply. Replies of more than
  1368. // approximately 350 characters will be rejected. HTML tags will be
  1369. // stripped.
  1370. ReplyText string `json:"replyText,omitempty"`
  1371. // ForceSendFields is a list of field names (e.g. "ReplyText") to
  1372. // unconditionally include in API requests. By default, fields with
  1373. // empty values are omitted from API requests. However, any non-pointer,
  1374. // non-interface field appearing in ForceSendFields will be sent to the
  1375. // server regardless of whether the field is empty or not. This may be
  1376. // used to include empty fields in Patch requests.
  1377. ForceSendFields []string `json:"-"`
  1378. // NullFields is a list of field names (e.g. "ReplyText") to include in
  1379. // API requests with the JSON null value. By default, fields with empty
  1380. // values are omitted from API requests. However, any field with an
  1381. // empty value appearing in NullFields will be sent to the server as
  1382. // null. It is an error if a field in this list has a non-empty value.
  1383. // This may be used to include null fields in Patch requests.
  1384. NullFields []string `json:"-"`
  1385. }
  1386. func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) {
  1387. type NoMethod ReviewsReplyRequest
  1388. raw := NoMethod(*s)
  1389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1390. }
  1391. type ReviewsReplyResponse struct {
  1392. Result *ReviewReplyResult `json:"result,omitempty"`
  1393. // ServerResponse contains the HTTP response code and headers from the
  1394. // server.
  1395. googleapi.ServerResponse `json:"-"`
  1396. // ForceSendFields is a list of field names (e.g. "Result") to
  1397. // unconditionally include in API requests. By default, fields with
  1398. // empty values are omitted from API requests. However, any non-pointer,
  1399. // non-interface field appearing in ForceSendFields will be sent to the
  1400. // server regardless of whether the field is empty or not. This may be
  1401. // used to include empty fields in Patch requests.
  1402. ForceSendFields []string `json:"-"`
  1403. // NullFields is a list of field names (e.g. "Result") to include in API
  1404. // requests with the JSON null value. By default, fields with empty
  1405. // values are omitted from API requests. However, any field with an
  1406. // empty value appearing in NullFields will be sent to the server as
  1407. // null. It is an error if a field in this list has a non-empty value.
  1408. // This may be used to include null fields in Patch requests.
  1409. NullFields []string `json:"-"`
  1410. }
  1411. func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) {
  1412. type NoMethod ReviewsReplyResponse
  1413. raw := NoMethod(*s)
  1414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1415. }
  1416. type Season struct {
  1417. // End: Inclusive end date of the recurrence period.
  1418. End *MonthDay `json:"end,omitempty"`
  1419. // Prorations: Optionally present list of prorations for the season.
  1420. // Each proration is a one-off discounted entry into a subscription.
  1421. // Each proration contains the first date on which the discount is
  1422. // available and the new pricing information.
  1423. Prorations []*Prorate `json:"prorations,omitempty"`
  1424. // Start: Inclusive start date of the recurrence period.
  1425. Start *MonthDay `json:"start,omitempty"`
  1426. // ForceSendFields is a list of field names (e.g. "End") to
  1427. // unconditionally include in API requests. By default, fields with
  1428. // empty values are omitted from API requests. However, any non-pointer,
  1429. // non-interface field appearing in ForceSendFields will be sent to the
  1430. // server regardless of whether the field is empty or not. This may be
  1431. // used to include empty fields in Patch requests.
  1432. ForceSendFields []string `json:"-"`
  1433. // NullFields is a list of field names (e.g. "End") to include in API
  1434. // requests with the JSON null value. By default, fields with empty
  1435. // values are omitted from API requests. However, any field with an
  1436. // empty value appearing in NullFields will be sent to the server as
  1437. // null. It is an error if a field in this list has a non-empty value.
  1438. // This may be used to include null fields in Patch requests.
  1439. NullFields []string `json:"-"`
  1440. }
  1441. func (s *Season) MarshalJSON() ([]byte, error) {
  1442. type NoMethod Season
  1443. raw := NoMethod(*s)
  1444. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1445. }
  1446. // SubscriptionCancelSurveyResult: Information provided by the user when
  1447. // they complete the subscription cancellation flow (cancellation reason
  1448. // survey).
  1449. type SubscriptionCancelSurveyResult struct {
  1450. // CancelSurveyReason: The cancellation reason the user chose in the
  1451. // survey. Possible values are:
  1452. // - Other
  1453. // - I don't use this service enough
  1454. // - Technical issues
  1455. // - Cost-related reasons
  1456. // - I found a better app
  1457. CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"`
  1458. // UserInputCancelReason: The customized input cancel reason from the
  1459. // user. Only present when cancelReason is 0.
  1460. UserInputCancelReason string `json:"userInputCancelReason,omitempty"`
  1461. // ForceSendFields is a list of field names (e.g. "CancelSurveyReason")
  1462. // to unconditionally include in API requests. By default, fields with
  1463. // empty values are omitted from API requests. However, any non-pointer,
  1464. // non-interface field appearing in ForceSendFields will be sent to the
  1465. // server regardless of whether the field is empty or not. This may be
  1466. // used to include empty fields in Patch requests.
  1467. ForceSendFields []string `json:"-"`
  1468. // NullFields is a list of field names (e.g. "CancelSurveyReason") to
  1469. // include in API requests with the JSON null value. By default, fields
  1470. // with empty values are omitted from API requests. However, any field
  1471. // with an empty value appearing in NullFields will be sent to the
  1472. // server as null. It is an error if a field in this list has a
  1473. // non-empty value. This may be used to include null fields in Patch
  1474. // requests.
  1475. NullFields []string `json:"-"`
  1476. }
  1477. func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) {
  1478. type NoMethod SubscriptionCancelSurveyResult
  1479. raw := NoMethod(*s)
  1480. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1481. }
  1482. // SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the
  1483. // data needed to defer a subscription purchase to a future expiry time.
  1484. type SubscriptionDeferralInfo struct {
  1485. // DesiredExpiryTimeMillis: The desired next expiry time to assign to
  1486. // the subscription, in milliseconds since the Epoch. The given time
  1487. // must be later/greater than the current expiry time for the
  1488. // subscription.
  1489. DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"`
  1490. // ExpectedExpiryTimeMillis: The expected expiry time for the
  1491. // subscription. If the current expiry time for the subscription is not
  1492. // the value specified here, the deferral will not occur.
  1493. ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"`
  1494. // ForceSendFields is a list of field names (e.g.
  1495. // "DesiredExpiryTimeMillis") to unconditionally include in API
  1496. // requests. By default, fields with empty values are omitted from API
  1497. // requests. However, any non-pointer, non-interface field appearing in
  1498. // ForceSendFields will be sent to the server regardless of whether the
  1499. // field is empty or not. This may be used to include empty fields in
  1500. // Patch requests.
  1501. ForceSendFields []string `json:"-"`
  1502. // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis")
  1503. // to include in API requests with the JSON null value. By default,
  1504. // fields with empty values are omitted from API requests. However, any
  1505. // field with an empty value appearing in NullFields will be sent to the
  1506. // server as null. It is an error if a field in this list has a
  1507. // non-empty value. This may be used to include null fields in Patch
  1508. // requests.
  1509. NullFields []string `json:"-"`
  1510. }
  1511. func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) {
  1512. type NoMethod SubscriptionDeferralInfo
  1513. raw := NoMethod(*s)
  1514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1515. }
  1516. // SubscriptionPurchase: A SubscriptionPurchase resource indicates the
  1517. // status of a user's subscription purchase.
  1518. type SubscriptionPurchase struct {
  1519. // AutoRenewing: Whether the subscription will automatically be renewed
  1520. // when it reaches its current expiry time.
  1521. AutoRenewing bool `json:"autoRenewing,omitempty"`
  1522. // CancelReason: The reason why a subscription was canceled or is not
  1523. // auto-renewing. Possible values are:
  1524. // - User canceled the subscription
  1525. // - Subscription was canceled by the system, for example because of a
  1526. // billing problem
  1527. // - Subscription was replaced with a new subscription
  1528. // - Subscription was canceled by the developer
  1529. CancelReason *int64 `json:"cancelReason,omitempty"`
  1530. // CancelSurveyResult: Information provided by the user when they
  1531. // complete the subscription cancellation flow (cancellation reason
  1532. // survey).
  1533. CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"`
  1534. // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the
  1535. // user at the time the subscription was granted.
  1536. CountryCode string `json:"countryCode,omitempty"`
  1537. // DeveloperPayload: A developer-specified string that contains
  1538. // supplemental information about an order.
  1539. DeveloperPayload string `json:"developerPayload,omitempty"`
  1540. // EmailAddress: The email address of the user when the subscription was
  1541. // purchased. Only present for purchases made with 'Subscribe with
  1542. // Google'.
  1543. EmailAddress string `json:"emailAddress,omitempty"`
  1544. // ExpiryTimeMillis: Time at which the subscription will expire, in
  1545. // milliseconds since the Epoch.
  1546. ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"`
  1547. // FamilyName: The family name of the user when the subscription was
  1548. // purchased. Only present for purchases made with 'Subscribe with
  1549. // Google'.
  1550. FamilyName string `json:"familyName,omitempty"`
  1551. // GivenName: The given name of the user when the subscription was
  1552. // purchased. Only present for purchases made with 'Subscribe with
  1553. // Google'.
  1554. GivenName string `json:"givenName,omitempty"`
  1555. // Kind: This kind represents a subscriptionPurchase object in the
  1556. // androidpublisher service.
  1557. Kind string `json:"kind,omitempty"`
  1558. // LinkedPurchaseToken: The purchase token of the originating purchase
  1559. // if this subscription is one of the following:
  1560. // - Re-signup of a canceled but non-lapsed subscription
  1561. // - Upgrade/downgrade from a previous subscription For example,
  1562. // suppose a user originally signs up and you receive purchase token X,
  1563. // then the user cancels and goes through the resignup flow (before
  1564. // their subscription lapses) and you receive purchase token Y, and
  1565. // finally the user upgrades their subscription and you receive purchase
  1566. // token Z. If you call this API with purchase token Z, this field will
  1567. // be set to Y. If you call this API with purchase token Y, this field
  1568. // will be set to X. If you call this API with purchase token X, this
  1569. // field will not be set.
  1570. LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"`
  1571. // OrderId: The order id of the latest recurring order associated with
  1572. // the purchase of the subscription.
  1573. OrderId string `json:"orderId,omitempty"`
  1574. // PaymentState: The payment state of the subscription. Possible values
  1575. // are:
  1576. // - Payment pending
  1577. // - Payment received
  1578. // - Free trial
  1579. PaymentState *int64 `json:"paymentState,omitempty"`
  1580. // PriceAmountMicros: Price of the subscription, not including tax.
  1581. // Price is expressed in micro-units, where 1,000,000 micro-units
  1582. // represents one unit of the currency. For example, if the subscription
  1583. // price is €1.99, price_amount_micros is 1990000.
  1584. PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"`
  1585. // PriceCurrencyCode: ISO 4217 currency code for the subscription price.
  1586. // For example, if the price is specified in British pounds sterling,
  1587. // price_currency_code is "GBP".
  1588. PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"`
  1589. // ProfileId: The profile id of the user when the subscription was
  1590. // purchased. Only present for purchases made with 'Subscribe with
  1591. // Google'.
  1592. ProfileId string `json:"profileId,omitempty"`
  1593. // ProfileName: The profile name of the user when the subscription was
  1594. // purchased. Only present for purchases made with 'Subscribe with
  1595. // Google'.
  1596. ProfileName string `json:"profileName,omitempty"`
  1597. // PurchaseType: The type of purchase of the subscription. This field is
  1598. // only set if this purchase was not made using the standard in-app
  1599. // billing flow. Possible values are:
  1600. // - Test (i.e. purchased from a license testing account)
  1601. PurchaseType int64 `json:"purchaseType,omitempty"`
  1602. // StartTimeMillis: Time at which the subscription was granted, in
  1603. // milliseconds since the Epoch.
  1604. StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"`
  1605. // UserCancellationTimeMillis: The time at which the subscription was
  1606. // canceled by the user, in milliseconds since the epoch. Only present
  1607. // if cancelReason is 0.
  1608. UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"`
  1609. // ServerResponse contains the HTTP response code and headers from the
  1610. // server.
  1611. googleapi.ServerResponse `json:"-"`
  1612. // ForceSendFields is a list of field names (e.g. "AutoRenewing") to
  1613. // unconditionally include in API requests. By default, fields with
  1614. // empty values are omitted from API requests. However, any non-pointer,
  1615. // non-interface field appearing in ForceSendFields will be sent to the
  1616. // server regardless of whether the field is empty or not. This may be
  1617. // used to include empty fields in Patch requests.
  1618. ForceSendFields []string `json:"-"`
  1619. // NullFields is a list of field names (e.g. "AutoRenewing") to include
  1620. // in API requests with the JSON null value. By default, fields with
  1621. // empty values are omitted from API requests. However, any field with
  1622. // an empty value appearing in NullFields will be sent to the server as
  1623. // null. It is an error if a field in this list has a non-empty value.
  1624. // This may be used to include null fields in Patch requests.
  1625. NullFields []string `json:"-"`
  1626. }
  1627. func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) {
  1628. type NoMethod SubscriptionPurchase
  1629. raw := NoMethod(*s)
  1630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1631. }
  1632. type SubscriptionPurchasesDeferRequest struct {
  1633. // DeferralInfo: The information about the new desired expiry time for
  1634. // the subscription.
  1635. DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"`
  1636. // ForceSendFields is a list of field names (e.g. "DeferralInfo") to
  1637. // unconditionally include in API requests. By default, fields with
  1638. // empty values are omitted from API requests. However, any non-pointer,
  1639. // non-interface field appearing in ForceSendFields will be sent to the
  1640. // server regardless of whether the field is empty or not. This may be
  1641. // used to include empty fields in Patch requests.
  1642. ForceSendFields []string `json:"-"`
  1643. // NullFields is a list of field names (e.g. "DeferralInfo") to include
  1644. // in API requests with the JSON null value. By default, fields with
  1645. // empty values are omitted from API requests. However, any field with
  1646. // an empty value appearing in NullFields will be sent to the server as
  1647. // null. It is an error if a field in this list has a non-empty value.
  1648. // This may be used to include null fields in Patch requests.
  1649. NullFields []string `json:"-"`
  1650. }
  1651. func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) {
  1652. type NoMethod SubscriptionPurchasesDeferRequest
  1653. raw := NoMethod(*s)
  1654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1655. }
  1656. type SubscriptionPurchasesDeferResponse struct {
  1657. // NewExpiryTimeMillis: The new expiry time for the subscription in
  1658. // milliseconds since the Epoch.
  1659. NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"`
  1660. // ServerResponse contains the HTTP response code and headers from the
  1661. // server.
  1662. googleapi.ServerResponse `json:"-"`
  1663. // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis")
  1664. // to unconditionally include in API requests. By default, fields with
  1665. // empty values are omitted from API requests. However, any non-pointer,
  1666. // non-interface field appearing in ForceSendFields will be sent to the
  1667. // server regardless of whether the field is empty or not. This may be
  1668. // used to include empty fields in Patch requests.
  1669. ForceSendFields []string `json:"-"`
  1670. // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to
  1671. // include in API requests with the JSON null value. By default, fields
  1672. // with empty values are omitted from API requests. However, any field
  1673. // with an empty value appearing in NullFields will be sent to the
  1674. // server as null. It is an error if a field in this list has a
  1675. // non-empty value. This may be used to include null fields in Patch
  1676. // requests.
  1677. NullFields []string `json:"-"`
  1678. }
  1679. func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) {
  1680. type NoMethod SubscriptionPurchasesDeferResponse
  1681. raw := NoMethod(*s)
  1682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1683. }
  1684. type Testers struct {
  1685. GoogleGroups []string `json:"googleGroups,omitempty"`
  1686. GooglePlusCommunities []string `json:"googlePlusCommunities,omitempty"`
  1687. // ServerResponse contains the HTTP response code and headers from the
  1688. // server.
  1689. googleapi.ServerResponse `json:"-"`
  1690. // ForceSendFields is a list of field names (e.g. "GoogleGroups") to
  1691. // unconditionally include in API requests. By default, fields with
  1692. // empty values are omitted from API requests. However, any non-pointer,
  1693. // non-interface field appearing in ForceSendFields will be sent to the
  1694. // server regardless of whether the field is empty or not. This may be
  1695. // used to include empty fields in Patch requests.
  1696. ForceSendFields []string `json:"-"`
  1697. // NullFields is a list of field names (e.g. "GoogleGroups") to include
  1698. // in API requests with the JSON null value. By default, fields with
  1699. // empty values are omitted from API requests. However, any field with
  1700. // an empty value appearing in NullFields will be sent to the server as
  1701. // null. It is an error if a field in this list has a non-empty value.
  1702. // This may be used to include null fields in Patch requests.
  1703. NullFields []string `json:"-"`
  1704. }
  1705. func (s *Testers) MarshalJSON() ([]byte, error) {
  1706. type NoMethod Testers
  1707. raw := NoMethod(*s)
  1708. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1709. }
  1710. type Timestamp struct {
  1711. Nanos int64 `json:"nanos,omitempty"`
  1712. Seconds int64 `json:"seconds,omitempty,string"`
  1713. // ForceSendFields is a list of field names (e.g. "Nanos") to
  1714. // unconditionally include in API requests. By default, fields with
  1715. // empty values are omitted from API requests. However, any non-pointer,
  1716. // non-interface field appearing in ForceSendFields will be sent to the
  1717. // server regardless of whether the field is empty or not. This may be
  1718. // used to include empty fields in Patch requests.
  1719. ForceSendFields []string `json:"-"`
  1720. // NullFields is a list of field names (e.g. "Nanos") to include in API
  1721. // requests with the JSON null value. By default, fields with empty
  1722. // values are omitted from API requests. However, any field with an
  1723. // empty value appearing in NullFields will be sent to the server as
  1724. // null. It is an error if a field in this list has a non-empty value.
  1725. // This may be used to include null fields in Patch requests.
  1726. NullFields []string `json:"-"`
  1727. }
  1728. func (s *Timestamp) MarshalJSON() ([]byte, error) {
  1729. type NoMethod Timestamp
  1730. raw := NoMethod(*s)
  1731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1732. }
  1733. type TokenPagination struct {
  1734. NextPageToken string `json:"nextPageToken,omitempty"`
  1735. PreviousPageToken string `json:"previousPageToken,omitempty"`
  1736. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1737. // unconditionally include in API requests. By default, fields with
  1738. // empty values are omitted from API requests. However, any non-pointer,
  1739. // non-interface field appearing in ForceSendFields will be sent to the
  1740. // server regardless of whether the field is empty or not. This may be
  1741. // used to include empty fields in Patch requests.
  1742. ForceSendFields []string `json:"-"`
  1743. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1744. // in API requests with the JSON null value. By default, fields with
  1745. // empty values are omitted from API requests. However, any field with
  1746. // an empty value appearing in NullFields will be sent to the server as
  1747. // null. It is an error if a field in this list has a non-empty value.
  1748. // This may be used to include null fields in Patch requests.
  1749. NullFields []string `json:"-"`
  1750. }
  1751. func (s *TokenPagination) MarshalJSON() ([]byte, error) {
  1752. type NoMethod TokenPagination
  1753. raw := NoMethod(*s)
  1754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1755. }
  1756. type Track struct {
  1757. // Track: Identifier for this track.
  1758. Track string `json:"track,omitempty"`
  1759. UserFraction float64 `json:"userFraction,omitempty"`
  1760. // VersionCodes: Version codes to make active on this track. Note that
  1761. // this list should contain all versions you wish to be active,
  1762. // including those you wish to retain from previous releases.
  1763. VersionCodes []int64 `json:"versionCodes,omitempty"`
  1764. // ServerResponse contains the HTTP response code and headers from the
  1765. // server.
  1766. googleapi.ServerResponse `json:"-"`
  1767. // ForceSendFields is a list of field names (e.g. "Track") to
  1768. // unconditionally include in API requests. By default, fields with
  1769. // empty values are omitted from API requests. However, any non-pointer,
  1770. // non-interface field appearing in ForceSendFields will be sent to the
  1771. // server regardless of whether the field is empty or not. This may be
  1772. // used to include empty fields in Patch requests.
  1773. ForceSendFields []string `json:"-"`
  1774. // NullFields is a list of field names (e.g. "Track") to include in API
  1775. // requests with the JSON null value. By default, fields with empty
  1776. // values are omitted from API requests. However, any field with an
  1777. // empty value appearing in NullFields will be sent to the server as
  1778. // null. It is an error if a field in this list has a non-empty value.
  1779. // This may be used to include null fields in Patch requests.
  1780. NullFields []string `json:"-"`
  1781. }
  1782. func (s *Track) MarshalJSON() ([]byte, error) {
  1783. type NoMethod Track
  1784. raw := NoMethod(*s)
  1785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1786. }
  1787. func (s *Track) UnmarshalJSON(data []byte) error {
  1788. type NoMethod Track
  1789. var s1 struct {
  1790. UserFraction gensupport.JSONFloat64 `json:"userFraction"`
  1791. *NoMethod
  1792. }
  1793. s1.NoMethod = (*NoMethod)(s)
  1794. if err := json.Unmarshal(data, &s1); err != nil {
  1795. return err
  1796. }
  1797. s.UserFraction = float64(s1.UserFraction)
  1798. return nil
  1799. }
  1800. type TracksListResponse struct {
  1801. // Kind: Identifies what kind of resource this is. Value: the fixed
  1802. // string "androidpublisher#tracksListResponse".
  1803. Kind string `json:"kind,omitempty"`
  1804. Tracks []*Track `json:"tracks,omitempty"`
  1805. // ServerResponse contains the HTTP response code and headers from the
  1806. // server.
  1807. googleapi.ServerResponse `json:"-"`
  1808. // ForceSendFields is a list of field names (e.g. "Kind") to
  1809. // unconditionally include in API requests. By default, fields with
  1810. // empty values are omitted from API requests. However, any non-pointer,
  1811. // non-interface field appearing in ForceSendFields will be sent to the
  1812. // server regardless of whether the field is empty or not. This may be
  1813. // used to include empty fields in Patch requests.
  1814. ForceSendFields []string `json:"-"`
  1815. // NullFields is a list of field names (e.g. "Kind") to include in API
  1816. // requests with the JSON null value. By default, fields with empty
  1817. // values are omitted from API requests. However, any field with an
  1818. // empty value appearing in NullFields will be sent to the server as
  1819. // null. It is an error if a field in this list has a non-empty value.
  1820. // This may be used to include null fields in Patch requests.
  1821. NullFields []string `json:"-"`
  1822. }
  1823. func (s *TracksListResponse) MarshalJSON() ([]byte, error) {
  1824. type NoMethod TracksListResponse
  1825. raw := NoMethod(*s)
  1826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1827. }
  1828. type UserComment struct {
  1829. // AndroidOsVersion: Integer Android SDK version of the user's device at
  1830. // the time the review was written, e.g. 23 is Marshmallow. May be
  1831. // absent.
  1832. AndroidOsVersion int64 `json:"androidOsVersion,omitempty"`
  1833. // AppVersionCode: Integer version code of the app as installed at the
  1834. // time the review was written. May be absent.
  1835. AppVersionCode int64 `json:"appVersionCode,omitempty"`
  1836. // AppVersionName: String version name of the app as installed at the
  1837. // time the review was written. May be absent.
  1838. AppVersionName string `json:"appVersionName,omitempty"`
  1839. // Device: Codename for the reviewer's device, e.g. klte, flounder. May
  1840. // be absent.
  1841. Device string `json:"device,omitempty"`
  1842. // DeviceMetadata: Some information about the characteristics of the
  1843. // user's device
  1844. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1845. // LastModified: The last time at which this comment was updated.
  1846. LastModified *Timestamp `json:"lastModified,omitempty"`
  1847. // OriginalText: Untranslated text of the review, in the case where the
  1848. // review has been translated. If the review has not been translated
  1849. // this is left blank.
  1850. OriginalText string `json:"originalText,omitempty"`
  1851. // ReviewerLanguage: Language code for the reviewer. This is taken from
  1852. // the device settings so is not guaranteed to match the language the
  1853. // review is written in. May be absent.
  1854. ReviewerLanguage string `json:"reviewerLanguage,omitempty"`
  1855. // StarRating: The star rating associated with the review, from 1 to 5.
  1856. StarRating int64 `json:"starRating,omitempty"`
  1857. // Text: The content of the comment, i.e. review body. In some cases
  1858. // users have been able to write a review with separate title and body;
  1859. // in those cases the title and body are concatenated and separated by a
  1860. // tab character.
  1861. Text string `json:"text,omitempty"`
  1862. // ThumbsDownCount: Number of users who have given this review a thumbs
  1863. // down
  1864. ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"`
  1865. // ThumbsUpCount: Number of users who have given this review a thumbs up
  1866. ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"`
  1867. // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") 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. "AndroidOsVersion") to
  1875. // include in API requests with the JSON null value. By default, fields
  1876. // with empty values are omitted from API requests. However, any field
  1877. // with an empty value appearing in NullFields will be sent to the
  1878. // server as null. It is an error if a field in this list has a
  1879. // non-empty value. This may be used to include null fields in Patch
  1880. // requests.
  1881. NullFields []string `json:"-"`
  1882. }
  1883. func (s *UserComment) MarshalJSON() ([]byte, error) {
  1884. type NoMethod UserComment
  1885. raw := NoMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1887. }
  1888. // VoidedPurchase: A VoidedPurchase resource indicates a purchase that
  1889. // was either canceled/refunded/charged-back.
  1890. type VoidedPurchase struct {
  1891. // Kind: This kind represents a voided purchase object in the
  1892. // androidpublisher service.
  1893. Kind string `json:"kind,omitempty"`
  1894. // PurchaseTimeMillis: The time at which the purchase was made, in
  1895. // milliseconds since the epoch (Jan 1, 1970).
  1896. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1897. // PurchaseToken: The token that was generated when a purchase was made.
  1898. // This uniquely identifies a purchase.
  1899. PurchaseToken string `json:"purchaseToken,omitempty"`
  1900. // VoidedTimeMillis: The time at which the purchase was
  1901. // canceled/refunded/charged-back, in milliseconds since the epoch (Jan
  1902. // 1, 1970).
  1903. VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"`
  1904. // ForceSendFields is a list of field names (e.g. "Kind") to
  1905. // unconditionally include in API requests. By default, fields with
  1906. // empty values are omitted from API requests. However, any non-pointer,
  1907. // non-interface field appearing in ForceSendFields will be sent to the
  1908. // server regardless of whether the field is empty or not. This may be
  1909. // used to include empty fields in Patch requests.
  1910. ForceSendFields []string `json:"-"`
  1911. // NullFields is a list of field names (e.g. "Kind") to include in API
  1912. // requests with the JSON null value. By default, fields with empty
  1913. // values are omitted from API requests. However, any field with an
  1914. // empty value appearing in NullFields will be sent to the server as
  1915. // null. It is an error if a field in this list has a non-empty value.
  1916. // This may be used to include null fields in Patch requests.
  1917. NullFields []string `json:"-"`
  1918. }
  1919. func (s *VoidedPurchase) MarshalJSON() ([]byte, error) {
  1920. type NoMethod VoidedPurchase
  1921. raw := NoMethod(*s)
  1922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1923. }
  1924. type VoidedPurchasesListResponse struct {
  1925. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1926. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1927. VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"`
  1928. // ServerResponse contains the HTTP response code and headers from the
  1929. // server.
  1930. googleapi.ServerResponse `json:"-"`
  1931. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  1932. // unconditionally include in API requests. By default, fields with
  1933. // empty values are omitted from API requests. However, any non-pointer,
  1934. // non-interface field appearing in ForceSendFields will be sent to the
  1935. // server regardless of whether the field is empty or not. This may be
  1936. // used to include empty fields in Patch requests.
  1937. ForceSendFields []string `json:"-"`
  1938. // NullFields is a list of field names (e.g. "PageInfo") to include in
  1939. // API requests with the JSON null value. By default, fields with empty
  1940. // values are omitted from API requests. However, any field with an
  1941. // empty value appearing in NullFields will be sent to the server as
  1942. // null. It is an error if a field in this list has a non-empty value.
  1943. // This may be used to include null fields in Patch requests.
  1944. NullFields []string `json:"-"`
  1945. }
  1946. func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) {
  1947. type NoMethod VoidedPurchasesListResponse
  1948. raw := NoMethod(*s)
  1949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1950. }
  1951. // method id "androidpublisher.edits.commit":
  1952. type EditsCommitCall struct {
  1953. s *Service
  1954. packageNameid string
  1955. editId string
  1956. urlParams_ gensupport.URLParams
  1957. ctx_ context.Context
  1958. header_ http.Header
  1959. }
  1960. // Commit: Commits/applies the changes made in this edit back to the
  1961. // app.
  1962. func (r *EditsService) Commit(packageNameid string, editId string) *EditsCommitCall {
  1963. c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1964. c.packageNameid = packageNameid
  1965. c.editId = editId
  1966. return c
  1967. }
  1968. // Fields allows partial responses to be retrieved. See
  1969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1970. // for more information.
  1971. func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall {
  1972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1973. return c
  1974. }
  1975. // Context sets the context to be used in this call's Do method. Any
  1976. // pending HTTP request will be aborted if the provided context is
  1977. // canceled.
  1978. func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall {
  1979. c.ctx_ = ctx
  1980. return c
  1981. }
  1982. // Header returns an http.Header that can be modified by the caller to
  1983. // add HTTP headers to the request.
  1984. func (c *EditsCommitCall) Header() http.Header {
  1985. if c.header_ == nil {
  1986. c.header_ = make(http.Header)
  1987. }
  1988. return c.header_
  1989. }
  1990. func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) {
  1991. reqHeaders := make(http.Header)
  1992. for k, v := range c.header_ {
  1993. reqHeaders[k] = v
  1994. }
  1995. reqHeaders.Set("User-Agent", c.s.userAgent())
  1996. var body io.Reader = nil
  1997. c.urlParams_.Set("alt", alt)
  1998. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:commit")
  1999. urls += "?" + c.urlParams_.Encode()
  2000. req, _ := http.NewRequest("POST", urls, body)
  2001. req.Header = reqHeaders
  2002. googleapi.Expand(req.URL, map[string]string{
  2003. "packageName": c.packageNameid,
  2004. "editId": c.editId,
  2005. })
  2006. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2007. }
  2008. // Do executes the "androidpublisher.edits.commit" call.
  2009. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2010. // code is an error. Response headers are in either
  2011. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2012. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2013. // check whether the returned error was because http.StatusNotModified
  2014. // was returned.
  2015. func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2016. gensupport.SetOptions(c.urlParams_, opts...)
  2017. res, err := c.doRequest("json")
  2018. if res != nil && res.StatusCode == http.StatusNotModified {
  2019. if res.Body != nil {
  2020. res.Body.Close()
  2021. }
  2022. return nil, &googleapi.Error{
  2023. Code: res.StatusCode,
  2024. Header: res.Header,
  2025. }
  2026. }
  2027. if err != nil {
  2028. return nil, err
  2029. }
  2030. defer googleapi.CloseBody(res)
  2031. if err := googleapi.CheckResponse(res); err != nil {
  2032. return nil, err
  2033. }
  2034. ret := &AppEdit{
  2035. ServerResponse: googleapi.ServerResponse{
  2036. Header: res.Header,
  2037. HTTPStatusCode: res.StatusCode,
  2038. },
  2039. }
  2040. target := &ret
  2041. if err := gensupport.DecodeResponse(target, res); err != nil {
  2042. return nil, err
  2043. }
  2044. return ret, nil
  2045. // {
  2046. // "description": "Commits/applies the changes made in this edit back to the app.",
  2047. // "httpMethod": "POST",
  2048. // "id": "androidpublisher.edits.commit",
  2049. // "parameterOrder": [
  2050. // "packageName",
  2051. // "editId"
  2052. // ],
  2053. // "parameters": {
  2054. // "editId": {
  2055. // "description": "Unique identifier for this edit.",
  2056. // "location": "path",
  2057. // "required": true,
  2058. // "type": "string"
  2059. // },
  2060. // "packageName": {
  2061. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2062. // "location": "path",
  2063. // "required": true,
  2064. // "type": "string"
  2065. // }
  2066. // },
  2067. // "path": "{packageName}/edits/{editId}:commit",
  2068. // "response": {
  2069. // "$ref": "AppEdit"
  2070. // },
  2071. // "scopes": [
  2072. // "https://www.googleapis.com/auth/androidpublisher"
  2073. // ]
  2074. // }
  2075. }
  2076. // method id "androidpublisher.edits.delete":
  2077. type EditsDeleteCall struct {
  2078. s *Service
  2079. packageNameid string
  2080. editId string
  2081. urlParams_ gensupport.URLParams
  2082. ctx_ context.Context
  2083. header_ http.Header
  2084. }
  2085. // Delete: Deletes an edit for an app. Creating a new edit will
  2086. // automatically delete any of your previous edits so this method need
  2087. // only be called if you want to preemptively abandon an edit.
  2088. func (r *EditsService) Delete(packageNameid string, editId string) *EditsDeleteCall {
  2089. c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2090. c.packageNameid = packageNameid
  2091. c.editId = editId
  2092. return c
  2093. }
  2094. // Fields allows partial responses to be retrieved. See
  2095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2096. // for more information.
  2097. func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall {
  2098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2099. return c
  2100. }
  2101. // Context sets the context to be used in this call's Do method. Any
  2102. // pending HTTP request will be aborted if the provided context is
  2103. // canceled.
  2104. func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall {
  2105. c.ctx_ = ctx
  2106. return c
  2107. }
  2108. // Header returns an http.Header that can be modified by the caller to
  2109. // add HTTP headers to the request.
  2110. func (c *EditsDeleteCall) Header() http.Header {
  2111. if c.header_ == nil {
  2112. c.header_ = make(http.Header)
  2113. }
  2114. return c.header_
  2115. }
  2116. func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2117. reqHeaders := make(http.Header)
  2118. for k, v := range c.header_ {
  2119. reqHeaders[k] = v
  2120. }
  2121. reqHeaders.Set("User-Agent", c.s.userAgent())
  2122. var body io.Reader = nil
  2123. c.urlParams_.Set("alt", alt)
  2124. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2125. urls += "?" + c.urlParams_.Encode()
  2126. req, _ := http.NewRequest("DELETE", urls, body)
  2127. req.Header = reqHeaders
  2128. googleapi.Expand(req.URL, map[string]string{
  2129. "packageName": c.packageNameid,
  2130. "editId": c.editId,
  2131. })
  2132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2133. }
  2134. // Do executes the "androidpublisher.edits.delete" call.
  2135. func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2136. gensupport.SetOptions(c.urlParams_, opts...)
  2137. res, err := c.doRequest("json")
  2138. if err != nil {
  2139. return err
  2140. }
  2141. defer googleapi.CloseBody(res)
  2142. if err := googleapi.CheckResponse(res); err != nil {
  2143. return err
  2144. }
  2145. return nil
  2146. // {
  2147. // "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.",
  2148. // "httpMethod": "DELETE",
  2149. // "id": "androidpublisher.edits.delete",
  2150. // "parameterOrder": [
  2151. // "packageName",
  2152. // "editId"
  2153. // ],
  2154. // "parameters": {
  2155. // "editId": {
  2156. // "description": "Unique identifier for this edit.",
  2157. // "location": "path",
  2158. // "required": true,
  2159. // "type": "string"
  2160. // },
  2161. // "packageName": {
  2162. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2163. // "location": "path",
  2164. // "required": true,
  2165. // "type": "string"
  2166. // }
  2167. // },
  2168. // "path": "{packageName}/edits/{editId}",
  2169. // "scopes": [
  2170. // "https://www.googleapis.com/auth/androidpublisher"
  2171. // ]
  2172. // }
  2173. }
  2174. // method id "androidpublisher.edits.get":
  2175. type EditsGetCall struct {
  2176. s *Service
  2177. packageNameid string
  2178. editId string
  2179. urlParams_ gensupport.URLParams
  2180. ifNoneMatch_ string
  2181. ctx_ context.Context
  2182. header_ http.Header
  2183. }
  2184. // Get: Returns information about the edit specified. Calls will fail if
  2185. // the edit is no long active (e.g. has been deleted, superseded or
  2186. // expired).
  2187. func (r *EditsService) Get(packageNameid string, editId string) *EditsGetCall {
  2188. c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2189. c.packageNameid = packageNameid
  2190. c.editId = editId
  2191. return c
  2192. }
  2193. // Fields allows partial responses to be retrieved. See
  2194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2195. // for more information.
  2196. func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall {
  2197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2198. return c
  2199. }
  2200. // IfNoneMatch sets the optional parameter which makes the operation
  2201. // fail if the object's ETag matches the given value. This is useful for
  2202. // getting updates only after the object has changed since the last
  2203. // request. Use googleapi.IsNotModified to check whether the response
  2204. // error from Do is the result of In-None-Match.
  2205. func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall {
  2206. c.ifNoneMatch_ = entityTag
  2207. return c
  2208. }
  2209. // Context sets the context to be used in this call's Do method. Any
  2210. // pending HTTP request will be aborted if the provided context is
  2211. // canceled.
  2212. func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall {
  2213. c.ctx_ = ctx
  2214. return c
  2215. }
  2216. // Header returns an http.Header that can be modified by the caller to
  2217. // add HTTP headers to the request.
  2218. func (c *EditsGetCall) Header() http.Header {
  2219. if c.header_ == nil {
  2220. c.header_ = make(http.Header)
  2221. }
  2222. return c.header_
  2223. }
  2224. func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) {
  2225. reqHeaders := make(http.Header)
  2226. for k, v := range c.header_ {
  2227. reqHeaders[k] = v
  2228. }
  2229. reqHeaders.Set("User-Agent", c.s.userAgent())
  2230. if c.ifNoneMatch_ != "" {
  2231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2232. }
  2233. var body io.Reader = nil
  2234. c.urlParams_.Set("alt", alt)
  2235. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2236. urls += "?" + c.urlParams_.Encode()
  2237. req, _ := http.NewRequest("GET", urls, body)
  2238. req.Header = reqHeaders
  2239. googleapi.Expand(req.URL, map[string]string{
  2240. "packageName": c.packageNameid,
  2241. "editId": c.editId,
  2242. })
  2243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2244. }
  2245. // Do executes the "androidpublisher.edits.get" call.
  2246. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2247. // code is an error. Response headers are in either
  2248. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2249. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2250. // check whether the returned error was because http.StatusNotModified
  2251. // was returned.
  2252. func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2253. gensupport.SetOptions(c.urlParams_, opts...)
  2254. res, err := c.doRequest("json")
  2255. if res != nil && res.StatusCode == http.StatusNotModified {
  2256. if res.Body != nil {
  2257. res.Body.Close()
  2258. }
  2259. return nil, &googleapi.Error{
  2260. Code: res.StatusCode,
  2261. Header: res.Header,
  2262. }
  2263. }
  2264. if err != nil {
  2265. return nil, err
  2266. }
  2267. defer googleapi.CloseBody(res)
  2268. if err := googleapi.CheckResponse(res); err != nil {
  2269. return nil, err
  2270. }
  2271. ret := &AppEdit{
  2272. ServerResponse: googleapi.ServerResponse{
  2273. Header: res.Header,
  2274. HTTPStatusCode: res.StatusCode,
  2275. },
  2276. }
  2277. target := &ret
  2278. if err := gensupport.DecodeResponse(target, res); err != nil {
  2279. return nil, err
  2280. }
  2281. return ret, nil
  2282. // {
  2283. // "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).",
  2284. // "httpMethod": "GET",
  2285. // "id": "androidpublisher.edits.get",
  2286. // "parameterOrder": [
  2287. // "packageName",
  2288. // "editId"
  2289. // ],
  2290. // "parameters": {
  2291. // "editId": {
  2292. // "description": "Unique identifier for this edit.",
  2293. // "location": "path",
  2294. // "required": true,
  2295. // "type": "string"
  2296. // },
  2297. // "packageName": {
  2298. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2299. // "location": "path",
  2300. // "required": true,
  2301. // "type": "string"
  2302. // }
  2303. // },
  2304. // "path": "{packageName}/edits/{editId}",
  2305. // "response": {
  2306. // "$ref": "AppEdit"
  2307. // },
  2308. // "scopes": [
  2309. // "https://www.googleapis.com/auth/androidpublisher"
  2310. // ]
  2311. // }
  2312. }
  2313. // method id "androidpublisher.edits.insert":
  2314. type EditsInsertCall struct {
  2315. s *Service
  2316. packageNameid string
  2317. appedit *AppEdit
  2318. urlParams_ gensupport.URLParams
  2319. ctx_ context.Context
  2320. header_ http.Header
  2321. }
  2322. // Insert: Creates a new edit for an app, populated with the app's
  2323. // current state.
  2324. func (r *EditsService) Insert(packageNameid string, appedit *AppEdit) *EditsInsertCall {
  2325. c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2326. c.packageNameid = packageNameid
  2327. c.appedit = appedit
  2328. return c
  2329. }
  2330. // Fields allows partial responses to be retrieved. See
  2331. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2332. // for more information.
  2333. func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall {
  2334. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2335. return c
  2336. }
  2337. // Context sets the context to be used in this call's Do method. Any
  2338. // pending HTTP request will be aborted if the provided context is
  2339. // canceled.
  2340. func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall {
  2341. c.ctx_ = ctx
  2342. return c
  2343. }
  2344. // Header returns an http.Header that can be modified by the caller to
  2345. // add HTTP headers to the request.
  2346. func (c *EditsInsertCall) Header() http.Header {
  2347. if c.header_ == nil {
  2348. c.header_ = make(http.Header)
  2349. }
  2350. return c.header_
  2351. }
  2352. func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) {
  2353. reqHeaders := make(http.Header)
  2354. for k, v := range c.header_ {
  2355. reqHeaders[k] = v
  2356. }
  2357. reqHeaders.Set("User-Agent", c.s.userAgent())
  2358. var body io.Reader = nil
  2359. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit)
  2360. if err != nil {
  2361. return nil, err
  2362. }
  2363. reqHeaders.Set("Content-Type", "application/json")
  2364. c.urlParams_.Set("alt", alt)
  2365. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits")
  2366. urls += "?" + c.urlParams_.Encode()
  2367. req, _ := http.NewRequest("POST", urls, body)
  2368. req.Header = reqHeaders
  2369. googleapi.Expand(req.URL, map[string]string{
  2370. "packageName": c.packageNameid,
  2371. })
  2372. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2373. }
  2374. // Do executes the "androidpublisher.edits.insert" call.
  2375. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2376. // code is an error. Response headers are in either
  2377. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2378. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2379. // check whether the returned error was because http.StatusNotModified
  2380. // was returned.
  2381. func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2382. gensupport.SetOptions(c.urlParams_, opts...)
  2383. res, err := c.doRequest("json")
  2384. if res != nil && res.StatusCode == http.StatusNotModified {
  2385. if res.Body != nil {
  2386. res.Body.Close()
  2387. }
  2388. return nil, &googleapi.Error{
  2389. Code: res.StatusCode,
  2390. Header: res.Header,
  2391. }
  2392. }
  2393. if err != nil {
  2394. return nil, err
  2395. }
  2396. defer googleapi.CloseBody(res)
  2397. if err := googleapi.CheckResponse(res); err != nil {
  2398. return nil, err
  2399. }
  2400. ret := &AppEdit{
  2401. ServerResponse: googleapi.ServerResponse{
  2402. Header: res.Header,
  2403. HTTPStatusCode: res.StatusCode,
  2404. },
  2405. }
  2406. target := &ret
  2407. if err := gensupport.DecodeResponse(target, res); err != nil {
  2408. return nil, err
  2409. }
  2410. return ret, nil
  2411. // {
  2412. // "description": "Creates a new edit for an app, populated with the app's current state.",
  2413. // "httpMethod": "POST",
  2414. // "id": "androidpublisher.edits.insert",
  2415. // "parameterOrder": [
  2416. // "packageName"
  2417. // ],
  2418. // "parameters": {
  2419. // "packageName": {
  2420. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2421. // "location": "path",
  2422. // "required": true,
  2423. // "type": "string"
  2424. // }
  2425. // },
  2426. // "path": "{packageName}/edits",
  2427. // "request": {
  2428. // "$ref": "AppEdit"
  2429. // },
  2430. // "response": {
  2431. // "$ref": "AppEdit"
  2432. // },
  2433. // "scopes": [
  2434. // "https://www.googleapis.com/auth/androidpublisher"
  2435. // ]
  2436. // }
  2437. }
  2438. // method id "androidpublisher.edits.validate":
  2439. type EditsValidateCall struct {
  2440. s *Service
  2441. packageNameid string
  2442. editId string
  2443. urlParams_ gensupport.URLParams
  2444. ctx_ context.Context
  2445. header_ http.Header
  2446. }
  2447. // Validate: Checks that the edit can be successfully committed. The
  2448. // edit's changes are not applied to the live app.
  2449. func (r *EditsService) Validate(packageNameid string, editId string) *EditsValidateCall {
  2450. c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2451. c.packageNameid = packageNameid
  2452. c.editId = editId
  2453. return c
  2454. }
  2455. // Fields allows partial responses to be retrieved. See
  2456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2457. // for more information.
  2458. func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall {
  2459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2460. return c
  2461. }
  2462. // Context sets the context to be used in this call's Do method. Any
  2463. // pending HTTP request will be aborted if the provided context is
  2464. // canceled.
  2465. func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall {
  2466. c.ctx_ = ctx
  2467. return c
  2468. }
  2469. // Header returns an http.Header that can be modified by the caller to
  2470. // add HTTP headers to the request.
  2471. func (c *EditsValidateCall) Header() http.Header {
  2472. if c.header_ == nil {
  2473. c.header_ = make(http.Header)
  2474. }
  2475. return c.header_
  2476. }
  2477. func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) {
  2478. reqHeaders := make(http.Header)
  2479. for k, v := range c.header_ {
  2480. reqHeaders[k] = v
  2481. }
  2482. reqHeaders.Set("User-Agent", c.s.userAgent())
  2483. var body io.Reader = nil
  2484. c.urlParams_.Set("alt", alt)
  2485. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:validate")
  2486. urls += "?" + c.urlParams_.Encode()
  2487. req, _ := http.NewRequest("POST", urls, body)
  2488. req.Header = reqHeaders
  2489. googleapi.Expand(req.URL, map[string]string{
  2490. "packageName": c.packageNameid,
  2491. "editId": c.editId,
  2492. })
  2493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2494. }
  2495. // Do executes the "androidpublisher.edits.validate" call.
  2496. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2497. // code is an error. Response headers are in either
  2498. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2499. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2500. // check whether the returned error was because http.StatusNotModified
  2501. // was returned.
  2502. func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2503. gensupport.SetOptions(c.urlParams_, opts...)
  2504. res, err := c.doRequest("json")
  2505. if res != nil && res.StatusCode == http.StatusNotModified {
  2506. if res.Body != nil {
  2507. res.Body.Close()
  2508. }
  2509. return nil, &googleapi.Error{
  2510. Code: res.StatusCode,
  2511. Header: res.Header,
  2512. }
  2513. }
  2514. if err != nil {
  2515. return nil, err
  2516. }
  2517. defer googleapi.CloseBody(res)
  2518. if err := googleapi.CheckResponse(res); err != nil {
  2519. return nil, err
  2520. }
  2521. ret := &AppEdit{
  2522. ServerResponse: googleapi.ServerResponse{
  2523. Header: res.Header,
  2524. HTTPStatusCode: res.StatusCode,
  2525. },
  2526. }
  2527. target := &ret
  2528. if err := gensupport.DecodeResponse(target, res); err != nil {
  2529. return nil, err
  2530. }
  2531. return ret, nil
  2532. // {
  2533. // "description": "Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.",
  2534. // "httpMethod": "POST",
  2535. // "id": "androidpublisher.edits.validate",
  2536. // "parameterOrder": [
  2537. // "packageName",
  2538. // "editId"
  2539. // ],
  2540. // "parameters": {
  2541. // "editId": {
  2542. // "description": "Unique identifier for this edit.",
  2543. // "location": "path",
  2544. // "required": true,
  2545. // "type": "string"
  2546. // },
  2547. // "packageName": {
  2548. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2549. // "location": "path",
  2550. // "required": true,
  2551. // "type": "string"
  2552. // }
  2553. // },
  2554. // "path": "{packageName}/edits/{editId}:validate",
  2555. // "response": {
  2556. // "$ref": "AppEdit"
  2557. // },
  2558. // "scopes": [
  2559. // "https://www.googleapis.com/auth/androidpublisher"
  2560. // ]
  2561. // }
  2562. }
  2563. // method id "androidpublisher.edits.apklistings.delete":
  2564. type EditsApklistingsDeleteCall struct {
  2565. s *Service
  2566. packageNameid string
  2567. editId string
  2568. apkVersionCode int64
  2569. language string
  2570. urlParams_ gensupport.URLParams
  2571. ctx_ context.Context
  2572. header_ http.Header
  2573. }
  2574. // Delete: Deletes the APK-specific localized listing for a specified
  2575. // APK and language code.
  2576. func (r *EditsApklistingsService) Delete(packageNameid string, editId string, apkVersionCode int64, language string) *EditsApklistingsDeleteCall {
  2577. c := &EditsApklistingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2578. c.packageNameid = packageNameid
  2579. c.editId = editId
  2580. c.apkVersionCode = apkVersionCode
  2581. c.language = language
  2582. return c
  2583. }
  2584. // Fields allows partial responses to be retrieved. See
  2585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2586. // for more information.
  2587. func (c *EditsApklistingsDeleteCall) Fields(s ...googleapi.Field) *EditsApklistingsDeleteCall {
  2588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2589. return c
  2590. }
  2591. // Context sets the context to be used in this call's Do method. Any
  2592. // pending HTTP request will be aborted if the provided context is
  2593. // canceled.
  2594. func (c *EditsApklistingsDeleteCall) Context(ctx context.Context) *EditsApklistingsDeleteCall {
  2595. c.ctx_ = ctx
  2596. return c
  2597. }
  2598. // Header returns an http.Header that can be modified by the caller to
  2599. // add HTTP headers to the request.
  2600. func (c *EditsApklistingsDeleteCall) Header() http.Header {
  2601. if c.header_ == nil {
  2602. c.header_ = make(http.Header)
  2603. }
  2604. return c.header_
  2605. }
  2606. func (c *EditsApklistingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2607. reqHeaders := make(http.Header)
  2608. for k, v := range c.header_ {
  2609. reqHeaders[k] = v
  2610. }
  2611. reqHeaders.Set("User-Agent", c.s.userAgent())
  2612. var body io.Reader = nil
  2613. c.urlParams_.Set("alt", alt)
  2614. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  2615. urls += "?" + c.urlParams_.Encode()
  2616. req, _ := http.NewRequest("DELETE", urls, body)
  2617. req.Header = reqHeaders
  2618. googleapi.Expand(req.URL, map[string]string{
  2619. "packageName": c.packageNameid,
  2620. "editId": c.editId,
  2621. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  2622. "language": c.language,
  2623. })
  2624. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2625. }
  2626. // Do executes the "androidpublisher.edits.apklistings.delete" call.
  2627. func (c *EditsApklistingsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2628. gensupport.SetOptions(c.urlParams_, opts...)
  2629. res, err := c.doRequest("json")
  2630. if err != nil {
  2631. return err
  2632. }
  2633. defer googleapi.CloseBody(res)
  2634. if err := googleapi.CheckResponse(res); err != nil {
  2635. return err
  2636. }
  2637. return nil
  2638. // {
  2639. // "description": "Deletes the APK-specific localized listing for a specified APK and language code.",
  2640. // "httpMethod": "DELETE",
  2641. // "id": "androidpublisher.edits.apklistings.delete",
  2642. // "parameterOrder": [
  2643. // "packageName",
  2644. // "editId",
  2645. // "apkVersionCode",
  2646. // "language"
  2647. // ],
  2648. // "parameters": {
  2649. // "apkVersionCode": {
  2650. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  2651. // "format": "int32",
  2652. // "location": "path",
  2653. // "required": true,
  2654. // "type": "integer"
  2655. // },
  2656. // "editId": {
  2657. // "description": "Unique identifier for this edit.",
  2658. // "location": "path",
  2659. // "required": true,
  2660. // "type": "string"
  2661. // },
  2662. // "language": {
  2663. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  2664. // "location": "path",
  2665. // "required": true,
  2666. // "type": "string"
  2667. // },
  2668. // "packageName": {
  2669. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2670. // "location": "path",
  2671. // "required": true,
  2672. // "type": "string"
  2673. // }
  2674. // },
  2675. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  2676. // "scopes": [
  2677. // "https://www.googleapis.com/auth/androidpublisher"
  2678. // ]
  2679. // }
  2680. }
  2681. // method id "androidpublisher.edits.apklistings.deleteall":
  2682. type EditsApklistingsDeleteallCall struct {
  2683. s *Service
  2684. packageNameid string
  2685. editId string
  2686. apkVersionCode int64
  2687. urlParams_ gensupport.URLParams
  2688. ctx_ context.Context
  2689. header_ http.Header
  2690. }
  2691. // Deleteall: Deletes all the APK-specific localized listings for a
  2692. // specified APK.
  2693. func (r *EditsApklistingsService) Deleteall(packageNameid string, editId string, apkVersionCode int64) *EditsApklistingsDeleteallCall {
  2694. c := &EditsApklistingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2695. c.packageNameid = packageNameid
  2696. c.editId = editId
  2697. c.apkVersionCode = apkVersionCode
  2698. return c
  2699. }
  2700. // Fields allows partial responses to be retrieved. See
  2701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2702. // for more information.
  2703. func (c *EditsApklistingsDeleteallCall) Fields(s ...googleapi.Field) *EditsApklistingsDeleteallCall {
  2704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2705. return c
  2706. }
  2707. // Context sets the context to be used in this call's Do method. Any
  2708. // pending HTTP request will be aborted if the provided context is
  2709. // canceled.
  2710. func (c *EditsApklistingsDeleteallCall) Context(ctx context.Context) *EditsApklistingsDeleteallCall {
  2711. c.ctx_ = ctx
  2712. return c
  2713. }
  2714. // Header returns an http.Header that can be modified by the caller to
  2715. // add HTTP headers to the request.
  2716. func (c *EditsApklistingsDeleteallCall) Header() http.Header {
  2717. if c.header_ == nil {
  2718. c.header_ = make(http.Header)
  2719. }
  2720. return c.header_
  2721. }
  2722. func (c *EditsApklistingsDeleteallCall) doRequest(alt string) (*http.Response, error) {
  2723. reqHeaders := make(http.Header)
  2724. for k, v := range c.header_ {
  2725. reqHeaders[k] = v
  2726. }
  2727. reqHeaders.Set("User-Agent", c.s.userAgent())
  2728. var body io.Reader = nil
  2729. c.urlParams_.Set("alt", alt)
  2730. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings")
  2731. urls += "?" + c.urlParams_.Encode()
  2732. req, _ := http.NewRequest("DELETE", urls, body)
  2733. req.Header = reqHeaders
  2734. googleapi.Expand(req.URL, map[string]string{
  2735. "packageName": c.packageNameid,
  2736. "editId": c.editId,
  2737. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  2738. })
  2739. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2740. }
  2741. // Do executes the "androidpublisher.edits.apklistings.deleteall" call.
  2742. func (c *EditsApklistingsDeleteallCall) Do(opts ...googleapi.CallOption) error {
  2743. gensupport.SetOptions(c.urlParams_, opts...)
  2744. res, err := c.doRequest("json")
  2745. if err != nil {
  2746. return err
  2747. }
  2748. defer googleapi.CloseBody(res)
  2749. if err := googleapi.CheckResponse(res); err != nil {
  2750. return err
  2751. }
  2752. return nil
  2753. // {
  2754. // "description": "Deletes all the APK-specific localized listings for a specified APK.",
  2755. // "httpMethod": "DELETE",
  2756. // "id": "androidpublisher.edits.apklistings.deleteall",
  2757. // "parameterOrder": [
  2758. // "packageName",
  2759. // "editId",
  2760. // "apkVersionCode"
  2761. // ],
  2762. // "parameters": {
  2763. // "apkVersionCode": {
  2764. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  2765. // "format": "int32",
  2766. // "location": "path",
  2767. // "required": true,
  2768. // "type": "integer"
  2769. // },
  2770. // "editId": {
  2771. // "description": "Unique identifier for this edit.",
  2772. // "location": "path",
  2773. // "required": true,
  2774. // "type": "string"
  2775. // },
  2776. // "packageName": {
  2777. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2778. // "location": "path",
  2779. // "required": true,
  2780. // "type": "string"
  2781. // }
  2782. // },
  2783. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings",
  2784. // "scopes": [
  2785. // "https://www.googleapis.com/auth/androidpublisher"
  2786. // ]
  2787. // }
  2788. }
  2789. // method id "androidpublisher.edits.apklistings.get":
  2790. type EditsApklistingsGetCall struct {
  2791. s *Service
  2792. packageNameid string
  2793. editId string
  2794. apkVersionCode int64
  2795. language string
  2796. urlParams_ gensupport.URLParams
  2797. ifNoneMatch_ string
  2798. ctx_ context.Context
  2799. header_ http.Header
  2800. }
  2801. // Get: Fetches the APK-specific localized listing for a specified APK
  2802. // and language code.
  2803. func (r *EditsApklistingsService) Get(packageNameid string, editId string, apkVersionCode int64, language string) *EditsApklistingsGetCall {
  2804. c := &EditsApklistingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2805. c.packageNameid = packageNameid
  2806. c.editId = editId
  2807. c.apkVersionCode = apkVersionCode
  2808. c.language = language
  2809. return c
  2810. }
  2811. // Fields allows partial responses to be retrieved. See
  2812. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2813. // for more information.
  2814. func (c *EditsApklistingsGetCall) Fields(s ...googleapi.Field) *EditsApklistingsGetCall {
  2815. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2816. return c
  2817. }
  2818. // IfNoneMatch sets the optional parameter which makes the operation
  2819. // fail if the object's ETag matches the given value. This is useful for
  2820. // getting updates only after the object has changed since the last
  2821. // request. Use googleapi.IsNotModified to check whether the response
  2822. // error from Do is the result of In-None-Match.
  2823. func (c *EditsApklistingsGetCall) IfNoneMatch(entityTag string) *EditsApklistingsGetCall {
  2824. c.ifNoneMatch_ = entityTag
  2825. return c
  2826. }
  2827. // Context sets the context to be used in this call's Do method. Any
  2828. // pending HTTP request will be aborted if the provided context is
  2829. // canceled.
  2830. func (c *EditsApklistingsGetCall) Context(ctx context.Context) *EditsApklistingsGetCall {
  2831. c.ctx_ = ctx
  2832. return c
  2833. }
  2834. // Header returns an http.Header that can be modified by the caller to
  2835. // add HTTP headers to the request.
  2836. func (c *EditsApklistingsGetCall) Header() http.Header {
  2837. if c.header_ == nil {
  2838. c.header_ = make(http.Header)
  2839. }
  2840. return c.header_
  2841. }
  2842. func (c *EditsApklistingsGetCall) doRequest(alt string) (*http.Response, error) {
  2843. reqHeaders := make(http.Header)
  2844. for k, v := range c.header_ {
  2845. reqHeaders[k] = v
  2846. }
  2847. reqHeaders.Set("User-Agent", c.s.userAgent())
  2848. if c.ifNoneMatch_ != "" {
  2849. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2850. }
  2851. var body io.Reader = nil
  2852. c.urlParams_.Set("alt", alt)
  2853. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  2854. urls += "?" + c.urlParams_.Encode()
  2855. req, _ := http.NewRequest("GET", urls, body)
  2856. req.Header = reqHeaders
  2857. googleapi.Expand(req.URL, map[string]string{
  2858. "packageName": c.packageNameid,
  2859. "editId": c.editId,
  2860. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  2861. "language": c.language,
  2862. })
  2863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2864. }
  2865. // Do executes the "androidpublisher.edits.apklistings.get" call.
  2866. // Exactly one of *ApkListing or error will be non-nil. Any non-2xx
  2867. // status code is an error. Response headers are in either
  2868. // *ApkListing.ServerResponse.Header or (if a response was returned at
  2869. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2870. // to check whether the returned error was because
  2871. // http.StatusNotModified was returned.
  2872. func (c *EditsApklistingsGetCall) Do(opts ...googleapi.CallOption) (*ApkListing, error) {
  2873. gensupport.SetOptions(c.urlParams_, opts...)
  2874. res, err := c.doRequest("json")
  2875. if res != nil && res.StatusCode == http.StatusNotModified {
  2876. if res.Body != nil {
  2877. res.Body.Close()
  2878. }
  2879. return nil, &googleapi.Error{
  2880. Code: res.StatusCode,
  2881. Header: res.Header,
  2882. }
  2883. }
  2884. if err != nil {
  2885. return nil, err
  2886. }
  2887. defer googleapi.CloseBody(res)
  2888. if err := googleapi.CheckResponse(res); err != nil {
  2889. return nil, err
  2890. }
  2891. ret := &ApkListing{
  2892. ServerResponse: googleapi.ServerResponse{
  2893. Header: res.Header,
  2894. HTTPStatusCode: res.StatusCode,
  2895. },
  2896. }
  2897. target := &ret
  2898. if err := gensupport.DecodeResponse(target, res); err != nil {
  2899. return nil, err
  2900. }
  2901. return ret, nil
  2902. // {
  2903. // "description": "Fetches the APK-specific localized listing for a specified APK and language code.",
  2904. // "httpMethod": "GET",
  2905. // "id": "androidpublisher.edits.apklistings.get",
  2906. // "parameterOrder": [
  2907. // "packageName",
  2908. // "editId",
  2909. // "apkVersionCode",
  2910. // "language"
  2911. // ],
  2912. // "parameters": {
  2913. // "apkVersionCode": {
  2914. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  2915. // "format": "int32",
  2916. // "location": "path",
  2917. // "required": true,
  2918. // "type": "integer"
  2919. // },
  2920. // "editId": {
  2921. // "description": "Unique identifier for this edit.",
  2922. // "location": "path",
  2923. // "required": true,
  2924. // "type": "string"
  2925. // },
  2926. // "language": {
  2927. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  2928. // "location": "path",
  2929. // "required": true,
  2930. // "type": "string"
  2931. // },
  2932. // "packageName": {
  2933. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2934. // "location": "path",
  2935. // "required": true,
  2936. // "type": "string"
  2937. // }
  2938. // },
  2939. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  2940. // "response": {
  2941. // "$ref": "ApkListing"
  2942. // },
  2943. // "scopes": [
  2944. // "https://www.googleapis.com/auth/androidpublisher"
  2945. // ]
  2946. // }
  2947. }
  2948. // method id "androidpublisher.edits.apklistings.list":
  2949. type EditsApklistingsListCall struct {
  2950. s *Service
  2951. packageNameid string
  2952. editId string
  2953. apkVersionCode int64
  2954. urlParams_ gensupport.URLParams
  2955. ifNoneMatch_ string
  2956. ctx_ context.Context
  2957. header_ http.Header
  2958. }
  2959. // List: Lists all the APK-specific localized listings for a specified
  2960. // APK.
  2961. func (r *EditsApklistingsService) List(packageNameid string, editId string, apkVersionCode int64) *EditsApklistingsListCall {
  2962. c := &EditsApklistingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2963. c.packageNameid = packageNameid
  2964. c.editId = editId
  2965. c.apkVersionCode = apkVersionCode
  2966. return c
  2967. }
  2968. // Fields allows partial responses to be retrieved. See
  2969. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2970. // for more information.
  2971. func (c *EditsApklistingsListCall) Fields(s ...googleapi.Field) *EditsApklistingsListCall {
  2972. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2973. return c
  2974. }
  2975. // IfNoneMatch sets the optional parameter which makes the operation
  2976. // fail if the object's ETag matches the given value. This is useful for
  2977. // getting updates only after the object has changed since the last
  2978. // request. Use googleapi.IsNotModified to check whether the response
  2979. // error from Do is the result of In-None-Match.
  2980. func (c *EditsApklistingsListCall) IfNoneMatch(entityTag string) *EditsApklistingsListCall {
  2981. c.ifNoneMatch_ = entityTag
  2982. return c
  2983. }
  2984. // Context sets the context to be used in this call's Do method. Any
  2985. // pending HTTP request will be aborted if the provided context is
  2986. // canceled.
  2987. func (c *EditsApklistingsListCall) Context(ctx context.Context) *EditsApklistingsListCall {
  2988. c.ctx_ = ctx
  2989. return c
  2990. }
  2991. // Header returns an http.Header that can be modified by the caller to
  2992. // add HTTP headers to the request.
  2993. func (c *EditsApklistingsListCall) Header() http.Header {
  2994. if c.header_ == nil {
  2995. c.header_ = make(http.Header)
  2996. }
  2997. return c.header_
  2998. }
  2999. func (c *EditsApklistingsListCall) doRequest(alt string) (*http.Response, error) {
  3000. reqHeaders := make(http.Header)
  3001. for k, v := range c.header_ {
  3002. reqHeaders[k] = v
  3003. }
  3004. reqHeaders.Set("User-Agent", c.s.userAgent())
  3005. if c.ifNoneMatch_ != "" {
  3006. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3007. }
  3008. var body io.Reader = nil
  3009. c.urlParams_.Set("alt", alt)
  3010. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings")
  3011. urls += "?" + c.urlParams_.Encode()
  3012. req, _ := http.NewRequest("GET", urls, body)
  3013. req.Header = reqHeaders
  3014. googleapi.Expand(req.URL, map[string]string{
  3015. "packageName": c.packageNameid,
  3016. "editId": c.editId,
  3017. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3018. })
  3019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3020. }
  3021. // Do executes the "androidpublisher.edits.apklistings.list" call.
  3022. // Exactly one of *ApkListingsListResponse or error will be non-nil. Any
  3023. // non-2xx status code is an error. Response headers are in either
  3024. // *ApkListingsListResponse.ServerResponse.Header or (if a response was
  3025. // returned at all) in error.(*googleapi.Error).Header. Use
  3026. // googleapi.IsNotModified to check whether the returned error was
  3027. // because http.StatusNotModified was returned.
  3028. func (c *EditsApklistingsListCall) Do(opts ...googleapi.CallOption) (*ApkListingsListResponse, error) {
  3029. gensupport.SetOptions(c.urlParams_, opts...)
  3030. res, err := c.doRequest("json")
  3031. if res != nil && res.StatusCode == http.StatusNotModified {
  3032. if res.Body != nil {
  3033. res.Body.Close()
  3034. }
  3035. return nil, &googleapi.Error{
  3036. Code: res.StatusCode,
  3037. Header: res.Header,
  3038. }
  3039. }
  3040. if err != nil {
  3041. return nil, err
  3042. }
  3043. defer googleapi.CloseBody(res)
  3044. if err := googleapi.CheckResponse(res); err != nil {
  3045. return nil, err
  3046. }
  3047. ret := &ApkListingsListResponse{
  3048. ServerResponse: googleapi.ServerResponse{
  3049. Header: res.Header,
  3050. HTTPStatusCode: res.StatusCode,
  3051. },
  3052. }
  3053. target := &ret
  3054. if err := gensupport.DecodeResponse(target, res); err != nil {
  3055. return nil, err
  3056. }
  3057. return ret, nil
  3058. // {
  3059. // "description": "Lists all the APK-specific localized listings for a specified APK.",
  3060. // "httpMethod": "GET",
  3061. // "id": "androidpublisher.edits.apklistings.list",
  3062. // "parameterOrder": [
  3063. // "packageName",
  3064. // "editId",
  3065. // "apkVersionCode"
  3066. // ],
  3067. // "parameters": {
  3068. // "apkVersionCode": {
  3069. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3070. // "format": "int32",
  3071. // "location": "path",
  3072. // "required": true,
  3073. // "type": "integer"
  3074. // },
  3075. // "editId": {
  3076. // "description": "Unique identifier for this edit.",
  3077. // "location": "path",
  3078. // "required": true,
  3079. // "type": "string"
  3080. // },
  3081. // "packageName": {
  3082. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3083. // "location": "path",
  3084. // "required": true,
  3085. // "type": "string"
  3086. // }
  3087. // },
  3088. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings",
  3089. // "response": {
  3090. // "$ref": "ApkListingsListResponse"
  3091. // },
  3092. // "scopes": [
  3093. // "https://www.googleapis.com/auth/androidpublisher"
  3094. // ]
  3095. // }
  3096. }
  3097. // method id "androidpublisher.edits.apklistings.patch":
  3098. type EditsApklistingsPatchCall struct {
  3099. s *Service
  3100. packageNameid string
  3101. editId string
  3102. apkVersionCode int64
  3103. language string
  3104. apklisting *ApkListing
  3105. urlParams_ gensupport.URLParams
  3106. ctx_ context.Context
  3107. header_ http.Header
  3108. }
  3109. // Patch: Updates or creates the APK-specific localized listing for a
  3110. // specified APK and language code. This method supports patch
  3111. // semantics.
  3112. func (r *EditsApklistingsService) Patch(packageNameid string, editId string, apkVersionCode int64, language string, apklisting *ApkListing) *EditsApklistingsPatchCall {
  3113. c := &EditsApklistingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3114. c.packageNameid = packageNameid
  3115. c.editId = editId
  3116. c.apkVersionCode = apkVersionCode
  3117. c.language = language
  3118. c.apklisting = apklisting
  3119. return c
  3120. }
  3121. // Fields allows partial responses to be retrieved. See
  3122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3123. // for more information.
  3124. func (c *EditsApklistingsPatchCall) Fields(s ...googleapi.Field) *EditsApklistingsPatchCall {
  3125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3126. return c
  3127. }
  3128. // Context sets the context to be used in this call's Do method. Any
  3129. // pending HTTP request will be aborted if the provided context is
  3130. // canceled.
  3131. func (c *EditsApklistingsPatchCall) Context(ctx context.Context) *EditsApklistingsPatchCall {
  3132. c.ctx_ = ctx
  3133. return c
  3134. }
  3135. // Header returns an http.Header that can be modified by the caller to
  3136. // add HTTP headers to the request.
  3137. func (c *EditsApklistingsPatchCall) Header() http.Header {
  3138. if c.header_ == nil {
  3139. c.header_ = make(http.Header)
  3140. }
  3141. return c.header_
  3142. }
  3143. func (c *EditsApklistingsPatchCall) doRequest(alt string) (*http.Response, error) {
  3144. reqHeaders := make(http.Header)
  3145. for k, v := range c.header_ {
  3146. reqHeaders[k] = v
  3147. }
  3148. reqHeaders.Set("User-Agent", c.s.userAgent())
  3149. var body io.Reader = nil
  3150. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apklisting)
  3151. if err != nil {
  3152. return nil, err
  3153. }
  3154. reqHeaders.Set("Content-Type", "application/json")
  3155. c.urlParams_.Set("alt", alt)
  3156. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  3157. urls += "?" + c.urlParams_.Encode()
  3158. req, _ := http.NewRequest("PATCH", urls, body)
  3159. req.Header = reqHeaders
  3160. googleapi.Expand(req.URL, map[string]string{
  3161. "packageName": c.packageNameid,
  3162. "editId": c.editId,
  3163. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3164. "language": c.language,
  3165. })
  3166. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3167. }
  3168. // Do executes the "androidpublisher.edits.apklistings.patch" call.
  3169. // Exactly one of *ApkListing or error will be non-nil. Any non-2xx
  3170. // status code is an error. Response headers are in either
  3171. // *ApkListing.ServerResponse.Header or (if a response was returned at
  3172. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3173. // to check whether the returned error was because
  3174. // http.StatusNotModified was returned.
  3175. func (c *EditsApklistingsPatchCall) Do(opts ...googleapi.CallOption) (*ApkListing, error) {
  3176. gensupport.SetOptions(c.urlParams_, opts...)
  3177. res, err := c.doRequest("json")
  3178. if res != nil && res.StatusCode == http.StatusNotModified {
  3179. if res.Body != nil {
  3180. res.Body.Close()
  3181. }
  3182. return nil, &googleapi.Error{
  3183. Code: res.StatusCode,
  3184. Header: res.Header,
  3185. }
  3186. }
  3187. if err != nil {
  3188. return nil, err
  3189. }
  3190. defer googleapi.CloseBody(res)
  3191. if err := googleapi.CheckResponse(res); err != nil {
  3192. return nil, err
  3193. }
  3194. ret := &ApkListing{
  3195. ServerResponse: googleapi.ServerResponse{
  3196. Header: res.Header,
  3197. HTTPStatusCode: res.StatusCode,
  3198. },
  3199. }
  3200. target := &ret
  3201. if err := gensupport.DecodeResponse(target, res); err != nil {
  3202. return nil, err
  3203. }
  3204. return ret, nil
  3205. // {
  3206. // "description": "Updates or creates the APK-specific localized listing for a specified APK and language code. This method supports patch semantics.",
  3207. // "httpMethod": "PATCH",
  3208. // "id": "androidpublisher.edits.apklistings.patch",
  3209. // "parameterOrder": [
  3210. // "packageName",
  3211. // "editId",
  3212. // "apkVersionCode",
  3213. // "language"
  3214. // ],
  3215. // "parameters": {
  3216. // "apkVersionCode": {
  3217. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3218. // "format": "int32",
  3219. // "location": "path",
  3220. // "required": true,
  3221. // "type": "integer"
  3222. // },
  3223. // "editId": {
  3224. // "description": "Unique identifier for this edit.",
  3225. // "location": "path",
  3226. // "required": true,
  3227. // "type": "string"
  3228. // },
  3229. // "language": {
  3230. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  3231. // "location": "path",
  3232. // "required": true,
  3233. // "type": "string"
  3234. // },
  3235. // "packageName": {
  3236. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3237. // "location": "path",
  3238. // "required": true,
  3239. // "type": "string"
  3240. // }
  3241. // },
  3242. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  3243. // "request": {
  3244. // "$ref": "ApkListing"
  3245. // },
  3246. // "response": {
  3247. // "$ref": "ApkListing"
  3248. // },
  3249. // "scopes": [
  3250. // "https://www.googleapis.com/auth/androidpublisher"
  3251. // ]
  3252. // }
  3253. }
  3254. // method id "androidpublisher.edits.apklistings.update":
  3255. type EditsApklistingsUpdateCall struct {
  3256. s *Service
  3257. packageNameid string
  3258. editId string
  3259. apkVersionCode int64
  3260. language string
  3261. apklisting *ApkListing
  3262. urlParams_ gensupport.URLParams
  3263. ctx_ context.Context
  3264. header_ http.Header
  3265. }
  3266. // Update: Updates or creates the APK-specific localized listing for a
  3267. // specified APK and language code.
  3268. func (r *EditsApklistingsService) Update(packageNameid string, editId string, apkVersionCode int64, language string, apklisting *ApkListing) *EditsApklistingsUpdateCall {
  3269. c := &EditsApklistingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3270. c.packageNameid = packageNameid
  3271. c.editId = editId
  3272. c.apkVersionCode = apkVersionCode
  3273. c.language = language
  3274. c.apklisting = apklisting
  3275. return c
  3276. }
  3277. // Fields allows partial responses to be retrieved. See
  3278. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3279. // for more information.
  3280. func (c *EditsApklistingsUpdateCall) Fields(s ...googleapi.Field) *EditsApklistingsUpdateCall {
  3281. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3282. return c
  3283. }
  3284. // Context sets the context to be used in this call's Do method. Any
  3285. // pending HTTP request will be aborted if the provided context is
  3286. // canceled.
  3287. func (c *EditsApklistingsUpdateCall) Context(ctx context.Context) *EditsApklistingsUpdateCall {
  3288. c.ctx_ = ctx
  3289. return c
  3290. }
  3291. // Header returns an http.Header that can be modified by the caller to
  3292. // add HTTP headers to the request.
  3293. func (c *EditsApklistingsUpdateCall) Header() http.Header {
  3294. if c.header_ == nil {
  3295. c.header_ = make(http.Header)
  3296. }
  3297. return c.header_
  3298. }
  3299. func (c *EditsApklistingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3300. reqHeaders := make(http.Header)
  3301. for k, v := range c.header_ {
  3302. reqHeaders[k] = v
  3303. }
  3304. reqHeaders.Set("User-Agent", c.s.userAgent())
  3305. var body io.Reader = nil
  3306. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apklisting)
  3307. if err != nil {
  3308. return nil, err
  3309. }
  3310. reqHeaders.Set("Content-Type", "application/json")
  3311. c.urlParams_.Set("alt", alt)
  3312. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}")
  3313. urls += "?" + c.urlParams_.Encode()
  3314. req, _ := http.NewRequest("PUT", urls, body)
  3315. req.Header = reqHeaders
  3316. googleapi.Expand(req.URL, map[string]string{
  3317. "packageName": c.packageNameid,
  3318. "editId": c.editId,
  3319. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3320. "language": c.language,
  3321. })
  3322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3323. }
  3324. // Do executes the "androidpublisher.edits.apklistings.update" call.
  3325. // Exactly one of *ApkListing or error will be non-nil. Any non-2xx
  3326. // status code is an error. Response headers are in either
  3327. // *ApkListing.ServerResponse.Header or (if a response was returned at
  3328. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3329. // to check whether the returned error was because
  3330. // http.StatusNotModified was returned.
  3331. func (c *EditsApklistingsUpdateCall) Do(opts ...googleapi.CallOption) (*ApkListing, error) {
  3332. gensupport.SetOptions(c.urlParams_, opts...)
  3333. res, err := c.doRequest("json")
  3334. if res != nil && res.StatusCode == http.StatusNotModified {
  3335. if res.Body != nil {
  3336. res.Body.Close()
  3337. }
  3338. return nil, &googleapi.Error{
  3339. Code: res.StatusCode,
  3340. Header: res.Header,
  3341. }
  3342. }
  3343. if err != nil {
  3344. return nil, err
  3345. }
  3346. defer googleapi.CloseBody(res)
  3347. if err := googleapi.CheckResponse(res); err != nil {
  3348. return nil, err
  3349. }
  3350. ret := &ApkListing{
  3351. ServerResponse: googleapi.ServerResponse{
  3352. Header: res.Header,
  3353. HTTPStatusCode: res.StatusCode,
  3354. },
  3355. }
  3356. target := &ret
  3357. if err := gensupport.DecodeResponse(target, res); err != nil {
  3358. return nil, err
  3359. }
  3360. return ret, nil
  3361. // {
  3362. // "description": "Updates or creates the APK-specific localized listing for a specified APK and language code.",
  3363. // "httpMethod": "PUT",
  3364. // "id": "androidpublisher.edits.apklistings.update",
  3365. // "parameterOrder": [
  3366. // "packageName",
  3367. // "editId",
  3368. // "apkVersionCode",
  3369. // "language"
  3370. // ],
  3371. // "parameters": {
  3372. // "apkVersionCode": {
  3373. // "description": "The APK version code whose APK-specific listings should be read or modified.",
  3374. // "format": "int32",
  3375. // "location": "path",
  3376. // "required": true,
  3377. // "type": "integer"
  3378. // },
  3379. // "editId": {
  3380. // "description": "Unique identifier for this edit.",
  3381. // "location": "path",
  3382. // "required": true,
  3383. // "type": "string"
  3384. // },
  3385. // "language": {
  3386. // "description": "The language code (a BCP-47 language tag) of the APK-specific localized listing to read or modify. For example, to select Austrian German, pass \"de-AT\".",
  3387. // "location": "path",
  3388. // "required": true,
  3389. // "type": "string"
  3390. // },
  3391. // "packageName": {
  3392. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3393. // "location": "path",
  3394. // "required": true,
  3395. // "type": "string"
  3396. // }
  3397. // },
  3398. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}",
  3399. // "request": {
  3400. // "$ref": "ApkListing"
  3401. // },
  3402. // "response": {
  3403. // "$ref": "ApkListing"
  3404. // },
  3405. // "scopes": [
  3406. // "https://www.googleapis.com/auth/androidpublisher"
  3407. // ]
  3408. // }
  3409. }
  3410. // method id "androidpublisher.edits.apks.addexternallyhosted":
  3411. type EditsApksAddexternallyhostedCall struct {
  3412. s *Service
  3413. packageNameid string
  3414. editId string
  3415. apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest
  3416. urlParams_ gensupport.URLParams
  3417. ctx_ context.Context
  3418. header_ http.Header
  3419. }
  3420. // Addexternallyhosted: Creates a new APK without uploading the APK
  3421. // itself to Google Play, instead hosting the APK at a specified URL.
  3422. // This function is only available to enterprises using Google Play for
  3423. // Work whose application is configured to restrict distribution to the
  3424. // enterprise domain.
  3425. func (r *EditsApksService) Addexternallyhosted(packageNameid string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall {
  3426. c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3427. c.packageNameid = packageNameid
  3428. c.editId = editId
  3429. c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest
  3430. return c
  3431. }
  3432. // Fields allows partial responses to be retrieved. See
  3433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3434. // for more information.
  3435. func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall {
  3436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3437. return c
  3438. }
  3439. // Context sets the context to be used in this call's Do method. Any
  3440. // pending HTTP request will be aborted if the provided context is
  3441. // canceled.
  3442. func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall {
  3443. c.ctx_ = ctx
  3444. return c
  3445. }
  3446. // Header returns an http.Header that can be modified by the caller to
  3447. // add HTTP headers to the request.
  3448. func (c *EditsApksAddexternallyhostedCall) Header() http.Header {
  3449. if c.header_ == nil {
  3450. c.header_ = make(http.Header)
  3451. }
  3452. return c.header_
  3453. }
  3454. func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) {
  3455. reqHeaders := make(http.Header)
  3456. for k, v := range c.header_ {
  3457. reqHeaders[k] = v
  3458. }
  3459. reqHeaders.Set("User-Agent", c.s.userAgent())
  3460. var body io.Reader = nil
  3461. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest)
  3462. if err != nil {
  3463. return nil, err
  3464. }
  3465. reqHeaders.Set("Content-Type", "application/json")
  3466. c.urlParams_.Set("alt", alt)
  3467. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/externallyHosted")
  3468. urls += "?" + c.urlParams_.Encode()
  3469. req, _ := http.NewRequest("POST", urls, body)
  3470. req.Header = reqHeaders
  3471. googleapi.Expand(req.URL, map[string]string{
  3472. "packageName": c.packageNameid,
  3473. "editId": c.editId,
  3474. })
  3475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3476. }
  3477. // Do executes the "androidpublisher.edits.apks.addexternallyhosted" call.
  3478. // Exactly one of *ApksAddExternallyHostedResponse or error will be
  3479. // non-nil. Any non-2xx status code is an error. Response headers are in
  3480. // either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if
  3481. // a response was returned at all) in error.(*googleapi.Error).Header.
  3482. // Use googleapi.IsNotModified to check whether the returned error was
  3483. // because http.StatusNotModified was returned.
  3484. func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) {
  3485. gensupport.SetOptions(c.urlParams_, opts...)
  3486. res, err := c.doRequest("json")
  3487. if res != nil && res.StatusCode == http.StatusNotModified {
  3488. if res.Body != nil {
  3489. res.Body.Close()
  3490. }
  3491. return nil, &googleapi.Error{
  3492. Code: res.StatusCode,
  3493. Header: res.Header,
  3494. }
  3495. }
  3496. if err != nil {
  3497. return nil, err
  3498. }
  3499. defer googleapi.CloseBody(res)
  3500. if err := googleapi.CheckResponse(res); err != nil {
  3501. return nil, err
  3502. }
  3503. ret := &ApksAddExternallyHostedResponse{
  3504. ServerResponse: googleapi.ServerResponse{
  3505. Header: res.Header,
  3506. HTTPStatusCode: res.StatusCode,
  3507. },
  3508. }
  3509. target := &ret
  3510. if err := gensupport.DecodeResponse(target, res); err != nil {
  3511. return nil, err
  3512. }
  3513. return ret, nil
  3514. // {
  3515. // "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.",
  3516. // "httpMethod": "POST",
  3517. // "id": "androidpublisher.edits.apks.addexternallyhosted",
  3518. // "parameterOrder": [
  3519. // "packageName",
  3520. // "editId"
  3521. // ],
  3522. // "parameters": {
  3523. // "editId": {
  3524. // "description": "Unique identifier for this edit.",
  3525. // "location": "path",
  3526. // "required": true,
  3527. // "type": "string"
  3528. // },
  3529. // "packageName": {
  3530. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3531. // "location": "path",
  3532. // "required": true,
  3533. // "type": "string"
  3534. // }
  3535. // },
  3536. // "path": "{packageName}/edits/{editId}/apks/externallyHosted",
  3537. // "request": {
  3538. // "$ref": "ApksAddExternallyHostedRequest"
  3539. // },
  3540. // "response": {
  3541. // "$ref": "ApksAddExternallyHostedResponse"
  3542. // },
  3543. // "scopes": [
  3544. // "https://www.googleapis.com/auth/androidpublisher"
  3545. // ]
  3546. // }
  3547. }
  3548. // method id "androidpublisher.edits.apks.list":
  3549. type EditsApksListCall struct {
  3550. s *Service
  3551. packageNameid string
  3552. editId string
  3553. urlParams_ gensupport.URLParams
  3554. ifNoneMatch_ string
  3555. ctx_ context.Context
  3556. header_ http.Header
  3557. }
  3558. // List:
  3559. func (r *EditsApksService) List(packageNameid string, editId string) *EditsApksListCall {
  3560. c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3561. c.packageNameid = packageNameid
  3562. c.editId = editId
  3563. return c
  3564. }
  3565. // Fields allows partial responses to be retrieved. See
  3566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3567. // for more information.
  3568. func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall {
  3569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3570. return c
  3571. }
  3572. // IfNoneMatch sets the optional parameter which makes the operation
  3573. // fail if the object's ETag matches the given value. This is useful for
  3574. // getting updates only after the object has changed since the last
  3575. // request. Use googleapi.IsNotModified to check whether the response
  3576. // error from Do is the result of In-None-Match.
  3577. func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall {
  3578. c.ifNoneMatch_ = entityTag
  3579. return c
  3580. }
  3581. // Context sets the context to be used in this call's Do method. Any
  3582. // pending HTTP request will be aborted if the provided context is
  3583. // canceled.
  3584. func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall {
  3585. c.ctx_ = ctx
  3586. return c
  3587. }
  3588. // Header returns an http.Header that can be modified by the caller to
  3589. // add HTTP headers to the request.
  3590. func (c *EditsApksListCall) Header() http.Header {
  3591. if c.header_ == nil {
  3592. c.header_ = make(http.Header)
  3593. }
  3594. return c.header_
  3595. }
  3596. func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) {
  3597. reqHeaders := make(http.Header)
  3598. for k, v := range c.header_ {
  3599. reqHeaders[k] = v
  3600. }
  3601. reqHeaders.Set("User-Agent", c.s.userAgent())
  3602. if c.ifNoneMatch_ != "" {
  3603. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3604. }
  3605. var body io.Reader = nil
  3606. c.urlParams_.Set("alt", alt)
  3607. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  3608. urls += "?" + c.urlParams_.Encode()
  3609. req, _ := http.NewRequest("GET", urls, body)
  3610. req.Header = reqHeaders
  3611. googleapi.Expand(req.URL, map[string]string{
  3612. "packageName": c.packageNameid,
  3613. "editId": c.editId,
  3614. })
  3615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3616. }
  3617. // Do executes the "androidpublisher.edits.apks.list" call.
  3618. // Exactly one of *ApksListResponse or error will be non-nil. Any
  3619. // non-2xx status code is an error. Response headers are in either
  3620. // *ApksListResponse.ServerResponse.Header or (if a response was
  3621. // returned at all) in error.(*googleapi.Error).Header. Use
  3622. // googleapi.IsNotModified to check whether the returned error was
  3623. // because http.StatusNotModified was returned.
  3624. func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) {
  3625. gensupport.SetOptions(c.urlParams_, opts...)
  3626. res, err := c.doRequest("json")
  3627. if res != nil && res.StatusCode == http.StatusNotModified {
  3628. if res.Body != nil {
  3629. res.Body.Close()
  3630. }
  3631. return nil, &googleapi.Error{
  3632. Code: res.StatusCode,
  3633. Header: res.Header,
  3634. }
  3635. }
  3636. if err != nil {
  3637. return nil, err
  3638. }
  3639. defer googleapi.CloseBody(res)
  3640. if err := googleapi.CheckResponse(res); err != nil {
  3641. return nil, err
  3642. }
  3643. ret := &ApksListResponse{
  3644. ServerResponse: googleapi.ServerResponse{
  3645. Header: res.Header,
  3646. HTTPStatusCode: res.StatusCode,
  3647. },
  3648. }
  3649. target := &ret
  3650. if err := gensupport.DecodeResponse(target, res); err != nil {
  3651. return nil, err
  3652. }
  3653. return ret, nil
  3654. // {
  3655. // "httpMethod": "GET",
  3656. // "id": "androidpublisher.edits.apks.list",
  3657. // "parameterOrder": [
  3658. // "packageName",
  3659. // "editId"
  3660. // ],
  3661. // "parameters": {
  3662. // "editId": {
  3663. // "description": "Unique identifier for this edit.",
  3664. // "location": "path",
  3665. // "required": true,
  3666. // "type": "string"
  3667. // },
  3668. // "packageName": {
  3669. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3670. // "location": "path",
  3671. // "required": true,
  3672. // "type": "string"
  3673. // }
  3674. // },
  3675. // "path": "{packageName}/edits/{editId}/apks",
  3676. // "response": {
  3677. // "$ref": "ApksListResponse"
  3678. // },
  3679. // "scopes": [
  3680. // "https://www.googleapis.com/auth/androidpublisher"
  3681. // ]
  3682. // }
  3683. }
  3684. // method id "androidpublisher.edits.apks.upload":
  3685. type EditsApksUploadCall struct {
  3686. s *Service
  3687. packageNameid string
  3688. editId string
  3689. urlParams_ gensupport.URLParams
  3690. mediaInfo_ *gensupport.MediaInfo
  3691. ctx_ context.Context
  3692. header_ http.Header
  3693. }
  3694. // Upload:
  3695. func (r *EditsApksService) Upload(packageNameid string, editId string) *EditsApksUploadCall {
  3696. c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3697. c.packageNameid = packageNameid
  3698. c.editId = editId
  3699. return c
  3700. }
  3701. // Media specifies the media to upload in one or more chunks. The chunk
  3702. // size may be controlled by supplying a MediaOption generated by
  3703. // googleapi.ChunkSize. The chunk size defaults to
  3704. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3705. // upload request will be determined by sniffing the contents of r,
  3706. // unless a MediaOption generated by googleapi.ContentType is
  3707. // supplied.
  3708. // At most one of Media and ResumableMedia may be set.
  3709. func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall {
  3710. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3711. return c
  3712. }
  3713. // ResumableMedia specifies the media to upload in chunks and can be
  3714. // canceled with ctx.
  3715. //
  3716. // Deprecated: use Media instead.
  3717. //
  3718. // At most one of Media and ResumableMedia may be set. mediaType
  3719. // identifies the MIME media type of the upload, such as "image/png". If
  3720. // mediaType is "", it will be auto-detected. The provided ctx will
  3721. // supersede any context previously provided to the Context method.
  3722. func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall {
  3723. c.ctx_ = ctx
  3724. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3725. return c
  3726. }
  3727. // ProgressUpdater provides a callback function that will be called
  3728. // after every chunk. It should be a low-latency function in order to
  3729. // not slow down the upload operation. This should only be called when
  3730. // using ResumableMedia (as opposed to Media).
  3731. func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall {
  3732. c.mediaInfo_.SetProgressUpdater(pu)
  3733. return c
  3734. }
  3735. // Fields allows partial responses to be retrieved. See
  3736. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3737. // for more information.
  3738. func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall {
  3739. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3740. return c
  3741. }
  3742. // Context sets the context to be used in this call's Do method. Any
  3743. // pending HTTP request will be aborted if the provided context is
  3744. // canceled.
  3745. // This context will supersede any context previously provided to the
  3746. // ResumableMedia method.
  3747. func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall {
  3748. c.ctx_ = ctx
  3749. return c
  3750. }
  3751. // Header returns an http.Header that can be modified by the caller to
  3752. // add HTTP headers to the request.
  3753. func (c *EditsApksUploadCall) Header() http.Header {
  3754. if c.header_ == nil {
  3755. c.header_ = make(http.Header)
  3756. }
  3757. return c.header_
  3758. }
  3759. func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) {
  3760. reqHeaders := make(http.Header)
  3761. for k, v := range c.header_ {
  3762. reqHeaders[k] = v
  3763. }
  3764. reqHeaders.Set("User-Agent", c.s.userAgent())
  3765. var body io.Reader = nil
  3766. c.urlParams_.Set("alt", alt)
  3767. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  3768. if c.mediaInfo_ != nil {
  3769. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3770. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3771. }
  3772. if body == nil {
  3773. body = new(bytes.Buffer)
  3774. reqHeaders.Set("Content-Type", "application/json")
  3775. }
  3776. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3777. defer cleanup()
  3778. urls += "?" + c.urlParams_.Encode()
  3779. req, _ := http.NewRequest("POST", urls, body)
  3780. req.Header = reqHeaders
  3781. gensupport.SetGetBody(req, getBody)
  3782. googleapi.Expand(req.URL, map[string]string{
  3783. "packageName": c.packageNameid,
  3784. "editId": c.editId,
  3785. })
  3786. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3787. }
  3788. // Do executes the "androidpublisher.edits.apks.upload" call.
  3789. // Exactly one of *Apk or error will be non-nil. Any non-2xx status code
  3790. // is an error. Response headers are in either
  3791. // *Apk.ServerResponse.Header or (if a response was returned at all) in
  3792. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3793. // whether the returned error was because http.StatusNotModified was
  3794. // returned.
  3795. func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) {
  3796. gensupport.SetOptions(c.urlParams_, opts...)
  3797. res, err := c.doRequest("json")
  3798. if res != nil && res.StatusCode == http.StatusNotModified {
  3799. if res.Body != nil {
  3800. res.Body.Close()
  3801. }
  3802. return nil, &googleapi.Error{
  3803. Code: res.StatusCode,
  3804. Header: res.Header,
  3805. }
  3806. }
  3807. if err != nil {
  3808. return nil, err
  3809. }
  3810. defer googleapi.CloseBody(res)
  3811. if err := googleapi.CheckResponse(res); err != nil {
  3812. return nil, err
  3813. }
  3814. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3815. if rx != nil {
  3816. rx.Client = c.s.client
  3817. rx.UserAgent = c.s.userAgent()
  3818. ctx := c.ctx_
  3819. if ctx == nil {
  3820. ctx = context.TODO()
  3821. }
  3822. res, err = rx.Upload(ctx)
  3823. if err != nil {
  3824. return nil, err
  3825. }
  3826. defer res.Body.Close()
  3827. if err := googleapi.CheckResponse(res); err != nil {
  3828. return nil, err
  3829. }
  3830. }
  3831. ret := &Apk{
  3832. ServerResponse: googleapi.ServerResponse{
  3833. Header: res.Header,
  3834. HTTPStatusCode: res.StatusCode,
  3835. },
  3836. }
  3837. target := &ret
  3838. if err := gensupport.DecodeResponse(target, res); err != nil {
  3839. return nil, err
  3840. }
  3841. return ret, nil
  3842. // {
  3843. // "httpMethod": "POST",
  3844. // "id": "androidpublisher.edits.apks.upload",
  3845. // "mediaUpload": {
  3846. // "accept": [
  3847. // "application/octet-stream",
  3848. // "application/vnd.android.package-archive"
  3849. // ],
  3850. // "maxSize": "1GB",
  3851. // "protocols": {
  3852. // "resumable": {
  3853. // "multipart": true,
  3854. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks"
  3855. // },
  3856. // "simple": {
  3857. // "multipart": true,
  3858. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks"
  3859. // }
  3860. // }
  3861. // },
  3862. // "parameterOrder": [
  3863. // "packageName",
  3864. // "editId"
  3865. // ],
  3866. // "parameters": {
  3867. // "editId": {
  3868. // "description": "Unique identifier for this edit.",
  3869. // "location": "path",
  3870. // "required": true,
  3871. // "type": "string"
  3872. // },
  3873. // "packageName": {
  3874. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3875. // "location": "path",
  3876. // "required": true,
  3877. // "type": "string"
  3878. // }
  3879. // },
  3880. // "path": "{packageName}/edits/{editId}/apks",
  3881. // "response": {
  3882. // "$ref": "Apk"
  3883. // },
  3884. // "scopes": [
  3885. // "https://www.googleapis.com/auth/androidpublisher"
  3886. // ],
  3887. // "supportsMediaUpload": true
  3888. // }
  3889. }
  3890. // method id "androidpublisher.edits.bundles.list":
  3891. type EditsBundlesListCall struct {
  3892. s *Service
  3893. packageNameid string
  3894. editId string
  3895. urlParams_ gensupport.URLParams
  3896. ifNoneMatch_ string
  3897. ctx_ context.Context
  3898. header_ http.Header
  3899. }
  3900. // List:
  3901. func (r *EditsBundlesService) List(packageNameid string, editId string) *EditsBundlesListCall {
  3902. c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3903. c.packageNameid = packageNameid
  3904. c.editId = editId
  3905. return c
  3906. }
  3907. // Fields allows partial responses to be retrieved. See
  3908. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3909. // for more information.
  3910. func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall {
  3911. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3912. return c
  3913. }
  3914. // IfNoneMatch sets the optional parameter which makes the operation
  3915. // fail if the object's ETag matches the given value. This is useful for
  3916. // getting updates only after the object has changed since the last
  3917. // request. Use googleapi.IsNotModified to check whether the response
  3918. // error from Do is the result of In-None-Match.
  3919. func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall {
  3920. c.ifNoneMatch_ = entityTag
  3921. return c
  3922. }
  3923. // Context sets the context to be used in this call's Do method. Any
  3924. // pending HTTP request will be aborted if the provided context is
  3925. // canceled.
  3926. func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall {
  3927. c.ctx_ = ctx
  3928. return c
  3929. }
  3930. // Header returns an http.Header that can be modified by the caller to
  3931. // add HTTP headers to the request.
  3932. func (c *EditsBundlesListCall) Header() http.Header {
  3933. if c.header_ == nil {
  3934. c.header_ = make(http.Header)
  3935. }
  3936. return c.header_
  3937. }
  3938. func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) {
  3939. reqHeaders := make(http.Header)
  3940. for k, v := range c.header_ {
  3941. reqHeaders[k] = v
  3942. }
  3943. reqHeaders.Set("User-Agent", c.s.userAgent())
  3944. if c.ifNoneMatch_ != "" {
  3945. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3946. }
  3947. var body io.Reader = nil
  3948. c.urlParams_.Set("alt", alt)
  3949. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  3950. urls += "?" + c.urlParams_.Encode()
  3951. req, _ := http.NewRequest("GET", urls, body)
  3952. req.Header = reqHeaders
  3953. googleapi.Expand(req.URL, map[string]string{
  3954. "packageName": c.packageNameid,
  3955. "editId": c.editId,
  3956. })
  3957. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3958. }
  3959. // Do executes the "androidpublisher.edits.bundles.list" call.
  3960. // Exactly one of *BundlesListResponse or error will be non-nil. Any
  3961. // non-2xx status code is an error. Response headers are in either
  3962. // *BundlesListResponse.ServerResponse.Header or (if a response was
  3963. // returned at all) in error.(*googleapi.Error).Header. Use
  3964. // googleapi.IsNotModified to check whether the returned error was
  3965. // because http.StatusNotModified was returned.
  3966. func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) {
  3967. gensupport.SetOptions(c.urlParams_, opts...)
  3968. res, err := c.doRequest("json")
  3969. if res != nil && res.StatusCode == http.StatusNotModified {
  3970. if res.Body != nil {
  3971. res.Body.Close()
  3972. }
  3973. return nil, &googleapi.Error{
  3974. Code: res.StatusCode,
  3975. Header: res.Header,
  3976. }
  3977. }
  3978. if err != nil {
  3979. return nil, err
  3980. }
  3981. defer googleapi.CloseBody(res)
  3982. if err := googleapi.CheckResponse(res); err != nil {
  3983. return nil, err
  3984. }
  3985. ret := &BundlesListResponse{
  3986. ServerResponse: googleapi.ServerResponse{
  3987. Header: res.Header,
  3988. HTTPStatusCode: res.StatusCode,
  3989. },
  3990. }
  3991. target := &ret
  3992. if err := gensupport.DecodeResponse(target, res); err != nil {
  3993. return nil, err
  3994. }
  3995. return ret, nil
  3996. // {
  3997. // "httpMethod": "GET",
  3998. // "id": "androidpublisher.edits.bundles.list",
  3999. // "parameterOrder": [
  4000. // "packageName",
  4001. // "editId"
  4002. // ],
  4003. // "parameters": {
  4004. // "editId": {
  4005. // "description": "Unique identifier for this edit.",
  4006. // "location": "path",
  4007. // "required": true,
  4008. // "type": "string"
  4009. // },
  4010. // "packageName": {
  4011. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4012. // "location": "path",
  4013. // "required": true,
  4014. // "type": "string"
  4015. // }
  4016. // },
  4017. // "path": "{packageName}/edits/{editId}/bundles",
  4018. // "response": {
  4019. // "$ref": "BundlesListResponse"
  4020. // },
  4021. // "scopes": [
  4022. // "https://www.googleapis.com/auth/androidpublisher"
  4023. // ]
  4024. // }
  4025. }
  4026. // method id "androidpublisher.edits.bundles.upload":
  4027. type EditsBundlesUploadCall struct {
  4028. s *Service
  4029. packageNameid string
  4030. editId string
  4031. urlParams_ gensupport.URLParams
  4032. mediaInfo_ *gensupport.MediaInfo
  4033. ctx_ context.Context
  4034. header_ http.Header
  4035. }
  4036. // Upload: Uploads a new Android App Bundle to this edit. If you are
  4037. // using the Google API client libraries, please increase the timeout of
  4038. // the http request before calling this endpoint (a timeout of 2 minutes
  4039. // is recommended). See:
  4040. // https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in
  4041. // java.
  4042. func (r *EditsBundlesService) Upload(packageNameid string, editId string) *EditsBundlesUploadCall {
  4043. c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4044. c.packageNameid = packageNameid
  4045. c.editId = editId
  4046. return c
  4047. }
  4048. // Media specifies the media to upload in one or more chunks. The chunk
  4049. // size may be controlled by supplying a MediaOption generated by
  4050. // googleapi.ChunkSize. The chunk size defaults to
  4051. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4052. // upload request will be determined by sniffing the contents of r,
  4053. // unless a MediaOption generated by googleapi.ContentType is
  4054. // supplied.
  4055. // At most one of Media and ResumableMedia may be set.
  4056. func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall {
  4057. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4058. return c
  4059. }
  4060. // ResumableMedia specifies the media to upload in chunks and can be
  4061. // canceled with ctx.
  4062. //
  4063. // Deprecated: use Media instead.
  4064. //
  4065. // At most one of Media and ResumableMedia may be set. mediaType
  4066. // identifies the MIME media type of the upload, such as "image/png". If
  4067. // mediaType is "", it will be auto-detected. The provided ctx will
  4068. // supersede any context previously provided to the Context method.
  4069. func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall {
  4070. c.ctx_ = ctx
  4071. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4072. return c
  4073. }
  4074. // ProgressUpdater provides a callback function that will be called
  4075. // after every chunk. It should be a low-latency function in order to
  4076. // not slow down the upload operation. This should only be called when
  4077. // using ResumableMedia (as opposed to Media).
  4078. func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall {
  4079. c.mediaInfo_.SetProgressUpdater(pu)
  4080. return c
  4081. }
  4082. // Fields allows partial responses to be retrieved. See
  4083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4084. // for more information.
  4085. func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall {
  4086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4087. return c
  4088. }
  4089. // Context sets the context to be used in this call's Do method. Any
  4090. // pending HTTP request will be aborted if the provided context is
  4091. // canceled.
  4092. // This context will supersede any context previously provided to the
  4093. // ResumableMedia method.
  4094. func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall {
  4095. c.ctx_ = ctx
  4096. return c
  4097. }
  4098. // Header returns an http.Header that can be modified by the caller to
  4099. // add HTTP headers to the request.
  4100. func (c *EditsBundlesUploadCall) Header() http.Header {
  4101. if c.header_ == nil {
  4102. c.header_ = make(http.Header)
  4103. }
  4104. return c.header_
  4105. }
  4106. func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) {
  4107. reqHeaders := make(http.Header)
  4108. for k, v := range c.header_ {
  4109. reqHeaders[k] = v
  4110. }
  4111. reqHeaders.Set("User-Agent", c.s.userAgent())
  4112. var body io.Reader = nil
  4113. c.urlParams_.Set("alt", alt)
  4114. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  4115. if c.mediaInfo_ != nil {
  4116. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  4117. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4118. }
  4119. if body == nil {
  4120. body = new(bytes.Buffer)
  4121. reqHeaders.Set("Content-Type", "application/json")
  4122. }
  4123. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4124. defer cleanup()
  4125. urls += "?" + c.urlParams_.Encode()
  4126. req, _ := http.NewRequest("POST", urls, body)
  4127. req.Header = reqHeaders
  4128. gensupport.SetGetBody(req, getBody)
  4129. googleapi.Expand(req.URL, map[string]string{
  4130. "packageName": c.packageNameid,
  4131. "editId": c.editId,
  4132. })
  4133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4134. }
  4135. // Do executes the "androidpublisher.edits.bundles.upload" call.
  4136. // Exactly one of *Bundle or error will be non-nil. Any non-2xx status
  4137. // code is an error. Response headers are in either
  4138. // *Bundle.ServerResponse.Header or (if a response was returned at all)
  4139. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4140. // check whether the returned error was because http.StatusNotModified
  4141. // was returned.
  4142. func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) {
  4143. gensupport.SetOptions(c.urlParams_, opts...)
  4144. res, err := c.doRequest("json")
  4145. if res != nil && res.StatusCode == http.StatusNotModified {
  4146. if res.Body != nil {
  4147. res.Body.Close()
  4148. }
  4149. return nil, &googleapi.Error{
  4150. Code: res.StatusCode,
  4151. Header: res.Header,
  4152. }
  4153. }
  4154. if err != nil {
  4155. return nil, err
  4156. }
  4157. defer googleapi.CloseBody(res)
  4158. if err := googleapi.CheckResponse(res); err != nil {
  4159. return nil, err
  4160. }
  4161. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4162. if rx != nil {
  4163. rx.Client = c.s.client
  4164. rx.UserAgent = c.s.userAgent()
  4165. ctx := c.ctx_
  4166. if ctx == nil {
  4167. ctx = context.TODO()
  4168. }
  4169. res, err = rx.Upload(ctx)
  4170. if err != nil {
  4171. return nil, err
  4172. }
  4173. defer res.Body.Close()
  4174. if err := googleapi.CheckResponse(res); err != nil {
  4175. return nil, err
  4176. }
  4177. }
  4178. ret := &Bundle{
  4179. ServerResponse: googleapi.ServerResponse{
  4180. Header: res.Header,
  4181. HTTPStatusCode: res.StatusCode,
  4182. },
  4183. }
  4184. target := &ret
  4185. if err := gensupport.DecodeResponse(target, res); err != nil {
  4186. return nil, err
  4187. }
  4188. return ret, nil
  4189. // {
  4190. // "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.",
  4191. // "httpMethod": "POST",
  4192. // "id": "androidpublisher.edits.bundles.upload",
  4193. // "mediaUpload": {
  4194. // "accept": [
  4195. // "application/octet-stream"
  4196. // ],
  4197. // "maxSize": "2GB",
  4198. // "protocols": {
  4199. // "resumable": {
  4200. // "multipart": true,
  4201. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/bundles"
  4202. // },
  4203. // "simple": {
  4204. // "multipart": true,
  4205. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/bundles"
  4206. // }
  4207. // }
  4208. // },
  4209. // "parameterOrder": [
  4210. // "packageName",
  4211. // "editId"
  4212. // ],
  4213. // "parameters": {
  4214. // "editId": {
  4215. // "description": "Unique identifier for this edit.",
  4216. // "location": "path",
  4217. // "required": true,
  4218. // "type": "string"
  4219. // },
  4220. // "packageName": {
  4221. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4222. // "location": "path",
  4223. // "required": true,
  4224. // "type": "string"
  4225. // }
  4226. // },
  4227. // "path": "{packageName}/edits/{editId}/bundles",
  4228. // "response": {
  4229. // "$ref": "Bundle"
  4230. // },
  4231. // "scopes": [
  4232. // "https://www.googleapis.com/auth/androidpublisher"
  4233. // ],
  4234. // "supportsMediaUpload": true
  4235. // }
  4236. }
  4237. // method id "androidpublisher.edits.deobfuscationfiles.upload":
  4238. type EditsDeobfuscationfilesUploadCall struct {
  4239. s *Service
  4240. packageNameid string
  4241. editId string
  4242. apkVersionCode int64
  4243. deobfuscationFileType string
  4244. urlParams_ gensupport.URLParams
  4245. mediaInfo_ *gensupport.MediaInfo
  4246. ctx_ context.Context
  4247. header_ http.Header
  4248. }
  4249. // Upload: Uploads the deobfuscation file of the specified APK. If a
  4250. // deobfuscation file already exists, it will be replaced.
  4251. func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall {
  4252. c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4253. c.packageNameid = packageNameid
  4254. c.editId = editId
  4255. c.apkVersionCode = apkVersionCode
  4256. c.deobfuscationFileType = deobfuscationFileType
  4257. return c
  4258. }
  4259. // Media specifies the media to upload in one or more chunks. The chunk
  4260. // size may be controlled by supplying a MediaOption generated by
  4261. // googleapi.ChunkSize. The chunk size defaults to
  4262. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4263. // upload request will be determined by sniffing the contents of r,
  4264. // unless a MediaOption generated by googleapi.ContentType is
  4265. // supplied.
  4266. // At most one of Media and ResumableMedia may be set.
  4267. func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall {
  4268. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4269. return c
  4270. }
  4271. // ResumableMedia specifies the media to upload in chunks and can be
  4272. // canceled with ctx.
  4273. //
  4274. // Deprecated: use Media instead.
  4275. //
  4276. // At most one of Media and ResumableMedia may be set. mediaType
  4277. // identifies the MIME media type of the upload, such as "image/png". If
  4278. // mediaType is "", it will be auto-detected. The provided ctx will
  4279. // supersede any context previously provided to the Context method.
  4280. func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall {
  4281. c.ctx_ = ctx
  4282. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4283. return c
  4284. }
  4285. // ProgressUpdater provides a callback function that will be called
  4286. // after every chunk. It should be a low-latency function in order to
  4287. // not slow down the upload operation. This should only be called when
  4288. // using ResumableMedia (as opposed to Media).
  4289. func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall {
  4290. c.mediaInfo_.SetProgressUpdater(pu)
  4291. return c
  4292. }
  4293. // Fields allows partial responses to be retrieved. See
  4294. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4295. // for more information.
  4296. func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall {
  4297. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4298. return c
  4299. }
  4300. // Context sets the context to be used in this call's Do method. Any
  4301. // pending HTTP request will be aborted if the provided context is
  4302. // canceled.
  4303. // This context will supersede any context previously provided to the
  4304. // ResumableMedia method.
  4305. func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall {
  4306. c.ctx_ = ctx
  4307. return c
  4308. }
  4309. // Header returns an http.Header that can be modified by the caller to
  4310. // add HTTP headers to the request.
  4311. func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header {
  4312. if c.header_ == nil {
  4313. c.header_ = make(http.Header)
  4314. }
  4315. return c.header_
  4316. }
  4317. func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  4318. reqHeaders := make(http.Header)
  4319. for k, v := range c.header_ {
  4320. reqHeaders[k] = v
  4321. }
  4322. reqHeaders.Set("User-Agent", c.s.userAgent())
  4323. var body io.Reader = nil
  4324. c.urlParams_.Set("alt", alt)
  4325. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}")
  4326. if c.mediaInfo_ != nil {
  4327. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  4328. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4329. }
  4330. if body == nil {
  4331. body = new(bytes.Buffer)
  4332. reqHeaders.Set("Content-Type", "application/json")
  4333. }
  4334. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4335. defer cleanup()
  4336. urls += "?" + c.urlParams_.Encode()
  4337. req, _ := http.NewRequest("POST", urls, body)
  4338. req.Header = reqHeaders
  4339. gensupport.SetGetBody(req, getBody)
  4340. googleapi.Expand(req.URL, map[string]string{
  4341. "packageName": c.packageNameid,
  4342. "editId": c.editId,
  4343. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4344. "deobfuscationFileType": c.deobfuscationFileType,
  4345. })
  4346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4347. }
  4348. // Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call.
  4349. // Exactly one of *DeobfuscationFilesUploadResponse or error will be
  4350. // non-nil. Any non-2xx status code is an error. Response headers are in
  4351. // either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if
  4352. // a response was returned at all) in error.(*googleapi.Error).Header.
  4353. // Use googleapi.IsNotModified to check whether the returned error was
  4354. // because http.StatusNotModified was returned.
  4355. func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) {
  4356. gensupport.SetOptions(c.urlParams_, opts...)
  4357. res, err := c.doRequest("json")
  4358. if res != nil && res.StatusCode == http.StatusNotModified {
  4359. if res.Body != nil {
  4360. res.Body.Close()
  4361. }
  4362. return nil, &googleapi.Error{
  4363. Code: res.StatusCode,
  4364. Header: res.Header,
  4365. }
  4366. }
  4367. if err != nil {
  4368. return nil, err
  4369. }
  4370. defer googleapi.CloseBody(res)
  4371. if err := googleapi.CheckResponse(res); err != nil {
  4372. return nil, err
  4373. }
  4374. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4375. if rx != nil {
  4376. rx.Client = c.s.client
  4377. rx.UserAgent = c.s.userAgent()
  4378. ctx := c.ctx_
  4379. if ctx == nil {
  4380. ctx = context.TODO()
  4381. }
  4382. res, err = rx.Upload(ctx)
  4383. if err != nil {
  4384. return nil, err
  4385. }
  4386. defer res.Body.Close()
  4387. if err := googleapi.CheckResponse(res); err != nil {
  4388. return nil, err
  4389. }
  4390. }
  4391. ret := &DeobfuscationFilesUploadResponse{
  4392. ServerResponse: googleapi.ServerResponse{
  4393. Header: res.Header,
  4394. HTTPStatusCode: res.StatusCode,
  4395. },
  4396. }
  4397. target := &ret
  4398. if err := gensupport.DecodeResponse(target, res); err != nil {
  4399. return nil, err
  4400. }
  4401. return ret, nil
  4402. // {
  4403. // "description": "Uploads the deobfuscation file of the specified APK. If a deobfuscation file already exists, it will be replaced.",
  4404. // "httpMethod": "POST",
  4405. // "id": "androidpublisher.edits.deobfuscationfiles.upload",
  4406. // "mediaUpload": {
  4407. // "accept": [
  4408. // "application/octet-stream"
  4409. // ],
  4410. // "maxSize": "300MB",
  4411. // "protocols": {
  4412. // "resumable": {
  4413. // "multipart": true,
  4414. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  4415. // },
  4416. // "simple": {
  4417. // "multipart": true,
  4418. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  4419. // }
  4420. // }
  4421. // },
  4422. // "parameterOrder": [
  4423. // "packageName",
  4424. // "editId",
  4425. // "apkVersionCode",
  4426. // "deobfuscationFileType"
  4427. // ],
  4428. // "parameters": {
  4429. // "apkVersionCode": {
  4430. // "description": "The version code of the APK whose deobfuscation file is being uploaded.",
  4431. // "format": "int32",
  4432. // "location": "path",
  4433. // "required": true,
  4434. // "type": "integer"
  4435. // },
  4436. // "deobfuscationFileType": {
  4437. // "enum": [
  4438. // "proguard"
  4439. // ],
  4440. // "enumDescriptions": [
  4441. // ""
  4442. // ],
  4443. // "location": "path",
  4444. // "required": true,
  4445. // "type": "string"
  4446. // },
  4447. // "editId": {
  4448. // "description": "Unique identifier for this edit.",
  4449. // "location": "path",
  4450. // "required": true,
  4451. // "type": "string"
  4452. // },
  4453. // "packageName": {
  4454. // "description": "Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, \"com.spiffygame\".",
  4455. // "location": "path",
  4456. // "required": true,
  4457. // "type": "string"
  4458. // }
  4459. // },
  4460. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}",
  4461. // "response": {
  4462. // "$ref": "DeobfuscationFilesUploadResponse"
  4463. // },
  4464. // "scopes": [
  4465. // "https://www.googleapis.com/auth/androidpublisher"
  4466. // ],
  4467. // "supportsMediaUpload": true
  4468. // }
  4469. }
  4470. // method id "androidpublisher.edits.details.get":
  4471. type EditsDetailsGetCall struct {
  4472. s *Service
  4473. packageNameid string
  4474. editId string
  4475. urlParams_ gensupport.URLParams
  4476. ifNoneMatch_ string
  4477. ctx_ context.Context
  4478. header_ http.Header
  4479. }
  4480. // Get: Fetches app details for this edit. This includes the default
  4481. // language and developer support contact information.
  4482. func (r *EditsDetailsService) Get(packageNameid string, editId string) *EditsDetailsGetCall {
  4483. c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4484. c.packageNameid = packageNameid
  4485. c.editId = editId
  4486. return c
  4487. }
  4488. // Fields allows partial responses to be retrieved. See
  4489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4490. // for more information.
  4491. func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall {
  4492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4493. return c
  4494. }
  4495. // IfNoneMatch sets the optional parameter which makes the operation
  4496. // fail if the object's ETag matches the given value. This is useful for
  4497. // getting updates only after the object has changed since the last
  4498. // request. Use googleapi.IsNotModified to check whether the response
  4499. // error from Do is the result of In-None-Match.
  4500. func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall {
  4501. c.ifNoneMatch_ = entityTag
  4502. return c
  4503. }
  4504. // Context sets the context to be used in this call's Do method. Any
  4505. // pending HTTP request will be aborted if the provided context is
  4506. // canceled.
  4507. func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall {
  4508. c.ctx_ = ctx
  4509. return c
  4510. }
  4511. // Header returns an http.Header that can be modified by the caller to
  4512. // add HTTP headers to the request.
  4513. func (c *EditsDetailsGetCall) Header() http.Header {
  4514. if c.header_ == nil {
  4515. c.header_ = make(http.Header)
  4516. }
  4517. return c.header_
  4518. }
  4519. func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) {
  4520. reqHeaders := make(http.Header)
  4521. for k, v := range c.header_ {
  4522. reqHeaders[k] = v
  4523. }
  4524. reqHeaders.Set("User-Agent", c.s.userAgent())
  4525. if c.ifNoneMatch_ != "" {
  4526. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4527. }
  4528. var body io.Reader = nil
  4529. c.urlParams_.Set("alt", alt)
  4530. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4531. urls += "?" + c.urlParams_.Encode()
  4532. req, _ := http.NewRequest("GET", urls, body)
  4533. req.Header = reqHeaders
  4534. googleapi.Expand(req.URL, map[string]string{
  4535. "packageName": c.packageNameid,
  4536. "editId": c.editId,
  4537. })
  4538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4539. }
  4540. // Do executes the "androidpublisher.edits.details.get" call.
  4541. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  4542. // status code is an error. Response headers are in either
  4543. // *AppDetails.ServerResponse.Header or (if a response was returned at
  4544. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4545. // to check whether the returned error was because
  4546. // http.StatusNotModified was returned.
  4547. func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  4548. gensupport.SetOptions(c.urlParams_, opts...)
  4549. res, err := c.doRequest("json")
  4550. if res != nil && res.StatusCode == http.StatusNotModified {
  4551. if res.Body != nil {
  4552. res.Body.Close()
  4553. }
  4554. return nil, &googleapi.Error{
  4555. Code: res.StatusCode,
  4556. Header: res.Header,
  4557. }
  4558. }
  4559. if err != nil {
  4560. return nil, err
  4561. }
  4562. defer googleapi.CloseBody(res)
  4563. if err := googleapi.CheckResponse(res); err != nil {
  4564. return nil, err
  4565. }
  4566. ret := &AppDetails{
  4567. ServerResponse: googleapi.ServerResponse{
  4568. Header: res.Header,
  4569. HTTPStatusCode: res.StatusCode,
  4570. },
  4571. }
  4572. target := &ret
  4573. if err := gensupport.DecodeResponse(target, res); err != nil {
  4574. return nil, err
  4575. }
  4576. return ret, nil
  4577. // {
  4578. // "description": "Fetches app details for this edit. This includes the default language and developer support contact information.",
  4579. // "httpMethod": "GET",
  4580. // "id": "androidpublisher.edits.details.get",
  4581. // "parameterOrder": [
  4582. // "packageName",
  4583. // "editId"
  4584. // ],
  4585. // "parameters": {
  4586. // "editId": {
  4587. // "description": "Unique identifier for this edit.",
  4588. // "location": "path",
  4589. // "required": true,
  4590. // "type": "string"
  4591. // },
  4592. // "packageName": {
  4593. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4594. // "location": "path",
  4595. // "required": true,
  4596. // "type": "string"
  4597. // }
  4598. // },
  4599. // "path": "{packageName}/edits/{editId}/details",
  4600. // "response": {
  4601. // "$ref": "AppDetails"
  4602. // },
  4603. // "scopes": [
  4604. // "https://www.googleapis.com/auth/androidpublisher"
  4605. // ]
  4606. // }
  4607. }
  4608. // method id "androidpublisher.edits.details.patch":
  4609. type EditsDetailsPatchCall struct {
  4610. s *Service
  4611. packageNameid string
  4612. editId string
  4613. appdetails *AppDetails
  4614. urlParams_ gensupport.URLParams
  4615. ctx_ context.Context
  4616. header_ http.Header
  4617. }
  4618. // Patch: Updates app details for this edit. This method supports patch
  4619. // semantics.
  4620. func (r *EditsDetailsService) Patch(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall {
  4621. c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4622. c.packageNameid = packageNameid
  4623. c.editId = editId
  4624. c.appdetails = appdetails
  4625. return c
  4626. }
  4627. // Fields allows partial responses to be retrieved. See
  4628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4629. // for more information.
  4630. func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall {
  4631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4632. return c
  4633. }
  4634. // Context sets the context to be used in this call's Do method. Any
  4635. // pending HTTP request will be aborted if the provided context is
  4636. // canceled.
  4637. func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall {
  4638. c.ctx_ = ctx
  4639. return c
  4640. }
  4641. // Header returns an http.Header that can be modified by the caller to
  4642. // add HTTP headers to the request.
  4643. func (c *EditsDetailsPatchCall) Header() http.Header {
  4644. if c.header_ == nil {
  4645. c.header_ = make(http.Header)
  4646. }
  4647. return c.header_
  4648. }
  4649. func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) {
  4650. reqHeaders := make(http.Header)
  4651. for k, v := range c.header_ {
  4652. reqHeaders[k] = v
  4653. }
  4654. reqHeaders.Set("User-Agent", c.s.userAgent())
  4655. var body io.Reader = nil
  4656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  4657. if err != nil {
  4658. return nil, err
  4659. }
  4660. reqHeaders.Set("Content-Type", "application/json")
  4661. c.urlParams_.Set("alt", alt)
  4662. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4663. urls += "?" + c.urlParams_.Encode()
  4664. req, _ := http.NewRequest("PATCH", urls, body)
  4665. req.Header = reqHeaders
  4666. googleapi.Expand(req.URL, map[string]string{
  4667. "packageName": c.packageNameid,
  4668. "editId": c.editId,
  4669. })
  4670. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4671. }
  4672. // Do executes the "androidpublisher.edits.details.patch" call.
  4673. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  4674. // status code is an error. Response headers are in either
  4675. // *AppDetails.ServerResponse.Header or (if a response was returned at
  4676. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4677. // to check whether the returned error was because
  4678. // http.StatusNotModified was returned.
  4679. func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  4680. gensupport.SetOptions(c.urlParams_, opts...)
  4681. res, err := c.doRequest("json")
  4682. if res != nil && res.StatusCode == http.StatusNotModified {
  4683. if res.Body != nil {
  4684. res.Body.Close()
  4685. }
  4686. return nil, &googleapi.Error{
  4687. Code: res.StatusCode,
  4688. Header: res.Header,
  4689. }
  4690. }
  4691. if err != nil {
  4692. return nil, err
  4693. }
  4694. defer googleapi.CloseBody(res)
  4695. if err := googleapi.CheckResponse(res); err != nil {
  4696. return nil, err
  4697. }
  4698. ret := &AppDetails{
  4699. ServerResponse: googleapi.ServerResponse{
  4700. Header: res.Header,
  4701. HTTPStatusCode: res.StatusCode,
  4702. },
  4703. }
  4704. target := &ret
  4705. if err := gensupport.DecodeResponse(target, res); err != nil {
  4706. return nil, err
  4707. }
  4708. return ret, nil
  4709. // {
  4710. // "description": "Updates app details for this edit. This method supports patch semantics.",
  4711. // "httpMethod": "PATCH",
  4712. // "id": "androidpublisher.edits.details.patch",
  4713. // "parameterOrder": [
  4714. // "packageName",
  4715. // "editId"
  4716. // ],
  4717. // "parameters": {
  4718. // "editId": {
  4719. // "description": "Unique identifier for this edit.",
  4720. // "location": "path",
  4721. // "required": true,
  4722. // "type": "string"
  4723. // },
  4724. // "packageName": {
  4725. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4726. // "location": "path",
  4727. // "required": true,
  4728. // "type": "string"
  4729. // }
  4730. // },
  4731. // "path": "{packageName}/edits/{editId}/details",
  4732. // "request": {
  4733. // "$ref": "AppDetails"
  4734. // },
  4735. // "response": {
  4736. // "$ref": "AppDetails"
  4737. // },
  4738. // "scopes": [
  4739. // "https://www.googleapis.com/auth/androidpublisher"
  4740. // ]
  4741. // }
  4742. }
  4743. // method id "androidpublisher.edits.details.update":
  4744. type EditsDetailsUpdateCall struct {
  4745. s *Service
  4746. packageNameid string
  4747. editId string
  4748. appdetails *AppDetails
  4749. urlParams_ gensupport.URLParams
  4750. ctx_ context.Context
  4751. header_ http.Header
  4752. }
  4753. // Update: Updates app details for this edit.
  4754. func (r *EditsDetailsService) Update(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall {
  4755. c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4756. c.packageNameid = packageNameid
  4757. c.editId = editId
  4758. c.appdetails = appdetails
  4759. return c
  4760. }
  4761. // Fields allows partial responses to be retrieved. See
  4762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4763. // for more information.
  4764. func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall {
  4765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4766. return c
  4767. }
  4768. // Context sets the context to be used in this call's Do method. Any
  4769. // pending HTTP request will be aborted if the provided context is
  4770. // canceled.
  4771. func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall {
  4772. c.ctx_ = ctx
  4773. return c
  4774. }
  4775. // Header returns an http.Header that can be modified by the caller to
  4776. // add HTTP headers to the request.
  4777. func (c *EditsDetailsUpdateCall) Header() http.Header {
  4778. if c.header_ == nil {
  4779. c.header_ = make(http.Header)
  4780. }
  4781. return c.header_
  4782. }
  4783. func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4784. reqHeaders := make(http.Header)
  4785. for k, v := range c.header_ {
  4786. reqHeaders[k] = v
  4787. }
  4788. reqHeaders.Set("User-Agent", c.s.userAgent())
  4789. var body io.Reader = nil
  4790. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  4791. if err != nil {
  4792. return nil, err
  4793. }
  4794. reqHeaders.Set("Content-Type", "application/json")
  4795. c.urlParams_.Set("alt", alt)
  4796. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  4797. urls += "?" + c.urlParams_.Encode()
  4798. req, _ := http.NewRequest("PUT", urls, body)
  4799. req.Header = reqHeaders
  4800. googleapi.Expand(req.URL, map[string]string{
  4801. "packageName": c.packageNameid,
  4802. "editId": c.editId,
  4803. })
  4804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4805. }
  4806. // Do executes the "androidpublisher.edits.details.update" call.
  4807. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  4808. // status code is an error. Response headers are in either
  4809. // *AppDetails.ServerResponse.Header or (if a response was returned at
  4810. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4811. // to check whether the returned error was because
  4812. // http.StatusNotModified was returned.
  4813. func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  4814. gensupport.SetOptions(c.urlParams_, opts...)
  4815. res, err := c.doRequest("json")
  4816. if res != nil && res.StatusCode == http.StatusNotModified {
  4817. if res.Body != nil {
  4818. res.Body.Close()
  4819. }
  4820. return nil, &googleapi.Error{
  4821. Code: res.StatusCode,
  4822. Header: res.Header,
  4823. }
  4824. }
  4825. if err != nil {
  4826. return nil, err
  4827. }
  4828. defer googleapi.CloseBody(res)
  4829. if err := googleapi.CheckResponse(res); err != nil {
  4830. return nil, err
  4831. }
  4832. ret := &AppDetails{
  4833. ServerResponse: googleapi.ServerResponse{
  4834. Header: res.Header,
  4835. HTTPStatusCode: res.StatusCode,
  4836. },
  4837. }
  4838. target := &ret
  4839. if err := gensupport.DecodeResponse(target, res); err != nil {
  4840. return nil, err
  4841. }
  4842. return ret, nil
  4843. // {
  4844. // "description": "Updates app details for this edit.",
  4845. // "httpMethod": "PUT",
  4846. // "id": "androidpublisher.edits.details.update",
  4847. // "parameterOrder": [
  4848. // "packageName",
  4849. // "editId"
  4850. // ],
  4851. // "parameters": {
  4852. // "editId": {
  4853. // "description": "Unique identifier for this edit.",
  4854. // "location": "path",
  4855. // "required": true,
  4856. // "type": "string"
  4857. // },
  4858. // "packageName": {
  4859. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4860. // "location": "path",
  4861. // "required": true,
  4862. // "type": "string"
  4863. // }
  4864. // },
  4865. // "path": "{packageName}/edits/{editId}/details",
  4866. // "request": {
  4867. // "$ref": "AppDetails"
  4868. // },
  4869. // "response": {
  4870. // "$ref": "AppDetails"
  4871. // },
  4872. // "scopes": [
  4873. // "https://www.googleapis.com/auth/androidpublisher"
  4874. // ]
  4875. // }
  4876. }
  4877. // method id "androidpublisher.edits.expansionfiles.get":
  4878. type EditsExpansionfilesGetCall struct {
  4879. s *Service
  4880. packageNameid string
  4881. editId string
  4882. apkVersionCode int64
  4883. expansionFileType string
  4884. urlParams_ gensupport.URLParams
  4885. ifNoneMatch_ string
  4886. ctx_ context.Context
  4887. header_ http.Header
  4888. }
  4889. // Get: Fetches the Expansion File configuration for the APK specified.
  4890. func (r *EditsExpansionfilesService) Get(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall {
  4891. c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4892. c.packageNameid = packageNameid
  4893. c.editId = editId
  4894. c.apkVersionCode = apkVersionCode
  4895. c.expansionFileType = expansionFileType
  4896. return c
  4897. }
  4898. // Fields allows partial responses to be retrieved. See
  4899. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4900. // for more information.
  4901. func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall {
  4902. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4903. return c
  4904. }
  4905. // IfNoneMatch sets the optional parameter which makes the operation
  4906. // fail if the object's ETag matches the given value. This is useful for
  4907. // getting updates only after the object has changed since the last
  4908. // request. Use googleapi.IsNotModified to check whether the response
  4909. // error from Do is the result of In-None-Match.
  4910. func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall {
  4911. c.ifNoneMatch_ = entityTag
  4912. return c
  4913. }
  4914. // Context sets the context to be used in this call's Do method. Any
  4915. // pending HTTP request will be aborted if the provided context is
  4916. // canceled.
  4917. func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall {
  4918. c.ctx_ = ctx
  4919. return c
  4920. }
  4921. // Header returns an http.Header that can be modified by the caller to
  4922. // add HTTP headers to the request.
  4923. func (c *EditsExpansionfilesGetCall) Header() http.Header {
  4924. if c.header_ == nil {
  4925. c.header_ = make(http.Header)
  4926. }
  4927. return c.header_
  4928. }
  4929. func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) {
  4930. reqHeaders := make(http.Header)
  4931. for k, v := range c.header_ {
  4932. reqHeaders[k] = v
  4933. }
  4934. reqHeaders.Set("User-Agent", c.s.userAgent())
  4935. if c.ifNoneMatch_ != "" {
  4936. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4937. }
  4938. var body io.Reader = nil
  4939. c.urlParams_.Set("alt", alt)
  4940. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4941. urls += "?" + c.urlParams_.Encode()
  4942. req, _ := http.NewRequest("GET", urls, body)
  4943. req.Header = reqHeaders
  4944. googleapi.Expand(req.URL, map[string]string{
  4945. "packageName": c.packageNameid,
  4946. "editId": c.editId,
  4947. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4948. "expansionFileType": c.expansionFileType,
  4949. })
  4950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4951. }
  4952. // Do executes the "androidpublisher.edits.expansionfiles.get" call.
  4953. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4954. // status code is an error. Response headers are in either
  4955. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4956. // at all) in error.(*googleapi.Error).Header. Use
  4957. // googleapi.IsNotModified to check whether the returned error was
  4958. // because http.StatusNotModified was returned.
  4959. func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4960. gensupport.SetOptions(c.urlParams_, opts...)
  4961. res, err := c.doRequest("json")
  4962. if res != nil && res.StatusCode == http.StatusNotModified {
  4963. if res.Body != nil {
  4964. res.Body.Close()
  4965. }
  4966. return nil, &googleapi.Error{
  4967. Code: res.StatusCode,
  4968. Header: res.Header,
  4969. }
  4970. }
  4971. if err != nil {
  4972. return nil, err
  4973. }
  4974. defer googleapi.CloseBody(res)
  4975. if err := googleapi.CheckResponse(res); err != nil {
  4976. return nil, err
  4977. }
  4978. ret := &ExpansionFile{
  4979. ServerResponse: googleapi.ServerResponse{
  4980. Header: res.Header,
  4981. HTTPStatusCode: res.StatusCode,
  4982. },
  4983. }
  4984. target := &ret
  4985. if err := gensupport.DecodeResponse(target, res); err != nil {
  4986. return nil, err
  4987. }
  4988. return ret, nil
  4989. // {
  4990. // "description": "Fetches the Expansion File configuration for the APK specified.",
  4991. // "httpMethod": "GET",
  4992. // "id": "androidpublisher.edits.expansionfiles.get",
  4993. // "parameterOrder": [
  4994. // "packageName",
  4995. // "editId",
  4996. // "apkVersionCode",
  4997. // "expansionFileType"
  4998. // ],
  4999. // "parameters": {
  5000. // "apkVersionCode": {
  5001. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5002. // "format": "int32",
  5003. // "location": "path",
  5004. // "required": true,
  5005. // "type": "integer"
  5006. // },
  5007. // "editId": {
  5008. // "description": "Unique identifier for this edit.",
  5009. // "location": "path",
  5010. // "required": true,
  5011. // "type": "string"
  5012. // },
  5013. // "expansionFileType": {
  5014. // "enum": [
  5015. // "main",
  5016. // "patch"
  5017. // ],
  5018. // "enumDescriptions": [
  5019. // "",
  5020. // ""
  5021. // ],
  5022. // "location": "path",
  5023. // "required": true,
  5024. // "type": "string"
  5025. // },
  5026. // "packageName": {
  5027. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5028. // "location": "path",
  5029. // "required": true,
  5030. // "type": "string"
  5031. // }
  5032. // },
  5033. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5034. // "response": {
  5035. // "$ref": "ExpansionFile"
  5036. // },
  5037. // "scopes": [
  5038. // "https://www.googleapis.com/auth/androidpublisher"
  5039. // ]
  5040. // }
  5041. }
  5042. // method id "androidpublisher.edits.expansionfiles.patch":
  5043. type EditsExpansionfilesPatchCall struct {
  5044. s *Service
  5045. packageNameid string
  5046. editId string
  5047. apkVersionCode int64
  5048. expansionFileType string
  5049. expansionfile *ExpansionFile
  5050. urlParams_ gensupport.URLParams
  5051. ctx_ context.Context
  5052. header_ http.Header
  5053. }
  5054. // Patch: Updates the APK's Expansion File configuration to reference
  5055. // another APK's Expansion Files. To add a new Expansion File use the
  5056. // Upload method. This method supports patch semantics.
  5057. func (r *EditsExpansionfilesService) Patch(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall {
  5058. c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5059. c.packageNameid = packageNameid
  5060. c.editId = editId
  5061. c.apkVersionCode = apkVersionCode
  5062. c.expansionFileType = expansionFileType
  5063. c.expansionfile = expansionfile
  5064. return c
  5065. }
  5066. // Fields allows partial responses to be retrieved. See
  5067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5068. // for more information.
  5069. func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall {
  5070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5071. return c
  5072. }
  5073. // Context sets the context to be used in this call's Do method. Any
  5074. // pending HTTP request will be aborted if the provided context is
  5075. // canceled.
  5076. func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall {
  5077. c.ctx_ = ctx
  5078. return c
  5079. }
  5080. // Header returns an http.Header that can be modified by the caller to
  5081. // add HTTP headers to the request.
  5082. func (c *EditsExpansionfilesPatchCall) Header() http.Header {
  5083. if c.header_ == nil {
  5084. c.header_ = make(http.Header)
  5085. }
  5086. return c.header_
  5087. }
  5088. func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  5089. reqHeaders := make(http.Header)
  5090. for k, v := range c.header_ {
  5091. reqHeaders[k] = v
  5092. }
  5093. reqHeaders.Set("User-Agent", c.s.userAgent())
  5094. var body io.Reader = nil
  5095. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  5096. if err != nil {
  5097. return nil, err
  5098. }
  5099. reqHeaders.Set("Content-Type", "application/json")
  5100. c.urlParams_.Set("alt", alt)
  5101. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5102. urls += "?" + c.urlParams_.Encode()
  5103. req, _ := http.NewRequest("PATCH", urls, body)
  5104. req.Header = reqHeaders
  5105. googleapi.Expand(req.URL, map[string]string{
  5106. "packageName": c.packageNameid,
  5107. "editId": c.editId,
  5108. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5109. "expansionFileType": c.expansionFileType,
  5110. })
  5111. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5112. }
  5113. // Do executes the "androidpublisher.edits.expansionfiles.patch" call.
  5114. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  5115. // status code is an error. Response headers are in either
  5116. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  5117. // at all) in error.(*googleapi.Error).Header. Use
  5118. // googleapi.IsNotModified to check whether the returned error was
  5119. // because http.StatusNotModified was returned.
  5120. func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  5121. gensupport.SetOptions(c.urlParams_, opts...)
  5122. res, err := c.doRequest("json")
  5123. if res != nil && res.StatusCode == http.StatusNotModified {
  5124. if res.Body != nil {
  5125. res.Body.Close()
  5126. }
  5127. return nil, &googleapi.Error{
  5128. Code: res.StatusCode,
  5129. Header: res.Header,
  5130. }
  5131. }
  5132. if err != nil {
  5133. return nil, err
  5134. }
  5135. defer googleapi.CloseBody(res)
  5136. if err := googleapi.CheckResponse(res); err != nil {
  5137. return nil, err
  5138. }
  5139. ret := &ExpansionFile{
  5140. ServerResponse: googleapi.ServerResponse{
  5141. Header: res.Header,
  5142. HTTPStatusCode: res.StatusCode,
  5143. },
  5144. }
  5145. target := &ret
  5146. if err := gensupport.DecodeResponse(target, res); err != nil {
  5147. return nil, err
  5148. }
  5149. return ret, nil
  5150. // {
  5151. // "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.",
  5152. // "httpMethod": "PATCH",
  5153. // "id": "androidpublisher.edits.expansionfiles.patch",
  5154. // "parameterOrder": [
  5155. // "packageName",
  5156. // "editId",
  5157. // "apkVersionCode",
  5158. // "expansionFileType"
  5159. // ],
  5160. // "parameters": {
  5161. // "apkVersionCode": {
  5162. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5163. // "format": "int32",
  5164. // "location": "path",
  5165. // "required": true,
  5166. // "type": "integer"
  5167. // },
  5168. // "editId": {
  5169. // "description": "Unique identifier for this edit.",
  5170. // "location": "path",
  5171. // "required": true,
  5172. // "type": "string"
  5173. // },
  5174. // "expansionFileType": {
  5175. // "enum": [
  5176. // "main",
  5177. // "patch"
  5178. // ],
  5179. // "enumDescriptions": [
  5180. // "",
  5181. // ""
  5182. // ],
  5183. // "location": "path",
  5184. // "required": true,
  5185. // "type": "string"
  5186. // },
  5187. // "packageName": {
  5188. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5189. // "location": "path",
  5190. // "required": true,
  5191. // "type": "string"
  5192. // }
  5193. // },
  5194. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5195. // "request": {
  5196. // "$ref": "ExpansionFile"
  5197. // },
  5198. // "response": {
  5199. // "$ref": "ExpansionFile"
  5200. // },
  5201. // "scopes": [
  5202. // "https://www.googleapis.com/auth/androidpublisher"
  5203. // ]
  5204. // }
  5205. }
  5206. // method id "androidpublisher.edits.expansionfiles.update":
  5207. type EditsExpansionfilesUpdateCall struct {
  5208. s *Service
  5209. packageNameid string
  5210. editId string
  5211. apkVersionCode int64
  5212. expansionFileType string
  5213. expansionfile *ExpansionFile
  5214. urlParams_ gensupport.URLParams
  5215. ctx_ context.Context
  5216. header_ http.Header
  5217. }
  5218. // Update: Updates the APK's Expansion File configuration to reference
  5219. // another APK's Expansion Files. To add a new Expansion File use the
  5220. // Upload method.
  5221. func (r *EditsExpansionfilesService) Update(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall {
  5222. c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5223. c.packageNameid = packageNameid
  5224. c.editId = editId
  5225. c.apkVersionCode = apkVersionCode
  5226. c.expansionFileType = expansionFileType
  5227. c.expansionfile = expansionfile
  5228. return c
  5229. }
  5230. // Fields allows partial responses to be retrieved. See
  5231. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5232. // for more information.
  5233. func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall {
  5234. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5235. return c
  5236. }
  5237. // Context sets the context to be used in this call's Do method. Any
  5238. // pending HTTP request will be aborted if the provided context is
  5239. // canceled.
  5240. func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall {
  5241. c.ctx_ = ctx
  5242. return c
  5243. }
  5244. // Header returns an http.Header that can be modified by the caller to
  5245. // add HTTP headers to the request.
  5246. func (c *EditsExpansionfilesUpdateCall) Header() http.Header {
  5247. if c.header_ == nil {
  5248. c.header_ = make(http.Header)
  5249. }
  5250. return c.header_
  5251. }
  5252. func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  5253. reqHeaders := make(http.Header)
  5254. for k, v := range c.header_ {
  5255. reqHeaders[k] = v
  5256. }
  5257. reqHeaders.Set("User-Agent", c.s.userAgent())
  5258. var body io.Reader = nil
  5259. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  5260. if err != nil {
  5261. return nil, err
  5262. }
  5263. reqHeaders.Set("Content-Type", "application/json")
  5264. c.urlParams_.Set("alt", alt)
  5265. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5266. urls += "?" + c.urlParams_.Encode()
  5267. req, _ := http.NewRequest("PUT", urls, body)
  5268. req.Header = reqHeaders
  5269. googleapi.Expand(req.URL, map[string]string{
  5270. "packageName": c.packageNameid,
  5271. "editId": c.editId,
  5272. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5273. "expansionFileType": c.expansionFileType,
  5274. })
  5275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5276. }
  5277. // Do executes the "androidpublisher.edits.expansionfiles.update" call.
  5278. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  5279. // status code is an error. Response headers are in either
  5280. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  5281. // at all) in error.(*googleapi.Error).Header. Use
  5282. // googleapi.IsNotModified to check whether the returned error was
  5283. // because http.StatusNotModified was returned.
  5284. func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  5285. gensupport.SetOptions(c.urlParams_, opts...)
  5286. res, err := c.doRequest("json")
  5287. if res != nil && res.StatusCode == http.StatusNotModified {
  5288. if res.Body != nil {
  5289. res.Body.Close()
  5290. }
  5291. return nil, &googleapi.Error{
  5292. Code: res.StatusCode,
  5293. Header: res.Header,
  5294. }
  5295. }
  5296. if err != nil {
  5297. return nil, err
  5298. }
  5299. defer googleapi.CloseBody(res)
  5300. if err := googleapi.CheckResponse(res); err != nil {
  5301. return nil, err
  5302. }
  5303. ret := &ExpansionFile{
  5304. ServerResponse: googleapi.ServerResponse{
  5305. Header: res.Header,
  5306. HTTPStatusCode: res.StatusCode,
  5307. },
  5308. }
  5309. target := &ret
  5310. if err := gensupport.DecodeResponse(target, res); err != nil {
  5311. return nil, err
  5312. }
  5313. return ret, nil
  5314. // {
  5315. // "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.",
  5316. // "httpMethod": "PUT",
  5317. // "id": "androidpublisher.edits.expansionfiles.update",
  5318. // "parameterOrder": [
  5319. // "packageName",
  5320. // "editId",
  5321. // "apkVersionCode",
  5322. // "expansionFileType"
  5323. // ],
  5324. // "parameters": {
  5325. // "apkVersionCode": {
  5326. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5327. // "format": "int32",
  5328. // "location": "path",
  5329. // "required": true,
  5330. // "type": "integer"
  5331. // },
  5332. // "editId": {
  5333. // "description": "Unique identifier for this edit.",
  5334. // "location": "path",
  5335. // "required": true,
  5336. // "type": "string"
  5337. // },
  5338. // "expansionFileType": {
  5339. // "enum": [
  5340. // "main",
  5341. // "patch"
  5342. // ],
  5343. // "enumDescriptions": [
  5344. // "",
  5345. // ""
  5346. // ],
  5347. // "location": "path",
  5348. // "required": true,
  5349. // "type": "string"
  5350. // },
  5351. // "packageName": {
  5352. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5353. // "location": "path",
  5354. // "required": true,
  5355. // "type": "string"
  5356. // }
  5357. // },
  5358. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5359. // "request": {
  5360. // "$ref": "ExpansionFile"
  5361. // },
  5362. // "response": {
  5363. // "$ref": "ExpansionFile"
  5364. // },
  5365. // "scopes": [
  5366. // "https://www.googleapis.com/auth/androidpublisher"
  5367. // ]
  5368. // }
  5369. }
  5370. // method id "androidpublisher.edits.expansionfiles.upload":
  5371. type EditsExpansionfilesUploadCall struct {
  5372. s *Service
  5373. packageNameid string
  5374. editId string
  5375. apkVersionCode int64
  5376. expansionFileType string
  5377. urlParams_ gensupport.URLParams
  5378. mediaInfo_ *gensupport.MediaInfo
  5379. ctx_ context.Context
  5380. header_ http.Header
  5381. }
  5382. // Upload: Uploads and attaches a new Expansion File to the APK
  5383. // specified.
  5384. func (r *EditsExpansionfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall {
  5385. c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5386. c.packageNameid = packageNameid
  5387. c.editId = editId
  5388. c.apkVersionCode = apkVersionCode
  5389. c.expansionFileType = expansionFileType
  5390. return c
  5391. }
  5392. // Media specifies the media to upload in one or more chunks. The chunk
  5393. // size may be controlled by supplying a MediaOption generated by
  5394. // googleapi.ChunkSize. The chunk size defaults to
  5395. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  5396. // upload request will be determined by sniffing the contents of r,
  5397. // unless a MediaOption generated by googleapi.ContentType is
  5398. // supplied.
  5399. // At most one of Media and ResumableMedia may be set.
  5400. func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall {
  5401. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  5402. return c
  5403. }
  5404. // ResumableMedia specifies the media to upload in chunks and can be
  5405. // canceled with ctx.
  5406. //
  5407. // Deprecated: use Media instead.
  5408. //
  5409. // At most one of Media and ResumableMedia may be set. mediaType
  5410. // identifies the MIME media type of the upload, such as "image/png". If
  5411. // mediaType is "", it will be auto-detected. The provided ctx will
  5412. // supersede any context previously provided to the Context method.
  5413. func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall {
  5414. c.ctx_ = ctx
  5415. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  5416. return c
  5417. }
  5418. // ProgressUpdater provides a callback function that will be called
  5419. // after every chunk. It should be a low-latency function in order to
  5420. // not slow down the upload operation. This should only be called when
  5421. // using ResumableMedia (as opposed to Media).
  5422. func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall {
  5423. c.mediaInfo_.SetProgressUpdater(pu)
  5424. return c
  5425. }
  5426. // Fields allows partial responses to be retrieved. See
  5427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5428. // for more information.
  5429. func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall {
  5430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5431. return c
  5432. }
  5433. // Context sets the context to be used in this call's Do method. Any
  5434. // pending HTTP request will be aborted if the provided context is
  5435. // canceled.
  5436. // This context will supersede any context previously provided to the
  5437. // ResumableMedia method.
  5438. func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall {
  5439. c.ctx_ = ctx
  5440. return c
  5441. }
  5442. // Header returns an http.Header that can be modified by the caller to
  5443. // add HTTP headers to the request.
  5444. func (c *EditsExpansionfilesUploadCall) Header() http.Header {
  5445. if c.header_ == nil {
  5446. c.header_ = make(http.Header)
  5447. }
  5448. return c.header_
  5449. }
  5450. func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  5451. reqHeaders := make(http.Header)
  5452. for k, v := range c.header_ {
  5453. reqHeaders[k] = v
  5454. }
  5455. reqHeaders.Set("User-Agent", c.s.userAgent())
  5456. var body io.Reader = nil
  5457. c.urlParams_.Set("alt", alt)
  5458. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  5459. if c.mediaInfo_ != nil {
  5460. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  5461. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  5462. }
  5463. if body == nil {
  5464. body = new(bytes.Buffer)
  5465. reqHeaders.Set("Content-Type", "application/json")
  5466. }
  5467. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  5468. defer cleanup()
  5469. urls += "?" + c.urlParams_.Encode()
  5470. req, _ := http.NewRequest("POST", urls, body)
  5471. req.Header = reqHeaders
  5472. gensupport.SetGetBody(req, getBody)
  5473. googleapi.Expand(req.URL, map[string]string{
  5474. "packageName": c.packageNameid,
  5475. "editId": c.editId,
  5476. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  5477. "expansionFileType": c.expansionFileType,
  5478. })
  5479. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5480. }
  5481. // Do executes the "androidpublisher.edits.expansionfiles.upload" call.
  5482. // Exactly one of *ExpansionFilesUploadResponse or error will be
  5483. // non-nil. Any non-2xx status code is an error. Response headers are in
  5484. // either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a
  5485. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5486. // googleapi.IsNotModified to check whether the returned error was
  5487. // because http.StatusNotModified was returned.
  5488. func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) {
  5489. gensupport.SetOptions(c.urlParams_, opts...)
  5490. res, err := c.doRequest("json")
  5491. if res != nil && res.StatusCode == http.StatusNotModified {
  5492. if res.Body != nil {
  5493. res.Body.Close()
  5494. }
  5495. return nil, &googleapi.Error{
  5496. Code: res.StatusCode,
  5497. Header: res.Header,
  5498. }
  5499. }
  5500. if err != nil {
  5501. return nil, err
  5502. }
  5503. defer googleapi.CloseBody(res)
  5504. if err := googleapi.CheckResponse(res); err != nil {
  5505. return nil, err
  5506. }
  5507. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  5508. if rx != nil {
  5509. rx.Client = c.s.client
  5510. rx.UserAgent = c.s.userAgent()
  5511. ctx := c.ctx_
  5512. if ctx == nil {
  5513. ctx = context.TODO()
  5514. }
  5515. res, err = rx.Upload(ctx)
  5516. if err != nil {
  5517. return nil, err
  5518. }
  5519. defer res.Body.Close()
  5520. if err := googleapi.CheckResponse(res); err != nil {
  5521. return nil, err
  5522. }
  5523. }
  5524. ret := &ExpansionFilesUploadResponse{
  5525. ServerResponse: googleapi.ServerResponse{
  5526. Header: res.Header,
  5527. HTTPStatusCode: res.StatusCode,
  5528. },
  5529. }
  5530. target := &ret
  5531. if err := gensupport.DecodeResponse(target, res); err != nil {
  5532. return nil, err
  5533. }
  5534. return ret, nil
  5535. // {
  5536. // "description": "Uploads and attaches a new Expansion File to the APK specified.",
  5537. // "httpMethod": "POST",
  5538. // "id": "androidpublisher.edits.expansionfiles.upload",
  5539. // "mediaUpload": {
  5540. // "accept": [
  5541. // "application/octet-stream"
  5542. // ],
  5543. // "maxSize": "2048MB",
  5544. // "protocols": {
  5545. // "resumable": {
  5546. // "multipart": true,
  5547. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  5548. // },
  5549. // "simple": {
  5550. // "multipart": true,
  5551. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  5552. // }
  5553. // }
  5554. // },
  5555. // "parameterOrder": [
  5556. // "packageName",
  5557. // "editId",
  5558. // "apkVersionCode",
  5559. // "expansionFileType"
  5560. // ],
  5561. // "parameters": {
  5562. // "apkVersionCode": {
  5563. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  5564. // "format": "int32",
  5565. // "location": "path",
  5566. // "required": true,
  5567. // "type": "integer"
  5568. // },
  5569. // "editId": {
  5570. // "description": "Unique identifier for this edit.",
  5571. // "location": "path",
  5572. // "required": true,
  5573. // "type": "string"
  5574. // },
  5575. // "expansionFileType": {
  5576. // "enum": [
  5577. // "main",
  5578. // "patch"
  5579. // ],
  5580. // "enumDescriptions": [
  5581. // "",
  5582. // ""
  5583. // ],
  5584. // "location": "path",
  5585. // "required": true,
  5586. // "type": "string"
  5587. // },
  5588. // "packageName": {
  5589. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5590. // "location": "path",
  5591. // "required": true,
  5592. // "type": "string"
  5593. // }
  5594. // },
  5595. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  5596. // "response": {
  5597. // "$ref": "ExpansionFilesUploadResponse"
  5598. // },
  5599. // "scopes": [
  5600. // "https://www.googleapis.com/auth/androidpublisher"
  5601. // ],
  5602. // "supportsMediaUpload": true
  5603. // }
  5604. }
  5605. // method id "androidpublisher.edits.images.delete":
  5606. type EditsImagesDeleteCall struct {
  5607. s *Service
  5608. packageNameid string
  5609. editId string
  5610. language string
  5611. imageType string
  5612. imageId string
  5613. urlParams_ gensupport.URLParams
  5614. ctx_ context.Context
  5615. header_ http.Header
  5616. }
  5617. // Delete: Deletes the image (specified by id) from the edit.
  5618. func (r *EditsImagesService) Delete(packageNameid string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall {
  5619. c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5620. c.packageNameid = packageNameid
  5621. c.editId = editId
  5622. c.language = language
  5623. c.imageType = imageType
  5624. c.imageId = imageId
  5625. return c
  5626. }
  5627. // Fields allows partial responses to be retrieved. See
  5628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5629. // for more information.
  5630. func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall {
  5631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5632. return c
  5633. }
  5634. // Context sets the context to be used in this call's Do method. Any
  5635. // pending HTTP request will be aborted if the provided context is
  5636. // canceled.
  5637. func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall {
  5638. c.ctx_ = ctx
  5639. return c
  5640. }
  5641. // Header returns an http.Header that can be modified by the caller to
  5642. // add HTTP headers to the request.
  5643. func (c *EditsImagesDeleteCall) Header() http.Header {
  5644. if c.header_ == nil {
  5645. c.header_ = make(http.Header)
  5646. }
  5647. return c.header_
  5648. }
  5649. func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5650. reqHeaders := make(http.Header)
  5651. for k, v := range c.header_ {
  5652. reqHeaders[k] = v
  5653. }
  5654. reqHeaders.Set("User-Agent", c.s.userAgent())
  5655. var body io.Reader = nil
  5656. c.urlParams_.Set("alt", alt)
  5657. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}")
  5658. urls += "?" + c.urlParams_.Encode()
  5659. req, _ := http.NewRequest("DELETE", urls, body)
  5660. req.Header = reqHeaders
  5661. googleapi.Expand(req.URL, map[string]string{
  5662. "packageName": c.packageNameid,
  5663. "editId": c.editId,
  5664. "language": c.language,
  5665. "imageType": c.imageType,
  5666. "imageId": c.imageId,
  5667. })
  5668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5669. }
  5670. // Do executes the "androidpublisher.edits.images.delete" call.
  5671. func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  5672. gensupport.SetOptions(c.urlParams_, opts...)
  5673. res, err := c.doRequest("json")
  5674. if err != nil {
  5675. return err
  5676. }
  5677. defer googleapi.CloseBody(res)
  5678. if err := googleapi.CheckResponse(res); err != nil {
  5679. return err
  5680. }
  5681. return nil
  5682. // {
  5683. // "description": "Deletes the image (specified by id) from the edit.",
  5684. // "httpMethod": "DELETE",
  5685. // "id": "androidpublisher.edits.images.delete",
  5686. // "parameterOrder": [
  5687. // "packageName",
  5688. // "editId",
  5689. // "language",
  5690. // "imageType",
  5691. // "imageId"
  5692. // ],
  5693. // "parameters": {
  5694. // "editId": {
  5695. // "description": "Unique identifier for this edit.",
  5696. // "location": "path",
  5697. // "required": true,
  5698. // "type": "string"
  5699. // },
  5700. // "imageId": {
  5701. // "description": "Unique identifier an image within the set of images attached to this edit.",
  5702. // "location": "path",
  5703. // "required": true,
  5704. // "type": "string"
  5705. // },
  5706. // "imageType": {
  5707. // "enum": [
  5708. // "featureGraphic",
  5709. // "icon",
  5710. // "phoneScreenshots",
  5711. // "promoGraphic",
  5712. // "sevenInchScreenshots",
  5713. // "tenInchScreenshots",
  5714. // "tvBanner",
  5715. // "tvScreenshots",
  5716. // "wearScreenshots"
  5717. // ],
  5718. // "enumDescriptions": [
  5719. // "",
  5720. // "",
  5721. // "",
  5722. // "",
  5723. // "",
  5724. // "",
  5725. // "",
  5726. // "",
  5727. // ""
  5728. // ],
  5729. // "location": "path",
  5730. // "required": true,
  5731. // "type": "string"
  5732. // },
  5733. // "language": {
  5734. // "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\".",
  5735. // "location": "path",
  5736. // "required": true,
  5737. // "type": "string"
  5738. // },
  5739. // "packageName": {
  5740. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5741. // "location": "path",
  5742. // "required": true,
  5743. // "type": "string"
  5744. // }
  5745. // },
  5746. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}",
  5747. // "scopes": [
  5748. // "https://www.googleapis.com/auth/androidpublisher"
  5749. // ]
  5750. // }
  5751. }
  5752. // method id "androidpublisher.edits.images.deleteall":
  5753. type EditsImagesDeleteallCall struct {
  5754. s *Service
  5755. packageNameid string
  5756. editId string
  5757. language string
  5758. imageType string
  5759. urlParams_ gensupport.URLParams
  5760. ctx_ context.Context
  5761. header_ http.Header
  5762. }
  5763. // Deleteall: Deletes all images for the specified language and image
  5764. // type.
  5765. func (r *EditsImagesService) Deleteall(packageNameid string, editId string, language string, imageType string) *EditsImagesDeleteallCall {
  5766. c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5767. c.packageNameid = packageNameid
  5768. c.editId = editId
  5769. c.language = language
  5770. c.imageType = imageType
  5771. return c
  5772. }
  5773. // Fields allows partial responses to be retrieved. See
  5774. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5775. // for more information.
  5776. func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall {
  5777. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5778. return c
  5779. }
  5780. // Context sets the context to be used in this call's Do method. Any
  5781. // pending HTTP request will be aborted if the provided context is
  5782. // canceled.
  5783. func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall {
  5784. c.ctx_ = ctx
  5785. return c
  5786. }
  5787. // Header returns an http.Header that can be modified by the caller to
  5788. // add HTTP headers to the request.
  5789. func (c *EditsImagesDeleteallCall) Header() http.Header {
  5790. if c.header_ == nil {
  5791. c.header_ = make(http.Header)
  5792. }
  5793. return c.header_
  5794. }
  5795. func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) {
  5796. reqHeaders := make(http.Header)
  5797. for k, v := range c.header_ {
  5798. reqHeaders[k] = v
  5799. }
  5800. reqHeaders.Set("User-Agent", c.s.userAgent())
  5801. var body io.Reader = nil
  5802. c.urlParams_.Set("alt", alt)
  5803. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5804. urls += "?" + c.urlParams_.Encode()
  5805. req, _ := http.NewRequest("DELETE", urls, body)
  5806. req.Header = reqHeaders
  5807. googleapi.Expand(req.URL, map[string]string{
  5808. "packageName": c.packageNameid,
  5809. "editId": c.editId,
  5810. "language": c.language,
  5811. "imageType": c.imageType,
  5812. })
  5813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5814. }
  5815. // Do executes the "androidpublisher.edits.images.deleteall" call.
  5816. // Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any
  5817. // non-2xx status code is an error. Response headers are in either
  5818. // *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was
  5819. // returned at all) in error.(*googleapi.Error).Header. Use
  5820. // googleapi.IsNotModified to check whether the returned error was
  5821. // because http.StatusNotModified was returned.
  5822. func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) {
  5823. gensupport.SetOptions(c.urlParams_, opts...)
  5824. res, err := c.doRequest("json")
  5825. if res != nil && res.StatusCode == http.StatusNotModified {
  5826. if res.Body != nil {
  5827. res.Body.Close()
  5828. }
  5829. return nil, &googleapi.Error{
  5830. Code: res.StatusCode,
  5831. Header: res.Header,
  5832. }
  5833. }
  5834. if err != nil {
  5835. return nil, err
  5836. }
  5837. defer googleapi.CloseBody(res)
  5838. if err := googleapi.CheckResponse(res); err != nil {
  5839. return nil, err
  5840. }
  5841. ret := &ImagesDeleteAllResponse{
  5842. ServerResponse: googleapi.ServerResponse{
  5843. Header: res.Header,
  5844. HTTPStatusCode: res.StatusCode,
  5845. },
  5846. }
  5847. target := &ret
  5848. if err := gensupport.DecodeResponse(target, res); err != nil {
  5849. return nil, err
  5850. }
  5851. return ret, nil
  5852. // {
  5853. // "description": "Deletes all images for the specified language and image type.",
  5854. // "httpMethod": "DELETE",
  5855. // "id": "androidpublisher.edits.images.deleteall",
  5856. // "parameterOrder": [
  5857. // "packageName",
  5858. // "editId",
  5859. // "language",
  5860. // "imageType"
  5861. // ],
  5862. // "parameters": {
  5863. // "editId": {
  5864. // "description": "Unique identifier for this edit.",
  5865. // "location": "path",
  5866. // "required": true,
  5867. // "type": "string"
  5868. // },
  5869. // "imageType": {
  5870. // "enum": [
  5871. // "featureGraphic",
  5872. // "icon",
  5873. // "phoneScreenshots",
  5874. // "promoGraphic",
  5875. // "sevenInchScreenshots",
  5876. // "tenInchScreenshots",
  5877. // "tvBanner",
  5878. // "tvScreenshots",
  5879. // "wearScreenshots"
  5880. // ],
  5881. // "enumDescriptions": [
  5882. // "",
  5883. // "",
  5884. // "",
  5885. // "",
  5886. // "",
  5887. // "",
  5888. // "",
  5889. // "",
  5890. // ""
  5891. // ],
  5892. // "location": "path",
  5893. // "required": true,
  5894. // "type": "string"
  5895. // },
  5896. // "language": {
  5897. // "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\".",
  5898. // "location": "path",
  5899. // "required": true,
  5900. // "type": "string"
  5901. // },
  5902. // "packageName": {
  5903. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5904. // "location": "path",
  5905. // "required": true,
  5906. // "type": "string"
  5907. // }
  5908. // },
  5909. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5910. // "response": {
  5911. // "$ref": "ImagesDeleteAllResponse"
  5912. // },
  5913. // "scopes": [
  5914. // "https://www.googleapis.com/auth/androidpublisher"
  5915. // ]
  5916. // }
  5917. }
  5918. // method id "androidpublisher.edits.images.list":
  5919. type EditsImagesListCall struct {
  5920. s *Service
  5921. packageNameid string
  5922. editId string
  5923. language string
  5924. imageType string
  5925. urlParams_ gensupport.URLParams
  5926. ifNoneMatch_ string
  5927. ctx_ context.Context
  5928. header_ http.Header
  5929. }
  5930. // List: Lists all images for the specified language and image type.
  5931. func (r *EditsImagesService) List(packageNameid string, editId string, language string, imageType string) *EditsImagesListCall {
  5932. c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5933. c.packageNameid = packageNameid
  5934. c.editId = editId
  5935. c.language = language
  5936. c.imageType = imageType
  5937. return c
  5938. }
  5939. // Fields allows partial responses to be retrieved. See
  5940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5941. // for more information.
  5942. func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall {
  5943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5944. return c
  5945. }
  5946. // IfNoneMatch sets the optional parameter which makes the operation
  5947. // fail if the object's ETag matches the given value. This is useful for
  5948. // getting updates only after the object has changed since the last
  5949. // request. Use googleapi.IsNotModified to check whether the response
  5950. // error from Do is the result of In-None-Match.
  5951. func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall {
  5952. c.ifNoneMatch_ = entityTag
  5953. return c
  5954. }
  5955. // Context sets the context to be used in this call's Do method. Any
  5956. // pending HTTP request will be aborted if the provided context is
  5957. // canceled.
  5958. func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall {
  5959. c.ctx_ = ctx
  5960. return c
  5961. }
  5962. // Header returns an http.Header that can be modified by the caller to
  5963. // add HTTP headers to the request.
  5964. func (c *EditsImagesListCall) Header() http.Header {
  5965. if c.header_ == nil {
  5966. c.header_ = make(http.Header)
  5967. }
  5968. return c.header_
  5969. }
  5970. func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) {
  5971. reqHeaders := make(http.Header)
  5972. for k, v := range c.header_ {
  5973. reqHeaders[k] = v
  5974. }
  5975. reqHeaders.Set("User-Agent", c.s.userAgent())
  5976. if c.ifNoneMatch_ != "" {
  5977. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5978. }
  5979. var body io.Reader = nil
  5980. c.urlParams_.Set("alt", alt)
  5981. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5982. urls += "?" + c.urlParams_.Encode()
  5983. req, _ := http.NewRequest("GET", urls, body)
  5984. req.Header = reqHeaders
  5985. googleapi.Expand(req.URL, map[string]string{
  5986. "packageName": c.packageNameid,
  5987. "editId": c.editId,
  5988. "language": c.language,
  5989. "imageType": c.imageType,
  5990. })
  5991. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5992. }
  5993. // Do executes the "androidpublisher.edits.images.list" call.
  5994. // Exactly one of *ImagesListResponse or error will be non-nil. Any
  5995. // non-2xx status code is an error. Response headers are in either
  5996. // *ImagesListResponse.ServerResponse.Header or (if a response was
  5997. // returned at all) in error.(*googleapi.Error).Header. Use
  5998. // googleapi.IsNotModified to check whether the returned error was
  5999. // because http.StatusNotModified was returned.
  6000. func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) {
  6001. gensupport.SetOptions(c.urlParams_, opts...)
  6002. res, err := c.doRequest("json")
  6003. if res != nil && res.StatusCode == http.StatusNotModified {
  6004. if res.Body != nil {
  6005. res.Body.Close()
  6006. }
  6007. return nil, &googleapi.Error{
  6008. Code: res.StatusCode,
  6009. Header: res.Header,
  6010. }
  6011. }
  6012. if err != nil {
  6013. return nil, err
  6014. }
  6015. defer googleapi.CloseBody(res)
  6016. if err := googleapi.CheckResponse(res); err != nil {
  6017. return nil, err
  6018. }
  6019. ret := &ImagesListResponse{
  6020. ServerResponse: googleapi.ServerResponse{
  6021. Header: res.Header,
  6022. HTTPStatusCode: res.StatusCode,
  6023. },
  6024. }
  6025. target := &ret
  6026. if err := gensupport.DecodeResponse(target, res); err != nil {
  6027. return nil, err
  6028. }
  6029. return ret, nil
  6030. // {
  6031. // "description": "Lists all images for the specified language and image type.",
  6032. // "httpMethod": "GET",
  6033. // "id": "androidpublisher.edits.images.list",
  6034. // "parameterOrder": [
  6035. // "packageName",
  6036. // "editId",
  6037. // "language",
  6038. // "imageType"
  6039. // ],
  6040. // "parameters": {
  6041. // "editId": {
  6042. // "description": "Unique identifier for this edit.",
  6043. // "location": "path",
  6044. // "required": true,
  6045. // "type": "string"
  6046. // },
  6047. // "imageType": {
  6048. // "enum": [
  6049. // "featureGraphic",
  6050. // "icon",
  6051. // "phoneScreenshots",
  6052. // "promoGraphic",
  6053. // "sevenInchScreenshots",
  6054. // "tenInchScreenshots",
  6055. // "tvBanner",
  6056. // "tvScreenshots",
  6057. // "wearScreenshots"
  6058. // ],
  6059. // "enumDescriptions": [
  6060. // "",
  6061. // "",
  6062. // "",
  6063. // "",
  6064. // "",
  6065. // "",
  6066. // "",
  6067. // "",
  6068. // ""
  6069. // ],
  6070. // "location": "path",
  6071. // "required": true,
  6072. // "type": "string"
  6073. // },
  6074. // "language": {
  6075. // "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\".",
  6076. // "location": "path",
  6077. // "required": true,
  6078. // "type": "string"
  6079. // },
  6080. // "packageName": {
  6081. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6082. // "location": "path",
  6083. // "required": true,
  6084. // "type": "string"
  6085. // }
  6086. // },
  6087. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  6088. // "response": {
  6089. // "$ref": "ImagesListResponse"
  6090. // },
  6091. // "scopes": [
  6092. // "https://www.googleapis.com/auth/androidpublisher"
  6093. // ]
  6094. // }
  6095. }
  6096. // method id "androidpublisher.edits.images.upload":
  6097. type EditsImagesUploadCall struct {
  6098. s *Service
  6099. packageNameid string
  6100. editId string
  6101. language string
  6102. imageType string
  6103. urlParams_ gensupport.URLParams
  6104. mediaInfo_ *gensupport.MediaInfo
  6105. ctx_ context.Context
  6106. header_ http.Header
  6107. }
  6108. // Upload: Uploads a new image and adds it to the list of images for the
  6109. // specified language and image type.
  6110. func (r *EditsImagesService) Upload(packageNameid string, editId string, language string, imageType string) *EditsImagesUploadCall {
  6111. c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6112. c.packageNameid = packageNameid
  6113. c.editId = editId
  6114. c.language = language
  6115. c.imageType = imageType
  6116. return c
  6117. }
  6118. // Media specifies the media to upload in one or more chunks. The chunk
  6119. // size may be controlled by supplying a MediaOption generated by
  6120. // googleapi.ChunkSize. The chunk size defaults to
  6121. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  6122. // upload request will be determined by sniffing the contents of r,
  6123. // unless a MediaOption generated by googleapi.ContentType is
  6124. // supplied.
  6125. // At most one of Media and ResumableMedia may be set.
  6126. func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall {
  6127. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  6128. return c
  6129. }
  6130. // ResumableMedia specifies the media to upload in chunks and can be
  6131. // canceled with ctx.
  6132. //
  6133. // Deprecated: use Media instead.
  6134. //
  6135. // At most one of Media and ResumableMedia may be set. mediaType
  6136. // identifies the MIME media type of the upload, such as "image/png". If
  6137. // mediaType is "", it will be auto-detected. The provided ctx will
  6138. // supersede any context previously provided to the Context method.
  6139. func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall {
  6140. c.ctx_ = ctx
  6141. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  6142. return c
  6143. }
  6144. // ProgressUpdater provides a callback function that will be called
  6145. // after every chunk. It should be a low-latency function in order to
  6146. // not slow down the upload operation. This should only be called when
  6147. // using ResumableMedia (as opposed to Media).
  6148. func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall {
  6149. c.mediaInfo_.SetProgressUpdater(pu)
  6150. return c
  6151. }
  6152. // Fields allows partial responses to be retrieved. See
  6153. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6154. // for more information.
  6155. func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall {
  6156. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6157. return c
  6158. }
  6159. // Context sets the context to be used in this call's Do method. Any
  6160. // pending HTTP request will be aborted if the provided context is
  6161. // canceled.
  6162. // This context will supersede any context previously provided to the
  6163. // ResumableMedia method.
  6164. func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall {
  6165. c.ctx_ = ctx
  6166. return c
  6167. }
  6168. // Header returns an http.Header that can be modified by the caller to
  6169. // add HTTP headers to the request.
  6170. func (c *EditsImagesUploadCall) Header() http.Header {
  6171. if c.header_ == nil {
  6172. c.header_ = make(http.Header)
  6173. }
  6174. return c.header_
  6175. }
  6176. func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) {
  6177. reqHeaders := make(http.Header)
  6178. for k, v := range c.header_ {
  6179. reqHeaders[k] = v
  6180. }
  6181. reqHeaders.Set("User-Agent", c.s.userAgent())
  6182. var body io.Reader = nil
  6183. c.urlParams_.Set("alt", alt)
  6184. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  6185. if c.mediaInfo_ != nil {
  6186. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  6187. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  6188. }
  6189. if body == nil {
  6190. body = new(bytes.Buffer)
  6191. reqHeaders.Set("Content-Type", "application/json")
  6192. }
  6193. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  6194. defer cleanup()
  6195. urls += "?" + c.urlParams_.Encode()
  6196. req, _ := http.NewRequest("POST", urls, body)
  6197. req.Header = reqHeaders
  6198. gensupport.SetGetBody(req, getBody)
  6199. googleapi.Expand(req.URL, map[string]string{
  6200. "packageName": c.packageNameid,
  6201. "editId": c.editId,
  6202. "language": c.language,
  6203. "imageType": c.imageType,
  6204. })
  6205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6206. }
  6207. // Do executes the "androidpublisher.edits.images.upload" call.
  6208. // Exactly one of *ImagesUploadResponse or error will be non-nil. Any
  6209. // non-2xx status code is an error. Response headers are in either
  6210. // *ImagesUploadResponse.ServerResponse.Header or (if a response was
  6211. // returned at all) in error.(*googleapi.Error).Header. Use
  6212. // googleapi.IsNotModified to check whether the returned error was
  6213. // because http.StatusNotModified was returned.
  6214. func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) {
  6215. gensupport.SetOptions(c.urlParams_, opts...)
  6216. res, err := c.doRequest("json")
  6217. if res != nil && res.StatusCode == http.StatusNotModified {
  6218. if res.Body != nil {
  6219. res.Body.Close()
  6220. }
  6221. return nil, &googleapi.Error{
  6222. Code: res.StatusCode,
  6223. Header: res.Header,
  6224. }
  6225. }
  6226. if err != nil {
  6227. return nil, err
  6228. }
  6229. defer googleapi.CloseBody(res)
  6230. if err := googleapi.CheckResponse(res); err != nil {
  6231. return nil, err
  6232. }
  6233. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  6234. if rx != nil {
  6235. rx.Client = c.s.client
  6236. rx.UserAgent = c.s.userAgent()
  6237. ctx := c.ctx_
  6238. if ctx == nil {
  6239. ctx = context.TODO()
  6240. }
  6241. res, err = rx.Upload(ctx)
  6242. if err != nil {
  6243. return nil, err
  6244. }
  6245. defer res.Body.Close()
  6246. if err := googleapi.CheckResponse(res); err != nil {
  6247. return nil, err
  6248. }
  6249. }
  6250. ret := &ImagesUploadResponse{
  6251. ServerResponse: googleapi.ServerResponse{
  6252. Header: res.Header,
  6253. HTTPStatusCode: res.StatusCode,
  6254. },
  6255. }
  6256. target := &ret
  6257. if err := gensupport.DecodeResponse(target, res); err != nil {
  6258. return nil, err
  6259. }
  6260. return ret, nil
  6261. // {
  6262. // "description": "Uploads a new image and adds it to the list of images for the specified language and image type.",
  6263. // "httpMethod": "POST",
  6264. // "id": "androidpublisher.edits.images.upload",
  6265. // "mediaUpload": {
  6266. // "accept": [
  6267. // "image/*"
  6268. // ],
  6269. // "maxSize": "15MB",
  6270. // "protocols": {
  6271. // "resumable": {
  6272. // "multipart": true,
  6273. // "path": "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  6274. // },
  6275. // "simple": {
  6276. // "multipart": true,
  6277. // "path": "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  6278. // }
  6279. // }
  6280. // },
  6281. // "parameterOrder": [
  6282. // "packageName",
  6283. // "editId",
  6284. // "language",
  6285. // "imageType"
  6286. // ],
  6287. // "parameters": {
  6288. // "editId": {
  6289. // "description": "Unique identifier for this edit.",
  6290. // "location": "path",
  6291. // "required": true,
  6292. // "type": "string"
  6293. // },
  6294. // "imageType": {
  6295. // "enum": [
  6296. // "featureGraphic",
  6297. // "icon",
  6298. // "phoneScreenshots",
  6299. // "promoGraphic",
  6300. // "sevenInchScreenshots",
  6301. // "tenInchScreenshots",
  6302. // "tvBanner",
  6303. // "tvScreenshots",
  6304. // "wearScreenshots"
  6305. // ],
  6306. // "enumDescriptions": [
  6307. // "",
  6308. // "",
  6309. // "",
  6310. // "",
  6311. // "",
  6312. // "",
  6313. // "",
  6314. // "",
  6315. // ""
  6316. // ],
  6317. // "location": "path",
  6318. // "required": true,
  6319. // "type": "string"
  6320. // },
  6321. // "language": {
  6322. // "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\".",
  6323. // "location": "path",
  6324. // "required": true,
  6325. // "type": "string"
  6326. // },
  6327. // "packageName": {
  6328. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6329. // "location": "path",
  6330. // "required": true,
  6331. // "type": "string"
  6332. // }
  6333. // },
  6334. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  6335. // "response": {
  6336. // "$ref": "ImagesUploadResponse"
  6337. // },
  6338. // "scopes": [
  6339. // "https://www.googleapis.com/auth/androidpublisher"
  6340. // ],
  6341. // "supportsMediaUpload": true
  6342. // }
  6343. }
  6344. // method id "androidpublisher.edits.listings.delete":
  6345. type EditsListingsDeleteCall struct {
  6346. s *Service
  6347. packageNameid string
  6348. editId string
  6349. language string
  6350. urlParams_ gensupport.URLParams
  6351. ctx_ context.Context
  6352. header_ http.Header
  6353. }
  6354. // Delete: Deletes the specified localized store listing from an edit.
  6355. func (r *EditsListingsService) Delete(packageNameid string, editId string, language string) *EditsListingsDeleteCall {
  6356. c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6357. c.packageNameid = packageNameid
  6358. c.editId = editId
  6359. c.language = language
  6360. return c
  6361. }
  6362. // Fields allows partial responses to be retrieved. See
  6363. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6364. // for more information.
  6365. func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall {
  6366. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6367. return c
  6368. }
  6369. // Context sets the context to be used in this call's Do method. Any
  6370. // pending HTTP request will be aborted if the provided context is
  6371. // canceled.
  6372. func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall {
  6373. c.ctx_ = ctx
  6374. return c
  6375. }
  6376. // Header returns an http.Header that can be modified by the caller to
  6377. // add HTTP headers to the request.
  6378. func (c *EditsListingsDeleteCall) Header() http.Header {
  6379. if c.header_ == nil {
  6380. c.header_ = make(http.Header)
  6381. }
  6382. return c.header_
  6383. }
  6384. func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6385. reqHeaders := make(http.Header)
  6386. for k, v := range c.header_ {
  6387. reqHeaders[k] = v
  6388. }
  6389. reqHeaders.Set("User-Agent", c.s.userAgent())
  6390. var body io.Reader = nil
  6391. c.urlParams_.Set("alt", alt)
  6392. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6393. urls += "?" + c.urlParams_.Encode()
  6394. req, _ := http.NewRequest("DELETE", urls, body)
  6395. req.Header = reqHeaders
  6396. googleapi.Expand(req.URL, map[string]string{
  6397. "packageName": c.packageNameid,
  6398. "editId": c.editId,
  6399. "language": c.language,
  6400. })
  6401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6402. }
  6403. // Do executes the "androidpublisher.edits.listings.delete" call.
  6404. func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error {
  6405. gensupport.SetOptions(c.urlParams_, opts...)
  6406. res, err := c.doRequest("json")
  6407. if err != nil {
  6408. return err
  6409. }
  6410. defer googleapi.CloseBody(res)
  6411. if err := googleapi.CheckResponse(res); err != nil {
  6412. return err
  6413. }
  6414. return nil
  6415. // {
  6416. // "description": "Deletes the specified localized store listing from an edit.",
  6417. // "httpMethod": "DELETE",
  6418. // "id": "androidpublisher.edits.listings.delete",
  6419. // "parameterOrder": [
  6420. // "packageName",
  6421. // "editId",
  6422. // "language"
  6423. // ],
  6424. // "parameters": {
  6425. // "editId": {
  6426. // "description": "Unique identifier for this edit.",
  6427. // "location": "path",
  6428. // "required": true,
  6429. // "type": "string"
  6430. // },
  6431. // "language": {
  6432. // "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\".",
  6433. // "location": "path",
  6434. // "required": true,
  6435. // "type": "string"
  6436. // },
  6437. // "packageName": {
  6438. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6439. // "location": "path",
  6440. // "required": true,
  6441. // "type": "string"
  6442. // }
  6443. // },
  6444. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6445. // "scopes": [
  6446. // "https://www.googleapis.com/auth/androidpublisher"
  6447. // ]
  6448. // }
  6449. }
  6450. // method id "androidpublisher.edits.listings.deleteall":
  6451. type EditsListingsDeleteallCall struct {
  6452. s *Service
  6453. packageNameid string
  6454. editId string
  6455. urlParams_ gensupport.URLParams
  6456. ctx_ context.Context
  6457. header_ http.Header
  6458. }
  6459. // Deleteall: Deletes all localized listings from an edit.
  6460. func (r *EditsListingsService) Deleteall(packageNameid string, editId string) *EditsListingsDeleteallCall {
  6461. c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6462. c.packageNameid = packageNameid
  6463. c.editId = editId
  6464. return c
  6465. }
  6466. // Fields allows partial responses to be retrieved. See
  6467. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6468. // for more information.
  6469. func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall {
  6470. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6471. return c
  6472. }
  6473. // Context sets the context to be used in this call's Do method. Any
  6474. // pending HTTP request will be aborted if the provided context is
  6475. // canceled.
  6476. func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall {
  6477. c.ctx_ = ctx
  6478. return c
  6479. }
  6480. // Header returns an http.Header that can be modified by the caller to
  6481. // add HTTP headers to the request.
  6482. func (c *EditsListingsDeleteallCall) Header() http.Header {
  6483. if c.header_ == nil {
  6484. c.header_ = make(http.Header)
  6485. }
  6486. return c.header_
  6487. }
  6488. func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) {
  6489. reqHeaders := make(http.Header)
  6490. for k, v := range c.header_ {
  6491. reqHeaders[k] = v
  6492. }
  6493. reqHeaders.Set("User-Agent", c.s.userAgent())
  6494. var body io.Reader = nil
  6495. c.urlParams_.Set("alt", alt)
  6496. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  6497. urls += "?" + c.urlParams_.Encode()
  6498. req, _ := http.NewRequest("DELETE", urls, body)
  6499. req.Header = reqHeaders
  6500. googleapi.Expand(req.URL, map[string]string{
  6501. "packageName": c.packageNameid,
  6502. "editId": c.editId,
  6503. })
  6504. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6505. }
  6506. // Do executes the "androidpublisher.edits.listings.deleteall" call.
  6507. func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error {
  6508. gensupport.SetOptions(c.urlParams_, opts...)
  6509. res, err := c.doRequest("json")
  6510. if err != nil {
  6511. return err
  6512. }
  6513. defer googleapi.CloseBody(res)
  6514. if err := googleapi.CheckResponse(res); err != nil {
  6515. return err
  6516. }
  6517. return nil
  6518. // {
  6519. // "description": "Deletes all localized listings from an edit.",
  6520. // "httpMethod": "DELETE",
  6521. // "id": "androidpublisher.edits.listings.deleteall",
  6522. // "parameterOrder": [
  6523. // "packageName",
  6524. // "editId"
  6525. // ],
  6526. // "parameters": {
  6527. // "editId": {
  6528. // "description": "Unique identifier for this edit.",
  6529. // "location": "path",
  6530. // "required": true,
  6531. // "type": "string"
  6532. // },
  6533. // "packageName": {
  6534. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6535. // "location": "path",
  6536. // "required": true,
  6537. // "type": "string"
  6538. // }
  6539. // },
  6540. // "path": "{packageName}/edits/{editId}/listings",
  6541. // "scopes": [
  6542. // "https://www.googleapis.com/auth/androidpublisher"
  6543. // ]
  6544. // }
  6545. }
  6546. // method id "androidpublisher.edits.listings.get":
  6547. type EditsListingsGetCall struct {
  6548. s *Service
  6549. packageNameid string
  6550. editId string
  6551. language string
  6552. urlParams_ gensupport.URLParams
  6553. ifNoneMatch_ string
  6554. ctx_ context.Context
  6555. header_ http.Header
  6556. }
  6557. // Get: Fetches information about a localized store listing.
  6558. func (r *EditsListingsService) Get(packageNameid string, editId string, language string) *EditsListingsGetCall {
  6559. c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6560. c.packageNameid = packageNameid
  6561. c.editId = editId
  6562. c.language = language
  6563. return c
  6564. }
  6565. // Fields allows partial responses to be retrieved. See
  6566. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6567. // for more information.
  6568. func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall {
  6569. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6570. return c
  6571. }
  6572. // IfNoneMatch sets the optional parameter which makes the operation
  6573. // fail if the object's ETag matches the given value. This is useful for
  6574. // getting updates only after the object has changed since the last
  6575. // request. Use googleapi.IsNotModified to check whether the response
  6576. // error from Do is the result of In-None-Match.
  6577. func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall {
  6578. c.ifNoneMatch_ = entityTag
  6579. return c
  6580. }
  6581. // Context sets the context to be used in this call's Do method. Any
  6582. // pending HTTP request will be aborted if the provided context is
  6583. // canceled.
  6584. func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall {
  6585. c.ctx_ = ctx
  6586. return c
  6587. }
  6588. // Header returns an http.Header that can be modified by the caller to
  6589. // add HTTP headers to the request.
  6590. func (c *EditsListingsGetCall) Header() http.Header {
  6591. if c.header_ == nil {
  6592. c.header_ = make(http.Header)
  6593. }
  6594. return c.header_
  6595. }
  6596. func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) {
  6597. reqHeaders := make(http.Header)
  6598. for k, v := range c.header_ {
  6599. reqHeaders[k] = v
  6600. }
  6601. reqHeaders.Set("User-Agent", c.s.userAgent())
  6602. if c.ifNoneMatch_ != "" {
  6603. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6604. }
  6605. var body io.Reader = nil
  6606. c.urlParams_.Set("alt", alt)
  6607. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6608. urls += "?" + c.urlParams_.Encode()
  6609. req, _ := http.NewRequest("GET", urls, body)
  6610. req.Header = reqHeaders
  6611. googleapi.Expand(req.URL, map[string]string{
  6612. "packageName": c.packageNameid,
  6613. "editId": c.editId,
  6614. "language": c.language,
  6615. })
  6616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6617. }
  6618. // Do executes the "androidpublisher.edits.listings.get" call.
  6619. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6620. // code is an error. Response headers are in either
  6621. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6622. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6623. // check whether the returned error was because http.StatusNotModified
  6624. // was returned.
  6625. func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6626. gensupport.SetOptions(c.urlParams_, opts...)
  6627. res, err := c.doRequest("json")
  6628. if res != nil && res.StatusCode == http.StatusNotModified {
  6629. if res.Body != nil {
  6630. res.Body.Close()
  6631. }
  6632. return nil, &googleapi.Error{
  6633. Code: res.StatusCode,
  6634. Header: res.Header,
  6635. }
  6636. }
  6637. if err != nil {
  6638. return nil, err
  6639. }
  6640. defer googleapi.CloseBody(res)
  6641. if err := googleapi.CheckResponse(res); err != nil {
  6642. return nil, err
  6643. }
  6644. ret := &Listing{
  6645. ServerResponse: googleapi.ServerResponse{
  6646. Header: res.Header,
  6647. HTTPStatusCode: res.StatusCode,
  6648. },
  6649. }
  6650. target := &ret
  6651. if err := gensupport.DecodeResponse(target, res); err != nil {
  6652. return nil, err
  6653. }
  6654. return ret, nil
  6655. // {
  6656. // "description": "Fetches information about a localized store listing.",
  6657. // "httpMethod": "GET",
  6658. // "id": "androidpublisher.edits.listings.get",
  6659. // "parameterOrder": [
  6660. // "packageName",
  6661. // "editId",
  6662. // "language"
  6663. // ],
  6664. // "parameters": {
  6665. // "editId": {
  6666. // "description": "Unique identifier for this edit.",
  6667. // "location": "path",
  6668. // "required": true,
  6669. // "type": "string"
  6670. // },
  6671. // "language": {
  6672. // "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\".",
  6673. // "location": "path",
  6674. // "required": true,
  6675. // "type": "string"
  6676. // },
  6677. // "packageName": {
  6678. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6679. // "location": "path",
  6680. // "required": true,
  6681. // "type": "string"
  6682. // }
  6683. // },
  6684. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6685. // "response": {
  6686. // "$ref": "Listing"
  6687. // },
  6688. // "scopes": [
  6689. // "https://www.googleapis.com/auth/androidpublisher"
  6690. // ]
  6691. // }
  6692. }
  6693. // method id "androidpublisher.edits.listings.list":
  6694. type EditsListingsListCall struct {
  6695. s *Service
  6696. packageNameid string
  6697. editId string
  6698. urlParams_ gensupport.URLParams
  6699. ifNoneMatch_ string
  6700. ctx_ context.Context
  6701. header_ http.Header
  6702. }
  6703. // List: Returns all of the localized store listings attached to this
  6704. // edit.
  6705. func (r *EditsListingsService) List(packageNameid string, editId string) *EditsListingsListCall {
  6706. c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6707. c.packageNameid = packageNameid
  6708. c.editId = editId
  6709. return c
  6710. }
  6711. // Fields allows partial responses to be retrieved. See
  6712. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6713. // for more information.
  6714. func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall {
  6715. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6716. return c
  6717. }
  6718. // IfNoneMatch sets the optional parameter which makes the operation
  6719. // fail if the object's ETag matches the given value. This is useful for
  6720. // getting updates only after the object has changed since the last
  6721. // request. Use googleapi.IsNotModified to check whether the response
  6722. // error from Do is the result of In-None-Match.
  6723. func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall {
  6724. c.ifNoneMatch_ = entityTag
  6725. return c
  6726. }
  6727. // Context sets the context to be used in this call's Do method. Any
  6728. // pending HTTP request will be aborted if the provided context is
  6729. // canceled.
  6730. func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall {
  6731. c.ctx_ = ctx
  6732. return c
  6733. }
  6734. // Header returns an http.Header that can be modified by the caller to
  6735. // add HTTP headers to the request.
  6736. func (c *EditsListingsListCall) Header() http.Header {
  6737. if c.header_ == nil {
  6738. c.header_ = make(http.Header)
  6739. }
  6740. return c.header_
  6741. }
  6742. func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) {
  6743. reqHeaders := make(http.Header)
  6744. for k, v := range c.header_ {
  6745. reqHeaders[k] = v
  6746. }
  6747. reqHeaders.Set("User-Agent", c.s.userAgent())
  6748. if c.ifNoneMatch_ != "" {
  6749. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6750. }
  6751. var body io.Reader = nil
  6752. c.urlParams_.Set("alt", alt)
  6753. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  6754. urls += "?" + c.urlParams_.Encode()
  6755. req, _ := http.NewRequest("GET", urls, body)
  6756. req.Header = reqHeaders
  6757. googleapi.Expand(req.URL, map[string]string{
  6758. "packageName": c.packageNameid,
  6759. "editId": c.editId,
  6760. })
  6761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6762. }
  6763. // Do executes the "androidpublisher.edits.listings.list" call.
  6764. // Exactly one of *ListingsListResponse or error will be non-nil. Any
  6765. // non-2xx status code is an error. Response headers are in either
  6766. // *ListingsListResponse.ServerResponse.Header or (if a response was
  6767. // returned at all) in error.(*googleapi.Error).Header. Use
  6768. // googleapi.IsNotModified to check whether the returned error was
  6769. // because http.StatusNotModified was returned.
  6770. func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) {
  6771. gensupport.SetOptions(c.urlParams_, opts...)
  6772. res, err := c.doRequest("json")
  6773. if res != nil && res.StatusCode == http.StatusNotModified {
  6774. if res.Body != nil {
  6775. res.Body.Close()
  6776. }
  6777. return nil, &googleapi.Error{
  6778. Code: res.StatusCode,
  6779. Header: res.Header,
  6780. }
  6781. }
  6782. if err != nil {
  6783. return nil, err
  6784. }
  6785. defer googleapi.CloseBody(res)
  6786. if err := googleapi.CheckResponse(res); err != nil {
  6787. return nil, err
  6788. }
  6789. ret := &ListingsListResponse{
  6790. ServerResponse: googleapi.ServerResponse{
  6791. Header: res.Header,
  6792. HTTPStatusCode: res.StatusCode,
  6793. },
  6794. }
  6795. target := &ret
  6796. if err := gensupport.DecodeResponse(target, res); err != nil {
  6797. return nil, err
  6798. }
  6799. return ret, nil
  6800. // {
  6801. // "description": "Returns all of the localized store listings attached to this edit.",
  6802. // "httpMethod": "GET",
  6803. // "id": "androidpublisher.edits.listings.list",
  6804. // "parameterOrder": [
  6805. // "packageName",
  6806. // "editId"
  6807. // ],
  6808. // "parameters": {
  6809. // "editId": {
  6810. // "description": "Unique identifier for this edit.",
  6811. // "location": "path",
  6812. // "required": true,
  6813. // "type": "string"
  6814. // },
  6815. // "packageName": {
  6816. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6817. // "location": "path",
  6818. // "required": true,
  6819. // "type": "string"
  6820. // }
  6821. // },
  6822. // "path": "{packageName}/edits/{editId}/listings",
  6823. // "response": {
  6824. // "$ref": "ListingsListResponse"
  6825. // },
  6826. // "scopes": [
  6827. // "https://www.googleapis.com/auth/androidpublisher"
  6828. // ]
  6829. // }
  6830. }
  6831. // method id "androidpublisher.edits.listings.patch":
  6832. type EditsListingsPatchCall struct {
  6833. s *Service
  6834. packageNameid string
  6835. editId string
  6836. language string
  6837. listing *Listing
  6838. urlParams_ gensupport.URLParams
  6839. ctx_ context.Context
  6840. header_ http.Header
  6841. }
  6842. // Patch: Creates or updates a localized store listing. This method
  6843. // supports patch semantics.
  6844. func (r *EditsListingsService) Patch(packageNameid string, editId string, language string, listing *Listing) *EditsListingsPatchCall {
  6845. c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6846. c.packageNameid = packageNameid
  6847. c.editId = editId
  6848. c.language = language
  6849. c.listing = listing
  6850. return c
  6851. }
  6852. // Fields allows partial responses to be retrieved. See
  6853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6854. // for more information.
  6855. func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall {
  6856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6857. return c
  6858. }
  6859. // Context sets the context to be used in this call's Do method. Any
  6860. // pending HTTP request will be aborted if the provided context is
  6861. // canceled.
  6862. func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall {
  6863. c.ctx_ = ctx
  6864. return c
  6865. }
  6866. // Header returns an http.Header that can be modified by the caller to
  6867. // add HTTP headers to the request.
  6868. func (c *EditsListingsPatchCall) Header() http.Header {
  6869. if c.header_ == nil {
  6870. c.header_ = make(http.Header)
  6871. }
  6872. return c.header_
  6873. }
  6874. func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) {
  6875. reqHeaders := make(http.Header)
  6876. for k, v := range c.header_ {
  6877. reqHeaders[k] = v
  6878. }
  6879. reqHeaders.Set("User-Agent", c.s.userAgent())
  6880. var body io.Reader = nil
  6881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  6882. if err != nil {
  6883. return nil, err
  6884. }
  6885. reqHeaders.Set("Content-Type", "application/json")
  6886. c.urlParams_.Set("alt", alt)
  6887. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6888. urls += "?" + c.urlParams_.Encode()
  6889. req, _ := http.NewRequest("PATCH", urls, body)
  6890. req.Header = reqHeaders
  6891. googleapi.Expand(req.URL, map[string]string{
  6892. "packageName": c.packageNameid,
  6893. "editId": c.editId,
  6894. "language": c.language,
  6895. })
  6896. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6897. }
  6898. // Do executes the "androidpublisher.edits.listings.patch" call.
  6899. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6900. // code is an error. Response headers are in either
  6901. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6902. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6903. // check whether the returned error was because http.StatusNotModified
  6904. // was returned.
  6905. func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6906. gensupport.SetOptions(c.urlParams_, opts...)
  6907. res, err := c.doRequest("json")
  6908. if res != nil && res.StatusCode == http.StatusNotModified {
  6909. if res.Body != nil {
  6910. res.Body.Close()
  6911. }
  6912. return nil, &googleapi.Error{
  6913. Code: res.StatusCode,
  6914. Header: res.Header,
  6915. }
  6916. }
  6917. if err != nil {
  6918. return nil, err
  6919. }
  6920. defer googleapi.CloseBody(res)
  6921. if err := googleapi.CheckResponse(res); err != nil {
  6922. return nil, err
  6923. }
  6924. ret := &Listing{
  6925. ServerResponse: googleapi.ServerResponse{
  6926. Header: res.Header,
  6927. HTTPStatusCode: res.StatusCode,
  6928. },
  6929. }
  6930. target := &ret
  6931. if err := gensupport.DecodeResponse(target, res); err != nil {
  6932. return nil, err
  6933. }
  6934. return ret, nil
  6935. // {
  6936. // "description": "Creates or updates a localized store listing. This method supports patch semantics.",
  6937. // "httpMethod": "PATCH",
  6938. // "id": "androidpublisher.edits.listings.patch",
  6939. // "parameterOrder": [
  6940. // "packageName",
  6941. // "editId",
  6942. // "language"
  6943. // ],
  6944. // "parameters": {
  6945. // "editId": {
  6946. // "description": "Unique identifier for this edit.",
  6947. // "location": "path",
  6948. // "required": true,
  6949. // "type": "string"
  6950. // },
  6951. // "language": {
  6952. // "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\".",
  6953. // "location": "path",
  6954. // "required": true,
  6955. // "type": "string"
  6956. // },
  6957. // "packageName": {
  6958. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6959. // "location": "path",
  6960. // "required": true,
  6961. // "type": "string"
  6962. // }
  6963. // },
  6964. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6965. // "request": {
  6966. // "$ref": "Listing"
  6967. // },
  6968. // "response": {
  6969. // "$ref": "Listing"
  6970. // },
  6971. // "scopes": [
  6972. // "https://www.googleapis.com/auth/androidpublisher"
  6973. // ]
  6974. // }
  6975. }
  6976. // method id "androidpublisher.edits.listings.update":
  6977. type EditsListingsUpdateCall struct {
  6978. s *Service
  6979. packageNameid string
  6980. editId string
  6981. language string
  6982. listing *Listing
  6983. urlParams_ gensupport.URLParams
  6984. ctx_ context.Context
  6985. header_ http.Header
  6986. }
  6987. // Update: Creates or updates a localized store listing.
  6988. func (r *EditsListingsService) Update(packageNameid string, editId string, language string, listing *Listing) *EditsListingsUpdateCall {
  6989. c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6990. c.packageNameid = packageNameid
  6991. c.editId = editId
  6992. c.language = language
  6993. c.listing = listing
  6994. return c
  6995. }
  6996. // Fields allows partial responses to be retrieved. See
  6997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6998. // for more information.
  6999. func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall {
  7000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7001. return c
  7002. }
  7003. // Context sets the context to be used in this call's Do method. Any
  7004. // pending HTTP request will be aborted if the provided context is
  7005. // canceled.
  7006. func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall {
  7007. c.ctx_ = ctx
  7008. return c
  7009. }
  7010. // Header returns an http.Header that can be modified by the caller to
  7011. // add HTTP headers to the request.
  7012. func (c *EditsListingsUpdateCall) Header() http.Header {
  7013. if c.header_ == nil {
  7014. c.header_ = make(http.Header)
  7015. }
  7016. return c.header_
  7017. }
  7018. func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7019. reqHeaders := make(http.Header)
  7020. for k, v := range c.header_ {
  7021. reqHeaders[k] = v
  7022. }
  7023. reqHeaders.Set("User-Agent", c.s.userAgent())
  7024. var body io.Reader = nil
  7025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  7026. if err != nil {
  7027. return nil, err
  7028. }
  7029. reqHeaders.Set("Content-Type", "application/json")
  7030. c.urlParams_.Set("alt", alt)
  7031. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  7032. urls += "?" + c.urlParams_.Encode()
  7033. req, _ := http.NewRequest("PUT", urls, body)
  7034. req.Header = reqHeaders
  7035. googleapi.Expand(req.URL, map[string]string{
  7036. "packageName": c.packageNameid,
  7037. "editId": c.editId,
  7038. "language": c.language,
  7039. })
  7040. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7041. }
  7042. // Do executes the "androidpublisher.edits.listings.update" call.
  7043. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  7044. // code is an error. Response headers are in either
  7045. // *Listing.ServerResponse.Header or (if a response was returned at all)
  7046. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7047. // check whether the returned error was because http.StatusNotModified
  7048. // was returned.
  7049. func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  7050. gensupport.SetOptions(c.urlParams_, opts...)
  7051. res, err := c.doRequest("json")
  7052. if res != nil && res.StatusCode == http.StatusNotModified {
  7053. if res.Body != nil {
  7054. res.Body.Close()
  7055. }
  7056. return nil, &googleapi.Error{
  7057. Code: res.StatusCode,
  7058. Header: res.Header,
  7059. }
  7060. }
  7061. if err != nil {
  7062. return nil, err
  7063. }
  7064. defer googleapi.CloseBody(res)
  7065. if err := googleapi.CheckResponse(res); err != nil {
  7066. return nil, err
  7067. }
  7068. ret := &Listing{
  7069. ServerResponse: googleapi.ServerResponse{
  7070. Header: res.Header,
  7071. HTTPStatusCode: res.StatusCode,
  7072. },
  7073. }
  7074. target := &ret
  7075. if err := gensupport.DecodeResponse(target, res); err != nil {
  7076. return nil, err
  7077. }
  7078. return ret, nil
  7079. // {
  7080. // "description": "Creates or updates a localized store listing.",
  7081. // "httpMethod": "PUT",
  7082. // "id": "androidpublisher.edits.listings.update",
  7083. // "parameterOrder": [
  7084. // "packageName",
  7085. // "editId",
  7086. // "language"
  7087. // ],
  7088. // "parameters": {
  7089. // "editId": {
  7090. // "description": "Unique identifier for this edit.",
  7091. // "location": "path",
  7092. // "required": true,
  7093. // "type": "string"
  7094. // },
  7095. // "language": {
  7096. // "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\".",
  7097. // "location": "path",
  7098. // "required": true,
  7099. // "type": "string"
  7100. // },
  7101. // "packageName": {
  7102. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7103. // "location": "path",
  7104. // "required": true,
  7105. // "type": "string"
  7106. // }
  7107. // },
  7108. // "path": "{packageName}/edits/{editId}/listings/{language}",
  7109. // "request": {
  7110. // "$ref": "Listing"
  7111. // },
  7112. // "response": {
  7113. // "$ref": "Listing"
  7114. // },
  7115. // "scopes": [
  7116. // "https://www.googleapis.com/auth/androidpublisher"
  7117. // ]
  7118. // }
  7119. }
  7120. // method id "androidpublisher.edits.testers.get":
  7121. type EditsTestersGetCall struct {
  7122. s *Service
  7123. packageNameid string
  7124. editId string
  7125. track string
  7126. urlParams_ gensupport.URLParams
  7127. ifNoneMatch_ string
  7128. ctx_ context.Context
  7129. header_ http.Header
  7130. }
  7131. // Get:
  7132. func (r *EditsTestersService) Get(packageNameid string, editId string, track string) *EditsTestersGetCall {
  7133. c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7134. c.packageNameid = packageNameid
  7135. c.editId = editId
  7136. c.track = track
  7137. return c
  7138. }
  7139. // Fields allows partial responses to be retrieved. See
  7140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7141. // for more information.
  7142. func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall {
  7143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7144. return c
  7145. }
  7146. // IfNoneMatch sets the optional parameter which makes the operation
  7147. // fail if the object's ETag matches the given value. This is useful for
  7148. // getting updates only after the object has changed since the last
  7149. // request. Use googleapi.IsNotModified to check whether the response
  7150. // error from Do is the result of In-None-Match.
  7151. func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall {
  7152. c.ifNoneMatch_ = entityTag
  7153. return c
  7154. }
  7155. // Context sets the context to be used in this call's Do method. Any
  7156. // pending HTTP request will be aborted if the provided context is
  7157. // canceled.
  7158. func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall {
  7159. c.ctx_ = ctx
  7160. return c
  7161. }
  7162. // Header returns an http.Header that can be modified by the caller to
  7163. // add HTTP headers to the request.
  7164. func (c *EditsTestersGetCall) Header() http.Header {
  7165. if c.header_ == nil {
  7166. c.header_ = make(http.Header)
  7167. }
  7168. return c.header_
  7169. }
  7170. func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) {
  7171. reqHeaders := make(http.Header)
  7172. for k, v := range c.header_ {
  7173. reqHeaders[k] = v
  7174. }
  7175. reqHeaders.Set("User-Agent", c.s.userAgent())
  7176. if c.ifNoneMatch_ != "" {
  7177. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7178. }
  7179. var body io.Reader = nil
  7180. c.urlParams_.Set("alt", alt)
  7181. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  7182. urls += "?" + c.urlParams_.Encode()
  7183. req, _ := http.NewRequest("GET", urls, body)
  7184. req.Header = reqHeaders
  7185. googleapi.Expand(req.URL, map[string]string{
  7186. "packageName": c.packageNameid,
  7187. "editId": c.editId,
  7188. "track": c.track,
  7189. })
  7190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7191. }
  7192. // Do executes the "androidpublisher.edits.testers.get" call.
  7193. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  7194. // code is an error. Response headers are in either
  7195. // *Testers.ServerResponse.Header or (if a response was returned at all)
  7196. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7197. // check whether the returned error was because http.StatusNotModified
  7198. // was returned.
  7199. func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  7200. gensupport.SetOptions(c.urlParams_, opts...)
  7201. res, err := c.doRequest("json")
  7202. if res != nil && res.StatusCode == http.StatusNotModified {
  7203. if res.Body != nil {
  7204. res.Body.Close()
  7205. }
  7206. return nil, &googleapi.Error{
  7207. Code: res.StatusCode,
  7208. Header: res.Header,
  7209. }
  7210. }
  7211. if err != nil {
  7212. return nil, err
  7213. }
  7214. defer googleapi.CloseBody(res)
  7215. if err := googleapi.CheckResponse(res); err != nil {
  7216. return nil, err
  7217. }
  7218. ret := &Testers{
  7219. ServerResponse: googleapi.ServerResponse{
  7220. Header: res.Header,
  7221. HTTPStatusCode: res.StatusCode,
  7222. },
  7223. }
  7224. target := &ret
  7225. if err := gensupport.DecodeResponse(target, res); err != nil {
  7226. return nil, err
  7227. }
  7228. return ret, nil
  7229. // {
  7230. // "httpMethod": "GET",
  7231. // "id": "androidpublisher.edits.testers.get",
  7232. // "parameterOrder": [
  7233. // "packageName",
  7234. // "editId",
  7235. // "track"
  7236. // ],
  7237. // "parameters": {
  7238. // "editId": {
  7239. // "description": "Unique identifier for this edit.",
  7240. // "location": "path",
  7241. // "required": true,
  7242. // "type": "string"
  7243. // },
  7244. // "packageName": {
  7245. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7246. // "location": "path",
  7247. // "required": true,
  7248. // "type": "string"
  7249. // },
  7250. // "track": {
  7251. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  7252. // "location": "path",
  7253. // "pattern": "(alpha|beta|production|rollout|internal)",
  7254. // "required": true,
  7255. // "type": "string"
  7256. // }
  7257. // },
  7258. // "path": "{packageName}/edits/{editId}/testers/{track}",
  7259. // "response": {
  7260. // "$ref": "Testers"
  7261. // },
  7262. // "scopes": [
  7263. // "https://www.googleapis.com/auth/androidpublisher"
  7264. // ]
  7265. // }
  7266. }
  7267. // method id "androidpublisher.edits.testers.patch":
  7268. type EditsTestersPatchCall struct {
  7269. s *Service
  7270. packageNameid string
  7271. editId string
  7272. track string
  7273. testers *Testers
  7274. urlParams_ gensupport.URLParams
  7275. ctx_ context.Context
  7276. header_ http.Header
  7277. }
  7278. // Patch:
  7279. func (r *EditsTestersService) Patch(packageNameid string, editId string, track string, testers *Testers) *EditsTestersPatchCall {
  7280. c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7281. c.packageNameid = packageNameid
  7282. c.editId = editId
  7283. c.track = track
  7284. c.testers = testers
  7285. return c
  7286. }
  7287. // Fields allows partial responses to be retrieved. See
  7288. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7289. // for more information.
  7290. func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall {
  7291. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7292. return c
  7293. }
  7294. // Context sets the context to be used in this call's Do method. Any
  7295. // pending HTTP request will be aborted if the provided context is
  7296. // canceled.
  7297. func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall {
  7298. c.ctx_ = ctx
  7299. return c
  7300. }
  7301. // Header returns an http.Header that can be modified by the caller to
  7302. // add HTTP headers to the request.
  7303. func (c *EditsTestersPatchCall) Header() http.Header {
  7304. if c.header_ == nil {
  7305. c.header_ = make(http.Header)
  7306. }
  7307. return c.header_
  7308. }
  7309. func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) {
  7310. reqHeaders := make(http.Header)
  7311. for k, v := range c.header_ {
  7312. reqHeaders[k] = v
  7313. }
  7314. reqHeaders.Set("User-Agent", c.s.userAgent())
  7315. var body io.Reader = nil
  7316. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  7317. if err != nil {
  7318. return nil, err
  7319. }
  7320. reqHeaders.Set("Content-Type", "application/json")
  7321. c.urlParams_.Set("alt", alt)
  7322. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  7323. urls += "?" + c.urlParams_.Encode()
  7324. req, _ := http.NewRequest("PATCH", urls, body)
  7325. req.Header = reqHeaders
  7326. googleapi.Expand(req.URL, map[string]string{
  7327. "packageName": c.packageNameid,
  7328. "editId": c.editId,
  7329. "track": c.track,
  7330. })
  7331. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7332. }
  7333. // Do executes the "androidpublisher.edits.testers.patch" call.
  7334. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  7335. // code is an error. Response headers are in either
  7336. // *Testers.ServerResponse.Header or (if a response was returned at all)
  7337. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7338. // check whether the returned error was because http.StatusNotModified
  7339. // was returned.
  7340. func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  7341. gensupport.SetOptions(c.urlParams_, opts...)
  7342. res, err := c.doRequest("json")
  7343. if res != nil && res.StatusCode == http.StatusNotModified {
  7344. if res.Body != nil {
  7345. res.Body.Close()
  7346. }
  7347. return nil, &googleapi.Error{
  7348. Code: res.StatusCode,
  7349. Header: res.Header,
  7350. }
  7351. }
  7352. if err != nil {
  7353. return nil, err
  7354. }
  7355. defer googleapi.CloseBody(res)
  7356. if err := googleapi.CheckResponse(res); err != nil {
  7357. return nil, err
  7358. }
  7359. ret := &Testers{
  7360. ServerResponse: googleapi.ServerResponse{
  7361. Header: res.Header,
  7362. HTTPStatusCode: res.StatusCode,
  7363. },
  7364. }
  7365. target := &ret
  7366. if err := gensupport.DecodeResponse(target, res); err != nil {
  7367. return nil, err
  7368. }
  7369. return ret, nil
  7370. // {
  7371. // "httpMethod": "PATCH",
  7372. // "id": "androidpublisher.edits.testers.patch",
  7373. // "parameterOrder": [
  7374. // "packageName",
  7375. // "editId",
  7376. // "track"
  7377. // ],
  7378. // "parameters": {
  7379. // "editId": {
  7380. // "description": "Unique identifier for this edit.",
  7381. // "location": "path",
  7382. // "required": true,
  7383. // "type": "string"
  7384. // },
  7385. // "packageName": {
  7386. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7387. // "location": "path",
  7388. // "required": true,
  7389. // "type": "string"
  7390. // },
  7391. // "track": {
  7392. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  7393. // "location": "path",
  7394. // "pattern": "(alpha|beta|production|rollout|internal)",
  7395. // "required": true,
  7396. // "type": "string"
  7397. // }
  7398. // },
  7399. // "path": "{packageName}/edits/{editId}/testers/{track}",
  7400. // "request": {
  7401. // "$ref": "Testers"
  7402. // },
  7403. // "response": {
  7404. // "$ref": "Testers"
  7405. // },
  7406. // "scopes": [
  7407. // "https://www.googleapis.com/auth/androidpublisher"
  7408. // ]
  7409. // }
  7410. }
  7411. // method id "androidpublisher.edits.testers.update":
  7412. type EditsTestersUpdateCall struct {
  7413. s *Service
  7414. packageNameid string
  7415. editId string
  7416. track string
  7417. testers *Testers
  7418. urlParams_ gensupport.URLParams
  7419. ctx_ context.Context
  7420. header_ http.Header
  7421. }
  7422. // Update:
  7423. func (r *EditsTestersService) Update(packageNameid string, editId string, track string, testers *Testers) *EditsTestersUpdateCall {
  7424. c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7425. c.packageNameid = packageNameid
  7426. c.editId = editId
  7427. c.track = track
  7428. c.testers = testers
  7429. return c
  7430. }
  7431. // Fields allows partial responses to be retrieved. See
  7432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7433. // for more information.
  7434. func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall {
  7435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7436. return c
  7437. }
  7438. // Context sets the context to be used in this call's Do method. Any
  7439. // pending HTTP request will be aborted if the provided context is
  7440. // canceled.
  7441. func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall {
  7442. c.ctx_ = ctx
  7443. return c
  7444. }
  7445. // Header returns an http.Header that can be modified by the caller to
  7446. // add HTTP headers to the request.
  7447. func (c *EditsTestersUpdateCall) Header() http.Header {
  7448. if c.header_ == nil {
  7449. c.header_ = make(http.Header)
  7450. }
  7451. return c.header_
  7452. }
  7453. func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) {
  7454. reqHeaders := make(http.Header)
  7455. for k, v := range c.header_ {
  7456. reqHeaders[k] = v
  7457. }
  7458. reqHeaders.Set("User-Agent", c.s.userAgent())
  7459. var body io.Reader = nil
  7460. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  7461. if err != nil {
  7462. return nil, err
  7463. }
  7464. reqHeaders.Set("Content-Type", "application/json")
  7465. c.urlParams_.Set("alt", alt)
  7466. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  7467. urls += "?" + c.urlParams_.Encode()
  7468. req, _ := http.NewRequest("PUT", urls, body)
  7469. req.Header = reqHeaders
  7470. googleapi.Expand(req.URL, map[string]string{
  7471. "packageName": c.packageNameid,
  7472. "editId": c.editId,
  7473. "track": c.track,
  7474. })
  7475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7476. }
  7477. // Do executes the "androidpublisher.edits.testers.update" call.
  7478. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  7479. // code is an error. Response headers are in either
  7480. // *Testers.ServerResponse.Header or (if a response was returned at all)
  7481. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7482. // check whether the returned error was because http.StatusNotModified
  7483. // was returned.
  7484. func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  7485. gensupport.SetOptions(c.urlParams_, opts...)
  7486. res, err := c.doRequest("json")
  7487. if res != nil && res.StatusCode == http.StatusNotModified {
  7488. if res.Body != nil {
  7489. res.Body.Close()
  7490. }
  7491. return nil, &googleapi.Error{
  7492. Code: res.StatusCode,
  7493. Header: res.Header,
  7494. }
  7495. }
  7496. if err != nil {
  7497. return nil, err
  7498. }
  7499. defer googleapi.CloseBody(res)
  7500. if err := googleapi.CheckResponse(res); err != nil {
  7501. return nil, err
  7502. }
  7503. ret := &Testers{
  7504. ServerResponse: googleapi.ServerResponse{
  7505. Header: res.Header,
  7506. HTTPStatusCode: res.StatusCode,
  7507. },
  7508. }
  7509. target := &ret
  7510. if err := gensupport.DecodeResponse(target, res); err != nil {
  7511. return nil, err
  7512. }
  7513. return ret, nil
  7514. // {
  7515. // "httpMethod": "PUT",
  7516. // "id": "androidpublisher.edits.testers.update",
  7517. // "parameterOrder": [
  7518. // "packageName",
  7519. // "editId",
  7520. // "track"
  7521. // ],
  7522. // "parameters": {
  7523. // "editId": {
  7524. // "description": "Unique identifier for this edit.",
  7525. // "location": "path",
  7526. // "required": true,
  7527. // "type": "string"
  7528. // },
  7529. // "packageName": {
  7530. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7531. // "location": "path",
  7532. // "required": true,
  7533. // "type": "string"
  7534. // },
  7535. // "track": {
  7536. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  7537. // "location": "path",
  7538. // "pattern": "(alpha|beta|production|rollout|internal)",
  7539. // "required": true,
  7540. // "type": "string"
  7541. // }
  7542. // },
  7543. // "path": "{packageName}/edits/{editId}/testers/{track}",
  7544. // "request": {
  7545. // "$ref": "Testers"
  7546. // },
  7547. // "response": {
  7548. // "$ref": "Testers"
  7549. // },
  7550. // "scopes": [
  7551. // "https://www.googleapis.com/auth/androidpublisher"
  7552. // ]
  7553. // }
  7554. }
  7555. // method id "androidpublisher.edits.tracks.get":
  7556. type EditsTracksGetCall struct {
  7557. s *Service
  7558. packageNameid string
  7559. editId string
  7560. track string
  7561. urlParams_ gensupport.URLParams
  7562. ifNoneMatch_ string
  7563. ctx_ context.Context
  7564. header_ http.Header
  7565. }
  7566. // Get: Fetches the track configuration for the specified track type.
  7567. // Includes the APK version codes that are in this track.
  7568. func (r *EditsTracksService) Get(packageNameid string, editId string, track string) *EditsTracksGetCall {
  7569. c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7570. c.packageNameid = packageNameid
  7571. c.editId = editId
  7572. c.track = track
  7573. return c
  7574. }
  7575. // Fields allows partial responses to be retrieved. See
  7576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7577. // for more information.
  7578. func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall {
  7579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7580. return c
  7581. }
  7582. // IfNoneMatch sets the optional parameter which makes the operation
  7583. // fail if the object's ETag matches the given value. This is useful for
  7584. // getting updates only after the object has changed since the last
  7585. // request. Use googleapi.IsNotModified to check whether the response
  7586. // error from Do is the result of In-None-Match.
  7587. func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall {
  7588. c.ifNoneMatch_ = entityTag
  7589. return c
  7590. }
  7591. // Context sets the context to be used in this call's Do method. Any
  7592. // pending HTTP request will be aborted if the provided context is
  7593. // canceled.
  7594. func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall {
  7595. c.ctx_ = ctx
  7596. return c
  7597. }
  7598. // Header returns an http.Header that can be modified by the caller to
  7599. // add HTTP headers to the request.
  7600. func (c *EditsTracksGetCall) Header() http.Header {
  7601. if c.header_ == nil {
  7602. c.header_ = make(http.Header)
  7603. }
  7604. return c.header_
  7605. }
  7606. func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) {
  7607. reqHeaders := make(http.Header)
  7608. for k, v := range c.header_ {
  7609. reqHeaders[k] = v
  7610. }
  7611. reqHeaders.Set("User-Agent", c.s.userAgent())
  7612. if c.ifNoneMatch_ != "" {
  7613. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7614. }
  7615. var body io.Reader = nil
  7616. c.urlParams_.Set("alt", alt)
  7617. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7618. urls += "?" + c.urlParams_.Encode()
  7619. req, _ := http.NewRequest("GET", urls, body)
  7620. req.Header = reqHeaders
  7621. googleapi.Expand(req.URL, map[string]string{
  7622. "packageName": c.packageNameid,
  7623. "editId": c.editId,
  7624. "track": c.track,
  7625. })
  7626. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7627. }
  7628. // Do executes the "androidpublisher.edits.tracks.get" call.
  7629. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7630. // code is an error. Response headers are in either
  7631. // *Track.ServerResponse.Header or (if a response was returned at all)
  7632. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7633. // check whether the returned error was because http.StatusNotModified
  7634. // was returned.
  7635. func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7636. gensupport.SetOptions(c.urlParams_, opts...)
  7637. res, err := c.doRequest("json")
  7638. if res != nil && res.StatusCode == http.StatusNotModified {
  7639. if res.Body != nil {
  7640. res.Body.Close()
  7641. }
  7642. return nil, &googleapi.Error{
  7643. Code: res.StatusCode,
  7644. Header: res.Header,
  7645. }
  7646. }
  7647. if err != nil {
  7648. return nil, err
  7649. }
  7650. defer googleapi.CloseBody(res)
  7651. if err := googleapi.CheckResponse(res); err != nil {
  7652. return nil, err
  7653. }
  7654. ret := &Track{
  7655. ServerResponse: googleapi.ServerResponse{
  7656. Header: res.Header,
  7657. HTTPStatusCode: res.StatusCode,
  7658. },
  7659. }
  7660. target := &ret
  7661. if err := gensupport.DecodeResponse(target, res); err != nil {
  7662. return nil, err
  7663. }
  7664. return ret, nil
  7665. // {
  7666. // "description": "Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track.",
  7667. // "httpMethod": "GET",
  7668. // "id": "androidpublisher.edits.tracks.get",
  7669. // "parameterOrder": [
  7670. // "packageName",
  7671. // "editId",
  7672. // "track"
  7673. // ],
  7674. // "parameters": {
  7675. // "editId": {
  7676. // "description": "Unique identifier for this edit.",
  7677. // "location": "path",
  7678. // "required": true,
  7679. // "type": "string"
  7680. // },
  7681. // "packageName": {
  7682. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7683. // "location": "path",
  7684. // "required": true,
  7685. // "type": "string"
  7686. // },
  7687. // "track": {
  7688. // "description": "The track to read or modify.",
  7689. // "location": "path",
  7690. // "required": true,
  7691. // "type": "string"
  7692. // }
  7693. // },
  7694. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7695. // "response": {
  7696. // "$ref": "Track"
  7697. // },
  7698. // "scopes": [
  7699. // "https://www.googleapis.com/auth/androidpublisher"
  7700. // ]
  7701. // }
  7702. }
  7703. // method id "androidpublisher.edits.tracks.list":
  7704. type EditsTracksListCall struct {
  7705. s *Service
  7706. packageNameid string
  7707. editId string
  7708. urlParams_ gensupport.URLParams
  7709. ifNoneMatch_ string
  7710. ctx_ context.Context
  7711. header_ http.Header
  7712. }
  7713. // List: Lists all the track configurations for this edit.
  7714. func (r *EditsTracksService) List(packageNameid string, editId string) *EditsTracksListCall {
  7715. c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7716. c.packageNameid = packageNameid
  7717. c.editId = editId
  7718. return c
  7719. }
  7720. // Fields allows partial responses to be retrieved. See
  7721. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7722. // for more information.
  7723. func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall {
  7724. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7725. return c
  7726. }
  7727. // IfNoneMatch sets the optional parameter which makes the operation
  7728. // fail if the object's ETag matches the given value. This is useful for
  7729. // getting updates only after the object has changed since the last
  7730. // request. Use googleapi.IsNotModified to check whether the response
  7731. // error from Do is the result of In-None-Match.
  7732. func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall {
  7733. c.ifNoneMatch_ = entityTag
  7734. return c
  7735. }
  7736. // Context sets the context to be used in this call's Do method. Any
  7737. // pending HTTP request will be aborted if the provided context is
  7738. // canceled.
  7739. func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall {
  7740. c.ctx_ = ctx
  7741. return c
  7742. }
  7743. // Header returns an http.Header that can be modified by the caller to
  7744. // add HTTP headers to the request.
  7745. func (c *EditsTracksListCall) Header() http.Header {
  7746. if c.header_ == nil {
  7747. c.header_ = make(http.Header)
  7748. }
  7749. return c.header_
  7750. }
  7751. func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) {
  7752. reqHeaders := make(http.Header)
  7753. for k, v := range c.header_ {
  7754. reqHeaders[k] = v
  7755. }
  7756. reqHeaders.Set("User-Agent", c.s.userAgent())
  7757. if c.ifNoneMatch_ != "" {
  7758. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7759. }
  7760. var body io.Reader = nil
  7761. c.urlParams_.Set("alt", alt)
  7762. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks")
  7763. urls += "?" + c.urlParams_.Encode()
  7764. req, _ := http.NewRequest("GET", urls, body)
  7765. req.Header = reqHeaders
  7766. googleapi.Expand(req.URL, map[string]string{
  7767. "packageName": c.packageNameid,
  7768. "editId": c.editId,
  7769. })
  7770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7771. }
  7772. // Do executes the "androidpublisher.edits.tracks.list" call.
  7773. // Exactly one of *TracksListResponse or error will be non-nil. Any
  7774. // non-2xx status code is an error. Response headers are in either
  7775. // *TracksListResponse.ServerResponse.Header or (if a response was
  7776. // returned at all) in error.(*googleapi.Error).Header. Use
  7777. // googleapi.IsNotModified to check whether the returned error was
  7778. // because http.StatusNotModified was returned.
  7779. func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) {
  7780. gensupport.SetOptions(c.urlParams_, opts...)
  7781. res, err := c.doRequest("json")
  7782. if res != nil && res.StatusCode == http.StatusNotModified {
  7783. if res.Body != nil {
  7784. res.Body.Close()
  7785. }
  7786. return nil, &googleapi.Error{
  7787. Code: res.StatusCode,
  7788. Header: res.Header,
  7789. }
  7790. }
  7791. if err != nil {
  7792. return nil, err
  7793. }
  7794. defer googleapi.CloseBody(res)
  7795. if err := googleapi.CheckResponse(res); err != nil {
  7796. return nil, err
  7797. }
  7798. ret := &TracksListResponse{
  7799. ServerResponse: googleapi.ServerResponse{
  7800. Header: res.Header,
  7801. HTTPStatusCode: res.StatusCode,
  7802. },
  7803. }
  7804. target := &ret
  7805. if err := gensupport.DecodeResponse(target, res); err != nil {
  7806. return nil, err
  7807. }
  7808. return ret, nil
  7809. // {
  7810. // "description": "Lists all the track configurations for this edit.",
  7811. // "httpMethod": "GET",
  7812. // "id": "androidpublisher.edits.tracks.list",
  7813. // "parameterOrder": [
  7814. // "packageName",
  7815. // "editId"
  7816. // ],
  7817. // "parameters": {
  7818. // "editId": {
  7819. // "description": "Unique identifier for this edit.",
  7820. // "location": "path",
  7821. // "required": true,
  7822. // "type": "string"
  7823. // },
  7824. // "packageName": {
  7825. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7826. // "location": "path",
  7827. // "required": true,
  7828. // "type": "string"
  7829. // }
  7830. // },
  7831. // "path": "{packageName}/edits/{editId}/tracks",
  7832. // "response": {
  7833. // "$ref": "TracksListResponse"
  7834. // },
  7835. // "scopes": [
  7836. // "https://www.googleapis.com/auth/androidpublisher"
  7837. // ]
  7838. // }
  7839. }
  7840. // method id "androidpublisher.edits.tracks.patch":
  7841. type EditsTracksPatchCall struct {
  7842. s *Service
  7843. packageNameid string
  7844. editId string
  7845. track string
  7846. track2 *Track
  7847. urlParams_ gensupport.URLParams
  7848. ctx_ context.Context
  7849. header_ http.Header
  7850. }
  7851. // Patch: Updates the track configuration for the specified track type.
  7852. // When halted, the rollout track cannot be updated without adding new
  7853. // APKs, and adding new APKs will cause it to resume. This method
  7854. // supports patch semantics.
  7855. func (r *EditsTracksService) Patch(packageNameid string, editId string, track string, track2 *Track) *EditsTracksPatchCall {
  7856. c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7857. c.packageNameid = packageNameid
  7858. c.editId = editId
  7859. c.track = track
  7860. c.track2 = track2
  7861. return c
  7862. }
  7863. // Fields allows partial responses to be retrieved. See
  7864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7865. // for more information.
  7866. func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall {
  7867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7868. return c
  7869. }
  7870. // Context sets the context to be used in this call's Do method. Any
  7871. // pending HTTP request will be aborted if the provided context is
  7872. // canceled.
  7873. func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall {
  7874. c.ctx_ = ctx
  7875. return c
  7876. }
  7877. // Header returns an http.Header that can be modified by the caller to
  7878. // add HTTP headers to the request.
  7879. func (c *EditsTracksPatchCall) Header() http.Header {
  7880. if c.header_ == nil {
  7881. c.header_ = make(http.Header)
  7882. }
  7883. return c.header_
  7884. }
  7885. func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) {
  7886. reqHeaders := make(http.Header)
  7887. for k, v := range c.header_ {
  7888. reqHeaders[k] = v
  7889. }
  7890. reqHeaders.Set("User-Agent", c.s.userAgent())
  7891. var body io.Reader = nil
  7892. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  7893. if err != nil {
  7894. return nil, err
  7895. }
  7896. reqHeaders.Set("Content-Type", "application/json")
  7897. c.urlParams_.Set("alt", alt)
  7898. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7899. urls += "?" + c.urlParams_.Encode()
  7900. req, _ := http.NewRequest("PATCH", urls, body)
  7901. req.Header = reqHeaders
  7902. googleapi.Expand(req.URL, map[string]string{
  7903. "packageName": c.packageNameid,
  7904. "editId": c.editId,
  7905. "track": c.track,
  7906. })
  7907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7908. }
  7909. // Do executes the "androidpublisher.edits.tracks.patch" call.
  7910. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7911. // code is an error. Response headers are in either
  7912. // *Track.ServerResponse.Header or (if a response was returned at all)
  7913. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7914. // check whether the returned error was because http.StatusNotModified
  7915. // was returned.
  7916. func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7917. gensupport.SetOptions(c.urlParams_, opts...)
  7918. res, err := c.doRequest("json")
  7919. if res != nil && res.StatusCode == http.StatusNotModified {
  7920. if res.Body != nil {
  7921. res.Body.Close()
  7922. }
  7923. return nil, &googleapi.Error{
  7924. Code: res.StatusCode,
  7925. Header: res.Header,
  7926. }
  7927. }
  7928. if err != nil {
  7929. return nil, err
  7930. }
  7931. defer googleapi.CloseBody(res)
  7932. if err := googleapi.CheckResponse(res); err != nil {
  7933. return nil, err
  7934. }
  7935. ret := &Track{
  7936. ServerResponse: googleapi.ServerResponse{
  7937. Header: res.Header,
  7938. HTTPStatusCode: res.StatusCode,
  7939. },
  7940. }
  7941. target := &ret
  7942. if err := gensupport.DecodeResponse(target, res); err != nil {
  7943. return nil, err
  7944. }
  7945. return ret, nil
  7946. // {
  7947. // "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.",
  7948. // "httpMethod": "PATCH",
  7949. // "id": "androidpublisher.edits.tracks.patch",
  7950. // "parameterOrder": [
  7951. // "packageName",
  7952. // "editId",
  7953. // "track"
  7954. // ],
  7955. // "parameters": {
  7956. // "editId": {
  7957. // "description": "Unique identifier for this edit.",
  7958. // "location": "path",
  7959. // "required": true,
  7960. // "type": "string"
  7961. // },
  7962. // "packageName": {
  7963. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7964. // "location": "path",
  7965. // "required": true,
  7966. // "type": "string"
  7967. // },
  7968. // "track": {
  7969. // "description": "The track to read or modify.",
  7970. // "location": "path",
  7971. // "required": true,
  7972. // "type": "string"
  7973. // }
  7974. // },
  7975. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7976. // "request": {
  7977. // "$ref": "Track"
  7978. // },
  7979. // "response": {
  7980. // "$ref": "Track"
  7981. // },
  7982. // "scopes": [
  7983. // "https://www.googleapis.com/auth/androidpublisher"
  7984. // ]
  7985. // }
  7986. }
  7987. // method id "androidpublisher.edits.tracks.update":
  7988. type EditsTracksUpdateCall struct {
  7989. s *Service
  7990. packageNameid string
  7991. editId string
  7992. track string
  7993. track2 *Track
  7994. urlParams_ gensupport.URLParams
  7995. ctx_ context.Context
  7996. header_ http.Header
  7997. }
  7998. // Update: Updates the track configuration for the specified track type.
  7999. // When halted, the rollout track cannot be updated without adding new
  8000. // APKs, and adding new APKs will cause it to resume.
  8001. func (r *EditsTracksService) Update(packageNameid string, editId string, track string, track2 *Track) *EditsTracksUpdateCall {
  8002. c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8003. c.packageNameid = packageNameid
  8004. c.editId = editId
  8005. c.track = track
  8006. c.track2 = track2
  8007. return c
  8008. }
  8009. // Fields allows partial responses to be retrieved. See
  8010. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8011. // for more information.
  8012. func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall {
  8013. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8014. return c
  8015. }
  8016. // Context sets the context to be used in this call's Do method. Any
  8017. // pending HTTP request will be aborted if the provided context is
  8018. // canceled.
  8019. func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall {
  8020. c.ctx_ = ctx
  8021. return c
  8022. }
  8023. // Header returns an http.Header that can be modified by the caller to
  8024. // add HTTP headers to the request.
  8025. func (c *EditsTracksUpdateCall) Header() http.Header {
  8026. if c.header_ == nil {
  8027. c.header_ = make(http.Header)
  8028. }
  8029. return c.header_
  8030. }
  8031. func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) {
  8032. reqHeaders := make(http.Header)
  8033. for k, v := range c.header_ {
  8034. reqHeaders[k] = v
  8035. }
  8036. reqHeaders.Set("User-Agent", c.s.userAgent())
  8037. var body io.Reader = nil
  8038. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  8039. if err != nil {
  8040. return nil, err
  8041. }
  8042. reqHeaders.Set("Content-Type", "application/json")
  8043. c.urlParams_.Set("alt", alt)
  8044. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  8045. urls += "?" + c.urlParams_.Encode()
  8046. req, _ := http.NewRequest("PUT", urls, body)
  8047. req.Header = reqHeaders
  8048. googleapi.Expand(req.URL, map[string]string{
  8049. "packageName": c.packageNameid,
  8050. "editId": c.editId,
  8051. "track": c.track,
  8052. })
  8053. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8054. }
  8055. // Do executes the "androidpublisher.edits.tracks.update" call.
  8056. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  8057. // code is an error. Response headers are in either
  8058. // *Track.ServerResponse.Header or (if a response was returned at all)
  8059. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8060. // check whether the returned error was because http.StatusNotModified
  8061. // was returned.
  8062. func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  8063. gensupport.SetOptions(c.urlParams_, opts...)
  8064. res, err := c.doRequest("json")
  8065. if res != nil && res.StatusCode == http.StatusNotModified {
  8066. if res.Body != nil {
  8067. res.Body.Close()
  8068. }
  8069. return nil, &googleapi.Error{
  8070. Code: res.StatusCode,
  8071. Header: res.Header,
  8072. }
  8073. }
  8074. if err != nil {
  8075. return nil, err
  8076. }
  8077. defer googleapi.CloseBody(res)
  8078. if err := googleapi.CheckResponse(res); err != nil {
  8079. return nil, err
  8080. }
  8081. ret := &Track{
  8082. ServerResponse: googleapi.ServerResponse{
  8083. Header: res.Header,
  8084. HTTPStatusCode: res.StatusCode,
  8085. },
  8086. }
  8087. target := &ret
  8088. if err := gensupport.DecodeResponse(target, res); err != nil {
  8089. return nil, err
  8090. }
  8091. return ret, nil
  8092. // {
  8093. // "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.",
  8094. // "httpMethod": "PUT",
  8095. // "id": "androidpublisher.edits.tracks.update",
  8096. // "parameterOrder": [
  8097. // "packageName",
  8098. // "editId",
  8099. // "track"
  8100. // ],
  8101. // "parameters": {
  8102. // "editId": {
  8103. // "description": "Unique identifier for this edit.",
  8104. // "location": "path",
  8105. // "required": true,
  8106. // "type": "string"
  8107. // },
  8108. // "packageName": {
  8109. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  8110. // "location": "path",
  8111. // "required": true,
  8112. // "type": "string"
  8113. // },
  8114. // "track": {
  8115. // "description": "The track to read or modify.",
  8116. // "location": "path",
  8117. // "required": true,
  8118. // "type": "string"
  8119. // }
  8120. // },
  8121. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  8122. // "request": {
  8123. // "$ref": "Track"
  8124. // },
  8125. // "response": {
  8126. // "$ref": "Track"
  8127. // },
  8128. // "scopes": [
  8129. // "https://www.googleapis.com/auth/androidpublisher"
  8130. // ]
  8131. // }
  8132. }
  8133. // method id "androidpublisher.inappproducts.delete":
  8134. type InappproductsDeleteCall struct {
  8135. s *Service
  8136. packageNameid string
  8137. skuid string
  8138. urlParams_ gensupport.URLParams
  8139. ctx_ context.Context
  8140. header_ http.Header
  8141. }
  8142. // Delete: Delete an in-app product for an app.
  8143. func (r *InappproductsService) Delete(packageNameid string, skuid string) *InappproductsDeleteCall {
  8144. c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8145. c.packageNameid = packageNameid
  8146. c.skuid = skuid
  8147. return c
  8148. }
  8149. // Fields allows partial responses to be retrieved. See
  8150. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8151. // for more information.
  8152. func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall {
  8153. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8154. return c
  8155. }
  8156. // Context sets the context to be used in this call's Do method. Any
  8157. // pending HTTP request will be aborted if the provided context is
  8158. // canceled.
  8159. func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall {
  8160. c.ctx_ = ctx
  8161. return c
  8162. }
  8163. // Header returns an http.Header that can be modified by the caller to
  8164. // add HTTP headers to the request.
  8165. func (c *InappproductsDeleteCall) Header() http.Header {
  8166. if c.header_ == nil {
  8167. c.header_ = make(http.Header)
  8168. }
  8169. return c.header_
  8170. }
  8171. func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8172. reqHeaders := make(http.Header)
  8173. for k, v := range c.header_ {
  8174. reqHeaders[k] = v
  8175. }
  8176. reqHeaders.Set("User-Agent", c.s.userAgent())
  8177. var body io.Reader = nil
  8178. c.urlParams_.Set("alt", alt)
  8179. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8180. urls += "?" + c.urlParams_.Encode()
  8181. req, _ := http.NewRequest("DELETE", urls, body)
  8182. req.Header = reqHeaders
  8183. googleapi.Expand(req.URL, map[string]string{
  8184. "packageName": c.packageNameid,
  8185. "sku": c.skuid,
  8186. })
  8187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8188. }
  8189. // Do executes the "androidpublisher.inappproducts.delete" call.
  8190. func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8191. gensupport.SetOptions(c.urlParams_, opts...)
  8192. res, err := c.doRequest("json")
  8193. if err != nil {
  8194. return err
  8195. }
  8196. defer googleapi.CloseBody(res)
  8197. if err := googleapi.CheckResponse(res); err != nil {
  8198. return err
  8199. }
  8200. return nil
  8201. // {
  8202. // "description": "Delete an in-app product for an app.",
  8203. // "httpMethod": "DELETE",
  8204. // "id": "androidpublisher.inappproducts.delete",
  8205. // "parameterOrder": [
  8206. // "packageName",
  8207. // "sku"
  8208. // ],
  8209. // "parameters": {
  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. // "scopes": [
  8225. // "https://www.googleapis.com/auth/androidpublisher"
  8226. // ]
  8227. // }
  8228. }
  8229. // method id "androidpublisher.inappproducts.get":
  8230. type InappproductsGetCall struct {
  8231. s *Service
  8232. packageName string
  8233. skuid string
  8234. urlParams_ gensupport.URLParams
  8235. ifNoneMatch_ string
  8236. ctx_ context.Context
  8237. header_ http.Header
  8238. }
  8239. // Get: Returns information about the in-app product specified.
  8240. func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall {
  8241. c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8242. c.packageName = packageName
  8243. c.skuid = skuid
  8244. return c
  8245. }
  8246. // Fields allows partial responses to be retrieved. See
  8247. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8248. // for more information.
  8249. func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall {
  8250. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8251. return c
  8252. }
  8253. // IfNoneMatch sets the optional parameter which makes the operation
  8254. // fail if the object's ETag matches the given value. This is useful for
  8255. // getting updates only after the object has changed since the last
  8256. // request. Use googleapi.IsNotModified to check whether the response
  8257. // error from Do is the result of In-None-Match.
  8258. func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall {
  8259. c.ifNoneMatch_ = entityTag
  8260. return c
  8261. }
  8262. // Context sets the context to be used in this call's Do method. Any
  8263. // pending HTTP request will be aborted if the provided context is
  8264. // canceled.
  8265. func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall {
  8266. c.ctx_ = ctx
  8267. return c
  8268. }
  8269. // Header returns an http.Header that can be modified by the caller to
  8270. // add HTTP headers to the request.
  8271. func (c *InappproductsGetCall) Header() http.Header {
  8272. if c.header_ == nil {
  8273. c.header_ = make(http.Header)
  8274. }
  8275. return c.header_
  8276. }
  8277. func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) {
  8278. reqHeaders := make(http.Header)
  8279. for k, v := range c.header_ {
  8280. reqHeaders[k] = v
  8281. }
  8282. reqHeaders.Set("User-Agent", c.s.userAgent())
  8283. if c.ifNoneMatch_ != "" {
  8284. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8285. }
  8286. var body io.Reader = nil
  8287. c.urlParams_.Set("alt", alt)
  8288. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8289. urls += "?" + c.urlParams_.Encode()
  8290. req, _ := http.NewRequest("GET", urls, body)
  8291. req.Header = reqHeaders
  8292. googleapi.Expand(req.URL, map[string]string{
  8293. "packageName": c.packageName,
  8294. "sku": c.skuid,
  8295. })
  8296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8297. }
  8298. // Do executes the "androidpublisher.inappproducts.get" call.
  8299. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8300. // status code is an error. Response headers are in either
  8301. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8302. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8303. // to check whether the returned error was because
  8304. // http.StatusNotModified was returned.
  8305. func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8306. gensupport.SetOptions(c.urlParams_, opts...)
  8307. res, err := c.doRequest("json")
  8308. if res != nil && res.StatusCode == http.StatusNotModified {
  8309. if res.Body != nil {
  8310. res.Body.Close()
  8311. }
  8312. return nil, &googleapi.Error{
  8313. Code: res.StatusCode,
  8314. Header: res.Header,
  8315. }
  8316. }
  8317. if err != nil {
  8318. return nil, err
  8319. }
  8320. defer googleapi.CloseBody(res)
  8321. if err := googleapi.CheckResponse(res); err != nil {
  8322. return nil, err
  8323. }
  8324. ret := &InAppProduct{
  8325. ServerResponse: googleapi.ServerResponse{
  8326. Header: res.Header,
  8327. HTTPStatusCode: res.StatusCode,
  8328. },
  8329. }
  8330. target := &ret
  8331. if err := gensupport.DecodeResponse(target, res); err != nil {
  8332. return nil, err
  8333. }
  8334. return ret, nil
  8335. // {
  8336. // "description": "Returns information about the in-app product specified.",
  8337. // "httpMethod": "GET",
  8338. // "id": "androidpublisher.inappproducts.get",
  8339. // "parameterOrder": [
  8340. // "packageName",
  8341. // "sku"
  8342. // ],
  8343. // "parameters": {
  8344. // "packageName": {
  8345. // "location": "path",
  8346. // "required": true,
  8347. // "type": "string"
  8348. // },
  8349. // "sku": {
  8350. // "description": "Unique identifier for the in-app product.",
  8351. // "location": "path",
  8352. // "required": true,
  8353. // "type": "string"
  8354. // }
  8355. // },
  8356. // "path": "{packageName}/inappproducts/{sku}",
  8357. // "response": {
  8358. // "$ref": "InAppProduct"
  8359. // },
  8360. // "scopes": [
  8361. // "https://www.googleapis.com/auth/androidpublisher"
  8362. // ]
  8363. // }
  8364. }
  8365. // method id "androidpublisher.inappproducts.insert":
  8366. type InappproductsInsertCall struct {
  8367. s *Service
  8368. packageNameid string
  8369. inappproduct *InAppProduct
  8370. urlParams_ gensupport.URLParams
  8371. ctx_ context.Context
  8372. header_ http.Header
  8373. }
  8374. // Insert: Creates a new in-app product for an app.
  8375. func (r *InappproductsService) Insert(packageNameid string, inappproduct *InAppProduct) *InappproductsInsertCall {
  8376. c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8377. c.packageNameid = packageNameid
  8378. c.inappproduct = inappproduct
  8379. return c
  8380. }
  8381. // AutoConvertMissingPrices sets the optional parameter
  8382. // "autoConvertMissingPrices": If true the prices for all regions
  8383. // targeted by the parent app that don't have a price specified for this
  8384. // in-app product will be auto converted to the target currency based on
  8385. // the default price. Defaults to false.
  8386. func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall {
  8387. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8388. return c
  8389. }
  8390. // Fields allows partial responses to be retrieved. See
  8391. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8392. // for more information.
  8393. func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall {
  8394. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8395. return c
  8396. }
  8397. // Context sets the context to be used in this call's Do method. Any
  8398. // pending HTTP request will be aborted if the provided context is
  8399. // canceled.
  8400. func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall {
  8401. c.ctx_ = ctx
  8402. return c
  8403. }
  8404. // Header returns an http.Header that can be modified by the caller to
  8405. // add HTTP headers to the request.
  8406. func (c *InappproductsInsertCall) Header() http.Header {
  8407. if c.header_ == nil {
  8408. c.header_ = make(http.Header)
  8409. }
  8410. return c.header_
  8411. }
  8412. func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) {
  8413. reqHeaders := make(http.Header)
  8414. for k, v := range c.header_ {
  8415. reqHeaders[k] = v
  8416. }
  8417. reqHeaders.Set("User-Agent", c.s.userAgent())
  8418. var body io.Reader = nil
  8419. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8420. if err != nil {
  8421. return nil, err
  8422. }
  8423. reqHeaders.Set("Content-Type", "application/json")
  8424. c.urlParams_.Set("alt", alt)
  8425. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  8426. urls += "?" + c.urlParams_.Encode()
  8427. req, _ := http.NewRequest("POST", urls, body)
  8428. req.Header = reqHeaders
  8429. googleapi.Expand(req.URL, map[string]string{
  8430. "packageName": c.packageNameid,
  8431. })
  8432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8433. }
  8434. // Do executes the "androidpublisher.inappproducts.insert" call.
  8435. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8436. // status code is an error. Response headers are in either
  8437. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8438. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8439. // to check whether the returned error was because
  8440. // http.StatusNotModified was returned.
  8441. func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8442. gensupport.SetOptions(c.urlParams_, opts...)
  8443. res, err := c.doRequest("json")
  8444. if res != nil && res.StatusCode == http.StatusNotModified {
  8445. if res.Body != nil {
  8446. res.Body.Close()
  8447. }
  8448. return nil, &googleapi.Error{
  8449. Code: res.StatusCode,
  8450. Header: res.Header,
  8451. }
  8452. }
  8453. if err != nil {
  8454. return nil, err
  8455. }
  8456. defer googleapi.CloseBody(res)
  8457. if err := googleapi.CheckResponse(res); err != nil {
  8458. return nil, err
  8459. }
  8460. ret := &InAppProduct{
  8461. ServerResponse: googleapi.ServerResponse{
  8462. Header: res.Header,
  8463. HTTPStatusCode: res.StatusCode,
  8464. },
  8465. }
  8466. target := &ret
  8467. if err := gensupport.DecodeResponse(target, res); err != nil {
  8468. return nil, err
  8469. }
  8470. return ret, nil
  8471. // {
  8472. // "description": "Creates a new in-app product for an app.",
  8473. // "httpMethod": "POST",
  8474. // "id": "androidpublisher.inappproducts.insert",
  8475. // "parameterOrder": [
  8476. // "packageName"
  8477. // ],
  8478. // "parameters": {
  8479. // "autoConvertMissingPrices": {
  8480. // "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.",
  8481. // "location": "query",
  8482. // "type": "boolean"
  8483. // },
  8484. // "packageName": {
  8485. // "description": "Unique identifier for the Android app; for example, \"com.spiffygame\".",
  8486. // "location": "path",
  8487. // "required": true,
  8488. // "type": "string"
  8489. // }
  8490. // },
  8491. // "path": "{packageName}/inappproducts",
  8492. // "request": {
  8493. // "$ref": "InAppProduct"
  8494. // },
  8495. // "response": {
  8496. // "$ref": "InAppProduct"
  8497. // },
  8498. // "scopes": [
  8499. // "https://www.googleapis.com/auth/androidpublisher"
  8500. // ]
  8501. // }
  8502. }
  8503. // method id "androidpublisher.inappproducts.list":
  8504. type InappproductsListCall struct {
  8505. s *Service
  8506. packageNameid string
  8507. urlParams_ gensupport.URLParams
  8508. ifNoneMatch_ string
  8509. ctx_ context.Context
  8510. header_ http.Header
  8511. }
  8512. // List: List all the in-app products for an Android app, both
  8513. // subscriptions and managed in-app products..
  8514. func (r *InappproductsService) List(packageNameid string) *InappproductsListCall {
  8515. c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8516. c.packageNameid = packageNameid
  8517. return c
  8518. }
  8519. // MaxResults sets the optional parameter "maxResults":
  8520. func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall {
  8521. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8522. return c
  8523. }
  8524. // StartIndex sets the optional parameter "startIndex":
  8525. func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall {
  8526. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  8527. return c
  8528. }
  8529. // Token sets the optional parameter "token":
  8530. func (c *InappproductsListCall) Token(token string) *InappproductsListCall {
  8531. c.urlParams_.Set("token", token)
  8532. return c
  8533. }
  8534. // Fields allows partial responses to be retrieved. See
  8535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8536. // for more information.
  8537. func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall {
  8538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8539. return c
  8540. }
  8541. // IfNoneMatch sets the optional parameter which makes the operation
  8542. // fail if the object's ETag matches the given value. This is useful for
  8543. // getting updates only after the object has changed since the last
  8544. // request. Use googleapi.IsNotModified to check whether the response
  8545. // error from Do is the result of In-None-Match.
  8546. func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall {
  8547. c.ifNoneMatch_ = entityTag
  8548. return c
  8549. }
  8550. // Context sets the context to be used in this call's Do method. Any
  8551. // pending HTTP request will be aborted if the provided context is
  8552. // canceled.
  8553. func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall {
  8554. c.ctx_ = ctx
  8555. return c
  8556. }
  8557. // Header returns an http.Header that can be modified by the caller to
  8558. // add HTTP headers to the request.
  8559. func (c *InappproductsListCall) Header() http.Header {
  8560. if c.header_ == nil {
  8561. c.header_ = make(http.Header)
  8562. }
  8563. return c.header_
  8564. }
  8565. func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) {
  8566. reqHeaders := make(http.Header)
  8567. for k, v := range c.header_ {
  8568. reqHeaders[k] = v
  8569. }
  8570. reqHeaders.Set("User-Agent", c.s.userAgent())
  8571. if c.ifNoneMatch_ != "" {
  8572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8573. }
  8574. var body io.Reader = nil
  8575. c.urlParams_.Set("alt", alt)
  8576. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  8577. urls += "?" + c.urlParams_.Encode()
  8578. req, _ := http.NewRequest("GET", urls, body)
  8579. req.Header = reqHeaders
  8580. googleapi.Expand(req.URL, map[string]string{
  8581. "packageName": c.packageNameid,
  8582. })
  8583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8584. }
  8585. // Do executes the "androidpublisher.inappproducts.list" call.
  8586. // Exactly one of *InappproductsListResponse or error will be non-nil.
  8587. // Any non-2xx status code is an error. Response headers are in either
  8588. // *InappproductsListResponse.ServerResponse.Header or (if a response
  8589. // was returned at all) in error.(*googleapi.Error).Header. Use
  8590. // googleapi.IsNotModified to check whether the returned error was
  8591. // because http.StatusNotModified was returned.
  8592. func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) {
  8593. gensupport.SetOptions(c.urlParams_, opts...)
  8594. res, err := c.doRequest("json")
  8595. if res != nil && res.StatusCode == http.StatusNotModified {
  8596. if res.Body != nil {
  8597. res.Body.Close()
  8598. }
  8599. return nil, &googleapi.Error{
  8600. Code: res.StatusCode,
  8601. Header: res.Header,
  8602. }
  8603. }
  8604. if err != nil {
  8605. return nil, err
  8606. }
  8607. defer googleapi.CloseBody(res)
  8608. if err := googleapi.CheckResponse(res); err != nil {
  8609. return nil, err
  8610. }
  8611. ret := &InappproductsListResponse{
  8612. ServerResponse: googleapi.ServerResponse{
  8613. Header: res.Header,
  8614. HTTPStatusCode: res.StatusCode,
  8615. },
  8616. }
  8617. target := &ret
  8618. if err := gensupport.DecodeResponse(target, res); err != nil {
  8619. return nil, err
  8620. }
  8621. return ret, nil
  8622. // {
  8623. // "description": "List all the in-app products for an Android app, both subscriptions and managed in-app products..",
  8624. // "httpMethod": "GET",
  8625. // "id": "androidpublisher.inappproducts.list",
  8626. // "parameterOrder": [
  8627. // "packageName"
  8628. // ],
  8629. // "parameters": {
  8630. // "maxResults": {
  8631. // "format": "uint32",
  8632. // "location": "query",
  8633. // "type": "integer"
  8634. // },
  8635. // "packageName": {
  8636. // "description": "Unique identifier for the Android app with in-app products; for example, \"com.spiffygame\".",
  8637. // "location": "path",
  8638. // "required": true,
  8639. // "type": "string"
  8640. // },
  8641. // "startIndex": {
  8642. // "format": "uint32",
  8643. // "location": "query",
  8644. // "type": "integer"
  8645. // },
  8646. // "token": {
  8647. // "location": "query",
  8648. // "type": "string"
  8649. // }
  8650. // },
  8651. // "path": "{packageName}/inappproducts",
  8652. // "response": {
  8653. // "$ref": "InappproductsListResponse"
  8654. // },
  8655. // "scopes": [
  8656. // "https://www.googleapis.com/auth/androidpublisher"
  8657. // ]
  8658. // }
  8659. }
  8660. // method id "androidpublisher.inappproducts.patch":
  8661. type InappproductsPatchCall struct {
  8662. s *Service
  8663. packageNameid string
  8664. skuid string
  8665. inappproduct *InAppProduct
  8666. urlParams_ gensupport.URLParams
  8667. ctx_ context.Context
  8668. header_ http.Header
  8669. }
  8670. // Patch: Updates the details of an in-app product. This method supports
  8671. // patch semantics.
  8672. func (r *InappproductsService) Patch(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall {
  8673. c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8674. c.packageNameid = packageNameid
  8675. c.skuid = skuid
  8676. c.inappproduct = inappproduct
  8677. return c
  8678. }
  8679. // AutoConvertMissingPrices sets the optional parameter
  8680. // "autoConvertMissingPrices": If true the prices for all regions
  8681. // targeted by the parent app that don't have a price specified for this
  8682. // in-app product will be auto converted to the target currency based on
  8683. // the default price. Defaults to false.
  8684. func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall {
  8685. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8686. return c
  8687. }
  8688. // Fields allows partial responses to be retrieved. See
  8689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8690. // for more information.
  8691. func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall {
  8692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8693. return c
  8694. }
  8695. // Context sets the context to be used in this call's Do method. Any
  8696. // pending HTTP request will be aborted if the provided context is
  8697. // canceled.
  8698. func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall {
  8699. c.ctx_ = ctx
  8700. return c
  8701. }
  8702. // Header returns an http.Header that can be modified by the caller to
  8703. // add HTTP headers to the request.
  8704. func (c *InappproductsPatchCall) Header() http.Header {
  8705. if c.header_ == nil {
  8706. c.header_ = make(http.Header)
  8707. }
  8708. return c.header_
  8709. }
  8710. func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) {
  8711. reqHeaders := make(http.Header)
  8712. for k, v := range c.header_ {
  8713. reqHeaders[k] = v
  8714. }
  8715. reqHeaders.Set("User-Agent", c.s.userAgent())
  8716. var body io.Reader = nil
  8717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8718. if err != nil {
  8719. return nil, err
  8720. }
  8721. reqHeaders.Set("Content-Type", "application/json")
  8722. c.urlParams_.Set("alt", alt)
  8723. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8724. urls += "?" + c.urlParams_.Encode()
  8725. req, _ := http.NewRequest("PATCH", urls, body)
  8726. req.Header = reqHeaders
  8727. googleapi.Expand(req.URL, map[string]string{
  8728. "packageName": c.packageNameid,
  8729. "sku": c.skuid,
  8730. })
  8731. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8732. }
  8733. // Do executes the "androidpublisher.inappproducts.patch" call.
  8734. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8735. // status code is an error. Response headers are in either
  8736. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8737. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8738. // to check whether the returned error was because
  8739. // http.StatusNotModified was returned.
  8740. func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8741. gensupport.SetOptions(c.urlParams_, opts...)
  8742. res, err := c.doRequest("json")
  8743. if res != nil && res.StatusCode == http.StatusNotModified {
  8744. if res.Body != nil {
  8745. res.Body.Close()
  8746. }
  8747. return nil, &googleapi.Error{
  8748. Code: res.StatusCode,
  8749. Header: res.Header,
  8750. }
  8751. }
  8752. if err != nil {
  8753. return nil, err
  8754. }
  8755. defer googleapi.CloseBody(res)
  8756. if err := googleapi.CheckResponse(res); err != nil {
  8757. return nil, err
  8758. }
  8759. ret := &InAppProduct{
  8760. ServerResponse: googleapi.ServerResponse{
  8761. Header: res.Header,
  8762. HTTPStatusCode: res.StatusCode,
  8763. },
  8764. }
  8765. target := &ret
  8766. if err := gensupport.DecodeResponse(target, res); err != nil {
  8767. return nil, err
  8768. }
  8769. return ret, nil
  8770. // {
  8771. // "description": "Updates the details of an in-app product. This method supports patch semantics.",
  8772. // "httpMethod": "PATCH",
  8773. // "id": "androidpublisher.inappproducts.patch",
  8774. // "parameterOrder": [
  8775. // "packageName",
  8776. // "sku"
  8777. // ],
  8778. // "parameters": {
  8779. // "autoConvertMissingPrices": {
  8780. // "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.",
  8781. // "location": "query",
  8782. // "type": "boolean"
  8783. // },
  8784. // "packageName": {
  8785. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  8786. // "location": "path",
  8787. // "required": true,
  8788. // "type": "string"
  8789. // },
  8790. // "sku": {
  8791. // "description": "Unique identifier for the in-app product.",
  8792. // "location": "path",
  8793. // "required": true,
  8794. // "type": "string"
  8795. // }
  8796. // },
  8797. // "path": "{packageName}/inappproducts/{sku}",
  8798. // "request": {
  8799. // "$ref": "InAppProduct"
  8800. // },
  8801. // "response": {
  8802. // "$ref": "InAppProduct"
  8803. // },
  8804. // "scopes": [
  8805. // "https://www.googleapis.com/auth/androidpublisher"
  8806. // ]
  8807. // }
  8808. }
  8809. // method id "androidpublisher.inappproducts.update":
  8810. type InappproductsUpdateCall struct {
  8811. s *Service
  8812. packageNameid string
  8813. skuid string
  8814. inappproduct *InAppProduct
  8815. urlParams_ gensupport.URLParams
  8816. ctx_ context.Context
  8817. header_ http.Header
  8818. }
  8819. // Update: Updates the details of an in-app product.
  8820. func (r *InappproductsService) Update(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall {
  8821. c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8822. c.packageNameid = packageNameid
  8823. c.skuid = skuid
  8824. c.inappproduct = inappproduct
  8825. return c
  8826. }
  8827. // AutoConvertMissingPrices sets the optional parameter
  8828. // "autoConvertMissingPrices": If true the prices for all regions
  8829. // targeted by the parent app that don't have a price specified for this
  8830. // in-app product will be auto converted to the target currency based on
  8831. // the default price. Defaults to false.
  8832. func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall {
  8833. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  8834. return c
  8835. }
  8836. // Fields allows partial responses to be retrieved. See
  8837. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8838. // for more information.
  8839. func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall {
  8840. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8841. return c
  8842. }
  8843. // Context sets the context to be used in this call's Do method. Any
  8844. // pending HTTP request will be aborted if the provided context is
  8845. // canceled.
  8846. func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall {
  8847. c.ctx_ = ctx
  8848. return c
  8849. }
  8850. // Header returns an http.Header that can be modified by the caller to
  8851. // add HTTP headers to the request.
  8852. func (c *InappproductsUpdateCall) Header() http.Header {
  8853. if c.header_ == nil {
  8854. c.header_ = make(http.Header)
  8855. }
  8856. return c.header_
  8857. }
  8858. func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8859. reqHeaders := make(http.Header)
  8860. for k, v := range c.header_ {
  8861. reqHeaders[k] = v
  8862. }
  8863. reqHeaders.Set("User-Agent", c.s.userAgent())
  8864. var body io.Reader = nil
  8865. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8866. if err != nil {
  8867. return nil, err
  8868. }
  8869. reqHeaders.Set("Content-Type", "application/json")
  8870. c.urlParams_.Set("alt", alt)
  8871. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8872. urls += "?" + c.urlParams_.Encode()
  8873. req, _ := http.NewRequest("PUT", urls, body)
  8874. req.Header = reqHeaders
  8875. googleapi.Expand(req.URL, map[string]string{
  8876. "packageName": c.packageNameid,
  8877. "sku": c.skuid,
  8878. })
  8879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8880. }
  8881. // Do executes the "androidpublisher.inappproducts.update" call.
  8882. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8883. // status code is an error. Response headers are in either
  8884. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8885. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8886. // to check whether the returned error was because
  8887. // http.StatusNotModified was returned.
  8888. func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8889. gensupport.SetOptions(c.urlParams_, opts...)
  8890. res, err := c.doRequest("json")
  8891. if res != nil && res.StatusCode == http.StatusNotModified {
  8892. if res.Body != nil {
  8893. res.Body.Close()
  8894. }
  8895. return nil, &googleapi.Error{
  8896. Code: res.StatusCode,
  8897. Header: res.Header,
  8898. }
  8899. }
  8900. if err != nil {
  8901. return nil, err
  8902. }
  8903. defer googleapi.CloseBody(res)
  8904. if err := googleapi.CheckResponse(res); err != nil {
  8905. return nil, err
  8906. }
  8907. ret := &InAppProduct{
  8908. ServerResponse: googleapi.ServerResponse{
  8909. Header: res.Header,
  8910. HTTPStatusCode: res.StatusCode,
  8911. },
  8912. }
  8913. target := &ret
  8914. if err := gensupport.DecodeResponse(target, res); err != nil {
  8915. return nil, err
  8916. }
  8917. return ret, nil
  8918. // {
  8919. // "description": "Updates the details of an in-app product.",
  8920. // "httpMethod": "PUT",
  8921. // "id": "androidpublisher.inappproducts.update",
  8922. // "parameterOrder": [
  8923. // "packageName",
  8924. // "sku"
  8925. // ],
  8926. // "parameters": {
  8927. // "autoConvertMissingPrices": {
  8928. // "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.",
  8929. // "location": "query",
  8930. // "type": "boolean"
  8931. // },
  8932. // "packageName": {
  8933. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  8934. // "location": "path",
  8935. // "required": true,
  8936. // "type": "string"
  8937. // },
  8938. // "sku": {
  8939. // "description": "Unique identifier for the in-app product.",
  8940. // "location": "path",
  8941. // "required": true,
  8942. // "type": "string"
  8943. // }
  8944. // },
  8945. // "path": "{packageName}/inappproducts/{sku}",
  8946. // "request": {
  8947. // "$ref": "InAppProduct"
  8948. // },
  8949. // "response": {
  8950. // "$ref": "InAppProduct"
  8951. // },
  8952. // "scopes": [
  8953. // "https://www.googleapis.com/auth/androidpublisher"
  8954. // ]
  8955. // }
  8956. }
  8957. // method id "androidpublisher.orders.refund":
  8958. type OrdersRefundCall struct {
  8959. s *Service
  8960. packageName string
  8961. orderId string
  8962. urlParams_ gensupport.URLParams
  8963. ctx_ context.Context
  8964. header_ http.Header
  8965. }
  8966. // Refund: Refund a user's subscription or in-app purchase order.
  8967. func (r *OrdersService) Refund(packageName string, orderId string) *OrdersRefundCall {
  8968. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8969. c.packageName = packageName
  8970. c.orderId = orderId
  8971. return c
  8972. }
  8973. // Revoke sets the optional parameter "revoke": Whether to revoke the
  8974. // purchased item. If set to true, access to the subscription or in-app
  8975. // item will be terminated immediately. If the item is a recurring
  8976. // subscription, all future payments will also be terminated. Consumed
  8977. // in-app items need to be handled by developer's app. (optional)
  8978. func (c *OrdersRefundCall) Revoke(revoke bool) *OrdersRefundCall {
  8979. c.urlParams_.Set("revoke", fmt.Sprint(revoke))
  8980. return c
  8981. }
  8982. // Fields allows partial responses to be retrieved. See
  8983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8984. // for more information.
  8985. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  8986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8987. return c
  8988. }
  8989. // Context sets the context to be used in this call's Do method. Any
  8990. // pending HTTP request will be aborted if the provided context is
  8991. // canceled.
  8992. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  8993. c.ctx_ = ctx
  8994. return c
  8995. }
  8996. // Header returns an http.Header that can be modified by the caller to
  8997. // add HTTP headers to the request.
  8998. func (c *OrdersRefundCall) Header() http.Header {
  8999. if c.header_ == nil {
  9000. c.header_ = make(http.Header)
  9001. }
  9002. return c.header_
  9003. }
  9004. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  9005. reqHeaders := make(http.Header)
  9006. for k, v := range c.header_ {
  9007. reqHeaders[k] = v
  9008. }
  9009. reqHeaders.Set("User-Agent", c.s.userAgent())
  9010. var body io.Reader = nil
  9011. c.urlParams_.Set("alt", alt)
  9012. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/orders/{orderId}:refund")
  9013. urls += "?" + c.urlParams_.Encode()
  9014. req, _ := http.NewRequest("POST", urls, body)
  9015. req.Header = reqHeaders
  9016. googleapi.Expand(req.URL, map[string]string{
  9017. "packageName": c.packageName,
  9018. "orderId": c.orderId,
  9019. })
  9020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9021. }
  9022. // Do executes the "androidpublisher.orders.refund" call.
  9023. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) error {
  9024. gensupport.SetOptions(c.urlParams_, opts...)
  9025. res, err := c.doRequest("json")
  9026. if err != nil {
  9027. return err
  9028. }
  9029. defer googleapi.CloseBody(res)
  9030. if err := googleapi.CheckResponse(res); err != nil {
  9031. return err
  9032. }
  9033. return nil
  9034. // {
  9035. // "description": "Refund a user's subscription or in-app purchase order.",
  9036. // "httpMethod": "POST",
  9037. // "id": "androidpublisher.orders.refund",
  9038. // "parameterOrder": [
  9039. // "packageName",
  9040. // "orderId"
  9041. // ],
  9042. // "parameters": {
  9043. // "orderId": {
  9044. // "description": "The order ID provided to the user when the subscription or in-app order was purchased.",
  9045. // "location": "path",
  9046. // "required": true,
  9047. // "type": "string"
  9048. // },
  9049. // "packageName": {
  9050. // "description": "The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing').",
  9051. // "location": "path",
  9052. // "required": true,
  9053. // "type": "string"
  9054. // },
  9055. // "revoke": {
  9056. // "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)",
  9057. // "location": "query",
  9058. // "type": "boolean"
  9059. // }
  9060. // },
  9061. // "path": "{packageName}/orders/{orderId}:refund",
  9062. // "scopes": [
  9063. // "https://www.googleapis.com/auth/androidpublisher"
  9064. // ]
  9065. // }
  9066. }
  9067. // method id "androidpublisher.purchases.products.get":
  9068. type PurchasesProductsGetCall struct {
  9069. s *Service
  9070. packageName string
  9071. productId string
  9072. token string
  9073. urlParams_ gensupport.URLParams
  9074. ifNoneMatch_ string
  9075. ctx_ context.Context
  9076. header_ http.Header
  9077. }
  9078. // Get: Checks the purchase and consumption status of an inapp item.
  9079. func (r *PurchasesProductsService) Get(packageName string, productId string, token string) *PurchasesProductsGetCall {
  9080. c := &PurchasesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9081. c.packageName = packageName
  9082. c.productId = productId
  9083. c.token = token
  9084. return c
  9085. }
  9086. // Fields allows partial responses to be retrieved. See
  9087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9088. // for more information.
  9089. func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall {
  9090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9091. return c
  9092. }
  9093. // IfNoneMatch sets the optional parameter which makes the operation
  9094. // fail if the object's ETag matches the given value. This is useful for
  9095. // getting updates only after the object has changed since the last
  9096. // request. Use googleapi.IsNotModified to check whether the response
  9097. // error from Do is the result of In-None-Match.
  9098. func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall {
  9099. c.ifNoneMatch_ = entityTag
  9100. return c
  9101. }
  9102. // Context sets the context to be used in this call's Do method. Any
  9103. // pending HTTP request will be aborted if the provided context is
  9104. // canceled.
  9105. func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall {
  9106. c.ctx_ = ctx
  9107. return c
  9108. }
  9109. // Header returns an http.Header that can be modified by the caller to
  9110. // add HTTP headers to the request.
  9111. func (c *PurchasesProductsGetCall) Header() http.Header {
  9112. if c.header_ == nil {
  9113. c.header_ = make(http.Header)
  9114. }
  9115. return c.header_
  9116. }
  9117. func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) {
  9118. reqHeaders := make(http.Header)
  9119. for k, v := range c.header_ {
  9120. reqHeaders[k] = v
  9121. }
  9122. reqHeaders.Set("User-Agent", c.s.userAgent())
  9123. if c.ifNoneMatch_ != "" {
  9124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9125. }
  9126. var body io.Reader = nil
  9127. c.urlParams_.Set("alt", alt)
  9128. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/products/{productId}/tokens/{token}")
  9129. urls += "?" + c.urlParams_.Encode()
  9130. req, _ := http.NewRequest("GET", urls, body)
  9131. req.Header = reqHeaders
  9132. googleapi.Expand(req.URL, map[string]string{
  9133. "packageName": c.packageName,
  9134. "productId": c.productId,
  9135. "token": c.token,
  9136. })
  9137. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9138. }
  9139. // Do executes the "androidpublisher.purchases.products.get" call.
  9140. // Exactly one of *ProductPurchase or error will be non-nil. Any non-2xx
  9141. // status code is an error. Response headers are in either
  9142. // *ProductPurchase.ServerResponse.Header or (if a response was returned
  9143. // at all) in error.(*googleapi.Error).Header. Use
  9144. // googleapi.IsNotModified to check whether the returned error was
  9145. // because http.StatusNotModified was returned.
  9146. func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase, error) {
  9147. gensupport.SetOptions(c.urlParams_, opts...)
  9148. res, err := c.doRequest("json")
  9149. if res != nil && res.StatusCode == http.StatusNotModified {
  9150. if res.Body != nil {
  9151. res.Body.Close()
  9152. }
  9153. return nil, &googleapi.Error{
  9154. Code: res.StatusCode,
  9155. Header: res.Header,
  9156. }
  9157. }
  9158. if err != nil {
  9159. return nil, err
  9160. }
  9161. defer googleapi.CloseBody(res)
  9162. if err := googleapi.CheckResponse(res); err != nil {
  9163. return nil, err
  9164. }
  9165. ret := &ProductPurchase{
  9166. ServerResponse: googleapi.ServerResponse{
  9167. Header: res.Header,
  9168. HTTPStatusCode: res.StatusCode,
  9169. },
  9170. }
  9171. target := &ret
  9172. if err := gensupport.DecodeResponse(target, res); err != nil {
  9173. return nil, err
  9174. }
  9175. return ret, nil
  9176. // {
  9177. // "description": "Checks the purchase and consumption status of an inapp item.",
  9178. // "httpMethod": "GET",
  9179. // "id": "androidpublisher.purchases.products.get",
  9180. // "parameterOrder": [
  9181. // "packageName",
  9182. // "productId",
  9183. // "token"
  9184. // ],
  9185. // "parameters": {
  9186. // "packageName": {
  9187. // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').",
  9188. // "location": "path",
  9189. // "required": true,
  9190. // "type": "string"
  9191. // },
  9192. // "productId": {
  9193. // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').",
  9194. // "location": "path",
  9195. // "required": true,
  9196. // "type": "string"
  9197. // },
  9198. // "token": {
  9199. // "description": "The token provided to the user's device when the inapp product was purchased.",
  9200. // "location": "path",
  9201. // "required": true,
  9202. // "type": "string"
  9203. // }
  9204. // },
  9205. // "path": "{packageName}/purchases/products/{productId}/tokens/{token}",
  9206. // "response": {
  9207. // "$ref": "ProductPurchase"
  9208. // },
  9209. // "scopes": [
  9210. // "https://www.googleapis.com/auth/androidpublisher"
  9211. // ]
  9212. // }
  9213. }
  9214. // method id "androidpublisher.purchases.subscriptions.cancel":
  9215. type PurchasesSubscriptionsCancelCall struct {
  9216. s *Service
  9217. packageName string
  9218. subscriptionId string
  9219. token string
  9220. urlParams_ gensupport.URLParams
  9221. ctx_ context.Context
  9222. header_ http.Header
  9223. }
  9224. // Cancel: Cancels a user's subscription purchase. The subscription
  9225. // remains valid until its expiration time.
  9226. func (r *PurchasesSubscriptionsService) Cancel(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsCancelCall {
  9227. c := &PurchasesSubscriptionsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9228. c.packageName = packageName
  9229. c.subscriptionId = subscriptionId
  9230. c.token = token
  9231. return c
  9232. }
  9233. // Fields allows partial responses to be retrieved. See
  9234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9235. // for more information.
  9236. func (c *PurchasesSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsCancelCall {
  9237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9238. return c
  9239. }
  9240. // Context sets the context to be used in this call's Do method. Any
  9241. // pending HTTP request will be aborted if the provided context is
  9242. // canceled.
  9243. func (c *PurchasesSubscriptionsCancelCall) Context(ctx context.Context) *PurchasesSubscriptionsCancelCall {
  9244. c.ctx_ = ctx
  9245. return c
  9246. }
  9247. // Header returns an http.Header that can be modified by the caller to
  9248. // add HTTP headers to the request.
  9249. func (c *PurchasesSubscriptionsCancelCall) Header() http.Header {
  9250. if c.header_ == nil {
  9251. c.header_ = make(http.Header)
  9252. }
  9253. return c.header_
  9254. }
  9255. func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) {
  9256. reqHeaders := make(http.Header)
  9257. for k, v := range c.header_ {
  9258. reqHeaders[k] = v
  9259. }
  9260. reqHeaders.Set("User-Agent", c.s.userAgent())
  9261. var body io.Reader = nil
  9262. c.urlParams_.Set("alt", alt)
  9263. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel")
  9264. urls += "?" + c.urlParams_.Encode()
  9265. req, _ := http.NewRequest("POST", urls, body)
  9266. req.Header = reqHeaders
  9267. googleapi.Expand(req.URL, map[string]string{
  9268. "packageName": c.packageName,
  9269. "subscriptionId": c.subscriptionId,
  9270. "token": c.token,
  9271. })
  9272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9273. }
  9274. // Do executes the "androidpublisher.purchases.subscriptions.cancel" call.
  9275. func (c *PurchasesSubscriptionsCancelCall) Do(opts ...googleapi.CallOption) error {
  9276. gensupport.SetOptions(c.urlParams_, opts...)
  9277. res, err := c.doRequest("json")
  9278. if err != nil {
  9279. return err
  9280. }
  9281. defer googleapi.CloseBody(res)
  9282. if err := googleapi.CheckResponse(res); err != nil {
  9283. return err
  9284. }
  9285. return nil
  9286. // {
  9287. // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
  9288. // "httpMethod": "POST",
  9289. // "id": "androidpublisher.purchases.subscriptions.cancel",
  9290. // "parameterOrder": [
  9291. // "packageName",
  9292. // "subscriptionId",
  9293. // "token"
  9294. // ],
  9295. // "parameters": {
  9296. // "packageName": {
  9297. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9298. // "location": "path",
  9299. // "required": true,
  9300. // "type": "string"
  9301. // },
  9302. // "subscriptionId": {
  9303. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9304. // "location": "path",
  9305. // "required": true,
  9306. // "type": "string"
  9307. // },
  9308. // "token": {
  9309. // "description": "The token provided to the user's device when the subscription was purchased.",
  9310. // "location": "path",
  9311. // "required": true,
  9312. // "type": "string"
  9313. // }
  9314. // },
  9315. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel",
  9316. // "scopes": [
  9317. // "https://www.googleapis.com/auth/androidpublisher"
  9318. // ]
  9319. // }
  9320. }
  9321. // method id "androidpublisher.purchases.subscriptions.defer":
  9322. type PurchasesSubscriptionsDeferCall struct {
  9323. s *Service
  9324. packageName string
  9325. subscriptionId string
  9326. token string
  9327. subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest
  9328. urlParams_ gensupport.URLParams
  9329. ctx_ context.Context
  9330. header_ http.Header
  9331. }
  9332. // Defer: Defers a user's subscription purchase until a specified future
  9333. // expiration time.
  9334. func (r *PurchasesSubscriptionsService) Defer(packageName string, subscriptionId string, token string, subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest) *PurchasesSubscriptionsDeferCall {
  9335. c := &PurchasesSubscriptionsDeferCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9336. c.packageName = packageName
  9337. c.subscriptionId = subscriptionId
  9338. c.token = token
  9339. c.subscriptionpurchasesdeferrequest = subscriptionpurchasesdeferrequest
  9340. return c
  9341. }
  9342. // Fields allows partial responses to be retrieved. See
  9343. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9344. // for more information.
  9345. func (c *PurchasesSubscriptionsDeferCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsDeferCall {
  9346. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9347. return c
  9348. }
  9349. // Context sets the context to be used in this call's Do method. Any
  9350. // pending HTTP request will be aborted if the provided context is
  9351. // canceled.
  9352. func (c *PurchasesSubscriptionsDeferCall) Context(ctx context.Context) *PurchasesSubscriptionsDeferCall {
  9353. c.ctx_ = ctx
  9354. return c
  9355. }
  9356. // Header returns an http.Header that can be modified by the caller to
  9357. // add HTTP headers to the request.
  9358. func (c *PurchasesSubscriptionsDeferCall) Header() http.Header {
  9359. if c.header_ == nil {
  9360. c.header_ = make(http.Header)
  9361. }
  9362. return c.header_
  9363. }
  9364. func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) {
  9365. reqHeaders := make(http.Header)
  9366. for k, v := range c.header_ {
  9367. reqHeaders[k] = v
  9368. }
  9369. reqHeaders.Set("User-Agent", c.s.userAgent())
  9370. var body io.Reader = nil
  9371. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest)
  9372. if err != nil {
  9373. return nil, err
  9374. }
  9375. reqHeaders.Set("Content-Type", "application/json")
  9376. c.urlParams_.Set("alt", alt)
  9377. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer")
  9378. urls += "?" + c.urlParams_.Encode()
  9379. req, _ := http.NewRequest("POST", urls, body)
  9380. req.Header = reqHeaders
  9381. googleapi.Expand(req.URL, map[string]string{
  9382. "packageName": c.packageName,
  9383. "subscriptionId": c.subscriptionId,
  9384. "token": c.token,
  9385. })
  9386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9387. }
  9388. // Do executes the "androidpublisher.purchases.subscriptions.defer" call.
  9389. // Exactly one of *SubscriptionPurchasesDeferResponse or error will be
  9390. // non-nil. Any non-2xx status code is an error. Response headers are in
  9391. // either *SubscriptionPurchasesDeferResponse.ServerResponse.Header or
  9392. // (if a response was returned at all) in
  9393. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9394. // whether the returned error was because http.StatusNotModified was
  9395. // returned.
  9396. func (c *PurchasesSubscriptionsDeferCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchasesDeferResponse, error) {
  9397. gensupport.SetOptions(c.urlParams_, opts...)
  9398. res, err := c.doRequest("json")
  9399. if res != nil && res.StatusCode == http.StatusNotModified {
  9400. if res.Body != nil {
  9401. res.Body.Close()
  9402. }
  9403. return nil, &googleapi.Error{
  9404. Code: res.StatusCode,
  9405. Header: res.Header,
  9406. }
  9407. }
  9408. if err != nil {
  9409. return nil, err
  9410. }
  9411. defer googleapi.CloseBody(res)
  9412. if err := googleapi.CheckResponse(res); err != nil {
  9413. return nil, err
  9414. }
  9415. ret := &SubscriptionPurchasesDeferResponse{
  9416. ServerResponse: googleapi.ServerResponse{
  9417. Header: res.Header,
  9418. HTTPStatusCode: res.StatusCode,
  9419. },
  9420. }
  9421. target := &ret
  9422. if err := gensupport.DecodeResponse(target, res); err != nil {
  9423. return nil, err
  9424. }
  9425. return ret, nil
  9426. // {
  9427. // "description": "Defers a user's subscription purchase until a specified future expiration time.",
  9428. // "httpMethod": "POST",
  9429. // "id": "androidpublisher.purchases.subscriptions.defer",
  9430. // "parameterOrder": [
  9431. // "packageName",
  9432. // "subscriptionId",
  9433. // "token"
  9434. // ],
  9435. // "parameters": {
  9436. // "packageName": {
  9437. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9438. // "location": "path",
  9439. // "required": true,
  9440. // "type": "string"
  9441. // },
  9442. // "subscriptionId": {
  9443. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9444. // "location": "path",
  9445. // "required": true,
  9446. // "type": "string"
  9447. // },
  9448. // "token": {
  9449. // "description": "The token provided to the user's device when the subscription was purchased.",
  9450. // "location": "path",
  9451. // "required": true,
  9452. // "type": "string"
  9453. // }
  9454. // },
  9455. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer",
  9456. // "request": {
  9457. // "$ref": "SubscriptionPurchasesDeferRequest"
  9458. // },
  9459. // "response": {
  9460. // "$ref": "SubscriptionPurchasesDeferResponse"
  9461. // },
  9462. // "scopes": [
  9463. // "https://www.googleapis.com/auth/androidpublisher"
  9464. // ]
  9465. // }
  9466. }
  9467. // method id "androidpublisher.purchases.subscriptions.get":
  9468. type PurchasesSubscriptionsGetCall struct {
  9469. s *Service
  9470. packageName string
  9471. subscriptionId string
  9472. token string
  9473. urlParams_ gensupport.URLParams
  9474. ifNoneMatch_ string
  9475. ctx_ context.Context
  9476. header_ http.Header
  9477. }
  9478. // Get: Checks whether a user's subscription purchase is valid and
  9479. // returns its expiry time.
  9480. func (r *PurchasesSubscriptionsService) Get(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsGetCall {
  9481. c := &PurchasesSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9482. c.packageName = packageName
  9483. c.subscriptionId = subscriptionId
  9484. c.token = token
  9485. return c
  9486. }
  9487. // Fields allows partial responses to be retrieved. See
  9488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9489. // for more information.
  9490. func (c *PurchasesSubscriptionsGetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsGetCall {
  9491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9492. return c
  9493. }
  9494. // IfNoneMatch sets the optional parameter which makes the operation
  9495. // fail if the object's ETag matches the given value. This is useful for
  9496. // getting updates only after the object has changed since the last
  9497. // request. Use googleapi.IsNotModified to check whether the response
  9498. // error from Do is the result of In-None-Match.
  9499. func (c *PurchasesSubscriptionsGetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsGetCall {
  9500. c.ifNoneMatch_ = entityTag
  9501. return c
  9502. }
  9503. // Context sets the context to be used in this call's Do method. Any
  9504. // pending HTTP request will be aborted if the provided context is
  9505. // canceled.
  9506. func (c *PurchasesSubscriptionsGetCall) Context(ctx context.Context) *PurchasesSubscriptionsGetCall {
  9507. c.ctx_ = ctx
  9508. return c
  9509. }
  9510. // Header returns an http.Header that can be modified by the caller to
  9511. // add HTTP headers to the request.
  9512. func (c *PurchasesSubscriptionsGetCall) Header() http.Header {
  9513. if c.header_ == nil {
  9514. c.header_ = make(http.Header)
  9515. }
  9516. return c.header_
  9517. }
  9518. func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  9519. reqHeaders := make(http.Header)
  9520. for k, v := range c.header_ {
  9521. reqHeaders[k] = v
  9522. }
  9523. reqHeaders.Set("User-Agent", c.s.userAgent())
  9524. if c.ifNoneMatch_ != "" {
  9525. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9526. }
  9527. var body io.Reader = nil
  9528. c.urlParams_.Set("alt", alt)
  9529. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}")
  9530. urls += "?" + c.urlParams_.Encode()
  9531. req, _ := http.NewRequest("GET", urls, body)
  9532. req.Header = reqHeaders
  9533. googleapi.Expand(req.URL, map[string]string{
  9534. "packageName": c.packageName,
  9535. "subscriptionId": c.subscriptionId,
  9536. "token": c.token,
  9537. })
  9538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9539. }
  9540. // Do executes the "androidpublisher.purchases.subscriptions.get" call.
  9541. // Exactly one of *SubscriptionPurchase or error will be non-nil. Any
  9542. // non-2xx status code is an error. Response headers are in either
  9543. // *SubscriptionPurchase.ServerResponse.Header or (if a response was
  9544. // returned at all) in error.(*googleapi.Error).Header. Use
  9545. // googleapi.IsNotModified to check whether the returned error was
  9546. // because http.StatusNotModified was returned.
  9547. func (c *PurchasesSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchase, error) {
  9548. gensupport.SetOptions(c.urlParams_, opts...)
  9549. res, err := c.doRequest("json")
  9550. if res != nil && res.StatusCode == http.StatusNotModified {
  9551. if res.Body != nil {
  9552. res.Body.Close()
  9553. }
  9554. return nil, &googleapi.Error{
  9555. Code: res.StatusCode,
  9556. Header: res.Header,
  9557. }
  9558. }
  9559. if err != nil {
  9560. return nil, err
  9561. }
  9562. defer googleapi.CloseBody(res)
  9563. if err := googleapi.CheckResponse(res); err != nil {
  9564. return nil, err
  9565. }
  9566. ret := &SubscriptionPurchase{
  9567. ServerResponse: googleapi.ServerResponse{
  9568. Header: res.Header,
  9569. HTTPStatusCode: res.StatusCode,
  9570. },
  9571. }
  9572. target := &ret
  9573. if err := gensupport.DecodeResponse(target, res); err != nil {
  9574. return nil, err
  9575. }
  9576. return ret, nil
  9577. // {
  9578. // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
  9579. // "httpMethod": "GET",
  9580. // "id": "androidpublisher.purchases.subscriptions.get",
  9581. // "parameterOrder": [
  9582. // "packageName",
  9583. // "subscriptionId",
  9584. // "token"
  9585. // ],
  9586. // "parameters": {
  9587. // "packageName": {
  9588. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9589. // "location": "path",
  9590. // "required": true,
  9591. // "type": "string"
  9592. // },
  9593. // "subscriptionId": {
  9594. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9595. // "location": "path",
  9596. // "required": true,
  9597. // "type": "string"
  9598. // },
  9599. // "token": {
  9600. // "description": "The token provided to the user's device when the subscription was purchased.",
  9601. // "location": "path",
  9602. // "required": true,
  9603. // "type": "string"
  9604. // }
  9605. // },
  9606. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}",
  9607. // "response": {
  9608. // "$ref": "SubscriptionPurchase"
  9609. // },
  9610. // "scopes": [
  9611. // "https://www.googleapis.com/auth/androidpublisher"
  9612. // ]
  9613. // }
  9614. }
  9615. // method id "androidpublisher.purchases.subscriptions.refund":
  9616. type PurchasesSubscriptionsRefundCall struct {
  9617. s *Service
  9618. packageName string
  9619. subscriptionId string
  9620. token string
  9621. urlParams_ gensupport.URLParams
  9622. ctx_ context.Context
  9623. header_ http.Header
  9624. }
  9625. // Refund: Refunds a user's subscription purchase, but the subscription
  9626. // remains valid until its expiration time and it will continue to
  9627. // recur.
  9628. func (r *PurchasesSubscriptionsService) Refund(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRefundCall {
  9629. c := &PurchasesSubscriptionsRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9630. c.packageName = packageName
  9631. c.subscriptionId = subscriptionId
  9632. c.token = token
  9633. return c
  9634. }
  9635. // Fields allows partial responses to be retrieved. See
  9636. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9637. // for more information.
  9638. func (c *PurchasesSubscriptionsRefundCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRefundCall {
  9639. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9640. return c
  9641. }
  9642. // Context sets the context to be used in this call's Do method. Any
  9643. // pending HTTP request will be aborted if the provided context is
  9644. // canceled.
  9645. func (c *PurchasesSubscriptionsRefundCall) Context(ctx context.Context) *PurchasesSubscriptionsRefundCall {
  9646. c.ctx_ = ctx
  9647. return c
  9648. }
  9649. // Header returns an http.Header that can be modified by the caller to
  9650. // add HTTP headers to the request.
  9651. func (c *PurchasesSubscriptionsRefundCall) Header() http.Header {
  9652. if c.header_ == nil {
  9653. c.header_ = make(http.Header)
  9654. }
  9655. return c.header_
  9656. }
  9657. func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) {
  9658. reqHeaders := make(http.Header)
  9659. for k, v := range c.header_ {
  9660. reqHeaders[k] = v
  9661. }
  9662. reqHeaders.Set("User-Agent", c.s.userAgent())
  9663. var body io.Reader = nil
  9664. c.urlParams_.Set("alt", alt)
  9665. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund")
  9666. urls += "?" + c.urlParams_.Encode()
  9667. req, _ := http.NewRequest("POST", urls, body)
  9668. req.Header = reqHeaders
  9669. googleapi.Expand(req.URL, map[string]string{
  9670. "packageName": c.packageName,
  9671. "subscriptionId": c.subscriptionId,
  9672. "token": c.token,
  9673. })
  9674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9675. }
  9676. // Do executes the "androidpublisher.purchases.subscriptions.refund" call.
  9677. func (c *PurchasesSubscriptionsRefundCall) Do(opts ...googleapi.CallOption) error {
  9678. gensupport.SetOptions(c.urlParams_, opts...)
  9679. res, err := c.doRequest("json")
  9680. if err != nil {
  9681. return err
  9682. }
  9683. defer googleapi.CloseBody(res)
  9684. if err := googleapi.CheckResponse(res); err != nil {
  9685. return err
  9686. }
  9687. return nil
  9688. // {
  9689. // "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.",
  9690. // "httpMethod": "POST",
  9691. // "id": "androidpublisher.purchases.subscriptions.refund",
  9692. // "parameterOrder": [
  9693. // "packageName",
  9694. // "subscriptionId",
  9695. // "token"
  9696. // ],
  9697. // "parameters": {
  9698. // "packageName": {
  9699. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9700. // "location": "path",
  9701. // "required": true,
  9702. // "type": "string"
  9703. // },
  9704. // "subscriptionId": {
  9705. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9706. // "location": "path",
  9707. // "required": true,
  9708. // "type": "string"
  9709. // },
  9710. // "token": {
  9711. // "description": "The token provided to the user's device when the subscription was purchased.",
  9712. // "location": "path",
  9713. // "required": true,
  9714. // "type": "string"
  9715. // }
  9716. // },
  9717. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund",
  9718. // "scopes": [
  9719. // "https://www.googleapis.com/auth/androidpublisher"
  9720. // ]
  9721. // }
  9722. }
  9723. // method id "androidpublisher.purchases.subscriptions.revoke":
  9724. type PurchasesSubscriptionsRevokeCall struct {
  9725. s *Service
  9726. packageName string
  9727. subscriptionId string
  9728. token string
  9729. urlParams_ gensupport.URLParams
  9730. ctx_ context.Context
  9731. header_ http.Header
  9732. }
  9733. // Revoke: Refunds and immediately revokes a user's subscription
  9734. // purchase. Access to the subscription will be terminated immediately
  9735. // and it will stop recurring.
  9736. func (r *PurchasesSubscriptionsService) Revoke(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRevokeCall {
  9737. c := &PurchasesSubscriptionsRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9738. c.packageName = packageName
  9739. c.subscriptionId = subscriptionId
  9740. c.token = token
  9741. return c
  9742. }
  9743. // Fields allows partial responses to be retrieved. See
  9744. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9745. // for more information.
  9746. func (c *PurchasesSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRevokeCall {
  9747. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9748. return c
  9749. }
  9750. // Context sets the context to be used in this call's Do method. Any
  9751. // pending HTTP request will be aborted if the provided context is
  9752. // canceled.
  9753. func (c *PurchasesSubscriptionsRevokeCall) Context(ctx context.Context) *PurchasesSubscriptionsRevokeCall {
  9754. c.ctx_ = ctx
  9755. return c
  9756. }
  9757. // Header returns an http.Header that can be modified by the caller to
  9758. // add HTTP headers to the request.
  9759. func (c *PurchasesSubscriptionsRevokeCall) Header() http.Header {
  9760. if c.header_ == nil {
  9761. c.header_ = make(http.Header)
  9762. }
  9763. return c.header_
  9764. }
  9765. func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) {
  9766. reqHeaders := make(http.Header)
  9767. for k, v := range c.header_ {
  9768. reqHeaders[k] = v
  9769. }
  9770. reqHeaders.Set("User-Agent", c.s.userAgent())
  9771. var body io.Reader = nil
  9772. c.urlParams_.Set("alt", alt)
  9773. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke")
  9774. urls += "?" + c.urlParams_.Encode()
  9775. req, _ := http.NewRequest("POST", urls, body)
  9776. req.Header = reqHeaders
  9777. googleapi.Expand(req.URL, map[string]string{
  9778. "packageName": c.packageName,
  9779. "subscriptionId": c.subscriptionId,
  9780. "token": c.token,
  9781. })
  9782. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9783. }
  9784. // Do executes the "androidpublisher.purchases.subscriptions.revoke" call.
  9785. func (c *PurchasesSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) error {
  9786. gensupport.SetOptions(c.urlParams_, opts...)
  9787. res, err := c.doRequest("json")
  9788. if err != nil {
  9789. return err
  9790. }
  9791. defer googleapi.CloseBody(res)
  9792. if err := googleapi.CheckResponse(res); err != nil {
  9793. return err
  9794. }
  9795. return nil
  9796. // {
  9797. // "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.",
  9798. // "httpMethod": "POST",
  9799. // "id": "androidpublisher.purchases.subscriptions.revoke",
  9800. // "parameterOrder": [
  9801. // "packageName",
  9802. // "subscriptionId",
  9803. // "token"
  9804. // ],
  9805. // "parameters": {
  9806. // "packageName": {
  9807. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  9808. // "location": "path",
  9809. // "required": true,
  9810. // "type": "string"
  9811. // },
  9812. // "subscriptionId": {
  9813. // "description": "The purchased subscription ID (for example, 'monthly001').",
  9814. // "location": "path",
  9815. // "required": true,
  9816. // "type": "string"
  9817. // },
  9818. // "token": {
  9819. // "description": "The token provided to the user's device when the subscription was purchased.",
  9820. // "location": "path",
  9821. // "required": true,
  9822. // "type": "string"
  9823. // }
  9824. // },
  9825. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke",
  9826. // "scopes": [
  9827. // "https://www.googleapis.com/auth/androidpublisher"
  9828. // ]
  9829. // }
  9830. }
  9831. // method id "androidpublisher.purchases.voidedpurchases.list":
  9832. type PurchasesVoidedpurchasesListCall struct {
  9833. s *Service
  9834. packageName string
  9835. urlParams_ gensupport.URLParams
  9836. ifNoneMatch_ string
  9837. ctx_ context.Context
  9838. header_ http.Header
  9839. }
  9840. // List: Lists the purchases that were canceled, refunded or
  9841. // charged-back.
  9842. func (r *PurchasesVoidedpurchasesService) List(packageName string) *PurchasesVoidedpurchasesListCall {
  9843. c := &PurchasesVoidedpurchasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9844. c.packageName = packageName
  9845. return c
  9846. }
  9847. // EndTime sets the optional parameter "endTime": The time, in
  9848. // milliseconds since the Epoch, of the newest voided in-app product
  9849. // purchase that you want to see in the response. The value of this
  9850. // parameter cannot be greater than the current time and is ignored if a
  9851. // pagination token is set. Default value is current time. Note: This
  9852. // filter is applied on the time at which the record is seen as voided
  9853. // by our systems and not the actual voided time returned in the
  9854. // response.
  9855. func (c *PurchasesVoidedpurchasesListCall) EndTime(endTime int64) *PurchasesVoidedpurchasesListCall {
  9856. c.urlParams_.Set("endTime", fmt.Sprint(endTime))
  9857. return c
  9858. }
  9859. // MaxResults sets the optional parameter "maxResults":
  9860. func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResults int64) *PurchasesVoidedpurchasesListCall {
  9861. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9862. return c
  9863. }
  9864. // StartIndex sets the optional parameter "startIndex":
  9865. func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndex int64) *PurchasesVoidedpurchasesListCall {
  9866. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9867. return c
  9868. }
  9869. // StartTime sets the optional parameter "startTime": The time, in
  9870. // milliseconds since the Epoch, of the oldest voided in-app product
  9871. // purchase that you want to see in the response. The value of this
  9872. // parameter cannot be older than 30 days and is ignored if a pagination
  9873. // token is set. Default value is current time minus 30 days. Note: This
  9874. // filter is applied on the time at which the record is seen as voided
  9875. // by our systems and not the actual voided time returned in the
  9876. // response.
  9877. func (c *PurchasesVoidedpurchasesListCall) StartTime(startTime int64) *PurchasesVoidedpurchasesListCall {
  9878. c.urlParams_.Set("startTime", fmt.Sprint(startTime))
  9879. return c
  9880. }
  9881. // Token sets the optional parameter "token":
  9882. func (c *PurchasesVoidedpurchasesListCall) Token(token string) *PurchasesVoidedpurchasesListCall {
  9883. c.urlParams_.Set("token", token)
  9884. return c
  9885. }
  9886. // Fields allows partial responses to be retrieved. See
  9887. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9888. // for more information.
  9889. func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall {
  9890. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9891. return c
  9892. }
  9893. // IfNoneMatch sets the optional parameter which makes the operation
  9894. // fail if the object's ETag matches the given value. This is useful for
  9895. // getting updates only after the object has changed since the last
  9896. // request. Use googleapi.IsNotModified to check whether the response
  9897. // error from Do is the result of In-None-Match.
  9898. func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTag string) *PurchasesVoidedpurchasesListCall {
  9899. c.ifNoneMatch_ = entityTag
  9900. return c
  9901. }
  9902. // Context sets the context to be used in this call's Do method. Any
  9903. // pending HTTP request will be aborted if the provided context is
  9904. // canceled.
  9905. func (c *PurchasesVoidedpurchasesListCall) Context(ctx context.Context) *PurchasesVoidedpurchasesListCall {
  9906. c.ctx_ = ctx
  9907. return c
  9908. }
  9909. // Header returns an http.Header that can be modified by the caller to
  9910. // add HTTP headers to the request.
  9911. func (c *PurchasesVoidedpurchasesListCall) Header() http.Header {
  9912. if c.header_ == nil {
  9913. c.header_ = make(http.Header)
  9914. }
  9915. return c.header_
  9916. }
  9917. func (c *PurchasesVoidedpurchasesListCall) doRequest(alt string) (*http.Response, error) {
  9918. reqHeaders := make(http.Header)
  9919. for k, v := range c.header_ {
  9920. reqHeaders[k] = v
  9921. }
  9922. reqHeaders.Set("User-Agent", c.s.userAgent())
  9923. if c.ifNoneMatch_ != "" {
  9924. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9925. }
  9926. var body io.Reader = nil
  9927. c.urlParams_.Set("alt", alt)
  9928. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/voidedpurchases")
  9929. urls += "?" + c.urlParams_.Encode()
  9930. req, _ := http.NewRequest("GET", urls, body)
  9931. req.Header = reqHeaders
  9932. googleapi.Expand(req.URL, map[string]string{
  9933. "packageName": c.packageName,
  9934. })
  9935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9936. }
  9937. // Do executes the "androidpublisher.purchases.voidedpurchases.list" call.
  9938. // Exactly one of *VoidedPurchasesListResponse or error will be non-nil.
  9939. // Any non-2xx status code is an error. Response headers are in either
  9940. // *VoidedPurchasesListResponse.ServerResponse.Header or (if a response
  9941. // was returned at all) in error.(*googleapi.Error).Header. Use
  9942. // googleapi.IsNotModified to check whether the returned error was
  9943. // because http.StatusNotModified was returned.
  9944. func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse, error) {
  9945. gensupport.SetOptions(c.urlParams_, opts...)
  9946. res, err := c.doRequest("json")
  9947. if res != nil && res.StatusCode == http.StatusNotModified {
  9948. if res.Body != nil {
  9949. res.Body.Close()
  9950. }
  9951. return nil, &googleapi.Error{
  9952. Code: res.StatusCode,
  9953. Header: res.Header,
  9954. }
  9955. }
  9956. if err != nil {
  9957. return nil, err
  9958. }
  9959. defer googleapi.CloseBody(res)
  9960. if err := googleapi.CheckResponse(res); err != nil {
  9961. return nil, err
  9962. }
  9963. ret := &VoidedPurchasesListResponse{
  9964. ServerResponse: googleapi.ServerResponse{
  9965. Header: res.Header,
  9966. HTTPStatusCode: res.StatusCode,
  9967. },
  9968. }
  9969. target := &ret
  9970. if err := gensupport.DecodeResponse(target, res); err != nil {
  9971. return nil, err
  9972. }
  9973. return ret, nil
  9974. // {
  9975. // "description": "Lists the purchases that were canceled, refunded or charged-back.",
  9976. // "httpMethod": "GET",
  9977. // "id": "androidpublisher.purchases.voidedpurchases.list",
  9978. // "parameterOrder": [
  9979. // "packageName"
  9980. // ],
  9981. // "parameters": {
  9982. // "endTime": {
  9983. // "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.",
  9984. // "format": "int64",
  9985. // "location": "query",
  9986. // "type": "string"
  9987. // },
  9988. // "maxResults": {
  9989. // "format": "uint32",
  9990. // "location": "query",
  9991. // "type": "integer"
  9992. // },
  9993. // "packageName": {
  9994. // "description": "The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing').",
  9995. // "location": "path",
  9996. // "required": true,
  9997. // "type": "string"
  9998. // },
  9999. // "startIndex": {
  10000. // "format": "uint32",
  10001. // "location": "query",
  10002. // "type": "integer"
  10003. // },
  10004. // "startTime": {
  10005. // "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.",
  10006. // "format": "int64",
  10007. // "location": "query",
  10008. // "type": "string"
  10009. // },
  10010. // "token": {
  10011. // "location": "query",
  10012. // "type": "string"
  10013. // }
  10014. // },
  10015. // "path": "{packageName}/purchases/voidedpurchases",
  10016. // "response": {
  10017. // "$ref": "VoidedPurchasesListResponse"
  10018. // },
  10019. // "scopes": [
  10020. // "https://www.googleapis.com/auth/androidpublisher"
  10021. // ]
  10022. // }
  10023. }
  10024. // method id "androidpublisher.reviews.get":
  10025. type ReviewsGetCall struct {
  10026. s *Service
  10027. packageNameid string
  10028. reviewId string
  10029. urlParams_ gensupport.URLParams
  10030. ifNoneMatch_ string
  10031. ctx_ context.Context
  10032. header_ http.Header
  10033. }
  10034. // Get: Returns a single review.
  10035. func (r *ReviewsService) Get(packageNameid string, reviewId string) *ReviewsGetCall {
  10036. c := &ReviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10037. c.packageNameid = packageNameid
  10038. c.reviewId = reviewId
  10039. return c
  10040. }
  10041. // TranslationLanguage sets the optional parameter
  10042. // "translationLanguage":
  10043. func (c *ReviewsGetCall) TranslationLanguage(translationLanguage string) *ReviewsGetCall {
  10044. c.urlParams_.Set("translationLanguage", translationLanguage)
  10045. return c
  10046. }
  10047. // Fields allows partial responses to be retrieved. See
  10048. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10049. // for more information.
  10050. func (c *ReviewsGetCall) Fields(s ...googleapi.Field) *ReviewsGetCall {
  10051. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10052. return c
  10053. }
  10054. // IfNoneMatch sets the optional parameter which makes the operation
  10055. // fail if the object's ETag matches the given value. This is useful for
  10056. // getting updates only after the object has changed since the last
  10057. // request. Use googleapi.IsNotModified to check whether the response
  10058. // error from Do is the result of In-None-Match.
  10059. func (c *ReviewsGetCall) IfNoneMatch(entityTag string) *ReviewsGetCall {
  10060. c.ifNoneMatch_ = entityTag
  10061. return c
  10062. }
  10063. // Context sets the context to be used in this call's Do method. Any
  10064. // pending HTTP request will be aborted if the provided context is
  10065. // canceled.
  10066. func (c *ReviewsGetCall) Context(ctx context.Context) *ReviewsGetCall {
  10067. c.ctx_ = ctx
  10068. return c
  10069. }
  10070. // Header returns an http.Header that can be modified by the caller to
  10071. // add HTTP headers to the request.
  10072. func (c *ReviewsGetCall) Header() http.Header {
  10073. if c.header_ == nil {
  10074. c.header_ = make(http.Header)
  10075. }
  10076. return c.header_
  10077. }
  10078. func (c *ReviewsGetCall) doRequest(alt string) (*http.Response, error) {
  10079. reqHeaders := make(http.Header)
  10080. for k, v := range c.header_ {
  10081. reqHeaders[k] = v
  10082. }
  10083. reqHeaders.Set("User-Agent", c.s.userAgent())
  10084. if c.ifNoneMatch_ != "" {
  10085. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10086. }
  10087. var body io.Reader = nil
  10088. c.urlParams_.Set("alt", alt)
  10089. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}")
  10090. urls += "?" + c.urlParams_.Encode()
  10091. req, _ := http.NewRequest("GET", urls, body)
  10092. req.Header = reqHeaders
  10093. googleapi.Expand(req.URL, map[string]string{
  10094. "packageName": c.packageNameid,
  10095. "reviewId": c.reviewId,
  10096. })
  10097. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10098. }
  10099. // Do executes the "androidpublisher.reviews.get" call.
  10100. // Exactly one of *Review or error will be non-nil. Any non-2xx status
  10101. // code is an error. Response headers are in either
  10102. // *Review.ServerResponse.Header or (if a response was returned at all)
  10103. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10104. // check whether the returned error was because http.StatusNotModified
  10105. // was returned.
  10106. func (c *ReviewsGetCall) Do(opts ...googleapi.CallOption) (*Review, error) {
  10107. gensupport.SetOptions(c.urlParams_, opts...)
  10108. res, err := c.doRequest("json")
  10109. if res != nil && res.StatusCode == http.StatusNotModified {
  10110. if res.Body != nil {
  10111. res.Body.Close()
  10112. }
  10113. return nil, &googleapi.Error{
  10114. Code: res.StatusCode,
  10115. Header: res.Header,
  10116. }
  10117. }
  10118. if err != nil {
  10119. return nil, err
  10120. }
  10121. defer googleapi.CloseBody(res)
  10122. if err := googleapi.CheckResponse(res); err != nil {
  10123. return nil, err
  10124. }
  10125. ret := &Review{
  10126. ServerResponse: googleapi.ServerResponse{
  10127. Header: res.Header,
  10128. HTTPStatusCode: res.StatusCode,
  10129. },
  10130. }
  10131. target := &ret
  10132. if err := gensupport.DecodeResponse(target, res); err != nil {
  10133. return nil, err
  10134. }
  10135. return ret, nil
  10136. // {
  10137. // "description": "Returns a single review.",
  10138. // "httpMethod": "GET",
  10139. // "id": "androidpublisher.reviews.get",
  10140. // "parameterOrder": [
  10141. // "packageName",
  10142. // "reviewId"
  10143. // ],
  10144. // "parameters": {
  10145. // "packageName": {
  10146. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  10147. // "location": "path",
  10148. // "required": true,
  10149. // "type": "string"
  10150. // },
  10151. // "reviewId": {
  10152. // "location": "path",
  10153. // "required": true,
  10154. // "type": "string"
  10155. // },
  10156. // "translationLanguage": {
  10157. // "location": "query",
  10158. // "type": "string"
  10159. // }
  10160. // },
  10161. // "path": "{packageName}/reviews/{reviewId}",
  10162. // "response": {
  10163. // "$ref": "Review"
  10164. // },
  10165. // "scopes": [
  10166. // "https://www.googleapis.com/auth/androidpublisher"
  10167. // ]
  10168. // }
  10169. }
  10170. // method id "androidpublisher.reviews.list":
  10171. type ReviewsListCall struct {
  10172. s *Service
  10173. packageNameid string
  10174. urlParams_ gensupport.URLParams
  10175. ifNoneMatch_ string
  10176. ctx_ context.Context
  10177. header_ http.Header
  10178. }
  10179. // List: Returns a list of reviews. Only reviews from last week will be
  10180. // returned.
  10181. func (r *ReviewsService) List(packageNameid string) *ReviewsListCall {
  10182. c := &ReviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10183. c.packageNameid = packageNameid
  10184. return c
  10185. }
  10186. // MaxResults sets the optional parameter "maxResults":
  10187. func (c *ReviewsListCall) MaxResults(maxResults int64) *ReviewsListCall {
  10188. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10189. return c
  10190. }
  10191. // StartIndex sets the optional parameter "startIndex":
  10192. func (c *ReviewsListCall) StartIndex(startIndex int64) *ReviewsListCall {
  10193. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  10194. return c
  10195. }
  10196. // Token sets the optional parameter "token":
  10197. func (c *ReviewsListCall) Token(token string) *ReviewsListCall {
  10198. c.urlParams_.Set("token", token)
  10199. return c
  10200. }
  10201. // TranslationLanguage sets the optional parameter
  10202. // "translationLanguage":
  10203. func (c *ReviewsListCall) TranslationLanguage(translationLanguage string) *ReviewsListCall {
  10204. c.urlParams_.Set("translationLanguage", translationLanguage)
  10205. return c
  10206. }
  10207. // Fields allows partial responses to be retrieved. See
  10208. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10209. // for more information.
  10210. func (c *ReviewsListCall) Fields(s ...googleapi.Field) *ReviewsListCall {
  10211. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10212. return c
  10213. }
  10214. // IfNoneMatch sets the optional parameter which makes the operation
  10215. // fail if the object's ETag matches the given value. This is useful for
  10216. // getting updates only after the object has changed since the last
  10217. // request. Use googleapi.IsNotModified to check whether the response
  10218. // error from Do is the result of In-None-Match.
  10219. func (c *ReviewsListCall) IfNoneMatch(entityTag string) *ReviewsListCall {
  10220. c.ifNoneMatch_ = entityTag
  10221. return c
  10222. }
  10223. // Context sets the context to be used in this call's Do method. Any
  10224. // pending HTTP request will be aborted if the provided context is
  10225. // canceled.
  10226. func (c *ReviewsListCall) Context(ctx context.Context) *ReviewsListCall {
  10227. c.ctx_ = ctx
  10228. return c
  10229. }
  10230. // Header returns an http.Header that can be modified by the caller to
  10231. // add HTTP headers to the request.
  10232. func (c *ReviewsListCall) Header() http.Header {
  10233. if c.header_ == nil {
  10234. c.header_ = make(http.Header)
  10235. }
  10236. return c.header_
  10237. }
  10238. func (c *ReviewsListCall) doRequest(alt string) (*http.Response, error) {
  10239. reqHeaders := make(http.Header)
  10240. for k, v := range c.header_ {
  10241. reqHeaders[k] = v
  10242. }
  10243. reqHeaders.Set("User-Agent", c.s.userAgent())
  10244. if c.ifNoneMatch_ != "" {
  10245. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10246. }
  10247. var body io.Reader = nil
  10248. c.urlParams_.Set("alt", alt)
  10249. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews")
  10250. urls += "?" + c.urlParams_.Encode()
  10251. req, _ := http.NewRequest("GET", urls, body)
  10252. req.Header = reqHeaders
  10253. googleapi.Expand(req.URL, map[string]string{
  10254. "packageName": c.packageNameid,
  10255. })
  10256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10257. }
  10258. // Do executes the "androidpublisher.reviews.list" call.
  10259. // Exactly one of *ReviewsListResponse or error will be non-nil. Any
  10260. // non-2xx status code is an error. Response headers are in either
  10261. // *ReviewsListResponse.ServerResponse.Header or (if a response was
  10262. // returned at all) in error.(*googleapi.Error).Header. Use
  10263. // googleapi.IsNotModified to check whether the returned error was
  10264. // because http.StatusNotModified was returned.
  10265. func (c *ReviewsListCall) Do(opts ...googleapi.CallOption) (*ReviewsListResponse, error) {
  10266. gensupport.SetOptions(c.urlParams_, opts...)
  10267. res, err := c.doRequest("json")
  10268. if res != nil && res.StatusCode == http.StatusNotModified {
  10269. if res.Body != nil {
  10270. res.Body.Close()
  10271. }
  10272. return nil, &googleapi.Error{
  10273. Code: res.StatusCode,
  10274. Header: res.Header,
  10275. }
  10276. }
  10277. if err != nil {
  10278. return nil, err
  10279. }
  10280. defer googleapi.CloseBody(res)
  10281. if err := googleapi.CheckResponse(res); err != nil {
  10282. return nil, err
  10283. }
  10284. ret := &ReviewsListResponse{
  10285. ServerResponse: googleapi.ServerResponse{
  10286. Header: res.Header,
  10287. HTTPStatusCode: res.StatusCode,
  10288. },
  10289. }
  10290. target := &ret
  10291. if err := gensupport.DecodeResponse(target, res); err != nil {
  10292. return nil, err
  10293. }
  10294. return ret, nil
  10295. // {
  10296. // "description": "Returns a list of reviews. Only reviews from last week will be returned.",
  10297. // "httpMethod": "GET",
  10298. // "id": "androidpublisher.reviews.list",
  10299. // "parameterOrder": [
  10300. // "packageName"
  10301. // ],
  10302. // "parameters": {
  10303. // "maxResults": {
  10304. // "format": "uint32",
  10305. // "location": "query",
  10306. // "type": "integer"
  10307. // },
  10308. // "packageName": {
  10309. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  10310. // "location": "path",
  10311. // "required": true,
  10312. // "type": "string"
  10313. // },
  10314. // "startIndex": {
  10315. // "format": "uint32",
  10316. // "location": "query",
  10317. // "type": "integer"
  10318. // },
  10319. // "token": {
  10320. // "location": "query",
  10321. // "type": "string"
  10322. // },
  10323. // "translationLanguage": {
  10324. // "location": "query",
  10325. // "type": "string"
  10326. // }
  10327. // },
  10328. // "path": "{packageName}/reviews",
  10329. // "response": {
  10330. // "$ref": "ReviewsListResponse"
  10331. // },
  10332. // "scopes": [
  10333. // "https://www.googleapis.com/auth/androidpublisher"
  10334. // ]
  10335. // }
  10336. }
  10337. // method id "androidpublisher.reviews.reply":
  10338. type ReviewsReplyCall struct {
  10339. s *Service
  10340. packageNameid string
  10341. reviewId string
  10342. reviewsreplyrequest *ReviewsReplyRequest
  10343. urlParams_ gensupport.URLParams
  10344. ctx_ context.Context
  10345. header_ http.Header
  10346. }
  10347. // Reply: Reply to a single review, or update an existing reply.
  10348. func (r *ReviewsService) Reply(packageNameid string, reviewId string, reviewsreplyrequest *ReviewsReplyRequest) *ReviewsReplyCall {
  10349. c := &ReviewsReplyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10350. c.packageNameid = packageNameid
  10351. c.reviewId = reviewId
  10352. c.reviewsreplyrequest = reviewsreplyrequest
  10353. return c
  10354. }
  10355. // Fields allows partial responses to be retrieved. See
  10356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10357. // for more information.
  10358. func (c *ReviewsReplyCall) Fields(s ...googleapi.Field) *ReviewsReplyCall {
  10359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10360. return c
  10361. }
  10362. // Context sets the context to be used in this call's Do method. Any
  10363. // pending HTTP request will be aborted if the provided context is
  10364. // canceled.
  10365. func (c *ReviewsReplyCall) Context(ctx context.Context) *ReviewsReplyCall {
  10366. c.ctx_ = ctx
  10367. return c
  10368. }
  10369. // Header returns an http.Header that can be modified by the caller to
  10370. // add HTTP headers to the request.
  10371. func (c *ReviewsReplyCall) Header() http.Header {
  10372. if c.header_ == nil {
  10373. c.header_ = make(http.Header)
  10374. }
  10375. return c.header_
  10376. }
  10377. func (c *ReviewsReplyCall) doRequest(alt string) (*http.Response, error) {
  10378. reqHeaders := make(http.Header)
  10379. for k, v := range c.header_ {
  10380. reqHeaders[k] = v
  10381. }
  10382. reqHeaders.Set("User-Agent", c.s.userAgent())
  10383. var body io.Reader = nil
  10384. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reviewsreplyrequest)
  10385. if err != nil {
  10386. return nil, err
  10387. }
  10388. reqHeaders.Set("Content-Type", "application/json")
  10389. c.urlParams_.Set("alt", alt)
  10390. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}:reply")
  10391. urls += "?" + c.urlParams_.Encode()
  10392. req, _ := http.NewRequest("POST", urls, body)
  10393. req.Header = reqHeaders
  10394. googleapi.Expand(req.URL, map[string]string{
  10395. "packageName": c.packageNameid,
  10396. "reviewId": c.reviewId,
  10397. })
  10398. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10399. }
  10400. // Do executes the "androidpublisher.reviews.reply" call.
  10401. // Exactly one of *ReviewsReplyResponse or error will be non-nil. Any
  10402. // non-2xx status code is an error. Response headers are in either
  10403. // *ReviewsReplyResponse.ServerResponse.Header or (if a response was
  10404. // returned at all) in error.(*googleapi.Error).Header. Use
  10405. // googleapi.IsNotModified to check whether the returned error was
  10406. // because http.StatusNotModified was returned.
  10407. func (c *ReviewsReplyCall) Do(opts ...googleapi.CallOption) (*ReviewsReplyResponse, error) {
  10408. gensupport.SetOptions(c.urlParams_, opts...)
  10409. res, err := c.doRequest("json")
  10410. if res != nil && res.StatusCode == http.StatusNotModified {
  10411. if res.Body != nil {
  10412. res.Body.Close()
  10413. }
  10414. return nil, &googleapi.Error{
  10415. Code: res.StatusCode,
  10416. Header: res.Header,
  10417. }
  10418. }
  10419. if err != nil {
  10420. return nil, err
  10421. }
  10422. defer googleapi.CloseBody(res)
  10423. if err := googleapi.CheckResponse(res); err != nil {
  10424. return nil, err
  10425. }
  10426. ret := &ReviewsReplyResponse{
  10427. ServerResponse: googleapi.ServerResponse{
  10428. Header: res.Header,
  10429. HTTPStatusCode: res.StatusCode,
  10430. },
  10431. }
  10432. target := &ret
  10433. if err := gensupport.DecodeResponse(target, res); err != nil {
  10434. return nil, err
  10435. }
  10436. return ret, nil
  10437. // {
  10438. // "description": "Reply to a single review, or update an existing reply.",
  10439. // "httpMethod": "POST",
  10440. // "id": "androidpublisher.reviews.reply",
  10441. // "parameterOrder": [
  10442. // "packageName",
  10443. // "reviewId"
  10444. // ],
  10445. // "parameters": {
  10446. // "packageName": {
  10447. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  10448. // "location": "path",
  10449. // "required": true,
  10450. // "type": "string"
  10451. // },
  10452. // "reviewId": {
  10453. // "location": "path",
  10454. // "required": true,
  10455. // "type": "string"
  10456. // }
  10457. // },
  10458. // "path": "{packageName}/reviews/{reviewId}:reply",
  10459. // "request": {
  10460. // "$ref": "ReviewsReplyRequest"
  10461. // },
  10462. // "response": {
  10463. // "$ref": "ReviewsReplyResponse"
  10464. // },
  10465. // "scopes": [
  10466. // "https://www.googleapis.com/auth/androidpublisher"
  10467. // ]
  10468. // }
  10469. }