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.
 
 
 

2203 lines
74 KiB

  1. // Copyright 2018 Google Inc. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // AUTO-GENERATED CODE. DO NOT EDIT.
  5. // Package playmoviespartner provides access to the Google Play Movies Partner API.
  6. //
  7. // See https://developers.google.com/playmoviespartner/
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/playmoviespartner/v1"
  12. // ...
  13. // playmoviespartnerService, err := playmoviespartner.New(oauthHttpClient)
  14. package playmoviespartner // import "google.golang.org/api/playmoviespartner/v1"
  15. import (
  16. "bytes"
  17. "context"
  18. "encoding/json"
  19. "errors"
  20. "fmt"
  21. "io"
  22. "net/http"
  23. "net/url"
  24. "strconv"
  25. "strings"
  26. gensupport "google.golang.org/api/gensupport"
  27. googleapi "google.golang.org/api/googleapi"
  28. )
  29. // Always reference these packages, just in case the auto-generated code
  30. // below doesn't.
  31. var _ = bytes.NewBuffer
  32. var _ = strconv.Itoa
  33. var _ = fmt.Sprintf
  34. var _ = json.NewDecoder
  35. var _ = io.Copy
  36. var _ = url.Parse
  37. var _ = gensupport.MarshalJSON
  38. var _ = googleapi.Version
  39. var _ = errors.New
  40. var _ = strings.Replace
  41. var _ = context.Canceled
  42. const apiId = "playmoviespartner:v1"
  43. const apiName = "playmoviespartner"
  44. const apiVersion = "v1"
  45. const basePath = "https://playmoviespartner.googleapis.com/"
  46. // OAuth2 scopes used by this API.
  47. const (
  48. // View the digital assets you publish on Google Play Movies and TV
  49. PlaymoviesPartnerReadonlyScope = "https://www.googleapis.com/auth/playmovies_partner.readonly"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Accounts = NewAccountsService(s)
  57. return s, nil
  58. }
  59. type Service struct {
  60. client *http.Client
  61. BasePath string // API endpoint base URL
  62. UserAgent string // optional additional User-Agent fragment
  63. Accounts *AccountsService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewAccountsService(s *Service) *AccountsService {
  72. rs := &AccountsService{s: s}
  73. rs.Avails = NewAccountsAvailsService(s)
  74. rs.Orders = NewAccountsOrdersService(s)
  75. rs.StoreInfos = NewAccountsStoreInfosService(s)
  76. return rs
  77. }
  78. type AccountsService struct {
  79. s *Service
  80. Avails *AccountsAvailsService
  81. Orders *AccountsOrdersService
  82. StoreInfos *AccountsStoreInfosService
  83. }
  84. func NewAccountsAvailsService(s *Service) *AccountsAvailsService {
  85. rs := &AccountsAvailsService{s: s}
  86. return rs
  87. }
  88. type AccountsAvailsService struct {
  89. s *Service
  90. }
  91. func NewAccountsOrdersService(s *Service) *AccountsOrdersService {
  92. rs := &AccountsOrdersService{s: s}
  93. return rs
  94. }
  95. type AccountsOrdersService struct {
  96. s *Service
  97. }
  98. func NewAccountsStoreInfosService(s *Service) *AccountsStoreInfosService {
  99. rs := &AccountsStoreInfosService{s: s}
  100. rs.Country = NewAccountsStoreInfosCountryService(s)
  101. return rs
  102. }
  103. type AccountsStoreInfosService struct {
  104. s *Service
  105. Country *AccountsStoreInfosCountryService
  106. }
  107. func NewAccountsStoreInfosCountryService(s *Service) *AccountsStoreInfosCountryService {
  108. rs := &AccountsStoreInfosCountryService{s: s}
  109. return rs
  110. }
  111. type AccountsStoreInfosCountryService struct {
  112. s *Service
  113. }
  114. // Avail: An Avail describes the Availability Window of a specific Edit
  115. // in a given
  116. // country, which means the period Google is allowed to sell or rent the
  117. // Edit.
  118. //
  119. // Avails are exposed in EMA format Version 1.6b (available
  120. // at
  121. // http://www.movielabs.com/md/avails/)
  122. //
  123. // Studios can see the Avails for the Titles they own.
  124. // Post-production houses cannot see any Avails.
  125. type Avail struct {
  126. // AltId: Other identifier referring to the Edit, as defined by
  127. // partner.
  128. // Example: "GOOGLER_2006"
  129. AltId string `json:"altId,omitempty"`
  130. // AvailId: ID internally generated by Google to uniquely identify an
  131. // Avail.
  132. // Not part of EMA Specs.
  133. AvailId string `json:"availId,omitempty"`
  134. // CaptionExemption: Communicating an exempt category as defined by FCC
  135. // regulations.
  136. // It is not required for non-US Avails.
  137. // Example: "1"
  138. CaptionExemption string `json:"captionExemption,omitempty"`
  139. // CaptionIncluded: Communicating if caption file will be delivered.
  140. CaptionIncluded bool `json:"captionIncluded,omitempty"`
  141. // ContentId: Title Identifier. This should be the Title Level
  142. // EIDR.
  143. // Example: "10.5240/1489-49A2-3956-4B2D-FE16-5".
  144. ContentId string `json:"contentId,omitempty"`
  145. // DisplayName: The name of the studio that owns the Edit referred in
  146. // the Avail.
  147. // This is the equivalent of `studio_name` in other resources, but it
  148. // follows
  149. // the EMA nomenclature.
  150. // Example: "Google Films".
  151. DisplayName string `json:"displayName,omitempty"`
  152. // EncodeId: Manifestation Identifier. This should be the
  153. // Manifestation
  154. // Level EIDR.
  155. // Example: "10.2340/1489-49A2-3956-4B2D-FE16-7"
  156. EncodeId string `json:"encodeId,omitempty"`
  157. // End: End of term in YYYY-MM-DD format in the timezone of the
  158. // country
  159. // of the Avail.
  160. // "Open" if no end date is available.
  161. // Example: "2019-02-17"
  162. End string `json:"end,omitempty"`
  163. // EpisodeAltId: Other identifier referring to the episode, as defined
  164. // by partner.
  165. // Only available on TV avails.
  166. // Example: "rs_googlers_s1_3".
  167. EpisodeAltId string `json:"episodeAltId,omitempty"`
  168. // EpisodeNumber: The number assigned to the episode within a
  169. // season.
  170. // Only available on TV Avails.
  171. // Example: "3".
  172. EpisodeNumber string `json:"episodeNumber,omitempty"`
  173. // EpisodeTitleInternalAlias: OPTIONAL.TV Only. Title used by involved
  174. // parties to refer to this episode.
  175. // Only available on TV Avails.
  176. // Example: "Coding at Google".
  177. EpisodeTitleInternalAlias string `json:"episodeTitleInternalAlias,omitempty"`
  178. // FormatProfile: Indicates the format profile covered by the
  179. // transaction.
  180. //
  181. // Possible values:
  182. // "FORMAT_PROFILE_UNSPECIFIED" - Value could not be determined,
  183. // please contact technical support if
  184. // it should.
  185. // "SD" - Standard-definition format.
  186. // "HD" - High-definition format.
  187. // "UHD" - 4K UHD.
  188. FormatProfile string `json:"formatProfile,omitempty"`
  189. // LicenseType: Type of transaction.
  190. //
  191. // Possible values:
  192. // "LICENSE_TYPE_UNSPECIFIED" - Value could not be determined, please
  193. // contact technical support if
  194. // it should.
  195. // "EST" - Electronic Sell Through - purchase policy for unlimited
  196. // viewing.
  197. // "VOD" - Video On Demand - rental policy for temporary viewing.
  198. // "SVOD" - Subscription Video On Demand - used for subscription
  199. // platforms.
  200. // Not supported on Google Play.
  201. // "POEST" - Pre-order Electronic Sell Through - pre-order purchase
  202. // only window.
  203. LicenseType string `json:"licenseType,omitempty"`
  204. // PphNames: Name of the post-production houses that manage the
  205. // Avail.
  206. // Not part of EMA Specs.
  207. PphNames []string `json:"pphNames,omitempty"`
  208. // PriceType: Type of pricing that should be applied to this Avail
  209. // based on how the partner classify them.
  210. // Example: "Tier", "WSP", "SRP", or "Category".
  211. PriceType string `json:"priceType,omitempty"`
  212. // PriceValue: Value to be applied to the pricing type.
  213. // Example: "4" or "2.99"
  214. PriceValue string `json:"priceValue,omitempty"`
  215. // ProductId: Edit Identifier. This should be the Edit Level
  216. // EIDR.
  217. // Example: "10.2340/1489-49A2-3956-4B2D-FE16-6"
  218. ProductId string `json:"productId,omitempty"`
  219. // RatingReason: Value representing the rating reason.
  220. // Rating reasons should be formatted as per
  221. // [EMA ratings spec](http://www.movielabs.com/md/ratings/)
  222. // and comma-separated for inclusion of multiple reasons.
  223. // Example: "L, S, V"
  224. RatingReason string `json:"ratingReason,omitempty"`
  225. // RatingSystem: Rating system applied to the version of title within
  226. // territory
  227. // of Avail.
  228. // Rating systems should be formatted as per
  229. // [EMA ratings spec](http://www.movielabs.com/md/ratings/)
  230. // Example: "MPAA"
  231. RatingSystem string `json:"ratingSystem,omitempty"`
  232. // RatingValue: Value representing the rating.
  233. // Ratings should be formatted as per
  234. // http://www.movielabs.com/md/ratings/
  235. // Example: "PG"
  236. RatingValue string `json:"ratingValue,omitempty"`
  237. // ReleaseDate: Release date of the Title in earliest released
  238. // territory.
  239. // Typically it is just the year, but it is free-form as per EMA
  240. // spec.
  241. // Examples: "1979", "Oct 2014"
  242. ReleaseDate string `json:"releaseDate,omitempty"`
  243. // SeasonAltId: Other identifier referring to the season, as defined by
  244. // partner.
  245. // Only available on TV avails.
  246. // Example: "rs_googlers_s1".
  247. SeasonAltId string `json:"seasonAltId,omitempty"`
  248. // SeasonNumber: The number assigned to the season within a series.
  249. // Only available on TV Avails.
  250. // Example: "1".
  251. SeasonNumber string `json:"seasonNumber,omitempty"`
  252. // SeasonTitleInternalAlias: Title used by involved parties to refer to
  253. // this season.
  254. // Only available on TV Avails.
  255. // Example: "Googlers, The".
  256. SeasonTitleInternalAlias string `json:"seasonTitleInternalAlias,omitempty"`
  257. // SeriesAltId: Other identifier referring to the series, as defined by
  258. // partner.
  259. // Only available on TV avails.
  260. // Example: "rs_googlers".
  261. SeriesAltId string `json:"seriesAltId,omitempty"`
  262. // SeriesTitleInternalAlias: Title used by involved parties to refer to
  263. // this series.
  264. // Only available on TV Avails.
  265. // Example: "Googlers, The".
  266. SeriesTitleInternalAlias string `json:"seriesTitleInternalAlias,omitempty"`
  267. // Start: Start of term in YYYY-MM-DD format in the timezone of
  268. // the
  269. // country of the Avail.
  270. // Example: "2013-05-14".
  271. Start string `json:"start,omitempty"`
  272. // StoreLanguage: Spoken language of the intended audience.
  273. // Language shall be encoded in accordance with RFC 5646.
  274. // Example: "fr".
  275. StoreLanguage string `json:"storeLanguage,omitempty"`
  276. // SuppressionLiftDate: First date an Edit could be publically announced
  277. // as becoming
  278. // available at a specific future date in territory of Avail.
  279. // *Not* the Avail start date or pre-order start date.
  280. // Format is YYYY-MM-DD.
  281. // Only available for pre-orders.
  282. // Example: "2012-12-10"
  283. SuppressionLiftDate string `json:"suppressionLiftDate,omitempty"`
  284. // Territory: ISO 3166-1 alpha-2 country code for the country or
  285. // territory
  286. // of this Avail.
  287. // For Avails, we use Territory in lieu of Country to comply with
  288. // EMA specifications.
  289. // But please note that Territory and Country identify the same
  290. // thing.
  291. // Example: "US".
  292. Territory string `json:"territory,omitempty"`
  293. // TitleInternalAlias: Title used by involved parties to refer to this
  294. // content.
  295. // Example: "Googlers, The".
  296. // Only available on Movie Avails.
  297. TitleInternalAlias string `json:"titleInternalAlias,omitempty"`
  298. // VideoId: Google-generated ID identifying the video linked to this
  299. // Avail, once
  300. // delivered.
  301. // Not part of EMA Specs.
  302. // Example: 'gtry456_xc'
  303. VideoId string `json:"videoId,omitempty"`
  304. // WorkType: Work type as enumerated in EMA.
  305. //
  306. // Possible values:
  307. // "TITLE_TYPE_UNSPECIFIED" - Value could not be determined, please
  308. // contact technical support if
  309. // it should.
  310. // "MOVIE" - A movie picture.
  311. // "SEASON" - A season of a TV show.
  312. // "EPISODE" - An episode of a TV show.
  313. // "BUNDLE" - A collection of movies, i.e. "Googlers 1 and Googlers,
  314. // the return"
  315. WorkType string `json:"workType,omitempty"`
  316. // ServerResponse contains the HTTP response code and headers from the
  317. // server.
  318. googleapi.ServerResponse `json:"-"`
  319. // ForceSendFields is a list of field names (e.g. "AltId") to
  320. // unconditionally include in API requests. By default, fields with
  321. // empty values are omitted from API requests. However, any non-pointer,
  322. // non-interface field appearing in ForceSendFields will be sent to the
  323. // server regardless of whether the field is empty or not. This may be
  324. // used to include empty fields in Patch requests.
  325. ForceSendFields []string `json:"-"`
  326. // NullFields is a list of field names (e.g. "AltId") to include in API
  327. // requests with the JSON null value. By default, fields with empty
  328. // values are omitted from API requests. However, any field with an
  329. // empty value appearing in NullFields will be sent to the server as
  330. // null. It is an error if a field in this list has a non-empty value.
  331. // This may be used to include null fields in Patch requests.
  332. NullFields []string `json:"-"`
  333. }
  334. func (s *Avail) MarshalJSON() ([]byte, error) {
  335. type NoMethod Avail
  336. raw := NoMethod(*s)
  337. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  338. }
  339. // ListAvailsResponse: Response to the 'ListAvails' method.
  340. type ListAvailsResponse struct {
  341. // Avails: List of Avails that match the request criteria.
  342. Avails []*Avail `json:"avails,omitempty"`
  343. // NextPageToken: See _List methods rules_ for info about this field.
  344. NextPageToken string `json:"nextPageToken,omitempty"`
  345. // TotalSize: See _List methods rules_ for more information about this
  346. // field.
  347. TotalSize int64 `json:"totalSize,omitempty"`
  348. // ServerResponse contains the HTTP response code and headers from the
  349. // server.
  350. googleapi.ServerResponse `json:"-"`
  351. // ForceSendFields is a list of field names (e.g. "Avails") to
  352. // unconditionally include in API requests. By default, fields with
  353. // empty values are omitted from API requests. However, any non-pointer,
  354. // non-interface field appearing in ForceSendFields will be sent to the
  355. // server regardless of whether the field is empty or not. This may be
  356. // used to include empty fields in Patch requests.
  357. ForceSendFields []string `json:"-"`
  358. // NullFields is a list of field names (e.g. "Avails") to include in API
  359. // requests with the JSON null value. By default, fields with empty
  360. // values are omitted from API requests. However, any field with an
  361. // empty value appearing in NullFields will be sent to the server as
  362. // null. It is an error if a field in this list has a non-empty value.
  363. // This may be used to include null fields in Patch requests.
  364. NullFields []string `json:"-"`
  365. }
  366. func (s *ListAvailsResponse) MarshalJSON() ([]byte, error) {
  367. type NoMethod ListAvailsResponse
  368. raw := NoMethod(*s)
  369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  370. }
  371. // ListOrdersResponse: Response to the 'ListOrders' method.
  372. type ListOrdersResponse struct {
  373. // NextPageToken: See _List methods rules_ for info about this field.
  374. NextPageToken string `json:"nextPageToken,omitempty"`
  375. // Orders: List of Orders that match the request criteria.
  376. Orders []*Order `json:"orders,omitempty"`
  377. // TotalSize: See _List methods rules_ for more information about this
  378. // field.
  379. TotalSize int64 `json:"totalSize,omitempty"`
  380. // ServerResponse contains the HTTP response code and headers from the
  381. // server.
  382. googleapi.ServerResponse `json:"-"`
  383. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  384. // unconditionally include in API requests. By default, fields with
  385. // empty values are omitted from API requests. However, any non-pointer,
  386. // non-interface field appearing in ForceSendFields will be sent to the
  387. // server regardless of whether the field is empty or not. This may be
  388. // used to include empty fields in Patch requests.
  389. ForceSendFields []string `json:"-"`
  390. // NullFields is a list of field names (e.g. "NextPageToken") to include
  391. // in API requests with the JSON null value. By default, fields with
  392. // empty values are omitted from API requests. However, any field with
  393. // an empty value appearing in NullFields will be sent to the server as
  394. // null. It is an error if a field in this list has a non-empty value.
  395. // This may be used to include null fields in Patch requests.
  396. NullFields []string `json:"-"`
  397. }
  398. func (s *ListOrdersResponse) MarshalJSON() ([]byte, error) {
  399. type NoMethod ListOrdersResponse
  400. raw := NoMethod(*s)
  401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  402. }
  403. // ListStoreInfosResponse: Response to the 'ListStoreInfos' method.
  404. type ListStoreInfosResponse struct {
  405. // NextPageToken: See 'List methods rules' for info about this field.
  406. NextPageToken string `json:"nextPageToken,omitempty"`
  407. // StoreInfos: List of StoreInfos that match the request criteria.
  408. StoreInfos []*StoreInfo `json:"storeInfos,omitempty"`
  409. // TotalSize: See _List methods rules_ for more information about this
  410. // field.
  411. TotalSize int64 `json:"totalSize,omitempty"`
  412. // ServerResponse contains the HTTP response code and headers from the
  413. // server.
  414. googleapi.ServerResponse `json:"-"`
  415. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  416. // unconditionally include in API requests. By default, fields with
  417. // empty values are omitted from API requests. However, any non-pointer,
  418. // non-interface field appearing in ForceSendFields will be sent to the
  419. // server regardless of whether the field is empty or not. This may be
  420. // used to include empty fields in Patch requests.
  421. ForceSendFields []string `json:"-"`
  422. // NullFields is a list of field names (e.g. "NextPageToken") to include
  423. // in API requests with the JSON null value. By default, fields with
  424. // empty values are omitted from API requests. However, any field with
  425. // an empty value appearing in NullFields will be sent to the server as
  426. // null. It is an error if a field in this list has a non-empty value.
  427. // This may be used to include null fields in Patch requests.
  428. NullFields []string `json:"-"`
  429. }
  430. func (s *ListStoreInfosResponse) MarshalJSON() ([]byte, error) {
  431. type NoMethod ListStoreInfosResponse
  432. raw := NoMethod(*s)
  433. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  434. }
  435. // Order: An Order tracks the fulfillment of an Edit when delivered
  436. // using the
  437. // legacy, non-component-based delivery.
  438. //
  439. // Each Order is uniquely identified by an `order_id`, which is
  440. // generated
  441. // by Google.
  442. //
  443. // Externally, Orders can also be identified by partners using its
  444. // `custom_id`
  445. // (when provided).
  446. type Order struct {
  447. // ApprovedTime: Timestamp when the Order was approved.
  448. ApprovedTime string `json:"approvedTime,omitempty"`
  449. // ChannelId: YouTube Channel ID that should be used to fulfill the
  450. // Order.
  451. // Example: "UCRG64darCZhb".
  452. ChannelId string `json:"channelId,omitempty"`
  453. // ChannelName: YouTube Channel Name that should be used to fulfill the
  454. // Order.
  455. // Example: "Google_channel".
  456. ChannelName string `json:"channelName,omitempty"`
  457. // Countries: Countries where the Order is available,
  458. // using the "ISO 3166-1 alpha-2" format (example: "US").
  459. Countries []string `json:"countries,omitempty"`
  460. // CustomId: ID that can be used to externally identify an Order.
  461. // This ID is provided by partners when submitting the Avails.
  462. // Example: 'GOOGLER_2006'
  463. CustomId string `json:"customId,omitempty"`
  464. // EarliestAvailStartTime: Timestamp of the earliest start date of the
  465. // Avails
  466. // linked to this Order.
  467. EarliestAvailStartTime string `json:"earliestAvailStartTime,omitempty"`
  468. // EpisodeName: Default Episode name,
  469. // usually in the language of the country of origin.
  470. // Only available for TV Edits
  471. // Example: "Googlers, The - Pilot".
  472. EpisodeName string `json:"episodeName,omitempty"`
  473. // LegacyPriority: Legacy Order priority, as defined by Google.
  474. // Example: 'P0'
  475. LegacyPriority string `json:"legacyPriority,omitempty"`
  476. // Name: Default Edit name,
  477. // usually in the language of the country of origin.
  478. // Example: "Googlers, The".
  479. Name string `json:"name,omitempty"`
  480. // NormalizedPriority: A simpler representation of the priority.
  481. //
  482. // Possible values:
  483. // "NORMALIZED_PRIORITY_UNSPECIFIED" - Value could not be determined,
  484. // please contact technical support if
  485. // it should.
  486. // "LOW_PRIORITY" - A low-priority asset, typically from a library
  487. // movie.
  488. // "HIGH_PRIORITY" - A high-priority asset, typically from a new
  489. // release or box office hit.
  490. NormalizedPriority string `json:"normalizedPriority,omitempty"`
  491. // OrderId: ID internally generated by Google to uniquely identify an
  492. // Order.
  493. // Example: 'abcde12_x'
  494. OrderId string `json:"orderId,omitempty"`
  495. // OrderedTime: Timestamp when the Order was created.
  496. OrderedTime string `json:"orderedTime,omitempty"`
  497. // PphName: Name of the post-production house that manages the Edit
  498. // ordered.
  499. PphName string `json:"pphName,omitempty"`
  500. // Priority: Order priority, as defined by Google.
  501. // The higher the value, the higher the priority.
  502. // Example: 90
  503. Priority float64 `json:"priority,omitempty"`
  504. // ReceivedTime: Timestamp when the Order was fulfilled.
  505. ReceivedTime string `json:"receivedTime,omitempty"`
  506. // RejectionNote: Field explaining why an Order has been
  507. // rejected.
  508. // Example: "Trailer audio is 2ch mono, please re-deliver in stereo".
  509. RejectionNote string `json:"rejectionNote,omitempty"`
  510. // SeasonName: Default Season name,
  511. // usually in the language of the country of origin.
  512. // Only available for TV Edits
  513. // Example: "Googlers, The - A Brave New World".
  514. SeasonName string `json:"seasonName,omitempty"`
  515. // ShowName: Default Show name,
  516. // usually in the language of the country of origin.
  517. // Only available for TV Edits
  518. // Example: "Googlers, The".
  519. ShowName string `json:"showName,omitempty"`
  520. // Status: High-level status of the order.
  521. //
  522. // Possible values:
  523. // "STATUS_UNSPECIFIED" - Value could not be determined, please
  524. // contact technical support if
  525. // it should.
  526. // "STATUS_APPROVED" - Approved by Google.
  527. // "STATUS_FAILED" - Waiting for partner to re-deliver the asset after
  528. // a rejection by Google.
  529. // "STATUS_PROCESSING" - Waiting for Google to process the asset.
  530. // "STATUS_UNFULFILLED" - Waiting for partner to deliver the asset.
  531. // "STATUS_NOT_AVAILABLE" - Used when Status is not available (i.e:
  532. // Orders for TV Seasons).
  533. Status string `json:"status,omitempty"`
  534. // StatusDetail: Detailed status of the order
  535. //
  536. // Possible values:
  537. // "ORDER_STATUS_UNSPECIFIED" - Value could not be determined, please
  538. // contact technical support if
  539. // it should.
  540. // "ORDER_STATUS_QC_APPROVED" - Approved by Google's Quality Control
  541. // team.
  542. // "ORDER_STATUS_QC_REJECTION" - Rejected by Google's Quality Control
  543. // team, pending partner redelivery.
  544. // "ORDER_STATUS_INTERNAL_FIX" - Internal error while processing the
  545. // Order.
  546. // "ORDER_STATUS_OPEN_ORDER" - Waiting for initial delivery from
  547. // partner.
  548. // "ORDER_STATUS_NOT_AVAILABLE" - Used on Orders that do not have
  549. // Status, like TV Seasons.
  550. // "ORDER_STATUS_AWAITING_REDELIVERY" - Waiting for re-delivery from
  551. // partner.
  552. // "ORDER_STATUS_READY_FOR_QC" - Asset was delivered by partner, but
  553. // is being reviewed by Google's
  554. // Quality Control team.
  555. // "ORDER_STATUS_FILE_PROCESSING" - Waiting for Google to process the
  556. // asset.
  557. StatusDetail string `json:"statusDetail,omitempty"`
  558. // StudioName: Name of the studio that owns the Edit ordered.
  559. StudioName string `json:"studioName,omitempty"`
  560. // Type: Type of the Edit linked to the Order.
  561. //
  562. // Possible values:
  563. // "TITLE_TYPE_UNSPECIFIED" - Value could not be determined, please
  564. // contact technical support if
  565. // it should.
  566. // "MOVIE" - A movie picture.
  567. // "SEASON" - A season of a TV show.
  568. // "EPISODE" - An episode of a TV show.
  569. // "BUNDLE" - A collection of movies, i.e. "Googlers 1 and Googlers,
  570. // the return"
  571. Type string `json:"type,omitempty"`
  572. // VideoId: Google-generated ID identifying the video linked to this
  573. // Order, once
  574. // delivered.
  575. // Example: 'gtry456_xc'.
  576. VideoId string `json:"videoId,omitempty"`
  577. // ServerResponse contains the HTTP response code and headers from the
  578. // server.
  579. googleapi.ServerResponse `json:"-"`
  580. // ForceSendFields is a list of field names (e.g. "ApprovedTime") to
  581. // unconditionally include in API requests. By default, fields with
  582. // empty values are omitted from API requests. However, any non-pointer,
  583. // non-interface field appearing in ForceSendFields will be sent to the
  584. // server regardless of whether the field is empty or not. This may be
  585. // used to include empty fields in Patch requests.
  586. ForceSendFields []string `json:"-"`
  587. // NullFields is a list of field names (e.g. "ApprovedTime") to include
  588. // in API requests with the JSON null value. By default, fields with
  589. // empty values are omitted from API requests. However, any field with
  590. // an empty value appearing in NullFields will be sent to the server as
  591. // null. It is an error if a field in this list has a non-empty value.
  592. // This may be used to include null fields in Patch requests.
  593. NullFields []string `json:"-"`
  594. }
  595. func (s *Order) MarshalJSON() ([]byte, error) {
  596. type NoMethod Order
  597. raw := NoMethod(*s)
  598. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  599. }
  600. func (s *Order) UnmarshalJSON(data []byte) error {
  601. type NoMethod Order
  602. var s1 struct {
  603. Priority gensupport.JSONFloat64 `json:"priority"`
  604. *NoMethod
  605. }
  606. s1.NoMethod = (*NoMethod)(s)
  607. if err := json.Unmarshal(data, &s1); err != nil {
  608. return err
  609. }
  610. s.Priority = float64(s1.Priority)
  611. return nil
  612. }
  613. // StoreInfo: Information about a playable sequence (video) associated
  614. // with an Edit
  615. // and available at the Google Play Store.
  616. //
  617. // Internally, each StoreInfo is uniquely identified by a `video_id`
  618. // and `country`.
  619. //
  620. // Externally, Title-level EIDR or Edit-level EIDR, if provided,
  621. // can also be used to identify a specific title or edit in a country.
  622. type StoreInfo struct {
  623. // AudioTracks: Audio tracks available for this Edit.
  624. AudioTracks []string `json:"audioTracks,omitempty"`
  625. // Country: Country where Edit is available in ISO 3166-1 alpha-2
  626. // country
  627. // code.
  628. // Example: "US".
  629. Country string `json:"country,omitempty"`
  630. // EditLevelEidr: Edit-level EIDR ID.
  631. // Example: "10.5240/1489-49A2-3956-4B2D-FE16-6".
  632. EditLevelEidr string `json:"editLevelEidr,omitempty"`
  633. // EpisodeNumber: The number assigned to the episode within a
  634. // season.
  635. // Only available on TV Edits.
  636. // Example: "1".
  637. EpisodeNumber string `json:"episodeNumber,omitempty"`
  638. // HasAudio51: Whether the Edit has a 5.1 channel audio track.
  639. HasAudio51 bool `json:"hasAudio51,omitempty"`
  640. // HasEstOffer: Whether the Edit has a EST offer.
  641. HasEstOffer bool `json:"hasEstOffer,omitempty"`
  642. // HasHdOffer: Whether the Edit has a HD offer.
  643. HasHdOffer bool `json:"hasHdOffer,omitempty"`
  644. // HasInfoCards: Whether the Edit has info cards.
  645. HasInfoCards bool `json:"hasInfoCards,omitempty"`
  646. // HasSdOffer: Whether the Edit has a SD offer.
  647. HasSdOffer bool `json:"hasSdOffer,omitempty"`
  648. // HasVodOffer: Whether the Edit has a VOD offer.
  649. HasVodOffer bool `json:"hasVodOffer,omitempty"`
  650. // LiveTime: Timestamp when the Edit went live on the Store.
  651. LiveTime string `json:"liveTime,omitempty"`
  652. // Mid: Knowledge Graph ID associated to this Edit, if available.
  653. // This ID links the Edit to its knowledge entity, externally
  654. // accessible
  655. // at http://freebase.com.
  656. // In the absense of Title EIDR or Edit EIDR, this ID helps link
  657. // together
  658. // multiple Edits across countries.
  659. // Example: '/m/0ffx29'
  660. Mid string `json:"mid,omitempty"`
  661. // Name: Default Edit name, usually in the language of the country
  662. // of
  663. // origin.
  664. // Example: "Googlers, The".
  665. Name string `json:"name,omitempty"`
  666. // PphNames: Name of the post-production houses that manage the Edit.
  667. PphNames []string `json:"pphNames,omitempty"`
  668. // SeasonId: Google-generated ID identifying the season linked to the
  669. // Edit.
  670. // Only available for TV Edits.
  671. // Example: 'ster23ex'
  672. SeasonId string `json:"seasonId,omitempty"`
  673. // SeasonName: Default Season name, usually in the language of the
  674. // country of
  675. // origin.
  676. // Only available for TV Edits
  677. // Example: "Googlers, The - A Brave New World".
  678. SeasonName string `json:"seasonName,omitempty"`
  679. // SeasonNumber: The number assigned to the season within a show.
  680. // Only available on TV Edits.
  681. // Example: "1".
  682. SeasonNumber string `json:"seasonNumber,omitempty"`
  683. // ShowId: Google-generated ID identifying the show linked to the
  684. // Edit.
  685. // Only available for TV Edits.
  686. // Example: 'et2hsue_x'
  687. ShowId string `json:"showId,omitempty"`
  688. // ShowName: Default Show name, usually in the language of the country
  689. // of
  690. // origin.
  691. // Only available for TV Edits
  692. // Example: "Googlers, The".
  693. ShowName string `json:"showName,omitempty"`
  694. // StudioName: Name of the studio that owns the Edit ordered.
  695. StudioName string `json:"studioName,omitempty"`
  696. // Subtitles: Subtitles available for this Edit.
  697. Subtitles []string `json:"subtitles,omitempty"`
  698. // TitleLevelEidr: Title-level EIDR ID.
  699. // Example: "10.5240/1489-49A2-3956-4B2D-FE16-5".
  700. TitleLevelEidr string `json:"titleLevelEidr,omitempty"`
  701. // TrailerId: Google-generated ID identifying the trailer linked to the
  702. // Edit.
  703. // Example: 'bhd_4e_cx'
  704. TrailerId string `json:"trailerId,omitempty"`
  705. // Type: Edit type, like Movie, Episode or Season.
  706. //
  707. // Possible values:
  708. // "TITLE_TYPE_UNSPECIFIED" - Value could not be determined, please
  709. // contact technical support if
  710. // it should.
  711. // "MOVIE" - A movie picture.
  712. // "SEASON" - A season of a TV show.
  713. // "EPISODE" - An episode of a TV show.
  714. // "BUNDLE" - A collection of movies, i.e. "Googlers 1 and Googlers,
  715. // the return"
  716. Type string `json:"type,omitempty"`
  717. // VideoId: Google-generated ID identifying the video linked to the
  718. // Edit.
  719. // Example: 'gtry456_xc'
  720. VideoId string `json:"videoId,omitempty"`
  721. // ServerResponse contains the HTTP response code and headers from the
  722. // server.
  723. googleapi.ServerResponse `json:"-"`
  724. // ForceSendFields is a list of field names (e.g. "AudioTracks") to
  725. // unconditionally include in API requests. By default, fields with
  726. // empty values are omitted from API requests. However, any non-pointer,
  727. // non-interface field appearing in ForceSendFields will be sent to the
  728. // server regardless of whether the field is empty or not. This may be
  729. // used to include empty fields in Patch requests.
  730. ForceSendFields []string `json:"-"`
  731. // NullFields is a list of field names (e.g. "AudioTracks") to include
  732. // in API requests with the JSON null value. By default, fields with
  733. // empty values are omitted from API requests. However, any field with
  734. // an empty value appearing in NullFields will be sent to the server as
  735. // null. It is an error if a field in this list has a non-empty value.
  736. // This may be used to include null fields in Patch requests.
  737. NullFields []string `json:"-"`
  738. }
  739. func (s *StoreInfo) MarshalJSON() ([]byte, error) {
  740. type NoMethod StoreInfo
  741. raw := NoMethod(*s)
  742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  743. }
  744. // method id "playmoviespartner.accounts.avails.get":
  745. type AccountsAvailsGetCall struct {
  746. s *Service
  747. accountId string
  748. availId string
  749. urlParams_ gensupport.URLParams
  750. ifNoneMatch_ string
  751. ctx_ context.Context
  752. header_ http.Header
  753. }
  754. // Get: Get an Avail given its avail group id and avail id.
  755. func (r *AccountsAvailsService) Get(accountId string, availId string) *AccountsAvailsGetCall {
  756. c := &AccountsAvailsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  757. c.accountId = accountId
  758. c.availId = availId
  759. return c
  760. }
  761. // Fields allows partial responses to be retrieved. See
  762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  763. // for more information.
  764. func (c *AccountsAvailsGetCall) Fields(s ...googleapi.Field) *AccountsAvailsGetCall {
  765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  766. return c
  767. }
  768. // IfNoneMatch sets the optional parameter which makes the operation
  769. // fail if the object's ETag matches the given value. This is useful for
  770. // getting updates only after the object has changed since the last
  771. // request. Use googleapi.IsNotModified to check whether the response
  772. // error from Do is the result of In-None-Match.
  773. func (c *AccountsAvailsGetCall) IfNoneMatch(entityTag string) *AccountsAvailsGetCall {
  774. c.ifNoneMatch_ = entityTag
  775. return c
  776. }
  777. // Context sets the context to be used in this call's Do method. Any
  778. // pending HTTP request will be aborted if the provided context is
  779. // canceled.
  780. func (c *AccountsAvailsGetCall) Context(ctx context.Context) *AccountsAvailsGetCall {
  781. c.ctx_ = ctx
  782. return c
  783. }
  784. // Header returns an http.Header that can be modified by the caller to
  785. // add HTTP headers to the request.
  786. func (c *AccountsAvailsGetCall) Header() http.Header {
  787. if c.header_ == nil {
  788. c.header_ = make(http.Header)
  789. }
  790. return c.header_
  791. }
  792. func (c *AccountsAvailsGetCall) doRequest(alt string) (*http.Response, error) {
  793. reqHeaders := make(http.Header)
  794. for k, v := range c.header_ {
  795. reqHeaders[k] = v
  796. }
  797. reqHeaders.Set("User-Agent", c.s.userAgent())
  798. if c.ifNoneMatch_ != "" {
  799. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  800. }
  801. var body io.Reader = nil
  802. c.urlParams_.Set("alt", alt)
  803. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/avails/{availId}")
  804. urls += "?" + c.urlParams_.Encode()
  805. req, _ := http.NewRequest("GET", urls, body)
  806. req.Header = reqHeaders
  807. googleapi.Expand(req.URL, map[string]string{
  808. "accountId": c.accountId,
  809. "availId": c.availId,
  810. })
  811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  812. }
  813. // Do executes the "playmoviespartner.accounts.avails.get" call.
  814. // Exactly one of *Avail or error will be non-nil. Any non-2xx status
  815. // code is an error. Response headers are in either
  816. // *Avail.ServerResponse.Header or (if a response was returned at all)
  817. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  818. // check whether the returned error was because http.StatusNotModified
  819. // was returned.
  820. func (c *AccountsAvailsGetCall) Do(opts ...googleapi.CallOption) (*Avail, error) {
  821. gensupport.SetOptions(c.urlParams_, opts...)
  822. res, err := c.doRequest("json")
  823. if res != nil && res.StatusCode == http.StatusNotModified {
  824. if res.Body != nil {
  825. res.Body.Close()
  826. }
  827. return nil, &googleapi.Error{
  828. Code: res.StatusCode,
  829. Header: res.Header,
  830. }
  831. }
  832. if err != nil {
  833. return nil, err
  834. }
  835. defer googleapi.CloseBody(res)
  836. if err := googleapi.CheckResponse(res); err != nil {
  837. return nil, err
  838. }
  839. ret := &Avail{
  840. ServerResponse: googleapi.ServerResponse{
  841. Header: res.Header,
  842. HTTPStatusCode: res.StatusCode,
  843. },
  844. }
  845. target := &ret
  846. if err := gensupport.DecodeResponse(target, res); err != nil {
  847. return nil, err
  848. }
  849. return ret, nil
  850. // {
  851. // "description": "Get an Avail given its avail group id and avail id.",
  852. // "flatPath": "v1/accounts/{accountId}/avails/{availId}",
  853. // "httpMethod": "GET",
  854. // "id": "playmoviespartner.accounts.avails.get",
  855. // "parameterOrder": [
  856. // "accountId",
  857. // "availId"
  858. // ],
  859. // "parameters": {
  860. // "accountId": {
  861. // "description": "REQUIRED. See _General rules_ for more information about this field.",
  862. // "location": "path",
  863. // "required": true,
  864. // "type": "string"
  865. // },
  866. // "availId": {
  867. // "description": "REQUIRED. Avail ID.",
  868. // "location": "path",
  869. // "required": true,
  870. // "type": "string"
  871. // }
  872. // },
  873. // "path": "v1/accounts/{accountId}/avails/{availId}",
  874. // "response": {
  875. // "$ref": "Avail"
  876. // },
  877. // "scopes": [
  878. // "https://www.googleapis.com/auth/playmovies_partner.readonly"
  879. // ]
  880. // }
  881. }
  882. // method id "playmoviespartner.accounts.avails.list":
  883. type AccountsAvailsListCall struct {
  884. s *Service
  885. accountId string
  886. urlParams_ gensupport.URLParams
  887. ifNoneMatch_ string
  888. ctx_ context.Context
  889. header_ http.Header
  890. }
  891. // List: List Avails owned or managed by the partner.
  892. //
  893. // See _Authentication and Authorization rules_ and
  894. // _List methods rules_ for more information about this method.
  895. func (r *AccountsAvailsService) List(accountId string) *AccountsAvailsListCall {
  896. c := &AccountsAvailsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  897. c.accountId = accountId
  898. return c
  899. }
  900. // AltId sets the optional parameter "altId": Filter Avails that match a
  901. // case-insensitive, partner-specific custom id.
  902. // NOTE: this field is deprecated and will be removed on V2;
  903. // `alt_ids`
  904. // should be used instead.
  905. func (c *AccountsAvailsListCall) AltId(altId string) *AccountsAvailsListCall {
  906. c.urlParams_.Set("altId", altId)
  907. return c
  908. }
  909. // AltIds sets the optional parameter "altIds": Filter Avails that match
  910. // (case-insensitive) any of the given partner-specific custom ids.
  911. func (c *AccountsAvailsListCall) AltIds(altIds ...string) *AccountsAvailsListCall {
  912. c.urlParams_.SetMulti("altIds", append([]string{}, altIds...))
  913. return c
  914. }
  915. // PageSize sets the optional parameter "pageSize": See _List methods
  916. // rules_ for info about this field.
  917. func (c *AccountsAvailsListCall) PageSize(pageSize int64) *AccountsAvailsListCall {
  918. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  919. return c
  920. }
  921. // PageToken sets the optional parameter "pageToken": See _List methods
  922. // rules_ for info about this field.
  923. func (c *AccountsAvailsListCall) PageToken(pageToken string) *AccountsAvailsListCall {
  924. c.urlParams_.Set("pageToken", pageToken)
  925. return c
  926. }
  927. // PphNames sets the optional parameter "pphNames": See _List methods
  928. // rules_ for info about this field.
  929. func (c *AccountsAvailsListCall) PphNames(pphNames ...string) *AccountsAvailsListCall {
  930. c.urlParams_.SetMulti("pphNames", append([]string{}, pphNames...))
  931. return c
  932. }
  933. // StudioNames sets the optional parameter "studioNames": See _List
  934. // methods rules_ for info about this field.
  935. func (c *AccountsAvailsListCall) StudioNames(studioNames ...string) *AccountsAvailsListCall {
  936. c.urlParams_.SetMulti("studioNames", append([]string{}, studioNames...))
  937. return c
  938. }
  939. // Territories sets the optional parameter "territories": Filter Avails
  940. // that match (case-insensitive) any of the given country codes,
  941. // using the "ISO 3166-1 alpha-2" format (examples: "US", "us", "Us").
  942. func (c *AccountsAvailsListCall) Territories(territories ...string) *AccountsAvailsListCall {
  943. c.urlParams_.SetMulti("territories", append([]string{}, territories...))
  944. return c
  945. }
  946. // Title sets the optional parameter "title": Filter that matches Avails
  947. // with a `title_internal_alias`,
  948. // `series_title_internal_alias`, `season_title_internal_alias`,
  949. // or `episode_title_internal_alias` that contains the
  950. // given
  951. // case-insensitive title.
  952. func (c *AccountsAvailsListCall) Title(title string) *AccountsAvailsListCall {
  953. c.urlParams_.Set("title", title)
  954. return c
  955. }
  956. // VideoIds sets the optional parameter "videoIds": Filter Avails that
  957. // match any of the given `video_id`s.
  958. func (c *AccountsAvailsListCall) VideoIds(videoIds ...string) *AccountsAvailsListCall {
  959. c.urlParams_.SetMulti("videoIds", append([]string{}, videoIds...))
  960. return c
  961. }
  962. // Fields allows partial responses to be retrieved. See
  963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  964. // for more information.
  965. func (c *AccountsAvailsListCall) Fields(s ...googleapi.Field) *AccountsAvailsListCall {
  966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  967. return c
  968. }
  969. // IfNoneMatch sets the optional parameter which makes the operation
  970. // fail if the object's ETag matches the given value. This is useful for
  971. // getting updates only after the object has changed since the last
  972. // request. Use googleapi.IsNotModified to check whether the response
  973. // error from Do is the result of In-None-Match.
  974. func (c *AccountsAvailsListCall) IfNoneMatch(entityTag string) *AccountsAvailsListCall {
  975. c.ifNoneMatch_ = entityTag
  976. return c
  977. }
  978. // Context sets the context to be used in this call's Do method. Any
  979. // pending HTTP request will be aborted if the provided context is
  980. // canceled.
  981. func (c *AccountsAvailsListCall) Context(ctx context.Context) *AccountsAvailsListCall {
  982. c.ctx_ = ctx
  983. return c
  984. }
  985. // Header returns an http.Header that can be modified by the caller to
  986. // add HTTP headers to the request.
  987. func (c *AccountsAvailsListCall) Header() http.Header {
  988. if c.header_ == nil {
  989. c.header_ = make(http.Header)
  990. }
  991. return c.header_
  992. }
  993. func (c *AccountsAvailsListCall) doRequest(alt string) (*http.Response, error) {
  994. reqHeaders := make(http.Header)
  995. for k, v := range c.header_ {
  996. reqHeaders[k] = v
  997. }
  998. reqHeaders.Set("User-Agent", c.s.userAgent())
  999. if c.ifNoneMatch_ != "" {
  1000. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1001. }
  1002. var body io.Reader = nil
  1003. c.urlParams_.Set("alt", alt)
  1004. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/avails")
  1005. urls += "?" + c.urlParams_.Encode()
  1006. req, _ := http.NewRequest("GET", urls, body)
  1007. req.Header = reqHeaders
  1008. googleapi.Expand(req.URL, map[string]string{
  1009. "accountId": c.accountId,
  1010. })
  1011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1012. }
  1013. // Do executes the "playmoviespartner.accounts.avails.list" call.
  1014. // Exactly one of *ListAvailsResponse or error will be non-nil. Any
  1015. // non-2xx status code is an error. Response headers are in either
  1016. // *ListAvailsResponse.ServerResponse.Header or (if a response was
  1017. // returned at all) in error.(*googleapi.Error).Header. Use
  1018. // googleapi.IsNotModified to check whether the returned error was
  1019. // because http.StatusNotModified was returned.
  1020. func (c *AccountsAvailsListCall) Do(opts ...googleapi.CallOption) (*ListAvailsResponse, error) {
  1021. gensupport.SetOptions(c.urlParams_, opts...)
  1022. res, err := c.doRequest("json")
  1023. if res != nil && res.StatusCode == http.StatusNotModified {
  1024. if res.Body != nil {
  1025. res.Body.Close()
  1026. }
  1027. return nil, &googleapi.Error{
  1028. Code: res.StatusCode,
  1029. Header: res.Header,
  1030. }
  1031. }
  1032. if err != nil {
  1033. return nil, err
  1034. }
  1035. defer googleapi.CloseBody(res)
  1036. if err := googleapi.CheckResponse(res); err != nil {
  1037. return nil, err
  1038. }
  1039. ret := &ListAvailsResponse{
  1040. ServerResponse: googleapi.ServerResponse{
  1041. Header: res.Header,
  1042. HTTPStatusCode: res.StatusCode,
  1043. },
  1044. }
  1045. target := &ret
  1046. if err := gensupport.DecodeResponse(target, res); err != nil {
  1047. return nil, err
  1048. }
  1049. return ret, nil
  1050. // {
  1051. // "description": "List Avails owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.",
  1052. // "flatPath": "v1/accounts/{accountId}/avails",
  1053. // "httpMethod": "GET",
  1054. // "id": "playmoviespartner.accounts.avails.list",
  1055. // "parameterOrder": [
  1056. // "accountId"
  1057. // ],
  1058. // "parameters": {
  1059. // "accountId": {
  1060. // "description": "REQUIRED. See _General rules_ for more information about this field.",
  1061. // "location": "path",
  1062. // "required": true,
  1063. // "type": "string"
  1064. // },
  1065. // "altId": {
  1066. // "description": "Filter Avails that match a case-insensitive, partner-specific custom id.\nNOTE: this field is deprecated and will be removed on V2; `alt_ids`\nshould be used instead.",
  1067. // "location": "query",
  1068. // "type": "string"
  1069. // },
  1070. // "altIds": {
  1071. // "description": "Filter Avails that match (case-insensitive) any of the given partner-specific custom ids.",
  1072. // "location": "query",
  1073. // "repeated": true,
  1074. // "type": "string"
  1075. // },
  1076. // "pageSize": {
  1077. // "description": "See _List methods rules_ for info about this field.",
  1078. // "format": "int32",
  1079. // "location": "query",
  1080. // "type": "integer"
  1081. // },
  1082. // "pageToken": {
  1083. // "description": "See _List methods rules_ for info about this field.",
  1084. // "location": "query",
  1085. // "type": "string"
  1086. // },
  1087. // "pphNames": {
  1088. // "description": "See _List methods rules_ for info about this field.",
  1089. // "location": "query",
  1090. // "repeated": true,
  1091. // "type": "string"
  1092. // },
  1093. // "studioNames": {
  1094. // "description": "See _List methods rules_ for info about this field.",
  1095. // "location": "query",
  1096. // "repeated": true,
  1097. // "type": "string"
  1098. // },
  1099. // "territories": {
  1100. // "description": "Filter Avails that match (case-insensitive) any of the given country codes,\nusing the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").",
  1101. // "location": "query",
  1102. // "repeated": true,
  1103. // "type": "string"
  1104. // },
  1105. // "title": {
  1106. // "description": "Filter that matches Avails with a `title_internal_alias`,\n`series_title_internal_alias`, `season_title_internal_alias`,\nor `episode_title_internal_alias` that contains the given\ncase-insensitive title.",
  1107. // "location": "query",
  1108. // "type": "string"
  1109. // },
  1110. // "videoIds": {
  1111. // "description": "Filter Avails that match any of the given `video_id`s.",
  1112. // "location": "query",
  1113. // "repeated": true,
  1114. // "type": "string"
  1115. // }
  1116. // },
  1117. // "path": "v1/accounts/{accountId}/avails",
  1118. // "response": {
  1119. // "$ref": "ListAvailsResponse"
  1120. // },
  1121. // "scopes": [
  1122. // "https://www.googleapis.com/auth/playmovies_partner.readonly"
  1123. // ]
  1124. // }
  1125. }
  1126. // Pages invokes f for each page of results.
  1127. // A non-nil error returned from f will halt the iteration.
  1128. // The provided context supersedes any context provided to the Context method.
  1129. func (c *AccountsAvailsListCall) Pages(ctx context.Context, f func(*ListAvailsResponse) error) error {
  1130. c.ctx_ = ctx
  1131. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1132. for {
  1133. x, err := c.Do()
  1134. if err != nil {
  1135. return err
  1136. }
  1137. if err := f(x); err != nil {
  1138. return err
  1139. }
  1140. if x.NextPageToken == "" {
  1141. return nil
  1142. }
  1143. c.PageToken(x.NextPageToken)
  1144. }
  1145. }
  1146. // method id "playmoviespartner.accounts.orders.get":
  1147. type AccountsOrdersGetCall struct {
  1148. s *Service
  1149. accountId string
  1150. orderId string
  1151. urlParams_ gensupport.URLParams
  1152. ifNoneMatch_ string
  1153. ctx_ context.Context
  1154. header_ http.Header
  1155. }
  1156. // Get: Get an Order given its id.
  1157. //
  1158. // See _Authentication and Authorization rules_ and
  1159. // _Get methods rules_ for more information about this method.
  1160. func (r *AccountsOrdersService) Get(accountId string, orderId string) *AccountsOrdersGetCall {
  1161. c := &AccountsOrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1162. c.accountId = accountId
  1163. c.orderId = orderId
  1164. return c
  1165. }
  1166. // Fields allows partial responses to be retrieved. See
  1167. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1168. // for more information.
  1169. func (c *AccountsOrdersGetCall) Fields(s ...googleapi.Field) *AccountsOrdersGetCall {
  1170. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1171. return c
  1172. }
  1173. // IfNoneMatch sets the optional parameter which makes the operation
  1174. // fail if the object's ETag matches the given value. This is useful for
  1175. // getting updates only after the object has changed since the last
  1176. // request. Use googleapi.IsNotModified to check whether the response
  1177. // error from Do is the result of In-None-Match.
  1178. func (c *AccountsOrdersGetCall) IfNoneMatch(entityTag string) *AccountsOrdersGetCall {
  1179. c.ifNoneMatch_ = entityTag
  1180. return c
  1181. }
  1182. // Context sets the context to be used in this call's Do method. Any
  1183. // pending HTTP request will be aborted if the provided context is
  1184. // canceled.
  1185. func (c *AccountsOrdersGetCall) Context(ctx context.Context) *AccountsOrdersGetCall {
  1186. c.ctx_ = ctx
  1187. return c
  1188. }
  1189. // Header returns an http.Header that can be modified by the caller to
  1190. // add HTTP headers to the request.
  1191. func (c *AccountsOrdersGetCall) Header() http.Header {
  1192. if c.header_ == nil {
  1193. c.header_ = make(http.Header)
  1194. }
  1195. return c.header_
  1196. }
  1197. func (c *AccountsOrdersGetCall) doRequest(alt string) (*http.Response, error) {
  1198. reqHeaders := make(http.Header)
  1199. for k, v := range c.header_ {
  1200. reqHeaders[k] = v
  1201. }
  1202. reqHeaders.Set("User-Agent", c.s.userAgent())
  1203. if c.ifNoneMatch_ != "" {
  1204. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1205. }
  1206. var body io.Reader = nil
  1207. c.urlParams_.Set("alt", alt)
  1208. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/orders/{orderId}")
  1209. urls += "?" + c.urlParams_.Encode()
  1210. req, _ := http.NewRequest("GET", urls, body)
  1211. req.Header = reqHeaders
  1212. googleapi.Expand(req.URL, map[string]string{
  1213. "accountId": c.accountId,
  1214. "orderId": c.orderId,
  1215. })
  1216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1217. }
  1218. // Do executes the "playmoviespartner.accounts.orders.get" call.
  1219. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  1220. // code is an error. Response headers are in either
  1221. // *Order.ServerResponse.Header or (if a response was returned at all)
  1222. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1223. // check whether the returned error was because http.StatusNotModified
  1224. // was returned.
  1225. func (c *AccountsOrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  1226. gensupport.SetOptions(c.urlParams_, opts...)
  1227. res, err := c.doRequest("json")
  1228. if res != nil && res.StatusCode == http.StatusNotModified {
  1229. if res.Body != nil {
  1230. res.Body.Close()
  1231. }
  1232. return nil, &googleapi.Error{
  1233. Code: res.StatusCode,
  1234. Header: res.Header,
  1235. }
  1236. }
  1237. if err != nil {
  1238. return nil, err
  1239. }
  1240. defer googleapi.CloseBody(res)
  1241. if err := googleapi.CheckResponse(res); err != nil {
  1242. return nil, err
  1243. }
  1244. ret := &Order{
  1245. ServerResponse: googleapi.ServerResponse{
  1246. Header: res.Header,
  1247. HTTPStatusCode: res.StatusCode,
  1248. },
  1249. }
  1250. target := &ret
  1251. if err := gensupport.DecodeResponse(target, res); err != nil {
  1252. return nil, err
  1253. }
  1254. return ret, nil
  1255. // {
  1256. // "description": "Get an Order given its id.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method.",
  1257. // "flatPath": "v1/accounts/{accountId}/orders/{orderId}",
  1258. // "httpMethod": "GET",
  1259. // "id": "playmoviespartner.accounts.orders.get",
  1260. // "parameterOrder": [
  1261. // "accountId",
  1262. // "orderId"
  1263. // ],
  1264. // "parameters": {
  1265. // "accountId": {
  1266. // "description": "REQUIRED. See _General rules_ for more information about this field.",
  1267. // "location": "path",
  1268. // "required": true,
  1269. // "type": "string"
  1270. // },
  1271. // "orderId": {
  1272. // "description": "REQUIRED. Order ID.",
  1273. // "location": "path",
  1274. // "required": true,
  1275. // "type": "string"
  1276. // }
  1277. // },
  1278. // "path": "v1/accounts/{accountId}/orders/{orderId}",
  1279. // "response": {
  1280. // "$ref": "Order"
  1281. // },
  1282. // "scopes": [
  1283. // "https://www.googleapis.com/auth/playmovies_partner.readonly"
  1284. // ]
  1285. // }
  1286. }
  1287. // method id "playmoviespartner.accounts.orders.list":
  1288. type AccountsOrdersListCall struct {
  1289. s *Service
  1290. accountId string
  1291. urlParams_ gensupport.URLParams
  1292. ifNoneMatch_ string
  1293. ctx_ context.Context
  1294. header_ http.Header
  1295. }
  1296. // List: List Orders owned or managed by the partner.
  1297. //
  1298. // See _Authentication and Authorization rules_ and
  1299. // _List methods rules_ for more information about this method.
  1300. func (r *AccountsOrdersService) List(accountId string) *AccountsOrdersListCall {
  1301. c := &AccountsOrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1302. c.accountId = accountId
  1303. return c
  1304. }
  1305. // CustomId sets the optional parameter "customId": Filter Orders that
  1306. // match a case-insensitive, partner-specific custom id.
  1307. func (c *AccountsOrdersListCall) CustomId(customId string) *AccountsOrdersListCall {
  1308. c.urlParams_.Set("customId", customId)
  1309. return c
  1310. }
  1311. // Name sets the optional parameter "name": Filter that matches Orders
  1312. // with a `name`, `show`, `season` or `episode`
  1313. // that contains the given case-insensitive name.
  1314. func (c *AccountsOrdersListCall) Name(name string) *AccountsOrdersListCall {
  1315. c.urlParams_.Set("name", name)
  1316. return c
  1317. }
  1318. // PageSize sets the optional parameter "pageSize": See _List methods
  1319. // rules_ for info about this field.
  1320. func (c *AccountsOrdersListCall) PageSize(pageSize int64) *AccountsOrdersListCall {
  1321. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1322. return c
  1323. }
  1324. // PageToken sets the optional parameter "pageToken": See _List methods
  1325. // rules_ for info about this field.
  1326. func (c *AccountsOrdersListCall) PageToken(pageToken string) *AccountsOrdersListCall {
  1327. c.urlParams_.Set("pageToken", pageToken)
  1328. return c
  1329. }
  1330. // PphNames sets the optional parameter "pphNames": See _List methods
  1331. // rules_ for info about this field.
  1332. func (c *AccountsOrdersListCall) PphNames(pphNames ...string) *AccountsOrdersListCall {
  1333. c.urlParams_.SetMulti("pphNames", append([]string{}, pphNames...))
  1334. return c
  1335. }
  1336. // Status sets the optional parameter "status": Filter Orders that match
  1337. // one of the given status.
  1338. //
  1339. // Possible values:
  1340. // "STATUS_UNSPECIFIED"
  1341. // "STATUS_APPROVED"
  1342. // "STATUS_FAILED"
  1343. // "STATUS_PROCESSING"
  1344. // "STATUS_UNFULFILLED"
  1345. // "STATUS_NOT_AVAILABLE"
  1346. func (c *AccountsOrdersListCall) Status(status ...string) *AccountsOrdersListCall {
  1347. c.urlParams_.SetMulti("status", append([]string{}, status...))
  1348. return c
  1349. }
  1350. // StudioNames sets the optional parameter "studioNames": See _List
  1351. // methods rules_ for info about this field.
  1352. func (c *AccountsOrdersListCall) StudioNames(studioNames ...string) *AccountsOrdersListCall {
  1353. c.urlParams_.SetMulti("studioNames", append([]string{}, studioNames...))
  1354. return c
  1355. }
  1356. // VideoIds sets the optional parameter "videoIds": Filter Orders that
  1357. // match any of the given `video_id`s.
  1358. func (c *AccountsOrdersListCall) VideoIds(videoIds ...string) *AccountsOrdersListCall {
  1359. c.urlParams_.SetMulti("videoIds", append([]string{}, videoIds...))
  1360. return c
  1361. }
  1362. // Fields allows partial responses to be retrieved. See
  1363. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1364. // for more information.
  1365. func (c *AccountsOrdersListCall) Fields(s ...googleapi.Field) *AccountsOrdersListCall {
  1366. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1367. return c
  1368. }
  1369. // IfNoneMatch sets the optional parameter which makes the operation
  1370. // fail if the object's ETag matches the given value. This is useful for
  1371. // getting updates only after the object has changed since the last
  1372. // request. Use googleapi.IsNotModified to check whether the response
  1373. // error from Do is the result of In-None-Match.
  1374. func (c *AccountsOrdersListCall) IfNoneMatch(entityTag string) *AccountsOrdersListCall {
  1375. c.ifNoneMatch_ = entityTag
  1376. return c
  1377. }
  1378. // Context sets the context to be used in this call's Do method. Any
  1379. // pending HTTP request will be aborted if the provided context is
  1380. // canceled.
  1381. func (c *AccountsOrdersListCall) Context(ctx context.Context) *AccountsOrdersListCall {
  1382. c.ctx_ = ctx
  1383. return c
  1384. }
  1385. // Header returns an http.Header that can be modified by the caller to
  1386. // add HTTP headers to the request.
  1387. func (c *AccountsOrdersListCall) Header() http.Header {
  1388. if c.header_ == nil {
  1389. c.header_ = make(http.Header)
  1390. }
  1391. return c.header_
  1392. }
  1393. func (c *AccountsOrdersListCall) doRequest(alt string) (*http.Response, error) {
  1394. reqHeaders := make(http.Header)
  1395. for k, v := range c.header_ {
  1396. reqHeaders[k] = v
  1397. }
  1398. reqHeaders.Set("User-Agent", c.s.userAgent())
  1399. if c.ifNoneMatch_ != "" {
  1400. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1401. }
  1402. var body io.Reader = nil
  1403. c.urlParams_.Set("alt", alt)
  1404. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/orders")
  1405. urls += "?" + c.urlParams_.Encode()
  1406. req, _ := http.NewRequest("GET", urls, body)
  1407. req.Header = reqHeaders
  1408. googleapi.Expand(req.URL, map[string]string{
  1409. "accountId": c.accountId,
  1410. })
  1411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1412. }
  1413. // Do executes the "playmoviespartner.accounts.orders.list" call.
  1414. // Exactly one of *ListOrdersResponse or error will be non-nil. Any
  1415. // non-2xx status code is an error. Response headers are in either
  1416. // *ListOrdersResponse.ServerResponse.Header or (if a response was
  1417. // returned at all) in error.(*googleapi.Error).Header. Use
  1418. // googleapi.IsNotModified to check whether the returned error was
  1419. // because http.StatusNotModified was returned.
  1420. func (c *AccountsOrdersListCall) Do(opts ...googleapi.CallOption) (*ListOrdersResponse, error) {
  1421. gensupport.SetOptions(c.urlParams_, opts...)
  1422. res, err := c.doRequest("json")
  1423. if res != nil && res.StatusCode == http.StatusNotModified {
  1424. if res.Body != nil {
  1425. res.Body.Close()
  1426. }
  1427. return nil, &googleapi.Error{
  1428. Code: res.StatusCode,
  1429. Header: res.Header,
  1430. }
  1431. }
  1432. if err != nil {
  1433. return nil, err
  1434. }
  1435. defer googleapi.CloseBody(res)
  1436. if err := googleapi.CheckResponse(res); err != nil {
  1437. return nil, err
  1438. }
  1439. ret := &ListOrdersResponse{
  1440. ServerResponse: googleapi.ServerResponse{
  1441. Header: res.Header,
  1442. HTTPStatusCode: res.StatusCode,
  1443. },
  1444. }
  1445. target := &ret
  1446. if err := gensupport.DecodeResponse(target, res); err != nil {
  1447. return nil, err
  1448. }
  1449. return ret, nil
  1450. // {
  1451. // "description": "List Orders owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.",
  1452. // "flatPath": "v1/accounts/{accountId}/orders",
  1453. // "httpMethod": "GET",
  1454. // "id": "playmoviespartner.accounts.orders.list",
  1455. // "parameterOrder": [
  1456. // "accountId"
  1457. // ],
  1458. // "parameters": {
  1459. // "accountId": {
  1460. // "description": "REQUIRED. See _General rules_ for more information about this field.",
  1461. // "location": "path",
  1462. // "required": true,
  1463. // "type": "string"
  1464. // },
  1465. // "customId": {
  1466. // "description": "Filter Orders that match a case-insensitive, partner-specific custom id.",
  1467. // "location": "query",
  1468. // "type": "string"
  1469. // },
  1470. // "name": {
  1471. // "description": "Filter that matches Orders with a `name`, `show`, `season` or `episode`\nthat contains the given case-insensitive name.",
  1472. // "location": "query",
  1473. // "type": "string"
  1474. // },
  1475. // "pageSize": {
  1476. // "description": "See _List methods rules_ for info about this field.",
  1477. // "format": "int32",
  1478. // "location": "query",
  1479. // "type": "integer"
  1480. // },
  1481. // "pageToken": {
  1482. // "description": "See _List methods rules_ for info about this field.",
  1483. // "location": "query",
  1484. // "type": "string"
  1485. // },
  1486. // "pphNames": {
  1487. // "description": "See _List methods rules_ for info about this field.",
  1488. // "location": "query",
  1489. // "repeated": true,
  1490. // "type": "string"
  1491. // },
  1492. // "status": {
  1493. // "description": "Filter Orders that match one of the given status.",
  1494. // "enum": [
  1495. // "STATUS_UNSPECIFIED",
  1496. // "STATUS_APPROVED",
  1497. // "STATUS_FAILED",
  1498. // "STATUS_PROCESSING",
  1499. // "STATUS_UNFULFILLED",
  1500. // "STATUS_NOT_AVAILABLE"
  1501. // ],
  1502. // "location": "query",
  1503. // "repeated": true,
  1504. // "type": "string"
  1505. // },
  1506. // "studioNames": {
  1507. // "description": "See _List methods rules_ for info about this field.",
  1508. // "location": "query",
  1509. // "repeated": true,
  1510. // "type": "string"
  1511. // },
  1512. // "videoIds": {
  1513. // "description": "Filter Orders that match any of the given `video_id`s.",
  1514. // "location": "query",
  1515. // "repeated": true,
  1516. // "type": "string"
  1517. // }
  1518. // },
  1519. // "path": "v1/accounts/{accountId}/orders",
  1520. // "response": {
  1521. // "$ref": "ListOrdersResponse"
  1522. // },
  1523. // "scopes": [
  1524. // "https://www.googleapis.com/auth/playmovies_partner.readonly"
  1525. // ]
  1526. // }
  1527. }
  1528. // Pages invokes f for each page of results.
  1529. // A non-nil error returned from f will halt the iteration.
  1530. // The provided context supersedes any context provided to the Context method.
  1531. func (c *AccountsOrdersListCall) Pages(ctx context.Context, f func(*ListOrdersResponse) error) error {
  1532. c.ctx_ = ctx
  1533. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1534. for {
  1535. x, err := c.Do()
  1536. if err != nil {
  1537. return err
  1538. }
  1539. if err := f(x); err != nil {
  1540. return err
  1541. }
  1542. if x.NextPageToken == "" {
  1543. return nil
  1544. }
  1545. c.PageToken(x.NextPageToken)
  1546. }
  1547. }
  1548. // method id "playmoviespartner.accounts.storeInfos.list":
  1549. type AccountsStoreInfosListCall struct {
  1550. s *Service
  1551. accountId string
  1552. urlParams_ gensupport.URLParams
  1553. ifNoneMatch_ string
  1554. ctx_ context.Context
  1555. header_ http.Header
  1556. }
  1557. // List: List StoreInfos owned or managed by the partner.
  1558. //
  1559. // See _Authentication and Authorization rules_ and
  1560. // _List methods rules_ for more information about this method.
  1561. func (r *AccountsStoreInfosService) List(accountId string) *AccountsStoreInfosListCall {
  1562. c := &AccountsStoreInfosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1563. c.accountId = accountId
  1564. return c
  1565. }
  1566. // Countries sets the optional parameter "countries": Filter StoreInfos
  1567. // that match (case-insensitive) any of the given country
  1568. // codes, using the "ISO 3166-1 alpha-2" format (examples: "US", "us",
  1569. // "Us").
  1570. func (c *AccountsStoreInfosListCall) Countries(countries ...string) *AccountsStoreInfosListCall {
  1571. c.urlParams_.SetMulti("countries", append([]string{}, countries...))
  1572. return c
  1573. }
  1574. // Mids sets the optional parameter "mids": Filter StoreInfos that match
  1575. // any of the given `mid`s.
  1576. func (c *AccountsStoreInfosListCall) Mids(mids ...string) *AccountsStoreInfosListCall {
  1577. c.urlParams_.SetMulti("mids", append([]string{}, mids...))
  1578. return c
  1579. }
  1580. // Name sets the optional parameter "name": Filter that matches
  1581. // StoreInfos with a `name` or `show_name`
  1582. // that contains the given case-insensitive name.
  1583. func (c *AccountsStoreInfosListCall) Name(name string) *AccountsStoreInfosListCall {
  1584. c.urlParams_.Set("name", name)
  1585. return c
  1586. }
  1587. // PageSize sets the optional parameter "pageSize": See _List methods
  1588. // rules_ for info about this field.
  1589. func (c *AccountsStoreInfosListCall) PageSize(pageSize int64) *AccountsStoreInfosListCall {
  1590. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1591. return c
  1592. }
  1593. // PageToken sets the optional parameter "pageToken": See _List methods
  1594. // rules_ for info about this field.
  1595. func (c *AccountsStoreInfosListCall) PageToken(pageToken string) *AccountsStoreInfosListCall {
  1596. c.urlParams_.Set("pageToken", pageToken)
  1597. return c
  1598. }
  1599. // PphNames sets the optional parameter "pphNames": See _List methods
  1600. // rules_ for info about this field.
  1601. func (c *AccountsStoreInfosListCall) PphNames(pphNames ...string) *AccountsStoreInfosListCall {
  1602. c.urlParams_.SetMulti("pphNames", append([]string{}, pphNames...))
  1603. return c
  1604. }
  1605. // SeasonIds sets the optional parameter "seasonIds": Filter StoreInfos
  1606. // that match any of the given `season_id`s.
  1607. func (c *AccountsStoreInfosListCall) SeasonIds(seasonIds ...string) *AccountsStoreInfosListCall {
  1608. c.urlParams_.SetMulti("seasonIds", append([]string{}, seasonIds...))
  1609. return c
  1610. }
  1611. // StudioNames sets the optional parameter "studioNames": See _List
  1612. // methods rules_ for info about this field.
  1613. func (c *AccountsStoreInfosListCall) StudioNames(studioNames ...string) *AccountsStoreInfosListCall {
  1614. c.urlParams_.SetMulti("studioNames", append([]string{}, studioNames...))
  1615. return c
  1616. }
  1617. // VideoId sets the optional parameter "videoId": Filter StoreInfos that
  1618. // match a given `video_id`.
  1619. // NOTE: this field is deprecated and will be removed on V2;
  1620. // `video_ids`
  1621. // should be used instead.
  1622. func (c *AccountsStoreInfosListCall) VideoId(videoId string) *AccountsStoreInfosListCall {
  1623. c.urlParams_.Set("videoId", videoId)
  1624. return c
  1625. }
  1626. // VideoIds sets the optional parameter "videoIds": Filter StoreInfos
  1627. // that match any of the given `video_id`s.
  1628. func (c *AccountsStoreInfosListCall) VideoIds(videoIds ...string) *AccountsStoreInfosListCall {
  1629. c.urlParams_.SetMulti("videoIds", append([]string{}, videoIds...))
  1630. return c
  1631. }
  1632. // Fields allows partial responses to be retrieved. See
  1633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1634. // for more information.
  1635. func (c *AccountsStoreInfosListCall) Fields(s ...googleapi.Field) *AccountsStoreInfosListCall {
  1636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1637. return c
  1638. }
  1639. // IfNoneMatch sets the optional parameter which makes the operation
  1640. // fail if the object's ETag matches the given value. This is useful for
  1641. // getting updates only after the object has changed since the last
  1642. // request. Use googleapi.IsNotModified to check whether the response
  1643. // error from Do is the result of In-None-Match.
  1644. func (c *AccountsStoreInfosListCall) IfNoneMatch(entityTag string) *AccountsStoreInfosListCall {
  1645. c.ifNoneMatch_ = entityTag
  1646. return c
  1647. }
  1648. // Context sets the context to be used in this call's Do method. Any
  1649. // pending HTTP request will be aborted if the provided context is
  1650. // canceled.
  1651. func (c *AccountsStoreInfosListCall) Context(ctx context.Context) *AccountsStoreInfosListCall {
  1652. c.ctx_ = ctx
  1653. return c
  1654. }
  1655. // Header returns an http.Header that can be modified by the caller to
  1656. // add HTTP headers to the request.
  1657. func (c *AccountsStoreInfosListCall) Header() http.Header {
  1658. if c.header_ == nil {
  1659. c.header_ = make(http.Header)
  1660. }
  1661. return c.header_
  1662. }
  1663. func (c *AccountsStoreInfosListCall) doRequest(alt string) (*http.Response, error) {
  1664. reqHeaders := make(http.Header)
  1665. for k, v := range c.header_ {
  1666. reqHeaders[k] = v
  1667. }
  1668. reqHeaders.Set("User-Agent", c.s.userAgent())
  1669. if c.ifNoneMatch_ != "" {
  1670. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1671. }
  1672. var body io.Reader = nil
  1673. c.urlParams_.Set("alt", alt)
  1674. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/storeInfos")
  1675. urls += "?" + c.urlParams_.Encode()
  1676. req, _ := http.NewRequest("GET", urls, body)
  1677. req.Header = reqHeaders
  1678. googleapi.Expand(req.URL, map[string]string{
  1679. "accountId": c.accountId,
  1680. })
  1681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1682. }
  1683. // Do executes the "playmoviespartner.accounts.storeInfos.list" call.
  1684. // Exactly one of *ListStoreInfosResponse or error will be non-nil. Any
  1685. // non-2xx status code is an error. Response headers are in either
  1686. // *ListStoreInfosResponse.ServerResponse.Header or (if a response was
  1687. // returned at all) in error.(*googleapi.Error).Header. Use
  1688. // googleapi.IsNotModified to check whether the returned error was
  1689. // because http.StatusNotModified was returned.
  1690. func (c *AccountsStoreInfosListCall) Do(opts ...googleapi.CallOption) (*ListStoreInfosResponse, error) {
  1691. gensupport.SetOptions(c.urlParams_, opts...)
  1692. res, err := c.doRequest("json")
  1693. if res != nil && res.StatusCode == http.StatusNotModified {
  1694. if res.Body != nil {
  1695. res.Body.Close()
  1696. }
  1697. return nil, &googleapi.Error{
  1698. Code: res.StatusCode,
  1699. Header: res.Header,
  1700. }
  1701. }
  1702. if err != nil {
  1703. return nil, err
  1704. }
  1705. defer googleapi.CloseBody(res)
  1706. if err := googleapi.CheckResponse(res); err != nil {
  1707. return nil, err
  1708. }
  1709. ret := &ListStoreInfosResponse{
  1710. ServerResponse: googleapi.ServerResponse{
  1711. Header: res.Header,
  1712. HTTPStatusCode: res.StatusCode,
  1713. },
  1714. }
  1715. target := &ret
  1716. if err := gensupport.DecodeResponse(target, res); err != nil {
  1717. return nil, err
  1718. }
  1719. return ret, nil
  1720. // {
  1721. // "description": "List StoreInfos owned or managed by the partner.\n\nSee _Authentication and Authorization rules_ and\n_List methods rules_ for more information about this method.",
  1722. // "flatPath": "v1/accounts/{accountId}/storeInfos",
  1723. // "httpMethod": "GET",
  1724. // "id": "playmoviespartner.accounts.storeInfos.list",
  1725. // "parameterOrder": [
  1726. // "accountId"
  1727. // ],
  1728. // "parameters": {
  1729. // "accountId": {
  1730. // "description": "REQUIRED. See _General rules_ for more information about this field.",
  1731. // "location": "path",
  1732. // "required": true,
  1733. // "type": "string"
  1734. // },
  1735. // "countries": {
  1736. // "description": "Filter StoreInfos that match (case-insensitive) any of the given country\ncodes, using the \"ISO 3166-1 alpha-2\" format (examples: \"US\", \"us\", \"Us\").",
  1737. // "location": "query",
  1738. // "repeated": true,
  1739. // "type": "string"
  1740. // },
  1741. // "mids": {
  1742. // "description": "Filter StoreInfos that match any of the given `mid`s.",
  1743. // "location": "query",
  1744. // "repeated": true,
  1745. // "type": "string"
  1746. // },
  1747. // "name": {
  1748. // "description": "Filter that matches StoreInfos with a `name` or `show_name`\nthat contains the given case-insensitive name.",
  1749. // "location": "query",
  1750. // "type": "string"
  1751. // },
  1752. // "pageSize": {
  1753. // "description": "See _List methods rules_ for info about this field.",
  1754. // "format": "int32",
  1755. // "location": "query",
  1756. // "type": "integer"
  1757. // },
  1758. // "pageToken": {
  1759. // "description": "See _List methods rules_ for info about this field.",
  1760. // "location": "query",
  1761. // "type": "string"
  1762. // },
  1763. // "pphNames": {
  1764. // "description": "See _List methods rules_ for info about this field.",
  1765. // "location": "query",
  1766. // "repeated": true,
  1767. // "type": "string"
  1768. // },
  1769. // "seasonIds": {
  1770. // "description": "Filter StoreInfos that match any of the given `season_id`s.",
  1771. // "location": "query",
  1772. // "repeated": true,
  1773. // "type": "string"
  1774. // },
  1775. // "studioNames": {
  1776. // "description": "See _List methods rules_ for info about this field.",
  1777. // "location": "query",
  1778. // "repeated": true,
  1779. // "type": "string"
  1780. // },
  1781. // "videoId": {
  1782. // "description": "Filter StoreInfos that match a given `video_id`.\nNOTE: this field is deprecated and will be removed on V2; `video_ids`\nshould be used instead.",
  1783. // "location": "query",
  1784. // "type": "string"
  1785. // },
  1786. // "videoIds": {
  1787. // "description": "Filter StoreInfos that match any of the given `video_id`s.",
  1788. // "location": "query",
  1789. // "repeated": true,
  1790. // "type": "string"
  1791. // }
  1792. // },
  1793. // "path": "v1/accounts/{accountId}/storeInfos",
  1794. // "response": {
  1795. // "$ref": "ListStoreInfosResponse"
  1796. // },
  1797. // "scopes": [
  1798. // "https://www.googleapis.com/auth/playmovies_partner.readonly"
  1799. // ]
  1800. // }
  1801. }
  1802. // Pages invokes f for each page of results.
  1803. // A non-nil error returned from f will halt the iteration.
  1804. // The provided context supersedes any context provided to the Context method.
  1805. func (c *AccountsStoreInfosListCall) Pages(ctx context.Context, f func(*ListStoreInfosResponse) error) error {
  1806. c.ctx_ = ctx
  1807. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1808. for {
  1809. x, err := c.Do()
  1810. if err != nil {
  1811. return err
  1812. }
  1813. if err := f(x); err != nil {
  1814. return err
  1815. }
  1816. if x.NextPageToken == "" {
  1817. return nil
  1818. }
  1819. c.PageToken(x.NextPageToken)
  1820. }
  1821. }
  1822. // method id "playmoviespartner.accounts.storeInfos.country.get":
  1823. type AccountsStoreInfosCountryGetCall struct {
  1824. s *Service
  1825. accountId string
  1826. videoId string
  1827. country string
  1828. urlParams_ gensupport.URLParams
  1829. ifNoneMatch_ string
  1830. ctx_ context.Context
  1831. header_ http.Header
  1832. }
  1833. // Get: Get a StoreInfo given its video id and country.
  1834. //
  1835. // See _Authentication and Authorization rules_ and
  1836. // _Get methods rules_ for more information about this method.
  1837. func (r *AccountsStoreInfosCountryService) Get(accountId string, videoId string, country string) *AccountsStoreInfosCountryGetCall {
  1838. c := &AccountsStoreInfosCountryGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1839. c.accountId = accountId
  1840. c.videoId = videoId
  1841. c.country = country
  1842. return c
  1843. }
  1844. // Fields allows partial responses to be retrieved. See
  1845. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1846. // for more information.
  1847. func (c *AccountsStoreInfosCountryGetCall) Fields(s ...googleapi.Field) *AccountsStoreInfosCountryGetCall {
  1848. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1849. return c
  1850. }
  1851. // IfNoneMatch sets the optional parameter which makes the operation
  1852. // fail if the object's ETag matches the given value. This is useful for
  1853. // getting updates only after the object has changed since the last
  1854. // request. Use googleapi.IsNotModified to check whether the response
  1855. // error from Do is the result of In-None-Match.
  1856. func (c *AccountsStoreInfosCountryGetCall) IfNoneMatch(entityTag string) *AccountsStoreInfosCountryGetCall {
  1857. c.ifNoneMatch_ = entityTag
  1858. return c
  1859. }
  1860. // Context sets the context to be used in this call's Do method. Any
  1861. // pending HTTP request will be aborted if the provided context is
  1862. // canceled.
  1863. func (c *AccountsStoreInfosCountryGetCall) Context(ctx context.Context) *AccountsStoreInfosCountryGetCall {
  1864. c.ctx_ = ctx
  1865. return c
  1866. }
  1867. // Header returns an http.Header that can be modified by the caller to
  1868. // add HTTP headers to the request.
  1869. func (c *AccountsStoreInfosCountryGetCall) Header() http.Header {
  1870. if c.header_ == nil {
  1871. c.header_ = make(http.Header)
  1872. }
  1873. return c.header_
  1874. }
  1875. func (c *AccountsStoreInfosCountryGetCall) doRequest(alt string) (*http.Response, error) {
  1876. reqHeaders := make(http.Header)
  1877. for k, v := range c.header_ {
  1878. reqHeaders[k] = v
  1879. }
  1880. reqHeaders.Set("User-Agent", c.s.userAgent())
  1881. if c.ifNoneMatch_ != "" {
  1882. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1883. }
  1884. var body io.Reader = nil
  1885. c.urlParams_.Set("alt", alt)
  1886. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}")
  1887. urls += "?" + c.urlParams_.Encode()
  1888. req, _ := http.NewRequest("GET", urls, body)
  1889. req.Header = reqHeaders
  1890. googleapi.Expand(req.URL, map[string]string{
  1891. "accountId": c.accountId,
  1892. "videoId": c.videoId,
  1893. "country": c.country,
  1894. })
  1895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1896. }
  1897. // Do executes the "playmoviespartner.accounts.storeInfos.country.get" call.
  1898. // Exactly one of *StoreInfo or error will be non-nil. Any non-2xx
  1899. // status code is an error. Response headers are in either
  1900. // *StoreInfo.ServerResponse.Header or (if a response was returned at
  1901. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  1902. // to check whether the returned error was because
  1903. // http.StatusNotModified was returned.
  1904. func (c *AccountsStoreInfosCountryGetCall) Do(opts ...googleapi.CallOption) (*StoreInfo, error) {
  1905. gensupport.SetOptions(c.urlParams_, opts...)
  1906. res, err := c.doRequest("json")
  1907. if res != nil && res.StatusCode == http.StatusNotModified {
  1908. if res.Body != nil {
  1909. res.Body.Close()
  1910. }
  1911. return nil, &googleapi.Error{
  1912. Code: res.StatusCode,
  1913. Header: res.Header,
  1914. }
  1915. }
  1916. if err != nil {
  1917. return nil, err
  1918. }
  1919. defer googleapi.CloseBody(res)
  1920. if err := googleapi.CheckResponse(res); err != nil {
  1921. return nil, err
  1922. }
  1923. ret := &StoreInfo{
  1924. ServerResponse: googleapi.ServerResponse{
  1925. Header: res.Header,
  1926. HTTPStatusCode: res.StatusCode,
  1927. },
  1928. }
  1929. target := &ret
  1930. if err := gensupport.DecodeResponse(target, res); err != nil {
  1931. return nil, err
  1932. }
  1933. return ret, nil
  1934. // {
  1935. // "description": "Get a StoreInfo given its video id and country.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method.",
  1936. // "flatPath": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}",
  1937. // "httpMethod": "GET",
  1938. // "id": "playmoviespartner.accounts.storeInfos.country.get",
  1939. // "parameterOrder": [
  1940. // "accountId",
  1941. // "videoId",
  1942. // "country"
  1943. // ],
  1944. // "parameters": {
  1945. // "accountId": {
  1946. // "description": "REQUIRED. See _General rules_ for more information about this field.",
  1947. // "location": "path",
  1948. // "required": true,
  1949. // "type": "string"
  1950. // },
  1951. // "country": {
  1952. // "description": "REQUIRED. Edit country.",
  1953. // "location": "path",
  1954. // "required": true,
  1955. // "type": "string"
  1956. // },
  1957. // "videoId": {
  1958. // "description": "REQUIRED. Video ID.",
  1959. // "location": "path",
  1960. // "required": true,
  1961. // "type": "string"
  1962. // }
  1963. // },
  1964. // "path": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}",
  1965. // "response": {
  1966. // "$ref": "StoreInfo"
  1967. // },
  1968. // "scopes": [
  1969. // "https://www.googleapis.com/auth/playmovies_partner.readonly"
  1970. // ]
  1971. // }
  1972. }