1 // Copyright 2020 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. 38 package playmoviespartner // import "google.golang.org/api/playmoviespartner/v1" 39 40 import ( 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. 60 var _ = bytes.NewBuffer 61 var _ = strconv.Itoa 62 var _ = fmt.Sprintf 63 var _ = json.NewDecoder 64 var _ = io.Copy 65 var _ = url.Parse 66 var _ = gensupport.MarshalJSON 67 var _ = googleapi.Version 68 var _ = errors.New 69 var _ = strings.Replace 70 var _ = context.Canceled 71 72 const apiId = "playmoviespartner:v1" 73 const apiName = "playmoviespartner" 74 const apiVersion = "v1" 75 const basePath = "https://playmoviespartner.googleapis.com/" 76 77 // OAuth2 scopes used by this API. 78 const ( 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. 84 func 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. 109 func 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 118 type 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 126 func (s *Service) userAgent() string { 127 if s.UserAgent == "" { 128 return googleapi.UserAgent 129 } 130 return googleapi.UserAgent + " " + s.UserAgent 131 } 132 133 func 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 141 type AccountsService struct { 142 s *Service 143 144 Avails *AccountsAvailsService 145 146 Orders *AccountsOrdersService 147 148 StoreInfos *AccountsStoreInfosService 149 } 150 151 func NewAccountsAvailsService(s *Service) *AccountsAvailsService { 152 rs := &AccountsAvailsService{s: s} 153 return rs 154 } 155 156 type AccountsAvailsService struct { 157 s *Service 158 } 159 160 func NewAccountsOrdersService(s *Service) *AccountsOrdersService { 161 rs := &AccountsOrdersService{s: s} 162 return rs 163 } 164 165 type AccountsOrdersService struct { 166 s *Service 167 } 168 169 func NewAccountsStoreInfosService(s *Service) *AccountsStoreInfosService { 170 rs := &AccountsStoreInfosService{s: s} 171 rs.Country = NewAccountsStoreInfosCountryService(s) 172 return rs 173 } 174 175 type AccountsStoreInfosService struct { 176 s *Service 177 178 Country *AccountsStoreInfosCountryService 179 } 180 181 func NewAccountsStoreInfosCountryService(s *Service) *AccountsStoreInfosCountryService { 182 rs := &AccountsStoreInfosCountryService{s: s} 183 return rs 184 } 185 186 type 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. 201 type 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 446 func (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. 453 type 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 485 func (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. 492 type 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 524 func (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. 531 type 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 563 func (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). 580 type 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 755 func (s *Order) MarshalJSON() ([]byte, error) { 756 type NoMethod Order 757 raw := NoMethod(*s) 758 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 759 } 760 761 func (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. 784 type 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 929 func (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 937 type 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. 948 func (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. 958 func (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. 968 func (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. 976 func (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. 983 func (c *AccountsAvailsGetCall) Header() http.Header { 984 if c.header_ == nil { 985 c.header_ = make(http.Header) 986 } 987 return c.header_ 988 } 989 990 func (c *AccountsAvailsGetCall) doRequest(alt string) (*http.Response, error) { 991 reqHeaders := make(http.Header) 992 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 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 c.urlParams_.Set("prettyPrint", "false") 1003 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/avails/{availId}") 1004 urls += "?" + c.urlParams_.Encode() 1005 req, err := http.NewRequest("GET", urls, body) 1006 if err != nil { 1007 return nil, err 1008 } 1009 req.Header = reqHeaders 1010 googleapi.Expand(req.URL, map[string]string{ 1011 "accountId": c.accountId, 1012 "availId": c.availId, 1013 }) 1014 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1015 } 1016 1017 // Do executes the "playmoviespartner.accounts.avails.get" call. 1018 // Exactly one of *Avail or error will be non-nil. Any non-2xx status 1019 // code is an error. Response headers are in either 1020 // *Avail.ServerResponse.Header or (if a response was returned at all) 1021 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1022 // check whether the returned error was because http.StatusNotModified 1023 // was returned. 1024 func (c *AccountsAvailsGetCall) Do(opts ...googleapi.CallOption) (*Avail, error) { 1025 gensupport.SetOptions(c.urlParams_, opts...) 1026 res, err := c.doRequest("json") 1027 if res != nil && res.StatusCode == http.StatusNotModified { 1028 if res.Body != nil { 1029 res.Body.Close() 1030 } 1031 return nil, &googleapi.Error{ 1032 Code: res.StatusCode, 1033 Header: res.Header, 1034 } 1035 } 1036 if err != nil { 1037 return nil, err 1038 } 1039 defer googleapi.CloseBody(res) 1040 if err := googleapi.CheckResponse(res); err != nil { 1041 return nil, err 1042 } 1043 ret := &Avail{ 1044 ServerResponse: googleapi.ServerResponse{ 1045 Header: res.Header, 1046 HTTPStatusCode: res.StatusCode, 1047 }, 1048 } 1049 target := &ret 1050 if err := gensupport.DecodeResponse(target, res); err != nil { 1051 return nil, err 1052 } 1053 return ret, nil 1054 // { 1055 // "description": "Get an Avail given its avail group id and avail id.", 1056 // "flatPath": "v1/accounts/{accountId}/avails/{availId}", 1057 // "httpMethod": "GET", 1058 // "id": "playmoviespartner.accounts.avails.get", 1059 // "parameterOrder": [ 1060 // "accountId", 1061 // "availId" 1062 // ], 1063 // "parameters": { 1064 // "accountId": { 1065 // "description": "REQUIRED. See _General rules_ for more information about this field.", 1066 // "location": "path", 1067 // "required": true, 1068 // "type": "string" 1069 // }, 1070 // "availId": { 1071 // "description": "REQUIRED. Avail ID.", 1072 // "location": "path", 1073 // "required": true, 1074 // "type": "string" 1075 // } 1076 // }, 1077 // "path": "v1/accounts/{accountId}/avails/{availId}", 1078 // "response": { 1079 // "$ref": "Avail" 1080 // }, 1081 // "scopes": [ 1082 // "https://www.googleapis.com/auth/playmovies_partner.readonly" 1083 // ] 1084 // } 1085 1086 } 1087 1088 // method id "playmoviespartner.accounts.avails.list": 1089 1090 type AccountsAvailsListCall struct { 1091 s *Service 1092 accountId string 1093 urlParams_ gensupport.URLParams 1094 ifNoneMatch_ string 1095 ctx_ context.Context 1096 header_ http.Header 1097 } 1098 1099 // List: List Avails owned or managed by the partner. 1100 // 1101 // See _Authentication and Authorization rules_ and 1102 // _List methods rules_ for more information about this method. 1103 func (r *AccountsAvailsService) List(accountId string) *AccountsAvailsListCall { 1104 c := &AccountsAvailsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1105 c.accountId = accountId 1106 return c 1107 } 1108 1109 // AltId sets the optional parameter "altId": Filter Avails that match a 1110 // case-insensitive, partner-specific custom id. 1111 // NOTE: this field is deprecated and will be removed on V2; 1112 // `alt_ids` 1113 // should be used instead. 1114 func (c *AccountsAvailsListCall) AltId(altId string) *AccountsAvailsListCall { 1115 c.urlParams_.Set("altId", altId) 1116 return c 1117 } 1118 1119 // AltIds sets the optional parameter "altIds": Filter Avails that match 1120 // (case-insensitive) any of the given partner-specific custom ids. 1121 func (c *AccountsAvailsListCall) AltIds(altIds ...string) *AccountsAvailsListCall { 1122 c.urlParams_.SetMulti("altIds", append([]string{}, altIds...)) 1123 return c 1124 } 1125 1126 // PageSize sets the optional parameter "pageSize": See _List methods 1127 // rules_ for info about this field. 1128 func (c *AccountsAvailsListCall) PageSize(pageSize int64) *AccountsAvailsListCall { 1129 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1130 return c 1131 } 1132 1133 // PageToken sets the optional parameter "pageToken": See _List methods 1134 // rules_ for info about this field. 1135 func (c *AccountsAvailsListCall) PageToken(pageToken string) *AccountsAvailsListCall { 1136 c.urlParams_.Set("pageToken", pageToken) 1137 return c 1138 } 1139 1140 // PphNames sets the optional parameter "pphNames": See _List methods 1141 // rules_ for info about this field. 1142 func (c *AccountsAvailsListCall) PphNames(pphNames ...string) *AccountsAvailsListCall { 1143 c.urlParams_.SetMulti("pphNames", append([]string{}, pphNames...)) 1144 return c 1145 } 1146 1147 // StudioNames sets the optional parameter "studioNames": See _List 1148 // methods rules_ for info about this field. 1149 func (c *AccountsAvailsListCall) StudioNames(studioNames ...string) *AccountsAvailsListCall { 1150 c.urlParams_.SetMulti("studioNames", append([]string{}, studioNames...)) 1151 return c 1152 } 1153 1154 // Territories sets the optional parameter "territories": Filter Avails 1155 // that match (case-insensitive) any of the given country codes, 1156 // using the "ISO 3166-1 alpha-2" format (examples: "US", "us", "Us"). 1157 func (c *AccountsAvailsListCall) Territories(territories ...string) *AccountsAvailsListCall { 1158 c.urlParams_.SetMulti("territories", append([]string{}, territories...)) 1159 return c 1160 } 1161 1162 // Title sets the optional parameter "title": Filter that matches Avails 1163 // with a `title_internal_alias`, 1164 // `series_title_internal_alias`, `season_title_internal_alias`, 1165 // or `episode_title_internal_alias` that contains the 1166 // given 1167 // case-insensitive title. 1168 func (c *AccountsAvailsListCall) Title(title string) *AccountsAvailsListCall { 1169 c.urlParams_.Set("title", title) 1170 return c 1171 } 1172 1173 // VideoIds sets the optional parameter "videoIds": Filter Avails that 1174 // match any of the given `video_id`s. 1175 func (c *AccountsAvailsListCall) VideoIds(videoIds ...string) *AccountsAvailsListCall { 1176 c.urlParams_.SetMulti("videoIds", append([]string{}, videoIds...)) 1177 return c 1178 } 1179 1180 // Fields allows partial responses to be retrieved. See 1181 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1182 // for more information. 1183 func (c *AccountsAvailsListCall) Fields(s ...googleapi.Field) *AccountsAvailsListCall { 1184 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1185 return c 1186 } 1187 1188 // IfNoneMatch sets the optional parameter which makes the operation 1189 // fail if the object's ETag matches the given value. This is useful for 1190 // getting updates only after the object has changed since the last 1191 // request. Use googleapi.IsNotModified to check whether the response 1192 // error from Do is the result of In-None-Match. 1193 func (c *AccountsAvailsListCall) IfNoneMatch(entityTag string) *AccountsAvailsListCall { 1194 c.ifNoneMatch_ = entityTag 1195 return c 1196 } 1197 1198 // Context sets the context to be used in this call's Do method. Any 1199 // pending HTTP request will be aborted if the provided context is 1200 // canceled. 1201 func (c *AccountsAvailsListCall) Context(ctx context.Context) *AccountsAvailsListCall { 1202 c.ctx_ = ctx 1203 return c 1204 } 1205 1206 // Header returns an http.Header that can be modified by the caller to 1207 // add HTTP headers to the request. 1208 func (c *AccountsAvailsListCall) Header() http.Header { 1209 if c.header_ == nil { 1210 c.header_ = make(http.Header) 1211 } 1212 return c.header_ 1213 } 1214 1215 func (c *AccountsAvailsListCall) doRequest(alt string) (*http.Response, error) { 1216 reqHeaders := make(http.Header) 1217 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 1218 for k, v := range c.header_ { 1219 reqHeaders[k] = v 1220 } 1221 reqHeaders.Set("User-Agent", c.s.userAgent()) 1222 if c.ifNoneMatch_ != "" { 1223 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1224 } 1225 var body io.Reader = nil 1226 c.urlParams_.Set("alt", alt) 1227 c.urlParams_.Set("prettyPrint", "false") 1228 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/avails") 1229 urls += "?" + c.urlParams_.Encode() 1230 req, err := http.NewRequest("GET", urls, body) 1231 if err != nil { 1232 return nil, err 1233 } 1234 req.Header = reqHeaders 1235 googleapi.Expand(req.URL, map[string]string{ 1236 "accountId": c.accountId, 1237 }) 1238 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1239 } 1240 1241 // Do executes the "playmoviespartner.accounts.avails.list" call. 1242 // Exactly one of *ListAvailsResponse or error will be non-nil. Any 1243 // non-2xx status code is an error. Response headers are in either 1244 // *ListAvailsResponse.ServerResponse.Header or (if a response was 1245 // returned at all) in error.(*googleapi.Error).Header. Use 1246 // googleapi.IsNotModified to check whether the returned error was 1247 // because http.StatusNotModified was returned. 1248 func (c *AccountsAvailsListCall) Do(opts ...googleapi.CallOption) (*ListAvailsResponse, error) { 1249 gensupport.SetOptions(c.urlParams_, opts...) 1250 res, err := c.doRequest("json") 1251 if res != nil && res.StatusCode == http.StatusNotModified { 1252 if res.Body != nil { 1253 res.Body.Close() 1254 } 1255 return nil, &googleapi.Error{ 1256 Code: res.StatusCode, 1257 Header: res.Header, 1258 } 1259 } 1260 if err != nil { 1261 return nil, err 1262 } 1263 defer googleapi.CloseBody(res) 1264 if err := googleapi.CheckResponse(res); err != nil { 1265 return nil, err 1266 } 1267 ret := &ListAvailsResponse{ 1268 ServerResponse: googleapi.ServerResponse{ 1269 Header: res.Header, 1270 HTTPStatusCode: res.StatusCode, 1271 }, 1272 } 1273 target := &ret 1274 if err := gensupport.DecodeResponse(target, res); err != nil { 1275 return nil, err 1276 } 1277 return ret, nil 1278 // { 1279 // "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.", 1280 // "flatPath": "v1/accounts/{accountId}/avails", 1281 // "httpMethod": "GET", 1282 // "id": "playmoviespartner.accounts.avails.list", 1283 // "parameterOrder": [ 1284 // "accountId" 1285 // ], 1286 // "parameters": { 1287 // "accountId": { 1288 // "description": "REQUIRED. See _General rules_ for more information about this field.", 1289 // "location": "path", 1290 // "required": true, 1291 // "type": "string" 1292 // }, 1293 // "altId": { 1294 // "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.", 1295 // "location": "query", 1296 // "type": "string" 1297 // }, 1298 // "altIds": { 1299 // "description": "Filter Avails that match (case-insensitive) any of the given partner-specific custom ids.", 1300 // "location": "query", 1301 // "repeated": true, 1302 // "type": "string" 1303 // }, 1304 // "pageSize": { 1305 // "description": "See _List methods rules_ for info about this field.", 1306 // "format": "int32", 1307 // "location": "query", 1308 // "type": "integer" 1309 // }, 1310 // "pageToken": { 1311 // "description": "See _List methods rules_ for info about this field.", 1312 // "location": "query", 1313 // "type": "string" 1314 // }, 1315 // "pphNames": { 1316 // "description": "See _List methods rules_ for info about this field.", 1317 // "location": "query", 1318 // "repeated": true, 1319 // "type": "string" 1320 // }, 1321 // "studioNames": { 1322 // "description": "See _List methods rules_ for info about this field.", 1323 // "location": "query", 1324 // "repeated": true, 1325 // "type": "string" 1326 // }, 1327 // "territories": { 1328 // "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\").", 1329 // "location": "query", 1330 // "repeated": true, 1331 // "type": "string" 1332 // }, 1333 // "title": { 1334 // "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.", 1335 // "location": "query", 1336 // "type": "string" 1337 // }, 1338 // "videoIds": { 1339 // "description": "Filter Avails that match any of the given `video_id`s.", 1340 // "location": "query", 1341 // "repeated": true, 1342 // "type": "string" 1343 // } 1344 // }, 1345 // "path": "v1/accounts/{accountId}/avails", 1346 // "response": { 1347 // "$ref": "ListAvailsResponse" 1348 // }, 1349 // "scopes": [ 1350 // "https://www.googleapis.com/auth/playmovies_partner.readonly" 1351 // ] 1352 // } 1353 1354 } 1355 1356 // Pages invokes f for each page of results. 1357 // A non-nil error returned from f will halt the iteration. 1358 // The provided context supersedes any context provided to the Context method. 1359 func (c *AccountsAvailsListCall) Pages(ctx context.Context, f func(*ListAvailsResponse) error) error { 1360 c.ctx_ = ctx 1361 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1362 for { 1363 x, err := c.Do() 1364 if err != nil { 1365 return err 1366 } 1367 if err := f(x); err != nil { 1368 return err 1369 } 1370 if x.NextPageToken == "" { 1371 return nil 1372 } 1373 c.PageToken(x.NextPageToken) 1374 } 1375 } 1376 1377 // method id "playmoviespartner.accounts.orders.get": 1378 1379 type AccountsOrdersGetCall struct { 1380 s *Service 1381 accountId string 1382 orderId string 1383 urlParams_ gensupport.URLParams 1384 ifNoneMatch_ string 1385 ctx_ context.Context 1386 header_ http.Header 1387 } 1388 1389 // Get: Get an Order given its id. 1390 // 1391 // See _Authentication and Authorization rules_ and 1392 // _Get methods rules_ for more information about this method. 1393 func (r *AccountsOrdersService) Get(accountId string, orderId string) *AccountsOrdersGetCall { 1394 c := &AccountsOrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1395 c.accountId = accountId 1396 c.orderId = orderId 1397 return c 1398 } 1399 1400 // Fields allows partial responses to be retrieved. See 1401 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1402 // for more information. 1403 func (c *AccountsOrdersGetCall) Fields(s ...googleapi.Field) *AccountsOrdersGetCall { 1404 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1405 return c 1406 } 1407 1408 // IfNoneMatch sets the optional parameter which makes the operation 1409 // fail if the object's ETag matches the given value. This is useful for 1410 // getting updates only after the object has changed since the last 1411 // request. Use googleapi.IsNotModified to check whether the response 1412 // error from Do is the result of In-None-Match. 1413 func (c *AccountsOrdersGetCall) IfNoneMatch(entityTag string) *AccountsOrdersGetCall { 1414 c.ifNoneMatch_ = entityTag 1415 return c 1416 } 1417 1418 // Context sets the context to be used in this call's Do method. Any 1419 // pending HTTP request will be aborted if the provided context is 1420 // canceled. 1421 func (c *AccountsOrdersGetCall) Context(ctx context.Context) *AccountsOrdersGetCall { 1422 c.ctx_ = ctx 1423 return c 1424 } 1425 1426 // Header returns an http.Header that can be modified by the caller to 1427 // add HTTP headers to the request. 1428 func (c *AccountsOrdersGetCall) Header() http.Header { 1429 if c.header_ == nil { 1430 c.header_ = make(http.Header) 1431 } 1432 return c.header_ 1433 } 1434 1435 func (c *AccountsOrdersGetCall) doRequest(alt string) (*http.Response, error) { 1436 reqHeaders := make(http.Header) 1437 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 1438 for k, v := range c.header_ { 1439 reqHeaders[k] = v 1440 } 1441 reqHeaders.Set("User-Agent", c.s.userAgent()) 1442 if c.ifNoneMatch_ != "" { 1443 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1444 } 1445 var body io.Reader = nil 1446 c.urlParams_.Set("alt", alt) 1447 c.urlParams_.Set("prettyPrint", "false") 1448 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/orders/{orderId}") 1449 urls += "?" + c.urlParams_.Encode() 1450 req, err := http.NewRequest("GET", urls, body) 1451 if err != nil { 1452 return nil, err 1453 } 1454 req.Header = reqHeaders 1455 googleapi.Expand(req.URL, map[string]string{ 1456 "accountId": c.accountId, 1457 "orderId": c.orderId, 1458 }) 1459 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1460 } 1461 1462 // Do executes the "playmoviespartner.accounts.orders.get" call. 1463 // Exactly one of *Order or error will be non-nil. Any non-2xx status 1464 // code is an error. Response headers are in either 1465 // *Order.ServerResponse.Header or (if a response was returned at all) 1466 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 1467 // check whether the returned error was because http.StatusNotModified 1468 // was returned. 1469 func (c *AccountsOrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) { 1470 gensupport.SetOptions(c.urlParams_, opts...) 1471 res, err := c.doRequest("json") 1472 if res != nil && res.StatusCode == http.StatusNotModified { 1473 if res.Body != nil { 1474 res.Body.Close() 1475 } 1476 return nil, &googleapi.Error{ 1477 Code: res.StatusCode, 1478 Header: res.Header, 1479 } 1480 } 1481 if err != nil { 1482 return nil, err 1483 } 1484 defer googleapi.CloseBody(res) 1485 if err := googleapi.CheckResponse(res); err != nil { 1486 return nil, err 1487 } 1488 ret := &Order{ 1489 ServerResponse: googleapi.ServerResponse{ 1490 Header: res.Header, 1491 HTTPStatusCode: res.StatusCode, 1492 }, 1493 } 1494 target := &ret 1495 if err := gensupport.DecodeResponse(target, res); err != nil { 1496 return nil, err 1497 } 1498 return ret, nil 1499 // { 1500 // "description": "Get an Order given its id.\n\nSee _Authentication and Authorization rules_ and\n_Get methods rules_ for more information about this method.", 1501 // "flatPath": "v1/accounts/{accountId}/orders/{orderId}", 1502 // "httpMethod": "GET", 1503 // "id": "playmoviespartner.accounts.orders.get", 1504 // "parameterOrder": [ 1505 // "accountId", 1506 // "orderId" 1507 // ], 1508 // "parameters": { 1509 // "accountId": { 1510 // "description": "REQUIRED. See _General rules_ for more information about this field.", 1511 // "location": "path", 1512 // "required": true, 1513 // "type": "string" 1514 // }, 1515 // "orderId": { 1516 // "description": "REQUIRED. Order ID.", 1517 // "location": "path", 1518 // "required": true, 1519 // "type": "string" 1520 // } 1521 // }, 1522 // "path": "v1/accounts/{accountId}/orders/{orderId}", 1523 // "response": { 1524 // "$ref": "Order" 1525 // }, 1526 // "scopes": [ 1527 // "https://www.googleapis.com/auth/playmovies_partner.readonly" 1528 // ] 1529 // } 1530 1531 } 1532 1533 // method id "playmoviespartner.accounts.orders.list": 1534 1535 type AccountsOrdersListCall struct { 1536 s *Service 1537 accountId string 1538 urlParams_ gensupport.URLParams 1539 ifNoneMatch_ string 1540 ctx_ context.Context 1541 header_ http.Header 1542 } 1543 1544 // List: List Orders owned or managed by the partner. 1545 // 1546 // See _Authentication and Authorization rules_ and 1547 // _List methods rules_ for more information about this method. 1548 func (r *AccountsOrdersService) List(accountId string) *AccountsOrdersListCall { 1549 c := &AccountsOrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1550 c.accountId = accountId 1551 return c 1552 } 1553 1554 // CustomId sets the optional parameter "customId": Filter Orders that 1555 // match a case-insensitive, partner-specific custom id. 1556 func (c *AccountsOrdersListCall) CustomId(customId string) *AccountsOrdersListCall { 1557 c.urlParams_.Set("customId", customId) 1558 return c 1559 } 1560 1561 // Name sets the optional parameter "name": Filter that matches Orders 1562 // with a `name`, `show`, `season` or `episode` 1563 // that contains the given case-insensitive name. 1564 func (c *AccountsOrdersListCall) Name(name string) *AccountsOrdersListCall { 1565 c.urlParams_.Set("name", name) 1566 return c 1567 } 1568 1569 // PageSize sets the optional parameter "pageSize": See _List methods 1570 // rules_ for info about this field. 1571 func (c *AccountsOrdersListCall) PageSize(pageSize int64) *AccountsOrdersListCall { 1572 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1573 return c 1574 } 1575 1576 // PageToken sets the optional parameter "pageToken": See _List methods 1577 // rules_ for info about this field. 1578 func (c *AccountsOrdersListCall) PageToken(pageToken string) *AccountsOrdersListCall { 1579 c.urlParams_.Set("pageToken", pageToken) 1580 return c 1581 } 1582 1583 // PphNames sets the optional parameter "pphNames": See _List methods 1584 // rules_ for info about this field. 1585 func (c *AccountsOrdersListCall) PphNames(pphNames ...string) *AccountsOrdersListCall { 1586 c.urlParams_.SetMulti("pphNames", append([]string{}, pphNames...)) 1587 return c 1588 } 1589 1590 // Status sets the optional parameter "status": Filter Orders that match 1591 // one of the given status. 1592 // 1593 // Possible values: 1594 // 1595 // "STATUS_UNSPECIFIED" 1596 // "STATUS_APPROVED" 1597 // "STATUS_FAILED" 1598 // "STATUS_PROCESSING" 1599 // "STATUS_UNFULFILLED" 1600 // "STATUS_NOT_AVAILABLE" 1601 func (c *AccountsOrdersListCall) Status(status ...string) *AccountsOrdersListCall { 1602 c.urlParams_.SetMulti("status", append([]string{}, status...)) 1603 return c 1604 } 1605 1606 // StudioNames sets the optional parameter "studioNames": See _List 1607 // methods rules_ for info about this field. 1608 func (c *AccountsOrdersListCall) StudioNames(studioNames ...string) *AccountsOrdersListCall { 1609 c.urlParams_.SetMulti("studioNames", append([]string{}, studioNames...)) 1610 return c 1611 } 1612 1613 // VideoIds sets the optional parameter "videoIds": Filter Orders that 1614 // match any of the given `video_id`s. 1615 func (c *AccountsOrdersListCall) VideoIds(videoIds ...string) *AccountsOrdersListCall { 1616 c.urlParams_.SetMulti("videoIds", append([]string{}, videoIds...)) 1617 return c 1618 } 1619 1620 // Fields allows partial responses to be retrieved. See 1621 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1622 // for more information. 1623 func (c *AccountsOrdersListCall) Fields(s ...googleapi.Field) *AccountsOrdersListCall { 1624 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1625 return c 1626 } 1627 1628 // IfNoneMatch sets the optional parameter which makes the operation 1629 // fail if the object's ETag matches the given value. This is useful for 1630 // getting updates only after the object has changed since the last 1631 // request. Use googleapi.IsNotModified to check whether the response 1632 // error from Do is the result of In-None-Match. 1633 func (c *AccountsOrdersListCall) IfNoneMatch(entityTag string) *AccountsOrdersListCall { 1634 c.ifNoneMatch_ = entityTag 1635 return c 1636 } 1637 1638 // Context sets the context to be used in this call's Do method. Any 1639 // pending HTTP request will be aborted if the provided context is 1640 // canceled. 1641 func (c *AccountsOrdersListCall) Context(ctx context.Context) *AccountsOrdersListCall { 1642 c.ctx_ = ctx 1643 return c 1644 } 1645 1646 // Header returns an http.Header that can be modified by the caller to 1647 // add HTTP headers to the request. 1648 func (c *AccountsOrdersListCall) Header() http.Header { 1649 if c.header_ == nil { 1650 c.header_ = make(http.Header) 1651 } 1652 return c.header_ 1653 } 1654 1655 func (c *AccountsOrdersListCall) doRequest(alt string) (*http.Response, error) { 1656 reqHeaders := make(http.Header) 1657 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 1658 for k, v := range c.header_ { 1659 reqHeaders[k] = v 1660 } 1661 reqHeaders.Set("User-Agent", c.s.userAgent()) 1662 if c.ifNoneMatch_ != "" { 1663 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1664 } 1665 var body io.Reader = nil 1666 c.urlParams_.Set("alt", alt) 1667 c.urlParams_.Set("prettyPrint", "false") 1668 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/orders") 1669 urls += "?" + c.urlParams_.Encode() 1670 req, err := http.NewRequest("GET", urls, body) 1671 if err != nil { 1672 return nil, err 1673 } 1674 req.Header = reqHeaders 1675 googleapi.Expand(req.URL, map[string]string{ 1676 "accountId": c.accountId, 1677 }) 1678 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1679 } 1680 1681 // Do executes the "playmoviespartner.accounts.orders.list" call. 1682 // Exactly one of *ListOrdersResponse or error will be non-nil. Any 1683 // non-2xx status code is an error. Response headers are in either 1684 // *ListOrdersResponse.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 *AccountsOrdersListCall) Do(opts ...googleapi.CallOption) (*ListOrdersResponse, 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 := &ListOrdersResponse{ 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 Orders 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}/orders", 1721 // "httpMethod": "GET", 1722 // "id": "playmoviespartner.accounts.orders.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 // "customId": { 1734 // "description": "Filter Orders that match a case-insensitive, partner-specific custom id.", 1735 // "location": "query", 1736 // "type": "string" 1737 // }, 1738 // "name": { 1739 // "description": "Filter that matches Orders with a `name`, `show`, `season` or `episode`\nthat contains the given case-insensitive name.", 1740 // "location": "query", 1741 // "type": "string" 1742 // }, 1743 // "pageSize": { 1744 // "description": "See _List methods rules_ for info about this field.", 1745 // "format": "int32", 1746 // "location": "query", 1747 // "type": "integer" 1748 // }, 1749 // "pageToken": { 1750 // "description": "See _List methods rules_ for info about this field.", 1751 // "location": "query", 1752 // "type": "string" 1753 // }, 1754 // "pphNames": { 1755 // "description": "See _List methods rules_ for info about this field.", 1756 // "location": "query", 1757 // "repeated": true, 1758 // "type": "string" 1759 // }, 1760 // "status": { 1761 // "description": "Filter Orders that match one of the given status.", 1762 // "enum": [ 1763 // "STATUS_UNSPECIFIED", 1764 // "STATUS_APPROVED", 1765 // "STATUS_FAILED", 1766 // "STATUS_PROCESSING", 1767 // "STATUS_UNFULFILLED", 1768 // "STATUS_NOT_AVAILABLE" 1769 // ], 1770 // "location": "query", 1771 // "repeated": true, 1772 // "type": "string" 1773 // }, 1774 // "studioNames": { 1775 // "description": "See _List methods rules_ for info about this field.", 1776 // "location": "query", 1777 // "repeated": true, 1778 // "type": "string" 1779 // }, 1780 // "videoIds": { 1781 // "description": "Filter Orders that match any of the given `video_id`s.", 1782 // "location": "query", 1783 // "repeated": true, 1784 // "type": "string" 1785 // } 1786 // }, 1787 // "path": "v1/accounts/{accountId}/orders", 1788 // "response": { 1789 // "$ref": "ListOrdersResponse" 1790 // }, 1791 // "scopes": [ 1792 // "https://www.googleapis.com/auth/playmovies_partner.readonly" 1793 // ] 1794 // } 1795 1796 } 1797 1798 // Pages invokes f for each page of results. 1799 // A non-nil error returned from f will halt the iteration. 1800 // The provided context supersedes any context provided to the Context method. 1801 func (c *AccountsOrdersListCall) Pages(ctx context.Context, f func(*ListOrdersResponse) error) error { 1802 c.ctx_ = ctx 1803 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 1804 for { 1805 x, err := c.Do() 1806 if err != nil { 1807 return err 1808 } 1809 if err := f(x); err != nil { 1810 return err 1811 } 1812 if x.NextPageToken == "" { 1813 return nil 1814 } 1815 c.PageToken(x.NextPageToken) 1816 } 1817 } 1818 1819 // method id "playmoviespartner.accounts.storeInfos.list": 1820 1821 type AccountsStoreInfosListCall struct { 1822 s *Service 1823 accountId string 1824 urlParams_ gensupport.URLParams 1825 ifNoneMatch_ string 1826 ctx_ context.Context 1827 header_ http.Header 1828 } 1829 1830 // List: List StoreInfos owned or managed by the partner. 1831 // 1832 // See _Authentication and Authorization rules_ and 1833 // _List methods rules_ for more information about this method. 1834 func (r *AccountsStoreInfosService) List(accountId string) *AccountsStoreInfosListCall { 1835 c := &AccountsStoreInfosListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1836 c.accountId = accountId 1837 return c 1838 } 1839 1840 // Countries sets the optional parameter "countries": Filter StoreInfos 1841 // that match (case-insensitive) any of the given country 1842 // codes, using the "ISO 3166-1 alpha-2" format (examples: "US", "us", 1843 // "Us"). 1844 func (c *AccountsStoreInfosListCall) Countries(countries ...string) *AccountsStoreInfosListCall { 1845 c.urlParams_.SetMulti("countries", append([]string{}, countries...)) 1846 return c 1847 } 1848 1849 // Mids sets the optional parameter "mids": Filter StoreInfos that match 1850 // any of the given `mid`s. 1851 func (c *AccountsStoreInfosListCall) Mids(mids ...string) *AccountsStoreInfosListCall { 1852 c.urlParams_.SetMulti("mids", append([]string{}, mids...)) 1853 return c 1854 } 1855 1856 // Name sets the optional parameter "name": Filter that matches 1857 // StoreInfos with a `name` or `show_name` 1858 // that contains the given case-insensitive name. 1859 func (c *AccountsStoreInfosListCall) Name(name string) *AccountsStoreInfosListCall { 1860 c.urlParams_.Set("name", name) 1861 return c 1862 } 1863 1864 // PageSize sets the optional parameter "pageSize": See _List methods 1865 // rules_ for info about this field. 1866 func (c *AccountsStoreInfosListCall) PageSize(pageSize int64) *AccountsStoreInfosListCall { 1867 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 1868 return c 1869 } 1870 1871 // PageToken sets the optional parameter "pageToken": See _List methods 1872 // rules_ for info about this field. 1873 func (c *AccountsStoreInfosListCall) PageToken(pageToken string) *AccountsStoreInfosListCall { 1874 c.urlParams_.Set("pageToken", pageToken) 1875 return c 1876 } 1877 1878 // PphNames sets the optional parameter "pphNames": See _List methods 1879 // rules_ for info about this field. 1880 func (c *AccountsStoreInfosListCall) PphNames(pphNames ...string) *AccountsStoreInfosListCall { 1881 c.urlParams_.SetMulti("pphNames", append([]string{}, pphNames...)) 1882 return c 1883 } 1884 1885 // SeasonIds sets the optional parameter "seasonIds": Filter StoreInfos 1886 // that match any of the given `season_id`s. 1887 func (c *AccountsStoreInfosListCall) SeasonIds(seasonIds ...string) *AccountsStoreInfosListCall { 1888 c.urlParams_.SetMulti("seasonIds", append([]string{}, seasonIds...)) 1889 return c 1890 } 1891 1892 // StudioNames sets the optional parameter "studioNames": See _List 1893 // methods rules_ for info about this field. 1894 func (c *AccountsStoreInfosListCall) StudioNames(studioNames ...string) *AccountsStoreInfosListCall { 1895 c.urlParams_.SetMulti("studioNames", append([]string{}, studioNames...)) 1896 return c 1897 } 1898 1899 // VideoId sets the optional parameter "videoId": Filter StoreInfos that 1900 // match a given `video_id`. 1901 // NOTE: this field is deprecated and will be removed on V2; 1902 // `video_ids` 1903 // should be used instead. 1904 func (c *AccountsStoreInfosListCall) VideoId(videoId string) *AccountsStoreInfosListCall { 1905 c.urlParams_.Set("videoId", videoId) 1906 return c 1907 } 1908 1909 // VideoIds sets the optional parameter "videoIds": Filter StoreInfos 1910 // that match any of the given `video_id`s. 1911 func (c *AccountsStoreInfosListCall) VideoIds(videoIds ...string) *AccountsStoreInfosListCall { 1912 c.urlParams_.SetMulti("videoIds", append([]string{}, videoIds...)) 1913 return c 1914 } 1915 1916 // Fields allows partial responses to be retrieved. See 1917 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1918 // for more information. 1919 func (c *AccountsStoreInfosListCall) Fields(s ...googleapi.Field) *AccountsStoreInfosListCall { 1920 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 1921 return c 1922 } 1923 1924 // IfNoneMatch sets the optional parameter which makes the operation 1925 // fail if the object's ETag matches the given value. This is useful for 1926 // getting updates only after the object has changed since the last 1927 // request. Use googleapi.IsNotModified to check whether the response 1928 // error from Do is the result of In-None-Match. 1929 func (c *AccountsStoreInfosListCall) IfNoneMatch(entityTag string) *AccountsStoreInfosListCall { 1930 c.ifNoneMatch_ = entityTag 1931 return c 1932 } 1933 1934 // Context sets the context to be used in this call's Do method. Any 1935 // pending HTTP request will be aborted if the provided context is 1936 // canceled. 1937 func (c *AccountsStoreInfosListCall) Context(ctx context.Context) *AccountsStoreInfosListCall { 1938 c.ctx_ = ctx 1939 return c 1940 } 1941 1942 // Header returns an http.Header that can be modified by the caller to 1943 // add HTTP headers to the request. 1944 func (c *AccountsStoreInfosListCall) Header() http.Header { 1945 if c.header_ == nil { 1946 c.header_ = make(http.Header) 1947 } 1948 return c.header_ 1949 } 1950 1951 func (c *AccountsStoreInfosListCall) doRequest(alt string) (*http.Response, error) { 1952 reqHeaders := make(http.Header) 1953 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 1954 for k, v := range c.header_ { 1955 reqHeaders[k] = v 1956 } 1957 reqHeaders.Set("User-Agent", c.s.userAgent()) 1958 if c.ifNoneMatch_ != "" { 1959 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 1960 } 1961 var body io.Reader = nil 1962 c.urlParams_.Set("alt", alt) 1963 c.urlParams_.Set("prettyPrint", "false") 1964 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/storeInfos") 1965 urls += "?" + c.urlParams_.Encode() 1966 req, err := http.NewRequest("GET", urls, body) 1967 if err != nil { 1968 return nil, err 1969 } 1970 req.Header = reqHeaders 1971 googleapi.Expand(req.URL, map[string]string{ 1972 "accountId": c.accountId, 1973 }) 1974 return gensupport.SendRequest(c.ctx_, c.s.client, req) 1975 } 1976 1977 // Do executes the "playmoviespartner.accounts.storeInfos.list" call. 1978 // Exactly one of *ListStoreInfosResponse or error will be non-nil. Any 1979 // non-2xx status code is an error. Response headers are in either 1980 // *ListStoreInfosResponse.ServerResponse.Header or (if a response was 1981 // returned at all) in error.(*googleapi.Error).Header. Use 1982 // googleapi.IsNotModified to check whether the returned error was 1983 // because http.StatusNotModified was returned. 1984 func (c *AccountsStoreInfosListCall) Do(opts ...googleapi.CallOption) (*ListStoreInfosResponse, error) { 1985 gensupport.SetOptions(c.urlParams_, opts...) 1986 res, err := c.doRequest("json") 1987 if res != nil && res.StatusCode == http.StatusNotModified { 1988 if res.Body != nil { 1989 res.Body.Close() 1990 } 1991 return nil, &googleapi.Error{ 1992 Code: res.StatusCode, 1993 Header: res.Header, 1994 } 1995 } 1996 if err != nil { 1997 return nil, err 1998 } 1999 defer googleapi.CloseBody(res) 2000 if err := googleapi.CheckResponse(res); err != nil { 2001 return nil, err 2002 } 2003 ret := &ListStoreInfosResponse{ 2004 ServerResponse: googleapi.ServerResponse{ 2005 Header: res.Header, 2006 HTTPStatusCode: res.StatusCode, 2007 }, 2008 } 2009 target := &ret 2010 if err := gensupport.DecodeResponse(target, res); err != nil { 2011 return nil, err 2012 } 2013 return ret, nil 2014 // { 2015 // "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.", 2016 // "flatPath": "v1/accounts/{accountId}/storeInfos", 2017 // "httpMethod": "GET", 2018 // "id": "playmoviespartner.accounts.storeInfos.list", 2019 // "parameterOrder": [ 2020 // "accountId" 2021 // ], 2022 // "parameters": { 2023 // "accountId": { 2024 // "description": "REQUIRED. See _General rules_ for more information about this field.", 2025 // "location": "path", 2026 // "required": true, 2027 // "type": "string" 2028 // }, 2029 // "countries": { 2030 // "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\").", 2031 // "location": "query", 2032 // "repeated": true, 2033 // "type": "string" 2034 // }, 2035 // "mids": { 2036 // "description": "Filter StoreInfos that match any of the given `mid`s.", 2037 // "location": "query", 2038 // "repeated": true, 2039 // "type": "string" 2040 // }, 2041 // "name": { 2042 // "description": "Filter that matches StoreInfos with a `name` or `show_name`\nthat contains the given case-insensitive name.", 2043 // "location": "query", 2044 // "type": "string" 2045 // }, 2046 // "pageSize": { 2047 // "description": "See _List methods rules_ for info about this field.", 2048 // "format": "int32", 2049 // "location": "query", 2050 // "type": "integer" 2051 // }, 2052 // "pageToken": { 2053 // "description": "See _List methods rules_ for info about this field.", 2054 // "location": "query", 2055 // "type": "string" 2056 // }, 2057 // "pphNames": { 2058 // "description": "See _List methods rules_ for info about this field.", 2059 // "location": "query", 2060 // "repeated": true, 2061 // "type": "string" 2062 // }, 2063 // "seasonIds": { 2064 // "description": "Filter StoreInfos that match any of the given `season_id`s.", 2065 // "location": "query", 2066 // "repeated": true, 2067 // "type": "string" 2068 // }, 2069 // "studioNames": { 2070 // "description": "See _List methods rules_ for info about this field.", 2071 // "location": "query", 2072 // "repeated": true, 2073 // "type": "string" 2074 // }, 2075 // "videoId": { 2076 // "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.", 2077 // "location": "query", 2078 // "type": "string" 2079 // }, 2080 // "videoIds": { 2081 // "description": "Filter StoreInfos that match any of the given `video_id`s.", 2082 // "location": "query", 2083 // "repeated": true, 2084 // "type": "string" 2085 // } 2086 // }, 2087 // "path": "v1/accounts/{accountId}/storeInfos", 2088 // "response": { 2089 // "$ref": "ListStoreInfosResponse" 2090 // }, 2091 // "scopes": [ 2092 // "https://www.googleapis.com/auth/playmovies_partner.readonly" 2093 // ] 2094 // } 2095 2096 } 2097 2098 // Pages invokes f for each page of results. 2099 // A non-nil error returned from f will halt the iteration. 2100 // The provided context supersedes any context provided to the Context method. 2101 func (c *AccountsStoreInfosListCall) Pages(ctx context.Context, f func(*ListStoreInfosResponse) error) error { 2102 c.ctx_ = ctx 2103 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 2104 for { 2105 x, err := c.Do() 2106 if err != nil { 2107 return err 2108 } 2109 if err := f(x); err != nil { 2110 return err 2111 } 2112 if x.NextPageToken == "" { 2113 return nil 2114 } 2115 c.PageToken(x.NextPageToken) 2116 } 2117 } 2118 2119 // method id "playmoviespartner.accounts.storeInfos.country.get": 2120 2121 type AccountsStoreInfosCountryGetCall struct { 2122 s *Service 2123 accountId string 2124 videoId string 2125 country string 2126 urlParams_ gensupport.URLParams 2127 ifNoneMatch_ string 2128 ctx_ context.Context 2129 header_ http.Header 2130 } 2131 2132 // Get: Get a StoreInfo given its video id and country. 2133 // 2134 // See _Authentication and Authorization rules_ and 2135 // _Get methods rules_ for more information about this method. 2136 func (r *AccountsStoreInfosCountryService) Get(accountId string, videoId string, country string) *AccountsStoreInfosCountryGetCall { 2137 c := &AccountsStoreInfosCountryGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2138 c.accountId = accountId 2139 c.videoId = videoId 2140 c.country = country 2141 return c 2142 } 2143 2144 // Fields allows partial responses to be retrieved. See 2145 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2146 // for more information. 2147 func (c *AccountsStoreInfosCountryGetCall) Fields(s ...googleapi.Field) *AccountsStoreInfosCountryGetCall { 2148 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2149 return c 2150 } 2151 2152 // IfNoneMatch sets the optional parameter which makes the operation 2153 // fail if the object's ETag matches the given value. This is useful for 2154 // getting updates only after the object has changed since the last 2155 // request. Use googleapi.IsNotModified to check whether the response 2156 // error from Do is the result of In-None-Match. 2157 func (c *AccountsStoreInfosCountryGetCall) IfNoneMatch(entityTag string) *AccountsStoreInfosCountryGetCall { 2158 c.ifNoneMatch_ = entityTag 2159 return c 2160 } 2161 2162 // Context sets the context to be used in this call's Do method. Any 2163 // pending HTTP request will be aborted if the provided context is 2164 // canceled. 2165 func (c *AccountsStoreInfosCountryGetCall) Context(ctx context.Context) *AccountsStoreInfosCountryGetCall { 2166 c.ctx_ = ctx 2167 return c 2168 } 2169 2170 // Header returns an http.Header that can be modified by the caller to 2171 // add HTTP headers to the request. 2172 func (c *AccountsStoreInfosCountryGetCall) Header() http.Header { 2173 if c.header_ == nil { 2174 c.header_ = make(http.Header) 2175 } 2176 return c.header_ 2177 } 2178 2179 func (c *AccountsStoreInfosCountryGetCall) doRequest(alt string) (*http.Response, error) { 2180 reqHeaders := make(http.Header) 2181 reqHeaders.Set("x-goog-api-client", "gl-go/1.13.7 gdcl/20200203") 2182 for k, v := range c.header_ { 2183 reqHeaders[k] = v 2184 } 2185 reqHeaders.Set("User-Agent", c.s.userAgent()) 2186 if c.ifNoneMatch_ != "" { 2187 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2188 } 2189 var body io.Reader = nil 2190 c.urlParams_.Set("alt", alt) 2191 c.urlParams_.Set("prettyPrint", "false") 2192 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}") 2193 urls += "?" + c.urlParams_.Encode() 2194 req, err := http.NewRequest("GET", urls, body) 2195 if err != nil { 2196 return nil, err 2197 } 2198 req.Header = reqHeaders 2199 googleapi.Expand(req.URL, map[string]string{ 2200 "accountId": c.accountId, 2201 "videoId": c.videoId, 2202 "country": c.country, 2203 }) 2204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2205 } 2206 2207 // Do executes the "playmoviespartner.accounts.storeInfos.country.get" call. 2208 // Exactly one of *StoreInfo or error will be non-nil. Any non-2xx 2209 // status code is an error. Response headers are in either 2210 // *StoreInfo.ServerResponse.Header or (if a response was returned at 2211 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2212 // to check whether the returned error was because 2213 // http.StatusNotModified was returned. 2214 func (c *AccountsStoreInfosCountryGetCall) Do(opts ...googleapi.CallOption) (*StoreInfo, error) { 2215 gensupport.SetOptions(c.urlParams_, opts...) 2216 res, err := c.doRequest("json") 2217 if res != nil && res.StatusCode == http.StatusNotModified { 2218 if res.Body != nil { 2219 res.Body.Close() 2220 } 2221 return nil, &googleapi.Error{ 2222 Code: res.StatusCode, 2223 Header: res.Header, 2224 } 2225 } 2226 if err != nil { 2227 return nil, err 2228 } 2229 defer googleapi.CloseBody(res) 2230 if err := googleapi.CheckResponse(res); err != nil { 2231 return nil, err 2232 } 2233 ret := &StoreInfo{ 2234 ServerResponse: googleapi.ServerResponse{ 2235 Header: res.Header, 2236 HTTPStatusCode: res.StatusCode, 2237 }, 2238 } 2239 target := &ret 2240 if err := gensupport.DecodeResponse(target, res); err != nil { 2241 return nil, err 2242 } 2243 return ret, nil 2244 // { 2245 // "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.", 2246 // "flatPath": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}", 2247 // "httpMethod": "GET", 2248 // "id": "playmoviespartner.accounts.storeInfos.country.get", 2249 // "parameterOrder": [ 2250 // "accountId", 2251 // "videoId", 2252 // "country" 2253 // ], 2254 // "parameters": { 2255 // "accountId": { 2256 // "description": "REQUIRED. See _General rules_ for more information about this field.", 2257 // "location": "path", 2258 // "required": true, 2259 // "type": "string" 2260 // }, 2261 // "country": { 2262 // "description": "REQUIRED. Edit country.", 2263 // "location": "path", 2264 // "required": true, 2265 // "type": "string" 2266 // }, 2267 // "videoId": { 2268 // "description": "REQUIRED. Video ID.", 2269 // "location": "path", 2270 // "required": true, 2271 // "type": "string" 2272 // } 2273 // }, 2274 // "path": "v1/accounts/{accountId}/storeInfos/{videoId}/country/{country}", 2275 // "response": { 2276 // "$ref": "StoreInfo" 2277 // }, 2278 // "scopes": [ 2279 // "https://www.googleapis.com/auth/playmovies_partner.readonly" 2280 // ] 2281 // } 2282 2283 } 2284