您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

2198 行
74 KiB

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