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.
 
 
 

10561 lines
354 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/v3"
  8. // ...
  9. // androidpublisherService, err := androidpublisher.New(oauthHttpClient)
  10. package androidpublisher // import "google.golang.org/api/androidpublisher/v3"
  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:v3"
  41. const apiName = "androidpublisher"
  42. const apiVersion = "v3"
  43. const basePath = "https://www.googleapis.com/androidpublisher/v3/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.Apks = NewEditsApksService(s)
  80. rs.Bundles = NewEditsBundlesService(s)
  81. rs.Deobfuscationfiles = NewEditsDeobfuscationfilesService(s)
  82. rs.Details = NewEditsDetailsService(s)
  83. rs.Expansionfiles = NewEditsExpansionfilesService(s)
  84. rs.Images = NewEditsImagesService(s)
  85. rs.Listings = NewEditsListingsService(s)
  86. rs.Testers = NewEditsTestersService(s)
  87. rs.Tracks = NewEditsTracksService(s)
  88. return rs
  89. }
  90. type EditsService struct {
  91. s *Service
  92. Apks *EditsApksService
  93. Bundles *EditsBundlesService
  94. Deobfuscationfiles *EditsDeobfuscationfilesService
  95. Details *EditsDetailsService
  96. Expansionfiles *EditsExpansionfilesService
  97. Images *EditsImagesService
  98. Listings *EditsListingsService
  99. Testers *EditsTestersService
  100. Tracks *EditsTracksService
  101. }
  102. func NewEditsApksService(s *Service) *EditsApksService {
  103. rs := &EditsApksService{s: s}
  104. return rs
  105. }
  106. type EditsApksService struct {
  107. s *Service
  108. }
  109. func NewEditsBundlesService(s *Service) *EditsBundlesService {
  110. rs := &EditsBundlesService{s: s}
  111. return rs
  112. }
  113. type EditsBundlesService struct {
  114. s *Service
  115. }
  116. func NewEditsDeobfuscationfilesService(s *Service) *EditsDeobfuscationfilesService {
  117. rs := &EditsDeobfuscationfilesService{s: s}
  118. return rs
  119. }
  120. type EditsDeobfuscationfilesService struct {
  121. s *Service
  122. }
  123. func NewEditsDetailsService(s *Service) *EditsDetailsService {
  124. rs := &EditsDetailsService{s: s}
  125. return rs
  126. }
  127. type EditsDetailsService struct {
  128. s *Service
  129. }
  130. func NewEditsExpansionfilesService(s *Service) *EditsExpansionfilesService {
  131. rs := &EditsExpansionfilesService{s: s}
  132. return rs
  133. }
  134. type EditsExpansionfilesService struct {
  135. s *Service
  136. }
  137. func NewEditsImagesService(s *Service) *EditsImagesService {
  138. rs := &EditsImagesService{s: s}
  139. return rs
  140. }
  141. type EditsImagesService struct {
  142. s *Service
  143. }
  144. func NewEditsListingsService(s *Service) *EditsListingsService {
  145. rs := &EditsListingsService{s: s}
  146. return rs
  147. }
  148. type EditsListingsService struct {
  149. s *Service
  150. }
  151. func NewEditsTestersService(s *Service) *EditsTestersService {
  152. rs := &EditsTestersService{s: s}
  153. return rs
  154. }
  155. type EditsTestersService struct {
  156. s *Service
  157. }
  158. func NewEditsTracksService(s *Service) *EditsTracksService {
  159. rs := &EditsTracksService{s: s}
  160. return rs
  161. }
  162. type EditsTracksService struct {
  163. s *Service
  164. }
  165. func NewInappproductsService(s *Service) *InappproductsService {
  166. rs := &InappproductsService{s: s}
  167. return rs
  168. }
  169. type InappproductsService struct {
  170. s *Service
  171. }
  172. func NewOrdersService(s *Service) *OrdersService {
  173. rs := &OrdersService{s: s}
  174. return rs
  175. }
  176. type OrdersService struct {
  177. s *Service
  178. }
  179. func NewPurchasesService(s *Service) *PurchasesService {
  180. rs := &PurchasesService{s: s}
  181. rs.Products = NewPurchasesProductsService(s)
  182. rs.Subscriptions = NewPurchasesSubscriptionsService(s)
  183. rs.Voidedpurchases = NewPurchasesVoidedpurchasesService(s)
  184. return rs
  185. }
  186. type PurchasesService struct {
  187. s *Service
  188. Products *PurchasesProductsService
  189. Subscriptions *PurchasesSubscriptionsService
  190. Voidedpurchases *PurchasesVoidedpurchasesService
  191. }
  192. func NewPurchasesProductsService(s *Service) *PurchasesProductsService {
  193. rs := &PurchasesProductsService{s: s}
  194. return rs
  195. }
  196. type PurchasesProductsService struct {
  197. s *Service
  198. }
  199. func NewPurchasesSubscriptionsService(s *Service) *PurchasesSubscriptionsService {
  200. rs := &PurchasesSubscriptionsService{s: s}
  201. return rs
  202. }
  203. type PurchasesSubscriptionsService struct {
  204. s *Service
  205. }
  206. func NewPurchasesVoidedpurchasesService(s *Service) *PurchasesVoidedpurchasesService {
  207. rs := &PurchasesVoidedpurchasesService{s: s}
  208. return rs
  209. }
  210. type PurchasesVoidedpurchasesService struct {
  211. s *Service
  212. }
  213. func NewReviewsService(s *Service) *ReviewsService {
  214. rs := &ReviewsService{s: s}
  215. return rs
  216. }
  217. type ReviewsService struct {
  218. s *Service
  219. }
  220. type Apk struct {
  221. // Binary: Information about the binary payload of this APK.
  222. Binary *ApkBinary `json:"binary,omitempty"`
  223. // VersionCode: The version code of the APK, as specified in the APK's
  224. // manifest file.
  225. VersionCode int64 `json:"versionCode,omitempty"`
  226. // ServerResponse contains the HTTP response code and headers from the
  227. // server.
  228. googleapi.ServerResponse `json:"-"`
  229. // ForceSendFields is a list of field names (e.g. "Binary") to
  230. // unconditionally include in API requests. By default, fields with
  231. // empty values are omitted from API requests. However, any non-pointer,
  232. // non-interface field appearing in ForceSendFields will be sent to the
  233. // server regardless of whether the field is empty or not. This may be
  234. // used to include empty fields in Patch requests.
  235. ForceSendFields []string `json:"-"`
  236. // NullFields is a list of field names (e.g. "Binary") to include in API
  237. // requests with the JSON null value. By default, fields with empty
  238. // values are omitted from API requests. However, any field with an
  239. // empty value appearing in NullFields will be sent to the server as
  240. // null. It is an error if a field in this list has a non-empty value.
  241. // This may be used to include null fields in Patch requests.
  242. NullFields []string `json:"-"`
  243. }
  244. func (s *Apk) MarshalJSON() ([]byte, error) {
  245. type NoMethod Apk
  246. raw := NoMethod(*s)
  247. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  248. }
  249. // ApkBinary: Represents the binary payload of an APK.
  250. type ApkBinary struct {
  251. // Sha1: A sha1 hash of the APK payload, encoded as a hex string and
  252. // matching the output of the sha1sum command.
  253. Sha1 string `json:"sha1,omitempty"`
  254. // Sha256: A sha256 hash of the APK payload, encoded as a hex string and
  255. // matching the output of the sha256sum command.
  256. Sha256 string `json:"sha256,omitempty"`
  257. // ForceSendFields is a list of field names (e.g. "Sha1") to
  258. // unconditionally include in API requests. By default, fields with
  259. // empty values are omitted from API requests. However, any non-pointer,
  260. // non-interface field appearing in ForceSendFields will be sent to the
  261. // server regardless of whether the field is empty or not. This may be
  262. // used to include empty fields in Patch requests.
  263. ForceSendFields []string `json:"-"`
  264. // NullFields is a list of field names (e.g. "Sha1") to include in API
  265. // requests with the JSON null value. By default, fields with empty
  266. // values are omitted from API requests. However, any field with an
  267. // empty value appearing in NullFields will be sent to the server as
  268. // null. It is an error if a field in this list has a non-empty value.
  269. // This may be used to include null fields in Patch requests.
  270. NullFields []string `json:"-"`
  271. }
  272. func (s *ApkBinary) MarshalJSON() ([]byte, error) {
  273. type NoMethod ApkBinary
  274. raw := NoMethod(*s)
  275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  276. }
  277. type ApksAddExternallyHostedRequest struct {
  278. // ExternallyHostedApk: The definition of the externally-hosted APK and
  279. // where it is located.
  280. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  281. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  282. // to unconditionally include in API requests. By default, fields with
  283. // empty values are omitted from API requests. However, any non-pointer,
  284. // non-interface field appearing in ForceSendFields will be sent to the
  285. // server regardless of whether the field is empty or not. This may be
  286. // used to include empty fields in Patch requests.
  287. ForceSendFields []string `json:"-"`
  288. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  289. // include in API requests with the JSON null value. By default, fields
  290. // with empty values are omitted from API requests. However, any field
  291. // with an empty value appearing in NullFields will be sent to the
  292. // server as null. It is an error if a field in this list has a
  293. // non-empty value. This may be used to include null fields in Patch
  294. // requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *ApksAddExternallyHostedRequest) MarshalJSON() ([]byte, error) {
  298. type NoMethod ApksAddExternallyHostedRequest
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. type ApksAddExternallyHostedResponse struct {
  303. // ExternallyHostedApk: The definition of the externally-hosted APK and
  304. // where it is located.
  305. ExternallyHostedApk *ExternallyHostedApk `json:"externallyHostedApk,omitempty"`
  306. // ServerResponse contains the HTTP response code and headers from the
  307. // server.
  308. googleapi.ServerResponse `json:"-"`
  309. // ForceSendFields is a list of field names (e.g. "ExternallyHostedApk")
  310. // to unconditionally include in API requests. By default, fields with
  311. // empty values are omitted from API requests. However, any non-pointer,
  312. // non-interface field appearing in ForceSendFields will be sent to the
  313. // server regardless of whether the field is empty or not. This may be
  314. // used to include empty fields in Patch requests.
  315. ForceSendFields []string `json:"-"`
  316. // NullFields is a list of field names (e.g. "ExternallyHostedApk") to
  317. // include in API requests with the JSON null value. By default, fields
  318. // with empty values are omitted from API requests. However, any field
  319. // with an empty value appearing in NullFields will be sent to the
  320. // server as null. It is an error if a field in this list has a
  321. // non-empty value. This may be used to include null fields in Patch
  322. // requests.
  323. NullFields []string `json:"-"`
  324. }
  325. func (s *ApksAddExternallyHostedResponse) MarshalJSON() ([]byte, error) {
  326. type NoMethod ApksAddExternallyHostedResponse
  327. raw := NoMethod(*s)
  328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  329. }
  330. type ApksListResponse struct {
  331. Apks []*Apk `json:"apks,omitempty"`
  332. // Kind: Identifies what kind of resource this is. Value: the fixed
  333. // string "androidpublisher#apksListResponse".
  334. Kind string `json:"kind,omitempty"`
  335. // ServerResponse contains the HTTP response code and headers from the
  336. // server.
  337. googleapi.ServerResponse `json:"-"`
  338. // ForceSendFields is a list of field names (e.g. "Apks") to
  339. // unconditionally include in API requests. By default, fields with
  340. // empty values are omitted from API requests. However, any non-pointer,
  341. // non-interface field appearing in ForceSendFields will be sent to the
  342. // server regardless of whether the field is empty or not. This may be
  343. // used to include empty fields in Patch requests.
  344. ForceSendFields []string `json:"-"`
  345. // NullFields is a list of field names (e.g. "Apks") to include in API
  346. // requests with the JSON null value. By default, fields with empty
  347. // values are omitted from API requests. However, any field with an
  348. // empty value appearing in NullFields will be sent to the server as
  349. // null. It is an error if a field in this list has a non-empty value.
  350. // This may be used to include null fields in Patch requests.
  351. NullFields []string `json:"-"`
  352. }
  353. func (s *ApksListResponse) MarshalJSON() ([]byte, error) {
  354. type NoMethod ApksListResponse
  355. raw := NoMethod(*s)
  356. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  357. }
  358. type AppDetails struct {
  359. // ContactEmail: The user-visible support email for this app.
  360. ContactEmail string `json:"contactEmail,omitempty"`
  361. // ContactPhone: The user-visible support telephone number for this app.
  362. ContactPhone string `json:"contactPhone,omitempty"`
  363. // ContactWebsite: The user-visible website for this app.
  364. ContactWebsite string `json:"contactWebsite,omitempty"`
  365. // DefaultLanguage: Default language code, in BCP 47 format (eg
  366. // "en-US").
  367. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  368. // ServerResponse contains the HTTP response code and headers from the
  369. // server.
  370. googleapi.ServerResponse `json:"-"`
  371. // ForceSendFields is a list of field names (e.g. "ContactEmail") to
  372. // unconditionally include in API requests. By default, fields with
  373. // empty values are omitted from API requests. However, any non-pointer,
  374. // non-interface field appearing in ForceSendFields will be sent to the
  375. // server regardless of whether the field is empty or not. This may be
  376. // used to include empty fields in Patch requests.
  377. ForceSendFields []string `json:"-"`
  378. // NullFields is a list of field names (e.g. "ContactEmail") to include
  379. // in API requests with the JSON null value. By default, fields with
  380. // empty values are omitted from API requests. However, any field with
  381. // an empty value appearing in NullFields will be sent to the server as
  382. // null. It is an error if a field in this list has a non-empty value.
  383. // This may be used to include null fields in Patch requests.
  384. NullFields []string `json:"-"`
  385. }
  386. func (s *AppDetails) MarshalJSON() ([]byte, error) {
  387. type NoMethod AppDetails
  388. raw := NoMethod(*s)
  389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  390. }
  391. // AppEdit: Represents an edit of an app. An edit allows clients to make
  392. // multiple changes before committing them in one operation.
  393. type AppEdit struct {
  394. // ExpiryTimeSeconds: The time at which the edit will expire and will be
  395. // no longer valid for use in any subsequent API calls (encoded as
  396. // seconds since the Epoch).
  397. ExpiryTimeSeconds string `json:"expiryTimeSeconds,omitempty"`
  398. // Id: The ID of the edit that can be used in subsequent API calls.
  399. Id string `json:"id,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. "ExpiryTimeSeconds")
  404. // to 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. "ExpiryTimeSeconds") to
  411. // include in API requests with the JSON null value. By default, fields
  412. // with empty values are omitted from API requests. However, any field
  413. // with an empty value appearing in NullFields will be sent to the
  414. // server as null. It is an error if a field in this list has a
  415. // non-empty value. This may be used to include null fields in Patch
  416. // requests.
  417. NullFields []string `json:"-"`
  418. }
  419. func (s *AppEdit) MarshalJSON() ([]byte, error) {
  420. type NoMethod AppEdit
  421. raw := NoMethod(*s)
  422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  423. }
  424. type Bundle struct {
  425. // Sha1: A sha1 hash of the upload payload, encoded as a hex string and
  426. // matching the output of the sha1sum command.
  427. Sha1 string `json:"sha1,omitempty"`
  428. // Sha256: A sha256 hash of the upload payload, encoded as a hex string
  429. // and matching the output of the sha256sum command.
  430. Sha256 string `json:"sha256,omitempty"`
  431. // VersionCode: The version code of the Android App Bundle. As specified
  432. // in the Android App Bundle's base module APK manifest file.
  433. VersionCode int64 `json:"versionCode,omitempty"`
  434. // ServerResponse contains the HTTP response code and headers from the
  435. // server.
  436. googleapi.ServerResponse `json:"-"`
  437. // ForceSendFields is a list of field names (e.g. "Sha1") to
  438. // unconditionally include in API requests. By default, fields with
  439. // empty values are omitted from API requests. However, any non-pointer,
  440. // non-interface field appearing in ForceSendFields will be sent to the
  441. // server regardless of whether the field is empty or not. This may be
  442. // used to include empty fields in Patch requests.
  443. ForceSendFields []string `json:"-"`
  444. // NullFields is a list of field names (e.g. "Sha1") to include in API
  445. // requests with the JSON null value. By default, fields with empty
  446. // values are omitted from API requests. However, any field with an
  447. // empty value appearing in NullFields will be sent to the server as
  448. // null. It is an error if a field in this list has a non-empty value.
  449. // This may be used to include null fields in Patch requests.
  450. NullFields []string `json:"-"`
  451. }
  452. func (s *Bundle) MarshalJSON() ([]byte, error) {
  453. type NoMethod Bundle
  454. raw := NoMethod(*s)
  455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  456. }
  457. type BundlesListResponse struct {
  458. Bundles []*Bundle `json:"bundles,omitempty"`
  459. // Kind: Identifies what kind of resource this is. Value: the fixed
  460. // string "androidpublisher#bundlesListResponse".
  461. Kind string `json:"kind,omitempty"`
  462. // ServerResponse contains the HTTP response code and headers from the
  463. // server.
  464. googleapi.ServerResponse `json:"-"`
  465. // ForceSendFields is a list of field names (e.g. "Bundles") to
  466. // unconditionally include in API requests. By default, fields with
  467. // empty values are omitted from API requests. However, any non-pointer,
  468. // non-interface field appearing in ForceSendFields will be sent to the
  469. // server regardless of whether the field is empty or not. This may be
  470. // used to include empty fields in Patch requests.
  471. ForceSendFields []string `json:"-"`
  472. // NullFields is a list of field names (e.g. "Bundles") to include in
  473. // API requests with the JSON null value. By default, fields with empty
  474. // values are omitted from API requests. However, any field with an
  475. // empty value appearing in NullFields will be sent to the server as
  476. // null. It is an error if a field in this list has a non-empty value.
  477. // This may be used to include null fields in Patch requests.
  478. NullFields []string `json:"-"`
  479. }
  480. func (s *BundlesListResponse) MarshalJSON() ([]byte, error) {
  481. type NoMethod BundlesListResponse
  482. raw := NoMethod(*s)
  483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  484. }
  485. type Comment struct {
  486. // DeveloperComment: A comment from a developer.
  487. DeveloperComment *DeveloperComment `json:"developerComment,omitempty"`
  488. // UserComment: A comment from a user.
  489. UserComment *UserComment `json:"userComment,omitempty"`
  490. // ForceSendFields is a list of field names (e.g. "DeveloperComment") to
  491. // unconditionally include in API requests. By default, fields with
  492. // empty values are omitted from API requests. However, any non-pointer,
  493. // non-interface field appearing in ForceSendFields will be sent to the
  494. // server regardless of whether the field is empty or not. This may be
  495. // used to include empty fields in Patch requests.
  496. ForceSendFields []string `json:"-"`
  497. // NullFields is a list of field names (e.g. "DeveloperComment") to
  498. // include in API requests with the JSON null value. By default, fields
  499. // with empty values are omitted from API requests. However, any field
  500. // with an empty value appearing in NullFields will be sent to the
  501. // server as null. It is an error if a field in this list has a
  502. // non-empty value. This may be used to include null fields in Patch
  503. // requests.
  504. NullFields []string `json:"-"`
  505. }
  506. func (s *Comment) MarshalJSON() ([]byte, error) {
  507. type NoMethod Comment
  508. raw := NoMethod(*s)
  509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  510. }
  511. // DeobfuscationFile: Represents a deobfuscation file.
  512. type DeobfuscationFile struct {
  513. // SymbolType: The type of the deobfuscation file.
  514. SymbolType string `json:"symbolType,omitempty"`
  515. // ForceSendFields is a list of field names (e.g. "SymbolType") to
  516. // unconditionally include in API requests. By default, fields with
  517. // empty values are omitted from API requests. However, any non-pointer,
  518. // non-interface field appearing in ForceSendFields will be sent to the
  519. // server regardless of whether the field is empty or not. This may be
  520. // used to include empty fields in Patch requests.
  521. ForceSendFields []string `json:"-"`
  522. // NullFields is a list of field names (e.g. "SymbolType") to include in
  523. // API requests with the JSON null value. By default, fields with empty
  524. // values are omitted from API requests. However, any field with an
  525. // empty value appearing in NullFields will be sent to the server as
  526. // null. It is an error if a field in this list has a non-empty value.
  527. // This may be used to include null fields in Patch requests.
  528. NullFields []string `json:"-"`
  529. }
  530. func (s *DeobfuscationFile) MarshalJSON() ([]byte, error) {
  531. type NoMethod DeobfuscationFile
  532. raw := NoMethod(*s)
  533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  534. }
  535. type DeobfuscationFilesUploadResponse struct {
  536. DeobfuscationFile *DeobfuscationFile `json:"deobfuscationFile,omitempty"`
  537. // ServerResponse contains the HTTP response code and headers from the
  538. // server.
  539. googleapi.ServerResponse `json:"-"`
  540. // ForceSendFields is a list of field names (e.g. "DeobfuscationFile")
  541. // to unconditionally include in API requests. By default, fields with
  542. // empty values are omitted from API requests. However, any non-pointer,
  543. // non-interface field appearing in ForceSendFields will be sent to the
  544. // server regardless of whether the field is empty or not. This may be
  545. // used to include empty fields in Patch requests.
  546. ForceSendFields []string `json:"-"`
  547. // NullFields is a list of field names (e.g. "DeobfuscationFile") to
  548. // include in API requests with the JSON null value. By default, fields
  549. // with empty values are omitted from API requests. However, any field
  550. // with an empty value appearing in NullFields will be sent to the
  551. // server as null. It is an error if a field in this list has a
  552. // non-empty value. This may be used to include null fields in Patch
  553. // requests.
  554. NullFields []string `json:"-"`
  555. }
  556. func (s *DeobfuscationFilesUploadResponse) MarshalJSON() ([]byte, error) {
  557. type NoMethod DeobfuscationFilesUploadResponse
  558. raw := NoMethod(*s)
  559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  560. }
  561. type DeveloperComment struct {
  562. // LastModified: The last time at which this comment was updated.
  563. LastModified *Timestamp `json:"lastModified,omitempty"`
  564. // Text: The content of the comment, i.e. reply body.
  565. Text string `json:"text,omitempty"`
  566. // ForceSendFields is a list of field names (e.g. "LastModified") to
  567. // unconditionally include in API requests. By default, fields with
  568. // empty values are omitted from API requests. However, any non-pointer,
  569. // non-interface field appearing in ForceSendFields will be sent to the
  570. // server regardless of whether the field is empty or not. This may be
  571. // used to include empty fields in Patch requests.
  572. ForceSendFields []string `json:"-"`
  573. // NullFields is a list of field names (e.g. "LastModified") to include
  574. // in API requests with the JSON null value. By default, fields with
  575. // empty values are omitted from API requests. However, any field with
  576. // an empty value appearing in NullFields will be sent to the server as
  577. // null. It is an error if a field in this list has a non-empty value.
  578. // This may be used to include null fields in Patch requests.
  579. NullFields []string `json:"-"`
  580. }
  581. func (s *DeveloperComment) MarshalJSON() ([]byte, error) {
  582. type NoMethod DeveloperComment
  583. raw := NoMethod(*s)
  584. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  585. }
  586. type DeviceMetadata struct {
  587. // CpuMake: Device CPU make e.g. "Qualcomm"
  588. CpuMake string `json:"cpuMake,omitempty"`
  589. // CpuModel: Device CPU model e.g. "MSM8974"
  590. CpuModel string `json:"cpuModel,omitempty"`
  591. // DeviceClass: Device class (e.g. tablet)
  592. DeviceClass string `json:"deviceClass,omitempty"`
  593. // GlEsVersion: OpenGL version
  594. GlEsVersion int64 `json:"glEsVersion,omitempty"`
  595. // Manufacturer: Device manufacturer (e.g. Motorola)
  596. Manufacturer string `json:"manufacturer,omitempty"`
  597. // NativePlatform: Comma separated list of native platforms (e.g. "arm",
  598. // "arm7")
  599. NativePlatform string `json:"nativePlatform,omitempty"`
  600. // ProductName: Device model name (e.g. Droid)
  601. ProductName string `json:"productName,omitempty"`
  602. // RamMb: Device RAM in Megabytes e.g. "2048"
  603. RamMb int64 `json:"ramMb,omitempty"`
  604. // ScreenDensityDpi: Screen density in DPI
  605. ScreenDensityDpi int64 `json:"screenDensityDpi,omitempty"`
  606. // ScreenHeightPx: Screen height in pixels
  607. ScreenHeightPx int64 `json:"screenHeightPx,omitempty"`
  608. // ScreenWidthPx: Screen width in pixels
  609. ScreenWidthPx int64 `json:"screenWidthPx,omitempty"`
  610. // ForceSendFields is a list of field names (e.g. "CpuMake") to
  611. // unconditionally include in API requests. By default, fields with
  612. // empty values are omitted from API requests. However, any non-pointer,
  613. // non-interface field appearing in ForceSendFields will be sent to the
  614. // server regardless of whether the field is empty or not. This may be
  615. // used to include empty fields in Patch requests.
  616. ForceSendFields []string `json:"-"`
  617. // NullFields is a list of field names (e.g. "CpuMake") to include in
  618. // API requests with the JSON null value. By default, fields with empty
  619. // values are omitted from API requests. However, any field with an
  620. // empty value appearing in NullFields will be sent to the server as
  621. // null. It is an error if a field in this list has a non-empty value.
  622. // This may be used to include null fields in Patch requests.
  623. NullFields []string `json:"-"`
  624. }
  625. func (s *DeviceMetadata) MarshalJSON() ([]byte, error) {
  626. type NoMethod DeviceMetadata
  627. raw := NoMethod(*s)
  628. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  629. }
  630. type ExpansionFile struct {
  631. // FileSize: If set this field indicates that this APK has an Expansion
  632. // File uploaded to it: this APK does not reference another APK's
  633. // Expansion File. The field's value is the size of the uploaded
  634. // Expansion File in bytes.
  635. FileSize int64 `json:"fileSize,omitempty,string"`
  636. // ReferencesVersion: If set this APK's Expansion File references
  637. // another APK's Expansion File. The file_size field will not be set.
  638. ReferencesVersion int64 `json:"referencesVersion,omitempty"`
  639. // ServerResponse contains the HTTP response code and headers from the
  640. // server.
  641. googleapi.ServerResponse `json:"-"`
  642. // ForceSendFields is a list of field names (e.g. "FileSize") to
  643. // unconditionally include in API requests. By default, fields with
  644. // empty values are omitted from API requests. However, any non-pointer,
  645. // non-interface field appearing in ForceSendFields will be sent to the
  646. // server regardless of whether the field is empty or not. This may be
  647. // used to include empty fields in Patch requests.
  648. ForceSendFields []string `json:"-"`
  649. // NullFields is a list of field names (e.g. "FileSize") to include in
  650. // API requests with the JSON null value. By default, fields with empty
  651. // values are omitted from API requests. However, any field with an
  652. // empty value appearing in NullFields will be sent to the server as
  653. // null. It is an error if a field in this list has a non-empty value.
  654. // This may be used to include null fields in Patch requests.
  655. NullFields []string `json:"-"`
  656. }
  657. func (s *ExpansionFile) MarshalJSON() ([]byte, error) {
  658. type NoMethod ExpansionFile
  659. raw := NoMethod(*s)
  660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  661. }
  662. type ExpansionFilesUploadResponse struct {
  663. ExpansionFile *ExpansionFile `json:"expansionFile,omitempty"`
  664. // ServerResponse contains the HTTP response code and headers from the
  665. // server.
  666. googleapi.ServerResponse `json:"-"`
  667. // ForceSendFields is a list of field names (e.g. "ExpansionFile") to
  668. // unconditionally include in API requests. By default, fields with
  669. // empty values are omitted from API requests. However, any non-pointer,
  670. // non-interface field appearing in ForceSendFields will be sent to the
  671. // server regardless of whether the field is empty or not. This may be
  672. // used to include empty fields in Patch requests.
  673. ForceSendFields []string `json:"-"`
  674. // NullFields is a list of field names (e.g. "ExpansionFile") to include
  675. // in API requests with the JSON null value. By default, fields with
  676. // empty values are omitted from API requests. However, any field with
  677. // an empty value appearing in NullFields will be sent to the server as
  678. // null. It is an error if a field in this list has a non-empty value.
  679. // This may be used to include null fields in Patch requests.
  680. NullFields []string `json:"-"`
  681. }
  682. func (s *ExpansionFilesUploadResponse) MarshalJSON() ([]byte, error) {
  683. type NoMethod ExpansionFilesUploadResponse
  684. raw := NoMethod(*s)
  685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  686. }
  687. // ExternallyHostedApk: Defines an APK available for this application
  688. // that is hosted externally and not uploaded to Google Play. This
  689. // function is only available to enterprises who are using Google Play
  690. // for Work, and whos application is restricted to the enterprise
  691. // private channel
  692. type ExternallyHostedApk struct {
  693. // ApplicationLabel: The application label.
  694. ApplicationLabel string `json:"applicationLabel,omitempty"`
  695. // CertificateBase64s: A certificate (or array of certificates if a
  696. // certificate-chain is used) used to signed this APK, represented as a
  697. // base64 encoded byte array.
  698. CertificateBase64s []string `json:"certificateBase64s,omitempty"`
  699. // ExternallyHostedUrl: The URL at which the APK is hosted. This must be
  700. // an https URL.
  701. ExternallyHostedUrl string `json:"externallyHostedUrl,omitempty"`
  702. // FileSha1Base64: The SHA1 checksum of this APK, represented as a
  703. // base64 encoded byte array.
  704. FileSha1Base64 string `json:"fileSha1Base64,omitempty"`
  705. // FileSha256Base64: The SHA256 checksum of this APK, represented as a
  706. // base64 encoded byte array.
  707. FileSha256Base64 string `json:"fileSha256Base64,omitempty"`
  708. // FileSize: The file size in bytes of this APK.
  709. FileSize int64 `json:"fileSize,omitempty,string"`
  710. // IconBase64: The icon image from the APK, as a base64 encoded byte
  711. // array.
  712. IconBase64 string `json:"iconBase64,omitempty"`
  713. // MaximumSdk: The maximum SDK supported by this APK (optional).
  714. MaximumSdk int64 `json:"maximumSdk,omitempty"`
  715. // MinimumSdk: The minimum SDK targeted by this APK.
  716. MinimumSdk int64 `json:"minimumSdk,omitempty"`
  717. // NativeCodes: The native code environments supported by this APK
  718. // (optional).
  719. NativeCodes []string `json:"nativeCodes,omitempty"`
  720. // PackageName: The package name.
  721. PackageName string `json:"packageName,omitempty"`
  722. // UsesFeatures: The features required by this APK (optional).
  723. UsesFeatures []string `json:"usesFeatures,omitempty"`
  724. // UsesPermissions: The permissions requested by this APK.
  725. UsesPermissions []*ExternallyHostedApkUsesPermission `json:"usesPermissions,omitempty"`
  726. // VersionCode: The version code of this APK.
  727. VersionCode int64 `json:"versionCode,omitempty"`
  728. // VersionName: The version name of this APK.
  729. VersionName string `json:"versionName,omitempty"`
  730. // ForceSendFields is a list of field names (e.g. "ApplicationLabel") to
  731. // unconditionally include in API requests. By default, fields with
  732. // empty values are omitted from API requests. However, any non-pointer,
  733. // non-interface field appearing in ForceSendFields will be sent to the
  734. // server regardless of whether the field is empty or not. This may be
  735. // used to include empty fields in Patch requests.
  736. ForceSendFields []string `json:"-"`
  737. // NullFields is a list of field names (e.g. "ApplicationLabel") to
  738. // include in API requests with the JSON null value. By default, fields
  739. // with empty values are omitted from API requests. However, any field
  740. // with an empty value appearing in NullFields will be sent to the
  741. // server as null. It is an error if a field in this list has a
  742. // non-empty value. This may be used to include null fields in Patch
  743. // requests.
  744. NullFields []string `json:"-"`
  745. }
  746. func (s *ExternallyHostedApk) MarshalJSON() ([]byte, error) {
  747. type NoMethod ExternallyHostedApk
  748. raw := NoMethod(*s)
  749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  750. }
  751. // ExternallyHostedApkUsesPermission: A permission used by this APK.
  752. type ExternallyHostedApkUsesPermission struct {
  753. // MaxSdkVersion: Optionally, the maximum SDK version for which the
  754. // permission is required.
  755. MaxSdkVersion int64 `json:"maxSdkVersion,omitempty"`
  756. // Name: The name of the permission requested.
  757. Name string `json:"name,omitempty"`
  758. // ForceSendFields is a list of field names (e.g. "MaxSdkVersion") to
  759. // unconditionally include in API requests. By default, fields with
  760. // empty values are omitted from API requests. However, any non-pointer,
  761. // non-interface field appearing in ForceSendFields will be sent to the
  762. // server regardless of whether the field is empty or not. This may be
  763. // used to include empty fields in Patch requests.
  764. ForceSendFields []string `json:"-"`
  765. // NullFields is a list of field names (e.g. "MaxSdkVersion") to include
  766. // in API requests with the JSON null value. By default, fields with
  767. // empty values are omitted from API requests. However, any field with
  768. // an empty value appearing in NullFields will be sent to the server as
  769. // null. It is an error if a field in this list has a non-empty value.
  770. // This may be used to include null fields in Patch requests.
  771. NullFields []string `json:"-"`
  772. }
  773. func (s *ExternallyHostedApkUsesPermission) MarshalJSON() ([]byte, error) {
  774. type NoMethod ExternallyHostedApkUsesPermission
  775. raw := NoMethod(*s)
  776. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  777. }
  778. type Image struct {
  779. // Id: A unique id representing this image.
  780. Id string `json:"id,omitempty"`
  781. // Sha1: A sha1 hash of the image that was uploaded.
  782. Sha1 string `json:"sha1,omitempty"`
  783. // Url: A URL that will serve a preview of the image.
  784. Url string `json:"url,omitempty"`
  785. // ForceSendFields is a list of field names (e.g. "Id") to
  786. // unconditionally include in API requests. By default, fields with
  787. // empty values are omitted from API requests. However, any non-pointer,
  788. // non-interface field appearing in ForceSendFields will be sent to the
  789. // server regardless of whether the field is empty or not. This may be
  790. // used to include empty fields in Patch requests.
  791. ForceSendFields []string `json:"-"`
  792. // NullFields is a list of field names (e.g. "Id") to include in API
  793. // requests with the JSON null value. By default, fields with empty
  794. // values are omitted from API requests. However, any field with an
  795. // empty value appearing in NullFields will be sent to the server as
  796. // null. It is an error if a field in this list has a non-empty value.
  797. // This may be used to include null fields in Patch requests.
  798. NullFields []string `json:"-"`
  799. }
  800. func (s *Image) MarshalJSON() ([]byte, error) {
  801. type NoMethod Image
  802. raw := NoMethod(*s)
  803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  804. }
  805. type ImagesDeleteAllResponse struct {
  806. Deleted []*Image `json:"deleted,omitempty"`
  807. // ServerResponse contains the HTTP response code and headers from the
  808. // server.
  809. googleapi.ServerResponse `json:"-"`
  810. // ForceSendFields is a list of field names (e.g. "Deleted") to
  811. // unconditionally include in API requests. By default, fields with
  812. // empty values are omitted from API requests. However, any non-pointer,
  813. // non-interface field appearing in ForceSendFields will be sent to the
  814. // server regardless of whether the field is empty or not. This may be
  815. // used to include empty fields in Patch requests.
  816. ForceSendFields []string `json:"-"`
  817. // NullFields is a list of field names (e.g. "Deleted") to include in
  818. // API requests with the JSON null value. By default, fields with empty
  819. // values are omitted from API requests. However, any field with an
  820. // empty value appearing in NullFields will be sent to the server as
  821. // null. It is an error if a field in this list has a non-empty value.
  822. // This may be used to include null fields in Patch requests.
  823. NullFields []string `json:"-"`
  824. }
  825. func (s *ImagesDeleteAllResponse) MarshalJSON() ([]byte, error) {
  826. type NoMethod ImagesDeleteAllResponse
  827. raw := NoMethod(*s)
  828. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  829. }
  830. type ImagesListResponse struct {
  831. Images []*Image `json:"images,omitempty"`
  832. // ServerResponse contains the HTTP response code and headers from the
  833. // server.
  834. googleapi.ServerResponse `json:"-"`
  835. // ForceSendFields is a list of field names (e.g. "Images") to
  836. // unconditionally include in API requests. By default, fields with
  837. // empty values are omitted from API requests. However, any non-pointer,
  838. // non-interface field appearing in ForceSendFields will be sent to the
  839. // server regardless of whether the field is empty or not. This may be
  840. // used to include empty fields in Patch requests.
  841. ForceSendFields []string `json:"-"`
  842. // NullFields is a list of field names (e.g. "Images") to include in API
  843. // requests with the JSON null value. By default, fields with empty
  844. // values are omitted from API requests. However, any field with an
  845. // empty value appearing in NullFields will be sent to the server as
  846. // null. It is an error if a field in this list has a non-empty value.
  847. // This may be used to include null fields in Patch requests.
  848. NullFields []string `json:"-"`
  849. }
  850. func (s *ImagesListResponse) MarshalJSON() ([]byte, error) {
  851. type NoMethod ImagesListResponse
  852. raw := NoMethod(*s)
  853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  854. }
  855. type ImagesUploadResponse struct {
  856. Image *Image `json:"image,omitempty"`
  857. // ServerResponse contains the HTTP response code and headers from the
  858. // server.
  859. googleapi.ServerResponse `json:"-"`
  860. // ForceSendFields is a list of field names (e.g. "Image") to
  861. // unconditionally include in API requests. By default, fields with
  862. // empty values are omitted from API requests. However, any non-pointer,
  863. // non-interface field appearing in ForceSendFields will be sent to the
  864. // server regardless of whether the field is empty or not. This may be
  865. // used to include empty fields in Patch requests.
  866. ForceSendFields []string `json:"-"`
  867. // NullFields is a list of field names (e.g. "Image") to include in API
  868. // requests with the JSON null value. By default, fields with empty
  869. // values are omitted from API requests. However, any field with an
  870. // empty value appearing in NullFields will be sent to the server as
  871. // null. It is an error if a field in this list has a non-empty value.
  872. // This may be used to include null fields in Patch requests.
  873. NullFields []string `json:"-"`
  874. }
  875. func (s *ImagesUploadResponse) MarshalJSON() ([]byte, error) {
  876. type NoMethod ImagesUploadResponse
  877. raw := NoMethod(*s)
  878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  879. }
  880. type InAppProduct struct {
  881. // DefaultLanguage: The default language of the localized data, as
  882. // defined by BCP 47. e.g. "en-US", "en-GB".
  883. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  884. // DefaultPrice: Default price cannot be zero. In-app products can never
  885. // be free. Default price is always in the developer's Checkout merchant
  886. // currency.
  887. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  888. // GracePeriod: Grace period of the subscription, specified in ISO 8601
  889. // format. It will allow developers to give their subscribers a grace
  890. // period when the payment for the new recurrence period is declined.
  891. // Acceptable values = "P3D" (three days) and "P7D" (seven days)
  892. GracePeriod string `json:"gracePeriod,omitempty"`
  893. // Listings: List of localized title and description data.
  894. Listings map[string]InAppProductListing `json:"listings,omitempty"`
  895. // PackageName: The package name of the parent app.
  896. PackageName string `json:"packageName,omitempty"`
  897. // Prices: Prices per buyer region. None of these prices should be zero.
  898. // In-app products can never be free.
  899. Prices map[string]Price `json:"prices,omitempty"`
  900. // PurchaseType: Purchase type enum value. Unmodifiable after creation.
  901. PurchaseType string `json:"purchaseType,omitempty"`
  902. // Season: Definition of a season for a seasonal subscription. Can be
  903. // defined only for yearly subscriptions.
  904. Season *Season `json:"season,omitempty"`
  905. // Sku: The stock-keeping-unit (SKU) of the product, unique within an
  906. // app.
  907. Sku string `json:"sku,omitempty"`
  908. Status string `json:"status,omitempty"`
  909. // SubscriptionPeriod: Subscription period, specified in ISO 8601
  910. // format. Acceptable values are "P1W" (one week), "P1M" (one month),
  911. // "P3M" (three months), "P6M" (six months), and "P1Y" (one year).
  912. SubscriptionPeriod string `json:"subscriptionPeriod,omitempty"`
  913. // TrialPeriod: Trial period, specified in ISO 8601 format. Acceptable
  914. // values are anything between "P7D" (seven days) and "P999D" (999
  915. // days). Seasonal subscriptions cannot have a trial period.
  916. TrialPeriod string `json:"trialPeriod,omitempty"`
  917. // ServerResponse contains the HTTP response code and headers from the
  918. // server.
  919. googleapi.ServerResponse `json:"-"`
  920. // ForceSendFields is a list of field names (e.g. "DefaultLanguage") to
  921. // unconditionally include in API requests. By default, fields with
  922. // empty values are omitted from API requests. However, any non-pointer,
  923. // non-interface field appearing in ForceSendFields will be sent to the
  924. // server regardless of whether the field is empty or not. This may be
  925. // used to include empty fields in Patch requests.
  926. ForceSendFields []string `json:"-"`
  927. // NullFields is a list of field names (e.g. "DefaultLanguage") to
  928. // include in API requests with the JSON null value. By default, fields
  929. // with empty values are omitted from API requests. However, any field
  930. // with an empty value appearing in NullFields will be sent to the
  931. // server as null. It is an error if a field in this list has a
  932. // non-empty value. This may be used to include null fields in Patch
  933. // requests.
  934. NullFields []string `json:"-"`
  935. }
  936. func (s *InAppProduct) MarshalJSON() ([]byte, error) {
  937. type NoMethod InAppProduct
  938. raw := NoMethod(*s)
  939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  940. }
  941. type InAppProductListing struct {
  942. Description string `json:"description,omitempty"`
  943. Title string `json:"title,omitempty"`
  944. // ForceSendFields is a list of field names (e.g. "Description") to
  945. // unconditionally include in API requests. By default, fields with
  946. // empty values are omitted from API requests. However, any non-pointer,
  947. // non-interface field appearing in ForceSendFields will be sent to the
  948. // server regardless of whether the field is empty or not. This may be
  949. // used to include empty fields in Patch requests.
  950. ForceSendFields []string `json:"-"`
  951. // NullFields is a list of field names (e.g. "Description") to include
  952. // in API requests with the JSON null value. By default, fields with
  953. // empty values are omitted from API requests. However, any field with
  954. // an empty value appearing in NullFields will be sent to the server as
  955. // null. It is an error if a field in this list has a non-empty value.
  956. // This may be used to include null fields in Patch requests.
  957. NullFields []string `json:"-"`
  958. }
  959. func (s *InAppProductListing) MarshalJSON() ([]byte, error) {
  960. type NoMethod InAppProductListing
  961. raw := NoMethod(*s)
  962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  963. }
  964. type InappproductsListResponse struct {
  965. Inappproduct []*InAppProduct `json:"inappproduct,omitempty"`
  966. // Kind: Identifies what kind of resource this is. Value: the fixed
  967. // string "androidpublisher#inappproductsListResponse".
  968. Kind string `json:"kind,omitempty"`
  969. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  970. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  971. // ServerResponse contains the HTTP response code and headers from the
  972. // server.
  973. googleapi.ServerResponse `json:"-"`
  974. // ForceSendFields is a list of field names (e.g. "Inappproduct") to
  975. // unconditionally include in API requests. By default, fields with
  976. // empty values are omitted from API requests. However, any non-pointer,
  977. // non-interface field appearing in ForceSendFields will be sent to the
  978. // server regardless of whether the field is empty or not. This may be
  979. // used to include empty fields in Patch requests.
  980. ForceSendFields []string `json:"-"`
  981. // NullFields is a list of field names (e.g. "Inappproduct") to include
  982. // in API requests with the JSON null value. By default, fields with
  983. // empty values are omitted from API requests. However, any field with
  984. // an empty value appearing in NullFields will be sent to the server as
  985. // null. It is an error if a field in this list has a non-empty value.
  986. // This may be used to include null fields in Patch requests.
  987. NullFields []string `json:"-"`
  988. }
  989. func (s *InappproductsListResponse) MarshalJSON() ([]byte, error) {
  990. type NoMethod InappproductsListResponse
  991. raw := NoMethod(*s)
  992. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  993. }
  994. type Listing struct {
  995. // FullDescription: Full description of the app; this may be up to 4000
  996. // characters in length.
  997. FullDescription string `json:"fullDescription,omitempty"`
  998. // Language: Language localization code (for example, "de-AT" for
  999. // Austrian German).
  1000. Language string `json:"language,omitempty"`
  1001. // ShortDescription: Short description of the app (previously known as
  1002. // promo text); this may be up to 80 characters in length.
  1003. ShortDescription string `json:"shortDescription,omitempty"`
  1004. // Title: App's localized title.
  1005. Title string `json:"title,omitempty"`
  1006. // Video: URL of a promotional YouTube video for the app.
  1007. Video string `json:"video,omitempty"`
  1008. // ServerResponse contains the HTTP response code and headers from the
  1009. // server.
  1010. googleapi.ServerResponse `json:"-"`
  1011. // ForceSendFields is a list of field names (e.g. "FullDescription") to
  1012. // unconditionally include in API requests. By default, fields with
  1013. // empty values are omitted from API requests. However, any non-pointer,
  1014. // non-interface field appearing in ForceSendFields will be sent to the
  1015. // server regardless of whether the field is empty or not. This may be
  1016. // used to include empty fields in Patch requests.
  1017. ForceSendFields []string `json:"-"`
  1018. // NullFields is a list of field names (e.g. "FullDescription") to
  1019. // include in API requests with the JSON null value. By default, fields
  1020. // with empty values are omitted from API requests. However, any field
  1021. // with an empty value appearing in NullFields will be sent to the
  1022. // server as null. It is an error if a field in this list has a
  1023. // non-empty value. This may be used to include null fields in Patch
  1024. // requests.
  1025. NullFields []string `json:"-"`
  1026. }
  1027. func (s *Listing) MarshalJSON() ([]byte, error) {
  1028. type NoMethod Listing
  1029. raw := NoMethod(*s)
  1030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1031. }
  1032. type ListingsListResponse struct {
  1033. // Kind: Identifies what kind of resource this is. Value: the fixed
  1034. // string "androidpublisher#listingsListResponse".
  1035. Kind string `json:"kind,omitempty"`
  1036. Listings []*Listing `json:"listings,omitempty"`
  1037. // ServerResponse contains the HTTP response code and headers from the
  1038. // server.
  1039. googleapi.ServerResponse `json:"-"`
  1040. // ForceSendFields is a list of field names (e.g. "Kind") to
  1041. // unconditionally include in API requests. By default, fields with
  1042. // empty values are omitted from API requests. However, any non-pointer,
  1043. // non-interface field appearing in ForceSendFields will be sent to the
  1044. // server regardless of whether the field is empty or not. This may be
  1045. // used to include empty fields in Patch requests.
  1046. ForceSendFields []string `json:"-"`
  1047. // NullFields is a list of field names (e.g. "Kind") to include in API
  1048. // requests with the JSON null value. By default, fields with empty
  1049. // values are omitted from API requests. However, any field with an
  1050. // empty value appearing in NullFields will be sent to the server as
  1051. // null. It is an error if a field in this list has a non-empty value.
  1052. // This may be used to include null fields in Patch requests.
  1053. NullFields []string `json:"-"`
  1054. }
  1055. func (s *ListingsListResponse) MarshalJSON() ([]byte, error) {
  1056. type NoMethod ListingsListResponse
  1057. raw := NoMethod(*s)
  1058. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1059. }
  1060. type LocalizedText struct {
  1061. // Language: The language code, in BCP 47 format (eg "en-US").
  1062. Language string `json:"language,omitempty"`
  1063. // Text: The text in the given `language`.
  1064. Text string `json:"text,omitempty"`
  1065. // ForceSendFields is a list of field names (e.g. "Language") to
  1066. // unconditionally include in API requests. By default, fields with
  1067. // empty values are omitted from API requests. However, any non-pointer,
  1068. // non-interface field appearing in ForceSendFields will be sent to the
  1069. // server regardless of whether the field is empty or not. This may be
  1070. // used to include empty fields in Patch requests.
  1071. ForceSendFields []string `json:"-"`
  1072. // NullFields is a list of field names (e.g. "Language") to include in
  1073. // API requests with the JSON null value. By default, fields with empty
  1074. // values are omitted from API requests. However, any field with an
  1075. // empty value appearing in NullFields will be sent to the server as
  1076. // null. It is an error if a field in this list has a non-empty value.
  1077. // This may be used to include null fields in Patch requests.
  1078. NullFields []string `json:"-"`
  1079. }
  1080. func (s *LocalizedText) MarshalJSON() ([]byte, error) {
  1081. type NoMethod LocalizedText
  1082. raw := NoMethod(*s)
  1083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1084. }
  1085. type MonthDay struct {
  1086. // Day: Day of a month, value in [1, 31] range. Valid range depends on
  1087. // the specified month.
  1088. Day int64 `json:"day,omitempty"`
  1089. // Month: Month of a year. e.g. 1 = JAN, 2 = FEB etc.
  1090. Month int64 `json:"month,omitempty"`
  1091. // ForceSendFields is a list of field names (e.g. "Day") to
  1092. // unconditionally include in API requests. By default, fields with
  1093. // empty values are omitted from API requests. However, any non-pointer,
  1094. // non-interface field appearing in ForceSendFields will be sent to the
  1095. // server regardless of whether the field is empty or not. This may be
  1096. // used to include empty fields in Patch requests.
  1097. ForceSendFields []string `json:"-"`
  1098. // NullFields is a list of field names (e.g. "Day") to include in API
  1099. // requests with the JSON null value. By default, fields with empty
  1100. // values are omitted from API requests. However, any field with an
  1101. // empty value appearing in NullFields will be sent to the server as
  1102. // null. It is an error if a field in this list has a non-empty value.
  1103. // This may be used to include null fields in Patch requests.
  1104. NullFields []string `json:"-"`
  1105. }
  1106. func (s *MonthDay) MarshalJSON() ([]byte, error) {
  1107. type NoMethod MonthDay
  1108. raw := NoMethod(*s)
  1109. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1110. }
  1111. type PageInfo struct {
  1112. ResultPerPage int64 `json:"resultPerPage,omitempty"`
  1113. StartIndex int64 `json:"startIndex,omitempty"`
  1114. TotalResults int64 `json:"totalResults,omitempty"`
  1115. // ForceSendFields is a list of field names (e.g. "ResultPerPage") to
  1116. // unconditionally include in API requests. By default, fields with
  1117. // empty values are omitted from API requests. However, any non-pointer,
  1118. // non-interface field appearing in ForceSendFields will be sent to the
  1119. // server regardless of whether the field is empty or not. This may be
  1120. // used to include empty fields in Patch requests.
  1121. ForceSendFields []string `json:"-"`
  1122. // NullFields is a list of field names (e.g. "ResultPerPage") to include
  1123. // in API requests with the JSON null value. By default, fields with
  1124. // empty values are omitted from API requests. However, any field with
  1125. // an empty value appearing in NullFields will be sent to the server as
  1126. // null. It is an error if a field in this list has a non-empty value.
  1127. // This may be used to include null fields in Patch requests.
  1128. NullFields []string `json:"-"`
  1129. }
  1130. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  1131. type NoMethod PageInfo
  1132. raw := NoMethod(*s)
  1133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1134. }
  1135. type Price struct {
  1136. // Currency: 3 letter Currency code, as defined by ISO 4217.
  1137. Currency string `json:"currency,omitempty"`
  1138. // PriceMicros: The price in millionths of the currency base unit
  1139. // represented as a string.
  1140. PriceMicros string `json:"priceMicros,omitempty"`
  1141. // ForceSendFields is a list of field names (e.g. "Currency") to
  1142. // unconditionally include in API requests. By default, fields with
  1143. // empty values are omitted from API requests. However, any non-pointer,
  1144. // non-interface field appearing in ForceSendFields will be sent to the
  1145. // server regardless of whether the field is empty or not. This may be
  1146. // used to include empty fields in Patch requests.
  1147. ForceSendFields []string `json:"-"`
  1148. // NullFields is a list of field names (e.g. "Currency") to include in
  1149. // API requests with the JSON null value. By default, fields with empty
  1150. // values are omitted from API requests. However, any field with an
  1151. // empty value appearing in NullFields will be sent to the server as
  1152. // null. It is an error if a field in this list has a non-empty value.
  1153. // This may be used to include null fields in Patch requests.
  1154. NullFields []string `json:"-"`
  1155. }
  1156. func (s *Price) MarshalJSON() ([]byte, error) {
  1157. type NoMethod Price
  1158. raw := NoMethod(*s)
  1159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1160. }
  1161. // ProductPurchase: A ProductPurchase resource indicates the status of a
  1162. // user's inapp product purchase.
  1163. type ProductPurchase struct {
  1164. // ConsumptionState: The consumption state of the inapp product.
  1165. // Possible values are:
  1166. // - Yet to be consumed
  1167. // - Consumed
  1168. ConsumptionState int64 `json:"consumptionState,omitempty"`
  1169. // DeveloperPayload: A developer-specified string that contains
  1170. // supplemental information about an order.
  1171. DeveloperPayload string `json:"developerPayload,omitempty"`
  1172. // Kind: This kind represents an inappPurchase object in the
  1173. // androidpublisher service.
  1174. Kind string `json:"kind,omitempty"`
  1175. // OrderId: The order id associated with the purchase of the inapp
  1176. // product.
  1177. OrderId string `json:"orderId,omitempty"`
  1178. // PurchaseState: The purchase state of the order. Possible values are:
  1179. //
  1180. // - Purchased
  1181. // - Canceled
  1182. PurchaseState int64 `json:"purchaseState,omitempty"`
  1183. // PurchaseTimeMillis: The time the product was purchased, in
  1184. // milliseconds since the epoch (Jan 1, 1970).
  1185. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1186. // PurchaseType: The type of purchase of the inapp product. This field
  1187. // is only set if this purchase was not made using the standard in-app
  1188. // billing flow. Possible values are:
  1189. // - Test (i.e. purchased from a license testing account)
  1190. // - Promo (i.e. purchased using a promo code)
  1191. PurchaseType int64 `json:"purchaseType,omitempty"`
  1192. // ServerResponse contains the HTTP response code and headers from the
  1193. // server.
  1194. googleapi.ServerResponse `json:"-"`
  1195. // ForceSendFields is a list of field names (e.g. "ConsumptionState") to
  1196. // unconditionally include in API requests. By default, fields with
  1197. // empty values are omitted from API requests. However, any non-pointer,
  1198. // non-interface field appearing in ForceSendFields will be sent to the
  1199. // server regardless of whether the field is empty or not. This may be
  1200. // used to include empty fields in Patch requests.
  1201. ForceSendFields []string `json:"-"`
  1202. // NullFields is a list of field names (e.g. "ConsumptionState") to
  1203. // include in API requests with the JSON null value. By default, fields
  1204. // with empty values are omitted from API requests. However, any field
  1205. // with an empty value appearing in NullFields will be sent to the
  1206. // server as null. It is an error if a field in this list has a
  1207. // non-empty value. This may be used to include null fields in Patch
  1208. // requests.
  1209. NullFields []string `json:"-"`
  1210. }
  1211. func (s *ProductPurchase) MarshalJSON() ([]byte, error) {
  1212. type NoMethod ProductPurchase
  1213. raw := NoMethod(*s)
  1214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1215. }
  1216. type Prorate struct {
  1217. // DefaultPrice: Default price cannot be zero and must be less than the
  1218. // full subscription price. Default price is always in the developer's
  1219. // Checkout merchant currency. Targeted countries have their prices set
  1220. // automatically based on the default_price.
  1221. DefaultPrice *Price `json:"defaultPrice,omitempty"`
  1222. // Start: Defines the first day on which the price takes effect.
  1223. Start *MonthDay `json:"start,omitempty"`
  1224. // ForceSendFields is a list of field names (e.g. "DefaultPrice") to
  1225. // unconditionally include in API requests. By default, fields with
  1226. // empty values are omitted from API requests. However, any non-pointer,
  1227. // non-interface field appearing in ForceSendFields will be sent to the
  1228. // server regardless of whether the field is empty or not. This may be
  1229. // used to include empty fields in Patch requests.
  1230. ForceSendFields []string `json:"-"`
  1231. // NullFields is a list of field names (e.g. "DefaultPrice") to include
  1232. // in API requests with the JSON null value. By default, fields with
  1233. // empty values are omitted from API requests. However, any field with
  1234. // an empty value appearing in NullFields will be sent to the server as
  1235. // null. It is an error if a field in this list has a non-empty value.
  1236. // This may be used to include null fields in Patch requests.
  1237. NullFields []string `json:"-"`
  1238. }
  1239. func (s *Prorate) MarshalJSON() ([]byte, error) {
  1240. type NoMethod Prorate
  1241. raw := NoMethod(*s)
  1242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1243. }
  1244. type Review struct {
  1245. // AuthorName: The name of the user who wrote the review.
  1246. AuthorName string `json:"authorName,omitempty"`
  1247. // Comments: A repeated field containing comments for the review.
  1248. Comments []*Comment `json:"comments,omitempty"`
  1249. // ReviewId: Unique identifier for this review.
  1250. ReviewId string `json:"reviewId,omitempty"`
  1251. // ServerResponse contains the HTTP response code and headers from the
  1252. // server.
  1253. googleapi.ServerResponse `json:"-"`
  1254. // ForceSendFields is a list of field names (e.g. "AuthorName") to
  1255. // unconditionally include in API requests. By default, fields with
  1256. // empty values are omitted from API requests. However, any non-pointer,
  1257. // non-interface field appearing in ForceSendFields will be sent to the
  1258. // server regardless of whether the field is empty or not. This may be
  1259. // used to include empty fields in Patch requests.
  1260. ForceSendFields []string `json:"-"`
  1261. // NullFields is a list of field names (e.g. "AuthorName") to include in
  1262. // API requests with the JSON null value. By default, fields with empty
  1263. // values are omitted from API requests. However, any field with an
  1264. // empty value appearing in NullFields will be sent to the server as
  1265. // null. It is an error if a field in this list has a non-empty value.
  1266. // This may be used to include null fields in Patch requests.
  1267. NullFields []string `json:"-"`
  1268. }
  1269. func (s *Review) MarshalJSON() ([]byte, error) {
  1270. type NoMethod Review
  1271. raw := NoMethod(*s)
  1272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1273. }
  1274. type ReviewReplyResult struct {
  1275. // LastEdited: The time at which the reply took effect.
  1276. LastEdited *Timestamp `json:"lastEdited,omitempty"`
  1277. // ReplyText: The reply text that was applied.
  1278. ReplyText string `json:"replyText,omitempty"`
  1279. // ForceSendFields is a list of field names (e.g. "LastEdited") to
  1280. // unconditionally include in API requests. By default, fields with
  1281. // empty values are omitted from API requests. However, any non-pointer,
  1282. // non-interface field appearing in ForceSendFields will be sent to the
  1283. // server regardless of whether the field is empty or not. This may be
  1284. // used to include empty fields in Patch requests.
  1285. ForceSendFields []string `json:"-"`
  1286. // NullFields is a list of field names (e.g. "LastEdited") to include in
  1287. // API requests with the JSON null value. By default, fields with empty
  1288. // values are omitted from API requests. However, any field with an
  1289. // empty value appearing in NullFields will be sent to the server as
  1290. // null. It is an error if a field in this list has a non-empty value.
  1291. // This may be used to include null fields in Patch requests.
  1292. NullFields []string `json:"-"`
  1293. }
  1294. func (s *ReviewReplyResult) MarshalJSON() ([]byte, error) {
  1295. type NoMethod ReviewReplyResult
  1296. raw := NoMethod(*s)
  1297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1298. }
  1299. type ReviewsListResponse struct {
  1300. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1301. Reviews []*Review `json:"reviews,omitempty"`
  1302. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1303. // ServerResponse contains the HTTP response code and headers from the
  1304. // server.
  1305. googleapi.ServerResponse `json:"-"`
  1306. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  1307. // unconditionally include in API requests. By default, fields with
  1308. // empty values are omitted from API requests. However, any non-pointer,
  1309. // non-interface field appearing in ForceSendFields will be sent to the
  1310. // server regardless of whether the field is empty or not. This may be
  1311. // used to include empty fields in Patch requests.
  1312. ForceSendFields []string `json:"-"`
  1313. // NullFields is a list of field names (e.g. "PageInfo") to include in
  1314. // API requests with the JSON null value. By default, fields with empty
  1315. // values are omitted from API requests. However, any field with an
  1316. // empty value appearing in NullFields will be sent to the server as
  1317. // null. It is an error if a field in this list has a non-empty value.
  1318. // This may be used to include null fields in Patch requests.
  1319. NullFields []string `json:"-"`
  1320. }
  1321. func (s *ReviewsListResponse) MarshalJSON() ([]byte, error) {
  1322. type NoMethod ReviewsListResponse
  1323. raw := NoMethod(*s)
  1324. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1325. }
  1326. type ReviewsReplyRequest struct {
  1327. // ReplyText: The text to set as the reply. Replies of more than
  1328. // approximately 350 characters will be rejected. HTML tags will be
  1329. // stripped.
  1330. ReplyText string `json:"replyText,omitempty"`
  1331. // ForceSendFields is a list of field names (e.g. "ReplyText") to
  1332. // unconditionally include in API requests. By default, fields with
  1333. // empty values are omitted from API requests. However, any non-pointer,
  1334. // non-interface field appearing in ForceSendFields will be sent to the
  1335. // server regardless of whether the field is empty or not. This may be
  1336. // used to include empty fields in Patch requests.
  1337. ForceSendFields []string `json:"-"`
  1338. // NullFields is a list of field names (e.g. "ReplyText") to include in
  1339. // API requests with the JSON null value. By default, fields with empty
  1340. // values are omitted from API requests. However, any field with an
  1341. // empty value appearing in NullFields will be sent to the server as
  1342. // null. It is an error if a field in this list has a non-empty value.
  1343. // This may be used to include null fields in Patch requests.
  1344. NullFields []string `json:"-"`
  1345. }
  1346. func (s *ReviewsReplyRequest) MarshalJSON() ([]byte, error) {
  1347. type NoMethod ReviewsReplyRequest
  1348. raw := NoMethod(*s)
  1349. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1350. }
  1351. type ReviewsReplyResponse struct {
  1352. Result *ReviewReplyResult `json:"result,omitempty"`
  1353. // ServerResponse contains the HTTP response code and headers from the
  1354. // server.
  1355. googleapi.ServerResponse `json:"-"`
  1356. // ForceSendFields is a list of field names (e.g. "Result") to
  1357. // unconditionally include in API requests. By default, fields with
  1358. // empty values are omitted from API requests. However, any non-pointer,
  1359. // non-interface field appearing in ForceSendFields will be sent to the
  1360. // server regardless of whether the field is empty or not. This may be
  1361. // used to include empty fields in Patch requests.
  1362. ForceSendFields []string `json:"-"`
  1363. // NullFields is a list of field names (e.g. "Result") to include in API
  1364. // requests with the JSON null value. By default, fields with empty
  1365. // values are omitted from API requests. However, any field with an
  1366. // empty value appearing in NullFields will be sent to the server as
  1367. // null. It is an error if a field in this list has a non-empty value.
  1368. // This may be used to include null fields in Patch requests.
  1369. NullFields []string `json:"-"`
  1370. }
  1371. func (s *ReviewsReplyResponse) MarshalJSON() ([]byte, error) {
  1372. type NoMethod ReviewsReplyResponse
  1373. raw := NoMethod(*s)
  1374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1375. }
  1376. type Season struct {
  1377. // End: Inclusive end date of the recurrence period.
  1378. End *MonthDay `json:"end,omitempty"`
  1379. // Prorations: Optionally present list of prorations for the season.
  1380. // Each proration is a one-off discounted entry into a subscription.
  1381. // Each proration contains the first date on which the discount is
  1382. // available and the new pricing information.
  1383. Prorations []*Prorate `json:"prorations,omitempty"`
  1384. // Start: Inclusive start date of the recurrence period.
  1385. Start *MonthDay `json:"start,omitempty"`
  1386. // ForceSendFields is a list of field names (e.g. "End") to
  1387. // unconditionally include in API requests. By default, fields with
  1388. // empty values are omitted from API requests. However, any non-pointer,
  1389. // non-interface field appearing in ForceSendFields will be sent to the
  1390. // server regardless of whether the field is empty or not. This may be
  1391. // used to include empty fields in Patch requests.
  1392. ForceSendFields []string `json:"-"`
  1393. // NullFields is a list of field names (e.g. "End") to include in API
  1394. // requests with the JSON null value. By default, fields with empty
  1395. // values are omitted from API requests. However, any field with an
  1396. // empty value appearing in NullFields will be sent to the server as
  1397. // null. It is an error if a field in this list has a non-empty value.
  1398. // This may be used to include null fields in Patch requests.
  1399. NullFields []string `json:"-"`
  1400. }
  1401. func (s *Season) MarshalJSON() ([]byte, error) {
  1402. type NoMethod Season
  1403. raw := NoMethod(*s)
  1404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1405. }
  1406. // SubscriptionCancelSurveyResult: Information provided by the user when
  1407. // they complete the subscription cancellation flow (cancellation reason
  1408. // survey).
  1409. type SubscriptionCancelSurveyResult struct {
  1410. // CancelSurveyReason: The cancellation reason the user chose in the
  1411. // survey. Possible values are:
  1412. // - Other
  1413. // - I don't use this service enough
  1414. // - Technical issues
  1415. // - Cost-related reasons
  1416. // - I found a better app
  1417. CancelSurveyReason int64 `json:"cancelSurveyReason,omitempty"`
  1418. // UserInputCancelReason: The customized input cancel reason from the
  1419. // user. Only present when cancelReason is 0.
  1420. UserInputCancelReason string `json:"userInputCancelReason,omitempty"`
  1421. // ForceSendFields is a list of field names (e.g. "CancelSurveyReason")
  1422. // to unconditionally include in API requests. By default, fields with
  1423. // empty values are omitted from API requests. However, any non-pointer,
  1424. // non-interface field appearing in ForceSendFields will be sent to the
  1425. // server regardless of whether the field is empty or not. This may be
  1426. // used to include empty fields in Patch requests.
  1427. ForceSendFields []string `json:"-"`
  1428. // NullFields is a list of field names (e.g. "CancelSurveyReason") to
  1429. // include in API requests with the JSON null value. By default, fields
  1430. // with empty values are omitted from API requests. However, any field
  1431. // with an empty value appearing in NullFields will be sent to the
  1432. // server as null. It is an error if a field in this list has a
  1433. // non-empty value. This may be used to include null fields in Patch
  1434. // requests.
  1435. NullFields []string `json:"-"`
  1436. }
  1437. func (s *SubscriptionCancelSurveyResult) MarshalJSON() ([]byte, error) {
  1438. type NoMethod SubscriptionCancelSurveyResult
  1439. raw := NoMethod(*s)
  1440. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1441. }
  1442. // SubscriptionDeferralInfo: A SubscriptionDeferralInfo contains the
  1443. // data needed to defer a subscription purchase to a future expiry time.
  1444. type SubscriptionDeferralInfo struct {
  1445. // DesiredExpiryTimeMillis: The desired next expiry time to assign to
  1446. // the subscription, in milliseconds since the Epoch. The given time
  1447. // must be later/greater than the current expiry time for the
  1448. // subscription.
  1449. DesiredExpiryTimeMillis int64 `json:"desiredExpiryTimeMillis,omitempty,string"`
  1450. // ExpectedExpiryTimeMillis: The expected expiry time for the
  1451. // subscription. If the current expiry time for the subscription is not
  1452. // the value specified here, the deferral will not occur.
  1453. ExpectedExpiryTimeMillis int64 `json:"expectedExpiryTimeMillis,omitempty,string"`
  1454. // ForceSendFields is a list of field names (e.g.
  1455. // "DesiredExpiryTimeMillis") to unconditionally include in API
  1456. // requests. By default, fields with empty values are omitted from API
  1457. // requests. However, any non-pointer, non-interface field appearing in
  1458. // ForceSendFields will be sent to the server regardless of whether the
  1459. // field is empty or not. This may be used to include empty fields in
  1460. // Patch requests.
  1461. ForceSendFields []string `json:"-"`
  1462. // NullFields is a list of field names (e.g. "DesiredExpiryTimeMillis")
  1463. // to include in API requests with the JSON null value. By default,
  1464. // fields with empty values are omitted from API requests. However, any
  1465. // field with an empty value appearing in NullFields will be sent to the
  1466. // server as null. It is an error if a field in this list has a
  1467. // non-empty value. This may be used to include null fields in Patch
  1468. // requests.
  1469. NullFields []string `json:"-"`
  1470. }
  1471. func (s *SubscriptionDeferralInfo) MarshalJSON() ([]byte, error) {
  1472. type NoMethod SubscriptionDeferralInfo
  1473. raw := NoMethod(*s)
  1474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1475. }
  1476. // SubscriptionPurchase: A SubscriptionPurchase resource indicates the
  1477. // status of a user's subscription purchase.
  1478. type SubscriptionPurchase struct {
  1479. // AutoRenewing: Whether the subscription will automatically be renewed
  1480. // when it reaches its current expiry time.
  1481. AutoRenewing bool `json:"autoRenewing,omitempty"`
  1482. // CancelReason: The reason why a subscription was canceled or is not
  1483. // auto-renewing. Possible values are:
  1484. // - User canceled the subscription
  1485. // - Subscription was canceled by the system, for example because of a
  1486. // billing problem
  1487. // - Subscription was replaced with a new subscription
  1488. // - Subscription was canceled by the developer
  1489. CancelReason int64 `json:"cancelReason,omitempty"`
  1490. // CancelSurveyResult: Information provided by the user when they
  1491. // complete the subscription cancellation flow (cancellation reason
  1492. // survey).
  1493. CancelSurveyResult *SubscriptionCancelSurveyResult `json:"cancelSurveyResult,omitempty"`
  1494. // CountryCode: ISO 3166-1 alpha-2 billing country/region code of the
  1495. // user at the time the subscription was granted.
  1496. CountryCode string `json:"countryCode,omitempty"`
  1497. // DeveloperPayload: A developer-specified string that contains
  1498. // supplemental information about an order.
  1499. DeveloperPayload string `json:"developerPayload,omitempty"`
  1500. // EmailAddress: The email address of the user when the subscription was
  1501. // purchased. Only present for purchases made with 'Subscribe with
  1502. // Google'.
  1503. EmailAddress string `json:"emailAddress,omitempty"`
  1504. // ExpiryTimeMillis: Time at which the subscription will expire, in
  1505. // milliseconds since the Epoch.
  1506. ExpiryTimeMillis int64 `json:"expiryTimeMillis,omitempty,string"`
  1507. // FamilyName: The family name of the user when the subscription was
  1508. // purchased. Only present for purchases made with 'Subscribe with
  1509. // Google'.
  1510. FamilyName string `json:"familyName,omitempty"`
  1511. // GivenName: The given name of the user when the subscription was
  1512. // purchased. Only present for purchases made with 'Subscribe with
  1513. // Google'.
  1514. GivenName string `json:"givenName,omitempty"`
  1515. // Kind: This kind represents a subscriptionPurchase object in the
  1516. // androidpublisher service.
  1517. Kind string `json:"kind,omitempty"`
  1518. // LinkedPurchaseToken: The purchase token of the originating purchase
  1519. // if this subscription is one of the following:
  1520. // - Re-signup of a canceled but non-lapsed subscription
  1521. // - Upgrade/downgrade from a previous subscription For example,
  1522. // suppose a user originally signs up and you receive purchase token X,
  1523. // then the user cancels and goes through the resignup flow (before
  1524. // their subscription lapses) and you receive purchase token Y, and
  1525. // finally the user upgrades their subscription and you receive purchase
  1526. // token Z. If you call this API with purchase token Z, this field will
  1527. // be set to Y. If you call this API with purchase token Y, this field
  1528. // will be set to X. If you call this API with purchase token X, this
  1529. // field will not be set.
  1530. LinkedPurchaseToken string `json:"linkedPurchaseToken,omitempty"`
  1531. // OrderId: The order id of the latest recurring order associated with
  1532. // the purchase of the subscription.
  1533. OrderId string `json:"orderId,omitempty"`
  1534. // PaymentState: The payment state of the subscription. Possible values
  1535. // are:
  1536. // - Payment pending
  1537. // - Payment received
  1538. // - Free trial
  1539. PaymentState int64 `json:"paymentState,omitempty"`
  1540. // PriceAmountMicros: Price of the subscription, not including tax.
  1541. // Price is expressed in micro-units, where 1,000,000 micro-units
  1542. // represents one unit of the currency. For example, if the subscription
  1543. // price is €1.99, price_amount_micros is 1990000.
  1544. PriceAmountMicros int64 `json:"priceAmountMicros,omitempty,string"`
  1545. // PriceCurrencyCode: ISO 4217 currency code for the subscription price.
  1546. // For example, if the price is specified in British pounds sterling,
  1547. // price_currency_code is "GBP".
  1548. PriceCurrencyCode string `json:"priceCurrencyCode,omitempty"`
  1549. // ProfileId: The profile id of the user when the subscription was
  1550. // purchased. Only present for purchases made with 'Subscribe with
  1551. // Google'.
  1552. ProfileId string `json:"profileId,omitempty"`
  1553. // ProfileName: The profile name of the user when the subscription was
  1554. // purchased. Only present for purchases made with 'Subscribe with
  1555. // Google'.
  1556. ProfileName string `json:"profileName,omitempty"`
  1557. // PurchaseType: The type of purchase of the subscription. This field is
  1558. // only set if this purchase was not made using the standard in-app
  1559. // billing flow. Possible values are:
  1560. // - Test (i.e. purchased from a license testing account)
  1561. PurchaseType int64 `json:"purchaseType,omitempty"`
  1562. // StartTimeMillis: Time at which the subscription was granted, in
  1563. // milliseconds since the Epoch.
  1564. StartTimeMillis int64 `json:"startTimeMillis,omitempty,string"`
  1565. // UserCancellationTimeMillis: The time at which the subscription was
  1566. // canceled by the user, in milliseconds since the epoch. Only present
  1567. // if cancelReason is 0.
  1568. UserCancellationTimeMillis int64 `json:"userCancellationTimeMillis,omitempty,string"`
  1569. // ServerResponse contains the HTTP response code and headers from the
  1570. // server.
  1571. googleapi.ServerResponse `json:"-"`
  1572. // ForceSendFields is a list of field names (e.g. "AutoRenewing") to
  1573. // unconditionally include in API requests. By default, fields with
  1574. // empty values are omitted from API requests. However, any non-pointer,
  1575. // non-interface field appearing in ForceSendFields will be sent to the
  1576. // server regardless of whether the field is empty or not. This may be
  1577. // used to include empty fields in Patch requests.
  1578. ForceSendFields []string `json:"-"`
  1579. // NullFields is a list of field names (e.g. "AutoRenewing") to include
  1580. // in API requests with the JSON null value. By default, fields with
  1581. // empty values are omitted from API requests. However, any field with
  1582. // an empty value appearing in NullFields will be sent to the server as
  1583. // null. It is an error if a field in this list has a non-empty value.
  1584. // This may be used to include null fields in Patch requests.
  1585. NullFields []string `json:"-"`
  1586. }
  1587. func (s *SubscriptionPurchase) MarshalJSON() ([]byte, error) {
  1588. type NoMethod SubscriptionPurchase
  1589. raw := NoMethod(*s)
  1590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1591. }
  1592. type SubscriptionPurchasesDeferRequest struct {
  1593. // DeferralInfo: The information about the new desired expiry time for
  1594. // the subscription.
  1595. DeferralInfo *SubscriptionDeferralInfo `json:"deferralInfo,omitempty"`
  1596. // ForceSendFields is a list of field names (e.g. "DeferralInfo") to
  1597. // unconditionally include in API requests. By default, fields with
  1598. // empty values are omitted from API requests. However, any non-pointer,
  1599. // non-interface field appearing in ForceSendFields will be sent to the
  1600. // server regardless of whether the field is empty or not. This may be
  1601. // used to include empty fields in Patch requests.
  1602. ForceSendFields []string `json:"-"`
  1603. // NullFields is a list of field names (e.g. "DeferralInfo") to include
  1604. // in API requests with the JSON null value. By default, fields with
  1605. // empty values are omitted from API requests. However, any field with
  1606. // an empty value appearing in NullFields will be sent to the server as
  1607. // null. It is an error if a field in this list has a non-empty value.
  1608. // This may be used to include null fields in Patch requests.
  1609. NullFields []string `json:"-"`
  1610. }
  1611. func (s *SubscriptionPurchasesDeferRequest) MarshalJSON() ([]byte, error) {
  1612. type NoMethod SubscriptionPurchasesDeferRequest
  1613. raw := NoMethod(*s)
  1614. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1615. }
  1616. type SubscriptionPurchasesDeferResponse struct {
  1617. // NewExpiryTimeMillis: The new expiry time for the subscription in
  1618. // milliseconds since the Epoch.
  1619. NewExpiryTimeMillis int64 `json:"newExpiryTimeMillis,omitempty,string"`
  1620. // ServerResponse contains the HTTP response code and headers from the
  1621. // server.
  1622. googleapi.ServerResponse `json:"-"`
  1623. // ForceSendFields is a list of field names (e.g. "NewExpiryTimeMillis")
  1624. // to unconditionally include in API requests. By default, fields with
  1625. // empty values are omitted from API requests. However, any non-pointer,
  1626. // non-interface field appearing in ForceSendFields will be sent to the
  1627. // server regardless of whether the field is empty or not. This may be
  1628. // used to include empty fields in Patch requests.
  1629. ForceSendFields []string `json:"-"`
  1630. // NullFields is a list of field names (e.g. "NewExpiryTimeMillis") to
  1631. // include in API requests with the JSON null value. By default, fields
  1632. // with empty values are omitted from API requests. However, any field
  1633. // with an empty value appearing in NullFields will be sent to the
  1634. // server as null. It is an error if a field in this list has a
  1635. // non-empty value. This may be used to include null fields in Patch
  1636. // requests.
  1637. NullFields []string `json:"-"`
  1638. }
  1639. func (s *SubscriptionPurchasesDeferResponse) MarshalJSON() ([]byte, error) {
  1640. type NoMethod SubscriptionPurchasesDeferResponse
  1641. raw := NoMethod(*s)
  1642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1643. }
  1644. type Testers struct {
  1645. GoogleGroups []string `json:"googleGroups,omitempty"`
  1646. GooglePlusCommunities []string `json:"googlePlusCommunities,omitempty"`
  1647. // ServerResponse contains the HTTP response code and headers from the
  1648. // server.
  1649. googleapi.ServerResponse `json:"-"`
  1650. // ForceSendFields is a list of field names (e.g. "GoogleGroups") to
  1651. // unconditionally include in API requests. By default, fields with
  1652. // empty values are omitted from API requests. However, any non-pointer,
  1653. // non-interface field appearing in ForceSendFields will be sent to the
  1654. // server regardless of whether the field is empty or not. This may be
  1655. // used to include empty fields in Patch requests.
  1656. ForceSendFields []string `json:"-"`
  1657. // NullFields is a list of field names (e.g. "GoogleGroups") to include
  1658. // in API requests with the JSON null value. By default, fields with
  1659. // empty values are omitted from API requests. However, any field with
  1660. // an empty value appearing in NullFields will be sent to the server as
  1661. // null. It is an error if a field in this list has a non-empty value.
  1662. // This may be used to include null fields in Patch requests.
  1663. NullFields []string `json:"-"`
  1664. }
  1665. func (s *Testers) MarshalJSON() ([]byte, error) {
  1666. type NoMethod Testers
  1667. raw := NoMethod(*s)
  1668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1669. }
  1670. type Timestamp struct {
  1671. Nanos int64 `json:"nanos,omitempty"`
  1672. Seconds int64 `json:"seconds,omitempty,string"`
  1673. // ForceSendFields is a list of field names (e.g. "Nanos") to
  1674. // unconditionally include in API requests. By default, fields with
  1675. // empty values are omitted from API requests. However, any non-pointer,
  1676. // non-interface field appearing in ForceSendFields will be sent to the
  1677. // server regardless of whether the field is empty or not. This may be
  1678. // used to include empty fields in Patch requests.
  1679. ForceSendFields []string `json:"-"`
  1680. // NullFields is a list of field names (e.g. "Nanos") to include in API
  1681. // requests with the JSON null value. By default, fields with empty
  1682. // values are omitted from API requests. However, any field with an
  1683. // empty value appearing in NullFields will be sent to the server as
  1684. // null. It is an error if a field in this list has a non-empty value.
  1685. // This may be used to include null fields in Patch requests.
  1686. NullFields []string `json:"-"`
  1687. }
  1688. func (s *Timestamp) MarshalJSON() ([]byte, error) {
  1689. type NoMethod Timestamp
  1690. raw := NoMethod(*s)
  1691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1692. }
  1693. type TokenPagination struct {
  1694. NextPageToken string `json:"nextPageToken,omitempty"`
  1695. PreviousPageToken string `json:"previousPageToken,omitempty"`
  1696. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1697. // unconditionally include in API requests. By default, fields with
  1698. // empty values are omitted from API requests. However, any non-pointer,
  1699. // non-interface field appearing in ForceSendFields will be sent to the
  1700. // server regardless of whether the field is empty or not. This may be
  1701. // used to include empty fields in Patch requests.
  1702. ForceSendFields []string `json:"-"`
  1703. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1704. // in API requests with the JSON null value. By default, fields with
  1705. // empty values are omitted from API requests. However, any field with
  1706. // an empty value appearing in NullFields will be sent to the server as
  1707. // null. It is an error if a field in this list has a non-empty value.
  1708. // This may be used to include null fields in Patch requests.
  1709. NullFields []string `json:"-"`
  1710. }
  1711. func (s *TokenPagination) MarshalJSON() ([]byte, error) {
  1712. type NoMethod TokenPagination
  1713. raw := NoMethod(*s)
  1714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1715. }
  1716. type Track struct {
  1717. // Releases: A list of all active releases in this track during a read
  1718. // request. On an update request, it represents desired changes.
  1719. Releases []*TrackRelease `json:"releases,omitempty"`
  1720. // Track: Identifier for this track.
  1721. Track string `json:"track,omitempty"`
  1722. // ServerResponse contains the HTTP response code and headers from the
  1723. // server.
  1724. googleapi.ServerResponse `json:"-"`
  1725. // ForceSendFields is a list of field names (e.g. "Releases") to
  1726. // unconditionally include in API requests. By default, fields with
  1727. // empty values are omitted from API requests. However, any non-pointer,
  1728. // non-interface field appearing in ForceSendFields will be sent to the
  1729. // server regardless of whether the field is empty or not. This may be
  1730. // used to include empty fields in Patch requests.
  1731. ForceSendFields []string `json:"-"`
  1732. // NullFields is a list of field names (e.g. "Releases") to include in
  1733. // API requests with the JSON null value. By default, fields with empty
  1734. // values are omitted from API requests. However, any field with an
  1735. // empty value appearing in NullFields will be sent to the server as
  1736. // null. It is an error if a field in this list has a non-empty value.
  1737. // This may be used to include null fields in Patch requests.
  1738. NullFields []string `json:"-"`
  1739. }
  1740. func (s *Track) MarshalJSON() ([]byte, error) {
  1741. type NoMethod Track
  1742. raw := NoMethod(*s)
  1743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1744. }
  1745. type TrackRelease struct {
  1746. // Name: The release name, used to identify this release in the Play
  1747. // Console UI. Not required to be unique. This is optional, if not set
  1748. // it will be generated from the version_name in the APKs.
  1749. Name string `json:"name,omitempty"`
  1750. // ReleaseNotes: The description of what is new in the app in this
  1751. // release.
  1752. ReleaseNotes []*LocalizedText `json:"releaseNotes,omitempty"`
  1753. // Status: The desired status of this release.
  1754. Status string `json:"status,omitempty"`
  1755. // UserFraction: Fraction of users who are eligible to receive the
  1756. // release. 0 < fraction < 1. To be set, release status must be
  1757. // "inProgress" or "halted".
  1758. UserFraction float64 `json:"userFraction,omitempty"`
  1759. // VersionCodes: A list of all version codes of APKs that will be
  1760. // exposed to the users of this track when this release is rolled out.
  1761. // Note that this list should contain all versions you wish to be
  1762. // active, including those you wish to retain from previous releases.
  1763. VersionCodes googleapi.Int64s `json:"versionCodes,omitempty"`
  1764. // ForceSendFields is a list of field names (e.g. "Name") to
  1765. // unconditionally include in API requests. By default, fields with
  1766. // empty values are omitted from API requests. However, any non-pointer,
  1767. // non-interface field appearing in ForceSendFields will be sent to the
  1768. // server regardless of whether the field is empty or not. This may be
  1769. // used to include empty fields in Patch requests.
  1770. ForceSendFields []string `json:"-"`
  1771. // NullFields is a list of field names (e.g. "Name") to include in API
  1772. // requests with the JSON null value. By default, fields with empty
  1773. // values are omitted from API requests. However, any field with an
  1774. // empty value appearing in NullFields will be sent to the server as
  1775. // null. It is an error if a field in this list has a non-empty value.
  1776. // This may be used to include null fields in Patch requests.
  1777. NullFields []string `json:"-"`
  1778. }
  1779. func (s *TrackRelease) MarshalJSON() ([]byte, error) {
  1780. type NoMethod TrackRelease
  1781. raw := NoMethod(*s)
  1782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1783. }
  1784. func (s *TrackRelease) UnmarshalJSON(data []byte) error {
  1785. type NoMethod TrackRelease
  1786. var s1 struct {
  1787. UserFraction gensupport.JSONFloat64 `json:"userFraction"`
  1788. *NoMethod
  1789. }
  1790. s1.NoMethod = (*NoMethod)(s)
  1791. if err := json.Unmarshal(data, &s1); err != nil {
  1792. return err
  1793. }
  1794. s.UserFraction = float64(s1.UserFraction)
  1795. return nil
  1796. }
  1797. type TracksListResponse struct {
  1798. // Kind: Identifies what kind of resource this is. Value: the fixed
  1799. // string "androidpublisher#tracksListResponse".
  1800. Kind string `json:"kind,omitempty"`
  1801. Tracks []*Track `json:"tracks,omitempty"`
  1802. // ServerResponse contains the HTTP response code and headers from the
  1803. // server.
  1804. googleapi.ServerResponse `json:"-"`
  1805. // ForceSendFields is a list of field names (e.g. "Kind") to
  1806. // unconditionally include in API requests. By default, fields with
  1807. // empty values are omitted from API requests. However, any non-pointer,
  1808. // non-interface field appearing in ForceSendFields will be sent to the
  1809. // server regardless of whether the field is empty or not. This may be
  1810. // used to include empty fields in Patch requests.
  1811. ForceSendFields []string `json:"-"`
  1812. // NullFields is a list of field names (e.g. "Kind") to include in API
  1813. // requests with the JSON null value. By default, fields with empty
  1814. // values are omitted from API requests. However, any field with an
  1815. // empty value appearing in NullFields will be sent to the server as
  1816. // null. It is an error if a field in this list has a non-empty value.
  1817. // This may be used to include null fields in Patch requests.
  1818. NullFields []string `json:"-"`
  1819. }
  1820. func (s *TracksListResponse) MarshalJSON() ([]byte, error) {
  1821. type NoMethod TracksListResponse
  1822. raw := NoMethod(*s)
  1823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1824. }
  1825. type UserComment struct {
  1826. // AndroidOsVersion: Integer Android SDK version of the user's device at
  1827. // the time the review was written, e.g. 23 is Marshmallow. May be
  1828. // absent.
  1829. AndroidOsVersion int64 `json:"androidOsVersion,omitempty"`
  1830. // AppVersionCode: Integer version code of the app as installed at the
  1831. // time the review was written. May be absent.
  1832. AppVersionCode int64 `json:"appVersionCode,omitempty"`
  1833. // AppVersionName: String version name of the app as installed at the
  1834. // time the review was written. May be absent.
  1835. AppVersionName string `json:"appVersionName,omitempty"`
  1836. // Device: Codename for the reviewer's device, e.g. klte, flounder. May
  1837. // be absent.
  1838. Device string `json:"device,omitempty"`
  1839. // DeviceMetadata: Some information about the characteristics of the
  1840. // user's device
  1841. DeviceMetadata *DeviceMetadata `json:"deviceMetadata,omitempty"`
  1842. // LastModified: The last time at which this comment was updated.
  1843. LastModified *Timestamp `json:"lastModified,omitempty"`
  1844. // OriginalText: Untranslated text of the review, in the case where the
  1845. // review has been translated. If the review has not been translated
  1846. // this is left blank.
  1847. OriginalText string `json:"originalText,omitempty"`
  1848. // ReviewerLanguage: Language code for the reviewer. This is taken from
  1849. // the device settings so is not guaranteed to match the language the
  1850. // review is written in. May be absent.
  1851. ReviewerLanguage string `json:"reviewerLanguage,omitempty"`
  1852. // StarRating: The star rating associated with the review, from 1 to 5.
  1853. StarRating int64 `json:"starRating,omitempty"`
  1854. // Text: The content of the comment, i.e. review body. In some cases
  1855. // users have been able to write a review with separate title and body;
  1856. // in those cases the title and body are concatenated and separated by a
  1857. // tab character.
  1858. Text string `json:"text,omitempty"`
  1859. // ThumbsDownCount: Number of users who have given this review a thumbs
  1860. // down
  1861. ThumbsDownCount int64 `json:"thumbsDownCount,omitempty"`
  1862. // ThumbsUpCount: Number of users who have given this review a thumbs up
  1863. ThumbsUpCount int64 `json:"thumbsUpCount,omitempty"`
  1864. // ForceSendFields is a list of field names (e.g. "AndroidOsVersion") to
  1865. // unconditionally include in API requests. By default, fields with
  1866. // empty values are omitted from API requests. However, any non-pointer,
  1867. // non-interface field appearing in ForceSendFields will be sent to the
  1868. // server regardless of whether the field is empty or not. This may be
  1869. // used to include empty fields in Patch requests.
  1870. ForceSendFields []string `json:"-"`
  1871. // NullFields is a list of field names (e.g. "AndroidOsVersion") to
  1872. // include in API requests with the JSON null value. By default, fields
  1873. // with empty values are omitted from API requests. However, any field
  1874. // with an empty value appearing in NullFields will be sent to the
  1875. // server as null. It is an error if a field in this list has a
  1876. // non-empty value. This may be used to include null fields in Patch
  1877. // requests.
  1878. NullFields []string `json:"-"`
  1879. }
  1880. func (s *UserComment) MarshalJSON() ([]byte, error) {
  1881. type NoMethod UserComment
  1882. raw := NoMethod(*s)
  1883. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1884. }
  1885. // VoidedPurchase: A VoidedPurchase resource indicates a purchase that
  1886. // was either canceled/refunded/charged-back.
  1887. type VoidedPurchase struct {
  1888. // Kind: This kind represents a voided purchase object in the
  1889. // androidpublisher service.
  1890. Kind string `json:"kind,omitempty"`
  1891. // PurchaseTimeMillis: The time at which the purchase was made, in
  1892. // milliseconds since the epoch (Jan 1, 1970).
  1893. PurchaseTimeMillis int64 `json:"purchaseTimeMillis,omitempty,string"`
  1894. // PurchaseToken: The token that was generated when a purchase was made.
  1895. // This uniquely identifies a purchase.
  1896. PurchaseToken string `json:"purchaseToken,omitempty"`
  1897. // VoidedTimeMillis: The time at which the purchase was
  1898. // canceled/refunded/charged-back, in milliseconds since the epoch (Jan
  1899. // 1, 1970).
  1900. VoidedTimeMillis int64 `json:"voidedTimeMillis,omitempty,string"`
  1901. // ForceSendFields is a list of field names (e.g. "Kind") to
  1902. // unconditionally include in API requests. By default, fields with
  1903. // empty values are omitted from API requests. However, any non-pointer,
  1904. // non-interface field appearing in ForceSendFields will be sent to the
  1905. // server regardless of whether the field is empty or not. This may be
  1906. // used to include empty fields in Patch requests.
  1907. ForceSendFields []string `json:"-"`
  1908. // NullFields is a list of field names (e.g. "Kind") to include in API
  1909. // requests with the JSON null value. By default, fields with empty
  1910. // values are omitted from API requests. However, any field with an
  1911. // empty value appearing in NullFields will be sent to the server as
  1912. // null. It is an error if a field in this list has a non-empty value.
  1913. // This may be used to include null fields in Patch requests.
  1914. NullFields []string `json:"-"`
  1915. }
  1916. func (s *VoidedPurchase) MarshalJSON() ([]byte, error) {
  1917. type NoMethod VoidedPurchase
  1918. raw := NoMethod(*s)
  1919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1920. }
  1921. type VoidedPurchasesListResponse struct {
  1922. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1923. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1924. VoidedPurchases []*VoidedPurchase `json:"voidedPurchases,omitempty"`
  1925. // ServerResponse contains the HTTP response code and headers from the
  1926. // server.
  1927. googleapi.ServerResponse `json:"-"`
  1928. // ForceSendFields is a list of field names (e.g. "PageInfo") to
  1929. // unconditionally include in API requests. By default, fields with
  1930. // empty values are omitted from API requests. However, any non-pointer,
  1931. // non-interface field appearing in ForceSendFields will be sent to the
  1932. // server regardless of whether the field is empty or not. This may be
  1933. // used to include empty fields in Patch requests.
  1934. ForceSendFields []string `json:"-"`
  1935. // NullFields is a list of field names (e.g. "PageInfo") to include in
  1936. // API requests with the JSON null value. By default, fields with empty
  1937. // values are omitted from API requests. However, any field with an
  1938. // empty value appearing in NullFields will be sent to the server as
  1939. // null. It is an error if a field in this list has a non-empty value.
  1940. // This may be used to include null fields in Patch requests.
  1941. NullFields []string `json:"-"`
  1942. }
  1943. func (s *VoidedPurchasesListResponse) MarshalJSON() ([]byte, error) {
  1944. type NoMethod VoidedPurchasesListResponse
  1945. raw := NoMethod(*s)
  1946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1947. }
  1948. // method id "androidpublisher.edits.commit":
  1949. type EditsCommitCall struct {
  1950. s *Service
  1951. packageNameid string
  1952. editId string
  1953. urlParams_ gensupport.URLParams
  1954. ctx_ context.Context
  1955. header_ http.Header
  1956. }
  1957. // Commit: Commits/applies the changes made in this edit back to the
  1958. // app.
  1959. func (r *EditsService) Commit(packageNameid string, editId string) *EditsCommitCall {
  1960. c := &EditsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1961. c.packageNameid = packageNameid
  1962. c.editId = editId
  1963. return c
  1964. }
  1965. // Fields allows partial responses to be retrieved. See
  1966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1967. // for more information.
  1968. func (c *EditsCommitCall) Fields(s ...googleapi.Field) *EditsCommitCall {
  1969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1970. return c
  1971. }
  1972. // Context sets the context to be used in this call's Do method. Any
  1973. // pending HTTP request will be aborted if the provided context is
  1974. // canceled.
  1975. func (c *EditsCommitCall) Context(ctx context.Context) *EditsCommitCall {
  1976. c.ctx_ = ctx
  1977. return c
  1978. }
  1979. // Header returns an http.Header that can be modified by the caller to
  1980. // add HTTP headers to the request.
  1981. func (c *EditsCommitCall) Header() http.Header {
  1982. if c.header_ == nil {
  1983. c.header_ = make(http.Header)
  1984. }
  1985. return c.header_
  1986. }
  1987. func (c *EditsCommitCall) doRequest(alt string) (*http.Response, error) {
  1988. reqHeaders := make(http.Header)
  1989. for k, v := range c.header_ {
  1990. reqHeaders[k] = v
  1991. }
  1992. reqHeaders.Set("User-Agent", c.s.userAgent())
  1993. var body io.Reader = nil
  1994. c.urlParams_.Set("alt", alt)
  1995. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:commit")
  1996. urls += "?" + c.urlParams_.Encode()
  1997. req, _ := http.NewRequest("POST", urls, body)
  1998. req.Header = reqHeaders
  1999. googleapi.Expand(req.URL, map[string]string{
  2000. "packageName": c.packageNameid,
  2001. "editId": c.editId,
  2002. })
  2003. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2004. }
  2005. // Do executes the "androidpublisher.edits.commit" call.
  2006. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2007. // code is an error. Response headers are in either
  2008. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2009. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2010. // check whether the returned error was because http.StatusNotModified
  2011. // was returned.
  2012. func (c *EditsCommitCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2013. gensupport.SetOptions(c.urlParams_, opts...)
  2014. res, err := c.doRequest("json")
  2015. if res != nil && res.StatusCode == http.StatusNotModified {
  2016. if res.Body != nil {
  2017. res.Body.Close()
  2018. }
  2019. return nil, &googleapi.Error{
  2020. Code: res.StatusCode,
  2021. Header: res.Header,
  2022. }
  2023. }
  2024. if err != nil {
  2025. return nil, err
  2026. }
  2027. defer googleapi.CloseBody(res)
  2028. if err := googleapi.CheckResponse(res); err != nil {
  2029. return nil, err
  2030. }
  2031. ret := &AppEdit{
  2032. ServerResponse: googleapi.ServerResponse{
  2033. Header: res.Header,
  2034. HTTPStatusCode: res.StatusCode,
  2035. },
  2036. }
  2037. target := &ret
  2038. if err := gensupport.DecodeResponse(target, res); err != nil {
  2039. return nil, err
  2040. }
  2041. return ret, nil
  2042. // {
  2043. // "description": "Commits/applies the changes made in this edit back to the app.",
  2044. // "httpMethod": "POST",
  2045. // "id": "androidpublisher.edits.commit",
  2046. // "parameterOrder": [
  2047. // "packageName",
  2048. // "editId"
  2049. // ],
  2050. // "parameters": {
  2051. // "editId": {
  2052. // "description": "Unique identifier for this edit.",
  2053. // "location": "path",
  2054. // "required": true,
  2055. // "type": "string"
  2056. // },
  2057. // "packageName": {
  2058. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2059. // "location": "path",
  2060. // "required": true,
  2061. // "type": "string"
  2062. // }
  2063. // },
  2064. // "path": "{packageName}/edits/{editId}:commit",
  2065. // "response": {
  2066. // "$ref": "AppEdit"
  2067. // },
  2068. // "scopes": [
  2069. // "https://www.googleapis.com/auth/androidpublisher"
  2070. // ]
  2071. // }
  2072. }
  2073. // method id "androidpublisher.edits.delete":
  2074. type EditsDeleteCall struct {
  2075. s *Service
  2076. packageNameid string
  2077. editId string
  2078. urlParams_ gensupport.URLParams
  2079. ctx_ context.Context
  2080. header_ http.Header
  2081. }
  2082. // Delete: Deletes an edit for an app. Creating a new edit will
  2083. // automatically delete any of your previous edits so this method need
  2084. // only be called if you want to preemptively abandon an edit.
  2085. func (r *EditsService) Delete(packageNameid string, editId string) *EditsDeleteCall {
  2086. c := &EditsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2087. c.packageNameid = packageNameid
  2088. c.editId = editId
  2089. return c
  2090. }
  2091. // Fields allows partial responses to be retrieved. See
  2092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2093. // for more information.
  2094. func (c *EditsDeleteCall) Fields(s ...googleapi.Field) *EditsDeleteCall {
  2095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2096. return c
  2097. }
  2098. // Context sets the context to be used in this call's Do method. Any
  2099. // pending HTTP request will be aborted if the provided context is
  2100. // canceled.
  2101. func (c *EditsDeleteCall) Context(ctx context.Context) *EditsDeleteCall {
  2102. c.ctx_ = ctx
  2103. return c
  2104. }
  2105. // Header returns an http.Header that can be modified by the caller to
  2106. // add HTTP headers to the request.
  2107. func (c *EditsDeleteCall) Header() http.Header {
  2108. if c.header_ == nil {
  2109. c.header_ = make(http.Header)
  2110. }
  2111. return c.header_
  2112. }
  2113. func (c *EditsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2114. reqHeaders := make(http.Header)
  2115. for k, v := range c.header_ {
  2116. reqHeaders[k] = v
  2117. }
  2118. reqHeaders.Set("User-Agent", c.s.userAgent())
  2119. var body io.Reader = nil
  2120. c.urlParams_.Set("alt", alt)
  2121. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2122. urls += "?" + c.urlParams_.Encode()
  2123. req, _ := http.NewRequest("DELETE", urls, body)
  2124. req.Header = reqHeaders
  2125. googleapi.Expand(req.URL, map[string]string{
  2126. "packageName": c.packageNameid,
  2127. "editId": c.editId,
  2128. })
  2129. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2130. }
  2131. // Do executes the "androidpublisher.edits.delete" call.
  2132. func (c *EditsDeleteCall) Do(opts ...googleapi.CallOption) error {
  2133. gensupport.SetOptions(c.urlParams_, opts...)
  2134. res, err := c.doRequest("json")
  2135. if err != nil {
  2136. return err
  2137. }
  2138. defer googleapi.CloseBody(res)
  2139. if err := googleapi.CheckResponse(res); err != nil {
  2140. return err
  2141. }
  2142. return nil
  2143. // {
  2144. // "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.",
  2145. // "httpMethod": "DELETE",
  2146. // "id": "androidpublisher.edits.delete",
  2147. // "parameterOrder": [
  2148. // "packageName",
  2149. // "editId"
  2150. // ],
  2151. // "parameters": {
  2152. // "editId": {
  2153. // "description": "Unique identifier for this edit.",
  2154. // "location": "path",
  2155. // "required": true,
  2156. // "type": "string"
  2157. // },
  2158. // "packageName": {
  2159. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2160. // "location": "path",
  2161. // "required": true,
  2162. // "type": "string"
  2163. // }
  2164. // },
  2165. // "path": "{packageName}/edits/{editId}",
  2166. // "scopes": [
  2167. // "https://www.googleapis.com/auth/androidpublisher"
  2168. // ]
  2169. // }
  2170. }
  2171. // method id "androidpublisher.edits.get":
  2172. type EditsGetCall struct {
  2173. s *Service
  2174. packageNameid string
  2175. editId string
  2176. urlParams_ gensupport.URLParams
  2177. ifNoneMatch_ string
  2178. ctx_ context.Context
  2179. header_ http.Header
  2180. }
  2181. // Get: Returns information about the edit specified. Calls will fail if
  2182. // the edit is no long active (e.g. has been deleted, superseded or
  2183. // expired).
  2184. func (r *EditsService) Get(packageNameid string, editId string) *EditsGetCall {
  2185. c := &EditsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2186. c.packageNameid = packageNameid
  2187. c.editId = editId
  2188. return c
  2189. }
  2190. // Fields allows partial responses to be retrieved. See
  2191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2192. // for more information.
  2193. func (c *EditsGetCall) Fields(s ...googleapi.Field) *EditsGetCall {
  2194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2195. return c
  2196. }
  2197. // IfNoneMatch sets the optional parameter which makes the operation
  2198. // fail if the object's ETag matches the given value. This is useful for
  2199. // getting updates only after the object has changed since the last
  2200. // request. Use googleapi.IsNotModified to check whether the response
  2201. // error from Do is the result of In-None-Match.
  2202. func (c *EditsGetCall) IfNoneMatch(entityTag string) *EditsGetCall {
  2203. c.ifNoneMatch_ = entityTag
  2204. return c
  2205. }
  2206. // Context sets the context to be used in this call's Do method. Any
  2207. // pending HTTP request will be aborted if the provided context is
  2208. // canceled.
  2209. func (c *EditsGetCall) Context(ctx context.Context) *EditsGetCall {
  2210. c.ctx_ = ctx
  2211. return c
  2212. }
  2213. // Header returns an http.Header that can be modified by the caller to
  2214. // add HTTP headers to the request.
  2215. func (c *EditsGetCall) Header() http.Header {
  2216. if c.header_ == nil {
  2217. c.header_ = make(http.Header)
  2218. }
  2219. return c.header_
  2220. }
  2221. func (c *EditsGetCall) doRequest(alt string) (*http.Response, error) {
  2222. reqHeaders := make(http.Header)
  2223. for k, v := range c.header_ {
  2224. reqHeaders[k] = v
  2225. }
  2226. reqHeaders.Set("User-Agent", c.s.userAgent())
  2227. if c.ifNoneMatch_ != "" {
  2228. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2229. }
  2230. var body io.Reader = nil
  2231. c.urlParams_.Set("alt", alt)
  2232. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}")
  2233. urls += "?" + c.urlParams_.Encode()
  2234. req, _ := http.NewRequest("GET", urls, body)
  2235. req.Header = reqHeaders
  2236. googleapi.Expand(req.URL, map[string]string{
  2237. "packageName": c.packageNameid,
  2238. "editId": c.editId,
  2239. })
  2240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2241. }
  2242. // Do executes the "androidpublisher.edits.get" call.
  2243. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2244. // code is an error. Response headers are in either
  2245. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2246. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2247. // check whether the returned error was because http.StatusNotModified
  2248. // was returned.
  2249. func (c *EditsGetCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2250. gensupport.SetOptions(c.urlParams_, opts...)
  2251. res, err := c.doRequest("json")
  2252. if res != nil && res.StatusCode == http.StatusNotModified {
  2253. if res.Body != nil {
  2254. res.Body.Close()
  2255. }
  2256. return nil, &googleapi.Error{
  2257. Code: res.StatusCode,
  2258. Header: res.Header,
  2259. }
  2260. }
  2261. if err != nil {
  2262. return nil, err
  2263. }
  2264. defer googleapi.CloseBody(res)
  2265. if err := googleapi.CheckResponse(res); err != nil {
  2266. return nil, err
  2267. }
  2268. ret := &AppEdit{
  2269. ServerResponse: googleapi.ServerResponse{
  2270. Header: res.Header,
  2271. HTTPStatusCode: res.StatusCode,
  2272. },
  2273. }
  2274. target := &ret
  2275. if err := gensupport.DecodeResponse(target, res); err != nil {
  2276. return nil, err
  2277. }
  2278. return ret, nil
  2279. // {
  2280. // "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).",
  2281. // "httpMethod": "GET",
  2282. // "id": "androidpublisher.edits.get",
  2283. // "parameterOrder": [
  2284. // "packageName",
  2285. // "editId"
  2286. // ],
  2287. // "parameters": {
  2288. // "editId": {
  2289. // "description": "Unique identifier for this edit.",
  2290. // "location": "path",
  2291. // "required": true,
  2292. // "type": "string"
  2293. // },
  2294. // "packageName": {
  2295. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2296. // "location": "path",
  2297. // "required": true,
  2298. // "type": "string"
  2299. // }
  2300. // },
  2301. // "path": "{packageName}/edits/{editId}",
  2302. // "response": {
  2303. // "$ref": "AppEdit"
  2304. // },
  2305. // "scopes": [
  2306. // "https://www.googleapis.com/auth/androidpublisher"
  2307. // ]
  2308. // }
  2309. }
  2310. // method id "androidpublisher.edits.insert":
  2311. type EditsInsertCall struct {
  2312. s *Service
  2313. packageNameid string
  2314. appedit *AppEdit
  2315. urlParams_ gensupport.URLParams
  2316. ctx_ context.Context
  2317. header_ http.Header
  2318. }
  2319. // Insert: Creates a new edit for an app, populated with the app's
  2320. // current state.
  2321. func (r *EditsService) Insert(packageNameid string, appedit *AppEdit) *EditsInsertCall {
  2322. c := &EditsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2323. c.packageNameid = packageNameid
  2324. c.appedit = appedit
  2325. return c
  2326. }
  2327. // Fields allows partial responses to be retrieved. See
  2328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2329. // for more information.
  2330. func (c *EditsInsertCall) Fields(s ...googleapi.Field) *EditsInsertCall {
  2331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2332. return c
  2333. }
  2334. // Context sets the context to be used in this call's Do method. Any
  2335. // pending HTTP request will be aborted if the provided context is
  2336. // canceled.
  2337. func (c *EditsInsertCall) Context(ctx context.Context) *EditsInsertCall {
  2338. c.ctx_ = ctx
  2339. return c
  2340. }
  2341. // Header returns an http.Header that can be modified by the caller to
  2342. // add HTTP headers to the request.
  2343. func (c *EditsInsertCall) Header() http.Header {
  2344. if c.header_ == nil {
  2345. c.header_ = make(http.Header)
  2346. }
  2347. return c.header_
  2348. }
  2349. func (c *EditsInsertCall) doRequest(alt string) (*http.Response, error) {
  2350. reqHeaders := make(http.Header)
  2351. for k, v := range c.header_ {
  2352. reqHeaders[k] = v
  2353. }
  2354. reqHeaders.Set("User-Agent", c.s.userAgent())
  2355. var body io.Reader = nil
  2356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appedit)
  2357. if err != nil {
  2358. return nil, err
  2359. }
  2360. reqHeaders.Set("Content-Type", "application/json")
  2361. c.urlParams_.Set("alt", alt)
  2362. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits")
  2363. urls += "?" + c.urlParams_.Encode()
  2364. req, _ := http.NewRequest("POST", urls, body)
  2365. req.Header = reqHeaders
  2366. googleapi.Expand(req.URL, map[string]string{
  2367. "packageName": c.packageNameid,
  2368. })
  2369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2370. }
  2371. // Do executes the "androidpublisher.edits.insert" call.
  2372. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2373. // code is an error. Response headers are in either
  2374. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2375. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2376. // check whether the returned error was because http.StatusNotModified
  2377. // was returned.
  2378. func (c *EditsInsertCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2379. gensupport.SetOptions(c.urlParams_, opts...)
  2380. res, err := c.doRequest("json")
  2381. if res != nil && res.StatusCode == http.StatusNotModified {
  2382. if res.Body != nil {
  2383. res.Body.Close()
  2384. }
  2385. return nil, &googleapi.Error{
  2386. Code: res.StatusCode,
  2387. Header: res.Header,
  2388. }
  2389. }
  2390. if err != nil {
  2391. return nil, err
  2392. }
  2393. defer googleapi.CloseBody(res)
  2394. if err := googleapi.CheckResponse(res); err != nil {
  2395. return nil, err
  2396. }
  2397. ret := &AppEdit{
  2398. ServerResponse: googleapi.ServerResponse{
  2399. Header: res.Header,
  2400. HTTPStatusCode: res.StatusCode,
  2401. },
  2402. }
  2403. target := &ret
  2404. if err := gensupport.DecodeResponse(target, res); err != nil {
  2405. return nil, err
  2406. }
  2407. return ret, nil
  2408. // {
  2409. // "description": "Creates a new edit for an app, populated with the app's current state.",
  2410. // "httpMethod": "POST",
  2411. // "id": "androidpublisher.edits.insert",
  2412. // "parameterOrder": [
  2413. // "packageName"
  2414. // ],
  2415. // "parameters": {
  2416. // "packageName": {
  2417. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2418. // "location": "path",
  2419. // "required": true,
  2420. // "type": "string"
  2421. // }
  2422. // },
  2423. // "path": "{packageName}/edits",
  2424. // "request": {
  2425. // "$ref": "AppEdit"
  2426. // },
  2427. // "response": {
  2428. // "$ref": "AppEdit"
  2429. // },
  2430. // "scopes": [
  2431. // "https://www.googleapis.com/auth/androidpublisher"
  2432. // ]
  2433. // }
  2434. }
  2435. // method id "androidpublisher.edits.validate":
  2436. type EditsValidateCall struct {
  2437. s *Service
  2438. packageNameid string
  2439. editId string
  2440. urlParams_ gensupport.URLParams
  2441. ctx_ context.Context
  2442. header_ http.Header
  2443. }
  2444. // Validate: Checks that the edit can be successfully committed. The
  2445. // edit's changes are not applied to the live app.
  2446. func (r *EditsService) Validate(packageNameid string, editId string) *EditsValidateCall {
  2447. c := &EditsValidateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2448. c.packageNameid = packageNameid
  2449. c.editId = editId
  2450. return c
  2451. }
  2452. // Fields allows partial responses to be retrieved. See
  2453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2454. // for more information.
  2455. func (c *EditsValidateCall) Fields(s ...googleapi.Field) *EditsValidateCall {
  2456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2457. return c
  2458. }
  2459. // Context sets the context to be used in this call's Do method. Any
  2460. // pending HTTP request will be aborted if the provided context is
  2461. // canceled.
  2462. func (c *EditsValidateCall) Context(ctx context.Context) *EditsValidateCall {
  2463. c.ctx_ = ctx
  2464. return c
  2465. }
  2466. // Header returns an http.Header that can be modified by the caller to
  2467. // add HTTP headers to the request.
  2468. func (c *EditsValidateCall) Header() http.Header {
  2469. if c.header_ == nil {
  2470. c.header_ = make(http.Header)
  2471. }
  2472. return c.header_
  2473. }
  2474. func (c *EditsValidateCall) doRequest(alt string) (*http.Response, error) {
  2475. reqHeaders := make(http.Header)
  2476. for k, v := range c.header_ {
  2477. reqHeaders[k] = v
  2478. }
  2479. reqHeaders.Set("User-Agent", c.s.userAgent())
  2480. var body io.Reader = nil
  2481. c.urlParams_.Set("alt", alt)
  2482. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}:validate")
  2483. urls += "?" + c.urlParams_.Encode()
  2484. req, _ := http.NewRequest("POST", urls, body)
  2485. req.Header = reqHeaders
  2486. googleapi.Expand(req.URL, map[string]string{
  2487. "packageName": c.packageNameid,
  2488. "editId": c.editId,
  2489. })
  2490. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2491. }
  2492. // Do executes the "androidpublisher.edits.validate" call.
  2493. // Exactly one of *AppEdit or error will be non-nil. Any non-2xx status
  2494. // code is an error. Response headers are in either
  2495. // *AppEdit.ServerResponse.Header or (if a response was returned at all)
  2496. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2497. // check whether the returned error was because http.StatusNotModified
  2498. // was returned.
  2499. func (c *EditsValidateCall) Do(opts ...googleapi.CallOption) (*AppEdit, error) {
  2500. gensupport.SetOptions(c.urlParams_, opts...)
  2501. res, err := c.doRequest("json")
  2502. if res != nil && res.StatusCode == http.StatusNotModified {
  2503. if res.Body != nil {
  2504. res.Body.Close()
  2505. }
  2506. return nil, &googleapi.Error{
  2507. Code: res.StatusCode,
  2508. Header: res.Header,
  2509. }
  2510. }
  2511. if err != nil {
  2512. return nil, err
  2513. }
  2514. defer googleapi.CloseBody(res)
  2515. if err := googleapi.CheckResponse(res); err != nil {
  2516. return nil, err
  2517. }
  2518. ret := &AppEdit{
  2519. ServerResponse: googleapi.ServerResponse{
  2520. Header: res.Header,
  2521. HTTPStatusCode: res.StatusCode,
  2522. },
  2523. }
  2524. target := &ret
  2525. if err := gensupport.DecodeResponse(target, res); err != nil {
  2526. return nil, err
  2527. }
  2528. return ret, nil
  2529. // {
  2530. // "description": "Checks that the edit can be successfully committed. The edit's changes are not applied to the live app.",
  2531. // "httpMethod": "POST",
  2532. // "id": "androidpublisher.edits.validate",
  2533. // "parameterOrder": [
  2534. // "packageName",
  2535. // "editId"
  2536. // ],
  2537. // "parameters": {
  2538. // "editId": {
  2539. // "description": "Unique identifier for this edit.",
  2540. // "location": "path",
  2541. // "required": true,
  2542. // "type": "string"
  2543. // },
  2544. // "packageName": {
  2545. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2546. // "location": "path",
  2547. // "required": true,
  2548. // "type": "string"
  2549. // }
  2550. // },
  2551. // "path": "{packageName}/edits/{editId}:validate",
  2552. // "response": {
  2553. // "$ref": "AppEdit"
  2554. // },
  2555. // "scopes": [
  2556. // "https://www.googleapis.com/auth/androidpublisher"
  2557. // ]
  2558. // }
  2559. }
  2560. // method id "androidpublisher.edits.apks.addexternallyhosted":
  2561. type EditsApksAddexternallyhostedCall struct {
  2562. s *Service
  2563. packageNameid string
  2564. editId string
  2565. apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest
  2566. urlParams_ gensupport.URLParams
  2567. ctx_ context.Context
  2568. header_ http.Header
  2569. }
  2570. // Addexternallyhosted: Creates a new APK without uploading the APK
  2571. // itself to Google Play, instead hosting the APK at a specified URL.
  2572. // This function is only available to enterprises using Google Play for
  2573. // Work whose application is configured to restrict distribution to the
  2574. // enterprise domain.
  2575. func (r *EditsApksService) Addexternallyhosted(packageNameid string, editId string, apksaddexternallyhostedrequest *ApksAddExternallyHostedRequest) *EditsApksAddexternallyhostedCall {
  2576. c := &EditsApksAddexternallyhostedCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2577. c.packageNameid = packageNameid
  2578. c.editId = editId
  2579. c.apksaddexternallyhostedrequest = apksaddexternallyhostedrequest
  2580. return c
  2581. }
  2582. // Fields allows partial responses to be retrieved. See
  2583. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2584. // for more information.
  2585. func (c *EditsApksAddexternallyhostedCall) Fields(s ...googleapi.Field) *EditsApksAddexternallyhostedCall {
  2586. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2587. return c
  2588. }
  2589. // Context sets the context to be used in this call's Do method. Any
  2590. // pending HTTP request will be aborted if the provided context is
  2591. // canceled.
  2592. func (c *EditsApksAddexternallyhostedCall) Context(ctx context.Context) *EditsApksAddexternallyhostedCall {
  2593. c.ctx_ = ctx
  2594. return c
  2595. }
  2596. // Header returns an http.Header that can be modified by the caller to
  2597. // add HTTP headers to the request.
  2598. func (c *EditsApksAddexternallyhostedCall) Header() http.Header {
  2599. if c.header_ == nil {
  2600. c.header_ = make(http.Header)
  2601. }
  2602. return c.header_
  2603. }
  2604. func (c *EditsApksAddexternallyhostedCall) doRequest(alt string) (*http.Response, error) {
  2605. reqHeaders := make(http.Header)
  2606. for k, v := range c.header_ {
  2607. reqHeaders[k] = v
  2608. }
  2609. reqHeaders.Set("User-Agent", c.s.userAgent())
  2610. var body io.Reader = nil
  2611. body, err := googleapi.WithoutDataWrapper.JSONReader(c.apksaddexternallyhostedrequest)
  2612. if err != nil {
  2613. return nil, err
  2614. }
  2615. reqHeaders.Set("Content-Type", "application/json")
  2616. c.urlParams_.Set("alt", alt)
  2617. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/externallyHosted")
  2618. urls += "?" + c.urlParams_.Encode()
  2619. req, _ := http.NewRequest("POST", urls, body)
  2620. req.Header = reqHeaders
  2621. googleapi.Expand(req.URL, map[string]string{
  2622. "packageName": c.packageNameid,
  2623. "editId": c.editId,
  2624. })
  2625. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2626. }
  2627. // Do executes the "androidpublisher.edits.apks.addexternallyhosted" call.
  2628. // Exactly one of *ApksAddExternallyHostedResponse or error will be
  2629. // non-nil. Any non-2xx status code is an error. Response headers are in
  2630. // either *ApksAddExternallyHostedResponse.ServerResponse.Header or (if
  2631. // a response was returned at all) in error.(*googleapi.Error).Header.
  2632. // Use googleapi.IsNotModified to check whether the returned error was
  2633. // because http.StatusNotModified was returned.
  2634. func (c *EditsApksAddexternallyhostedCall) Do(opts ...googleapi.CallOption) (*ApksAddExternallyHostedResponse, error) {
  2635. gensupport.SetOptions(c.urlParams_, opts...)
  2636. res, err := c.doRequest("json")
  2637. if res != nil && res.StatusCode == http.StatusNotModified {
  2638. if res.Body != nil {
  2639. res.Body.Close()
  2640. }
  2641. return nil, &googleapi.Error{
  2642. Code: res.StatusCode,
  2643. Header: res.Header,
  2644. }
  2645. }
  2646. if err != nil {
  2647. return nil, err
  2648. }
  2649. defer googleapi.CloseBody(res)
  2650. if err := googleapi.CheckResponse(res); err != nil {
  2651. return nil, err
  2652. }
  2653. ret := &ApksAddExternallyHostedResponse{
  2654. ServerResponse: googleapi.ServerResponse{
  2655. Header: res.Header,
  2656. HTTPStatusCode: res.StatusCode,
  2657. },
  2658. }
  2659. target := &ret
  2660. if err := gensupport.DecodeResponse(target, res); err != nil {
  2661. return nil, err
  2662. }
  2663. return ret, nil
  2664. // {
  2665. // "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.",
  2666. // "httpMethod": "POST",
  2667. // "id": "androidpublisher.edits.apks.addexternallyhosted",
  2668. // "parameterOrder": [
  2669. // "packageName",
  2670. // "editId"
  2671. // ],
  2672. // "parameters": {
  2673. // "editId": {
  2674. // "description": "Unique identifier for this edit.",
  2675. // "location": "path",
  2676. // "required": true,
  2677. // "type": "string"
  2678. // },
  2679. // "packageName": {
  2680. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2681. // "location": "path",
  2682. // "required": true,
  2683. // "type": "string"
  2684. // }
  2685. // },
  2686. // "path": "{packageName}/edits/{editId}/apks/externallyHosted",
  2687. // "request": {
  2688. // "$ref": "ApksAddExternallyHostedRequest"
  2689. // },
  2690. // "response": {
  2691. // "$ref": "ApksAddExternallyHostedResponse"
  2692. // },
  2693. // "scopes": [
  2694. // "https://www.googleapis.com/auth/androidpublisher"
  2695. // ]
  2696. // }
  2697. }
  2698. // method id "androidpublisher.edits.apks.list":
  2699. type EditsApksListCall struct {
  2700. s *Service
  2701. packageNameid string
  2702. editId string
  2703. urlParams_ gensupport.URLParams
  2704. ifNoneMatch_ string
  2705. ctx_ context.Context
  2706. header_ http.Header
  2707. }
  2708. // List:
  2709. func (r *EditsApksService) List(packageNameid string, editId string) *EditsApksListCall {
  2710. c := &EditsApksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2711. c.packageNameid = packageNameid
  2712. c.editId = editId
  2713. return c
  2714. }
  2715. // Fields allows partial responses to be retrieved. See
  2716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2717. // for more information.
  2718. func (c *EditsApksListCall) Fields(s ...googleapi.Field) *EditsApksListCall {
  2719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2720. return c
  2721. }
  2722. // IfNoneMatch sets the optional parameter which makes the operation
  2723. // fail if the object's ETag matches the given value. This is useful for
  2724. // getting updates only after the object has changed since the last
  2725. // request. Use googleapi.IsNotModified to check whether the response
  2726. // error from Do is the result of In-None-Match.
  2727. func (c *EditsApksListCall) IfNoneMatch(entityTag string) *EditsApksListCall {
  2728. c.ifNoneMatch_ = entityTag
  2729. return c
  2730. }
  2731. // Context sets the context to be used in this call's Do method. Any
  2732. // pending HTTP request will be aborted if the provided context is
  2733. // canceled.
  2734. func (c *EditsApksListCall) Context(ctx context.Context) *EditsApksListCall {
  2735. c.ctx_ = ctx
  2736. return c
  2737. }
  2738. // Header returns an http.Header that can be modified by the caller to
  2739. // add HTTP headers to the request.
  2740. func (c *EditsApksListCall) Header() http.Header {
  2741. if c.header_ == nil {
  2742. c.header_ = make(http.Header)
  2743. }
  2744. return c.header_
  2745. }
  2746. func (c *EditsApksListCall) doRequest(alt string) (*http.Response, error) {
  2747. reqHeaders := make(http.Header)
  2748. for k, v := range c.header_ {
  2749. reqHeaders[k] = v
  2750. }
  2751. reqHeaders.Set("User-Agent", c.s.userAgent())
  2752. if c.ifNoneMatch_ != "" {
  2753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2754. }
  2755. var body io.Reader = nil
  2756. c.urlParams_.Set("alt", alt)
  2757. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  2758. urls += "?" + c.urlParams_.Encode()
  2759. req, _ := http.NewRequest("GET", urls, body)
  2760. req.Header = reqHeaders
  2761. googleapi.Expand(req.URL, map[string]string{
  2762. "packageName": c.packageNameid,
  2763. "editId": c.editId,
  2764. })
  2765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2766. }
  2767. // Do executes the "androidpublisher.edits.apks.list" call.
  2768. // Exactly one of *ApksListResponse or error will be non-nil. Any
  2769. // non-2xx status code is an error. Response headers are in either
  2770. // *ApksListResponse.ServerResponse.Header or (if a response was
  2771. // returned at all) in error.(*googleapi.Error).Header. Use
  2772. // googleapi.IsNotModified to check whether the returned error was
  2773. // because http.StatusNotModified was returned.
  2774. func (c *EditsApksListCall) Do(opts ...googleapi.CallOption) (*ApksListResponse, error) {
  2775. gensupport.SetOptions(c.urlParams_, opts...)
  2776. res, err := c.doRequest("json")
  2777. if res != nil && res.StatusCode == http.StatusNotModified {
  2778. if res.Body != nil {
  2779. res.Body.Close()
  2780. }
  2781. return nil, &googleapi.Error{
  2782. Code: res.StatusCode,
  2783. Header: res.Header,
  2784. }
  2785. }
  2786. if err != nil {
  2787. return nil, err
  2788. }
  2789. defer googleapi.CloseBody(res)
  2790. if err := googleapi.CheckResponse(res); err != nil {
  2791. return nil, err
  2792. }
  2793. ret := &ApksListResponse{
  2794. ServerResponse: googleapi.ServerResponse{
  2795. Header: res.Header,
  2796. HTTPStatusCode: res.StatusCode,
  2797. },
  2798. }
  2799. target := &ret
  2800. if err := gensupport.DecodeResponse(target, res); err != nil {
  2801. return nil, err
  2802. }
  2803. return ret, nil
  2804. // {
  2805. // "httpMethod": "GET",
  2806. // "id": "androidpublisher.edits.apks.list",
  2807. // "parameterOrder": [
  2808. // "packageName",
  2809. // "editId"
  2810. // ],
  2811. // "parameters": {
  2812. // "editId": {
  2813. // "description": "Unique identifier for this edit.",
  2814. // "location": "path",
  2815. // "required": true,
  2816. // "type": "string"
  2817. // },
  2818. // "packageName": {
  2819. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  2820. // "location": "path",
  2821. // "required": true,
  2822. // "type": "string"
  2823. // }
  2824. // },
  2825. // "path": "{packageName}/edits/{editId}/apks",
  2826. // "response": {
  2827. // "$ref": "ApksListResponse"
  2828. // },
  2829. // "scopes": [
  2830. // "https://www.googleapis.com/auth/androidpublisher"
  2831. // ]
  2832. // }
  2833. }
  2834. // method id "androidpublisher.edits.apks.upload":
  2835. type EditsApksUploadCall struct {
  2836. s *Service
  2837. packageNameid string
  2838. editId string
  2839. urlParams_ gensupport.URLParams
  2840. mediaInfo_ *gensupport.MediaInfo
  2841. ctx_ context.Context
  2842. header_ http.Header
  2843. }
  2844. // Upload:
  2845. func (r *EditsApksService) Upload(packageNameid string, editId string) *EditsApksUploadCall {
  2846. c := &EditsApksUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2847. c.packageNameid = packageNameid
  2848. c.editId = editId
  2849. return c
  2850. }
  2851. // Media specifies the media to upload in one or more chunks. The chunk
  2852. // size may be controlled by supplying a MediaOption generated by
  2853. // googleapi.ChunkSize. The chunk size defaults to
  2854. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  2855. // upload request will be determined by sniffing the contents of r,
  2856. // unless a MediaOption generated by googleapi.ContentType is
  2857. // supplied.
  2858. // At most one of Media and ResumableMedia may be set.
  2859. func (c *EditsApksUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsApksUploadCall {
  2860. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  2861. return c
  2862. }
  2863. // ResumableMedia specifies the media to upload in chunks and can be
  2864. // canceled with ctx.
  2865. //
  2866. // Deprecated: use Media instead.
  2867. //
  2868. // At most one of Media and ResumableMedia may be set. mediaType
  2869. // identifies the MIME media type of the upload, such as "image/png". If
  2870. // mediaType is "", it will be auto-detected. The provided ctx will
  2871. // supersede any context previously provided to the Context method.
  2872. func (c *EditsApksUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsApksUploadCall {
  2873. c.ctx_ = ctx
  2874. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  2875. return c
  2876. }
  2877. // ProgressUpdater provides a callback function that will be called
  2878. // after every chunk. It should be a low-latency function in order to
  2879. // not slow down the upload operation. This should only be called when
  2880. // using ResumableMedia (as opposed to Media).
  2881. func (c *EditsApksUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsApksUploadCall {
  2882. c.mediaInfo_.SetProgressUpdater(pu)
  2883. return c
  2884. }
  2885. // Fields allows partial responses to be retrieved. See
  2886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2887. // for more information.
  2888. func (c *EditsApksUploadCall) Fields(s ...googleapi.Field) *EditsApksUploadCall {
  2889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2890. return c
  2891. }
  2892. // Context sets the context to be used in this call's Do method. Any
  2893. // pending HTTP request will be aborted if the provided context is
  2894. // canceled.
  2895. // This context will supersede any context previously provided to the
  2896. // ResumableMedia method.
  2897. func (c *EditsApksUploadCall) Context(ctx context.Context) *EditsApksUploadCall {
  2898. c.ctx_ = ctx
  2899. return c
  2900. }
  2901. // Header returns an http.Header that can be modified by the caller to
  2902. // add HTTP headers to the request.
  2903. func (c *EditsApksUploadCall) Header() http.Header {
  2904. if c.header_ == nil {
  2905. c.header_ = make(http.Header)
  2906. }
  2907. return c.header_
  2908. }
  2909. func (c *EditsApksUploadCall) doRequest(alt string) (*http.Response, error) {
  2910. reqHeaders := make(http.Header)
  2911. for k, v := range c.header_ {
  2912. reqHeaders[k] = v
  2913. }
  2914. reqHeaders.Set("User-Agent", c.s.userAgent())
  2915. var body io.Reader = nil
  2916. c.urlParams_.Set("alt", alt)
  2917. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks")
  2918. if c.mediaInfo_ != nil {
  2919. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  2920. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  2921. }
  2922. if body == nil {
  2923. body = new(bytes.Buffer)
  2924. reqHeaders.Set("Content-Type", "application/json")
  2925. }
  2926. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  2927. defer cleanup()
  2928. urls += "?" + c.urlParams_.Encode()
  2929. req, _ := http.NewRequest("POST", urls, body)
  2930. req.Header = reqHeaders
  2931. gensupport.SetGetBody(req, getBody)
  2932. googleapi.Expand(req.URL, map[string]string{
  2933. "packageName": c.packageNameid,
  2934. "editId": c.editId,
  2935. })
  2936. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2937. }
  2938. // Do executes the "androidpublisher.edits.apks.upload" call.
  2939. // Exactly one of *Apk or error will be non-nil. Any non-2xx status code
  2940. // is an error. Response headers are in either
  2941. // *Apk.ServerResponse.Header or (if a response was returned at all) in
  2942. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2943. // whether the returned error was because http.StatusNotModified was
  2944. // returned.
  2945. func (c *EditsApksUploadCall) Do(opts ...googleapi.CallOption) (*Apk, error) {
  2946. gensupport.SetOptions(c.urlParams_, opts...)
  2947. res, err := c.doRequest("json")
  2948. if res != nil && res.StatusCode == http.StatusNotModified {
  2949. if res.Body != nil {
  2950. res.Body.Close()
  2951. }
  2952. return nil, &googleapi.Error{
  2953. Code: res.StatusCode,
  2954. Header: res.Header,
  2955. }
  2956. }
  2957. if err != nil {
  2958. return nil, err
  2959. }
  2960. defer googleapi.CloseBody(res)
  2961. if err := googleapi.CheckResponse(res); err != nil {
  2962. return nil, err
  2963. }
  2964. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  2965. if rx != nil {
  2966. rx.Client = c.s.client
  2967. rx.UserAgent = c.s.userAgent()
  2968. ctx := c.ctx_
  2969. if ctx == nil {
  2970. ctx = context.TODO()
  2971. }
  2972. res, err = rx.Upload(ctx)
  2973. if err != nil {
  2974. return nil, err
  2975. }
  2976. defer res.Body.Close()
  2977. if err := googleapi.CheckResponse(res); err != nil {
  2978. return nil, err
  2979. }
  2980. }
  2981. ret := &Apk{
  2982. ServerResponse: googleapi.ServerResponse{
  2983. Header: res.Header,
  2984. HTTPStatusCode: res.StatusCode,
  2985. },
  2986. }
  2987. target := &ret
  2988. if err := gensupport.DecodeResponse(target, res); err != nil {
  2989. return nil, err
  2990. }
  2991. return ret, nil
  2992. // {
  2993. // "httpMethod": "POST",
  2994. // "id": "androidpublisher.edits.apks.upload",
  2995. // "mediaUpload": {
  2996. // "accept": [
  2997. // "application/octet-stream",
  2998. // "application/vnd.android.package-archive"
  2999. // ],
  3000. // "maxSize": "1GB",
  3001. // "protocols": {
  3002. // "resumable": {
  3003. // "multipart": true,
  3004. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks"
  3005. // },
  3006. // "simple": {
  3007. // "multipart": true,
  3008. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks"
  3009. // }
  3010. // }
  3011. // },
  3012. // "parameterOrder": [
  3013. // "packageName",
  3014. // "editId"
  3015. // ],
  3016. // "parameters": {
  3017. // "editId": {
  3018. // "description": "Unique identifier for this edit.",
  3019. // "location": "path",
  3020. // "required": true,
  3021. // "type": "string"
  3022. // },
  3023. // "packageName": {
  3024. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3025. // "location": "path",
  3026. // "required": true,
  3027. // "type": "string"
  3028. // }
  3029. // },
  3030. // "path": "{packageName}/edits/{editId}/apks",
  3031. // "response": {
  3032. // "$ref": "Apk"
  3033. // },
  3034. // "scopes": [
  3035. // "https://www.googleapis.com/auth/androidpublisher"
  3036. // ],
  3037. // "supportsMediaUpload": true
  3038. // }
  3039. }
  3040. // method id "androidpublisher.edits.bundles.list":
  3041. type EditsBundlesListCall struct {
  3042. s *Service
  3043. packageNameid string
  3044. editId string
  3045. urlParams_ gensupport.URLParams
  3046. ifNoneMatch_ string
  3047. ctx_ context.Context
  3048. header_ http.Header
  3049. }
  3050. // List:
  3051. func (r *EditsBundlesService) List(packageNameid string, editId string) *EditsBundlesListCall {
  3052. c := &EditsBundlesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3053. c.packageNameid = packageNameid
  3054. c.editId = editId
  3055. return c
  3056. }
  3057. // Fields allows partial responses to be retrieved. See
  3058. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3059. // for more information.
  3060. func (c *EditsBundlesListCall) Fields(s ...googleapi.Field) *EditsBundlesListCall {
  3061. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3062. return c
  3063. }
  3064. // IfNoneMatch sets the optional parameter which makes the operation
  3065. // fail if the object's ETag matches the given value. This is useful for
  3066. // getting updates only after the object has changed since the last
  3067. // request. Use googleapi.IsNotModified to check whether the response
  3068. // error from Do is the result of In-None-Match.
  3069. func (c *EditsBundlesListCall) IfNoneMatch(entityTag string) *EditsBundlesListCall {
  3070. c.ifNoneMatch_ = entityTag
  3071. return c
  3072. }
  3073. // Context sets the context to be used in this call's Do method. Any
  3074. // pending HTTP request will be aborted if the provided context is
  3075. // canceled.
  3076. func (c *EditsBundlesListCall) Context(ctx context.Context) *EditsBundlesListCall {
  3077. c.ctx_ = ctx
  3078. return c
  3079. }
  3080. // Header returns an http.Header that can be modified by the caller to
  3081. // add HTTP headers to the request.
  3082. func (c *EditsBundlesListCall) Header() http.Header {
  3083. if c.header_ == nil {
  3084. c.header_ = make(http.Header)
  3085. }
  3086. return c.header_
  3087. }
  3088. func (c *EditsBundlesListCall) doRequest(alt string) (*http.Response, error) {
  3089. reqHeaders := make(http.Header)
  3090. for k, v := range c.header_ {
  3091. reqHeaders[k] = v
  3092. }
  3093. reqHeaders.Set("User-Agent", c.s.userAgent())
  3094. if c.ifNoneMatch_ != "" {
  3095. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3096. }
  3097. var body io.Reader = nil
  3098. c.urlParams_.Set("alt", alt)
  3099. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  3100. urls += "?" + c.urlParams_.Encode()
  3101. req, _ := http.NewRequest("GET", urls, body)
  3102. req.Header = reqHeaders
  3103. googleapi.Expand(req.URL, map[string]string{
  3104. "packageName": c.packageNameid,
  3105. "editId": c.editId,
  3106. })
  3107. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3108. }
  3109. // Do executes the "androidpublisher.edits.bundles.list" call.
  3110. // Exactly one of *BundlesListResponse or error will be non-nil. Any
  3111. // non-2xx status code is an error. Response headers are in either
  3112. // *BundlesListResponse.ServerResponse.Header or (if a response was
  3113. // returned at all) in error.(*googleapi.Error).Header. Use
  3114. // googleapi.IsNotModified to check whether the returned error was
  3115. // because http.StatusNotModified was returned.
  3116. func (c *EditsBundlesListCall) Do(opts ...googleapi.CallOption) (*BundlesListResponse, error) {
  3117. gensupport.SetOptions(c.urlParams_, opts...)
  3118. res, err := c.doRequest("json")
  3119. if res != nil && res.StatusCode == http.StatusNotModified {
  3120. if res.Body != nil {
  3121. res.Body.Close()
  3122. }
  3123. return nil, &googleapi.Error{
  3124. Code: res.StatusCode,
  3125. Header: res.Header,
  3126. }
  3127. }
  3128. if err != nil {
  3129. return nil, err
  3130. }
  3131. defer googleapi.CloseBody(res)
  3132. if err := googleapi.CheckResponse(res); err != nil {
  3133. return nil, err
  3134. }
  3135. ret := &BundlesListResponse{
  3136. ServerResponse: googleapi.ServerResponse{
  3137. Header: res.Header,
  3138. HTTPStatusCode: res.StatusCode,
  3139. },
  3140. }
  3141. target := &ret
  3142. if err := gensupport.DecodeResponse(target, res); err != nil {
  3143. return nil, err
  3144. }
  3145. return ret, nil
  3146. // {
  3147. // "httpMethod": "GET",
  3148. // "id": "androidpublisher.edits.bundles.list",
  3149. // "parameterOrder": [
  3150. // "packageName",
  3151. // "editId"
  3152. // ],
  3153. // "parameters": {
  3154. // "editId": {
  3155. // "description": "Unique identifier for this edit.",
  3156. // "location": "path",
  3157. // "required": true,
  3158. // "type": "string"
  3159. // },
  3160. // "packageName": {
  3161. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3162. // "location": "path",
  3163. // "required": true,
  3164. // "type": "string"
  3165. // }
  3166. // },
  3167. // "path": "{packageName}/edits/{editId}/bundles",
  3168. // "response": {
  3169. // "$ref": "BundlesListResponse"
  3170. // },
  3171. // "scopes": [
  3172. // "https://www.googleapis.com/auth/androidpublisher"
  3173. // ]
  3174. // }
  3175. }
  3176. // method id "androidpublisher.edits.bundles.upload":
  3177. type EditsBundlesUploadCall struct {
  3178. s *Service
  3179. packageNameid string
  3180. editId string
  3181. urlParams_ gensupport.URLParams
  3182. mediaInfo_ *gensupport.MediaInfo
  3183. ctx_ context.Context
  3184. header_ http.Header
  3185. }
  3186. // Upload: Uploads a new Android App Bundle to this edit. If you are
  3187. // using the Google API client libraries, please increase the timeout of
  3188. // the http request before calling this endpoint (a timeout of 2 minutes
  3189. // is recommended). See:
  3190. // https://developers.google.com/api-client-library/java/google-api-java-client/errors for an example in
  3191. // java.
  3192. func (r *EditsBundlesService) Upload(packageNameid string, editId string) *EditsBundlesUploadCall {
  3193. c := &EditsBundlesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3194. c.packageNameid = packageNameid
  3195. c.editId = editId
  3196. return c
  3197. }
  3198. // Media specifies the media to upload in one or more chunks. The chunk
  3199. // size may be controlled by supplying a MediaOption generated by
  3200. // googleapi.ChunkSize. The chunk size defaults to
  3201. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3202. // upload request will be determined by sniffing the contents of r,
  3203. // unless a MediaOption generated by googleapi.ContentType is
  3204. // supplied.
  3205. // At most one of Media and ResumableMedia may be set.
  3206. func (c *EditsBundlesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsBundlesUploadCall {
  3207. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3208. return c
  3209. }
  3210. // ResumableMedia specifies the media to upload in chunks and can be
  3211. // canceled with ctx.
  3212. //
  3213. // Deprecated: use Media instead.
  3214. //
  3215. // At most one of Media and ResumableMedia may be set. mediaType
  3216. // identifies the MIME media type of the upload, such as "image/png". If
  3217. // mediaType is "", it will be auto-detected. The provided ctx will
  3218. // supersede any context previously provided to the Context method.
  3219. func (c *EditsBundlesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsBundlesUploadCall {
  3220. c.ctx_ = ctx
  3221. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3222. return c
  3223. }
  3224. // ProgressUpdater provides a callback function that will be called
  3225. // after every chunk. It should be a low-latency function in order to
  3226. // not slow down the upload operation. This should only be called when
  3227. // using ResumableMedia (as opposed to Media).
  3228. func (c *EditsBundlesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsBundlesUploadCall {
  3229. c.mediaInfo_.SetProgressUpdater(pu)
  3230. return c
  3231. }
  3232. // Fields allows partial responses to be retrieved. See
  3233. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3234. // for more information.
  3235. func (c *EditsBundlesUploadCall) Fields(s ...googleapi.Field) *EditsBundlesUploadCall {
  3236. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3237. return c
  3238. }
  3239. // Context sets the context to be used in this call's Do method. Any
  3240. // pending HTTP request will be aborted if the provided context is
  3241. // canceled.
  3242. // This context will supersede any context previously provided to the
  3243. // ResumableMedia method.
  3244. func (c *EditsBundlesUploadCall) Context(ctx context.Context) *EditsBundlesUploadCall {
  3245. c.ctx_ = ctx
  3246. return c
  3247. }
  3248. // Header returns an http.Header that can be modified by the caller to
  3249. // add HTTP headers to the request.
  3250. func (c *EditsBundlesUploadCall) Header() http.Header {
  3251. if c.header_ == nil {
  3252. c.header_ = make(http.Header)
  3253. }
  3254. return c.header_
  3255. }
  3256. func (c *EditsBundlesUploadCall) doRequest(alt string) (*http.Response, error) {
  3257. reqHeaders := make(http.Header)
  3258. for k, v := range c.header_ {
  3259. reqHeaders[k] = v
  3260. }
  3261. reqHeaders.Set("User-Agent", c.s.userAgent())
  3262. var body io.Reader = nil
  3263. c.urlParams_.Set("alt", alt)
  3264. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/bundles")
  3265. if c.mediaInfo_ != nil {
  3266. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3267. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3268. }
  3269. if body == nil {
  3270. body = new(bytes.Buffer)
  3271. reqHeaders.Set("Content-Type", "application/json")
  3272. }
  3273. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3274. defer cleanup()
  3275. urls += "?" + c.urlParams_.Encode()
  3276. req, _ := http.NewRequest("POST", urls, body)
  3277. req.Header = reqHeaders
  3278. gensupport.SetGetBody(req, getBody)
  3279. googleapi.Expand(req.URL, map[string]string{
  3280. "packageName": c.packageNameid,
  3281. "editId": c.editId,
  3282. })
  3283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3284. }
  3285. // Do executes the "androidpublisher.edits.bundles.upload" call.
  3286. // Exactly one of *Bundle or error will be non-nil. Any non-2xx status
  3287. // code is an error. Response headers are in either
  3288. // *Bundle.ServerResponse.Header or (if a response was returned at all)
  3289. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3290. // check whether the returned error was because http.StatusNotModified
  3291. // was returned.
  3292. func (c *EditsBundlesUploadCall) Do(opts ...googleapi.CallOption) (*Bundle, error) {
  3293. gensupport.SetOptions(c.urlParams_, opts...)
  3294. res, err := c.doRequest("json")
  3295. if res != nil && res.StatusCode == http.StatusNotModified {
  3296. if res.Body != nil {
  3297. res.Body.Close()
  3298. }
  3299. return nil, &googleapi.Error{
  3300. Code: res.StatusCode,
  3301. Header: res.Header,
  3302. }
  3303. }
  3304. if err != nil {
  3305. return nil, err
  3306. }
  3307. defer googleapi.CloseBody(res)
  3308. if err := googleapi.CheckResponse(res); err != nil {
  3309. return nil, err
  3310. }
  3311. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3312. if rx != nil {
  3313. rx.Client = c.s.client
  3314. rx.UserAgent = c.s.userAgent()
  3315. ctx := c.ctx_
  3316. if ctx == nil {
  3317. ctx = context.TODO()
  3318. }
  3319. res, err = rx.Upload(ctx)
  3320. if err != nil {
  3321. return nil, err
  3322. }
  3323. defer res.Body.Close()
  3324. if err := googleapi.CheckResponse(res); err != nil {
  3325. return nil, err
  3326. }
  3327. }
  3328. ret := &Bundle{
  3329. ServerResponse: googleapi.ServerResponse{
  3330. Header: res.Header,
  3331. HTTPStatusCode: res.StatusCode,
  3332. },
  3333. }
  3334. target := &ret
  3335. if err := gensupport.DecodeResponse(target, res); err != nil {
  3336. return nil, err
  3337. }
  3338. return ret, nil
  3339. // {
  3340. // "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.",
  3341. // "httpMethod": "POST",
  3342. // "id": "androidpublisher.edits.bundles.upload",
  3343. // "mediaUpload": {
  3344. // "accept": [
  3345. // "application/octet-stream"
  3346. // ],
  3347. // "maxSize": "2GB",
  3348. // "protocols": {
  3349. // "resumable": {
  3350. // "multipart": true,
  3351. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles"
  3352. // },
  3353. // "simple": {
  3354. // "multipart": true,
  3355. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles"
  3356. // }
  3357. // }
  3358. // },
  3359. // "parameterOrder": [
  3360. // "packageName",
  3361. // "editId"
  3362. // ],
  3363. // "parameters": {
  3364. // "editId": {
  3365. // "description": "Unique identifier for this edit.",
  3366. // "location": "path",
  3367. // "required": true,
  3368. // "type": "string"
  3369. // },
  3370. // "packageName": {
  3371. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3372. // "location": "path",
  3373. // "required": true,
  3374. // "type": "string"
  3375. // }
  3376. // },
  3377. // "path": "{packageName}/edits/{editId}/bundles",
  3378. // "response": {
  3379. // "$ref": "Bundle"
  3380. // },
  3381. // "scopes": [
  3382. // "https://www.googleapis.com/auth/androidpublisher"
  3383. // ],
  3384. // "supportsMediaUpload": true
  3385. // }
  3386. }
  3387. // method id "androidpublisher.edits.deobfuscationfiles.upload":
  3388. type EditsDeobfuscationfilesUploadCall struct {
  3389. s *Service
  3390. packageNameid string
  3391. editId string
  3392. apkVersionCode int64
  3393. deobfuscationFileType string
  3394. urlParams_ gensupport.URLParams
  3395. mediaInfo_ *gensupport.MediaInfo
  3396. ctx_ context.Context
  3397. header_ http.Header
  3398. }
  3399. // Upload: Uploads the deobfuscation file of the specified APK. If a
  3400. // deobfuscation file already exists, it will be replaced.
  3401. func (r *EditsDeobfuscationfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, deobfuscationFileType string) *EditsDeobfuscationfilesUploadCall {
  3402. c := &EditsDeobfuscationfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3403. c.packageNameid = packageNameid
  3404. c.editId = editId
  3405. c.apkVersionCode = apkVersionCode
  3406. c.deobfuscationFileType = deobfuscationFileType
  3407. return c
  3408. }
  3409. // Media specifies the media to upload in one or more chunks. The chunk
  3410. // size may be controlled by supplying a MediaOption generated by
  3411. // googleapi.ChunkSize. The chunk size defaults to
  3412. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  3413. // upload request will be determined by sniffing the contents of r,
  3414. // unless a MediaOption generated by googleapi.ContentType is
  3415. // supplied.
  3416. // At most one of Media and ResumableMedia may be set.
  3417. func (c *EditsDeobfuscationfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsDeobfuscationfilesUploadCall {
  3418. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  3419. return c
  3420. }
  3421. // ResumableMedia specifies the media to upload in chunks and can be
  3422. // canceled with ctx.
  3423. //
  3424. // Deprecated: use Media instead.
  3425. //
  3426. // At most one of Media and ResumableMedia may be set. mediaType
  3427. // identifies the MIME media type of the upload, such as "image/png". If
  3428. // mediaType is "", it will be auto-detected. The provided ctx will
  3429. // supersede any context previously provided to the Context method.
  3430. func (c *EditsDeobfuscationfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsDeobfuscationfilesUploadCall {
  3431. c.ctx_ = ctx
  3432. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  3433. return c
  3434. }
  3435. // ProgressUpdater provides a callback function that will be called
  3436. // after every chunk. It should be a low-latency function in order to
  3437. // not slow down the upload operation. This should only be called when
  3438. // using ResumableMedia (as opposed to Media).
  3439. func (c *EditsDeobfuscationfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsDeobfuscationfilesUploadCall {
  3440. c.mediaInfo_.SetProgressUpdater(pu)
  3441. return c
  3442. }
  3443. // Fields allows partial responses to be retrieved. See
  3444. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3445. // for more information.
  3446. func (c *EditsDeobfuscationfilesUploadCall) Fields(s ...googleapi.Field) *EditsDeobfuscationfilesUploadCall {
  3447. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3448. return c
  3449. }
  3450. // Context sets the context to be used in this call's Do method. Any
  3451. // pending HTTP request will be aborted if the provided context is
  3452. // canceled.
  3453. // This context will supersede any context previously provided to the
  3454. // ResumableMedia method.
  3455. func (c *EditsDeobfuscationfilesUploadCall) Context(ctx context.Context) *EditsDeobfuscationfilesUploadCall {
  3456. c.ctx_ = ctx
  3457. return c
  3458. }
  3459. // Header returns an http.Header that can be modified by the caller to
  3460. // add HTTP headers to the request.
  3461. func (c *EditsDeobfuscationfilesUploadCall) Header() http.Header {
  3462. if c.header_ == nil {
  3463. c.header_ = make(http.Header)
  3464. }
  3465. return c.header_
  3466. }
  3467. func (c *EditsDeobfuscationfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  3468. reqHeaders := make(http.Header)
  3469. for k, v := range c.header_ {
  3470. reqHeaders[k] = v
  3471. }
  3472. reqHeaders.Set("User-Agent", c.s.userAgent())
  3473. var body io.Reader = nil
  3474. c.urlParams_.Set("alt", alt)
  3475. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}")
  3476. if c.mediaInfo_ != nil {
  3477. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  3478. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  3479. }
  3480. if body == nil {
  3481. body = new(bytes.Buffer)
  3482. reqHeaders.Set("Content-Type", "application/json")
  3483. }
  3484. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  3485. defer cleanup()
  3486. urls += "?" + c.urlParams_.Encode()
  3487. req, _ := http.NewRequest("POST", urls, body)
  3488. req.Header = reqHeaders
  3489. gensupport.SetGetBody(req, getBody)
  3490. googleapi.Expand(req.URL, map[string]string{
  3491. "packageName": c.packageNameid,
  3492. "editId": c.editId,
  3493. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  3494. "deobfuscationFileType": c.deobfuscationFileType,
  3495. })
  3496. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3497. }
  3498. // Do executes the "androidpublisher.edits.deobfuscationfiles.upload" call.
  3499. // Exactly one of *DeobfuscationFilesUploadResponse or error will be
  3500. // non-nil. Any non-2xx status code is an error. Response headers are in
  3501. // either *DeobfuscationFilesUploadResponse.ServerResponse.Header or (if
  3502. // a response was returned at all) in error.(*googleapi.Error).Header.
  3503. // Use googleapi.IsNotModified to check whether the returned error was
  3504. // because http.StatusNotModified was returned.
  3505. func (c *EditsDeobfuscationfilesUploadCall) Do(opts ...googleapi.CallOption) (*DeobfuscationFilesUploadResponse, error) {
  3506. gensupport.SetOptions(c.urlParams_, opts...)
  3507. res, err := c.doRequest("json")
  3508. if res != nil && res.StatusCode == http.StatusNotModified {
  3509. if res.Body != nil {
  3510. res.Body.Close()
  3511. }
  3512. return nil, &googleapi.Error{
  3513. Code: res.StatusCode,
  3514. Header: res.Header,
  3515. }
  3516. }
  3517. if err != nil {
  3518. return nil, err
  3519. }
  3520. defer googleapi.CloseBody(res)
  3521. if err := googleapi.CheckResponse(res); err != nil {
  3522. return nil, err
  3523. }
  3524. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  3525. if rx != nil {
  3526. rx.Client = c.s.client
  3527. rx.UserAgent = c.s.userAgent()
  3528. ctx := c.ctx_
  3529. if ctx == nil {
  3530. ctx = context.TODO()
  3531. }
  3532. res, err = rx.Upload(ctx)
  3533. if err != nil {
  3534. return nil, err
  3535. }
  3536. defer res.Body.Close()
  3537. if err := googleapi.CheckResponse(res); err != nil {
  3538. return nil, err
  3539. }
  3540. }
  3541. ret := &DeobfuscationFilesUploadResponse{
  3542. ServerResponse: googleapi.ServerResponse{
  3543. Header: res.Header,
  3544. HTTPStatusCode: res.StatusCode,
  3545. },
  3546. }
  3547. target := &ret
  3548. if err := gensupport.DecodeResponse(target, res); err != nil {
  3549. return nil, err
  3550. }
  3551. return ret, nil
  3552. // {
  3553. // "description": "Uploads the deobfuscation file of the specified APK. If a deobfuscation file already exists, it will be replaced.",
  3554. // "httpMethod": "POST",
  3555. // "id": "androidpublisher.edits.deobfuscationfiles.upload",
  3556. // "mediaUpload": {
  3557. // "accept": [
  3558. // "application/octet-stream"
  3559. // ],
  3560. // "maxSize": "300MB",
  3561. // "protocols": {
  3562. // "resumable": {
  3563. // "multipart": true,
  3564. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  3565. // },
  3566. // "simple": {
  3567. // "multipart": true,
  3568. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}"
  3569. // }
  3570. // }
  3571. // },
  3572. // "parameterOrder": [
  3573. // "packageName",
  3574. // "editId",
  3575. // "apkVersionCode",
  3576. // "deobfuscationFileType"
  3577. // ],
  3578. // "parameters": {
  3579. // "apkVersionCode": {
  3580. // "description": "The version code of the APK whose deobfuscation file is being uploaded.",
  3581. // "format": "int32",
  3582. // "location": "path",
  3583. // "required": true,
  3584. // "type": "integer"
  3585. // },
  3586. // "deobfuscationFileType": {
  3587. // "enum": [
  3588. // "proguard"
  3589. // ],
  3590. // "enumDescriptions": [
  3591. // ""
  3592. // ],
  3593. // "location": "path",
  3594. // "required": true,
  3595. // "type": "string"
  3596. // },
  3597. // "editId": {
  3598. // "description": "Unique identifier for this edit.",
  3599. // "location": "path",
  3600. // "required": true,
  3601. // "type": "string"
  3602. // },
  3603. // "packageName": {
  3604. // "description": "Unique identifier of the Android app for which the deobfuscatiuon files are being uploaded; for example, \"com.spiffygame\".",
  3605. // "location": "path",
  3606. // "required": true,
  3607. // "type": "string"
  3608. // }
  3609. // },
  3610. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}",
  3611. // "response": {
  3612. // "$ref": "DeobfuscationFilesUploadResponse"
  3613. // },
  3614. // "scopes": [
  3615. // "https://www.googleapis.com/auth/androidpublisher"
  3616. // ],
  3617. // "supportsMediaUpload": true
  3618. // }
  3619. }
  3620. // method id "androidpublisher.edits.details.get":
  3621. type EditsDetailsGetCall struct {
  3622. s *Service
  3623. packageNameid string
  3624. editId string
  3625. urlParams_ gensupport.URLParams
  3626. ifNoneMatch_ string
  3627. ctx_ context.Context
  3628. header_ http.Header
  3629. }
  3630. // Get: Fetches app details for this edit. This includes the default
  3631. // language and developer support contact information.
  3632. func (r *EditsDetailsService) Get(packageNameid string, editId string) *EditsDetailsGetCall {
  3633. c := &EditsDetailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3634. c.packageNameid = packageNameid
  3635. c.editId = editId
  3636. return c
  3637. }
  3638. // Fields allows partial responses to be retrieved. See
  3639. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3640. // for more information.
  3641. func (c *EditsDetailsGetCall) Fields(s ...googleapi.Field) *EditsDetailsGetCall {
  3642. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3643. return c
  3644. }
  3645. // IfNoneMatch sets the optional parameter which makes the operation
  3646. // fail if the object's ETag matches the given value. This is useful for
  3647. // getting updates only after the object has changed since the last
  3648. // request. Use googleapi.IsNotModified to check whether the response
  3649. // error from Do is the result of In-None-Match.
  3650. func (c *EditsDetailsGetCall) IfNoneMatch(entityTag string) *EditsDetailsGetCall {
  3651. c.ifNoneMatch_ = entityTag
  3652. return c
  3653. }
  3654. // Context sets the context to be used in this call's Do method. Any
  3655. // pending HTTP request will be aborted if the provided context is
  3656. // canceled.
  3657. func (c *EditsDetailsGetCall) Context(ctx context.Context) *EditsDetailsGetCall {
  3658. c.ctx_ = ctx
  3659. return c
  3660. }
  3661. // Header returns an http.Header that can be modified by the caller to
  3662. // add HTTP headers to the request.
  3663. func (c *EditsDetailsGetCall) Header() http.Header {
  3664. if c.header_ == nil {
  3665. c.header_ = make(http.Header)
  3666. }
  3667. return c.header_
  3668. }
  3669. func (c *EditsDetailsGetCall) doRequest(alt string) (*http.Response, error) {
  3670. reqHeaders := make(http.Header)
  3671. for k, v := range c.header_ {
  3672. reqHeaders[k] = v
  3673. }
  3674. reqHeaders.Set("User-Agent", c.s.userAgent())
  3675. if c.ifNoneMatch_ != "" {
  3676. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3677. }
  3678. var body io.Reader = nil
  3679. c.urlParams_.Set("alt", alt)
  3680. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  3681. urls += "?" + c.urlParams_.Encode()
  3682. req, _ := http.NewRequest("GET", urls, body)
  3683. req.Header = reqHeaders
  3684. googleapi.Expand(req.URL, map[string]string{
  3685. "packageName": c.packageNameid,
  3686. "editId": c.editId,
  3687. })
  3688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3689. }
  3690. // Do executes the "androidpublisher.edits.details.get" call.
  3691. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  3692. // status code is an error. Response headers are in either
  3693. // *AppDetails.ServerResponse.Header or (if a response was returned at
  3694. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3695. // to check whether the returned error was because
  3696. // http.StatusNotModified was returned.
  3697. func (c *EditsDetailsGetCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  3698. gensupport.SetOptions(c.urlParams_, opts...)
  3699. res, err := c.doRequest("json")
  3700. if res != nil && res.StatusCode == http.StatusNotModified {
  3701. if res.Body != nil {
  3702. res.Body.Close()
  3703. }
  3704. return nil, &googleapi.Error{
  3705. Code: res.StatusCode,
  3706. Header: res.Header,
  3707. }
  3708. }
  3709. if err != nil {
  3710. return nil, err
  3711. }
  3712. defer googleapi.CloseBody(res)
  3713. if err := googleapi.CheckResponse(res); err != nil {
  3714. return nil, err
  3715. }
  3716. ret := &AppDetails{
  3717. ServerResponse: googleapi.ServerResponse{
  3718. Header: res.Header,
  3719. HTTPStatusCode: res.StatusCode,
  3720. },
  3721. }
  3722. target := &ret
  3723. if err := gensupport.DecodeResponse(target, res); err != nil {
  3724. return nil, err
  3725. }
  3726. return ret, nil
  3727. // {
  3728. // "description": "Fetches app details for this edit. This includes the default language and developer support contact information.",
  3729. // "httpMethod": "GET",
  3730. // "id": "androidpublisher.edits.details.get",
  3731. // "parameterOrder": [
  3732. // "packageName",
  3733. // "editId"
  3734. // ],
  3735. // "parameters": {
  3736. // "editId": {
  3737. // "description": "Unique identifier for this edit.",
  3738. // "location": "path",
  3739. // "required": true,
  3740. // "type": "string"
  3741. // },
  3742. // "packageName": {
  3743. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3744. // "location": "path",
  3745. // "required": true,
  3746. // "type": "string"
  3747. // }
  3748. // },
  3749. // "path": "{packageName}/edits/{editId}/details",
  3750. // "response": {
  3751. // "$ref": "AppDetails"
  3752. // },
  3753. // "scopes": [
  3754. // "https://www.googleapis.com/auth/androidpublisher"
  3755. // ]
  3756. // }
  3757. }
  3758. // method id "androidpublisher.edits.details.patch":
  3759. type EditsDetailsPatchCall struct {
  3760. s *Service
  3761. packageNameid string
  3762. editId string
  3763. appdetails *AppDetails
  3764. urlParams_ gensupport.URLParams
  3765. ctx_ context.Context
  3766. header_ http.Header
  3767. }
  3768. // Patch: Updates app details for this edit. This method supports patch
  3769. // semantics.
  3770. func (r *EditsDetailsService) Patch(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsPatchCall {
  3771. c := &EditsDetailsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3772. c.packageNameid = packageNameid
  3773. c.editId = editId
  3774. c.appdetails = appdetails
  3775. return c
  3776. }
  3777. // Fields allows partial responses to be retrieved. See
  3778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3779. // for more information.
  3780. func (c *EditsDetailsPatchCall) Fields(s ...googleapi.Field) *EditsDetailsPatchCall {
  3781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3782. return c
  3783. }
  3784. // Context sets the context to be used in this call's Do method. Any
  3785. // pending HTTP request will be aborted if the provided context is
  3786. // canceled.
  3787. func (c *EditsDetailsPatchCall) Context(ctx context.Context) *EditsDetailsPatchCall {
  3788. c.ctx_ = ctx
  3789. return c
  3790. }
  3791. // Header returns an http.Header that can be modified by the caller to
  3792. // add HTTP headers to the request.
  3793. func (c *EditsDetailsPatchCall) Header() http.Header {
  3794. if c.header_ == nil {
  3795. c.header_ = make(http.Header)
  3796. }
  3797. return c.header_
  3798. }
  3799. func (c *EditsDetailsPatchCall) doRequest(alt string) (*http.Response, error) {
  3800. reqHeaders := make(http.Header)
  3801. for k, v := range c.header_ {
  3802. reqHeaders[k] = v
  3803. }
  3804. reqHeaders.Set("User-Agent", c.s.userAgent())
  3805. var body io.Reader = nil
  3806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  3807. if err != nil {
  3808. return nil, err
  3809. }
  3810. reqHeaders.Set("Content-Type", "application/json")
  3811. c.urlParams_.Set("alt", alt)
  3812. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  3813. urls += "?" + c.urlParams_.Encode()
  3814. req, _ := http.NewRequest("PATCH", urls, body)
  3815. req.Header = reqHeaders
  3816. googleapi.Expand(req.URL, map[string]string{
  3817. "packageName": c.packageNameid,
  3818. "editId": c.editId,
  3819. })
  3820. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3821. }
  3822. // Do executes the "androidpublisher.edits.details.patch" call.
  3823. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  3824. // status code is an error. Response headers are in either
  3825. // *AppDetails.ServerResponse.Header or (if a response was returned at
  3826. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3827. // to check whether the returned error was because
  3828. // http.StatusNotModified was returned.
  3829. func (c *EditsDetailsPatchCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  3830. gensupport.SetOptions(c.urlParams_, opts...)
  3831. res, err := c.doRequest("json")
  3832. if res != nil && res.StatusCode == http.StatusNotModified {
  3833. if res.Body != nil {
  3834. res.Body.Close()
  3835. }
  3836. return nil, &googleapi.Error{
  3837. Code: res.StatusCode,
  3838. Header: res.Header,
  3839. }
  3840. }
  3841. if err != nil {
  3842. return nil, err
  3843. }
  3844. defer googleapi.CloseBody(res)
  3845. if err := googleapi.CheckResponse(res); err != nil {
  3846. return nil, err
  3847. }
  3848. ret := &AppDetails{
  3849. ServerResponse: googleapi.ServerResponse{
  3850. Header: res.Header,
  3851. HTTPStatusCode: res.StatusCode,
  3852. },
  3853. }
  3854. target := &ret
  3855. if err := gensupport.DecodeResponse(target, res); err != nil {
  3856. return nil, err
  3857. }
  3858. return ret, nil
  3859. // {
  3860. // "description": "Updates app details for this edit. This method supports patch semantics.",
  3861. // "httpMethod": "PATCH",
  3862. // "id": "androidpublisher.edits.details.patch",
  3863. // "parameterOrder": [
  3864. // "packageName",
  3865. // "editId"
  3866. // ],
  3867. // "parameters": {
  3868. // "editId": {
  3869. // "description": "Unique identifier for this edit.",
  3870. // "location": "path",
  3871. // "required": true,
  3872. // "type": "string"
  3873. // },
  3874. // "packageName": {
  3875. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  3876. // "location": "path",
  3877. // "required": true,
  3878. // "type": "string"
  3879. // }
  3880. // },
  3881. // "path": "{packageName}/edits/{editId}/details",
  3882. // "request": {
  3883. // "$ref": "AppDetails"
  3884. // },
  3885. // "response": {
  3886. // "$ref": "AppDetails"
  3887. // },
  3888. // "scopes": [
  3889. // "https://www.googleapis.com/auth/androidpublisher"
  3890. // ]
  3891. // }
  3892. }
  3893. // method id "androidpublisher.edits.details.update":
  3894. type EditsDetailsUpdateCall struct {
  3895. s *Service
  3896. packageNameid string
  3897. editId string
  3898. appdetails *AppDetails
  3899. urlParams_ gensupport.URLParams
  3900. ctx_ context.Context
  3901. header_ http.Header
  3902. }
  3903. // Update: Updates app details for this edit.
  3904. func (r *EditsDetailsService) Update(packageNameid string, editId string, appdetails *AppDetails) *EditsDetailsUpdateCall {
  3905. c := &EditsDetailsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3906. c.packageNameid = packageNameid
  3907. c.editId = editId
  3908. c.appdetails = appdetails
  3909. return c
  3910. }
  3911. // Fields allows partial responses to be retrieved. See
  3912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3913. // for more information.
  3914. func (c *EditsDetailsUpdateCall) Fields(s ...googleapi.Field) *EditsDetailsUpdateCall {
  3915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3916. return c
  3917. }
  3918. // Context sets the context to be used in this call's Do method. Any
  3919. // pending HTTP request will be aborted if the provided context is
  3920. // canceled.
  3921. func (c *EditsDetailsUpdateCall) Context(ctx context.Context) *EditsDetailsUpdateCall {
  3922. c.ctx_ = ctx
  3923. return c
  3924. }
  3925. // Header returns an http.Header that can be modified by the caller to
  3926. // add HTTP headers to the request.
  3927. func (c *EditsDetailsUpdateCall) Header() http.Header {
  3928. if c.header_ == nil {
  3929. c.header_ = make(http.Header)
  3930. }
  3931. return c.header_
  3932. }
  3933. func (c *EditsDetailsUpdateCall) doRequest(alt string) (*http.Response, error) {
  3934. reqHeaders := make(http.Header)
  3935. for k, v := range c.header_ {
  3936. reqHeaders[k] = v
  3937. }
  3938. reqHeaders.Set("User-Agent", c.s.userAgent())
  3939. var body io.Reader = nil
  3940. body, err := googleapi.WithoutDataWrapper.JSONReader(c.appdetails)
  3941. if err != nil {
  3942. return nil, err
  3943. }
  3944. reqHeaders.Set("Content-Type", "application/json")
  3945. c.urlParams_.Set("alt", alt)
  3946. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/details")
  3947. urls += "?" + c.urlParams_.Encode()
  3948. req, _ := http.NewRequest("PUT", urls, body)
  3949. req.Header = reqHeaders
  3950. googleapi.Expand(req.URL, map[string]string{
  3951. "packageName": c.packageNameid,
  3952. "editId": c.editId,
  3953. })
  3954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3955. }
  3956. // Do executes the "androidpublisher.edits.details.update" call.
  3957. // Exactly one of *AppDetails or error will be non-nil. Any non-2xx
  3958. // status code is an error. Response headers are in either
  3959. // *AppDetails.ServerResponse.Header or (if a response was returned at
  3960. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3961. // to check whether the returned error was because
  3962. // http.StatusNotModified was returned.
  3963. func (c *EditsDetailsUpdateCall) Do(opts ...googleapi.CallOption) (*AppDetails, error) {
  3964. gensupport.SetOptions(c.urlParams_, opts...)
  3965. res, err := c.doRequest("json")
  3966. if res != nil && res.StatusCode == http.StatusNotModified {
  3967. if res.Body != nil {
  3968. res.Body.Close()
  3969. }
  3970. return nil, &googleapi.Error{
  3971. Code: res.StatusCode,
  3972. Header: res.Header,
  3973. }
  3974. }
  3975. if err != nil {
  3976. return nil, err
  3977. }
  3978. defer googleapi.CloseBody(res)
  3979. if err := googleapi.CheckResponse(res); err != nil {
  3980. return nil, err
  3981. }
  3982. ret := &AppDetails{
  3983. ServerResponse: googleapi.ServerResponse{
  3984. Header: res.Header,
  3985. HTTPStatusCode: res.StatusCode,
  3986. },
  3987. }
  3988. target := &ret
  3989. if err := gensupport.DecodeResponse(target, res); err != nil {
  3990. return nil, err
  3991. }
  3992. return ret, nil
  3993. // {
  3994. // "description": "Updates app details for this edit.",
  3995. // "httpMethod": "PUT",
  3996. // "id": "androidpublisher.edits.details.update",
  3997. // "parameterOrder": [
  3998. // "packageName",
  3999. // "editId"
  4000. // ],
  4001. // "parameters": {
  4002. // "editId": {
  4003. // "description": "Unique identifier for this edit.",
  4004. // "location": "path",
  4005. // "required": true,
  4006. // "type": "string"
  4007. // },
  4008. // "packageName": {
  4009. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4010. // "location": "path",
  4011. // "required": true,
  4012. // "type": "string"
  4013. // }
  4014. // },
  4015. // "path": "{packageName}/edits/{editId}/details",
  4016. // "request": {
  4017. // "$ref": "AppDetails"
  4018. // },
  4019. // "response": {
  4020. // "$ref": "AppDetails"
  4021. // },
  4022. // "scopes": [
  4023. // "https://www.googleapis.com/auth/androidpublisher"
  4024. // ]
  4025. // }
  4026. }
  4027. // method id "androidpublisher.edits.expansionfiles.get":
  4028. type EditsExpansionfilesGetCall struct {
  4029. s *Service
  4030. packageNameid string
  4031. editId string
  4032. apkVersionCode int64
  4033. expansionFileType string
  4034. urlParams_ gensupport.URLParams
  4035. ifNoneMatch_ string
  4036. ctx_ context.Context
  4037. header_ http.Header
  4038. }
  4039. // Get: Fetches the Expansion File configuration for the APK specified.
  4040. func (r *EditsExpansionfilesService) Get(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesGetCall {
  4041. c := &EditsExpansionfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4042. c.packageNameid = packageNameid
  4043. c.editId = editId
  4044. c.apkVersionCode = apkVersionCode
  4045. c.expansionFileType = expansionFileType
  4046. return c
  4047. }
  4048. // Fields allows partial responses to be retrieved. See
  4049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4050. // for more information.
  4051. func (c *EditsExpansionfilesGetCall) Fields(s ...googleapi.Field) *EditsExpansionfilesGetCall {
  4052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4053. return c
  4054. }
  4055. // IfNoneMatch sets the optional parameter which makes the operation
  4056. // fail if the object's ETag matches the given value. This is useful for
  4057. // getting updates only after the object has changed since the last
  4058. // request. Use googleapi.IsNotModified to check whether the response
  4059. // error from Do is the result of In-None-Match.
  4060. func (c *EditsExpansionfilesGetCall) IfNoneMatch(entityTag string) *EditsExpansionfilesGetCall {
  4061. c.ifNoneMatch_ = entityTag
  4062. return c
  4063. }
  4064. // Context sets the context to be used in this call's Do method. Any
  4065. // pending HTTP request will be aborted if the provided context is
  4066. // canceled.
  4067. func (c *EditsExpansionfilesGetCall) Context(ctx context.Context) *EditsExpansionfilesGetCall {
  4068. c.ctx_ = ctx
  4069. return c
  4070. }
  4071. // Header returns an http.Header that can be modified by the caller to
  4072. // add HTTP headers to the request.
  4073. func (c *EditsExpansionfilesGetCall) Header() http.Header {
  4074. if c.header_ == nil {
  4075. c.header_ = make(http.Header)
  4076. }
  4077. return c.header_
  4078. }
  4079. func (c *EditsExpansionfilesGetCall) doRequest(alt string) (*http.Response, error) {
  4080. reqHeaders := make(http.Header)
  4081. for k, v := range c.header_ {
  4082. reqHeaders[k] = v
  4083. }
  4084. reqHeaders.Set("User-Agent", c.s.userAgent())
  4085. if c.ifNoneMatch_ != "" {
  4086. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4087. }
  4088. var body io.Reader = nil
  4089. c.urlParams_.Set("alt", alt)
  4090. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4091. urls += "?" + c.urlParams_.Encode()
  4092. req, _ := http.NewRequest("GET", urls, body)
  4093. req.Header = reqHeaders
  4094. googleapi.Expand(req.URL, map[string]string{
  4095. "packageName": c.packageNameid,
  4096. "editId": c.editId,
  4097. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4098. "expansionFileType": c.expansionFileType,
  4099. })
  4100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4101. }
  4102. // Do executes the "androidpublisher.edits.expansionfiles.get" call.
  4103. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4104. // status code is an error. Response headers are in either
  4105. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4106. // at all) in error.(*googleapi.Error).Header. Use
  4107. // googleapi.IsNotModified to check whether the returned error was
  4108. // because http.StatusNotModified was returned.
  4109. func (c *EditsExpansionfilesGetCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4110. gensupport.SetOptions(c.urlParams_, opts...)
  4111. res, err := c.doRequest("json")
  4112. if res != nil && res.StatusCode == http.StatusNotModified {
  4113. if res.Body != nil {
  4114. res.Body.Close()
  4115. }
  4116. return nil, &googleapi.Error{
  4117. Code: res.StatusCode,
  4118. Header: res.Header,
  4119. }
  4120. }
  4121. if err != nil {
  4122. return nil, err
  4123. }
  4124. defer googleapi.CloseBody(res)
  4125. if err := googleapi.CheckResponse(res); err != nil {
  4126. return nil, err
  4127. }
  4128. ret := &ExpansionFile{
  4129. ServerResponse: googleapi.ServerResponse{
  4130. Header: res.Header,
  4131. HTTPStatusCode: res.StatusCode,
  4132. },
  4133. }
  4134. target := &ret
  4135. if err := gensupport.DecodeResponse(target, res); err != nil {
  4136. return nil, err
  4137. }
  4138. return ret, nil
  4139. // {
  4140. // "description": "Fetches the Expansion File configuration for the APK specified.",
  4141. // "httpMethod": "GET",
  4142. // "id": "androidpublisher.edits.expansionfiles.get",
  4143. // "parameterOrder": [
  4144. // "packageName",
  4145. // "editId",
  4146. // "apkVersionCode",
  4147. // "expansionFileType"
  4148. // ],
  4149. // "parameters": {
  4150. // "apkVersionCode": {
  4151. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4152. // "format": "int32",
  4153. // "location": "path",
  4154. // "required": true,
  4155. // "type": "integer"
  4156. // },
  4157. // "editId": {
  4158. // "description": "Unique identifier for this edit.",
  4159. // "location": "path",
  4160. // "required": true,
  4161. // "type": "string"
  4162. // },
  4163. // "expansionFileType": {
  4164. // "enum": [
  4165. // "main",
  4166. // "patch"
  4167. // ],
  4168. // "enumDescriptions": [
  4169. // "",
  4170. // ""
  4171. // ],
  4172. // "location": "path",
  4173. // "required": true,
  4174. // "type": "string"
  4175. // },
  4176. // "packageName": {
  4177. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4178. // "location": "path",
  4179. // "required": true,
  4180. // "type": "string"
  4181. // }
  4182. // },
  4183. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4184. // "response": {
  4185. // "$ref": "ExpansionFile"
  4186. // },
  4187. // "scopes": [
  4188. // "https://www.googleapis.com/auth/androidpublisher"
  4189. // ]
  4190. // }
  4191. }
  4192. // method id "androidpublisher.edits.expansionfiles.patch":
  4193. type EditsExpansionfilesPatchCall struct {
  4194. s *Service
  4195. packageNameid string
  4196. editId string
  4197. apkVersionCode int64
  4198. expansionFileType string
  4199. expansionfile *ExpansionFile
  4200. urlParams_ gensupport.URLParams
  4201. ctx_ context.Context
  4202. header_ http.Header
  4203. }
  4204. // Patch: Updates the APK's Expansion File configuration to reference
  4205. // another APK's Expansion Files. To add a new Expansion File use the
  4206. // Upload method. This method supports patch semantics.
  4207. func (r *EditsExpansionfilesService) Patch(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesPatchCall {
  4208. c := &EditsExpansionfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4209. c.packageNameid = packageNameid
  4210. c.editId = editId
  4211. c.apkVersionCode = apkVersionCode
  4212. c.expansionFileType = expansionFileType
  4213. c.expansionfile = expansionfile
  4214. return c
  4215. }
  4216. // Fields allows partial responses to be retrieved. See
  4217. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4218. // for more information.
  4219. func (c *EditsExpansionfilesPatchCall) Fields(s ...googleapi.Field) *EditsExpansionfilesPatchCall {
  4220. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4221. return c
  4222. }
  4223. // Context sets the context to be used in this call's Do method. Any
  4224. // pending HTTP request will be aborted if the provided context is
  4225. // canceled.
  4226. func (c *EditsExpansionfilesPatchCall) Context(ctx context.Context) *EditsExpansionfilesPatchCall {
  4227. c.ctx_ = ctx
  4228. return c
  4229. }
  4230. // Header returns an http.Header that can be modified by the caller to
  4231. // add HTTP headers to the request.
  4232. func (c *EditsExpansionfilesPatchCall) Header() http.Header {
  4233. if c.header_ == nil {
  4234. c.header_ = make(http.Header)
  4235. }
  4236. return c.header_
  4237. }
  4238. func (c *EditsExpansionfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  4239. reqHeaders := make(http.Header)
  4240. for k, v := range c.header_ {
  4241. reqHeaders[k] = v
  4242. }
  4243. reqHeaders.Set("User-Agent", c.s.userAgent())
  4244. var body io.Reader = nil
  4245. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  4246. if err != nil {
  4247. return nil, err
  4248. }
  4249. reqHeaders.Set("Content-Type", "application/json")
  4250. c.urlParams_.Set("alt", alt)
  4251. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4252. urls += "?" + c.urlParams_.Encode()
  4253. req, _ := http.NewRequest("PATCH", urls, body)
  4254. req.Header = reqHeaders
  4255. googleapi.Expand(req.URL, map[string]string{
  4256. "packageName": c.packageNameid,
  4257. "editId": c.editId,
  4258. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4259. "expansionFileType": c.expansionFileType,
  4260. })
  4261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4262. }
  4263. // Do executes the "androidpublisher.edits.expansionfiles.patch" call.
  4264. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4265. // status code is an error. Response headers are in either
  4266. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4267. // at all) in error.(*googleapi.Error).Header. Use
  4268. // googleapi.IsNotModified to check whether the returned error was
  4269. // because http.StatusNotModified was returned.
  4270. func (c *EditsExpansionfilesPatchCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4271. gensupport.SetOptions(c.urlParams_, opts...)
  4272. res, err := c.doRequest("json")
  4273. if res != nil && res.StatusCode == http.StatusNotModified {
  4274. if res.Body != nil {
  4275. res.Body.Close()
  4276. }
  4277. return nil, &googleapi.Error{
  4278. Code: res.StatusCode,
  4279. Header: res.Header,
  4280. }
  4281. }
  4282. if err != nil {
  4283. return nil, err
  4284. }
  4285. defer googleapi.CloseBody(res)
  4286. if err := googleapi.CheckResponse(res); err != nil {
  4287. return nil, err
  4288. }
  4289. ret := &ExpansionFile{
  4290. ServerResponse: googleapi.ServerResponse{
  4291. Header: res.Header,
  4292. HTTPStatusCode: res.StatusCode,
  4293. },
  4294. }
  4295. target := &ret
  4296. if err := gensupport.DecodeResponse(target, res); err != nil {
  4297. return nil, err
  4298. }
  4299. return ret, nil
  4300. // {
  4301. // "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.",
  4302. // "httpMethod": "PATCH",
  4303. // "id": "androidpublisher.edits.expansionfiles.patch",
  4304. // "parameterOrder": [
  4305. // "packageName",
  4306. // "editId",
  4307. // "apkVersionCode",
  4308. // "expansionFileType"
  4309. // ],
  4310. // "parameters": {
  4311. // "apkVersionCode": {
  4312. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4313. // "format": "int32",
  4314. // "location": "path",
  4315. // "required": true,
  4316. // "type": "integer"
  4317. // },
  4318. // "editId": {
  4319. // "description": "Unique identifier for this edit.",
  4320. // "location": "path",
  4321. // "required": true,
  4322. // "type": "string"
  4323. // },
  4324. // "expansionFileType": {
  4325. // "enum": [
  4326. // "main",
  4327. // "patch"
  4328. // ],
  4329. // "enumDescriptions": [
  4330. // "",
  4331. // ""
  4332. // ],
  4333. // "location": "path",
  4334. // "required": true,
  4335. // "type": "string"
  4336. // },
  4337. // "packageName": {
  4338. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4339. // "location": "path",
  4340. // "required": true,
  4341. // "type": "string"
  4342. // }
  4343. // },
  4344. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4345. // "request": {
  4346. // "$ref": "ExpansionFile"
  4347. // },
  4348. // "response": {
  4349. // "$ref": "ExpansionFile"
  4350. // },
  4351. // "scopes": [
  4352. // "https://www.googleapis.com/auth/androidpublisher"
  4353. // ]
  4354. // }
  4355. }
  4356. // method id "androidpublisher.edits.expansionfiles.update":
  4357. type EditsExpansionfilesUpdateCall struct {
  4358. s *Service
  4359. packageNameid string
  4360. editId string
  4361. apkVersionCode int64
  4362. expansionFileType string
  4363. expansionfile *ExpansionFile
  4364. urlParams_ gensupport.URLParams
  4365. ctx_ context.Context
  4366. header_ http.Header
  4367. }
  4368. // Update: Updates the APK's Expansion File configuration to reference
  4369. // another APK's Expansion Files. To add a new Expansion File use the
  4370. // Upload method.
  4371. func (r *EditsExpansionfilesService) Update(packageNameid string, editId string, apkVersionCode int64, expansionFileType string, expansionfile *ExpansionFile) *EditsExpansionfilesUpdateCall {
  4372. c := &EditsExpansionfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4373. c.packageNameid = packageNameid
  4374. c.editId = editId
  4375. c.apkVersionCode = apkVersionCode
  4376. c.expansionFileType = expansionFileType
  4377. c.expansionfile = expansionfile
  4378. return c
  4379. }
  4380. // Fields allows partial responses to be retrieved. See
  4381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4382. // for more information.
  4383. func (c *EditsExpansionfilesUpdateCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUpdateCall {
  4384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4385. return c
  4386. }
  4387. // Context sets the context to be used in this call's Do method. Any
  4388. // pending HTTP request will be aborted if the provided context is
  4389. // canceled.
  4390. func (c *EditsExpansionfilesUpdateCall) Context(ctx context.Context) *EditsExpansionfilesUpdateCall {
  4391. c.ctx_ = ctx
  4392. return c
  4393. }
  4394. // Header returns an http.Header that can be modified by the caller to
  4395. // add HTTP headers to the request.
  4396. func (c *EditsExpansionfilesUpdateCall) Header() http.Header {
  4397. if c.header_ == nil {
  4398. c.header_ = make(http.Header)
  4399. }
  4400. return c.header_
  4401. }
  4402. func (c *EditsExpansionfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  4403. reqHeaders := make(http.Header)
  4404. for k, v := range c.header_ {
  4405. reqHeaders[k] = v
  4406. }
  4407. reqHeaders.Set("User-Agent", c.s.userAgent())
  4408. var body io.Reader = nil
  4409. body, err := googleapi.WithoutDataWrapper.JSONReader(c.expansionfile)
  4410. if err != nil {
  4411. return nil, err
  4412. }
  4413. reqHeaders.Set("Content-Type", "application/json")
  4414. c.urlParams_.Set("alt", alt)
  4415. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4416. urls += "?" + c.urlParams_.Encode()
  4417. req, _ := http.NewRequest("PUT", urls, body)
  4418. req.Header = reqHeaders
  4419. googleapi.Expand(req.URL, map[string]string{
  4420. "packageName": c.packageNameid,
  4421. "editId": c.editId,
  4422. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4423. "expansionFileType": c.expansionFileType,
  4424. })
  4425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4426. }
  4427. // Do executes the "androidpublisher.edits.expansionfiles.update" call.
  4428. // Exactly one of *ExpansionFile or error will be non-nil. Any non-2xx
  4429. // status code is an error. Response headers are in either
  4430. // *ExpansionFile.ServerResponse.Header or (if a response was returned
  4431. // at all) in error.(*googleapi.Error).Header. Use
  4432. // googleapi.IsNotModified to check whether the returned error was
  4433. // because http.StatusNotModified was returned.
  4434. func (c *EditsExpansionfilesUpdateCall) Do(opts ...googleapi.CallOption) (*ExpansionFile, error) {
  4435. gensupport.SetOptions(c.urlParams_, opts...)
  4436. res, err := c.doRequest("json")
  4437. if res != nil && res.StatusCode == http.StatusNotModified {
  4438. if res.Body != nil {
  4439. res.Body.Close()
  4440. }
  4441. return nil, &googleapi.Error{
  4442. Code: res.StatusCode,
  4443. Header: res.Header,
  4444. }
  4445. }
  4446. if err != nil {
  4447. return nil, err
  4448. }
  4449. defer googleapi.CloseBody(res)
  4450. if err := googleapi.CheckResponse(res); err != nil {
  4451. return nil, err
  4452. }
  4453. ret := &ExpansionFile{
  4454. ServerResponse: googleapi.ServerResponse{
  4455. Header: res.Header,
  4456. HTTPStatusCode: res.StatusCode,
  4457. },
  4458. }
  4459. target := &ret
  4460. if err := gensupport.DecodeResponse(target, res); err != nil {
  4461. return nil, err
  4462. }
  4463. return ret, nil
  4464. // {
  4465. // "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.",
  4466. // "httpMethod": "PUT",
  4467. // "id": "androidpublisher.edits.expansionfiles.update",
  4468. // "parameterOrder": [
  4469. // "packageName",
  4470. // "editId",
  4471. // "apkVersionCode",
  4472. // "expansionFileType"
  4473. // ],
  4474. // "parameters": {
  4475. // "apkVersionCode": {
  4476. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4477. // "format": "int32",
  4478. // "location": "path",
  4479. // "required": true,
  4480. // "type": "integer"
  4481. // },
  4482. // "editId": {
  4483. // "description": "Unique identifier for this edit.",
  4484. // "location": "path",
  4485. // "required": true,
  4486. // "type": "string"
  4487. // },
  4488. // "expansionFileType": {
  4489. // "enum": [
  4490. // "main",
  4491. // "patch"
  4492. // ],
  4493. // "enumDescriptions": [
  4494. // "",
  4495. // ""
  4496. // ],
  4497. // "location": "path",
  4498. // "required": true,
  4499. // "type": "string"
  4500. // },
  4501. // "packageName": {
  4502. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4503. // "location": "path",
  4504. // "required": true,
  4505. // "type": "string"
  4506. // }
  4507. // },
  4508. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4509. // "request": {
  4510. // "$ref": "ExpansionFile"
  4511. // },
  4512. // "response": {
  4513. // "$ref": "ExpansionFile"
  4514. // },
  4515. // "scopes": [
  4516. // "https://www.googleapis.com/auth/androidpublisher"
  4517. // ]
  4518. // }
  4519. }
  4520. // method id "androidpublisher.edits.expansionfiles.upload":
  4521. type EditsExpansionfilesUploadCall struct {
  4522. s *Service
  4523. packageNameid string
  4524. editId string
  4525. apkVersionCode int64
  4526. expansionFileType string
  4527. urlParams_ gensupport.URLParams
  4528. mediaInfo_ *gensupport.MediaInfo
  4529. ctx_ context.Context
  4530. header_ http.Header
  4531. }
  4532. // Upload: Uploads and attaches a new Expansion File to the APK
  4533. // specified.
  4534. func (r *EditsExpansionfilesService) Upload(packageNameid string, editId string, apkVersionCode int64, expansionFileType string) *EditsExpansionfilesUploadCall {
  4535. c := &EditsExpansionfilesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4536. c.packageNameid = packageNameid
  4537. c.editId = editId
  4538. c.apkVersionCode = apkVersionCode
  4539. c.expansionFileType = expansionFileType
  4540. return c
  4541. }
  4542. // Media specifies the media to upload in one or more chunks. The chunk
  4543. // size may be controlled by supplying a MediaOption generated by
  4544. // googleapi.ChunkSize. The chunk size defaults to
  4545. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  4546. // upload request will be determined by sniffing the contents of r,
  4547. // unless a MediaOption generated by googleapi.ContentType is
  4548. // supplied.
  4549. // At most one of Media and ResumableMedia may be set.
  4550. func (c *EditsExpansionfilesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsExpansionfilesUploadCall {
  4551. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  4552. return c
  4553. }
  4554. // ResumableMedia specifies the media to upload in chunks and can be
  4555. // canceled with ctx.
  4556. //
  4557. // Deprecated: use Media instead.
  4558. //
  4559. // At most one of Media and ResumableMedia may be set. mediaType
  4560. // identifies the MIME media type of the upload, such as "image/png". If
  4561. // mediaType is "", it will be auto-detected. The provided ctx will
  4562. // supersede any context previously provided to the Context method.
  4563. func (c *EditsExpansionfilesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsExpansionfilesUploadCall {
  4564. c.ctx_ = ctx
  4565. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  4566. return c
  4567. }
  4568. // ProgressUpdater provides a callback function that will be called
  4569. // after every chunk. It should be a low-latency function in order to
  4570. // not slow down the upload operation. This should only be called when
  4571. // using ResumableMedia (as opposed to Media).
  4572. func (c *EditsExpansionfilesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsExpansionfilesUploadCall {
  4573. c.mediaInfo_.SetProgressUpdater(pu)
  4574. return c
  4575. }
  4576. // Fields allows partial responses to be retrieved. See
  4577. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4578. // for more information.
  4579. func (c *EditsExpansionfilesUploadCall) Fields(s ...googleapi.Field) *EditsExpansionfilesUploadCall {
  4580. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4581. return c
  4582. }
  4583. // Context sets the context to be used in this call's Do method. Any
  4584. // pending HTTP request will be aborted if the provided context is
  4585. // canceled.
  4586. // This context will supersede any context previously provided to the
  4587. // ResumableMedia method.
  4588. func (c *EditsExpansionfilesUploadCall) Context(ctx context.Context) *EditsExpansionfilesUploadCall {
  4589. c.ctx_ = ctx
  4590. return c
  4591. }
  4592. // Header returns an http.Header that can be modified by the caller to
  4593. // add HTTP headers to the request.
  4594. func (c *EditsExpansionfilesUploadCall) Header() http.Header {
  4595. if c.header_ == nil {
  4596. c.header_ = make(http.Header)
  4597. }
  4598. return c.header_
  4599. }
  4600. func (c *EditsExpansionfilesUploadCall) doRequest(alt string) (*http.Response, error) {
  4601. reqHeaders := make(http.Header)
  4602. for k, v := range c.header_ {
  4603. reqHeaders[k] = v
  4604. }
  4605. reqHeaders.Set("User-Agent", c.s.userAgent())
  4606. var body io.Reader = nil
  4607. c.urlParams_.Set("alt", alt)
  4608. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}")
  4609. if c.mediaInfo_ != nil {
  4610. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  4611. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  4612. }
  4613. if body == nil {
  4614. body = new(bytes.Buffer)
  4615. reqHeaders.Set("Content-Type", "application/json")
  4616. }
  4617. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  4618. defer cleanup()
  4619. urls += "?" + c.urlParams_.Encode()
  4620. req, _ := http.NewRequest("POST", urls, body)
  4621. req.Header = reqHeaders
  4622. gensupport.SetGetBody(req, getBody)
  4623. googleapi.Expand(req.URL, map[string]string{
  4624. "packageName": c.packageNameid,
  4625. "editId": c.editId,
  4626. "apkVersionCode": strconv.FormatInt(c.apkVersionCode, 10),
  4627. "expansionFileType": c.expansionFileType,
  4628. })
  4629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4630. }
  4631. // Do executes the "androidpublisher.edits.expansionfiles.upload" call.
  4632. // Exactly one of *ExpansionFilesUploadResponse or error will be
  4633. // non-nil. Any non-2xx status code is an error. Response headers are in
  4634. // either *ExpansionFilesUploadResponse.ServerResponse.Header or (if a
  4635. // response was returned at all) in error.(*googleapi.Error).Header. Use
  4636. // googleapi.IsNotModified to check whether the returned error was
  4637. // because http.StatusNotModified was returned.
  4638. func (c *EditsExpansionfilesUploadCall) Do(opts ...googleapi.CallOption) (*ExpansionFilesUploadResponse, error) {
  4639. gensupport.SetOptions(c.urlParams_, opts...)
  4640. res, err := c.doRequest("json")
  4641. if res != nil && res.StatusCode == http.StatusNotModified {
  4642. if res.Body != nil {
  4643. res.Body.Close()
  4644. }
  4645. return nil, &googleapi.Error{
  4646. Code: res.StatusCode,
  4647. Header: res.Header,
  4648. }
  4649. }
  4650. if err != nil {
  4651. return nil, err
  4652. }
  4653. defer googleapi.CloseBody(res)
  4654. if err := googleapi.CheckResponse(res); err != nil {
  4655. return nil, err
  4656. }
  4657. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  4658. if rx != nil {
  4659. rx.Client = c.s.client
  4660. rx.UserAgent = c.s.userAgent()
  4661. ctx := c.ctx_
  4662. if ctx == nil {
  4663. ctx = context.TODO()
  4664. }
  4665. res, err = rx.Upload(ctx)
  4666. if err != nil {
  4667. return nil, err
  4668. }
  4669. defer res.Body.Close()
  4670. if err := googleapi.CheckResponse(res); err != nil {
  4671. return nil, err
  4672. }
  4673. }
  4674. ret := &ExpansionFilesUploadResponse{
  4675. ServerResponse: googleapi.ServerResponse{
  4676. Header: res.Header,
  4677. HTTPStatusCode: res.StatusCode,
  4678. },
  4679. }
  4680. target := &ret
  4681. if err := gensupport.DecodeResponse(target, res); err != nil {
  4682. return nil, err
  4683. }
  4684. return ret, nil
  4685. // {
  4686. // "description": "Uploads and attaches a new Expansion File to the APK specified.",
  4687. // "httpMethod": "POST",
  4688. // "id": "androidpublisher.edits.expansionfiles.upload",
  4689. // "mediaUpload": {
  4690. // "accept": [
  4691. // "application/octet-stream"
  4692. // ],
  4693. // "maxSize": "2048MB",
  4694. // "protocols": {
  4695. // "resumable": {
  4696. // "multipart": true,
  4697. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  4698. // },
  4699. // "simple": {
  4700. // "multipart": true,
  4701. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}"
  4702. // }
  4703. // }
  4704. // },
  4705. // "parameterOrder": [
  4706. // "packageName",
  4707. // "editId",
  4708. // "apkVersionCode",
  4709. // "expansionFileType"
  4710. // ],
  4711. // "parameters": {
  4712. // "apkVersionCode": {
  4713. // "description": "The version code of the APK whose Expansion File configuration is being read or modified.",
  4714. // "format": "int32",
  4715. // "location": "path",
  4716. // "required": true,
  4717. // "type": "integer"
  4718. // },
  4719. // "editId": {
  4720. // "description": "Unique identifier for this edit.",
  4721. // "location": "path",
  4722. // "required": true,
  4723. // "type": "string"
  4724. // },
  4725. // "expansionFileType": {
  4726. // "enum": [
  4727. // "main",
  4728. // "patch"
  4729. // ],
  4730. // "enumDescriptions": [
  4731. // "",
  4732. // ""
  4733. // ],
  4734. // "location": "path",
  4735. // "required": true,
  4736. // "type": "string"
  4737. // },
  4738. // "packageName": {
  4739. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4740. // "location": "path",
  4741. // "required": true,
  4742. // "type": "string"
  4743. // }
  4744. // },
  4745. // "path": "{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}",
  4746. // "response": {
  4747. // "$ref": "ExpansionFilesUploadResponse"
  4748. // },
  4749. // "scopes": [
  4750. // "https://www.googleapis.com/auth/androidpublisher"
  4751. // ],
  4752. // "supportsMediaUpload": true
  4753. // }
  4754. }
  4755. // method id "androidpublisher.edits.images.delete":
  4756. type EditsImagesDeleteCall struct {
  4757. s *Service
  4758. packageNameid string
  4759. editId string
  4760. language string
  4761. imageType string
  4762. imageId string
  4763. urlParams_ gensupport.URLParams
  4764. ctx_ context.Context
  4765. header_ http.Header
  4766. }
  4767. // Delete: Deletes the image (specified by id) from the edit.
  4768. func (r *EditsImagesService) Delete(packageNameid string, editId string, language string, imageType string, imageId string) *EditsImagesDeleteCall {
  4769. c := &EditsImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4770. c.packageNameid = packageNameid
  4771. c.editId = editId
  4772. c.language = language
  4773. c.imageType = imageType
  4774. c.imageId = imageId
  4775. return c
  4776. }
  4777. // Fields allows partial responses to be retrieved. See
  4778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4779. // for more information.
  4780. func (c *EditsImagesDeleteCall) Fields(s ...googleapi.Field) *EditsImagesDeleteCall {
  4781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4782. return c
  4783. }
  4784. // Context sets the context to be used in this call's Do method. Any
  4785. // pending HTTP request will be aborted if the provided context is
  4786. // canceled.
  4787. func (c *EditsImagesDeleteCall) Context(ctx context.Context) *EditsImagesDeleteCall {
  4788. c.ctx_ = ctx
  4789. return c
  4790. }
  4791. // Header returns an http.Header that can be modified by the caller to
  4792. // add HTTP headers to the request.
  4793. func (c *EditsImagesDeleteCall) Header() http.Header {
  4794. if c.header_ == nil {
  4795. c.header_ = make(http.Header)
  4796. }
  4797. return c.header_
  4798. }
  4799. func (c *EditsImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4800. reqHeaders := make(http.Header)
  4801. for k, v := range c.header_ {
  4802. reqHeaders[k] = v
  4803. }
  4804. reqHeaders.Set("User-Agent", c.s.userAgent())
  4805. var body io.Reader = nil
  4806. c.urlParams_.Set("alt", alt)
  4807. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}")
  4808. urls += "?" + c.urlParams_.Encode()
  4809. req, _ := http.NewRequest("DELETE", urls, body)
  4810. req.Header = reqHeaders
  4811. googleapi.Expand(req.URL, map[string]string{
  4812. "packageName": c.packageNameid,
  4813. "editId": c.editId,
  4814. "language": c.language,
  4815. "imageType": c.imageType,
  4816. "imageId": c.imageId,
  4817. })
  4818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4819. }
  4820. // Do executes the "androidpublisher.edits.images.delete" call.
  4821. func (c *EditsImagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  4822. gensupport.SetOptions(c.urlParams_, opts...)
  4823. res, err := c.doRequest("json")
  4824. if err != nil {
  4825. return err
  4826. }
  4827. defer googleapi.CloseBody(res)
  4828. if err := googleapi.CheckResponse(res); err != nil {
  4829. return err
  4830. }
  4831. return nil
  4832. // {
  4833. // "description": "Deletes the image (specified by id) from the edit.",
  4834. // "httpMethod": "DELETE",
  4835. // "id": "androidpublisher.edits.images.delete",
  4836. // "parameterOrder": [
  4837. // "packageName",
  4838. // "editId",
  4839. // "language",
  4840. // "imageType",
  4841. // "imageId"
  4842. // ],
  4843. // "parameters": {
  4844. // "editId": {
  4845. // "description": "Unique identifier for this edit.",
  4846. // "location": "path",
  4847. // "required": true,
  4848. // "type": "string"
  4849. // },
  4850. // "imageId": {
  4851. // "description": "Unique identifier an image within the set of images attached to this edit.",
  4852. // "location": "path",
  4853. // "required": true,
  4854. // "type": "string"
  4855. // },
  4856. // "imageType": {
  4857. // "enum": [
  4858. // "featureGraphic",
  4859. // "icon",
  4860. // "phoneScreenshots",
  4861. // "promoGraphic",
  4862. // "sevenInchScreenshots",
  4863. // "tenInchScreenshots",
  4864. // "tvBanner",
  4865. // "tvScreenshots",
  4866. // "wearScreenshots"
  4867. // ],
  4868. // "enumDescriptions": [
  4869. // "",
  4870. // "",
  4871. // "",
  4872. // "",
  4873. // "",
  4874. // "",
  4875. // "",
  4876. // "",
  4877. // ""
  4878. // ],
  4879. // "location": "path",
  4880. // "required": true,
  4881. // "type": "string"
  4882. // },
  4883. // "language": {
  4884. // "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\".",
  4885. // "location": "path",
  4886. // "required": true,
  4887. // "type": "string"
  4888. // },
  4889. // "packageName": {
  4890. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  4891. // "location": "path",
  4892. // "required": true,
  4893. // "type": "string"
  4894. // }
  4895. // },
  4896. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}",
  4897. // "scopes": [
  4898. // "https://www.googleapis.com/auth/androidpublisher"
  4899. // ]
  4900. // }
  4901. }
  4902. // method id "androidpublisher.edits.images.deleteall":
  4903. type EditsImagesDeleteallCall struct {
  4904. s *Service
  4905. packageNameid string
  4906. editId string
  4907. language string
  4908. imageType string
  4909. urlParams_ gensupport.URLParams
  4910. ctx_ context.Context
  4911. header_ http.Header
  4912. }
  4913. // Deleteall: Deletes all images for the specified language and image
  4914. // type.
  4915. func (r *EditsImagesService) Deleteall(packageNameid string, editId string, language string, imageType string) *EditsImagesDeleteallCall {
  4916. c := &EditsImagesDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4917. c.packageNameid = packageNameid
  4918. c.editId = editId
  4919. c.language = language
  4920. c.imageType = imageType
  4921. return c
  4922. }
  4923. // Fields allows partial responses to be retrieved. See
  4924. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4925. // for more information.
  4926. func (c *EditsImagesDeleteallCall) Fields(s ...googleapi.Field) *EditsImagesDeleteallCall {
  4927. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4928. return c
  4929. }
  4930. // Context sets the context to be used in this call's Do method. Any
  4931. // pending HTTP request will be aborted if the provided context is
  4932. // canceled.
  4933. func (c *EditsImagesDeleteallCall) Context(ctx context.Context) *EditsImagesDeleteallCall {
  4934. c.ctx_ = ctx
  4935. return c
  4936. }
  4937. // Header returns an http.Header that can be modified by the caller to
  4938. // add HTTP headers to the request.
  4939. func (c *EditsImagesDeleteallCall) Header() http.Header {
  4940. if c.header_ == nil {
  4941. c.header_ = make(http.Header)
  4942. }
  4943. return c.header_
  4944. }
  4945. func (c *EditsImagesDeleteallCall) doRequest(alt string) (*http.Response, error) {
  4946. reqHeaders := make(http.Header)
  4947. for k, v := range c.header_ {
  4948. reqHeaders[k] = v
  4949. }
  4950. reqHeaders.Set("User-Agent", c.s.userAgent())
  4951. var body io.Reader = nil
  4952. c.urlParams_.Set("alt", alt)
  4953. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  4954. urls += "?" + c.urlParams_.Encode()
  4955. req, _ := http.NewRequest("DELETE", urls, body)
  4956. req.Header = reqHeaders
  4957. googleapi.Expand(req.URL, map[string]string{
  4958. "packageName": c.packageNameid,
  4959. "editId": c.editId,
  4960. "language": c.language,
  4961. "imageType": c.imageType,
  4962. })
  4963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4964. }
  4965. // Do executes the "androidpublisher.edits.images.deleteall" call.
  4966. // Exactly one of *ImagesDeleteAllResponse or error will be non-nil. Any
  4967. // non-2xx status code is an error. Response headers are in either
  4968. // *ImagesDeleteAllResponse.ServerResponse.Header or (if a response was
  4969. // returned at all) in error.(*googleapi.Error).Header. Use
  4970. // googleapi.IsNotModified to check whether the returned error was
  4971. // because http.StatusNotModified was returned.
  4972. func (c *EditsImagesDeleteallCall) Do(opts ...googleapi.CallOption) (*ImagesDeleteAllResponse, error) {
  4973. gensupport.SetOptions(c.urlParams_, opts...)
  4974. res, err := c.doRequest("json")
  4975. if res != nil && res.StatusCode == http.StatusNotModified {
  4976. if res.Body != nil {
  4977. res.Body.Close()
  4978. }
  4979. return nil, &googleapi.Error{
  4980. Code: res.StatusCode,
  4981. Header: res.Header,
  4982. }
  4983. }
  4984. if err != nil {
  4985. return nil, err
  4986. }
  4987. defer googleapi.CloseBody(res)
  4988. if err := googleapi.CheckResponse(res); err != nil {
  4989. return nil, err
  4990. }
  4991. ret := &ImagesDeleteAllResponse{
  4992. ServerResponse: googleapi.ServerResponse{
  4993. Header: res.Header,
  4994. HTTPStatusCode: res.StatusCode,
  4995. },
  4996. }
  4997. target := &ret
  4998. if err := gensupport.DecodeResponse(target, res); err != nil {
  4999. return nil, err
  5000. }
  5001. return ret, nil
  5002. // {
  5003. // "description": "Deletes all images for the specified language and image type.",
  5004. // "httpMethod": "DELETE",
  5005. // "id": "androidpublisher.edits.images.deleteall",
  5006. // "parameterOrder": [
  5007. // "packageName",
  5008. // "editId",
  5009. // "language",
  5010. // "imageType"
  5011. // ],
  5012. // "parameters": {
  5013. // "editId": {
  5014. // "description": "Unique identifier for this edit.",
  5015. // "location": "path",
  5016. // "required": true,
  5017. // "type": "string"
  5018. // },
  5019. // "imageType": {
  5020. // "enum": [
  5021. // "featureGraphic",
  5022. // "icon",
  5023. // "phoneScreenshots",
  5024. // "promoGraphic",
  5025. // "sevenInchScreenshots",
  5026. // "tenInchScreenshots",
  5027. // "tvBanner",
  5028. // "tvScreenshots",
  5029. // "wearScreenshots"
  5030. // ],
  5031. // "enumDescriptions": [
  5032. // "",
  5033. // "",
  5034. // "",
  5035. // "",
  5036. // "",
  5037. // "",
  5038. // "",
  5039. // "",
  5040. // ""
  5041. // ],
  5042. // "location": "path",
  5043. // "required": true,
  5044. // "type": "string"
  5045. // },
  5046. // "language": {
  5047. // "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\".",
  5048. // "location": "path",
  5049. // "required": true,
  5050. // "type": "string"
  5051. // },
  5052. // "packageName": {
  5053. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5054. // "location": "path",
  5055. // "required": true,
  5056. // "type": "string"
  5057. // }
  5058. // },
  5059. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5060. // "response": {
  5061. // "$ref": "ImagesDeleteAllResponse"
  5062. // },
  5063. // "scopes": [
  5064. // "https://www.googleapis.com/auth/androidpublisher"
  5065. // ]
  5066. // }
  5067. }
  5068. // method id "androidpublisher.edits.images.list":
  5069. type EditsImagesListCall struct {
  5070. s *Service
  5071. packageNameid string
  5072. editId string
  5073. language string
  5074. imageType string
  5075. urlParams_ gensupport.URLParams
  5076. ifNoneMatch_ string
  5077. ctx_ context.Context
  5078. header_ http.Header
  5079. }
  5080. // List: Lists all images for the specified language and image type.
  5081. func (r *EditsImagesService) List(packageNameid string, editId string, language string, imageType string) *EditsImagesListCall {
  5082. c := &EditsImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5083. c.packageNameid = packageNameid
  5084. c.editId = editId
  5085. c.language = language
  5086. c.imageType = imageType
  5087. return c
  5088. }
  5089. // Fields allows partial responses to be retrieved. See
  5090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5091. // for more information.
  5092. func (c *EditsImagesListCall) Fields(s ...googleapi.Field) *EditsImagesListCall {
  5093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5094. return c
  5095. }
  5096. // IfNoneMatch sets the optional parameter which makes the operation
  5097. // fail if the object's ETag matches the given value. This is useful for
  5098. // getting updates only after the object has changed since the last
  5099. // request. Use googleapi.IsNotModified to check whether the response
  5100. // error from Do is the result of In-None-Match.
  5101. func (c *EditsImagesListCall) IfNoneMatch(entityTag string) *EditsImagesListCall {
  5102. c.ifNoneMatch_ = entityTag
  5103. return c
  5104. }
  5105. // Context sets the context to be used in this call's Do method. Any
  5106. // pending HTTP request will be aborted if the provided context is
  5107. // canceled.
  5108. func (c *EditsImagesListCall) Context(ctx context.Context) *EditsImagesListCall {
  5109. c.ctx_ = ctx
  5110. return c
  5111. }
  5112. // Header returns an http.Header that can be modified by the caller to
  5113. // add HTTP headers to the request.
  5114. func (c *EditsImagesListCall) Header() http.Header {
  5115. if c.header_ == nil {
  5116. c.header_ = make(http.Header)
  5117. }
  5118. return c.header_
  5119. }
  5120. func (c *EditsImagesListCall) doRequest(alt string) (*http.Response, error) {
  5121. reqHeaders := make(http.Header)
  5122. for k, v := range c.header_ {
  5123. reqHeaders[k] = v
  5124. }
  5125. reqHeaders.Set("User-Agent", c.s.userAgent())
  5126. if c.ifNoneMatch_ != "" {
  5127. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5128. }
  5129. var body io.Reader = nil
  5130. c.urlParams_.Set("alt", alt)
  5131. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5132. urls += "?" + c.urlParams_.Encode()
  5133. req, _ := http.NewRequest("GET", urls, body)
  5134. req.Header = reqHeaders
  5135. googleapi.Expand(req.URL, map[string]string{
  5136. "packageName": c.packageNameid,
  5137. "editId": c.editId,
  5138. "language": c.language,
  5139. "imageType": c.imageType,
  5140. })
  5141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5142. }
  5143. // Do executes the "androidpublisher.edits.images.list" call.
  5144. // Exactly one of *ImagesListResponse or error will be non-nil. Any
  5145. // non-2xx status code is an error. Response headers are in either
  5146. // *ImagesListResponse.ServerResponse.Header or (if a response was
  5147. // returned at all) in error.(*googleapi.Error).Header. Use
  5148. // googleapi.IsNotModified to check whether the returned error was
  5149. // because http.StatusNotModified was returned.
  5150. func (c *EditsImagesListCall) Do(opts ...googleapi.CallOption) (*ImagesListResponse, error) {
  5151. gensupport.SetOptions(c.urlParams_, opts...)
  5152. res, err := c.doRequest("json")
  5153. if res != nil && res.StatusCode == http.StatusNotModified {
  5154. if res.Body != nil {
  5155. res.Body.Close()
  5156. }
  5157. return nil, &googleapi.Error{
  5158. Code: res.StatusCode,
  5159. Header: res.Header,
  5160. }
  5161. }
  5162. if err != nil {
  5163. return nil, err
  5164. }
  5165. defer googleapi.CloseBody(res)
  5166. if err := googleapi.CheckResponse(res); err != nil {
  5167. return nil, err
  5168. }
  5169. ret := &ImagesListResponse{
  5170. ServerResponse: googleapi.ServerResponse{
  5171. Header: res.Header,
  5172. HTTPStatusCode: res.StatusCode,
  5173. },
  5174. }
  5175. target := &ret
  5176. if err := gensupport.DecodeResponse(target, res); err != nil {
  5177. return nil, err
  5178. }
  5179. return ret, nil
  5180. // {
  5181. // "description": "Lists all images for the specified language and image type.",
  5182. // "httpMethod": "GET",
  5183. // "id": "androidpublisher.edits.images.list",
  5184. // "parameterOrder": [
  5185. // "packageName",
  5186. // "editId",
  5187. // "language",
  5188. // "imageType"
  5189. // ],
  5190. // "parameters": {
  5191. // "editId": {
  5192. // "description": "Unique identifier for this edit.",
  5193. // "location": "path",
  5194. // "required": true,
  5195. // "type": "string"
  5196. // },
  5197. // "imageType": {
  5198. // "enum": [
  5199. // "featureGraphic",
  5200. // "icon",
  5201. // "phoneScreenshots",
  5202. // "promoGraphic",
  5203. // "sevenInchScreenshots",
  5204. // "tenInchScreenshots",
  5205. // "tvBanner",
  5206. // "tvScreenshots",
  5207. // "wearScreenshots"
  5208. // ],
  5209. // "enumDescriptions": [
  5210. // "",
  5211. // "",
  5212. // "",
  5213. // "",
  5214. // "",
  5215. // "",
  5216. // "",
  5217. // "",
  5218. // ""
  5219. // ],
  5220. // "location": "path",
  5221. // "required": true,
  5222. // "type": "string"
  5223. // },
  5224. // "language": {
  5225. // "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\".",
  5226. // "location": "path",
  5227. // "required": true,
  5228. // "type": "string"
  5229. // },
  5230. // "packageName": {
  5231. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5232. // "location": "path",
  5233. // "required": true,
  5234. // "type": "string"
  5235. // }
  5236. // },
  5237. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5238. // "response": {
  5239. // "$ref": "ImagesListResponse"
  5240. // },
  5241. // "scopes": [
  5242. // "https://www.googleapis.com/auth/androidpublisher"
  5243. // ]
  5244. // }
  5245. }
  5246. // method id "androidpublisher.edits.images.upload":
  5247. type EditsImagesUploadCall struct {
  5248. s *Service
  5249. packageNameid string
  5250. editId string
  5251. language string
  5252. imageType string
  5253. urlParams_ gensupport.URLParams
  5254. mediaInfo_ *gensupport.MediaInfo
  5255. ctx_ context.Context
  5256. header_ http.Header
  5257. }
  5258. // Upload: Uploads a new image and adds it to the list of images for the
  5259. // specified language and image type.
  5260. func (r *EditsImagesService) Upload(packageNameid string, editId string, language string, imageType string) *EditsImagesUploadCall {
  5261. c := &EditsImagesUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5262. c.packageNameid = packageNameid
  5263. c.editId = editId
  5264. c.language = language
  5265. c.imageType = imageType
  5266. return c
  5267. }
  5268. // Media specifies the media to upload in one or more chunks. The chunk
  5269. // size may be controlled by supplying a MediaOption generated by
  5270. // googleapi.ChunkSize. The chunk size defaults to
  5271. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  5272. // upload request will be determined by sniffing the contents of r,
  5273. // unless a MediaOption generated by googleapi.ContentType is
  5274. // supplied.
  5275. // At most one of Media and ResumableMedia may be set.
  5276. func (c *EditsImagesUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *EditsImagesUploadCall {
  5277. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  5278. return c
  5279. }
  5280. // ResumableMedia specifies the media to upload in chunks and can be
  5281. // canceled with ctx.
  5282. //
  5283. // Deprecated: use Media instead.
  5284. //
  5285. // At most one of Media and ResumableMedia may be set. mediaType
  5286. // identifies the MIME media type of the upload, such as "image/png". If
  5287. // mediaType is "", it will be auto-detected. The provided ctx will
  5288. // supersede any context previously provided to the Context method.
  5289. func (c *EditsImagesUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *EditsImagesUploadCall {
  5290. c.ctx_ = ctx
  5291. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  5292. return c
  5293. }
  5294. // ProgressUpdater provides a callback function that will be called
  5295. // after every chunk. It should be a low-latency function in order to
  5296. // not slow down the upload operation. This should only be called when
  5297. // using ResumableMedia (as opposed to Media).
  5298. func (c *EditsImagesUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *EditsImagesUploadCall {
  5299. c.mediaInfo_.SetProgressUpdater(pu)
  5300. return c
  5301. }
  5302. // Fields allows partial responses to be retrieved. See
  5303. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5304. // for more information.
  5305. func (c *EditsImagesUploadCall) Fields(s ...googleapi.Field) *EditsImagesUploadCall {
  5306. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5307. return c
  5308. }
  5309. // Context sets the context to be used in this call's Do method. Any
  5310. // pending HTTP request will be aborted if the provided context is
  5311. // canceled.
  5312. // This context will supersede any context previously provided to the
  5313. // ResumableMedia method.
  5314. func (c *EditsImagesUploadCall) Context(ctx context.Context) *EditsImagesUploadCall {
  5315. c.ctx_ = ctx
  5316. return c
  5317. }
  5318. // Header returns an http.Header that can be modified by the caller to
  5319. // add HTTP headers to the request.
  5320. func (c *EditsImagesUploadCall) Header() http.Header {
  5321. if c.header_ == nil {
  5322. c.header_ = make(http.Header)
  5323. }
  5324. return c.header_
  5325. }
  5326. func (c *EditsImagesUploadCall) doRequest(alt string) (*http.Response, error) {
  5327. reqHeaders := make(http.Header)
  5328. for k, v := range c.header_ {
  5329. reqHeaders[k] = v
  5330. }
  5331. reqHeaders.Set("User-Agent", c.s.userAgent())
  5332. var body io.Reader = nil
  5333. c.urlParams_.Set("alt", alt)
  5334. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}/{imageType}")
  5335. if c.mediaInfo_ != nil {
  5336. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  5337. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  5338. }
  5339. if body == nil {
  5340. body = new(bytes.Buffer)
  5341. reqHeaders.Set("Content-Type", "application/json")
  5342. }
  5343. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  5344. defer cleanup()
  5345. urls += "?" + c.urlParams_.Encode()
  5346. req, _ := http.NewRequest("POST", urls, body)
  5347. req.Header = reqHeaders
  5348. gensupport.SetGetBody(req, getBody)
  5349. googleapi.Expand(req.URL, map[string]string{
  5350. "packageName": c.packageNameid,
  5351. "editId": c.editId,
  5352. "language": c.language,
  5353. "imageType": c.imageType,
  5354. })
  5355. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5356. }
  5357. // Do executes the "androidpublisher.edits.images.upload" call.
  5358. // Exactly one of *ImagesUploadResponse or error will be non-nil. Any
  5359. // non-2xx status code is an error. Response headers are in either
  5360. // *ImagesUploadResponse.ServerResponse.Header or (if a response was
  5361. // returned at all) in error.(*googleapi.Error).Header. Use
  5362. // googleapi.IsNotModified to check whether the returned error was
  5363. // because http.StatusNotModified was returned.
  5364. func (c *EditsImagesUploadCall) Do(opts ...googleapi.CallOption) (*ImagesUploadResponse, error) {
  5365. gensupport.SetOptions(c.urlParams_, opts...)
  5366. res, err := c.doRequest("json")
  5367. if res != nil && res.StatusCode == http.StatusNotModified {
  5368. if res.Body != nil {
  5369. res.Body.Close()
  5370. }
  5371. return nil, &googleapi.Error{
  5372. Code: res.StatusCode,
  5373. Header: res.Header,
  5374. }
  5375. }
  5376. if err != nil {
  5377. return nil, err
  5378. }
  5379. defer googleapi.CloseBody(res)
  5380. if err := googleapi.CheckResponse(res); err != nil {
  5381. return nil, err
  5382. }
  5383. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  5384. if rx != nil {
  5385. rx.Client = c.s.client
  5386. rx.UserAgent = c.s.userAgent()
  5387. ctx := c.ctx_
  5388. if ctx == nil {
  5389. ctx = context.TODO()
  5390. }
  5391. res, err = rx.Upload(ctx)
  5392. if err != nil {
  5393. return nil, err
  5394. }
  5395. defer res.Body.Close()
  5396. if err := googleapi.CheckResponse(res); err != nil {
  5397. return nil, err
  5398. }
  5399. }
  5400. ret := &ImagesUploadResponse{
  5401. ServerResponse: googleapi.ServerResponse{
  5402. Header: res.Header,
  5403. HTTPStatusCode: res.StatusCode,
  5404. },
  5405. }
  5406. target := &ret
  5407. if err := gensupport.DecodeResponse(target, res); err != nil {
  5408. return nil, err
  5409. }
  5410. return ret, nil
  5411. // {
  5412. // "description": "Uploads a new image and adds it to the list of images for the specified language and image type.",
  5413. // "httpMethod": "POST",
  5414. // "id": "androidpublisher.edits.images.upload",
  5415. // "mediaUpload": {
  5416. // "accept": [
  5417. // "image/*"
  5418. // ],
  5419. // "maxSize": "15MB",
  5420. // "protocols": {
  5421. // "resumable": {
  5422. // "multipart": true,
  5423. // "path": "/resumable/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  5424. // },
  5425. // "simple": {
  5426. // "multipart": true,
  5427. // "path": "/upload/androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}"
  5428. // }
  5429. // }
  5430. // },
  5431. // "parameterOrder": [
  5432. // "packageName",
  5433. // "editId",
  5434. // "language",
  5435. // "imageType"
  5436. // ],
  5437. // "parameters": {
  5438. // "editId": {
  5439. // "description": "Unique identifier for this edit.",
  5440. // "location": "path",
  5441. // "required": true,
  5442. // "type": "string"
  5443. // },
  5444. // "imageType": {
  5445. // "enum": [
  5446. // "featureGraphic",
  5447. // "icon",
  5448. // "phoneScreenshots",
  5449. // "promoGraphic",
  5450. // "sevenInchScreenshots",
  5451. // "tenInchScreenshots",
  5452. // "tvBanner",
  5453. // "tvScreenshots",
  5454. // "wearScreenshots"
  5455. // ],
  5456. // "enumDescriptions": [
  5457. // "",
  5458. // "",
  5459. // "",
  5460. // "",
  5461. // "",
  5462. // "",
  5463. // "",
  5464. // "",
  5465. // ""
  5466. // ],
  5467. // "location": "path",
  5468. // "required": true,
  5469. // "type": "string"
  5470. // },
  5471. // "language": {
  5472. // "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\".",
  5473. // "location": "path",
  5474. // "required": true,
  5475. // "type": "string"
  5476. // },
  5477. // "packageName": {
  5478. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5479. // "location": "path",
  5480. // "required": true,
  5481. // "type": "string"
  5482. // }
  5483. // },
  5484. // "path": "{packageName}/edits/{editId}/listings/{language}/{imageType}",
  5485. // "response": {
  5486. // "$ref": "ImagesUploadResponse"
  5487. // },
  5488. // "scopes": [
  5489. // "https://www.googleapis.com/auth/androidpublisher"
  5490. // ],
  5491. // "supportsMediaUpload": true
  5492. // }
  5493. }
  5494. // method id "androidpublisher.edits.listings.delete":
  5495. type EditsListingsDeleteCall struct {
  5496. s *Service
  5497. packageNameid string
  5498. editId string
  5499. language string
  5500. urlParams_ gensupport.URLParams
  5501. ctx_ context.Context
  5502. header_ http.Header
  5503. }
  5504. // Delete: Deletes the specified localized store listing from an edit.
  5505. func (r *EditsListingsService) Delete(packageNameid string, editId string, language string) *EditsListingsDeleteCall {
  5506. c := &EditsListingsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5507. c.packageNameid = packageNameid
  5508. c.editId = editId
  5509. c.language = language
  5510. return c
  5511. }
  5512. // Fields allows partial responses to be retrieved. See
  5513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5514. // for more information.
  5515. func (c *EditsListingsDeleteCall) Fields(s ...googleapi.Field) *EditsListingsDeleteCall {
  5516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5517. return c
  5518. }
  5519. // Context sets the context to be used in this call's Do method. Any
  5520. // pending HTTP request will be aborted if the provided context is
  5521. // canceled.
  5522. func (c *EditsListingsDeleteCall) Context(ctx context.Context) *EditsListingsDeleteCall {
  5523. c.ctx_ = ctx
  5524. return c
  5525. }
  5526. // Header returns an http.Header that can be modified by the caller to
  5527. // add HTTP headers to the request.
  5528. func (c *EditsListingsDeleteCall) Header() http.Header {
  5529. if c.header_ == nil {
  5530. c.header_ = make(http.Header)
  5531. }
  5532. return c.header_
  5533. }
  5534. func (c *EditsListingsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5535. reqHeaders := make(http.Header)
  5536. for k, v := range c.header_ {
  5537. reqHeaders[k] = v
  5538. }
  5539. reqHeaders.Set("User-Agent", c.s.userAgent())
  5540. var body io.Reader = nil
  5541. c.urlParams_.Set("alt", alt)
  5542. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  5543. urls += "?" + c.urlParams_.Encode()
  5544. req, _ := http.NewRequest("DELETE", urls, body)
  5545. req.Header = reqHeaders
  5546. googleapi.Expand(req.URL, map[string]string{
  5547. "packageName": c.packageNameid,
  5548. "editId": c.editId,
  5549. "language": c.language,
  5550. })
  5551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5552. }
  5553. // Do executes the "androidpublisher.edits.listings.delete" call.
  5554. func (c *EditsListingsDeleteCall) Do(opts ...googleapi.CallOption) error {
  5555. gensupport.SetOptions(c.urlParams_, opts...)
  5556. res, err := c.doRequest("json")
  5557. if err != nil {
  5558. return err
  5559. }
  5560. defer googleapi.CloseBody(res)
  5561. if err := googleapi.CheckResponse(res); err != nil {
  5562. return err
  5563. }
  5564. return nil
  5565. // {
  5566. // "description": "Deletes the specified localized store listing from an edit.",
  5567. // "httpMethod": "DELETE",
  5568. // "id": "androidpublisher.edits.listings.delete",
  5569. // "parameterOrder": [
  5570. // "packageName",
  5571. // "editId",
  5572. // "language"
  5573. // ],
  5574. // "parameters": {
  5575. // "editId": {
  5576. // "description": "Unique identifier for this edit.",
  5577. // "location": "path",
  5578. // "required": true,
  5579. // "type": "string"
  5580. // },
  5581. // "language": {
  5582. // "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\".",
  5583. // "location": "path",
  5584. // "required": true,
  5585. // "type": "string"
  5586. // },
  5587. // "packageName": {
  5588. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5589. // "location": "path",
  5590. // "required": true,
  5591. // "type": "string"
  5592. // }
  5593. // },
  5594. // "path": "{packageName}/edits/{editId}/listings/{language}",
  5595. // "scopes": [
  5596. // "https://www.googleapis.com/auth/androidpublisher"
  5597. // ]
  5598. // }
  5599. }
  5600. // method id "androidpublisher.edits.listings.deleteall":
  5601. type EditsListingsDeleteallCall struct {
  5602. s *Service
  5603. packageNameid string
  5604. editId string
  5605. urlParams_ gensupport.URLParams
  5606. ctx_ context.Context
  5607. header_ http.Header
  5608. }
  5609. // Deleteall: Deletes all localized listings from an edit.
  5610. func (r *EditsListingsService) Deleteall(packageNameid string, editId string) *EditsListingsDeleteallCall {
  5611. c := &EditsListingsDeleteallCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5612. c.packageNameid = packageNameid
  5613. c.editId = editId
  5614. return c
  5615. }
  5616. // Fields allows partial responses to be retrieved. See
  5617. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5618. // for more information.
  5619. func (c *EditsListingsDeleteallCall) Fields(s ...googleapi.Field) *EditsListingsDeleteallCall {
  5620. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5621. return c
  5622. }
  5623. // Context sets the context to be used in this call's Do method. Any
  5624. // pending HTTP request will be aborted if the provided context is
  5625. // canceled.
  5626. func (c *EditsListingsDeleteallCall) Context(ctx context.Context) *EditsListingsDeleteallCall {
  5627. c.ctx_ = ctx
  5628. return c
  5629. }
  5630. // Header returns an http.Header that can be modified by the caller to
  5631. // add HTTP headers to the request.
  5632. func (c *EditsListingsDeleteallCall) Header() http.Header {
  5633. if c.header_ == nil {
  5634. c.header_ = make(http.Header)
  5635. }
  5636. return c.header_
  5637. }
  5638. func (c *EditsListingsDeleteallCall) doRequest(alt string) (*http.Response, error) {
  5639. reqHeaders := make(http.Header)
  5640. for k, v := range c.header_ {
  5641. reqHeaders[k] = v
  5642. }
  5643. reqHeaders.Set("User-Agent", c.s.userAgent())
  5644. var body io.Reader = nil
  5645. c.urlParams_.Set("alt", alt)
  5646. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  5647. urls += "?" + c.urlParams_.Encode()
  5648. req, _ := http.NewRequest("DELETE", urls, body)
  5649. req.Header = reqHeaders
  5650. googleapi.Expand(req.URL, map[string]string{
  5651. "packageName": c.packageNameid,
  5652. "editId": c.editId,
  5653. })
  5654. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5655. }
  5656. // Do executes the "androidpublisher.edits.listings.deleteall" call.
  5657. func (c *EditsListingsDeleteallCall) Do(opts ...googleapi.CallOption) error {
  5658. gensupport.SetOptions(c.urlParams_, opts...)
  5659. res, err := c.doRequest("json")
  5660. if err != nil {
  5661. return err
  5662. }
  5663. defer googleapi.CloseBody(res)
  5664. if err := googleapi.CheckResponse(res); err != nil {
  5665. return err
  5666. }
  5667. return nil
  5668. // {
  5669. // "description": "Deletes all localized listings from an edit.",
  5670. // "httpMethod": "DELETE",
  5671. // "id": "androidpublisher.edits.listings.deleteall",
  5672. // "parameterOrder": [
  5673. // "packageName",
  5674. // "editId"
  5675. // ],
  5676. // "parameters": {
  5677. // "editId": {
  5678. // "description": "Unique identifier for this edit.",
  5679. // "location": "path",
  5680. // "required": true,
  5681. // "type": "string"
  5682. // },
  5683. // "packageName": {
  5684. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5685. // "location": "path",
  5686. // "required": true,
  5687. // "type": "string"
  5688. // }
  5689. // },
  5690. // "path": "{packageName}/edits/{editId}/listings",
  5691. // "scopes": [
  5692. // "https://www.googleapis.com/auth/androidpublisher"
  5693. // ]
  5694. // }
  5695. }
  5696. // method id "androidpublisher.edits.listings.get":
  5697. type EditsListingsGetCall struct {
  5698. s *Service
  5699. packageNameid string
  5700. editId string
  5701. language string
  5702. urlParams_ gensupport.URLParams
  5703. ifNoneMatch_ string
  5704. ctx_ context.Context
  5705. header_ http.Header
  5706. }
  5707. // Get: Fetches information about a localized store listing.
  5708. func (r *EditsListingsService) Get(packageNameid string, editId string, language string) *EditsListingsGetCall {
  5709. c := &EditsListingsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5710. c.packageNameid = packageNameid
  5711. c.editId = editId
  5712. c.language = language
  5713. return c
  5714. }
  5715. // Fields allows partial responses to be retrieved. See
  5716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5717. // for more information.
  5718. func (c *EditsListingsGetCall) Fields(s ...googleapi.Field) *EditsListingsGetCall {
  5719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5720. return c
  5721. }
  5722. // IfNoneMatch sets the optional parameter which makes the operation
  5723. // fail if the object's ETag matches the given value. This is useful for
  5724. // getting updates only after the object has changed since the last
  5725. // request. Use googleapi.IsNotModified to check whether the response
  5726. // error from Do is the result of In-None-Match.
  5727. func (c *EditsListingsGetCall) IfNoneMatch(entityTag string) *EditsListingsGetCall {
  5728. c.ifNoneMatch_ = entityTag
  5729. return c
  5730. }
  5731. // Context sets the context to be used in this call's Do method. Any
  5732. // pending HTTP request will be aborted if the provided context is
  5733. // canceled.
  5734. func (c *EditsListingsGetCall) Context(ctx context.Context) *EditsListingsGetCall {
  5735. c.ctx_ = ctx
  5736. return c
  5737. }
  5738. // Header returns an http.Header that can be modified by the caller to
  5739. // add HTTP headers to the request.
  5740. func (c *EditsListingsGetCall) Header() http.Header {
  5741. if c.header_ == nil {
  5742. c.header_ = make(http.Header)
  5743. }
  5744. return c.header_
  5745. }
  5746. func (c *EditsListingsGetCall) doRequest(alt string) (*http.Response, error) {
  5747. reqHeaders := make(http.Header)
  5748. for k, v := range c.header_ {
  5749. reqHeaders[k] = v
  5750. }
  5751. reqHeaders.Set("User-Agent", c.s.userAgent())
  5752. if c.ifNoneMatch_ != "" {
  5753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5754. }
  5755. var body io.Reader = nil
  5756. c.urlParams_.Set("alt", alt)
  5757. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  5758. urls += "?" + c.urlParams_.Encode()
  5759. req, _ := http.NewRequest("GET", urls, body)
  5760. req.Header = reqHeaders
  5761. googleapi.Expand(req.URL, map[string]string{
  5762. "packageName": c.packageNameid,
  5763. "editId": c.editId,
  5764. "language": c.language,
  5765. })
  5766. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5767. }
  5768. // Do executes the "androidpublisher.edits.listings.get" call.
  5769. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  5770. // code is an error. Response headers are in either
  5771. // *Listing.ServerResponse.Header or (if a response was returned at all)
  5772. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5773. // check whether the returned error was because http.StatusNotModified
  5774. // was returned.
  5775. func (c *EditsListingsGetCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  5776. gensupport.SetOptions(c.urlParams_, opts...)
  5777. res, err := c.doRequest("json")
  5778. if res != nil && res.StatusCode == http.StatusNotModified {
  5779. if res.Body != nil {
  5780. res.Body.Close()
  5781. }
  5782. return nil, &googleapi.Error{
  5783. Code: res.StatusCode,
  5784. Header: res.Header,
  5785. }
  5786. }
  5787. if err != nil {
  5788. return nil, err
  5789. }
  5790. defer googleapi.CloseBody(res)
  5791. if err := googleapi.CheckResponse(res); err != nil {
  5792. return nil, err
  5793. }
  5794. ret := &Listing{
  5795. ServerResponse: googleapi.ServerResponse{
  5796. Header: res.Header,
  5797. HTTPStatusCode: res.StatusCode,
  5798. },
  5799. }
  5800. target := &ret
  5801. if err := gensupport.DecodeResponse(target, res); err != nil {
  5802. return nil, err
  5803. }
  5804. return ret, nil
  5805. // {
  5806. // "description": "Fetches information about a localized store listing.",
  5807. // "httpMethod": "GET",
  5808. // "id": "androidpublisher.edits.listings.get",
  5809. // "parameterOrder": [
  5810. // "packageName",
  5811. // "editId",
  5812. // "language"
  5813. // ],
  5814. // "parameters": {
  5815. // "editId": {
  5816. // "description": "Unique identifier for this edit.",
  5817. // "location": "path",
  5818. // "required": true,
  5819. // "type": "string"
  5820. // },
  5821. // "language": {
  5822. // "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\".",
  5823. // "location": "path",
  5824. // "required": true,
  5825. // "type": "string"
  5826. // },
  5827. // "packageName": {
  5828. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5829. // "location": "path",
  5830. // "required": true,
  5831. // "type": "string"
  5832. // }
  5833. // },
  5834. // "path": "{packageName}/edits/{editId}/listings/{language}",
  5835. // "response": {
  5836. // "$ref": "Listing"
  5837. // },
  5838. // "scopes": [
  5839. // "https://www.googleapis.com/auth/androidpublisher"
  5840. // ]
  5841. // }
  5842. }
  5843. // method id "androidpublisher.edits.listings.list":
  5844. type EditsListingsListCall struct {
  5845. s *Service
  5846. packageNameid string
  5847. editId string
  5848. urlParams_ gensupport.URLParams
  5849. ifNoneMatch_ string
  5850. ctx_ context.Context
  5851. header_ http.Header
  5852. }
  5853. // List: Returns all of the localized store listings attached to this
  5854. // edit.
  5855. func (r *EditsListingsService) List(packageNameid string, editId string) *EditsListingsListCall {
  5856. c := &EditsListingsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5857. c.packageNameid = packageNameid
  5858. c.editId = editId
  5859. return c
  5860. }
  5861. // Fields allows partial responses to be retrieved. See
  5862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5863. // for more information.
  5864. func (c *EditsListingsListCall) Fields(s ...googleapi.Field) *EditsListingsListCall {
  5865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5866. return c
  5867. }
  5868. // IfNoneMatch sets the optional parameter which makes the operation
  5869. // fail if the object's ETag matches the given value. This is useful for
  5870. // getting updates only after the object has changed since the last
  5871. // request. Use googleapi.IsNotModified to check whether the response
  5872. // error from Do is the result of In-None-Match.
  5873. func (c *EditsListingsListCall) IfNoneMatch(entityTag string) *EditsListingsListCall {
  5874. c.ifNoneMatch_ = entityTag
  5875. return c
  5876. }
  5877. // Context sets the context to be used in this call's Do method. Any
  5878. // pending HTTP request will be aborted if the provided context is
  5879. // canceled.
  5880. func (c *EditsListingsListCall) Context(ctx context.Context) *EditsListingsListCall {
  5881. c.ctx_ = ctx
  5882. return c
  5883. }
  5884. // Header returns an http.Header that can be modified by the caller to
  5885. // add HTTP headers to the request.
  5886. func (c *EditsListingsListCall) Header() http.Header {
  5887. if c.header_ == nil {
  5888. c.header_ = make(http.Header)
  5889. }
  5890. return c.header_
  5891. }
  5892. func (c *EditsListingsListCall) doRequest(alt string) (*http.Response, error) {
  5893. reqHeaders := make(http.Header)
  5894. for k, v := range c.header_ {
  5895. reqHeaders[k] = v
  5896. }
  5897. reqHeaders.Set("User-Agent", c.s.userAgent())
  5898. if c.ifNoneMatch_ != "" {
  5899. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5900. }
  5901. var body io.Reader = nil
  5902. c.urlParams_.Set("alt", alt)
  5903. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings")
  5904. urls += "?" + c.urlParams_.Encode()
  5905. req, _ := http.NewRequest("GET", urls, body)
  5906. req.Header = reqHeaders
  5907. googleapi.Expand(req.URL, map[string]string{
  5908. "packageName": c.packageNameid,
  5909. "editId": c.editId,
  5910. })
  5911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5912. }
  5913. // Do executes the "androidpublisher.edits.listings.list" call.
  5914. // Exactly one of *ListingsListResponse or error will be non-nil. Any
  5915. // non-2xx status code is an error. Response headers are in either
  5916. // *ListingsListResponse.ServerResponse.Header or (if a response was
  5917. // returned at all) in error.(*googleapi.Error).Header. Use
  5918. // googleapi.IsNotModified to check whether the returned error was
  5919. // because http.StatusNotModified was returned.
  5920. func (c *EditsListingsListCall) Do(opts ...googleapi.CallOption) (*ListingsListResponse, error) {
  5921. gensupport.SetOptions(c.urlParams_, opts...)
  5922. res, err := c.doRequest("json")
  5923. if res != nil && res.StatusCode == http.StatusNotModified {
  5924. if res.Body != nil {
  5925. res.Body.Close()
  5926. }
  5927. return nil, &googleapi.Error{
  5928. Code: res.StatusCode,
  5929. Header: res.Header,
  5930. }
  5931. }
  5932. if err != nil {
  5933. return nil, err
  5934. }
  5935. defer googleapi.CloseBody(res)
  5936. if err := googleapi.CheckResponse(res); err != nil {
  5937. return nil, err
  5938. }
  5939. ret := &ListingsListResponse{
  5940. ServerResponse: googleapi.ServerResponse{
  5941. Header: res.Header,
  5942. HTTPStatusCode: res.StatusCode,
  5943. },
  5944. }
  5945. target := &ret
  5946. if err := gensupport.DecodeResponse(target, res); err != nil {
  5947. return nil, err
  5948. }
  5949. return ret, nil
  5950. // {
  5951. // "description": "Returns all of the localized store listings attached to this edit.",
  5952. // "httpMethod": "GET",
  5953. // "id": "androidpublisher.edits.listings.list",
  5954. // "parameterOrder": [
  5955. // "packageName",
  5956. // "editId"
  5957. // ],
  5958. // "parameters": {
  5959. // "editId": {
  5960. // "description": "Unique identifier for this edit.",
  5961. // "location": "path",
  5962. // "required": true,
  5963. // "type": "string"
  5964. // },
  5965. // "packageName": {
  5966. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  5967. // "location": "path",
  5968. // "required": true,
  5969. // "type": "string"
  5970. // }
  5971. // },
  5972. // "path": "{packageName}/edits/{editId}/listings",
  5973. // "response": {
  5974. // "$ref": "ListingsListResponse"
  5975. // },
  5976. // "scopes": [
  5977. // "https://www.googleapis.com/auth/androidpublisher"
  5978. // ]
  5979. // }
  5980. }
  5981. // method id "androidpublisher.edits.listings.patch":
  5982. type EditsListingsPatchCall struct {
  5983. s *Service
  5984. packageNameid string
  5985. editId string
  5986. language string
  5987. listing *Listing
  5988. urlParams_ gensupport.URLParams
  5989. ctx_ context.Context
  5990. header_ http.Header
  5991. }
  5992. // Patch: Creates or updates a localized store listing. This method
  5993. // supports patch semantics.
  5994. func (r *EditsListingsService) Patch(packageNameid string, editId string, language string, listing *Listing) *EditsListingsPatchCall {
  5995. c := &EditsListingsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5996. c.packageNameid = packageNameid
  5997. c.editId = editId
  5998. c.language = language
  5999. c.listing = listing
  6000. return c
  6001. }
  6002. // Fields allows partial responses to be retrieved. See
  6003. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6004. // for more information.
  6005. func (c *EditsListingsPatchCall) Fields(s ...googleapi.Field) *EditsListingsPatchCall {
  6006. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6007. return c
  6008. }
  6009. // Context sets the context to be used in this call's Do method. Any
  6010. // pending HTTP request will be aborted if the provided context is
  6011. // canceled.
  6012. func (c *EditsListingsPatchCall) Context(ctx context.Context) *EditsListingsPatchCall {
  6013. c.ctx_ = ctx
  6014. return c
  6015. }
  6016. // Header returns an http.Header that can be modified by the caller to
  6017. // add HTTP headers to the request.
  6018. func (c *EditsListingsPatchCall) Header() http.Header {
  6019. if c.header_ == nil {
  6020. c.header_ = make(http.Header)
  6021. }
  6022. return c.header_
  6023. }
  6024. func (c *EditsListingsPatchCall) doRequest(alt string) (*http.Response, error) {
  6025. reqHeaders := make(http.Header)
  6026. for k, v := range c.header_ {
  6027. reqHeaders[k] = v
  6028. }
  6029. reqHeaders.Set("User-Agent", c.s.userAgent())
  6030. var body io.Reader = nil
  6031. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  6032. if err != nil {
  6033. return nil, err
  6034. }
  6035. reqHeaders.Set("Content-Type", "application/json")
  6036. c.urlParams_.Set("alt", alt)
  6037. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6038. urls += "?" + c.urlParams_.Encode()
  6039. req, _ := http.NewRequest("PATCH", urls, body)
  6040. req.Header = reqHeaders
  6041. googleapi.Expand(req.URL, map[string]string{
  6042. "packageName": c.packageNameid,
  6043. "editId": c.editId,
  6044. "language": c.language,
  6045. })
  6046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6047. }
  6048. // Do executes the "androidpublisher.edits.listings.patch" call.
  6049. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6050. // code is an error. Response headers are in either
  6051. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6052. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6053. // check whether the returned error was because http.StatusNotModified
  6054. // was returned.
  6055. func (c *EditsListingsPatchCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6056. gensupport.SetOptions(c.urlParams_, opts...)
  6057. res, err := c.doRequest("json")
  6058. if res != nil && res.StatusCode == http.StatusNotModified {
  6059. if res.Body != nil {
  6060. res.Body.Close()
  6061. }
  6062. return nil, &googleapi.Error{
  6063. Code: res.StatusCode,
  6064. Header: res.Header,
  6065. }
  6066. }
  6067. if err != nil {
  6068. return nil, err
  6069. }
  6070. defer googleapi.CloseBody(res)
  6071. if err := googleapi.CheckResponse(res); err != nil {
  6072. return nil, err
  6073. }
  6074. ret := &Listing{
  6075. ServerResponse: googleapi.ServerResponse{
  6076. Header: res.Header,
  6077. HTTPStatusCode: res.StatusCode,
  6078. },
  6079. }
  6080. target := &ret
  6081. if err := gensupport.DecodeResponse(target, res); err != nil {
  6082. return nil, err
  6083. }
  6084. return ret, nil
  6085. // {
  6086. // "description": "Creates or updates a localized store listing. This method supports patch semantics.",
  6087. // "httpMethod": "PATCH",
  6088. // "id": "androidpublisher.edits.listings.patch",
  6089. // "parameterOrder": [
  6090. // "packageName",
  6091. // "editId",
  6092. // "language"
  6093. // ],
  6094. // "parameters": {
  6095. // "editId": {
  6096. // "description": "Unique identifier for this edit.",
  6097. // "location": "path",
  6098. // "required": true,
  6099. // "type": "string"
  6100. // },
  6101. // "language": {
  6102. // "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\".",
  6103. // "location": "path",
  6104. // "required": true,
  6105. // "type": "string"
  6106. // },
  6107. // "packageName": {
  6108. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6109. // "location": "path",
  6110. // "required": true,
  6111. // "type": "string"
  6112. // }
  6113. // },
  6114. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6115. // "request": {
  6116. // "$ref": "Listing"
  6117. // },
  6118. // "response": {
  6119. // "$ref": "Listing"
  6120. // },
  6121. // "scopes": [
  6122. // "https://www.googleapis.com/auth/androidpublisher"
  6123. // ]
  6124. // }
  6125. }
  6126. // method id "androidpublisher.edits.listings.update":
  6127. type EditsListingsUpdateCall struct {
  6128. s *Service
  6129. packageNameid string
  6130. editId string
  6131. language string
  6132. listing *Listing
  6133. urlParams_ gensupport.URLParams
  6134. ctx_ context.Context
  6135. header_ http.Header
  6136. }
  6137. // Update: Creates or updates a localized store listing.
  6138. func (r *EditsListingsService) Update(packageNameid string, editId string, language string, listing *Listing) *EditsListingsUpdateCall {
  6139. c := &EditsListingsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6140. c.packageNameid = packageNameid
  6141. c.editId = editId
  6142. c.language = language
  6143. c.listing = listing
  6144. return c
  6145. }
  6146. // Fields allows partial responses to be retrieved. See
  6147. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6148. // for more information.
  6149. func (c *EditsListingsUpdateCall) Fields(s ...googleapi.Field) *EditsListingsUpdateCall {
  6150. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6151. return c
  6152. }
  6153. // Context sets the context to be used in this call's Do method. Any
  6154. // pending HTTP request will be aborted if the provided context is
  6155. // canceled.
  6156. func (c *EditsListingsUpdateCall) Context(ctx context.Context) *EditsListingsUpdateCall {
  6157. c.ctx_ = ctx
  6158. return c
  6159. }
  6160. // Header returns an http.Header that can be modified by the caller to
  6161. // add HTTP headers to the request.
  6162. func (c *EditsListingsUpdateCall) Header() http.Header {
  6163. if c.header_ == nil {
  6164. c.header_ = make(http.Header)
  6165. }
  6166. return c.header_
  6167. }
  6168. func (c *EditsListingsUpdateCall) doRequest(alt string) (*http.Response, error) {
  6169. reqHeaders := make(http.Header)
  6170. for k, v := range c.header_ {
  6171. reqHeaders[k] = v
  6172. }
  6173. reqHeaders.Set("User-Agent", c.s.userAgent())
  6174. var body io.Reader = nil
  6175. body, err := googleapi.WithoutDataWrapper.JSONReader(c.listing)
  6176. if err != nil {
  6177. return nil, err
  6178. }
  6179. reqHeaders.Set("Content-Type", "application/json")
  6180. c.urlParams_.Set("alt", alt)
  6181. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/listings/{language}")
  6182. urls += "?" + c.urlParams_.Encode()
  6183. req, _ := http.NewRequest("PUT", urls, body)
  6184. req.Header = reqHeaders
  6185. googleapi.Expand(req.URL, map[string]string{
  6186. "packageName": c.packageNameid,
  6187. "editId": c.editId,
  6188. "language": c.language,
  6189. })
  6190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6191. }
  6192. // Do executes the "androidpublisher.edits.listings.update" call.
  6193. // Exactly one of *Listing or error will be non-nil. Any non-2xx status
  6194. // code is an error. Response headers are in either
  6195. // *Listing.ServerResponse.Header or (if a response was returned at all)
  6196. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6197. // check whether the returned error was because http.StatusNotModified
  6198. // was returned.
  6199. func (c *EditsListingsUpdateCall) Do(opts ...googleapi.CallOption) (*Listing, error) {
  6200. gensupport.SetOptions(c.urlParams_, opts...)
  6201. res, err := c.doRequest("json")
  6202. if res != nil && res.StatusCode == http.StatusNotModified {
  6203. if res.Body != nil {
  6204. res.Body.Close()
  6205. }
  6206. return nil, &googleapi.Error{
  6207. Code: res.StatusCode,
  6208. Header: res.Header,
  6209. }
  6210. }
  6211. if err != nil {
  6212. return nil, err
  6213. }
  6214. defer googleapi.CloseBody(res)
  6215. if err := googleapi.CheckResponse(res); err != nil {
  6216. return nil, err
  6217. }
  6218. ret := &Listing{
  6219. ServerResponse: googleapi.ServerResponse{
  6220. Header: res.Header,
  6221. HTTPStatusCode: res.StatusCode,
  6222. },
  6223. }
  6224. target := &ret
  6225. if err := gensupport.DecodeResponse(target, res); err != nil {
  6226. return nil, err
  6227. }
  6228. return ret, nil
  6229. // {
  6230. // "description": "Creates or updates a localized store listing.",
  6231. // "httpMethod": "PUT",
  6232. // "id": "androidpublisher.edits.listings.update",
  6233. // "parameterOrder": [
  6234. // "packageName",
  6235. // "editId",
  6236. // "language"
  6237. // ],
  6238. // "parameters": {
  6239. // "editId": {
  6240. // "description": "Unique identifier for this edit.",
  6241. // "location": "path",
  6242. // "required": true,
  6243. // "type": "string"
  6244. // },
  6245. // "language": {
  6246. // "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\".",
  6247. // "location": "path",
  6248. // "required": true,
  6249. // "type": "string"
  6250. // },
  6251. // "packageName": {
  6252. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6253. // "location": "path",
  6254. // "required": true,
  6255. // "type": "string"
  6256. // }
  6257. // },
  6258. // "path": "{packageName}/edits/{editId}/listings/{language}",
  6259. // "request": {
  6260. // "$ref": "Listing"
  6261. // },
  6262. // "response": {
  6263. // "$ref": "Listing"
  6264. // },
  6265. // "scopes": [
  6266. // "https://www.googleapis.com/auth/androidpublisher"
  6267. // ]
  6268. // }
  6269. }
  6270. // method id "androidpublisher.edits.testers.get":
  6271. type EditsTestersGetCall struct {
  6272. s *Service
  6273. packageNameid string
  6274. editId string
  6275. track string
  6276. urlParams_ gensupport.URLParams
  6277. ifNoneMatch_ string
  6278. ctx_ context.Context
  6279. header_ http.Header
  6280. }
  6281. // Get:
  6282. func (r *EditsTestersService) Get(packageNameid string, editId string, track string) *EditsTestersGetCall {
  6283. c := &EditsTestersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6284. c.packageNameid = packageNameid
  6285. c.editId = editId
  6286. c.track = track
  6287. return c
  6288. }
  6289. // Fields allows partial responses to be retrieved. See
  6290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6291. // for more information.
  6292. func (c *EditsTestersGetCall) Fields(s ...googleapi.Field) *EditsTestersGetCall {
  6293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6294. return c
  6295. }
  6296. // IfNoneMatch sets the optional parameter which makes the operation
  6297. // fail if the object's ETag matches the given value. This is useful for
  6298. // getting updates only after the object has changed since the last
  6299. // request. Use googleapi.IsNotModified to check whether the response
  6300. // error from Do is the result of In-None-Match.
  6301. func (c *EditsTestersGetCall) IfNoneMatch(entityTag string) *EditsTestersGetCall {
  6302. c.ifNoneMatch_ = entityTag
  6303. return c
  6304. }
  6305. // Context sets the context to be used in this call's Do method. Any
  6306. // pending HTTP request will be aborted if the provided context is
  6307. // canceled.
  6308. func (c *EditsTestersGetCall) Context(ctx context.Context) *EditsTestersGetCall {
  6309. c.ctx_ = ctx
  6310. return c
  6311. }
  6312. // Header returns an http.Header that can be modified by the caller to
  6313. // add HTTP headers to the request.
  6314. func (c *EditsTestersGetCall) Header() http.Header {
  6315. if c.header_ == nil {
  6316. c.header_ = make(http.Header)
  6317. }
  6318. return c.header_
  6319. }
  6320. func (c *EditsTestersGetCall) doRequest(alt string) (*http.Response, error) {
  6321. reqHeaders := make(http.Header)
  6322. for k, v := range c.header_ {
  6323. reqHeaders[k] = v
  6324. }
  6325. reqHeaders.Set("User-Agent", c.s.userAgent())
  6326. if c.ifNoneMatch_ != "" {
  6327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6328. }
  6329. var body io.Reader = nil
  6330. c.urlParams_.Set("alt", alt)
  6331. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  6332. urls += "?" + c.urlParams_.Encode()
  6333. req, _ := http.NewRequest("GET", urls, body)
  6334. req.Header = reqHeaders
  6335. googleapi.Expand(req.URL, map[string]string{
  6336. "packageName": c.packageNameid,
  6337. "editId": c.editId,
  6338. "track": c.track,
  6339. })
  6340. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6341. }
  6342. // Do executes the "androidpublisher.edits.testers.get" call.
  6343. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  6344. // code is an error. Response headers are in either
  6345. // *Testers.ServerResponse.Header or (if a response was returned at all)
  6346. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6347. // check whether the returned error was because http.StatusNotModified
  6348. // was returned.
  6349. func (c *EditsTestersGetCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  6350. gensupport.SetOptions(c.urlParams_, opts...)
  6351. res, err := c.doRequest("json")
  6352. if res != nil && res.StatusCode == http.StatusNotModified {
  6353. if res.Body != nil {
  6354. res.Body.Close()
  6355. }
  6356. return nil, &googleapi.Error{
  6357. Code: res.StatusCode,
  6358. Header: res.Header,
  6359. }
  6360. }
  6361. if err != nil {
  6362. return nil, err
  6363. }
  6364. defer googleapi.CloseBody(res)
  6365. if err := googleapi.CheckResponse(res); err != nil {
  6366. return nil, err
  6367. }
  6368. ret := &Testers{
  6369. ServerResponse: googleapi.ServerResponse{
  6370. Header: res.Header,
  6371. HTTPStatusCode: res.StatusCode,
  6372. },
  6373. }
  6374. target := &ret
  6375. if err := gensupport.DecodeResponse(target, res); err != nil {
  6376. return nil, err
  6377. }
  6378. return ret, nil
  6379. // {
  6380. // "httpMethod": "GET",
  6381. // "id": "androidpublisher.edits.testers.get",
  6382. // "parameterOrder": [
  6383. // "packageName",
  6384. // "editId",
  6385. // "track"
  6386. // ],
  6387. // "parameters": {
  6388. // "editId": {
  6389. // "description": "Unique identifier for this edit.",
  6390. // "location": "path",
  6391. // "required": true,
  6392. // "type": "string"
  6393. // },
  6394. // "packageName": {
  6395. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6396. // "location": "path",
  6397. // "required": true,
  6398. // "type": "string"
  6399. // },
  6400. // "track": {
  6401. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  6402. // "location": "path",
  6403. // "pattern": "(alpha|beta|production|rollout|internal)",
  6404. // "required": true,
  6405. // "type": "string"
  6406. // }
  6407. // },
  6408. // "path": "{packageName}/edits/{editId}/testers/{track}",
  6409. // "response": {
  6410. // "$ref": "Testers"
  6411. // },
  6412. // "scopes": [
  6413. // "https://www.googleapis.com/auth/androidpublisher"
  6414. // ]
  6415. // }
  6416. }
  6417. // method id "androidpublisher.edits.testers.patch":
  6418. type EditsTestersPatchCall struct {
  6419. s *Service
  6420. packageNameid string
  6421. editId string
  6422. track string
  6423. testers *Testers
  6424. urlParams_ gensupport.URLParams
  6425. ctx_ context.Context
  6426. header_ http.Header
  6427. }
  6428. // Patch:
  6429. func (r *EditsTestersService) Patch(packageNameid string, editId string, track string, testers *Testers) *EditsTestersPatchCall {
  6430. c := &EditsTestersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6431. c.packageNameid = packageNameid
  6432. c.editId = editId
  6433. c.track = track
  6434. c.testers = testers
  6435. return c
  6436. }
  6437. // Fields allows partial responses to be retrieved. See
  6438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6439. // for more information.
  6440. func (c *EditsTestersPatchCall) Fields(s ...googleapi.Field) *EditsTestersPatchCall {
  6441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6442. return c
  6443. }
  6444. // Context sets the context to be used in this call's Do method. Any
  6445. // pending HTTP request will be aborted if the provided context is
  6446. // canceled.
  6447. func (c *EditsTestersPatchCall) Context(ctx context.Context) *EditsTestersPatchCall {
  6448. c.ctx_ = ctx
  6449. return c
  6450. }
  6451. // Header returns an http.Header that can be modified by the caller to
  6452. // add HTTP headers to the request.
  6453. func (c *EditsTestersPatchCall) Header() http.Header {
  6454. if c.header_ == nil {
  6455. c.header_ = make(http.Header)
  6456. }
  6457. return c.header_
  6458. }
  6459. func (c *EditsTestersPatchCall) doRequest(alt string) (*http.Response, error) {
  6460. reqHeaders := make(http.Header)
  6461. for k, v := range c.header_ {
  6462. reqHeaders[k] = v
  6463. }
  6464. reqHeaders.Set("User-Agent", c.s.userAgent())
  6465. var body io.Reader = nil
  6466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  6467. if err != nil {
  6468. return nil, err
  6469. }
  6470. reqHeaders.Set("Content-Type", "application/json")
  6471. c.urlParams_.Set("alt", alt)
  6472. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  6473. urls += "?" + c.urlParams_.Encode()
  6474. req, _ := http.NewRequest("PATCH", urls, body)
  6475. req.Header = reqHeaders
  6476. googleapi.Expand(req.URL, map[string]string{
  6477. "packageName": c.packageNameid,
  6478. "editId": c.editId,
  6479. "track": c.track,
  6480. })
  6481. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6482. }
  6483. // Do executes the "androidpublisher.edits.testers.patch" call.
  6484. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  6485. // code is an error. Response headers are in either
  6486. // *Testers.ServerResponse.Header or (if a response was returned at all)
  6487. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6488. // check whether the returned error was because http.StatusNotModified
  6489. // was returned.
  6490. func (c *EditsTestersPatchCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  6491. gensupport.SetOptions(c.urlParams_, opts...)
  6492. res, err := c.doRequest("json")
  6493. if res != nil && res.StatusCode == http.StatusNotModified {
  6494. if res.Body != nil {
  6495. res.Body.Close()
  6496. }
  6497. return nil, &googleapi.Error{
  6498. Code: res.StatusCode,
  6499. Header: res.Header,
  6500. }
  6501. }
  6502. if err != nil {
  6503. return nil, err
  6504. }
  6505. defer googleapi.CloseBody(res)
  6506. if err := googleapi.CheckResponse(res); err != nil {
  6507. return nil, err
  6508. }
  6509. ret := &Testers{
  6510. ServerResponse: googleapi.ServerResponse{
  6511. Header: res.Header,
  6512. HTTPStatusCode: res.StatusCode,
  6513. },
  6514. }
  6515. target := &ret
  6516. if err := gensupport.DecodeResponse(target, res); err != nil {
  6517. return nil, err
  6518. }
  6519. return ret, nil
  6520. // {
  6521. // "httpMethod": "PATCH",
  6522. // "id": "androidpublisher.edits.testers.patch",
  6523. // "parameterOrder": [
  6524. // "packageName",
  6525. // "editId",
  6526. // "track"
  6527. // ],
  6528. // "parameters": {
  6529. // "editId": {
  6530. // "description": "Unique identifier for this edit.",
  6531. // "location": "path",
  6532. // "required": true,
  6533. // "type": "string"
  6534. // },
  6535. // "packageName": {
  6536. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6537. // "location": "path",
  6538. // "required": true,
  6539. // "type": "string"
  6540. // },
  6541. // "track": {
  6542. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  6543. // "location": "path",
  6544. // "pattern": "(alpha|beta|production|rollout|internal)",
  6545. // "required": true,
  6546. // "type": "string"
  6547. // }
  6548. // },
  6549. // "path": "{packageName}/edits/{editId}/testers/{track}",
  6550. // "request": {
  6551. // "$ref": "Testers"
  6552. // },
  6553. // "response": {
  6554. // "$ref": "Testers"
  6555. // },
  6556. // "scopes": [
  6557. // "https://www.googleapis.com/auth/androidpublisher"
  6558. // ]
  6559. // }
  6560. }
  6561. // method id "androidpublisher.edits.testers.update":
  6562. type EditsTestersUpdateCall struct {
  6563. s *Service
  6564. packageNameid string
  6565. editId string
  6566. track string
  6567. testers *Testers
  6568. urlParams_ gensupport.URLParams
  6569. ctx_ context.Context
  6570. header_ http.Header
  6571. }
  6572. // Update:
  6573. func (r *EditsTestersService) Update(packageNameid string, editId string, track string, testers *Testers) *EditsTestersUpdateCall {
  6574. c := &EditsTestersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6575. c.packageNameid = packageNameid
  6576. c.editId = editId
  6577. c.track = track
  6578. c.testers = testers
  6579. return c
  6580. }
  6581. // Fields allows partial responses to be retrieved. See
  6582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6583. // for more information.
  6584. func (c *EditsTestersUpdateCall) Fields(s ...googleapi.Field) *EditsTestersUpdateCall {
  6585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6586. return c
  6587. }
  6588. // Context sets the context to be used in this call's Do method. Any
  6589. // pending HTTP request will be aborted if the provided context is
  6590. // canceled.
  6591. func (c *EditsTestersUpdateCall) Context(ctx context.Context) *EditsTestersUpdateCall {
  6592. c.ctx_ = ctx
  6593. return c
  6594. }
  6595. // Header returns an http.Header that can be modified by the caller to
  6596. // add HTTP headers to the request.
  6597. func (c *EditsTestersUpdateCall) Header() http.Header {
  6598. if c.header_ == nil {
  6599. c.header_ = make(http.Header)
  6600. }
  6601. return c.header_
  6602. }
  6603. func (c *EditsTestersUpdateCall) doRequest(alt string) (*http.Response, error) {
  6604. reqHeaders := make(http.Header)
  6605. for k, v := range c.header_ {
  6606. reqHeaders[k] = v
  6607. }
  6608. reqHeaders.Set("User-Agent", c.s.userAgent())
  6609. var body io.Reader = nil
  6610. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testers)
  6611. if err != nil {
  6612. return nil, err
  6613. }
  6614. reqHeaders.Set("Content-Type", "application/json")
  6615. c.urlParams_.Set("alt", alt)
  6616. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/testers/{track}")
  6617. urls += "?" + c.urlParams_.Encode()
  6618. req, _ := http.NewRequest("PUT", urls, body)
  6619. req.Header = reqHeaders
  6620. googleapi.Expand(req.URL, map[string]string{
  6621. "packageName": c.packageNameid,
  6622. "editId": c.editId,
  6623. "track": c.track,
  6624. })
  6625. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6626. }
  6627. // Do executes the "androidpublisher.edits.testers.update" call.
  6628. // Exactly one of *Testers or error will be non-nil. Any non-2xx status
  6629. // code is an error. Response headers are in either
  6630. // *Testers.ServerResponse.Header or (if a response was returned at all)
  6631. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6632. // check whether the returned error was because http.StatusNotModified
  6633. // was returned.
  6634. func (c *EditsTestersUpdateCall) Do(opts ...googleapi.CallOption) (*Testers, error) {
  6635. gensupport.SetOptions(c.urlParams_, opts...)
  6636. res, err := c.doRequest("json")
  6637. if res != nil && res.StatusCode == http.StatusNotModified {
  6638. if res.Body != nil {
  6639. res.Body.Close()
  6640. }
  6641. return nil, &googleapi.Error{
  6642. Code: res.StatusCode,
  6643. Header: res.Header,
  6644. }
  6645. }
  6646. if err != nil {
  6647. return nil, err
  6648. }
  6649. defer googleapi.CloseBody(res)
  6650. if err := googleapi.CheckResponse(res); err != nil {
  6651. return nil, err
  6652. }
  6653. ret := &Testers{
  6654. ServerResponse: googleapi.ServerResponse{
  6655. Header: res.Header,
  6656. HTTPStatusCode: res.StatusCode,
  6657. },
  6658. }
  6659. target := &ret
  6660. if err := gensupport.DecodeResponse(target, res); err != nil {
  6661. return nil, err
  6662. }
  6663. return ret, nil
  6664. // {
  6665. // "httpMethod": "PUT",
  6666. // "id": "androidpublisher.edits.testers.update",
  6667. // "parameterOrder": [
  6668. // "packageName",
  6669. // "editId",
  6670. // "track"
  6671. // ],
  6672. // "parameters": {
  6673. // "editId": {
  6674. // "description": "Unique identifier for this edit.",
  6675. // "location": "path",
  6676. // "required": true,
  6677. // "type": "string"
  6678. // },
  6679. // "packageName": {
  6680. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6681. // "location": "path",
  6682. // "required": true,
  6683. // "type": "string"
  6684. // },
  6685. // "track": {
  6686. // "description": "The track to read or modify. Acceptable values are: \"alpha\", \"beta\", \"production\", \"rollout\" or \"internal\".",
  6687. // "location": "path",
  6688. // "pattern": "(alpha|beta|production|rollout|internal)",
  6689. // "required": true,
  6690. // "type": "string"
  6691. // }
  6692. // },
  6693. // "path": "{packageName}/edits/{editId}/testers/{track}",
  6694. // "request": {
  6695. // "$ref": "Testers"
  6696. // },
  6697. // "response": {
  6698. // "$ref": "Testers"
  6699. // },
  6700. // "scopes": [
  6701. // "https://www.googleapis.com/auth/androidpublisher"
  6702. // ]
  6703. // }
  6704. }
  6705. // method id "androidpublisher.edits.tracks.get":
  6706. type EditsTracksGetCall struct {
  6707. s *Service
  6708. packageNameid string
  6709. editId string
  6710. track string
  6711. urlParams_ gensupport.URLParams
  6712. ifNoneMatch_ string
  6713. ctx_ context.Context
  6714. header_ http.Header
  6715. }
  6716. // Get: Fetches the track configuration for the specified track type.
  6717. // Includes the APK version codes that are in this track.
  6718. func (r *EditsTracksService) Get(packageNameid string, editId string, track string) *EditsTracksGetCall {
  6719. c := &EditsTracksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6720. c.packageNameid = packageNameid
  6721. c.editId = editId
  6722. c.track = track
  6723. return c
  6724. }
  6725. // Fields allows partial responses to be retrieved. See
  6726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6727. // for more information.
  6728. func (c *EditsTracksGetCall) Fields(s ...googleapi.Field) *EditsTracksGetCall {
  6729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6730. return c
  6731. }
  6732. // IfNoneMatch sets the optional parameter which makes the operation
  6733. // fail if the object's ETag matches the given value. This is useful for
  6734. // getting updates only after the object has changed since the last
  6735. // request. Use googleapi.IsNotModified to check whether the response
  6736. // error from Do is the result of In-None-Match.
  6737. func (c *EditsTracksGetCall) IfNoneMatch(entityTag string) *EditsTracksGetCall {
  6738. c.ifNoneMatch_ = entityTag
  6739. return c
  6740. }
  6741. // Context sets the context to be used in this call's Do method. Any
  6742. // pending HTTP request will be aborted if the provided context is
  6743. // canceled.
  6744. func (c *EditsTracksGetCall) Context(ctx context.Context) *EditsTracksGetCall {
  6745. c.ctx_ = ctx
  6746. return c
  6747. }
  6748. // Header returns an http.Header that can be modified by the caller to
  6749. // add HTTP headers to the request.
  6750. func (c *EditsTracksGetCall) Header() http.Header {
  6751. if c.header_ == nil {
  6752. c.header_ = make(http.Header)
  6753. }
  6754. return c.header_
  6755. }
  6756. func (c *EditsTracksGetCall) doRequest(alt string) (*http.Response, error) {
  6757. reqHeaders := make(http.Header)
  6758. for k, v := range c.header_ {
  6759. reqHeaders[k] = v
  6760. }
  6761. reqHeaders.Set("User-Agent", c.s.userAgent())
  6762. if c.ifNoneMatch_ != "" {
  6763. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6764. }
  6765. var body io.Reader = nil
  6766. c.urlParams_.Set("alt", alt)
  6767. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  6768. urls += "?" + c.urlParams_.Encode()
  6769. req, _ := http.NewRequest("GET", urls, body)
  6770. req.Header = reqHeaders
  6771. googleapi.Expand(req.URL, map[string]string{
  6772. "packageName": c.packageNameid,
  6773. "editId": c.editId,
  6774. "track": c.track,
  6775. })
  6776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6777. }
  6778. // Do executes the "androidpublisher.edits.tracks.get" call.
  6779. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  6780. // code is an error. Response headers are in either
  6781. // *Track.ServerResponse.Header or (if a response was returned at all)
  6782. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6783. // check whether the returned error was because http.StatusNotModified
  6784. // was returned.
  6785. func (c *EditsTracksGetCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  6786. gensupport.SetOptions(c.urlParams_, opts...)
  6787. res, err := c.doRequest("json")
  6788. if res != nil && res.StatusCode == http.StatusNotModified {
  6789. if res.Body != nil {
  6790. res.Body.Close()
  6791. }
  6792. return nil, &googleapi.Error{
  6793. Code: res.StatusCode,
  6794. Header: res.Header,
  6795. }
  6796. }
  6797. if err != nil {
  6798. return nil, err
  6799. }
  6800. defer googleapi.CloseBody(res)
  6801. if err := googleapi.CheckResponse(res); err != nil {
  6802. return nil, err
  6803. }
  6804. ret := &Track{
  6805. ServerResponse: googleapi.ServerResponse{
  6806. Header: res.Header,
  6807. HTTPStatusCode: res.StatusCode,
  6808. },
  6809. }
  6810. target := &ret
  6811. if err := gensupport.DecodeResponse(target, res); err != nil {
  6812. return nil, err
  6813. }
  6814. return ret, nil
  6815. // {
  6816. // "description": "Fetches the track configuration for the specified track type. Includes the APK version codes that are in this track.",
  6817. // "httpMethod": "GET",
  6818. // "id": "androidpublisher.edits.tracks.get",
  6819. // "parameterOrder": [
  6820. // "packageName",
  6821. // "editId",
  6822. // "track"
  6823. // ],
  6824. // "parameters": {
  6825. // "editId": {
  6826. // "description": "Unique identifier for this edit.",
  6827. // "location": "path",
  6828. // "required": true,
  6829. // "type": "string"
  6830. // },
  6831. // "packageName": {
  6832. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6833. // "location": "path",
  6834. // "required": true,
  6835. // "type": "string"
  6836. // },
  6837. // "track": {
  6838. // "description": "The track to read or modify.",
  6839. // "location": "path",
  6840. // "required": true,
  6841. // "type": "string"
  6842. // }
  6843. // },
  6844. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  6845. // "response": {
  6846. // "$ref": "Track"
  6847. // },
  6848. // "scopes": [
  6849. // "https://www.googleapis.com/auth/androidpublisher"
  6850. // ]
  6851. // }
  6852. }
  6853. // method id "androidpublisher.edits.tracks.list":
  6854. type EditsTracksListCall struct {
  6855. s *Service
  6856. packageNameid string
  6857. editId string
  6858. urlParams_ gensupport.URLParams
  6859. ifNoneMatch_ string
  6860. ctx_ context.Context
  6861. header_ http.Header
  6862. }
  6863. // List: Lists all the track configurations for this edit.
  6864. func (r *EditsTracksService) List(packageNameid string, editId string) *EditsTracksListCall {
  6865. c := &EditsTracksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6866. c.packageNameid = packageNameid
  6867. c.editId = editId
  6868. return c
  6869. }
  6870. // Fields allows partial responses to be retrieved. See
  6871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6872. // for more information.
  6873. func (c *EditsTracksListCall) Fields(s ...googleapi.Field) *EditsTracksListCall {
  6874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6875. return c
  6876. }
  6877. // IfNoneMatch sets the optional parameter which makes the operation
  6878. // fail if the object's ETag matches the given value. This is useful for
  6879. // getting updates only after the object has changed since the last
  6880. // request. Use googleapi.IsNotModified to check whether the response
  6881. // error from Do is the result of In-None-Match.
  6882. func (c *EditsTracksListCall) IfNoneMatch(entityTag string) *EditsTracksListCall {
  6883. c.ifNoneMatch_ = entityTag
  6884. return c
  6885. }
  6886. // Context sets the context to be used in this call's Do method. Any
  6887. // pending HTTP request will be aborted if the provided context is
  6888. // canceled.
  6889. func (c *EditsTracksListCall) Context(ctx context.Context) *EditsTracksListCall {
  6890. c.ctx_ = ctx
  6891. return c
  6892. }
  6893. // Header returns an http.Header that can be modified by the caller to
  6894. // add HTTP headers to the request.
  6895. func (c *EditsTracksListCall) Header() http.Header {
  6896. if c.header_ == nil {
  6897. c.header_ = make(http.Header)
  6898. }
  6899. return c.header_
  6900. }
  6901. func (c *EditsTracksListCall) doRequest(alt string) (*http.Response, error) {
  6902. reqHeaders := make(http.Header)
  6903. for k, v := range c.header_ {
  6904. reqHeaders[k] = v
  6905. }
  6906. reqHeaders.Set("User-Agent", c.s.userAgent())
  6907. if c.ifNoneMatch_ != "" {
  6908. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6909. }
  6910. var body io.Reader = nil
  6911. c.urlParams_.Set("alt", alt)
  6912. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks")
  6913. urls += "?" + c.urlParams_.Encode()
  6914. req, _ := http.NewRequest("GET", urls, body)
  6915. req.Header = reqHeaders
  6916. googleapi.Expand(req.URL, map[string]string{
  6917. "packageName": c.packageNameid,
  6918. "editId": c.editId,
  6919. })
  6920. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6921. }
  6922. // Do executes the "androidpublisher.edits.tracks.list" call.
  6923. // Exactly one of *TracksListResponse or error will be non-nil. Any
  6924. // non-2xx status code is an error. Response headers are in either
  6925. // *TracksListResponse.ServerResponse.Header or (if a response was
  6926. // returned at all) in error.(*googleapi.Error).Header. Use
  6927. // googleapi.IsNotModified to check whether the returned error was
  6928. // because http.StatusNotModified was returned.
  6929. func (c *EditsTracksListCall) Do(opts ...googleapi.CallOption) (*TracksListResponse, error) {
  6930. gensupport.SetOptions(c.urlParams_, opts...)
  6931. res, err := c.doRequest("json")
  6932. if res != nil && res.StatusCode == http.StatusNotModified {
  6933. if res.Body != nil {
  6934. res.Body.Close()
  6935. }
  6936. return nil, &googleapi.Error{
  6937. Code: res.StatusCode,
  6938. Header: res.Header,
  6939. }
  6940. }
  6941. if err != nil {
  6942. return nil, err
  6943. }
  6944. defer googleapi.CloseBody(res)
  6945. if err := googleapi.CheckResponse(res); err != nil {
  6946. return nil, err
  6947. }
  6948. ret := &TracksListResponse{
  6949. ServerResponse: googleapi.ServerResponse{
  6950. Header: res.Header,
  6951. HTTPStatusCode: res.StatusCode,
  6952. },
  6953. }
  6954. target := &ret
  6955. if err := gensupport.DecodeResponse(target, res); err != nil {
  6956. return nil, err
  6957. }
  6958. return ret, nil
  6959. // {
  6960. // "description": "Lists all the track configurations for this edit.",
  6961. // "httpMethod": "GET",
  6962. // "id": "androidpublisher.edits.tracks.list",
  6963. // "parameterOrder": [
  6964. // "packageName",
  6965. // "editId"
  6966. // ],
  6967. // "parameters": {
  6968. // "editId": {
  6969. // "description": "Unique identifier for this edit.",
  6970. // "location": "path",
  6971. // "required": true,
  6972. // "type": "string"
  6973. // },
  6974. // "packageName": {
  6975. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  6976. // "location": "path",
  6977. // "required": true,
  6978. // "type": "string"
  6979. // }
  6980. // },
  6981. // "path": "{packageName}/edits/{editId}/tracks",
  6982. // "response": {
  6983. // "$ref": "TracksListResponse"
  6984. // },
  6985. // "scopes": [
  6986. // "https://www.googleapis.com/auth/androidpublisher"
  6987. // ]
  6988. // }
  6989. }
  6990. // method id "androidpublisher.edits.tracks.patch":
  6991. type EditsTracksPatchCall struct {
  6992. s *Service
  6993. packageNameid string
  6994. editId string
  6995. track string
  6996. track2 *Track
  6997. urlParams_ gensupport.URLParams
  6998. ctx_ context.Context
  6999. header_ http.Header
  7000. }
  7001. // Patch: Updates the track configuration for the specified track type.
  7002. // When halted, the rollout track cannot be updated without adding new
  7003. // APKs, and adding new APKs will cause it to resume. This method
  7004. // supports patch semantics.
  7005. func (r *EditsTracksService) Patch(packageNameid string, editId string, track string, track2 *Track) *EditsTracksPatchCall {
  7006. c := &EditsTracksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7007. c.packageNameid = packageNameid
  7008. c.editId = editId
  7009. c.track = track
  7010. c.track2 = track2
  7011. return c
  7012. }
  7013. // Fields allows partial responses to be retrieved. See
  7014. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7015. // for more information.
  7016. func (c *EditsTracksPatchCall) Fields(s ...googleapi.Field) *EditsTracksPatchCall {
  7017. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7018. return c
  7019. }
  7020. // Context sets the context to be used in this call's Do method. Any
  7021. // pending HTTP request will be aborted if the provided context is
  7022. // canceled.
  7023. func (c *EditsTracksPatchCall) Context(ctx context.Context) *EditsTracksPatchCall {
  7024. c.ctx_ = ctx
  7025. return c
  7026. }
  7027. // Header returns an http.Header that can be modified by the caller to
  7028. // add HTTP headers to the request.
  7029. func (c *EditsTracksPatchCall) Header() http.Header {
  7030. if c.header_ == nil {
  7031. c.header_ = make(http.Header)
  7032. }
  7033. return c.header_
  7034. }
  7035. func (c *EditsTracksPatchCall) doRequest(alt string) (*http.Response, error) {
  7036. reqHeaders := make(http.Header)
  7037. for k, v := range c.header_ {
  7038. reqHeaders[k] = v
  7039. }
  7040. reqHeaders.Set("User-Agent", c.s.userAgent())
  7041. var body io.Reader = nil
  7042. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  7043. if err != nil {
  7044. return nil, err
  7045. }
  7046. reqHeaders.Set("Content-Type", "application/json")
  7047. c.urlParams_.Set("alt", alt)
  7048. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7049. urls += "?" + c.urlParams_.Encode()
  7050. req, _ := http.NewRequest("PATCH", urls, body)
  7051. req.Header = reqHeaders
  7052. googleapi.Expand(req.URL, map[string]string{
  7053. "packageName": c.packageNameid,
  7054. "editId": c.editId,
  7055. "track": c.track,
  7056. })
  7057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7058. }
  7059. // Do executes the "androidpublisher.edits.tracks.patch" call.
  7060. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7061. // code is an error. Response headers are in either
  7062. // *Track.ServerResponse.Header or (if a response was returned at all)
  7063. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7064. // check whether the returned error was because http.StatusNotModified
  7065. // was returned.
  7066. func (c *EditsTracksPatchCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7067. gensupport.SetOptions(c.urlParams_, opts...)
  7068. res, err := c.doRequest("json")
  7069. if res != nil && res.StatusCode == http.StatusNotModified {
  7070. if res.Body != nil {
  7071. res.Body.Close()
  7072. }
  7073. return nil, &googleapi.Error{
  7074. Code: res.StatusCode,
  7075. Header: res.Header,
  7076. }
  7077. }
  7078. if err != nil {
  7079. return nil, err
  7080. }
  7081. defer googleapi.CloseBody(res)
  7082. if err := googleapi.CheckResponse(res); err != nil {
  7083. return nil, err
  7084. }
  7085. ret := &Track{
  7086. ServerResponse: googleapi.ServerResponse{
  7087. Header: res.Header,
  7088. HTTPStatusCode: res.StatusCode,
  7089. },
  7090. }
  7091. target := &ret
  7092. if err := gensupport.DecodeResponse(target, res); err != nil {
  7093. return nil, err
  7094. }
  7095. return ret, nil
  7096. // {
  7097. // "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.",
  7098. // "httpMethod": "PATCH",
  7099. // "id": "androidpublisher.edits.tracks.patch",
  7100. // "parameterOrder": [
  7101. // "packageName",
  7102. // "editId",
  7103. // "track"
  7104. // ],
  7105. // "parameters": {
  7106. // "editId": {
  7107. // "description": "Unique identifier for this edit.",
  7108. // "location": "path",
  7109. // "required": true,
  7110. // "type": "string"
  7111. // },
  7112. // "packageName": {
  7113. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7114. // "location": "path",
  7115. // "required": true,
  7116. // "type": "string"
  7117. // },
  7118. // "track": {
  7119. // "description": "The track to read or modify.",
  7120. // "location": "path",
  7121. // "required": true,
  7122. // "type": "string"
  7123. // }
  7124. // },
  7125. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7126. // "request": {
  7127. // "$ref": "Track"
  7128. // },
  7129. // "response": {
  7130. // "$ref": "Track"
  7131. // },
  7132. // "scopes": [
  7133. // "https://www.googleapis.com/auth/androidpublisher"
  7134. // ]
  7135. // }
  7136. }
  7137. // method id "androidpublisher.edits.tracks.update":
  7138. type EditsTracksUpdateCall struct {
  7139. s *Service
  7140. packageNameid string
  7141. editId string
  7142. track string
  7143. track2 *Track
  7144. urlParams_ gensupport.URLParams
  7145. ctx_ context.Context
  7146. header_ http.Header
  7147. }
  7148. // Update: Updates the track configuration for the specified track type.
  7149. // When halted, the rollout track cannot be updated without adding new
  7150. // APKs, and adding new APKs will cause it to resume.
  7151. func (r *EditsTracksService) Update(packageNameid string, editId string, track string, track2 *Track) *EditsTracksUpdateCall {
  7152. c := &EditsTracksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7153. c.packageNameid = packageNameid
  7154. c.editId = editId
  7155. c.track = track
  7156. c.track2 = track2
  7157. return c
  7158. }
  7159. // Fields allows partial responses to be retrieved. See
  7160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7161. // for more information.
  7162. func (c *EditsTracksUpdateCall) Fields(s ...googleapi.Field) *EditsTracksUpdateCall {
  7163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7164. return c
  7165. }
  7166. // Context sets the context to be used in this call's Do method. Any
  7167. // pending HTTP request will be aborted if the provided context is
  7168. // canceled.
  7169. func (c *EditsTracksUpdateCall) Context(ctx context.Context) *EditsTracksUpdateCall {
  7170. c.ctx_ = ctx
  7171. return c
  7172. }
  7173. // Header returns an http.Header that can be modified by the caller to
  7174. // add HTTP headers to the request.
  7175. func (c *EditsTracksUpdateCall) Header() http.Header {
  7176. if c.header_ == nil {
  7177. c.header_ = make(http.Header)
  7178. }
  7179. return c.header_
  7180. }
  7181. func (c *EditsTracksUpdateCall) doRequest(alt string) (*http.Response, error) {
  7182. reqHeaders := make(http.Header)
  7183. for k, v := range c.header_ {
  7184. reqHeaders[k] = v
  7185. }
  7186. reqHeaders.Set("User-Agent", c.s.userAgent())
  7187. var body io.Reader = nil
  7188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.track2)
  7189. if err != nil {
  7190. return nil, err
  7191. }
  7192. reqHeaders.Set("Content-Type", "application/json")
  7193. c.urlParams_.Set("alt", alt)
  7194. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/edits/{editId}/tracks/{track}")
  7195. urls += "?" + c.urlParams_.Encode()
  7196. req, _ := http.NewRequest("PUT", urls, body)
  7197. req.Header = reqHeaders
  7198. googleapi.Expand(req.URL, map[string]string{
  7199. "packageName": c.packageNameid,
  7200. "editId": c.editId,
  7201. "track": c.track,
  7202. })
  7203. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7204. }
  7205. // Do executes the "androidpublisher.edits.tracks.update" call.
  7206. // Exactly one of *Track or error will be non-nil. Any non-2xx status
  7207. // code is an error. Response headers are in either
  7208. // *Track.ServerResponse.Header or (if a response was returned at all)
  7209. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7210. // check whether the returned error was because http.StatusNotModified
  7211. // was returned.
  7212. func (c *EditsTracksUpdateCall) Do(opts ...googleapi.CallOption) (*Track, error) {
  7213. gensupport.SetOptions(c.urlParams_, opts...)
  7214. res, err := c.doRequest("json")
  7215. if res != nil && res.StatusCode == http.StatusNotModified {
  7216. if res.Body != nil {
  7217. res.Body.Close()
  7218. }
  7219. return nil, &googleapi.Error{
  7220. Code: res.StatusCode,
  7221. Header: res.Header,
  7222. }
  7223. }
  7224. if err != nil {
  7225. return nil, err
  7226. }
  7227. defer googleapi.CloseBody(res)
  7228. if err := googleapi.CheckResponse(res); err != nil {
  7229. return nil, err
  7230. }
  7231. ret := &Track{
  7232. ServerResponse: googleapi.ServerResponse{
  7233. Header: res.Header,
  7234. HTTPStatusCode: res.StatusCode,
  7235. },
  7236. }
  7237. target := &ret
  7238. if err := gensupport.DecodeResponse(target, res); err != nil {
  7239. return nil, err
  7240. }
  7241. return ret, nil
  7242. // {
  7243. // "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.",
  7244. // "httpMethod": "PUT",
  7245. // "id": "androidpublisher.edits.tracks.update",
  7246. // "parameterOrder": [
  7247. // "packageName",
  7248. // "editId",
  7249. // "track"
  7250. // ],
  7251. // "parameters": {
  7252. // "editId": {
  7253. // "description": "Unique identifier for this edit.",
  7254. // "location": "path",
  7255. // "required": true,
  7256. // "type": "string"
  7257. // },
  7258. // "packageName": {
  7259. // "description": "Unique identifier for the Android app that is being updated; for example, \"com.spiffygame\".",
  7260. // "location": "path",
  7261. // "required": true,
  7262. // "type": "string"
  7263. // },
  7264. // "track": {
  7265. // "description": "The track to read or modify.",
  7266. // "location": "path",
  7267. // "required": true,
  7268. // "type": "string"
  7269. // }
  7270. // },
  7271. // "path": "{packageName}/edits/{editId}/tracks/{track}",
  7272. // "request": {
  7273. // "$ref": "Track"
  7274. // },
  7275. // "response": {
  7276. // "$ref": "Track"
  7277. // },
  7278. // "scopes": [
  7279. // "https://www.googleapis.com/auth/androidpublisher"
  7280. // ]
  7281. // }
  7282. }
  7283. // method id "androidpublisher.inappproducts.delete":
  7284. type InappproductsDeleteCall struct {
  7285. s *Service
  7286. packageNameid string
  7287. skuid string
  7288. urlParams_ gensupport.URLParams
  7289. ctx_ context.Context
  7290. header_ http.Header
  7291. }
  7292. // Delete: Delete an in-app product for an app.
  7293. func (r *InappproductsService) Delete(packageNameid string, skuid string) *InappproductsDeleteCall {
  7294. c := &InappproductsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7295. c.packageNameid = packageNameid
  7296. c.skuid = skuid
  7297. return c
  7298. }
  7299. // Fields allows partial responses to be retrieved. See
  7300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7301. // for more information.
  7302. func (c *InappproductsDeleteCall) Fields(s ...googleapi.Field) *InappproductsDeleteCall {
  7303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7304. return c
  7305. }
  7306. // Context sets the context to be used in this call's Do method. Any
  7307. // pending HTTP request will be aborted if the provided context is
  7308. // canceled.
  7309. func (c *InappproductsDeleteCall) Context(ctx context.Context) *InappproductsDeleteCall {
  7310. c.ctx_ = ctx
  7311. return c
  7312. }
  7313. // Header returns an http.Header that can be modified by the caller to
  7314. // add HTTP headers to the request.
  7315. func (c *InappproductsDeleteCall) Header() http.Header {
  7316. if c.header_ == nil {
  7317. c.header_ = make(http.Header)
  7318. }
  7319. return c.header_
  7320. }
  7321. func (c *InappproductsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7322. reqHeaders := make(http.Header)
  7323. for k, v := range c.header_ {
  7324. reqHeaders[k] = v
  7325. }
  7326. reqHeaders.Set("User-Agent", c.s.userAgent())
  7327. var body io.Reader = nil
  7328. c.urlParams_.Set("alt", alt)
  7329. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  7330. urls += "?" + c.urlParams_.Encode()
  7331. req, _ := http.NewRequest("DELETE", urls, body)
  7332. req.Header = reqHeaders
  7333. googleapi.Expand(req.URL, map[string]string{
  7334. "packageName": c.packageNameid,
  7335. "sku": c.skuid,
  7336. })
  7337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7338. }
  7339. // Do executes the "androidpublisher.inappproducts.delete" call.
  7340. func (c *InappproductsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7341. gensupport.SetOptions(c.urlParams_, opts...)
  7342. res, err := c.doRequest("json")
  7343. if err != nil {
  7344. return err
  7345. }
  7346. defer googleapi.CloseBody(res)
  7347. if err := googleapi.CheckResponse(res); err != nil {
  7348. return err
  7349. }
  7350. return nil
  7351. // {
  7352. // "description": "Delete an in-app product for an app.",
  7353. // "httpMethod": "DELETE",
  7354. // "id": "androidpublisher.inappproducts.delete",
  7355. // "parameterOrder": [
  7356. // "packageName",
  7357. // "sku"
  7358. // ],
  7359. // "parameters": {
  7360. // "packageName": {
  7361. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  7362. // "location": "path",
  7363. // "required": true,
  7364. // "type": "string"
  7365. // },
  7366. // "sku": {
  7367. // "description": "Unique identifier for the in-app product.",
  7368. // "location": "path",
  7369. // "required": true,
  7370. // "type": "string"
  7371. // }
  7372. // },
  7373. // "path": "{packageName}/inappproducts/{sku}",
  7374. // "scopes": [
  7375. // "https://www.googleapis.com/auth/androidpublisher"
  7376. // ]
  7377. // }
  7378. }
  7379. // method id "androidpublisher.inappproducts.get":
  7380. type InappproductsGetCall struct {
  7381. s *Service
  7382. packageName string
  7383. skuid string
  7384. urlParams_ gensupport.URLParams
  7385. ifNoneMatch_ string
  7386. ctx_ context.Context
  7387. header_ http.Header
  7388. }
  7389. // Get: Returns information about the in-app product specified.
  7390. func (r *InappproductsService) Get(packageName string, skuid string) *InappproductsGetCall {
  7391. c := &InappproductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7392. c.packageName = packageName
  7393. c.skuid = skuid
  7394. return c
  7395. }
  7396. // Fields allows partial responses to be retrieved. See
  7397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7398. // for more information.
  7399. func (c *InappproductsGetCall) Fields(s ...googleapi.Field) *InappproductsGetCall {
  7400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7401. return c
  7402. }
  7403. // IfNoneMatch sets the optional parameter which makes the operation
  7404. // fail if the object's ETag matches the given value. This is useful for
  7405. // getting updates only after the object has changed since the last
  7406. // request. Use googleapi.IsNotModified to check whether the response
  7407. // error from Do is the result of In-None-Match.
  7408. func (c *InappproductsGetCall) IfNoneMatch(entityTag string) *InappproductsGetCall {
  7409. c.ifNoneMatch_ = entityTag
  7410. return c
  7411. }
  7412. // Context sets the context to be used in this call's Do method. Any
  7413. // pending HTTP request will be aborted if the provided context is
  7414. // canceled.
  7415. func (c *InappproductsGetCall) Context(ctx context.Context) *InappproductsGetCall {
  7416. c.ctx_ = ctx
  7417. return c
  7418. }
  7419. // Header returns an http.Header that can be modified by the caller to
  7420. // add HTTP headers to the request.
  7421. func (c *InappproductsGetCall) Header() http.Header {
  7422. if c.header_ == nil {
  7423. c.header_ = make(http.Header)
  7424. }
  7425. return c.header_
  7426. }
  7427. func (c *InappproductsGetCall) doRequest(alt string) (*http.Response, error) {
  7428. reqHeaders := make(http.Header)
  7429. for k, v := range c.header_ {
  7430. reqHeaders[k] = v
  7431. }
  7432. reqHeaders.Set("User-Agent", c.s.userAgent())
  7433. if c.ifNoneMatch_ != "" {
  7434. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7435. }
  7436. var body io.Reader = nil
  7437. c.urlParams_.Set("alt", alt)
  7438. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  7439. urls += "?" + c.urlParams_.Encode()
  7440. req, _ := http.NewRequest("GET", urls, body)
  7441. req.Header = reqHeaders
  7442. googleapi.Expand(req.URL, map[string]string{
  7443. "packageName": c.packageName,
  7444. "sku": c.skuid,
  7445. })
  7446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7447. }
  7448. // Do executes the "androidpublisher.inappproducts.get" call.
  7449. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  7450. // status code is an error. Response headers are in either
  7451. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  7452. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7453. // to check whether the returned error was because
  7454. // http.StatusNotModified was returned.
  7455. func (c *InappproductsGetCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  7456. gensupport.SetOptions(c.urlParams_, opts...)
  7457. res, err := c.doRequest("json")
  7458. if res != nil && res.StatusCode == http.StatusNotModified {
  7459. if res.Body != nil {
  7460. res.Body.Close()
  7461. }
  7462. return nil, &googleapi.Error{
  7463. Code: res.StatusCode,
  7464. Header: res.Header,
  7465. }
  7466. }
  7467. if err != nil {
  7468. return nil, err
  7469. }
  7470. defer googleapi.CloseBody(res)
  7471. if err := googleapi.CheckResponse(res); err != nil {
  7472. return nil, err
  7473. }
  7474. ret := &InAppProduct{
  7475. ServerResponse: googleapi.ServerResponse{
  7476. Header: res.Header,
  7477. HTTPStatusCode: res.StatusCode,
  7478. },
  7479. }
  7480. target := &ret
  7481. if err := gensupport.DecodeResponse(target, res); err != nil {
  7482. return nil, err
  7483. }
  7484. return ret, nil
  7485. // {
  7486. // "description": "Returns information about the in-app product specified.",
  7487. // "httpMethod": "GET",
  7488. // "id": "androidpublisher.inappproducts.get",
  7489. // "parameterOrder": [
  7490. // "packageName",
  7491. // "sku"
  7492. // ],
  7493. // "parameters": {
  7494. // "packageName": {
  7495. // "location": "path",
  7496. // "required": true,
  7497. // "type": "string"
  7498. // },
  7499. // "sku": {
  7500. // "description": "Unique identifier for the in-app product.",
  7501. // "location": "path",
  7502. // "required": true,
  7503. // "type": "string"
  7504. // }
  7505. // },
  7506. // "path": "{packageName}/inappproducts/{sku}",
  7507. // "response": {
  7508. // "$ref": "InAppProduct"
  7509. // },
  7510. // "scopes": [
  7511. // "https://www.googleapis.com/auth/androidpublisher"
  7512. // ]
  7513. // }
  7514. }
  7515. // method id "androidpublisher.inappproducts.insert":
  7516. type InappproductsInsertCall struct {
  7517. s *Service
  7518. packageNameid string
  7519. inappproduct *InAppProduct
  7520. urlParams_ gensupport.URLParams
  7521. ctx_ context.Context
  7522. header_ http.Header
  7523. }
  7524. // Insert: Creates a new in-app product for an app.
  7525. func (r *InappproductsService) Insert(packageNameid string, inappproduct *InAppProduct) *InappproductsInsertCall {
  7526. c := &InappproductsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7527. c.packageNameid = packageNameid
  7528. c.inappproduct = inappproduct
  7529. return c
  7530. }
  7531. // AutoConvertMissingPrices sets the optional parameter
  7532. // "autoConvertMissingPrices": If true the prices for all regions
  7533. // targeted by the parent app that don't have a price specified for this
  7534. // in-app product will be auto converted to the target currency based on
  7535. // the default price. Defaults to false.
  7536. func (c *InappproductsInsertCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsInsertCall {
  7537. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  7538. return c
  7539. }
  7540. // Fields allows partial responses to be retrieved. See
  7541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7542. // for more information.
  7543. func (c *InappproductsInsertCall) Fields(s ...googleapi.Field) *InappproductsInsertCall {
  7544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7545. return c
  7546. }
  7547. // Context sets the context to be used in this call's Do method. Any
  7548. // pending HTTP request will be aborted if the provided context is
  7549. // canceled.
  7550. func (c *InappproductsInsertCall) Context(ctx context.Context) *InappproductsInsertCall {
  7551. c.ctx_ = ctx
  7552. return c
  7553. }
  7554. // Header returns an http.Header that can be modified by the caller to
  7555. // add HTTP headers to the request.
  7556. func (c *InappproductsInsertCall) Header() http.Header {
  7557. if c.header_ == nil {
  7558. c.header_ = make(http.Header)
  7559. }
  7560. return c.header_
  7561. }
  7562. func (c *InappproductsInsertCall) doRequest(alt string) (*http.Response, error) {
  7563. reqHeaders := make(http.Header)
  7564. for k, v := range c.header_ {
  7565. reqHeaders[k] = v
  7566. }
  7567. reqHeaders.Set("User-Agent", c.s.userAgent())
  7568. var body io.Reader = nil
  7569. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  7570. if err != nil {
  7571. return nil, err
  7572. }
  7573. reqHeaders.Set("Content-Type", "application/json")
  7574. c.urlParams_.Set("alt", alt)
  7575. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  7576. urls += "?" + c.urlParams_.Encode()
  7577. req, _ := http.NewRequest("POST", urls, body)
  7578. req.Header = reqHeaders
  7579. googleapi.Expand(req.URL, map[string]string{
  7580. "packageName": c.packageNameid,
  7581. })
  7582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7583. }
  7584. // Do executes the "androidpublisher.inappproducts.insert" call.
  7585. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  7586. // status code is an error. Response headers are in either
  7587. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  7588. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7589. // to check whether the returned error was because
  7590. // http.StatusNotModified was returned.
  7591. func (c *InappproductsInsertCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  7592. gensupport.SetOptions(c.urlParams_, opts...)
  7593. res, err := c.doRequest("json")
  7594. if res != nil && res.StatusCode == http.StatusNotModified {
  7595. if res.Body != nil {
  7596. res.Body.Close()
  7597. }
  7598. return nil, &googleapi.Error{
  7599. Code: res.StatusCode,
  7600. Header: res.Header,
  7601. }
  7602. }
  7603. if err != nil {
  7604. return nil, err
  7605. }
  7606. defer googleapi.CloseBody(res)
  7607. if err := googleapi.CheckResponse(res); err != nil {
  7608. return nil, err
  7609. }
  7610. ret := &InAppProduct{
  7611. ServerResponse: googleapi.ServerResponse{
  7612. Header: res.Header,
  7613. HTTPStatusCode: res.StatusCode,
  7614. },
  7615. }
  7616. target := &ret
  7617. if err := gensupport.DecodeResponse(target, res); err != nil {
  7618. return nil, err
  7619. }
  7620. return ret, nil
  7621. // {
  7622. // "description": "Creates a new in-app product for an app.",
  7623. // "httpMethod": "POST",
  7624. // "id": "androidpublisher.inappproducts.insert",
  7625. // "parameterOrder": [
  7626. // "packageName"
  7627. // ],
  7628. // "parameters": {
  7629. // "autoConvertMissingPrices": {
  7630. // "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.",
  7631. // "location": "query",
  7632. // "type": "boolean"
  7633. // },
  7634. // "packageName": {
  7635. // "description": "Unique identifier for the Android app; for example, \"com.spiffygame\".",
  7636. // "location": "path",
  7637. // "required": true,
  7638. // "type": "string"
  7639. // }
  7640. // },
  7641. // "path": "{packageName}/inappproducts",
  7642. // "request": {
  7643. // "$ref": "InAppProduct"
  7644. // },
  7645. // "response": {
  7646. // "$ref": "InAppProduct"
  7647. // },
  7648. // "scopes": [
  7649. // "https://www.googleapis.com/auth/androidpublisher"
  7650. // ]
  7651. // }
  7652. }
  7653. // method id "androidpublisher.inappproducts.list":
  7654. type InappproductsListCall struct {
  7655. s *Service
  7656. packageNameid string
  7657. urlParams_ gensupport.URLParams
  7658. ifNoneMatch_ string
  7659. ctx_ context.Context
  7660. header_ http.Header
  7661. }
  7662. // List: List all the in-app products for an Android app, both
  7663. // subscriptions and managed in-app products..
  7664. func (r *InappproductsService) List(packageNameid string) *InappproductsListCall {
  7665. c := &InappproductsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7666. c.packageNameid = packageNameid
  7667. return c
  7668. }
  7669. // MaxResults sets the optional parameter "maxResults":
  7670. func (c *InappproductsListCall) MaxResults(maxResults int64) *InappproductsListCall {
  7671. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  7672. return c
  7673. }
  7674. // StartIndex sets the optional parameter "startIndex":
  7675. func (c *InappproductsListCall) StartIndex(startIndex int64) *InappproductsListCall {
  7676. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  7677. return c
  7678. }
  7679. // Token sets the optional parameter "token":
  7680. func (c *InappproductsListCall) Token(token string) *InappproductsListCall {
  7681. c.urlParams_.Set("token", token)
  7682. return c
  7683. }
  7684. // Fields allows partial responses to be retrieved. See
  7685. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7686. // for more information.
  7687. func (c *InappproductsListCall) Fields(s ...googleapi.Field) *InappproductsListCall {
  7688. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7689. return c
  7690. }
  7691. // IfNoneMatch sets the optional parameter which makes the operation
  7692. // fail if the object's ETag matches the given value. This is useful for
  7693. // getting updates only after the object has changed since the last
  7694. // request. Use googleapi.IsNotModified to check whether the response
  7695. // error from Do is the result of In-None-Match.
  7696. func (c *InappproductsListCall) IfNoneMatch(entityTag string) *InappproductsListCall {
  7697. c.ifNoneMatch_ = entityTag
  7698. return c
  7699. }
  7700. // Context sets the context to be used in this call's Do method. Any
  7701. // pending HTTP request will be aborted if the provided context is
  7702. // canceled.
  7703. func (c *InappproductsListCall) Context(ctx context.Context) *InappproductsListCall {
  7704. c.ctx_ = ctx
  7705. return c
  7706. }
  7707. // Header returns an http.Header that can be modified by the caller to
  7708. // add HTTP headers to the request.
  7709. func (c *InappproductsListCall) Header() http.Header {
  7710. if c.header_ == nil {
  7711. c.header_ = make(http.Header)
  7712. }
  7713. return c.header_
  7714. }
  7715. func (c *InappproductsListCall) doRequest(alt string) (*http.Response, error) {
  7716. reqHeaders := make(http.Header)
  7717. for k, v := range c.header_ {
  7718. reqHeaders[k] = v
  7719. }
  7720. reqHeaders.Set("User-Agent", c.s.userAgent())
  7721. if c.ifNoneMatch_ != "" {
  7722. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7723. }
  7724. var body io.Reader = nil
  7725. c.urlParams_.Set("alt", alt)
  7726. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts")
  7727. urls += "?" + c.urlParams_.Encode()
  7728. req, _ := http.NewRequest("GET", urls, body)
  7729. req.Header = reqHeaders
  7730. googleapi.Expand(req.URL, map[string]string{
  7731. "packageName": c.packageNameid,
  7732. })
  7733. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7734. }
  7735. // Do executes the "androidpublisher.inappproducts.list" call.
  7736. // Exactly one of *InappproductsListResponse or error will be non-nil.
  7737. // Any non-2xx status code is an error. Response headers are in either
  7738. // *InappproductsListResponse.ServerResponse.Header or (if a response
  7739. // was returned at all) in error.(*googleapi.Error).Header. Use
  7740. // googleapi.IsNotModified to check whether the returned error was
  7741. // because http.StatusNotModified was returned.
  7742. func (c *InappproductsListCall) Do(opts ...googleapi.CallOption) (*InappproductsListResponse, error) {
  7743. gensupport.SetOptions(c.urlParams_, opts...)
  7744. res, err := c.doRequest("json")
  7745. if res != nil && res.StatusCode == http.StatusNotModified {
  7746. if res.Body != nil {
  7747. res.Body.Close()
  7748. }
  7749. return nil, &googleapi.Error{
  7750. Code: res.StatusCode,
  7751. Header: res.Header,
  7752. }
  7753. }
  7754. if err != nil {
  7755. return nil, err
  7756. }
  7757. defer googleapi.CloseBody(res)
  7758. if err := googleapi.CheckResponse(res); err != nil {
  7759. return nil, err
  7760. }
  7761. ret := &InappproductsListResponse{
  7762. ServerResponse: googleapi.ServerResponse{
  7763. Header: res.Header,
  7764. HTTPStatusCode: res.StatusCode,
  7765. },
  7766. }
  7767. target := &ret
  7768. if err := gensupport.DecodeResponse(target, res); err != nil {
  7769. return nil, err
  7770. }
  7771. return ret, nil
  7772. // {
  7773. // "description": "List all the in-app products for an Android app, both subscriptions and managed in-app products..",
  7774. // "httpMethod": "GET",
  7775. // "id": "androidpublisher.inappproducts.list",
  7776. // "parameterOrder": [
  7777. // "packageName"
  7778. // ],
  7779. // "parameters": {
  7780. // "maxResults": {
  7781. // "format": "uint32",
  7782. // "location": "query",
  7783. // "type": "integer"
  7784. // },
  7785. // "packageName": {
  7786. // "description": "Unique identifier for the Android app with in-app products; for example, \"com.spiffygame\".",
  7787. // "location": "path",
  7788. // "required": true,
  7789. // "type": "string"
  7790. // },
  7791. // "startIndex": {
  7792. // "format": "uint32",
  7793. // "location": "query",
  7794. // "type": "integer"
  7795. // },
  7796. // "token": {
  7797. // "location": "query",
  7798. // "type": "string"
  7799. // }
  7800. // },
  7801. // "path": "{packageName}/inappproducts",
  7802. // "response": {
  7803. // "$ref": "InappproductsListResponse"
  7804. // },
  7805. // "scopes": [
  7806. // "https://www.googleapis.com/auth/androidpublisher"
  7807. // ]
  7808. // }
  7809. }
  7810. // method id "androidpublisher.inappproducts.patch":
  7811. type InappproductsPatchCall struct {
  7812. s *Service
  7813. packageNameid string
  7814. skuid string
  7815. inappproduct *InAppProduct
  7816. urlParams_ gensupport.URLParams
  7817. ctx_ context.Context
  7818. header_ http.Header
  7819. }
  7820. // Patch: Updates the details of an in-app product. This method supports
  7821. // patch semantics.
  7822. func (r *InappproductsService) Patch(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsPatchCall {
  7823. c := &InappproductsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7824. c.packageNameid = packageNameid
  7825. c.skuid = skuid
  7826. c.inappproduct = inappproduct
  7827. return c
  7828. }
  7829. // AutoConvertMissingPrices sets the optional parameter
  7830. // "autoConvertMissingPrices": If true the prices for all regions
  7831. // targeted by the parent app that don't have a price specified for this
  7832. // in-app product will be auto converted to the target currency based on
  7833. // the default price. Defaults to false.
  7834. func (c *InappproductsPatchCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsPatchCall {
  7835. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  7836. return c
  7837. }
  7838. // Fields allows partial responses to be retrieved. See
  7839. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7840. // for more information.
  7841. func (c *InappproductsPatchCall) Fields(s ...googleapi.Field) *InappproductsPatchCall {
  7842. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7843. return c
  7844. }
  7845. // Context sets the context to be used in this call's Do method. Any
  7846. // pending HTTP request will be aborted if the provided context is
  7847. // canceled.
  7848. func (c *InappproductsPatchCall) Context(ctx context.Context) *InappproductsPatchCall {
  7849. c.ctx_ = ctx
  7850. return c
  7851. }
  7852. // Header returns an http.Header that can be modified by the caller to
  7853. // add HTTP headers to the request.
  7854. func (c *InappproductsPatchCall) Header() http.Header {
  7855. if c.header_ == nil {
  7856. c.header_ = make(http.Header)
  7857. }
  7858. return c.header_
  7859. }
  7860. func (c *InappproductsPatchCall) doRequest(alt string) (*http.Response, error) {
  7861. reqHeaders := make(http.Header)
  7862. for k, v := range c.header_ {
  7863. reqHeaders[k] = v
  7864. }
  7865. reqHeaders.Set("User-Agent", c.s.userAgent())
  7866. var body io.Reader = nil
  7867. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  7868. if err != nil {
  7869. return nil, err
  7870. }
  7871. reqHeaders.Set("Content-Type", "application/json")
  7872. c.urlParams_.Set("alt", alt)
  7873. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  7874. urls += "?" + c.urlParams_.Encode()
  7875. req, _ := http.NewRequest("PATCH", urls, body)
  7876. req.Header = reqHeaders
  7877. googleapi.Expand(req.URL, map[string]string{
  7878. "packageName": c.packageNameid,
  7879. "sku": c.skuid,
  7880. })
  7881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7882. }
  7883. // Do executes the "androidpublisher.inappproducts.patch" call.
  7884. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  7885. // status code is an error. Response headers are in either
  7886. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  7887. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7888. // to check whether the returned error was because
  7889. // http.StatusNotModified was returned.
  7890. func (c *InappproductsPatchCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  7891. gensupport.SetOptions(c.urlParams_, opts...)
  7892. res, err := c.doRequest("json")
  7893. if res != nil && res.StatusCode == http.StatusNotModified {
  7894. if res.Body != nil {
  7895. res.Body.Close()
  7896. }
  7897. return nil, &googleapi.Error{
  7898. Code: res.StatusCode,
  7899. Header: res.Header,
  7900. }
  7901. }
  7902. if err != nil {
  7903. return nil, err
  7904. }
  7905. defer googleapi.CloseBody(res)
  7906. if err := googleapi.CheckResponse(res); err != nil {
  7907. return nil, err
  7908. }
  7909. ret := &InAppProduct{
  7910. ServerResponse: googleapi.ServerResponse{
  7911. Header: res.Header,
  7912. HTTPStatusCode: res.StatusCode,
  7913. },
  7914. }
  7915. target := &ret
  7916. if err := gensupport.DecodeResponse(target, res); err != nil {
  7917. return nil, err
  7918. }
  7919. return ret, nil
  7920. // {
  7921. // "description": "Updates the details of an in-app product. This method supports patch semantics.",
  7922. // "httpMethod": "PATCH",
  7923. // "id": "androidpublisher.inappproducts.patch",
  7924. // "parameterOrder": [
  7925. // "packageName",
  7926. // "sku"
  7927. // ],
  7928. // "parameters": {
  7929. // "autoConvertMissingPrices": {
  7930. // "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.",
  7931. // "location": "query",
  7932. // "type": "boolean"
  7933. // },
  7934. // "packageName": {
  7935. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  7936. // "location": "path",
  7937. // "required": true,
  7938. // "type": "string"
  7939. // },
  7940. // "sku": {
  7941. // "description": "Unique identifier for the in-app product.",
  7942. // "location": "path",
  7943. // "required": true,
  7944. // "type": "string"
  7945. // }
  7946. // },
  7947. // "path": "{packageName}/inappproducts/{sku}",
  7948. // "request": {
  7949. // "$ref": "InAppProduct"
  7950. // },
  7951. // "response": {
  7952. // "$ref": "InAppProduct"
  7953. // },
  7954. // "scopes": [
  7955. // "https://www.googleapis.com/auth/androidpublisher"
  7956. // ]
  7957. // }
  7958. }
  7959. // method id "androidpublisher.inappproducts.update":
  7960. type InappproductsUpdateCall struct {
  7961. s *Service
  7962. packageNameid string
  7963. skuid string
  7964. inappproduct *InAppProduct
  7965. urlParams_ gensupport.URLParams
  7966. ctx_ context.Context
  7967. header_ http.Header
  7968. }
  7969. // Update: Updates the details of an in-app product.
  7970. func (r *InappproductsService) Update(packageNameid string, skuid string, inappproduct *InAppProduct) *InappproductsUpdateCall {
  7971. c := &InappproductsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7972. c.packageNameid = packageNameid
  7973. c.skuid = skuid
  7974. c.inappproduct = inappproduct
  7975. return c
  7976. }
  7977. // AutoConvertMissingPrices sets the optional parameter
  7978. // "autoConvertMissingPrices": If true the prices for all regions
  7979. // targeted by the parent app that don't have a price specified for this
  7980. // in-app product will be auto converted to the target currency based on
  7981. // the default price. Defaults to false.
  7982. func (c *InappproductsUpdateCall) AutoConvertMissingPrices(autoConvertMissingPrices bool) *InappproductsUpdateCall {
  7983. c.urlParams_.Set("autoConvertMissingPrices", fmt.Sprint(autoConvertMissingPrices))
  7984. return c
  7985. }
  7986. // Fields allows partial responses to be retrieved. See
  7987. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7988. // for more information.
  7989. func (c *InappproductsUpdateCall) Fields(s ...googleapi.Field) *InappproductsUpdateCall {
  7990. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7991. return c
  7992. }
  7993. // Context sets the context to be used in this call's Do method. Any
  7994. // pending HTTP request will be aborted if the provided context is
  7995. // canceled.
  7996. func (c *InappproductsUpdateCall) Context(ctx context.Context) *InappproductsUpdateCall {
  7997. c.ctx_ = ctx
  7998. return c
  7999. }
  8000. // Header returns an http.Header that can be modified by the caller to
  8001. // add HTTP headers to the request.
  8002. func (c *InappproductsUpdateCall) Header() http.Header {
  8003. if c.header_ == nil {
  8004. c.header_ = make(http.Header)
  8005. }
  8006. return c.header_
  8007. }
  8008. func (c *InappproductsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8009. reqHeaders := make(http.Header)
  8010. for k, v := range c.header_ {
  8011. reqHeaders[k] = v
  8012. }
  8013. reqHeaders.Set("User-Agent", c.s.userAgent())
  8014. var body io.Reader = nil
  8015. body, err := googleapi.WithoutDataWrapper.JSONReader(c.inappproduct)
  8016. if err != nil {
  8017. return nil, err
  8018. }
  8019. reqHeaders.Set("Content-Type", "application/json")
  8020. c.urlParams_.Set("alt", alt)
  8021. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/inappproducts/{sku}")
  8022. urls += "?" + c.urlParams_.Encode()
  8023. req, _ := http.NewRequest("PUT", urls, body)
  8024. req.Header = reqHeaders
  8025. googleapi.Expand(req.URL, map[string]string{
  8026. "packageName": c.packageNameid,
  8027. "sku": c.skuid,
  8028. })
  8029. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8030. }
  8031. // Do executes the "androidpublisher.inappproducts.update" call.
  8032. // Exactly one of *InAppProduct or error will be non-nil. Any non-2xx
  8033. // status code is an error. Response headers are in either
  8034. // *InAppProduct.ServerResponse.Header or (if a response was returned at
  8035. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8036. // to check whether the returned error was because
  8037. // http.StatusNotModified was returned.
  8038. func (c *InappproductsUpdateCall) Do(opts ...googleapi.CallOption) (*InAppProduct, error) {
  8039. gensupport.SetOptions(c.urlParams_, opts...)
  8040. res, err := c.doRequest("json")
  8041. if res != nil && res.StatusCode == http.StatusNotModified {
  8042. if res.Body != nil {
  8043. res.Body.Close()
  8044. }
  8045. return nil, &googleapi.Error{
  8046. Code: res.StatusCode,
  8047. Header: res.Header,
  8048. }
  8049. }
  8050. if err != nil {
  8051. return nil, err
  8052. }
  8053. defer googleapi.CloseBody(res)
  8054. if err := googleapi.CheckResponse(res); err != nil {
  8055. return nil, err
  8056. }
  8057. ret := &InAppProduct{
  8058. ServerResponse: googleapi.ServerResponse{
  8059. Header: res.Header,
  8060. HTTPStatusCode: res.StatusCode,
  8061. },
  8062. }
  8063. target := &ret
  8064. if err := gensupport.DecodeResponse(target, res); err != nil {
  8065. return nil, err
  8066. }
  8067. return ret, nil
  8068. // {
  8069. // "description": "Updates the details of an in-app product.",
  8070. // "httpMethod": "PUT",
  8071. // "id": "androidpublisher.inappproducts.update",
  8072. // "parameterOrder": [
  8073. // "packageName",
  8074. // "sku"
  8075. // ],
  8076. // "parameters": {
  8077. // "autoConvertMissingPrices": {
  8078. // "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.",
  8079. // "location": "query",
  8080. // "type": "boolean"
  8081. // },
  8082. // "packageName": {
  8083. // "description": "Unique identifier for the Android app with the in-app product; for example, \"com.spiffygame\".",
  8084. // "location": "path",
  8085. // "required": true,
  8086. // "type": "string"
  8087. // },
  8088. // "sku": {
  8089. // "description": "Unique identifier for the in-app product.",
  8090. // "location": "path",
  8091. // "required": true,
  8092. // "type": "string"
  8093. // }
  8094. // },
  8095. // "path": "{packageName}/inappproducts/{sku}",
  8096. // "request": {
  8097. // "$ref": "InAppProduct"
  8098. // },
  8099. // "response": {
  8100. // "$ref": "InAppProduct"
  8101. // },
  8102. // "scopes": [
  8103. // "https://www.googleapis.com/auth/androidpublisher"
  8104. // ]
  8105. // }
  8106. }
  8107. // method id "androidpublisher.orders.refund":
  8108. type OrdersRefundCall struct {
  8109. s *Service
  8110. packageName string
  8111. orderId string
  8112. urlParams_ gensupport.URLParams
  8113. ctx_ context.Context
  8114. header_ http.Header
  8115. }
  8116. // Refund: Refund a user's subscription or in-app purchase order.
  8117. func (r *OrdersService) Refund(packageName string, orderId string) *OrdersRefundCall {
  8118. c := &OrdersRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8119. c.packageName = packageName
  8120. c.orderId = orderId
  8121. return c
  8122. }
  8123. // Revoke sets the optional parameter "revoke": Whether to revoke the
  8124. // purchased item. If set to true, access to the subscription or in-app
  8125. // item will be terminated immediately. If the item is a recurring
  8126. // subscription, all future payments will also be terminated. Consumed
  8127. // in-app items need to be handled by developer's app. (optional)
  8128. func (c *OrdersRefundCall) Revoke(revoke bool) *OrdersRefundCall {
  8129. c.urlParams_.Set("revoke", fmt.Sprint(revoke))
  8130. return c
  8131. }
  8132. // Fields allows partial responses to be retrieved. See
  8133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8134. // for more information.
  8135. func (c *OrdersRefundCall) Fields(s ...googleapi.Field) *OrdersRefundCall {
  8136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8137. return c
  8138. }
  8139. // Context sets the context to be used in this call's Do method. Any
  8140. // pending HTTP request will be aborted if the provided context is
  8141. // canceled.
  8142. func (c *OrdersRefundCall) Context(ctx context.Context) *OrdersRefundCall {
  8143. c.ctx_ = ctx
  8144. return c
  8145. }
  8146. // Header returns an http.Header that can be modified by the caller to
  8147. // add HTTP headers to the request.
  8148. func (c *OrdersRefundCall) Header() http.Header {
  8149. if c.header_ == nil {
  8150. c.header_ = make(http.Header)
  8151. }
  8152. return c.header_
  8153. }
  8154. func (c *OrdersRefundCall) doRequest(alt string) (*http.Response, error) {
  8155. reqHeaders := make(http.Header)
  8156. for k, v := range c.header_ {
  8157. reqHeaders[k] = v
  8158. }
  8159. reqHeaders.Set("User-Agent", c.s.userAgent())
  8160. var body io.Reader = nil
  8161. c.urlParams_.Set("alt", alt)
  8162. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/orders/{orderId}:refund")
  8163. urls += "?" + c.urlParams_.Encode()
  8164. req, _ := http.NewRequest("POST", urls, body)
  8165. req.Header = reqHeaders
  8166. googleapi.Expand(req.URL, map[string]string{
  8167. "packageName": c.packageName,
  8168. "orderId": c.orderId,
  8169. })
  8170. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8171. }
  8172. // Do executes the "androidpublisher.orders.refund" call.
  8173. func (c *OrdersRefundCall) Do(opts ...googleapi.CallOption) error {
  8174. gensupport.SetOptions(c.urlParams_, opts...)
  8175. res, err := c.doRequest("json")
  8176. if err != nil {
  8177. return err
  8178. }
  8179. defer googleapi.CloseBody(res)
  8180. if err := googleapi.CheckResponse(res); err != nil {
  8181. return err
  8182. }
  8183. return nil
  8184. // {
  8185. // "description": "Refund a user's subscription or in-app purchase order.",
  8186. // "httpMethod": "POST",
  8187. // "id": "androidpublisher.orders.refund",
  8188. // "parameterOrder": [
  8189. // "packageName",
  8190. // "orderId"
  8191. // ],
  8192. // "parameters": {
  8193. // "orderId": {
  8194. // "description": "The order ID provided to the user when the subscription or in-app order was purchased.",
  8195. // "location": "path",
  8196. // "required": true,
  8197. // "type": "string"
  8198. // },
  8199. // "packageName": {
  8200. // "description": "The package name of the application for which this subscription or in-app item was purchased (for example, 'com.some.thing').",
  8201. // "location": "path",
  8202. // "required": true,
  8203. // "type": "string"
  8204. // },
  8205. // "revoke": {
  8206. // "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)",
  8207. // "location": "query",
  8208. // "type": "boolean"
  8209. // }
  8210. // },
  8211. // "path": "{packageName}/orders/{orderId}:refund",
  8212. // "scopes": [
  8213. // "https://www.googleapis.com/auth/androidpublisher"
  8214. // ]
  8215. // }
  8216. }
  8217. // method id "androidpublisher.purchases.products.get":
  8218. type PurchasesProductsGetCall struct {
  8219. s *Service
  8220. packageName string
  8221. productId string
  8222. token string
  8223. urlParams_ gensupport.URLParams
  8224. ifNoneMatch_ string
  8225. ctx_ context.Context
  8226. header_ http.Header
  8227. }
  8228. // Get: Checks the purchase and consumption status of an inapp item.
  8229. func (r *PurchasesProductsService) Get(packageName string, productId string, token string) *PurchasesProductsGetCall {
  8230. c := &PurchasesProductsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8231. c.packageName = packageName
  8232. c.productId = productId
  8233. c.token = token
  8234. return c
  8235. }
  8236. // Fields allows partial responses to be retrieved. See
  8237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8238. // for more information.
  8239. func (c *PurchasesProductsGetCall) Fields(s ...googleapi.Field) *PurchasesProductsGetCall {
  8240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8241. return c
  8242. }
  8243. // IfNoneMatch sets the optional parameter which makes the operation
  8244. // fail if the object's ETag matches the given value. This is useful for
  8245. // getting updates only after the object has changed since the last
  8246. // request. Use googleapi.IsNotModified to check whether the response
  8247. // error from Do is the result of In-None-Match.
  8248. func (c *PurchasesProductsGetCall) IfNoneMatch(entityTag string) *PurchasesProductsGetCall {
  8249. c.ifNoneMatch_ = entityTag
  8250. return c
  8251. }
  8252. // Context sets the context to be used in this call's Do method. Any
  8253. // pending HTTP request will be aborted if the provided context is
  8254. // canceled.
  8255. func (c *PurchasesProductsGetCall) Context(ctx context.Context) *PurchasesProductsGetCall {
  8256. c.ctx_ = ctx
  8257. return c
  8258. }
  8259. // Header returns an http.Header that can be modified by the caller to
  8260. // add HTTP headers to the request.
  8261. func (c *PurchasesProductsGetCall) Header() http.Header {
  8262. if c.header_ == nil {
  8263. c.header_ = make(http.Header)
  8264. }
  8265. return c.header_
  8266. }
  8267. func (c *PurchasesProductsGetCall) doRequest(alt string) (*http.Response, error) {
  8268. reqHeaders := make(http.Header)
  8269. for k, v := range c.header_ {
  8270. reqHeaders[k] = v
  8271. }
  8272. reqHeaders.Set("User-Agent", c.s.userAgent())
  8273. if c.ifNoneMatch_ != "" {
  8274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8275. }
  8276. var body io.Reader = nil
  8277. c.urlParams_.Set("alt", alt)
  8278. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/products/{productId}/tokens/{token}")
  8279. urls += "?" + c.urlParams_.Encode()
  8280. req, _ := http.NewRequest("GET", urls, body)
  8281. req.Header = reqHeaders
  8282. googleapi.Expand(req.URL, map[string]string{
  8283. "packageName": c.packageName,
  8284. "productId": c.productId,
  8285. "token": c.token,
  8286. })
  8287. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8288. }
  8289. // Do executes the "androidpublisher.purchases.products.get" call.
  8290. // Exactly one of *ProductPurchase or error will be non-nil. Any non-2xx
  8291. // status code is an error. Response headers are in either
  8292. // *ProductPurchase.ServerResponse.Header or (if a response was returned
  8293. // at all) in error.(*googleapi.Error).Header. Use
  8294. // googleapi.IsNotModified to check whether the returned error was
  8295. // because http.StatusNotModified was returned.
  8296. func (c *PurchasesProductsGetCall) Do(opts ...googleapi.CallOption) (*ProductPurchase, error) {
  8297. gensupport.SetOptions(c.urlParams_, opts...)
  8298. res, err := c.doRequest("json")
  8299. if res != nil && res.StatusCode == http.StatusNotModified {
  8300. if res.Body != nil {
  8301. res.Body.Close()
  8302. }
  8303. return nil, &googleapi.Error{
  8304. Code: res.StatusCode,
  8305. Header: res.Header,
  8306. }
  8307. }
  8308. if err != nil {
  8309. return nil, err
  8310. }
  8311. defer googleapi.CloseBody(res)
  8312. if err := googleapi.CheckResponse(res); err != nil {
  8313. return nil, err
  8314. }
  8315. ret := &ProductPurchase{
  8316. ServerResponse: googleapi.ServerResponse{
  8317. Header: res.Header,
  8318. HTTPStatusCode: res.StatusCode,
  8319. },
  8320. }
  8321. target := &ret
  8322. if err := gensupport.DecodeResponse(target, res); err != nil {
  8323. return nil, err
  8324. }
  8325. return ret, nil
  8326. // {
  8327. // "description": "Checks the purchase and consumption status of an inapp item.",
  8328. // "httpMethod": "GET",
  8329. // "id": "androidpublisher.purchases.products.get",
  8330. // "parameterOrder": [
  8331. // "packageName",
  8332. // "productId",
  8333. // "token"
  8334. // ],
  8335. // "parameters": {
  8336. // "packageName": {
  8337. // "description": "The package name of the application the inapp product was sold in (for example, 'com.some.thing').",
  8338. // "location": "path",
  8339. // "required": true,
  8340. // "type": "string"
  8341. // },
  8342. // "productId": {
  8343. // "description": "The inapp product SKU (for example, 'com.some.thing.inapp1').",
  8344. // "location": "path",
  8345. // "required": true,
  8346. // "type": "string"
  8347. // },
  8348. // "token": {
  8349. // "description": "The token provided to the user's device when the inapp product was purchased.",
  8350. // "location": "path",
  8351. // "required": true,
  8352. // "type": "string"
  8353. // }
  8354. // },
  8355. // "path": "{packageName}/purchases/products/{productId}/tokens/{token}",
  8356. // "response": {
  8357. // "$ref": "ProductPurchase"
  8358. // },
  8359. // "scopes": [
  8360. // "https://www.googleapis.com/auth/androidpublisher"
  8361. // ]
  8362. // }
  8363. }
  8364. // method id "androidpublisher.purchases.subscriptions.cancel":
  8365. type PurchasesSubscriptionsCancelCall struct {
  8366. s *Service
  8367. packageName string
  8368. subscriptionId string
  8369. token string
  8370. urlParams_ gensupport.URLParams
  8371. ctx_ context.Context
  8372. header_ http.Header
  8373. }
  8374. // Cancel: Cancels a user's subscription purchase. The subscription
  8375. // remains valid until its expiration time.
  8376. func (r *PurchasesSubscriptionsService) Cancel(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsCancelCall {
  8377. c := &PurchasesSubscriptionsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8378. c.packageName = packageName
  8379. c.subscriptionId = subscriptionId
  8380. c.token = token
  8381. return c
  8382. }
  8383. // Fields allows partial responses to be retrieved. See
  8384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8385. // for more information.
  8386. func (c *PurchasesSubscriptionsCancelCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsCancelCall {
  8387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8388. return c
  8389. }
  8390. // Context sets the context to be used in this call's Do method. Any
  8391. // pending HTTP request will be aborted if the provided context is
  8392. // canceled.
  8393. func (c *PurchasesSubscriptionsCancelCall) Context(ctx context.Context) *PurchasesSubscriptionsCancelCall {
  8394. c.ctx_ = ctx
  8395. return c
  8396. }
  8397. // Header returns an http.Header that can be modified by the caller to
  8398. // add HTTP headers to the request.
  8399. func (c *PurchasesSubscriptionsCancelCall) Header() http.Header {
  8400. if c.header_ == nil {
  8401. c.header_ = make(http.Header)
  8402. }
  8403. return c.header_
  8404. }
  8405. func (c *PurchasesSubscriptionsCancelCall) doRequest(alt string) (*http.Response, error) {
  8406. reqHeaders := make(http.Header)
  8407. for k, v := range c.header_ {
  8408. reqHeaders[k] = v
  8409. }
  8410. reqHeaders.Set("User-Agent", c.s.userAgent())
  8411. var body io.Reader = nil
  8412. c.urlParams_.Set("alt", alt)
  8413. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel")
  8414. urls += "?" + c.urlParams_.Encode()
  8415. req, _ := http.NewRequest("POST", urls, body)
  8416. req.Header = reqHeaders
  8417. googleapi.Expand(req.URL, map[string]string{
  8418. "packageName": c.packageName,
  8419. "subscriptionId": c.subscriptionId,
  8420. "token": c.token,
  8421. })
  8422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8423. }
  8424. // Do executes the "androidpublisher.purchases.subscriptions.cancel" call.
  8425. func (c *PurchasesSubscriptionsCancelCall) Do(opts ...googleapi.CallOption) error {
  8426. gensupport.SetOptions(c.urlParams_, opts...)
  8427. res, err := c.doRequest("json")
  8428. if err != nil {
  8429. return err
  8430. }
  8431. defer googleapi.CloseBody(res)
  8432. if err := googleapi.CheckResponse(res); err != nil {
  8433. return err
  8434. }
  8435. return nil
  8436. // {
  8437. // "description": "Cancels a user's subscription purchase. The subscription remains valid until its expiration time.",
  8438. // "httpMethod": "POST",
  8439. // "id": "androidpublisher.purchases.subscriptions.cancel",
  8440. // "parameterOrder": [
  8441. // "packageName",
  8442. // "subscriptionId",
  8443. // "token"
  8444. // ],
  8445. // "parameters": {
  8446. // "packageName": {
  8447. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8448. // "location": "path",
  8449. // "required": true,
  8450. // "type": "string"
  8451. // },
  8452. // "subscriptionId": {
  8453. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8454. // "location": "path",
  8455. // "required": true,
  8456. // "type": "string"
  8457. // },
  8458. // "token": {
  8459. // "description": "The token provided to the user's device when the subscription was purchased.",
  8460. // "location": "path",
  8461. // "required": true,
  8462. // "type": "string"
  8463. // }
  8464. // },
  8465. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel",
  8466. // "scopes": [
  8467. // "https://www.googleapis.com/auth/androidpublisher"
  8468. // ]
  8469. // }
  8470. }
  8471. // method id "androidpublisher.purchases.subscriptions.defer":
  8472. type PurchasesSubscriptionsDeferCall struct {
  8473. s *Service
  8474. packageName string
  8475. subscriptionId string
  8476. token string
  8477. subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest
  8478. urlParams_ gensupport.URLParams
  8479. ctx_ context.Context
  8480. header_ http.Header
  8481. }
  8482. // Defer: Defers a user's subscription purchase until a specified future
  8483. // expiration time.
  8484. func (r *PurchasesSubscriptionsService) Defer(packageName string, subscriptionId string, token string, subscriptionpurchasesdeferrequest *SubscriptionPurchasesDeferRequest) *PurchasesSubscriptionsDeferCall {
  8485. c := &PurchasesSubscriptionsDeferCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8486. c.packageName = packageName
  8487. c.subscriptionId = subscriptionId
  8488. c.token = token
  8489. c.subscriptionpurchasesdeferrequest = subscriptionpurchasesdeferrequest
  8490. return c
  8491. }
  8492. // Fields allows partial responses to be retrieved. See
  8493. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8494. // for more information.
  8495. func (c *PurchasesSubscriptionsDeferCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsDeferCall {
  8496. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8497. return c
  8498. }
  8499. // Context sets the context to be used in this call's Do method. Any
  8500. // pending HTTP request will be aborted if the provided context is
  8501. // canceled.
  8502. func (c *PurchasesSubscriptionsDeferCall) Context(ctx context.Context) *PurchasesSubscriptionsDeferCall {
  8503. c.ctx_ = ctx
  8504. return c
  8505. }
  8506. // Header returns an http.Header that can be modified by the caller to
  8507. // add HTTP headers to the request.
  8508. func (c *PurchasesSubscriptionsDeferCall) Header() http.Header {
  8509. if c.header_ == nil {
  8510. c.header_ = make(http.Header)
  8511. }
  8512. return c.header_
  8513. }
  8514. func (c *PurchasesSubscriptionsDeferCall) doRequest(alt string) (*http.Response, error) {
  8515. reqHeaders := make(http.Header)
  8516. for k, v := range c.header_ {
  8517. reqHeaders[k] = v
  8518. }
  8519. reqHeaders.Set("User-Agent", c.s.userAgent())
  8520. var body io.Reader = nil
  8521. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscriptionpurchasesdeferrequest)
  8522. if err != nil {
  8523. return nil, err
  8524. }
  8525. reqHeaders.Set("Content-Type", "application/json")
  8526. c.urlParams_.Set("alt", alt)
  8527. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer")
  8528. urls += "?" + c.urlParams_.Encode()
  8529. req, _ := http.NewRequest("POST", urls, body)
  8530. req.Header = reqHeaders
  8531. googleapi.Expand(req.URL, map[string]string{
  8532. "packageName": c.packageName,
  8533. "subscriptionId": c.subscriptionId,
  8534. "token": c.token,
  8535. })
  8536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8537. }
  8538. // Do executes the "androidpublisher.purchases.subscriptions.defer" call.
  8539. // Exactly one of *SubscriptionPurchasesDeferResponse or error will be
  8540. // non-nil. Any non-2xx status code is an error. Response headers are in
  8541. // either *SubscriptionPurchasesDeferResponse.ServerResponse.Header or
  8542. // (if a response was returned at all) in
  8543. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8544. // whether the returned error was because http.StatusNotModified was
  8545. // returned.
  8546. func (c *PurchasesSubscriptionsDeferCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchasesDeferResponse, error) {
  8547. gensupport.SetOptions(c.urlParams_, opts...)
  8548. res, err := c.doRequest("json")
  8549. if res != nil && res.StatusCode == http.StatusNotModified {
  8550. if res.Body != nil {
  8551. res.Body.Close()
  8552. }
  8553. return nil, &googleapi.Error{
  8554. Code: res.StatusCode,
  8555. Header: res.Header,
  8556. }
  8557. }
  8558. if err != nil {
  8559. return nil, err
  8560. }
  8561. defer googleapi.CloseBody(res)
  8562. if err := googleapi.CheckResponse(res); err != nil {
  8563. return nil, err
  8564. }
  8565. ret := &SubscriptionPurchasesDeferResponse{
  8566. ServerResponse: googleapi.ServerResponse{
  8567. Header: res.Header,
  8568. HTTPStatusCode: res.StatusCode,
  8569. },
  8570. }
  8571. target := &ret
  8572. if err := gensupport.DecodeResponse(target, res); err != nil {
  8573. return nil, err
  8574. }
  8575. return ret, nil
  8576. // {
  8577. // "description": "Defers a user's subscription purchase until a specified future expiration time.",
  8578. // "httpMethod": "POST",
  8579. // "id": "androidpublisher.purchases.subscriptions.defer",
  8580. // "parameterOrder": [
  8581. // "packageName",
  8582. // "subscriptionId",
  8583. // "token"
  8584. // ],
  8585. // "parameters": {
  8586. // "packageName": {
  8587. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8588. // "location": "path",
  8589. // "required": true,
  8590. // "type": "string"
  8591. // },
  8592. // "subscriptionId": {
  8593. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8594. // "location": "path",
  8595. // "required": true,
  8596. // "type": "string"
  8597. // },
  8598. // "token": {
  8599. // "description": "The token provided to the user's device when the subscription was purchased.",
  8600. // "location": "path",
  8601. // "required": true,
  8602. // "type": "string"
  8603. // }
  8604. // },
  8605. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer",
  8606. // "request": {
  8607. // "$ref": "SubscriptionPurchasesDeferRequest"
  8608. // },
  8609. // "response": {
  8610. // "$ref": "SubscriptionPurchasesDeferResponse"
  8611. // },
  8612. // "scopes": [
  8613. // "https://www.googleapis.com/auth/androidpublisher"
  8614. // ]
  8615. // }
  8616. }
  8617. // method id "androidpublisher.purchases.subscriptions.get":
  8618. type PurchasesSubscriptionsGetCall struct {
  8619. s *Service
  8620. packageName string
  8621. subscriptionId string
  8622. token string
  8623. urlParams_ gensupport.URLParams
  8624. ifNoneMatch_ string
  8625. ctx_ context.Context
  8626. header_ http.Header
  8627. }
  8628. // Get: Checks whether a user's subscription purchase is valid and
  8629. // returns its expiry time.
  8630. func (r *PurchasesSubscriptionsService) Get(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsGetCall {
  8631. c := &PurchasesSubscriptionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8632. c.packageName = packageName
  8633. c.subscriptionId = subscriptionId
  8634. c.token = token
  8635. return c
  8636. }
  8637. // Fields allows partial responses to be retrieved. See
  8638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8639. // for more information.
  8640. func (c *PurchasesSubscriptionsGetCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsGetCall {
  8641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8642. return c
  8643. }
  8644. // IfNoneMatch sets the optional parameter which makes the operation
  8645. // fail if the object's ETag matches the given value. This is useful for
  8646. // getting updates only after the object has changed since the last
  8647. // request. Use googleapi.IsNotModified to check whether the response
  8648. // error from Do is the result of In-None-Match.
  8649. func (c *PurchasesSubscriptionsGetCall) IfNoneMatch(entityTag string) *PurchasesSubscriptionsGetCall {
  8650. c.ifNoneMatch_ = entityTag
  8651. return c
  8652. }
  8653. // Context sets the context to be used in this call's Do method. Any
  8654. // pending HTTP request will be aborted if the provided context is
  8655. // canceled.
  8656. func (c *PurchasesSubscriptionsGetCall) Context(ctx context.Context) *PurchasesSubscriptionsGetCall {
  8657. c.ctx_ = ctx
  8658. return c
  8659. }
  8660. // Header returns an http.Header that can be modified by the caller to
  8661. // add HTTP headers to the request.
  8662. func (c *PurchasesSubscriptionsGetCall) Header() http.Header {
  8663. if c.header_ == nil {
  8664. c.header_ = make(http.Header)
  8665. }
  8666. return c.header_
  8667. }
  8668. func (c *PurchasesSubscriptionsGetCall) doRequest(alt string) (*http.Response, error) {
  8669. reqHeaders := make(http.Header)
  8670. for k, v := range c.header_ {
  8671. reqHeaders[k] = v
  8672. }
  8673. reqHeaders.Set("User-Agent", c.s.userAgent())
  8674. if c.ifNoneMatch_ != "" {
  8675. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8676. }
  8677. var body io.Reader = nil
  8678. c.urlParams_.Set("alt", alt)
  8679. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}")
  8680. urls += "?" + c.urlParams_.Encode()
  8681. req, _ := http.NewRequest("GET", urls, body)
  8682. req.Header = reqHeaders
  8683. googleapi.Expand(req.URL, map[string]string{
  8684. "packageName": c.packageName,
  8685. "subscriptionId": c.subscriptionId,
  8686. "token": c.token,
  8687. })
  8688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8689. }
  8690. // Do executes the "androidpublisher.purchases.subscriptions.get" call.
  8691. // Exactly one of *SubscriptionPurchase or error will be non-nil. Any
  8692. // non-2xx status code is an error. Response headers are in either
  8693. // *SubscriptionPurchase.ServerResponse.Header or (if a response was
  8694. // returned at all) in error.(*googleapi.Error).Header. Use
  8695. // googleapi.IsNotModified to check whether the returned error was
  8696. // because http.StatusNotModified was returned.
  8697. func (c *PurchasesSubscriptionsGetCall) Do(opts ...googleapi.CallOption) (*SubscriptionPurchase, error) {
  8698. gensupport.SetOptions(c.urlParams_, opts...)
  8699. res, err := c.doRequest("json")
  8700. if res != nil && res.StatusCode == http.StatusNotModified {
  8701. if res.Body != nil {
  8702. res.Body.Close()
  8703. }
  8704. return nil, &googleapi.Error{
  8705. Code: res.StatusCode,
  8706. Header: res.Header,
  8707. }
  8708. }
  8709. if err != nil {
  8710. return nil, err
  8711. }
  8712. defer googleapi.CloseBody(res)
  8713. if err := googleapi.CheckResponse(res); err != nil {
  8714. return nil, err
  8715. }
  8716. ret := &SubscriptionPurchase{
  8717. ServerResponse: googleapi.ServerResponse{
  8718. Header: res.Header,
  8719. HTTPStatusCode: res.StatusCode,
  8720. },
  8721. }
  8722. target := &ret
  8723. if err := gensupport.DecodeResponse(target, res); err != nil {
  8724. return nil, err
  8725. }
  8726. return ret, nil
  8727. // {
  8728. // "description": "Checks whether a user's subscription purchase is valid and returns its expiry time.",
  8729. // "httpMethod": "GET",
  8730. // "id": "androidpublisher.purchases.subscriptions.get",
  8731. // "parameterOrder": [
  8732. // "packageName",
  8733. // "subscriptionId",
  8734. // "token"
  8735. // ],
  8736. // "parameters": {
  8737. // "packageName": {
  8738. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8739. // "location": "path",
  8740. // "required": true,
  8741. // "type": "string"
  8742. // },
  8743. // "subscriptionId": {
  8744. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8745. // "location": "path",
  8746. // "required": true,
  8747. // "type": "string"
  8748. // },
  8749. // "token": {
  8750. // "description": "The token provided to the user's device when the subscription was purchased.",
  8751. // "location": "path",
  8752. // "required": true,
  8753. // "type": "string"
  8754. // }
  8755. // },
  8756. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}",
  8757. // "response": {
  8758. // "$ref": "SubscriptionPurchase"
  8759. // },
  8760. // "scopes": [
  8761. // "https://www.googleapis.com/auth/androidpublisher"
  8762. // ]
  8763. // }
  8764. }
  8765. // method id "androidpublisher.purchases.subscriptions.refund":
  8766. type PurchasesSubscriptionsRefundCall struct {
  8767. s *Service
  8768. packageName string
  8769. subscriptionId string
  8770. token string
  8771. urlParams_ gensupport.URLParams
  8772. ctx_ context.Context
  8773. header_ http.Header
  8774. }
  8775. // Refund: Refunds a user's subscription purchase, but the subscription
  8776. // remains valid until its expiration time and it will continue to
  8777. // recur.
  8778. func (r *PurchasesSubscriptionsService) Refund(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRefundCall {
  8779. c := &PurchasesSubscriptionsRefundCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8780. c.packageName = packageName
  8781. c.subscriptionId = subscriptionId
  8782. c.token = token
  8783. return c
  8784. }
  8785. // Fields allows partial responses to be retrieved. See
  8786. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8787. // for more information.
  8788. func (c *PurchasesSubscriptionsRefundCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRefundCall {
  8789. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8790. return c
  8791. }
  8792. // Context sets the context to be used in this call's Do method. Any
  8793. // pending HTTP request will be aborted if the provided context is
  8794. // canceled.
  8795. func (c *PurchasesSubscriptionsRefundCall) Context(ctx context.Context) *PurchasesSubscriptionsRefundCall {
  8796. c.ctx_ = ctx
  8797. return c
  8798. }
  8799. // Header returns an http.Header that can be modified by the caller to
  8800. // add HTTP headers to the request.
  8801. func (c *PurchasesSubscriptionsRefundCall) Header() http.Header {
  8802. if c.header_ == nil {
  8803. c.header_ = make(http.Header)
  8804. }
  8805. return c.header_
  8806. }
  8807. func (c *PurchasesSubscriptionsRefundCall) doRequest(alt string) (*http.Response, error) {
  8808. reqHeaders := make(http.Header)
  8809. for k, v := range c.header_ {
  8810. reqHeaders[k] = v
  8811. }
  8812. reqHeaders.Set("User-Agent", c.s.userAgent())
  8813. var body io.Reader = nil
  8814. c.urlParams_.Set("alt", alt)
  8815. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund")
  8816. urls += "?" + c.urlParams_.Encode()
  8817. req, _ := http.NewRequest("POST", urls, body)
  8818. req.Header = reqHeaders
  8819. googleapi.Expand(req.URL, map[string]string{
  8820. "packageName": c.packageName,
  8821. "subscriptionId": c.subscriptionId,
  8822. "token": c.token,
  8823. })
  8824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8825. }
  8826. // Do executes the "androidpublisher.purchases.subscriptions.refund" call.
  8827. func (c *PurchasesSubscriptionsRefundCall) Do(opts ...googleapi.CallOption) error {
  8828. gensupport.SetOptions(c.urlParams_, opts...)
  8829. res, err := c.doRequest("json")
  8830. if err != nil {
  8831. return err
  8832. }
  8833. defer googleapi.CloseBody(res)
  8834. if err := googleapi.CheckResponse(res); err != nil {
  8835. return err
  8836. }
  8837. return nil
  8838. // {
  8839. // "description": "Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.",
  8840. // "httpMethod": "POST",
  8841. // "id": "androidpublisher.purchases.subscriptions.refund",
  8842. // "parameterOrder": [
  8843. // "packageName",
  8844. // "subscriptionId",
  8845. // "token"
  8846. // ],
  8847. // "parameters": {
  8848. // "packageName": {
  8849. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8850. // "location": "path",
  8851. // "required": true,
  8852. // "type": "string"
  8853. // },
  8854. // "subscriptionId": {
  8855. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8856. // "location": "path",
  8857. // "required": true,
  8858. // "type": "string"
  8859. // },
  8860. // "token": {
  8861. // "description": "The token provided to the user's device when the subscription was purchased.",
  8862. // "location": "path",
  8863. // "required": true,
  8864. // "type": "string"
  8865. // }
  8866. // },
  8867. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund",
  8868. // "scopes": [
  8869. // "https://www.googleapis.com/auth/androidpublisher"
  8870. // ]
  8871. // }
  8872. }
  8873. // method id "androidpublisher.purchases.subscriptions.revoke":
  8874. type PurchasesSubscriptionsRevokeCall struct {
  8875. s *Service
  8876. packageName string
  8877. subscriptionId string
  8878. token string
  8879. urlParams_ gensupport.URLParams
  8880. ctx_ context.Context
  8881. header_ http.Header
  8882. }
  8883. // Revoke: Refunds and immediately revokes a user's subscription
  8884. // purchase. Access to the subscription will be terminated immediately
  8885. // and it will stop recurring.
  8886. func (r *PurchasesSubscriptionsService) Revoke(packageName string, subscriptionId string, token string) *PurchasesSubscriptionsRevokeCall {
  8887. c := &PurchasesSubscriptionsRevokeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8888. c.packageName = packageName
  8889. c.subscriptionId = subscriptionId
  8890. c.token = token
  8891. return c
  8892. }
  8893. // Fields allows partial responses to be retrieved. See
  8894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8895. // for more information.
  8896. func (c *PurchasesSubscriptionsRevokeCall) Fields(s ...googleapi.Field) *PurchasesSubscriptionsRevokeCall {
  8897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8898. return c
  8899. }
  8900. // Context sets the context to be used in this call's Do method. Any
  8901. // pending HTTP request will be aborted if the provided context is
  8902. // canceled.
  8903. func (c *PurchasesSubscriptionsRevokeCall) Context(ctx context.Context) *PurchasesSubscriptionsRevokeCall {
  8904. c.ctx_ = ctx
  8905. return c
  8906. }
  8907. // Header returns an http.Header that can be modified by the caller to
  8908. // add HTTP headers to the request.
  8909. func (c *PurchasesSubscriptionsRevokeCall) Header() http.Header {
  8910. if c.header_ == nil {
  8911. c.header_ = make(http.Header)
  8912. }
  8913. return c.header_
  8914. }
  8915. func (c *PurchasesSubscriptionsRevokeCall) doRequest(alt string) (*http.Response, error) {
  8916. reqHeaders := make(http.Header)
  8917. for k, v := range c.header_ {
  8918. reqHeaders[k] = v
  8919. }
  8920. reqHeaders.Set("User-Agent", c.s.userAgent())
  8921. var body io.Reader = nil
  8922. c.urlParams_.Set("alt", alt)
  8923. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke")
  8924. urls += "?" + c.urlParams_.Encode()
  8925. req, _ := http.NewRequest("POST", urls, body)
  8926. req.Header = reqHeaders
  8927. googleapi.Expand(req.URL, map[string]string{
  8928. "packageName": c.packageName,
  8929. "subscriptionId": c.subscriptionId,
  8930. "token": c.token,
  8931. })
  8932. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8933. }
  8934. // Do executes the "androidpublisher.purchases.subscriptions.revoke" call.
  8935. func (c *PurchasesSubscriptionsRevokeCall) Do(opts ...googleapi.CallOption) error {
  8936. gensupport.SetOptions(c.urlParams_, opts...)
  8937. res, err := c.doRequest("json")
  8938. if err != nil {
  8939. return err
  8940. }
  8941. defer googleapi.CloseBody(res)
  8942. if err := googleapi.CheckResponse(res); err != nil {
  8943. return err
  8944. }
  8945. return nil
  8946. // {
  8947. // "description": "Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.",
  8948. // "httpMethod": "POST",
  8949. // "id": "androidpublisher.purchases.subscriptions.revoke",
  8950. // "parameterOrder": [
  8951. // "packageName",
  8952. // "subscriptionId",
  8953. // "token"
  8954. // ],
  8955. // "parameters": {
  8956. // "packageName": {
  8957. // "description": "The package name of the application for which this subscription was purchased (for example, 'com.some.thing').",
  8958. // "location": "path",
  8959. // "required": true,
  8960. // "type": "string"
  8961. // },
  8962. // "subscriptionId": {
  8963. // "description": "The purchased subscription ID (for example, 'monthly001').",
  8964. // "location": "path",
  8965. // "required": true,
  8966. // "type": "string"
  8967. // },
  8968. // "token": {
  8969. // "description": "The token provided to the user's device when the subscription was purchased.",
  8970. // "location": "path",
  8971. // "required": true,
  8972. // "type": "string"
  8973. // }
  8974. // },
  8975. // "path": "{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke",
  8976. // "scopes": [
  8977. // "https://www.googleapis.com/auth/androidpublisher"
  8978. // ]
  8979. // }
  8980. }
  8981. // method id "androidpublisher.purchases.voidedpurchases.list":
  8982. type PurchasesVoidedpurchasesListCall struct {
  8983. s *Service
  8984. packageName string
  8985. urlParams_ gensupport.URLParams
  8986. ifNoneMatch_ string
  8987. ctx_ context.Context
  8988. header_ http.Header
  8989. }
  8990. // List: Lists the purchases that were canceled, refunded or
  8991. // charged-back.
  8992. func (r *PurchasesVoidedpurchasesService) List(packageName string) *PurchasesVoidedpurchasesListCall {
  8993. c := &PurchasesVoidedpurchasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8994. c.packageName = packageName
  8995. return c
  8996. }
  8997. // EndTime sets the optional parameter "endTime": The time, in
  8998. // milliseconds since the Epoch, of the newest voided in-app product
  8999. // purchase that you want to see in the response. The value of this
  9000. // parameter cannot be greater than the current time and is ignored if a
  9001. // pagination token is set. Default value is current time. Note: This
  9002. // filter is applied on the time at which the record is seen as voided
  9003. // by our systems and not the actual voided time returned in the
  9004. // response.
  9005. func (c *PurchasesVoidedpurchasesListCall) EndTime(endTime int64) *PurchasesVoidedpurchasesListCall {
  9006. c.urlParams_.Set("endTime", fmt.Sprint(endTime))
  9007. return c
  9008. }
  9009. // MaxResults sets the optional parameter "maxResults":
  9010. func (c *PurchasesVoidedpurchasesListCall) MaxResults(maxResults int64) *PurchasesVoidedpurchasesListCall {
  9011. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9012. return c
  9013. }
  9014. // StartIndex sets the optional parameter "startIndex":
  9015. func (c *PurchasesVoidedpurchasesListCall) StartIndex(startIndex int64) *PurchasesVoidedpurchasesListCall {
  9016. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9017. return c
  9018. }
  9019. // StartTime sets the optional parameter "startTime": The time, in
  9020. // milliseconds since the Epoch, of the oldest voided in-app product
  9021. // purchase that you want to see in the response. The value of this
  9022. // parameter cannot be older than 30 days and is ignored if a pagination
  9023. // token is set. Default value is current time minus 30 days. Note: This
  9024. // filter is applied on the time at which the record is seen as voided
  9025. // by our systems and not the actual voided time returned in the
  9026. // response.
  9027. func (c *PurchasesVoidedpurchasesListCall) StartTime(startTime int64) *PurchasesVoidedpurchasesListCall {
  9028. c.urlParams_.Set("startTime", fmt.Sprint(startTime))
  9029. return c
  9030. }
  9031. // Token sets the optional parameter "token":
  9032. func (c *PurchasesVoidedpurchasesListCall) Token(token string) *PurchasesVoidedpurchasesListCall {
  9033. c.urlParams_.Set("token", token)
  9034. return c
  9035. }
  9036. // Fields allows partial responses to be retrieved. See
  9037. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9038. // for more information.
  9039. func (c *PurchasesVoidedpurchasesListCall) Fields(s ...googleapi.Field) *PurchasesVoidedpurchasesListCall {
  9040. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9041. return c
  9042. }
  9043. // IfNoneMatch sets the optional parameter which makes the operation
  9044. // fail if the object's ETag matches the given value. This is useful for
  9045. // getting updates only after the object has changed since the last
  9046. // request. Use googleapi.IsNotModified to check whether the response
  9047. // error from Do is the result of In-None-Match.
  9048. func (c *PurchasesVoidedpurchasesListCall) IfNoneMatch(entityTag string) *PurchasesVoidedpurchasesListCall {
  9049. c.ifNoneMatch_ = entityTag
  9050. return c
  9051. }
  9052. // Context sets the context to be used in this call's Do method. Any
  9053. // pending HTTP request will be aborted if the provided context is
  9054. // canceled.
  9055. func (c *PurchasesVoidedpurchasesListCall) Context(ctx context.Context) *PurchasesVoidedpurchasesListCall {
  9056. c.ctx_ = ctx
  9057. return c
  9058. }
  9059. // Header returns an http.Header that can be modified by the caller to
  9060. // add HTTP headers to the request.
  9061. func (c *PurchasesVoidedpurchasesListCall) Header() http.Header {
  9062. if c.header_ == nil {
  9063. c.header_ = make(http.Header)
  9064. }
  9065. return c.header_
  9066. }
  9067. func (c *PurchasesVoidedpurchasesListCall) doRequest(alt string) (*http.Response, error) {
  9068. reqHeaders := make(http.Header)
  9069. for k, v := range c.header_ {
  9070. reqHeaders[k] = v
  9071. }
  9072. reqHeaders.Set("User-Agent", c.s.userAgent())
  9073. if c.ifNoneMatch_ != "" {
  9074. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9075. }
  9076. var body io.Reader = nil
  9077. c.urlParams_.Set("alt", alt)
  9078. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/purchases/voidedpurchases")
  9079. urls += "?" + c.urlParams_.Encode()
  9080. req, _ := http.NewRequest("GET", urls, body)
  9081. req.Header = reqHeaders
  9082. googleapi.Expand(req.URL, map[string]string{
  9083. "packageName": c.packageName,
  9084. })
  9085. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9086. }
  9087. // Do executes the "androidpublisher.purchases.voidedpurchases.list" call.
  9088. // Exactly one of *VoidedPurchasesListResponse or error will be non-nil.
  9089. // Any non-2xx status code is an error. Response headers are in either
  9090. // *VoidedPurchasesListResponse.ServerResponse.Header or (if a response
  9091. // was returned at all) in error.(*googleapi.Error).Header. Use
  9092. // googleapi.IsNotModified to check whether the returned error was
  9093. // because http.StatusNotModified was returned.
  9094. func (c *PurchasesVoidedpurchasesListCall) Do(opts ...googleapi.CallOption) (*VoidedPurchasesListResponse, error) {
  9095. gensupport.SetOptions(c.urlParams_, opts...)
  9096. res, err := c.doRequest("json")
  9097. if res != nil && res.StatusCode == http.StatusNotModified {
  9098. if res.Body != nil {
  9099. res.Body.Close()
  9100. }
  9101. return nil, &googleapi.Error{
  9102. Code: res.StatusCode,
  9103. Header: res.Header,
  9104. }
  9105. }
  9106. if err != nil {
  9107. return nil, err
  9108. }
  9109. defer googleapi.CloseBody(res)
  9110. if err := googleapi.CheckResponse(res); err != nil {
  9111. return nil, err
  9112. }
  9113. ret := &VoidedPurchasesListResponse{
  9114. ServerResponse: googleapi.ServerResponse{
  9115. Header: res.Header,
  9116. HTTPStatusCode: res.StatusCode,
  9117. },
  9118. }
  9119. target := &ret
  9120. if err := gensupport.DecodeResponse(target, res); err != nil {
  9121. return nil, err
  9122. }
  9123. return ret, nil
  9124. // {
  9125. // "description": "Lists the purchases that were canceled, refunded or charged-back.",
  9126. // "httpMethod": "GET",
  9127. // "id": "androidpublisher.purchases.voidedpurchases.list",
  9128. // "parameterOrder": [
  9129. // "packageName"
  9130. // ],
  9131. // "parameters": {
  9132. // "endTime": {
  9133. // "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.",
  9134. // "format": "int64",
  9135. // "location": "query",
  9136. // "type": "string"
  9137. // },
  9138. // "maxResults": {
  9139. // "format": "uint32",
  9140. // "location": "query",
  9141. // "type": "integer"
  9142. // },
  9143. // "packageName": {
  9144. // "description": "The package name of the application for which voided purchases need to be returned (for example, 'com.some.thing').",
  9145. // "location": "path",
  9146. // "required": true,
  9147. // "type": "string"
  9148. // },
  9149. // "startIndex": {
  9150. // "format": "uint32",
  9151. // "location": "query",
  9152. // "type": "integer"
  9153. // },
  9154. // "startTime": {
  9155. // "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.",
  9156. // "format": "int64",
  9157. // "location": "query",
  9158. // "type": "string"
  9159. // },
  9160. // "token": {
  9161. // "location": "query",
  9162. // "type": "string"
  9163. // }
  9164. // },
  9165. // "path": "{packageName}/purchases/voidedpurchases",
  9166. // "response": {
  9167. // "$ref": "VoidedPurchasesListResponse"
  9168. // },
  9169. // "scopes": [
  9170. // "https://www.googleapis.com/auth/androidpublisher"
  9171. // ]
  9172. // }
  9173. }
  9174. // method id "androidpublisher.reviews.get":
  9175. type ReviewsGetCall struct {
  9176. s *Service
  9177. packageNameid string
  9178. reviewId string
  9179. urlParams_ gensupport.URLParams
  9180. ifNoneMatch_ string
  9181. ctx_ context.Context
  9182. header_ http.Header
  9183. }
  9184. // Get: Returns a single review.
  9185. func (r *ReviewsService) Get(packageNameid string, reviewId string) *ReviewsGetCall {
  9186. c := &ReviewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9187. c.packageNameid = packageNameid
  9188. c.reviewId = reviewId
  9189. return c
  9190. }
  9191. // TranslationLanguage sets the optional parameter
  9192. // "translationLanguage":
  9193. func (c *ReviewsGetCall) TranslationLanguage(translationLanguage string) *ReviewsGetCall {
  9194. c.urlParams_.Set("translationLanguage", translationLanguage)
  9195. return c
  9196. }
  9197. // Fields allows partial responses to be retrieved. See
  9198. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9199. // for more information.
  9200. func (c *ReviewsGetCall) Fields(s ...googleapi.Field) *ReviewsGetCall {
  9201. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9202. return c
  9203. }
  9204. // IfNoneMatch sets the optional parameter which makes the operation
  9205. // fail if the object's ETag matches the given value. This is useful for
  9206. // getting updates only after the object has changed since the last
  9207. // request. Use googleapi.IsNotModified to check whether the response
  9208. // error from Do is the result of In-None-Match.
  9209. func (c *ReviewsGetCall) IfNoneMatch(entityTag string) *ReviewsGetCall {
  9210. c.ifNoneMatch_ = entityTag
  9211. return c
  9212. }
  9213. // Context sets the context to be used in this call's Do method. Any
  9214. // pending HTTP request will be aborted if the provided context is
  9215. // canceled.
  9216. func (c *ReviewsGetCall) Context(ctx context.Context) *ReviewsGetCall {
  9217. c.ctx_ = ctx
  9218. return c
  9219. }
  9220. // Header returns an http.Header that can be modified by the caller to
  9221. // add HTTP headers to the request.
  9222. func (c *ReviewsGetCall) Header() http.Header {
  9223. if c.header_ == nil {
  9224. c.header_ = make(http.Header)
  9225. }
  9226. return c.header_
  9227. }
  9228. func (c *ReviewsGetCall) doRequest(alt string) (*http.Response, error) {
  9229. reqHeaders := make(http.Header)
  9230. for k, v := range c.header_ {
  9231. reqHeaders[k] = v
  9232. }
  9233. reqHeaders.Set("User-Agent", c.s.userAgent())
  9234. if c.ifNoneMatch_ != "" {
  9235. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9236. }
  9237. var body io.Reader = nil
  9238. c.urlParams_.Set("alt", alt)
  9239. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}")
  9240. urls += "?" + c.urlParams_.Encode()
  9241. req, _ := http.NewRequest("GET", urls, body)
  9242. req.Header = reqHeaders
  9243. googleapi.Expand(req.URL, map[string]string{
  9244. "packageName": c.packageNameid,
  9245. "reviewId": c.reviewId,
  9246. })
  9247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9248. }
  9249. // Do executes the "androidpublisher.reviews.get" call.
  9250. // Exactly one of *Review or error will be non-nil. Any non-2xx status
  9251. // code is an error. Response headers are in either
  9252. // *Review.ServerResponse.Header or (if a response was returned at all)
  9253. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9254. // check whether the returned error was because http.StatusNotModified
  9255. // was returned.
  9256. func (c *ReviewsGetCall) Do(opts ...googleapi.CallOption) (*Review, error) {
  9257. gensupport.SetOptions(c.urlParams_, opts...)
  9258. res, err := c.doRequest("json")
  9259. if res != nil && res.StatusCode == http.StatusNotModified {
  9260. if res.Body != nil {
  9261. res.Body.Close()
  9262. }
  9263. return nil, &googleapi.Error{
  9264. Code: res.StatusCode,
  9265. Header: res.Header,
  9266. }
  9267. }
  9268. if err != nil {
  9269. return nil, err
  9270. }
  9271. defer googleapi.CloseBody(res)
  9272. if err := googleapi.CheckResponse(res); err != nil {
  9273. return nil, err
  9274. }
  9275. ret := &Review{
  9276. ServerResponse: googleapi.ServerResponse{
  9277. Header: res.Header,
  9278. HTTPStatusCode: res.StatusCode,
  9279. },
  9280. }
  9281. target := &ret
  9282. if err := gensupport.DecodeResponse(target, res); err != nil {
  9283. return nil, err
  9284. }
  9285. return ret, nil
  9286. // {
  9287. // "description": "Returns a single review.",
  9288. // "httpMethod": "GET",
  9289. // "id": "androidpublisher.reviews.get",
  9290. // "parameterOrder": [
  9291. // "packageName",
  9292. // "reviewId"
  9293. // ],
  9294. // "parameters": {
  9295. // "packageName": {
  9296. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  9297. // "location": "path",
  9298. // "required": true,
  9299. // "type": "string"
  9300. // },
  9301. // "reviewId": {
  9302. // "location": "path",
  9303. // "required": true,
  9304. // "type": "string"
  9305. // },
  9306. // "translationLanguage": {
  9307. // "location": "query",
  9308. // "type": "string"
  9309. // }
  9310. // },
  9311. // "path": "{packageName}/reviews/{reviewId}",
  9312. // "response": {
  9313. // "$ref": "Review"
  9314. // },
  9315. // "scopes": [
  9316. // "https://www.googleapis.com/auth/androidpublisher"
  9317. // ]
  9318. // }
  9319. }
  9320. // method id "androidpublisher.reviews.list":
  9321. type ReviewsListCall struct {
  9322. s *Service
  9323. packageNameid string
  9324. urlParams_ gensupport.URLParams
  9325. ifNoneMatch_ string
  9326. ctx_ context.Context
  9327. header_ http.Header
  9328. }
  9329. // List: Returns a list of reviews. Only reviews from last week will be
  9330. // returned.
  9331. func (r *ReviewsService) List(packageNameid string) *ReviewsListCall {
  9332. c := &ReviewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9333. c.packageNameid = packageNameid
  9334. return c
  9335. }
  9336. // MaxResults sets the optional parameter "maxResults":
  9337. func (c *ReviewsListCall) MaxResults(maxResults int64) *ReviewsListCall {
  9338. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  9339. return c
  9340. }
  9341. // StartIndex sets the optional parameter "startIndex":
  9342. func (c *ReviewsListCall) StartIndex(startIndex int64) *ReviewsListCall {
  9343. c.urlParams_.Set("startIndex", fmt.Sprint(startIndex))
  9344. return c
  9345. }
  9346. // Token sets the optional parameter "token":
  9347. func (c *ReviewsListCall) Token(token string) *ReviewsListCall {
  9348. c.urlParams_.Set("token", token)
  9349. return c
  9350. }
  9351. // TranslationLanguage sets the optional parameter
  9352. // "translationLanguage":
  9353. func (c *ReviewsListCall) TranslationLanguage(translationLanguage string) *ReviewsListCall {
  9354. c.urlParams_.Set("translationLanguage", translationLanguage)
  9355. return c
  9356. }
  9357. // Fields allows partial responses to be retrieved. See
  9358. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9359. // for more information.
  9360. func (c *ReviewsListCall) Fields(s ...googleapi.Field) *ReviewsListCall {
  9361. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9362. return c
  9363. }
  9364. // IfNoneMatch sets the optional parameter which makes the operation
  9365. // fail if the object's ETag matches the given value. This is useful for
  9366. // getting updates only after the object has changed since the last
  9367. // request. Use googleapi.IsNotModified to check whether the response
  9368. // error from Do is the result of In-None-Match.
  9369. func (c *ReviewsListCall) IfNoneMatch(entityTag string) *ReviewsListCall {
  9370. c.ifNoneMatch_ = entityTag
  9371. return c
  9372. }
  9373. // Context sets the context to be used in this call's Do method. Any
  9374. // pending HTTP request will be aborted if the provided context is
  9375. // canceled.
  9376. func (c *ReviewsListCall) Context(ctx context.Context) *ReviewsListCall {
  9377. c.ctx_ = ctx
  9378. return c
  9379. }
  9380. // Header returns an http.Header that can be modified by the caller to
  9381. // add HTTP headers to the request.
  9382. func (c *ReviewsListCall) Header() http.Header {
  9383. if c.header_ == nil {
  9384. c.header_ = make(http.Header)
  9385. }
  9386. return c.header_
  9387. }
  9388. func (c *ReviewsListCall) doRequest(alt string) (*http.Response, error) {
  9389. reqHeaders := make(http.Header)
  9390. for k, v := range c.header_ {
  9391. reqHeaders[k] = v
  9392. }
  9393. reqHeaders.Set("User-Agent", c.s.userAgent())
  9394. if c.ifNoneMatch_ != "" {
  9395. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9396. }
  9397. var body io.Reader = nil
  9398. c.urlParams_.Set("alt", alt)
  9399. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews")
  9400. urls += "?" + c.urlParams_.Encode()
  9401. req, _ := http.NewRequest("GET", urls, body)
  9402. req.Header = reqHeaders
  9403. googleapi.Expand(req.URL, map[string]string{
  9404. "packageName": c.packageNameid,
  9405. })
  9406. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9407. }
  9408. // Do executes the "androidpublisher.reviews.list" call.
  9409. // Exactly one of *ReviewsListResponse or error will be non-nil. Any
  9410. // non-2xx status code is an error. Response headers are in either
  9411. // *ReviewsListResponse.ServerResponse.Header or (if a response was
  9412. // returned at all) in error.(*googleapi.Error).Header. Use
  9413. // googleapi.IsNotModified to check whether the returned error was
  9414. // because http.StatusNotModified was returned.
  9415. func (c *ReviewsListCall) Do(opts ...googleapi.CallOption) (*ReviewsListResponse, error) {
  9416. gensupport.SetOptions(c.urlParams_, opts...)
  9417. res, err := c.doRequest("json")
  9418. if res != nil && res.StatusCode == http.StatusNotModified {
  9419. if res.Body != nil {
  9420. res.Body.Close()
  9421. }
  9422. return nil, &googleapi.Error{
  9423. Code: res.StatusCode,
  9424. Header: res.Header,
  9425. }
  9426. }
  9427. if err != nil {
  9428. return nil, err
  9429. }
  9430. defer googleapi.CloseBody(res)
  9431. if err := googleapi.CheckResponse(res); err != nil {
  9432. return nil, err
  9433. }
  9434. ret := &ReviewsListResponse{
  9435. ServerResponse: googleapi.ServerResponse{
  9436. Header: res.Header,
  9437. HTTPStatusCode: res.StatusCode,
  9438. },
  9439. }
  9440. target := &ret
  9441. if err := gensupport.DecodeResponse(target, res); err != nil {
  9442. return nil, err
  9443. }
  9444. return ret, nil
  9445. // {
  9446. // "description": "Returns a list of reviews. Only reviews from last week will be returned.",
  9447. // "httpMethod": "GET",
  9448. // "id": "androidpublisher.reviews.list",
  9449. // "parameterOrder": [
  9450. // "packageName"
  9451. // ],
  9452. // "parameters": {
  9453. // "maxResults": {
  9454. // "format": "uint32",
  9455. // "location": "query",
  9456. // "type": "integer"
  9457. // },
  9458. // "packageName": {
  9459. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  9460. // "location": "path",
  9461. // "required": true,
  9462. // "type": "string"
  9463. // },
  9464. // "startIndex": {
  9465. // "format": "uint32",
  9466. // "location": "query",
  9467. // "type": "integer"
  9468. // },
  9469. // "token": {
  9470. // "location": "query",
  9471. // "type": "string"
  9472. // },
  9473. // "translationLanguage": {
  9474. // "location": "query",
  9475. // "type": "string"
  9476. // }
  9477. // },
  9478. // "path": "{packageName}/reviews",
  9479. // "response": {
  9480. // "$ref": "ReviewsListResponse"
  9481. // },
  9482. // "scopes": [
  9483. // "https://www.googleapis.com/auth/androidpublisher"
  9484. // ]
  9485. // }
  9486. }
  9487. // method id "androidpublisher.reviews.reply":
  9488. type ReviewsReplyCall struct {
  9489. s *Service
  9490. packageNameid string
  9491. reviewId string
  9492. reviewsreplyrequest *ReviewsReplyRequest
  9493. urlParams_ gensupport.URLParams
  9494. ctx_ context.Context
  9495. header_ http.Header
  9496. }
  9497. // Reply: Reply to a single review, or update an existing reply.
  9498. func (r *ReviewsService) Reply(packageNameid string, reviewId string, reviewsreplyrequest *ReviewsReplyRequest) *ReviewsReplyCall {
  9499. c := &ReviewsReplyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9500. c.packageNameid = packageNameid
  9501. c.reviewId = reviewId
  9502. c.reviewsreplyrequest = reviewsreplyrequest
  9503. return c
  9504. }
  9505. // Fields allows partial responses to be retrieved. See
  9506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9507. // for more information.
  9508. func (c *ReviewsReplyCall) Fields(s ...googleapi.Field) *ReviewsReplyCall {
  9509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9510. return c
  9511. }
  9512. // Context sets the context to be used in this call's Do method. Any
  9513. // pending HTTP request will be aborted if the provided context is
  9514. // canceled.
  9515. func (c *ReviewsReplyCall) Context(ctx context.Context) *ReviewsReplyCall {
  9516. c.ctx_ = ctx
  9517. return c
  9518. }
  9519. // Header returns an http.Header that can be modified by the caller to
  9520. // add HTTP headers to the request.
  9521. func (c *ReviewsReplyCall) Header() http.Header {
  9522. if c.header_ == nil {
  9523. c.header_ = make(http.Header)
  9524. }
  9525. return c.header_
  9526. }
  9527. func (c *ReviewsReplyCall) doRequest(alt string) (*http.Response, error) {
  9528. reqHeaders := make(http.Header)
  9529. for k, v := range c.header_ {
  9530. reqHeaders[k] = v
  9531. }
  9532. reqHeaders.Set("User-Agent", c.s.userAgent())
  9533. var body io.Reader = nil
  9534. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reviewsreplyrequest)
  9535. if err != nil {
  9536. return nil, err
  9537. }
  9538. reqHeaders.Set("Content-Type", "application/json")
  9539. c.urlParams_.Set("alt", alt)
  9540. urls := googleapi.ResolveRelative(c.s.BasePath, "{packageName}/reviews/{reviewId}:reply")
  9541. urls += "?" + c.urlParams_.Encode()
  9542. req, _ := http.NewRequest("POST", urls, body)
  9543. req.Header = reqHeaders
  9544. googleapi.Expand(req.URL, map[string]string{
  9545. "packageName": c.packageNameid,
  9546. "reviewId": c.reviewId,
  9547. })
  9548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9549. }
  9550. // Do executes the "androidpublisher.reviews.reply" call.
  9551. // Exactly one of *ReviewsReplyResponse or error will be non-nil. Any
  9552. // non-2xx status code is an error. Response headers are in either
  9553. // *ReviewsReplyResponse.ServerResponse.Header or (if a response was
  9554. // returned at all) in error.(*googleapi.Error).Header. Use
  9555. // googleapi.IsNotModified to check whether the returned error was
  9556. // because http.StatusNotModified was returned.
  9557. func (c *ReviewsReplyCall) Do(opts ...googleapi.CallOption) (*ReviewsReplyResponse, error) {
  9558. gensupport.SetOptions(c.urlParams_, opts...)
  9559. res, err := c.doRequest("json")
  9560. if res != nil && res.StatusCode == http.StatusNotModified {
  9561. if res.Body != nil {
  9562. res.Body.Close()
  9563. }
  9564. return nil, &googleapi.Error{
  9565. Code: res.StatusCode,
  9566. Header: res.Header,
  9567. }
  9568. }
  9569. if err != nil {
  9570. return nil, err
  9571. }
  9572. defer googleapi.CloseBody(res)
  9573. if err := googleapi.CheckResponse(res); err != nil {
  9574. return nil, err
  9575. }
  9576. ret := &ReviewsReplyResponse{
  9577. ServerResponse: googleapi.ServerResponse{
  9578. Header: res.Header,
  9579. HTTPStatusCode: res.StatusCode,
  9580. },
  9581. }
  9582. target := &ret
  9583. if err := gensupport.DecodeResponse(target, res); err != nil {
  9584. return nil, err
  9585. }
  9586. return ret, nil
  9587. // {
  9588. // "description": "Reply to a single review, or update an existing reply.",
  9589. // "httpMethod": "POST",
  9590. // "id": "androidpublisher.reviews.reply",
  9591. // "parameterOrder": [
  9592. // "packageName",
  9593. // "reviewId"
  9594. // ],
  9595. // "parameters": {
  9596. // "packageName": {
  9597. // "description": "Unique identifier for the Android app for which we want reviews; for example, \"com.spiffygame\".",
  9598. // "location": "path",
  9599. // "required": true,
  9600. // "type": "string"
  9601. // },
  9602. // "reviewId": {
  9603. // "location": "path",
  9604. // "required": true,
  9605. // "type": "string"
  9606. // }
  9607. // },
  9608. // "path": "{packageName}/reviews/{reviewId}:reply",
  9609. // "request": {
  9610. // "$ref": "ReviewsReplyRequest"
  9611. // },
  9612. // "response": {
  9613. // "$ref": "ReviewsReplyResponse"
  9614. // },
  9615. // "scopes": [
  9616. // "https://www.googleapis.com/auth/androidpublisher"
  9617. // ]
  9618. // }
  9619. }