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