From 189a103ad2e47f5d9bcac65a517bb67798cf37d9 Mon Sep 17 00:00:00 2001 From: Nyah Check Date: Tue, 1 Aug 2017 15:45:14 -0600 Subject: [PATCH] Addev vendored packages. --- vendor/cloud.google.com/go/LICENSE | 202 + .../go/compute/metadata/metadata.go | 437 + vendor/golang.org/x/net/LICENSE | 27 + vendor/golang.org/x/net/PATENTS | 22 + vendor/golang.org/x/net/context/context.go | 54 + .../x/net/context/ctxhttp/ctxhttp.go | 74 + .../x/net/context/ctxhttp/ctxhttp_pre17.go | 147 + vendor/golang.org/x/net/context/go17.go | 72 + vendor/golang.org/x/net/context/go19.go | 20 + vendor/golang.org/x/net/context/pre_go17.go | 300 + vendor/golang.org/x/net/context/pre_go19.go | 109 + vendor/golang.org/x/oauth2/AUTHORS | 3 + vendor/golang.org/x/oauth2/CONTRIBUTING.md | 31 + vendor/golang.org/x/oauth2/CONTRIBUTORS | 3 + vendor/golang.org/x/oauth2/LICENSE | 27 + vendor/golang.org/x/oauth2/README.md | 77 + .../golang.org/x/oauth2/client_appengine.go | 25 + .../golang.org/x/oauth2/google/appengine.go | 89 + .../x/oauth2/google/appengine_hook.go | 14 + .../x/oauth2/google/appengineflex_hook.go | 11 + vendor/golang.org/x/oauth2/google/default.go | 130 + vendor/golang.org/x/oauth2/google/google.go | 202 + vendor/golang.org/x/oauth2/google/jwt.go | 74 + vendor/golang.org/x/oauth2/google/sdk.go | 172 + vendor/golang.org/x/oauth2/internal/oauth2.go | 76 + vendor/golang.org/x/oauth2/internal/token.go | 251 + .../golang.org/x/oauth2/internal/transport.go | 69 + vendor/golang.org/x/oauth2/jws/jws.go | 182 + vendor/golang.org/x/oauth2/jwt/jwt.go | 159 + vendor/golang.org/x/oauth2/oauth2.go | 340 + vendor/golang.org/x/oauth2/token.go | 158 + vendor/golang.org/x/oauth2/transport.go | 132 + vendor/google.golang.org/api/LICENSE | 27 + .../api/gensupport/backoff.go | 46 + .../api/gensupport/buffer.go | 77 + .../google.golang.org/api/gensupport/doc.go | 10 + .../api/gensupport/header.go | 22 + .../google.golang.org/api/gensupport/json.go | 211 + .../api/gensupport/jsonfloat.go | 57 + .../google.golang.org/api/gensupport/media.go | 199 + .../api/gensupport/params.go | 50 + .../api/gensupport/resumable.go | 217 + .../google.golang.org/api/gensupport/retry.go | 85 + .../google.golang.org/api/gensupport/send.go | 61 + .../api/googleapi/googleapi.go | 406 + .../googleapi/internal/uritemplates/LICENSE | 18 + .../internal/uritemplates/uritemplates.go | 248 + .../googleapi/internal/uritemplates/utils.go | 17 + .../google.golang.org/api/googleapi/types.go | 202 + .../api/youtube/v3/youtube-api.json | 10879 +++++++ .../api/youtube/v3/youtube-gen.go | 23861 ++++++++++++++++ vendor/vendor.json | 75 +- 52 files changed, 40456 insertions(+), 1 deletion(-) create mode 100644 vendor/cloud.google.com/go/LICENSE create mode 100644 vendor/cloud.google.com/go/compute/metadata/metadata.go create mode 100644 vendor/golang.org/x/net/LICENSE create mode 100644 vendor/golang.org/x/net/PATENTS create mode 100644 vendor/golang.org/x/net/context/context.go create mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go create mode 100644 vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go create mode 100644 vendor/golang.org/x/net/context/go17.go create mode 100644 vendor/golang.org/x/net/context/go19.go create mode 100644 vendor/golang.org/x/net/context/pre_go17.go create mode 100644 vendor/golang.org/x/net/context/pre_go19.go create mode 100644 vendor/golang.org/x/oauth2/AUTHORS create mode 100644 vendor/golang.org/x/oauth2/CONTRIBUTING.md create mode 100644 vendor/golang.org/x/oauth2/CONTRIBUTORS create mode 100644 vendor/golang.org/x/oauth2/LICENSE create mode 100644 vendor/golang.org/x/oauth2/README.md create mode 100644 vendor/golang.org/x/oauth2/client_appengine.go create mode 100644 vendor/golang.org/x/oauth2/google/appengine.go create mode 100644 vendor/golang.org/x/oauth2/google/appengine_hook.go create mode 100644 vendor/golang.org/x/oauth2/google/appengineflex_hook.go create mode 100644 vendor/golang.org/x/oauth2/google/default.go create mode 100644 vendor/golang.org/x/oauth2/google/google.go create mode 100644 vendor/golang.org/x/oauth2/google/jwt.go create mode 100644 vendor/golang.org/x/oauth2/google/sdk.go create mode 100644 vendor/golang.org/x/oauth2/internal/oauth2.go create mode 100644 vendor/golang.org/x/oauth2/internal/token.go create mode 100644 vendor/golang.org/x/oauth2/internal/transport.go create mode 100644 vendor/golang.org/x/oauth2/jws/jws.go create mode 100644 vendor/golang.org/x/oauth2/jwt/jwt.go create mode 100644 vendor/golang.org/x/oauth2/oauth2.go create mode 100644 vendor/golang.org/x/oauth2/token.go create mode 100644 vendor/golang.org/x/oauth2/transport.go create mode 100644 vendor/google.golang.org/api/LICENSE create mode 100644 vendor/google.golang.org/api/gensupport/backoff.go create mode 100644 vendor/google.golang.org/api/gensupport/buffer.go create mode 100644 vendor/google.golang.org/api/gensupport/doc.go create mode 100644 vendor/google.golang.org/api/gensupport/header.go create mode 100644 vendor/google.golang.org/api/gensupport/json.go create mode 100644 vendor/google.golang.org/api/gensupport/jsonfloat.go create mode 100644 vendor/google.golang.org/api/gensupport/media.go create mode 100644 vendor/google.golang.org/api/gensupport/params.go create mode 100644 vendor/google.golang.org/api/gensupport/resumable.go create mode 100644 vendor/google.golang.org/api/gensupport/retry.go create mode 100644 vendor/google.golang.org/api/gensupport/send.go create mode 100644 vendor/google.golang.org/api/googleapi/googleapi.go create mode 100644 vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE create mode 100644 vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go create mode 100644 vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go create mode 100644 vendor/google.golang.org/api/googleapi/types.go create mode 100644 vendor/google.golang.org/api/youtube/v3/youtube-api.json create mode 100644 vendor/google.golang.org/api/youtube/v3/youtube-gen.go diff --git a/vendor/cloud.google.com/go/LICENSE b/vendor/cloud.google.com/go/LICENSE new file mode 100644 index 0000000..a4c5efd --- /dev/null +++ b/vendor/cloud.google.com/go/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2014 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/cloud.google.com/go/compute/metadata/metadata.go b/vendor/cloud.google.com/go/compute/metadata/metadata.go new file mode 100644 index 0000000..e708c03 --- /dev/null +++ b/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -0,0 +1,437 @@ +// Copyright 2014 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package metadata provides access to Google Compute Engine (GCE) +// metadata and API service accounts. +// +// This package is a wrapper around the GCE metadata service, +// as documented at https://developers.google.com/compute/docs/metadata. +package metadata // import "cloud.google.com/go/compute/metadata" + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net" + "net/http" + "net/url" + "os" + "runtime" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" +) + +const ( + // metadataIP is the documented metadata server IP address. + metadataIP = "169.254.169.254" + + // metadataHostEnv is the environment variable specifying the + // GCE metadata hostname. If empty, the default value of + // metadataIP ("169.254.169.254") is used instead. + // This is variable name is not defined by any spec, as far as + // I know; it was made up for the Go package. + metadataHostEnv = "GCE_METADATA_HOST" + + userAgent = "gcloud-golang/0.1" +) + +type cachedValue struct { + k string + trim bool + mu sync.Mutex + v string +} + +var ( + projID = &cachedValue{k: "project/project-id", trim: true} + projNum = &cachedValue{k: "project/numeric-project-id", trim: true} + instID = &cachedValue{k: "instance/id", trim: true} +) + +var ( + metaClient = &http.Client{ + Transport: &http.Transport{ + Dial: (&net.Dialer{ + Timeout: 2 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + ResponseHeaderTimeout: 2 * time.Second, + }, + } + subscribeClient = &http.Client{ + Transport: &http.Transport{ + Dial: (&net.Dialer{ + Timeout: 2 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + }, + } +) + +// NotDefinedError is returned when requested metadata is not defined. +// +// The underlying string is the suffix after "/computeMetadata/v1/". +// +// This error is not returned if the value is defined to be the empty +// string. +type NotDefinedError string + +func (suffix NotDefinedError) Error() string { + return fmt.Sprintf("metadata: GCE metadata %q not defined", string(suffix)) +} + +// Get returns a value from the metadata service. +// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". +// +// If the GCE_METADATA_HOST environment variable is not defined, a default of +// 169.254.169.254 will be used instead. +// +// If the requested metadata is not defined, the returned error will +// be of type NotDefinedError. +func Get(suffix string) (string, error) { + val, _, err := getETag(metaClient, suffix) + return val, err +} + +// getETag returns a value from the metadata service as well as the associated +// ETag using the provided client. This func is otherwise equivalent to Get. +func getETag(client *http.Client, suffix string) (value, etag string, err error) { + // Using a fixed IP makes it very difficult to spoof the metadata service in + // a container, which is an important use-case for local testing of cloud + // deployments. To enable spoofing of the metadata service, the environment + // variable GCE_METADATA_HOST is first inspected to decide where metadata + // requests shall go. + host := os.Getenv(metadataHostEnv) + if host == "" { + // Using 169.254.169.254 instead of "metadata" here because Go + // binaries built with the "netgo" tag and without cgo won't + // know the search suffix for "metadata" is + // ".google.internal", and this IP address is documented as + // being stable anyway. + host = metadataIP + } + url := "http://" + host + "/computeMetadata/v1/" + suffix + req, _ := http.NewRequest("GET", url, nil) + req.Header.Set("Metadata-Flavor", "Google") + req.Header.Set("User-Agent", userAgent) + res, err := client.Do(req) + if err != nil { + return "", "", err + } + defer res.Body.Close() + if res.StatusCode == http.StatusNotFound { + return "", "", NotDefinedError(suffix) + } + if res.StatusCode != 200 { + return "", "", fmt.Errorf("status code %d trying to fetch %s", res.StatusCode, url) + } + all, err := ioutil.ReadAll(res.Body) + if err != nil { + return "", "", err + } + return string(all), res.Header.Get("Etag"), nil +} + +func getTrimmed(suffix string) (s string, err error) { + s, err = Get(suffix) + s = strings.TrimSpace(s) + return +} + +func (c *cachedValue) get() (v string, err error) { + defer c.mu.Unlock() + c.mu.Lock() + if c.v != "" { + return c.v, nil + } + if c.trim { + v, err = getTrimmed(c.k) + } else { + v, err = Get(c.k) + } + if err == nil { + c.v = v + } + return +} + +var ( + onGCEOnce sync.Once + onGCE bool +) + +// OnGCE reports whether this process is running on Google Compute Engine. +func OnGCE() bool { + onGCEOnce.Do(initOnGCE) + return onGCE +} + +func initOnGCE() { + onGCE = testOnGCE() +} + +func testOnGCE() bool { + // The user explicitly said they're on GCE, so trust them. + if os.Getenv(metadataHostEnv) != "" { + return true + } + + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + resc := make(chan bool, 2) + + // Try two strategies in parallel. + // See https://github.com/GoogleCloudPlatform/google-cloud-go/issues/194 + go func() { + req, _ := http.NewRequest("GET", "http://"+metadataIP, nil) + req.Header.Set("User-Agent", userAgent) + res, err := ctxhttp.Do(ctx, metaClient, req) + if err != nil { + resc <- false + return + } + defer res.Body.Close() + resc <- res.Header.Get("Metadata-Flavor") == "Google" + }() + + go func() { + addrs, err := net.LookupHost("metadata.google.internal") + if err != nil || len(addrs) == 0 { + resc <- false + return + } + resc <- strsContains(addrs, metadataIP) + }() + + tryHarder := systemInfoSuggestsGCE() + if tryHarder { + res := <-resc + if res { + // The first strategy succeeded, so let's use it. + return true + } + // Wait for either the DNS or metadata server probe to + // contradict the other one and say we are running on + // GCE. Give it a lot of time to do so, since the system + // info already suggests we're running on a GCE BIOS. + timer := time.NewTimer(5 * time.Second) + defer timer.Stop() + select { + case res = <-resc: + return res + case <-timer.C: + // Too slow. Who knows what this system is. + return false + } + } + + // There's no hint from the system info that we're running on + // GCE, so use the first probe's result as truth, whether it's + // true or false. The goal here is to optimize for speed for + // users who are NOT running on GCE. We can't assume that + // either a DNS lookup or an HTTP request to a blackholed IP + // address is fast. Worst case this should return when the + // metaClient's Transport.ResponseHeaderTimeout or + // Transport.Dial.Timeout fires (in two seconds). + return <-resc +} + +// systemInfoSuggestsGCE reports whether the local system (without +// doing network requests) suggests that we're running on GCE. If this +// returns true, testOnGCE tries a bit harder to reach its metadata +// server. +func systemInfoSuggestsGCE() bool { + if runtime.GOOS != "linux" { + // We don't have any non-Linux clues available, at least yet. + return false + } + slurp, _ := ioutil.ReadFile("/sys/class/dmi/id/product_name") + name := strings.TrimSpace(string(slurp)) + return name == "Google" || name == "Google Compute Engine" +} + +// Subscribe subscribes to a value from the metadata service. +// The suffix is appended to "http://${GCE_METADATA_HOST}/computeMetadata/v1/". +// The suffix may contain query parameters. +// +// Subscribe calls fn with the latest metadata value indicated by the provided +// suffix. If the metadata value is deleted, fn is called with the empty string +// and ok false. Subscribe blocks until fn returns a non-nil error or the value +// is deleted. Subscribe returns the error value returned from the last call to +// fn, which may be nil when ok == false. +func Subscribe(suffix string, fn func(v string, ok bool) error) error { + const failedSubscribeSleep = time.Second * 5 + + // First check to see if the metadata value exists at all. + val, lastETag, err := getETag(subscribeClient, suffix) + if err != nil { + return err + } + + if err := fn(val, true); err != nil { + return err + } + + ok := true + if strings.ContainsRune(suffix, '?') { + suffix += "&wait_for_change=true&last_etag=" + } else { + suffix += "?wait_for_change=true&last_etag=" + } + for { + val, etag, err := getETag(subscribeClient, suffix+url.QueryEscape(lastETag)) + if err != nil { + if _, deleted := err.(NotDefinedError); !deleted { + time.Sleep(failedSubscribeSleep) + continue // Retry on other errors. + } + ok = false + } + lastETag = etag + + if err := fn(val, ok); err != nil || !ok { + return err + } + } +} + +// ProjectID returns the current instance's project ID string. +func ProjectID() (string, error) { return projID.get() } + +// NumericProjectID returns the current instance's numeric project ID. +func NumericProjectID() (string, error) { return projNum.get() } + +// InternalIP returns the instance's primary internal IP address. +func InternalIP() (string, error) { + return getTrimmed("instance/network-interfaces/0/ip") +} + +// ExternalIP returns the instance's primary external (public) IP address. +func ExternalIP() (string, error) { + return getTrimmed("instance/network-interfaces/0/access-configs/0/external-ip") +} + +// Hostname returns the instance's hostname. This will be of the form +// ".c..internal". +func Hostname() (string, error) { + return getTrimmed("instance/hostname") +} + +// InstanceTags returns the list of user-defined instance tags, +// assigned when initially creating a GCE instance. +func InstanceTags() ([]string, error) { + var s []string + j, err := Get("instance/tags") + if err != nil { + return nil, err + } + if err := json.NewDecoder(strings.NewReader(j)).Decode(&s); err != nil { + return nil, err + } + return s, nil +} + +// InstanceID returns the current VM's numeric instance ID. +func InstanceID() (string, error) { + return instID.get() +} + +// InstanceName returns the current VM's instance ID string. +func InstanceName() (string, error) { + host, err := Hostname() + if err != nil { + return "", err + } + return strings.Split(host, ".")[0], nil +} + +// Zone returns the current VM's zone, such as "us-central1-b". +func Zone() (string, error) { + zone, err := getTrimmed("instance/zone") + // zone is of the form "projects//zones/". + if err != nil { + return "", err + } + return zone[strings.LastIndex(zone, "/")+1:], nil +} + +// InstanceAttributes returns the list of user-defined attributes, +// assigned when initially creating a GCE VM instance. The value of an +// attribute can be obtained with InstanceAttributeValue. +func InstanceAttributes() ([]string, error) { return lines("instance/attributes/") } + +// ProjectAttributes returns the list of user-defined attributes +// applying to the project as a whole, not just this VM. The value of +// an attribute can be obtained with ProjectAttributeValue. +func ProjectAttributes() ([]string, error) { return lines("project/attributes/") } + +func lines(suffix string) ([]string, error) { + j, err := Get(suffix) + if err != nil { + return nil, err + } + s := strings.Split(strings.TrimSpace(j), "\n") + for i := range s { + s[i] = strings.TrimSpace(s[i]) + } + return s, nil +} + +// InstanceAttributeValue returns the value of the provided VM +// instance attribute. +// +// If the requested attribute is not defined, the returned error will +// be of type NotDefinedError. +// +// InstanceAttributeValue may return ("", nil) if the attribute was +// defined to be the empty string. +func InstanceAttributeValue(attr string) (string, error) { + return Get("instance/attributes/" + attr) +} + +// ProjectAttributeValue returns the value of the provided +// project attribute. +// +// If the requested attribute is not defined, the returned error will +// be of type NotDefinedError. +// +// ProjectAttributeValue may return ("", nil) if the attribute was +// defined to be the empty string. +func ProjectAttributeValue(attr string) (string, error) { + return Get("project/attributes/" + attr) +} + +// Scopes returns the service account scopes for the given account. +// The account may be empty or the string "default" to use the instance's +// main account. +func Scopes(serviceAccount string) ([]string, error) { + if serviceAccount == "" { + serviceAccount = "default" + } + return lines("instance/service-accounts/" + serviceAccount + "/scopes") +} + +func strsContains(ss []string, s string) bool { + for _, v := range ss { + if v == s { + return true + } + } + return false +} diff --git a/vendor/golang.org/x/net/LICENSE b/vendor/golang.org/x/net/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/vendor/golang.org/x/net/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/net/PATENTS b/vendor/golang.org/x/net/PATENTS new file mode 100644 index 0000000..7330990 --- /dev/null +++ b/vendor/golang.org/x/net/PATENTS @@ -0,0 +1,22 @@ +Additional IP Rights Grant (Patents) + +"This implementation" means the copyrightable works distributed by +Google as part of the Go project. + +Google hereby grants to You a perpetual, worldwide, non-exclusive, +no-charge, royalty-free, irrevocable (except as stated in this section) +patent license to make, have made, use, offer to sell, sell, import, +transfer and otherwise run, modify and propagate the contents of this +implementation of Go, where such license applies only to those patent +claims, both currently owned or controlled by Google and acquired in +the future, licensable by Google that are necessarily infringed by this +implementation of Go. This grant does not include claims that would be +infringed only as a consequence of further modification of this +implementation. If you or your agent or exclusive licensee institute or +order or agree to the institution of patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging +that this implementation of Go or any code incorporated within this +implementation of Go constitutes direct or contributory patent +infringement, or inducement of patent infringement, then any patent +rights granted to you under this License for this implementation of Go +shall terminate as of the date such litigation is filed. diff --git a/vendor/golang.org/x/net/context/context.go b/vendor/golang.org/x/net/context/context.go new file mode 100644 index 0000000..d3681ab --- /dev/null +++ b/vendor/golang.org/x/net/context/context.go @@ -0,0 +1,54 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package context defines the Context type, which carries deadlines, +// cancelation signals, and other request-scoped values across API boundaries +// and between processes. +// +// Incoming requests to a server should create a Context, and outgoing calls to +// servers should accept a Context. The chain of function calls between must +// propagate the Context, optionally replacing it with a modified copy created +// using WithDeadline, WithTimeout, WithCancel, or WithValue. +// +// Programs that use Contexts should follow these rules to keep interfaces +// consistent across packages and enable static analysis tools to check context +// propagation: +// +// Do not store Contexts inside a struct type; instead, pass a Context +// explicitly to each function that needs it. The Context should be the first +// parameter, typically named ctx: +// +// func DoSomething(ctx context.Context, arg Arg) error { +// // ... use ctx ... +// } +// +// Do not pass a nil Context, even if a function permits it. Pass context.TODO +// if you are unsure about which Context to use. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +// +// The same Context may be passed to functions running in different goroutines; +// Contexts are safe for simultaneous use by multiple goroutines. +// +// See http://blog.golang.org/context for example code for a server that uses +// Contexts. +package context // import "golang.org/x/net/context" + +// Background returns a non-nil, empty Context. It is never canceled, has no +// values, and has no deadline. It is typically used by the main function, +// initialization, and tests, and as the top-level Context for incoming +// requests. +func Background() Context { + return background +} + +// TODO returns a non-nil, empty Context. Code should use context.TODO when +// it's unclear which Context to use or it is not yet available (because the +// surrounding function has not yet been extended to accept a Context +// parameter). TODO is recognized by static analysis tools that determine +// whether Contexts are propagated correctly in a program. +func TODO() Context { + return todo +} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go new file mode 100644 index 0000000..606cf1f --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go @@ -0,0 +1,74 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +// Package ctxhttp provides helper functions for performing context-aware HTTP requests. +package ctxhttp // import "golang.org/x/net/context/ctxhttp" + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +// Do sends an HTTP request with the provided http.Client and returns +// an HTTP response. +// +// If the client is nil, http.DefaultClient is used. +// +// The provided ctx must be non-nil. If it is canceled or times out, +// ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + resp, err := client.Do(req.WithContext(ctx)) + // If we got an error, and the context has been canceled, + // the context's error is probably more useful. + if err != nil { + select { + case <-ctx.Done(): + err = ctx.Err() + default: + } + } + return resp, err +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} diff --git a/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go new file mode 100644 index 0000000..926870c --- /dev/null +++ b/vendor/golang.org/x/net/context/ctxhttp/ctxhttp_pre17.go @@ -0,0 +1,147 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package ctxhttp // import "golang.org/x/net/context/ctxhttp" + +import ( + "io" + "net/http" + "net/url" + "strings" + + "golang.org/x/net/context" +) + +func nop() {} + +var ( + testHookContextDoneBeforeHeaders = nop + testHookDoReturned = nop + testHookDidBodyClose = nop +) + +// Do sends an HTTP request with the provided http.Client and returns an HTTP response. +// If the client is nil, http.DefaultClient is used. +// If the context is canceled or times out, ctx.Err() will be returned. +func Do(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if client == nil { + client = http.DefaultClient + } + + // TODO(djd): Respect any existing value of req.Cancel. + cancel := make(chan struct{}) + req.Cancel = cancel + + type responseAndError struct { + resp *http.Response + err error + } + result := make(chan responseAndError, 1) + + // Make local copies of test hooks closed over by goroutines below. + // Prevents data races in tests. + testHookDoReturned := testHookDoReturned + testHookDidBodyClose := testHookDidBodyClose + + go func() { + resp, err := client.Do(req) + testHookDoReturned() + result <- responseAndError{resp, err} + }() + + var resp *http.Response + + select { + case <-ctx.Done(): + testHookContextDoneBeforeHeaders() + close(cancel) + // Clean up after the goroutine calling client.Do: + go func() { + if r := <-result; r.resp != nil { + testHookDidBodyClose() + r.resp.Body.Close() + } + }() + return nil, ctx.Err() + case r := <-result: + var err error + resp, err = r.resp, r.err + if err != nil { + return resp, err + } + } + + c := make(chan struct{}) + go func() { + select { + case <-ctx.Done(): + close(cancel) + case <-c: + // The response's Body is closed. + } + }() + resp.Body = ¬ifyingReader{resp.Body, c} + + return resp, nil +} + +// Get issues a GET request via the Do function. +func Get(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("GET", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Head issues a HEAD request via the Do function. +func Head(ctx context.Context, client *http.Client, url string) (*http.Response, error) { + req, err := http.NewRequest("HEAD", url, nil) + if err != nil { + return nil, err + } + return Do(ctx, client, req) +} + +// Post issues a POST request via the Do function. +func Post(ctx context.Context, client *http.Client, url string, bodyType string, body io.Reader) (*http.Response, error) { + req, err := http.NewRequest("POST", url, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", bodyType) + return Do(ctx, client, req) +} + +// PostForm issues a POST request via the Do function. +func PostForm(ctx context.Context, client *http.Client, url string, data url.Values) (*http.Response, error) { + return Post(ctx, client, url, "application/x-www-form-urlencoded", strings.NewReader(data.Encode())) +} + +// notifyingReader is an io.ReadCloser that closes the notify channel after +// Close is called or a Read fails on the underlying ReadCloser. +type notifyingReader struct { + io.ReadCloser + notify chan<- struct{} +} + +func (r *notifyingReader) Read(p []byte) (int, error) { + n, err := r.ReadCloser.Read(p) + if err != nil && r.notify != nil { + close(r.notify) + r.notify = nil + } + return n, err +} + +func (r *notifyingReader) Close() error { + err := r.ReadCloser.Close() + if r.notify != nil { + close(r.notify) + r.notify = nil + } + return err +} diff --git a/vendor/golang.org/x/net/context/go17.go b/vendor/golang.org/x/net/context/go17.go new file mode 100644 index 0000000..d20f52b --- /dev/null +++ b/vendor/golang.org/x/net/context/go17.go @@ -0,0 +1,72 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.7 + +package context + +import ( + "context" // standard library's context, as of Go 1.7 + "time" +) + +var ( + todo = context.TODO() + background = context.Background() +) + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = context.Canceled + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = context.DeadlineExceeded + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + ctx, f := context.WithCancel(parent) + return ctx, CancelFunc(f) +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + ctx, f := context.WithDeadline(parent, deadline) + return ctx, CancelFunc(f) +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return context.WithValue(parent, key, val) +} diff --git a/vendor/golang.org/x/net/context/go19.go b/vendor/golang.org/x/net/context/go19.go new file mode 100644 index 0000000..d88bd1d --- /dev/null +++ b/vendor/golang.org/x/net/context/go19.go @@ -0,0 +1,20 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build go1.9 + +package context + +import "context" // standard library's context, as of Go 1.7 + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context = context.Context + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc = context.CancelFunc diff --git a/vendor/golang.org/x/net/context/pre_go17.go b/vendor/golang.org/x/net/context/pre_go17.go new file mode 100644 index 0000000..0f35592 --- /dev/null +++ b/vendor/golang.org/x/net/context/pre_go17.go @@ -0,0 +1,300 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.7 + +package context + +import ( + "errors" + "fmt" + "sync" + "time" +) + +// An emptyCtx is never canceled, has no values, and has no deadline. It is not +// struct{}, since vars of this type must have distinct addresses. +type emptyCtx int + +func (*emptyCtx) Deadline() (deadline time.Time, ok bool) { + return +} + +func (*emptyCtx) Done() <-chan struct{} { + return nil +} + +func (*emptyCtx) Err() error { + return nil +} + +func (*emptyCtx) Value(key interface{}) interface{} { + return nil +} + +func (e *emptyCtx) String() string { + switch e { + case background: + return "context.Background" + case todo: + return "context.TODO" + } + return "unknown empty Context" +} + +var ( + background = new(emptyCtx) + todo = new(emptyCtx) +) + +// Canceled is the error returned by Context.Err when the context is canceled. +var Canceled = errors.New("context canceled") + +// DeadlineExceeded is the error returned by Context.Err when the context's +// deadline passes. +var DeadlineExceeded = errors.New("context deadline exceeded") + +// WithCancel returns a copy of parent with a new Done channel. The returned +// context's Done channel is closed when the returned cancel function is called +// or when the parent context's Done channel is closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithCancel(parent Context) (ctx Context, cancel CancelFunc) { + c := newCancelCtx(parent) + propagateCancel(parent, c) + return c, func() { c.cancel(true, Canceled) } +} + +// newCancelCtx returns an initialized cancelCtx. +func newCancelCtx(parent Context) *cancelCtx { + return &cancelCtx{ + Context: parent, + done: make(chan struct{}), + } +} + +// propagateCancel arranges for child to be canceled when parent is. +func propagateCancel(parent Context, child canceler) { + if parent.Done() == nil { + return // parent is never canceled + } + if p, ok := parentCancelCtx(parent); ok { + p.mu.Lock() + if p.err != nil { + // parent has already been canceled + child.cancel(false, p.err) + } else { + if p.children == nil { + p.children = make(map[canceler]bool) + } + p.children[child] = true + } + p.mu.Unlock() + } else { + go func() { + select { + case <-parent.Done(): + child.cancel(false, parent.Err()) + case <-child.Done(): + } + }() + } +} + +// parentCancelCtx follows a chain of parent references until it finds a +// *cancelCtx. This function understands how each of the concrete types in this +// package represents its parent. +func parentCancelCtx(parent Context) (*cancelCtx, bool) { + for { + switch c := parent.(type) { + case *cancelCtx: + return c, true + case *timerCtx: + return c.cancelCtx, true + case *valueCtx: + parent = c.Context + default: + return nil, false + } + } +} + +// removeChild removes a context from its parent. +func removeChild(parent Context, child canceler) { + p, ok := parentCancelCtx(parent) + if !ok { + return + } + p.mu.Lock() + if p.children != nil { + delete(p.children, child) + } + p.mu.Unlock() +} + +// A canceler is a context type that can be canceled directly. The +// implementations are *cancelCtx and *timerCtx. +type canceler interface { + cancel(removeFromParent bool, err error) + Done() <-chan struct{} +} + +// A cancelCtx can be canceled. When canceled, it also cancels any children +// that implement canceler. +type cancelCtx struct { + Context + + done chan struct{} // closed by the first cancel call. + + mu sync.Mutex + children map[canceler]bool // set to nil by the first cancel call + err error // set to non-nil by the first cancel call +} + +func (c *cancelCtx) Done() <-chan struct{} { + return c.done +} + +func (c *cancelCtx) Err() error { + c.mu.Lock() + defer c.mu.Unlock() + return c.err +} + +func (c *cancelCtx) String() string { + return fmt.Sprintf("%v.WithCancel", c.Context) +} + +// cancel closes c.done, cancels each of c's children, and, if +// removeFromParent is true, removes c from its parent's children. +func (c *cancelCtx) cancel(removeFromParent bool, err error) { + if err == nil { + panic("context: internal error: missing cancel error") + } + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return // already canceled + } + c.err = err + close(c.done) + for child := range c.children { + // NOTE: acquiring the child's lock while holding parent's lock. + child.cancel(false, err) + } + c.children = nil + c.mu.Unlock() + + if removeFromParent { + removeChild(c.Context, c) + } +} + +// WithDeadline returns a copy of the parent context with the deadline adjusted +// to be no later than d. If the parent's deadline is already earlier than d, +// WithDeadline(parent, d) is semantically equivalent to parent. The returned +// context's Done channel is closed when the deadline expires, when the returned +// cancel function is called, or when the parent context's Done channel is +// closed, whichever happens first. +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete. +func WithDeadline(parent Context, deadline time.Time) (Context, CancelFunc) { + if cur, ok := parent.Deadline(); ok && cur.Before(deadline) { + // The current deadline is already sooner than the new one. + return WithCancel(parent) + } + c := &timerCtx{ + cancelCtx: newCancelCtx(parent), + deadline: deadline, + } + propagateCancel(parent, c) + d := deadline.Sub(time.Now()) + if d <= 0 { + c.cancel(true, DeadlineExceeded) // deadline has already passed + return c, func() { c.cancel(true, Canceled) } + } + c.mu.Lock() + defer c.mu.Unlock() + if c.err == nil { + c.timer = time.AfterFunc(d, func() { + c.cancel(true, DeadlineExceeded) + }) + } + return c, func() { c.cancel(true, Canceled) } +} + +// A timerCtx carries a timer and a deadline. It embeds a cancelCtx to +// implement Done and Err. It implements cancel by stopping its timer then +// delegating to cancelCtx.cancel. +type timerCtx struct { + *cancelCtx + timer *time.Timer // Under cancelCtx.mu. + + deadline time.Time +} + +func (c *timerCtx) Deadline() (deadline time.Time, ok bool) { + return c.deadline, true +} + +func (c *timerCtx) String() string { + return fmt.Sprintf("%v.WithDeadline(%s [%s])", c.cancelCtx.Context, c.deadline, c.deadline.Sub(time.Now())) +} + +func (c *timerCtx) cancel(removeFromParent bool, err error) { + c.cancelCtx.cancel(false, err) + if removeFromParent { + // Remove this timerCtx from its parent cancelCtx's children. + removeChild(c.cancelCtx.Context, c) + } + c.mu.Lock() + if c.timer != nil { + c.timer.Stop() + c.timer = nil + } + c.mu.Unlock() +} + +// WithTimeout returns WithDeadline(parent, time.Now().Add(timeout)). +// +// Canceling this context releases resources associated with it, so code should +// call cancel as soon as the operations running in this Context complete: +// +// func slowOperationWithTimeout(ctx context.Context) (Result, error) { +// ctx, cancel := context.WithTimeout(ctx, 100*time.Millisecond) +// defer cancel() // releases resources if slowOperation completes before timeout elapses +// return slowOperation(ctx) +// } +func WithTimeout(parent Context, timeout time.Duration) (Context, CancelFunc) { + return WithDeadline(parent, time.Now().Add(timeout)) +} + +// WithValue returns a copy of parent in which the value associated with key is +// val. +// +// Use context Values only for request-scoped data that transits processes and +// APIs, not for passing optional parameters to functions. +func WithValue(parent Context, key interface{}, val interface{}) Context { + return &valueCtx{parent, key, val} +} + +// A valueCtx carries a key-value pair. It implements Value for that key and +// delegates all other calls to the embedded Context. +type valueCtx struct { + Context + key, val interface{} +} + +func (c *valueCtx) String() string { + return fmt.Sprintf("%v.WithValue(%#v, %#v)", c.Context, c.key, c.val) +} + +func (c *valueCtx) Value(key interface{}) interface{} { + if c.key == key { + return c.val + } + return c.Context.Value(key) +} diff --git a/vendor/golang.org/x/net/context/pre_go19.go b/vendor/golang.org/x/net/context/pre_go19.go new file mode 100644 index 0000000..b105f80 --- /dev/null +++ b/vendor/golang.org/x/net/context/pre_go19.go @@ -0,0 +1,109 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !go1.9 + +package context + +import "time" + +// A Context carries a deadline, a cancelation signal, and other values across +// API boundaries. +// +// Context's methods may be called by multiple goroutines simultaneously. +type Context interface { + // Deadline returns the time when work done on behalf of this context + // should be canceled. Deadline returns ok==false when no deadline is + // set. Successive calls to Deadline return the same results. + Deadline() (deadline time.Time, ok bool) + + // Done returns a channel that's closed when work done on behalf of this + // context should be canceled. Done may return nil if this context can + // never be canceled. Successive calls to Done return the same value. + // + // WithCancel arranges for Done to be closed when cancel is called; + // WithDeadline arranges for Done to be closed when the deadline + // expires; WithTimeout arranges for Done to be closed when the timeout + // elapses. + // + // Done is provided for use in select statements: + // + // // Stream generates values with DoSomething and sends them to out + // // until DoSomething returns an error or ctx.Done is closed. + // func Stream(ctx context.Context, out chan<- Value) error { + // for { + // v, err := DoSomething(ctx) + // if err != nil { + // return err + // } + // select { + // case <-ctx.Done(): + // return ctx.Err() + // case out <- v: + // } + // } + // } + // + // See http://blog.golang.org/pipelines for more examples of how to use + // a Done channel for cancelation. + Done() <-chan struct{} + + // Err returns a non-nil error value after Done is closed. Err returns + // Canceled if the context was canceled or DeadlineExceeded if the + // context's deadline passed. No other values for Err are defined. + // After Done is closed, successive calls to Err return the same value. + Err() error + + // Value returns the value associated with this context for key, or nil + // if no value is associated with key. Successive calls to Value with + // the same key returns the same result. + // + // Use context values only for request-scoped data that transits + // processes and API boundaries, not for passing optional parameters to + // functions. + // + // A key identifies a specific value in a Context. Functions that wish + // to store values in Context typically allocate a key in a global + // variable then use that key as the argument to context.WithValue and + // Context.Value. A key can be any type that supports equality; + // packages should define keys as an unexported type to avoid + // collisions. + // + // Packages that define a Context key should provide type-safe accessors + // for the values stores using that key: + // + // // Package user defines a User type that's stored in Contexts. + // package user + // + // import "golang.org/x/net/context" + // + // // User is the type of value stored in the Contexts. + // type User struct {...} + // + // // key is an unexported type for keys defined in this package. + // // This prevents collisions with keys defined in other packages. + // type key int + // + // // userKey is the key for user.User values in Contexts. It is + // // unexported; clients use user.NewContext and user.FromContext + // // instead of using this key directly. + // var userKey key = 0 + // + // // NewContext returns a new Context that carries value u. + // func NewContext(ctx context.Context, u *User) context.Context { + // return context.WithValue(ctx, userKey, u) + // } + // + // // FromContext returns the User value stored in ctx, if any. + // func FromContext(ctx context.Context) (*User, bool) { + // u, ok := ctx.Value(userKey).(*User) + // return u, ok + // } + Value(key interface{}) interface{} +} + +// A CancelFunc tells an operation to abandon its work. +// A CancelFunc does not wait for the work to stop. +// After the first call, subsequent calls to a CancelFunc do nothing. +type CancelFunc func() diff --git a/vendor/golang.org/x/oauth2/AUTHORS b/vendor/golang.org/x/oauth2/AUTHORS new file mode 100644 index 0000000..15167cd --- /dev/null +++ b/vendor/golang.org/x/oauth2/AUTHORS @@ -0,0 +1,3 @@ +# This source code refers to The Go Authors for copyright purposes. +# The master list of authors is in the main Go distribution, +# visible at http://tip.golang.org/AUTHORS. diff --git a/vendor/golang.org/x/oauth2/CONTRIBUTING.md b/vendor/golang.org/x/oauth2/CONTRIBUTING.md new file mode 100644 index 0000000..46aa2b1 --- /dev/null +++ b/vendor/golang.org/x/oauth2/CONTRIBUTING.md @@ -0,0 +1,31 @@ +# Contributing to Go + +Go is an open source project. + +It is the work of hundreds of contributors. We appreciate your help! + + +## Filing issues + +When [filing an issue](https://github.com/golang/oauth2/issues), make sure to answer these five questions: + +1. What version of Go are you using (`go version`)? +2. What operating system and processor architecture are you using? +3. What did you do? +4. What did you expect to see? +5. What did you see instead? + +General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. +The gophers there will answer or ask you to file an issue if you've tripped over a bug. + +## Contributing code + +Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) +before sending patches. + +**We do not accept GitHub pull requests** +(we use [Gerrit](https://code.google.com/p/gerrit/) instead for code review). + +Unless otherwise noted, the Go source files are distributed under +the BSD-style license found in the LICENSE file. + diff --git a/vendor/golang.org/x/oauth2/CONTRIBUTORS b/vendor/golang.org/x/oauth2/CONTRIBUTORS new file mode 100644 index 0000000..1c4577e --- /dev/null +++ b/vendor/golang.org/x/oauth2/CONTRIBUTORS @@ -0,0 +1,3 @@ +# This source code was written by the Go contributors. +# The master list of contributors is in the main Go distribution, +# visible at http://tip.golang.org/CONTRIBUTORS. diff --git a/vendor/golang.org/x/oauth2/LICENSE b/vendor/golang.org/x/oauth2/LICENSE new file mode 100644 index 0000000..d02f24f --- /dev/null +++ b/vendor/golang.org/x/oauth2/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The oauth2 Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/golang.org/x/oauth2/README.md b/vendor/golang.org/x/oauth2/README.md new file mode 100644 index 0000000..eb8dcee --- /dev/null +++ b/vendor/golang.org/x/oauth2/README.md @@ -0,0 +1,77 @@ +# OAuth2 for Go + +[![Build Status](https://travis-ci.org/golang/oauth2.svg?branch=master)](https://travis-ci.org/golang/oauth2) +[![GoDoc](https://godoc.org/golang.org/x/oauth2?status.svg)](https://godoc.org/golang.org/x/oauth2) + +oauth2 package contains a client implementation for OAuth 2.0 spec. + +## Installation + +~~~~ +go get golang.org/x/oauth2 +~~~~ + +Or you can manually git clone the repository to +`$(go env GOPATH)/src/golang.org/x/oauth2`. + +See godoc for further documentation and examples. + +* [godoc.org/golang.org/x/oauth2](http://godoc.org/golang.org/x/oauth2) +* [godoc.org/golang.org/x/oauth2/google](http://godoc.org/golang.org/x/oauth2/google) + + +## App Engine + +In change 96e89be (March 2015), we removed the `oauth2.Context2` type in favor +of the [`context.Context`](https://golang.org/x/net/context#Context) type from +the `golang.org/x/net/context` package + +This means it's no longer possible to use the "Classic App Engine" +`appengine.Context` type with the `oauth2` package. (You're using +Classic App Engine if you import the package `"appengine"`.) + +To work around this, you may use the new `"google.golang.org/appengine"` +package. This package has almost the same API as the `"appengine"` package, +but it can be fetched with `go get` and used on "Managed VMs" and well as +Classic App Engine. + +See the [new `appengine` package's readme](https://github.com/golang/appengine#updating-a-go-app-engine-app) +for information on updating your app. + +If you don't want to update your entire app to use the new App Engine packages, +you may use both sets of packages in parallel, using only the new packages +with the `oauth2` package. + +```go +import ( + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/google" + newappengine "google.golang.org/appengine" + newurlfetch "google.golang.org/appengine/urlfetch" + + "appengine" +) + +func handler(w http.ResponseWriter, r *http.Request) { + var c appengine.Context = appengine.NewContext(r) + c.Infof("Logging a message with the old package") + + var ctx context.Context = newappengine.NewContext(r) + client := &http.Client{ + Transport: &oauth2.Transport{ + Source: google.AppEngineTokenSource(ctx, "scope"), + Base: &newurlfetch.Transport{Context: ctx}, + }, + } + client.Get("...") +} +``` + +## Report Issues / Send Patches + +This repository uses Gerrit for code changes. To learn how to submit changes to +this repository, see https://golang.org/doc/contribute.html. + +The main issue tracker for the oauth2 repository is located at +https://github.com/golang/oauth2/issues. diff --git a/vendor/golang.org/x/oauth2/client_appengine.go b/vendor/golang.org/x/oauth2/client_appengine.go new file mode 100644 index 0000000..8962c49 --- /dev/null +++ b/vendor/golang.org/x/oauth2/client_appengine.go @@ -0,0 +1,25 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appengine + +// App Engine hooks. + +package oauth2 + +import ( + "net/http" + + "golang.org/x/net/context" + "golang.org/x/oauth2/internal" + "google.golang.org/appengine/urlfetch" +) + +func init() { + internal.RegisterContextClientFunc(contextClientAppEngine) +} + +func contextClientAppEngine(ctx context.Context) (*http.Client, error) { + return urlfetch.Client(ctx), nil +} diff --git a/vendor/golang.org/x/oauth2/google/appengine.go b/vendor/golang.org/x/oauth2/google/appengine.go new file mode 100644 index 0000000..50d918b --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/appengine.go @@ -0,0 +1,89 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package google + +import ( + "sort" + "strings" + "sync" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2" +) + +// appengineFlex is set at init time by appengineflex_hook.go. If true, we are on App Engine Flex. +var appengineFlex bool + +// Set at init time by appengine_hook.go. If nil, we're not on App Engine. +var appengineTokenFunc func(c context.Context, scopes ...string) (token string, expiry time.Time, err error) + +// Set at init time by appengine_hook.go. If nil, we're not on App Engine. +var appengineAppIDFunc func(c context.Context) string + +// AppEngineTokenSource returns a token source that fetches tokens +// issued to the current App Engine application's service account. +// If you are implementing a 3-legged OAuth 2.0 flow on App Engine +// that involves user accounts, see oauth2.Config instead. +// +// The provided context must have come from appengine.NewContext. +func AppEngineTokenSource(ctx context.Context, scope ...string) oauth2.TokenSource { + if appengineTokenFunc == nil { + panic("google: AppEngineTokenSource can only be used on App Engine.") + } + scopes := append([]string{}, scope...) + sort.Strings(scopes) + return &appEngineTokenSource{ + ctx: ctx, + scopes: scopes, + key: strings.Join(scopes, " "), + } +} + +// aeTokens helps the fetched tokens to be reused until their expiration. +var ( + aeTokensMu sync.Mutex + aeTokens = make(map[string]*tokenLock) // key is space-separated scopes +) + +type tokenLock struct { + mu sync.Mutex // guards t; held while fetching or updating t + t *oauth2.Token +} + +type appEngineTokenSource struct { + ctx context.Context + scopes []string + key string // to aeTokens map; space-separated scopes +} + +func (ts *appEngineTokenSource) Token() (*oauth2.Token, error) { + if appengineTokenFunc == nil { + panic("google: AppEngineTokenSource can only be used on App Engine.") + } + + aeTokensMu.Lock() + tok, ok := aeTokens[ts.key] + if !ok { + tok = &tokenLock{} + aeTokens[ts.key] = tok + } + aeTokensMu.Unlock() + + tok.mu.Lock() + defer tok.mu.Unlock() + if tok.t.Valid() { + return tok.t, nil + } + access, exp, err := appengineTokenFunc(ts.ctx, ts.scopes...) + if err != nil { + return nil, err + } + tok.t = &oauth2.Token{ + AccessToken: access, + Expiry: exp, + } + return tok.t, nil +} diff --git a/vendor/golang.org/x/oauth2/google/appengine_hook.go b/vendor/golang.org/x/oauth2/google/appengine_hook.go new file mode 100644 index 0000000..56669ea --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/appengine_hook.go @@ -0,0 +1,14 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appengine appenginevm + +package google + +import "google.golang.org/appengine" + +func init() { + appengineTokenFunc = appengine.AccessToken + appengineAppIDFunc = appengine.AppID +} diff --git a/vendor/golang.org/x/oauth2/google/appengineflex_hook.go b/vendor/golang.org/x/oauth2/google/appengineflex_hook.go new file mode 100644 index 0000000..5d0231a --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/appengineflex_hook.go @@ -0,0 +1,11 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build appenginevm + +package google + +func init() { + appengineFlex = true // Flex doesn't support appengine.AccessToken; depend on metadata server. +} diff --git a/vendor/golang.org/x/oauth2/google/default.go b/vendor/golang.org/x/oauth2/google/default.go new file mode 100644 index 0000000..004ed4e --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/default.go @@ -0,0 +1,130 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package google + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "os" + "path/filepath" + "runtime" + + "cloud.google.com/go/compute/metadata" + "golang.org/x/net/context" + "golang.org/x/oauth2" +) + +// DefaultCredentials holds "Application Default Credentials". +// For more details, see: +// https://developers.google.com/accounts/docs/application-default-credentials +type DefaultCredentials struct { + ProjectID string // may be empty + TokenSource oauth2.TokenSource +} + +// DefaultClient returns an HTTP Client that uses the +// DefaultTokenSource to obtain authentication credentials. +func DefaultClient(ctx context.Context, scope ...string) (*http.Client, error) { + ts, err := DefaultTokenSource(ctx, scope...) + if err != nil { + return nil, err + } + return oauth2.NewClient(ctx, ts), nil +} + +// DefaultTokenSource returns the token source for +// "Application Default Credentials". +// It is a shortcut for FindDefaultCredentials(ctx, scope).TokenSource. +func DefaultTokenSource(ctx context.Context, scope ...string) (oauth2.TokenSource, error) { + creds, err := FindDefaultCredentials(ctx, scope...) + if err != nil { + return nil, err + } + return creds.TokenSource, nil +} + +// FindDefaultCredentials searches for "Application Default Credentials". +// +// It looks for credentials in the following places, +// preferring the first location found: +// +// 1. A JSON file whose path is specified by the +// GOOGLE_APPLICATION_CREDENTIALS environment variable. +// 2. A JSON file in a location known to the gcloud command-line tool. +// On Windows, this is %APPDATA%/gcloud/application_default_credentials.json. +// On other systems, $HOME/.config/gcloud/application_default_credentials.json. +// 3. On Google App Engine it uses the appengine.AccessToken function. +// 4. On Google Compute Engine and Google App Engine Managed VMs, it fetches +// credentials from the metadata server. +// (In this final case any provided scopes are ignored.) +func FindDefaultCredentials(ctx context.Context, scope ...string) (*DefaultCredentials, error) { + // First, try the environment variable. + const envVar = "GOOGLE_APPLICATION_CREDENTIALS" + if filename := os.Getenv(envVar); filename != "" { + creds, err := readCredentialsFile(ctx, filename, scope) + if err != nil { + return nil, fmt.Errorf("google: error getting credentials using %v environment variable: %v", envVar, err) + } + return creds, nil + } + + // Second, try a well-known file. + filename := wellKnownFile() + if creds, err := readCredentialsFile(ctx, filename, scope); err == nil { + return creds, nil + } else if !os.IsNotExist(err) { + return nil, fmt.Errorf("google: error getting credentials using well-known file (%v): %v", filename, err) + } + + // Third, if we're on Google App Engine use those credentials. + if appengineTokenFunc != nil && !appengineFlex { + return &DefaultCredentials{ + ProjectID: appengineAppIDFunc(ctx), + TokenSource: AppEngineTokenSource(ctx, scope...), + }, nil + } + + // Fourth, if we're on Google Compute Engine use the metadata server. + if metadata.OnGCE() { + id, _ := metadata.ProjectID() + return &DefaultCredentials{ + ProjectID: id, + TokenSource: ComputeTokenSource(""), + }, nil + } + + // None are found; return helpful error. + const url = "https://developers.google.com/accounts/docs/application-default-credentials" + return nil, fmt.Errorf("google: could not find default credentials. See %v for more information.", url) +} + +func wellKnownFile() string { + const f = "application_default_credentials.json" + if runtime.GOOS == "windows" { + return filepath.Join(os.Getenv("APPDATA"), "gcloud", f) + } + return filepath.Join(guessUnixHomeDir(), ".config", "gcloud", f) +} + +func readCredentialsFile(ctx context.Context, filename string, scopes []string) (*DefaultCredentials, error) { + b, err := ioutil.ReadFile(filename) + if err != nil { + return nil, err + } + var f credentialsFile + if err := json.Unmarshal(b, &f); err != nil { + return nil, err + } + ts, err := f.tokenSource(ctx, append([]string(nil), scopes...)) + if err != nil { + return nil, err + } + return &DefaultCredentials{ + ProjectID: f.ProjectID, + TokenSource: ts, + }, nil +} diff --git a/vendor/golang.org/x/oauth2/google/google.go b/vendor/golang.org/x/oauth2/google/google.go new file mode 100644 index 0000000..66a8b0e --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/google.go @@ -0,0 +1,202 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package google provides support for making OAuth2 authorized and +// authenticated HTTP requests to Google APIs. +// It supports the Web server flow, client-side credentials, service accounts, +// Google Compute Engine service accounts, and Google App Engine service +// accounts. +// +// For more information, please read +// https://developers.google.com/accounts/docs/OAuth2 +// and +// https://developers.google.com/accounts/docs/application-default-credentials. +package google // import "golang.org/x/oauth2/google" + +import ( + "encoding/json" + "errors" + "fmt" + "strings" + "time" + + "cloud.google.com/go/compute/metadata" + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/jwt" +) + +// Endpoint is Google's OAuth 2.0 endpoint. +var Endpoint = oauth2.Endpoint{ + AuthURL: "https://accounts.google.com/o/oauth2/auth", + TokenURL: "https://accounts.google.com/o/oauth2/token", +} + +// JWTTokenURL is Google's OAuth 2.0 token URL to use with the JWT flow. +const JWTTokenURL = "https://accounts.google.com/o/oauth2/token" + +// ConfigFromJSON uses a Google Developers Console client_credentials.json +// file to construct a config. +// client_credentials.json can be downloaded from +// https://console.developers.google.com, under "Credentials". Download the Web +// application credentials in the JSON format and provide the contents of the +// file as jsonKey. +func ConfigFromJSON(jsonKey []byte, scope ...string) (*oauth2.Config, error) { + type cred struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + RedirectURIs []string `json:"redirect_uris"` + AuthURI string `json:"auth_uri"` + TokenURI string `json:"token_uri"` + } + var j struct { + Web *cred `json:"web"` + Installed *cred `json:"installed"` + } + if err := json.Unmarshal(jsonKey, &j); err != nil { + return nil, err + } + var c *cred + switch { + case j.Web != nil: + c = j.Web + case j.Installed != nil: + c = j.Installed + default: + return nil, fmt.Errorf("oauth2/google: no credentials found") + } + if len(c.RedirectURIs) < 1 { + return nil, errors.New("oauth2/google: missing redirect URL in the client_credentials.json") + } + return &oauth2.Config{ + ClientID: c.ClientID, + ClientSecret: c.ClientSecret, + RedirectURL: c.RedirectURIs[0], + Scopes: scope, + Endpoint: oauth2.Endpoint{ + AuthURL: c.AuthURI, + TokenURL: c.TokenURI, + }, + }, nil +} + +// JWTConfigFromJSON uses a Google Developers service account JSON key file to read +// the credentials that authorize and authenticate the requests. +// Create a service account on "Credentials" for your project at +// https://console.developers.google.com to download a JSON key file. +func JWTConfigFromJSON(jsonKey []byte, scope ...string) (*jwt.Config, error) { + var f credentialsFile + if err := json.Unmarshal(jsonKey, &f); err != nil { + return nil, err + } + if f.Type != serviceAccountKey { + return nil, fmt.Errorf("google: read JWT from JSON credentials: 'type' field is %q (expected %q)", f.Type, serviceAccountKey) + } + scope = append([]string(nil), scope...) // copy + return f.jwtConfig(scope), nil +} + +// JSON key file types. +const ( + serviceAccountKey = "service_account" + userCredentialsKey = "authorized_user" +) + +// credentialsFile is the unmarshalled representation of a credentials file. +type credentialsFile struct { + Type string `json:"type"` // serviceAccountKey or userCredentialsKey + + // Service Account fields + ClientEmail string `json:"client_email"` + PrivateKeyID string `json:"private_key_id"` + PrivateKey string `json:"private_key"` + TokenURL string `json:"token_uri"` + ProjectID string `json:"project_id"` + + // User Credential fields + // (These typically come from gcloud auth.) + ClientSecret string `json:"client_secret"` + ClientID string `json:"client_id"` + RefreshToken string `json:"refresh_token"` +} + +func (f *credentialsFile) jwtConfig(scopes []string) *jwt.Config { + cfg := &jwt.Config{ + Email: f.ClientEmail, + PrivateKey: []byte(f.PrivateKey), + PrivateKeyID: f.PrivateKeyID, + Scopes: scopes, + TokenURL: f.TokenURL, + } + if cfg.TokenURL == "" { + cfg.TokenURL = JWTTokenURL + } + return cfg +} + +func (f *credentialsFile) tokenSource(ctx context.Context, scopes []string) (oauth2.TokenSource, error) { + switch f.Type { + case serviceAccountKey: + cfg := f.jwtConfig(scopes) + return cfg.TokenSource(ctx), nil + case userCredentialsKey: + cfg := &oauth2.Config{ + ClientID: f.ClientID, + ClientSecret: f.ClientSecret, + Scopes: scopes, + Endpoint: Endpoint, + } + tok := &oauth2.Token{RefreshToken: f.RefreshToken} + return cfg.TokenSource(ctx, tok), nil + case "": + return nil, errors.New("missing 'type' field in credentials") + default: + return nil, fmt.Errorf("unknown credential type: %q", f.Type) + } +} + +// ComputeTokenSource returns a token source that fetches access tokens +// from Google Compute Engine (GCE)'s metadata server. It's only valid to use +// this token source if your program is running on a GCE instance. +// If no account is specified, "default" is used. +// Further information about retrieving access tokens from the GCE metadata +// server can be found at https://cloud.google.com/compute/docs/authentication. +func ComputeTokenSource(account string) oauth2.TokenSource { + return oauth2.ReuseTokenSource(nil, computeSource{account: account}) +} + +type computeSource struct { + account string +} + +func (cs computeSource) Token() (*oauth2.Token, error) { + if !metadata.OnGCE() { + return nil, errors.New("oauth2/google: can't get a token from the metadata service; not running on GCE") + } + acct := cs.account + if acct == "" { + acct = "default" + } + tokenJSON, err := metadata.Get("instance/service-accounts/" + acct + "/token") + if err != nil { + return nil, err + } + var res struct { + AccessToken string `json:"access_token"` + ExpiresInSec int `json:"expires_in"` + TokenType string `json:"token_type"` + } + err = json.NewDecoder(strings.NewReader(tokenJSON)).Decode(&res) + if err != nil { + return nil, fmt.Errorf("oauth2/google: invalid token JSON from metadata: %v", err) + } + if res.ExpiresInSec == 0 || res.AccessToken == "" { + return nil, fmt.Errorf("oauth2/google: incomplete token received from metadata") + } + return &oauth2.Token{ + AccessToken: res.AccessToken, + TokenType: res.TokenType, + Expiry: time.Now().Add(time.Duration(res.ExpiresInSec) * time.Second), + }, nil +} diff --git a/vendor/golang.org/x/oauth2/google/jwt.go b/vendor/golang.org/x/oauth2/google/jwt.go new file mode 100644 index 0000000..b0fdb3a --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/jwt.go @@ -0,0 +1,74 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package google + +import ( + "crypto/rsa" + "fmt" + "time" + + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" + "golang.org/x/oauth2/jws" +) + +// JWTAccessTokenSourceFromJSON uses a Google Developers service account JSON +// key file to read the credentials that authorize and authenticate the +// requests, and returns a TokenSource that does not use any OAuth2 flow but +// instead creates a JWT and sends that as the access token. +// The audience is typically a URL that specifies the scope of the credentials. +// +// Note that this is not a standard OAuth flow, but rather an +// optimization supported by a few Google services. +// Unless you know otherwise, you should use JWTConfigFromJSON instead. +func JWTAccessTokenSourceFromJSON(jsonKey []byte, audience string) (oauth2.TokenSource, error) { + cfg, err := JWTConfigFromJSON(jsonKey) + if err != nil { + return nil, fmt.Errorf("google: could not parse JSON key: %v", err) + } + pk, err := internal.ParseKey(cfg.PrivateKey) + if err != nil { + return nil, fmt.Errorf("google: could not parse key: %v", err) + } + ts := &jwtAccessTokenSource{ + email: cfg.Email, + audience: audience, + pk: pk, + pkID: cfg.PrivateKeyID, + } + tok, err := ts.Token() + if err != nil { + return nil, err + } + return oauth2.ReuseTokenSource(tok, ts), nil +} + +type jwtAccessTokenSource struct { + email, audience string + pk *rsa.PrivateKey + pkID string +} + +func (ts *jwtAccessTokenSource) Token() (*oauth2.Token, error) { + iat := time.Now() + exp := iat.Add(time.Hour) + cs := &jws.ClaimSet{ + Iss: ts.email, + Sub: ts.email, + Aud: ts.audience, + Iat: iat.Unix(), + Exp: exp.Unix(), + } + hdr := &jws.Header{ + Algorithm: "RS256", + Typ: "JWT", + KeyID: string(ts.pkID), + } + msg, err := jws.Encode(hdr, cs, ts.pk) + if err != nil { + return nil, fmt.Errorf("google: could not encode JWT: %v", err) + } + return &oauth2.Token{AccessToken: msg, TokenType: "Bearer", Expiry: exp}, nil +} diff --git a/vendor/golang.org/x/oauth2/google/sdk.go b/vendor/golang.org/x/oauth2/google/sdk.go new file mode 100644 index 0000000..bdc1808 --- /dev/null +++ b/vendor/golang.org/x/oauth2/google/sdk.go @@ -0,0 +1,172 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package google + +import ( + "encoding/json" + "errors" + "fmt" + "net/http" + "os" + "os/user" + "path/filepath" + "runtime" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" +) + +type sdkCredentials struct { + Data []struct { + Credential struct { + ClientID string `json:"client_id"` + ClientSecret string `json:"client_secret"` + AccessToken string `json:"access_token"` + RefreshToken string `json:"refresh_token"` + TokenExpiry *time.Time `json:"token_expiry"` + } `json:"credential"` + Key struct { + Account string `json:"account"` + Scope string `json:"scope"` + } `json:"key"` + } +} + +// An SDKConfig provides access to tokens from an account already +// authorized via the Google Cloud SDK. +type SDKConfig struct { + conf oauth2.Config + initialToken *oauth2.Token +} + +// NewSDKConfig creates an SDKConfig for the given Google Cloud SDK +// account. If account is empty, the account currently active in +// Google Cloud SDK properties is used. +// Google Cloud SDK credentials must be created by running `gcloud auth` +// before using this function. +// The Google Cloud SDK is available at https://cloud.google.com/sdk/. +func NewSDKConfig(account string) (*SDKConfig, error) { + configPath, err := sdkConfigPath() + if err != nil { + return nil, fmt.Errorf("oauth2/google: error getting SDK config path: %v", err) + } + credentialsPath := filepath.Join(configPath, "credentials") + f, err := os.Open(credentialsPath) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to load SDK credentials: %v", err) + } + defer f.Close() + + var c sdkCredentials + if err := json.NewDecoder(f).Decode(&c); err != nil { + return nil, fmt.Errorf("oauth2/google: failed to decode SDK credentials from %q: %v", credentialsPath, err) + } + if len(c.Data) == 0 { + return nil, fmt.Errorf("oauth2/google: no credentials found in %q, run `gcloud auth login` to create one", credentialsPath) + } + if account == "" { + propertiesPath := filepath.Join(configPath, "properties") + f, err := os.Open(propertiesPath) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to load SDK properties: %v", err) + } + defer f.Close() + ini, err := internal.ParseINI(f) + if err != nil { + return nil, fmt.Errorf("oauth2/google: failed to parse SDK properties %q: %v", propertiesPath, err) + } + core, ok := ini["core"] + if !ok { + return nil, fmt.Errorf("oauth2/google: failed to find [core] section in %v", ini) + } + active, ok := core["account"] + if !ok { + return nil, fmt.Errorf("oauth2/google: failed to find %q attribute in %v", "account", core) + } + account = active + } + + for _, d := range c.Data { + if account == "" || d.Key.Account == account { + if d.Credential.AccessToken == "" && d.Credential.RefreshToken == "" { + return nil, fmt.Errorf("oauth2/google: no token available for account %q", account) + } + var expiry time.Time + if d.Credential.TokenExpiry != nil { + expiry = *d.Credential.TokenExpiry + } + return &SDKConfig{ + conf: oauth2.Config{ + ClientID: d.Credential.ClientID, + ClientSecret: d.Credential.ClientSecret, + Scopes: strings.Split(d.Key.Scope, " "), + Endpoint: Endpoint, + RedirectURL: "oob", + }, + initialToken: &oauth2.Token{ + AccessToken: d.Credential.AccessToken, + RefreshToken: d.Credential.RefreshToken, + Expiry: expiry, + }, + }, nil + } + } + return nil, fmt.Errorf("oauth2/google: no such credentials for account %q", account) +} + +// Client returns an HTTP client using Google Cloud SDK credentials to +// authorize requests. The token will auto-refresh as necessary. The +// underlying http.RoundTripper will be obtained using the provided +// context. The returned client and its Transport should not be +// modified. +func (c *SDKConfig) Client(ctx context.Context) *http.Client { + return &http.Client{ + Transport: &oauth2.Transport{ + Source: c.TokenSource(ctx), + }, + } +} + +// TokenSource returns an oauth2.TokenSource that retrieve tokens from +// Google Cloud SDK credentials using the provided context. +// It will returns the current access token stored in the credentials, +// and refresh it when it expires, but it won't update the credentials +// with the new access token. +func (c *SDKConfig) TokenSource(ctx context.Context) oauth2.TokenSource { + return c.conf.TokenSource(ctx, c.initialToken) +} + +// Scopes are the OAuth 2.0 scopes the current account is authorized for. +func (c *SDKConfig) Scopes() []string { + return c.conf.Scopes +} + +// sdkConfigPath tries to guess where the gcloud config is located. +// It can be overridden during tests. +var sdkConfigPath = func() (string, error) { + if runtime.GOOS == "windows" { + return filepath.Join(os.Getenv("APPDATA"), "gcloud"), nil + } + homeDir := guessUnixHomeDir() + if homeDir == "" { + return "", errors.New("unable to get current user home directory: os/user lookup failed; $HOME is empty") + } + return filepath.Join(homeDir, ".config", "gcloud"), nil +} + +func guessUnixHomeDir() string { + // Prefer $HOME over user.Current due to glibc bug: golang.org/issue/13470 + if v := os.Getenv("HOME"); v != "" { + return v + } + // Else, fall back to user.Current: + if u, err := user.Current(); err == nil { + return u.HomeDir + } + return "" +} diff --git a/vendor/golang.org/x/oauth2/internal/oauth2.go b/vendor/golang.org/x/oauth2/internal/oauth2.go new file mode 100644 index 0000000..e31541b --- /dev/null +++ b/vendor/golang.org/x/oauth2/internal/oauth2.go @@ -0,0 +1,76 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package internal contains support packages for oauth2 package. +package internal + +import ( + "bufio" + "crypto/rsa" + "crypto/x509" + "encoding/pem" + "errors" + "fmt" + "io" + "strings" +) + +// ParseKey converts the binary contents of a private key file +// to an *rsa.PrivateKey. It detects whether the private key is in a +// PEM container or not. If so, it extracts the the private key +// from PEM container before conversion. It only supports PEM +// containers with no passphrase. +func ParseKey(key []byte) (*rsa.PrivateKey, error) { + block, _ := pem.Decode(key) + if block != nil { + key = block.Bytes + } + parsedKey, err := x509.ParsePKCS8PrivateKey(key) + if err != nil { + parsedKey, err = x509.ParsePKCS1PrivateKey(key) + if err != nil { + return nil, fmt.Errorf("private key should be a PEM or plain PKSC1 or PKCS8; parse error: %v", err) + } + } + parsed, ok := parsedKey.(*rsa.PrivateKey) + if !ok { + return nil, errors.New("private key is invalid") + } + return parsed, nil +} + +func ParseINI(ini io.Reader) (map[string]map[string]string, error) { + result := map[string]map[string]string{ + "": {}, // root section + } + scanner := bufio.NewScanner(ini) + currentSection := "" + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + if strings.HasPrefix(line, ";") { + // comment. + continue + } + if strings.HasPrefix(line, "[") && strings.HasSuffix(line, "]") { + currentSection = strings.TrimSpace(line[1 : len(line)-1]) + result[currentSection] = map[string]string{} + continue + } + parts := strings.SplitN(line, "=", 2) + if len(parts) == 2 && parts[0] != "" { + result[currentSection][strings.TrimSpace(parts[0])] = strings.TrimSpace(parts[1]) + } + } + if err := scanner.Err(); err != nil { + return nil, fmt.Errorf("error scanning ini: %v", err) + } + return result, nil +} + +func CondVal(v string) []string { + if v == "" { + return nil + } + return []string{v} +} diff --git a/vendor/golang.org/x/oauth2/internal/token.go b/vendor/golang.org/x/oauth2/internal/token.go new file mode 100644 index 0000000..0487c81 --- /dev/null +++ b/vendor/golang.org/x/oauth2/internal/token.go @@ -0,0 +1,251 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package internal contains support packages for oauth2 package. +package internal + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "mime" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" +) + +// Token represents the crendentials used to authorize +// the requests to access protected resources on the OAuth 2.0 +// provider's backend. +// +// This type is a mirror of oauth2.Token and exists to break +// an otherwise-circular dependency. Other internal packages +// should convert this Token into an oauth2.Token before use. +type Token struct { + // AccessToken is the token that authorizes and authenticates + // the requests. + AccessToken string + + // TokenType is the type of token. + // The Type method returns either this or "Bearer", the default. + TokenType string + + // RefreshToken is a token that's used by the application + // (as opposed to the user) to refresh the access token + // if it expires. + RefreshToken string + + // Expiry is the optional expiration time of the access token. + // + // If zero, TokenSource implementations will reuse the same + // token forever and RefreshToken or equivalent + // mechanisms for that TokenSource will not be used. + Expiry time.Time + + // Raw optionally contains extra metadata from the server + // when updating a token. + Raw interface{} +} + +// tokenJSON is the struct representing the HTTP response from OAuth2 +// providers returning a token in JSON form. +type tokenJSON struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + RefreshToken string `json:"refresh_token"` + ExpiresIn expirationTime `json:"expires_in"` // at least PayPal returns string, while most return number + Expires expirationTime `json:"expires"` // broken Facebook spelling of expires_in +} + +func (e *tokenJSON) expiry() (t time.Time) { + if v := e.ExpiresIn; v != 0 { + return time.Now().Add(time.Duration(v) * time.Second) + } + if v := e.Expires; v != 0 { + return time.Now().Add(time.Duration(v) * time.Second) + } + return +} + +type expirationTime int32 + +func (e *expirationTime) UnmarshalJSON(b []byte) error { + var n json.Number + err := json.Unmarshal(b, &n) + if err != nil { + return err + } + i, err := n.Int64() + if err != nil { + return err + } + *e = expirationTime(i) + return nil +} + +var brokenAuthHeaderProviders = []string{ + "https://accounts.google.com/", + "https://api.codeswholesale.com/oauth/token", + "https://api.dropbox.com/", + "https://api.dropboxapi.com/", + "https://api.instagram.com/", + "https://api.netatmo.net/", + "https://api.odnoklassniki.ru/", + "https://api.pushbullet.com/", + "https://api.soundcloud.com/", + "https://api.twitch.tv/", + "https://app.box.com/", + "https://connect.stripe.com/", + "https://graph.facebook.com", // see https://github.com/golang/oauth2/issues/214 + "https://login.microsoftonline.com/", + "https://login.salesforce.com/", + "https://login.windows.net", + "https://oauth.sandbox.trainingpeaks.com/", + "https://oauth.trainingpeaks.com/", + "https://oauth.vk.com/", + "https://openapi.baidu.com/", + "https://slack.com/", + "https://test-sandbox.auth.corp.google.com", + "https://test.salesforce.com/", + "https://user.gini.net/", + "https://www.douban.com/", + "https://www.googleapis.com/", + "https://www.linkedin.com/", + "https://www.strava.com/oauth/", + "https://www.wunderlist.com/oauth/", + "https://api.patreon.com/", + "https://sandbox.codeswholesale.com/oauth/token", + "https://api.sipgate.com/v1/authorization/oauth", +} + +// brokenAuthHeaderDomains lists broken providers that issue dynamic endpoints. +var brokenAuthHeaderDomains = []string{ + ".force.com", + ".myshopify.com", + ".okta.com", + ".oktapreview.com", +} + +func RegisterBrokenAuthHeaderProvider(tokenURL string) { + brokenAuthHeaderProviders = append(brokenAuthHeaderProviders, tokenURL) +} + +// providerAuthHeaderWorks reports whether the OAuth2 server identified by the tokenURL +// implements the OAuth2 spec correctly +// See https://code.google.com/p/goauth2/issues/detail?id=31 for background. +// In summary: +// - Reddit only accepts client secret in the Authorization header +// - Dropbox accepts either it in URL param or Auth header, but not both. +// - Google only accepts URL param (not spec compliant?), not Auth header +// - Stripe only accepts client secret in Auth header with Bearer method, not Basic +func providerAuthHeaderWorks(tokenURL string) bool { + for _, s := range brokenAuthHeaderProviders { + if strings.HasPrefix(tokenURL, s) { + // Some sites fail to implement the OAuth2 spec fully. + return false + } + } + + if u, err := url.Parse(tokenURL); err == nil { + for _, s := range brokenAuthHeaderDomains { + if strings.HasSuffix(u.Host, s) { + return false + } + } + } + + // Assume the provider implements the spec properly + // otherwise. We can add more exceptions as they're + // discovered. We will _not_ be adding configurable hooks + // to this package to let users select server bugs. + return true +} + +func RetrieveToken(ctx context.Context, clientID, clientSecret, tokenURL string, v url.Values) (*Token, error) { + hc, err := ContextClient(ctx) + if err != nil { + return nil, err + } + bustedAuth := !providerAuthHeaderWorks(tokenURL) + if bustedAuth { + if clientID != "" { + v.Set("client_id", clientID) + } + if clientSecret != "" { + v.Set("client_secret", clientSecret) + } + } + req, err := http.NewRequest("POST", tokenURL, strings.NewReader(v.Encode())) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/x-www-form-urlencoded") + if !bustedAuth { + req.SetBasicAuth(clientID, clientSecret) + } + r, err := ctxhttp.Do(ctx, hc, req) + if err != nil { + return nil, err + } + defer r.Body.Close() + body, err := ioutil.ReadAll(io.LimitReader(r.Body, 1<<20)) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + if code := r.StatusCode; code < 200 || code > 299 { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v\nResponse: %s", r.Status, body) + } + + var token *Token + content, _, _ := mime.ParseMediaType(r.Header.Get("Content-Type")) + switch content { + case "application/x-www-form-urlencoded", "text/plain": + vals, err := url.ParseQuery(string(body)) + if err != nil { + return nil, err + } + token = &Token{ + AccessToken: vals.Get("access_token"), + TokenType: vals.Get("token_type"), + RefreshToken: vals.Get("refresh_token"), + Raw: vals, + } + e := vals.Get("expires_in") + if e == "" { + // TODO(jbd): Facebook's OAuth2 implementation is broken and + // returns expires_in field in expires. Remove the fallback to expires, + // when Facebook fixes their implementation. + e = vals.Get("expires") + } + expires, _ := strconv.Atoi(e) + if expires != 0 { + token.Expiry = time.Now().Add(time.Duration(expires) * time.Second) + } + default: + var tj tokenJSON + if err = json.Unmarshal(body, &tj); err != nil { + return nil, err + } + token = &Token{ + AccessToken: tj.AccessToken, + TokenType: tj.TokenType, + RefreshToken: tj.RefreshToken, + Expiry: tj.expiry(), + Raw: make(map[string]interface{}), + } + json.Unmarshal(body, &token.Raw) // no error checks for optional fields + } + // Don't overwrite `RefreshToken` with an empty value + // if this was a token refreshing request. + if token.RefreshToken == "" { + token.RefreshToken = v.Get("refresh_token") + } + return token, nil +} diff --git a/vendor/golang.org/x/oauth2/internal/transport.go b/vendor/golang.org/x/oauth2/internal/transport.go new file mode 100644 index 0000000..f1f173e --- /dev/null +++ b/vendor/golang.org/x/oauth2/internal/transport.go @@ -0,0 +1,69 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package internal contains support packages for oauth2 package. +package internal + +import ( + "net/http" + + "golang.org/x/net/context" +) + +// HTTPClient is the context key to use with golang.org/x/net/context's +// WithValue function to associate an *http.Client value with a context. +var HTTPClient ContextKey + +// ContextKey is just an empty struct. It exists so HTTPClient can be +// an immutable public variable with a unique type. It's immutable +// because nobody else can create a ContextKey, being unexported. +type ContextKey struct{} + +// ContextClientFunc is a func which tries to return an *http.Client +// given a Context value. If it returns an error, the search stops +// with that error. If it returns (nil, nil), the search continues +// down the list of registered funcs. +type ContextClientFunc func(context.Context) (*http.Client, error) + +var contextClientFuncs []ContextClientFunc + +func RegisterContextClientFunc(fn ContextClientFunc) { + contextClientFuncs = append(contextClientFuncs, fn) +} + +func ContextClient(ctx context.Context) (*http.Client, error) { + if ctx != nil { + if hc, ok := ctx.Value(HTTPClient).(*http.Client); ok { + return hc, nil + } + } + for _, fn := range contextClientFuncs { + c, err := fn(ctx) + if err != nil { + return nil, err + } + if c != nil { + return c, nil + } + } + return http.DefaultClient, nil +} + +func ContextTransport(ctx context.Context) http.RoundTripper { + hc, err := ContextClient(ctx) + // This is a rare error case (somebody using nil on App Engine). + if err != nil { + return ErrorTransport{err} + } + return hc.Transport +} + +// ErrorTransport returns the specified error on RoundTrip. +// This RoundTripper should be used in rare error cases where +// error handling can be postponed to response handling time. +type ErrorTransport struct{ Err error } + +func (t ErrorTransport) RoundTrip(*http.Request) (*http.Response, error) { + return nil, t.Err +} diff --git a/vendor/golang.org/x/oauth2/jws/jws.go b/vendor/golang.org/x/oauth2/jws/jws.go new file mode 100644 index 0000000..683d2d2 --- /dev/null +++ b/vendor/golang.org/x/oauth2/jws/jws.go @@ -0,0 +1,182 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package jws provides a partial implementation +// of JSON Web Signature encoding and decoding. +// It exists to support the golang.org/x/oauth2 package. +// +// See RFC 7515. +// +// Deprecated: this package is not intended for public use and might be +// removed in the future. It exists for internal use only. +// Please switch to another JWS package or copy this package into your own +// source tree. +package jws // import "golang.org/x/oauth2/jws" + +import ( + "bytes" + "crypto" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "strings" + "time" +) + +// ClaimSet contains information about the JWT signature including the +// permissions being requested (scopes), the target of the token, the issuer, +// the time the token was issued, and the lifetime of the token. +type ClaimSet struct { + Iss string `json:"iss"` // email address of the client_id of the application making the access token request + Scope string `json:"scope,omitempty"` // space-delimited list of the permissions the application requests + Aud string `json:"aud"` // descriptor of the intended target of the assertion (Optional). + Exp int64 `json:"exp"` // the expiration time of the assertion (seconds since Unix epoch) + Iat int64 `json:"iat"` // the time the assertion was issued (seconds since Unix epoch) + Typ string `json:"typ,omitempty"` // token type (Optional). + + // Email for which the application is requesting delegated access (Optional). + Sub string `json:"sub,omitempty"` + + // The old name of Sub. Client keeps setting Prn to be + // complaint with legacy OAuth 2.0 providers. (Optional) + Prn string `json:"prn,omitempty"` + + // See http://tools.ietf.org/html/draft-jones-json-web-token-10#section-4.3 + // This array is marshalled using custom code (see (c *ClaimSet) encode()). + PrivateClaims map[string]interface{} `json:"-"` +} + +func (c *ClaimSet) encode() (string, error) { + // Reverting time back for machines whose time is not perfectly in sync. + // If client machine's time is in the future according + // to Google servers, an access token will not be issued. + now := time.Now().Add(-10 * time.Second) + if c.Iat == 0 { + c.Iat = now.Unix() + } + if c.Exp == 0 { + c.Exp = now.Add(time.Hour).Unix() + } + if c.Exp < c.Iat { + return "", fmt.Errorf("jws: invalid Exp = %v; must be later than Iat = %v", c.Exp, c.Iat) + } + + b, err := json.Marshal(c) + if err != nil { + return "", err + } + + if len(c.PrivateClaims) == 0 { + return base64.RawURLEncoding.EncodeToString(b), nil + } + + // Marshal private claim set and then append it to b. + prv, err := json.Marshal(c.PrivateClaims) + if err != nil { + return "", fmt.Errorf("jws: invalid map of private claims %v", c.PrivateClaims) + } + + // Concatenate public and private claim JSON objects. + if !bytes.HasSuffix(b, []byte{'}'}) { + return "", fmt.Errorf("jws: invalid JSON %s", b) + } + if !bytes.HasPrefix(prv, []byte{'{'}) { + return "", fmt.Errorf("jws: invalid JSON %s", prv) + } + b[len(b)-1] = ',' // Replace closing curly brace with a comma. + b = append(b, prv[1:]...) // Append private claims. + return base64.RawURLEncoding.EncodeToString(b), nil +} + +// Header represents the header for the signed JWS payloads. +type Header struct { + // The algorithm used for signature. + Algorithm string `json:"alg"` + + // Represents the token type. + Typ string `json:"typ"` + + // The optional hint of which key is being used. + KeyID string `json:"kid,omitempty"` +} + +func (h *Header) encode() (string, error) { + b, err := json.Marshal(h) + if err != nil { + return "", err + } + return base64.RawURLEncoding.EncodeToString(b), nil +} + +// Decode decodes a claim set from a JWS payload. +func Decode(payload string) (*ClaimSet, error) { + // decode returned id token to get expiry + s := strings.Split(payload, ".") + if len(s) < 2 { + // TODO(jbd): Provide more context about the error. + return nil, errors.New("jws: invalid token received") + } + decoded, err := base64.RawURLEncoding.DecodeString(s[1]) + if err != nil { + return nil, err + } + c := &ClaimSet{} + err = json.NewDecoder(bytes.NewBuffer(decoded)).Decode(c) + return c, err +} + +// Signer returns a signature for the given data. +type Signer func(data []byte) (sig []byte, err error) + +// EncodeWithSigner encodes a header and claim set with the provided signer. +func EncodeWithSigner(header *Header, c *ClaimSet, sg Signer) (string, error) { + head, err := header.encode() + if err != nil { + return "", err + } + cs, err := c.encode() + if err != nil { + return "", err + } + ss := fmt.Sprintf("%s.%s", head, cs) + sig, err := sg([]byte(ss)) + if err != nil { + return "", err + } + return fmt.Sprintf("%s.%s", ss, base64.RawURLEncoding.EncodeToString(sig)), nil +} + +// Encode encodes a signed JWS with provided header and claim set. +// This invokes EncodeWithSigner using crypto/rsa.SignPKCS1v15 with the given RSA private key. +func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error) { + sg := func(data []byte) (sig []byte, err error) { + h := sha256.New() + h.Write(data) + return rsa.SignPKCS1v15(rand.Reader, key, crypto.SHA256, h.Sum(nil)) + } + return EncodeWithSigner(header, c, sg) +} + +// Verify tests whether the provided JWT token's signature was produced by the private key +// associated with the supplied public key. +func Verify(token string, key *rsa.PublicKey) error { + parts := strings.Split(token, ".") + if len(parts) != 3 { + return errors.New("jws: invalid token received, token must have 3 parts") + } + + signedContent := parts[0] + "." + parts[1] + signatureString, err := base64.RawURLEncoding.DecodeString(parts[2]) + if err != nil { + return err + } + + h := sha256.New() + h.Write([]byte(signedContent)) + return rsa.VerifyPKCS1v15(key, crypto.SHA256, h.Sum(nil), []byte(signatureString)) +} diff --git a/vendor/golang.org/x/oauth2/jwt/jwt.go b/vendor/golang.org/x/oauth2/jwt/jwt.go new file mode 100644 index 0000000..e016db4 --- /dev/null +++ b/vendor/golang.org/x/oauth2/jwt/jwt.go @@ -0,0 +1,159 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package jwt implements the OAuth 2.0 JSON Web Token flow, commonly +// known as "two-legged OAuth 2.0". +// +// See: https://tools.ietf.org/html/draft-ietf-oauth-jwt-bearer-12 +package jwt + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2" + "golang.org/x/oauth2/internal" + "golang.org/x/oauth2/jws" +) + +var ( + defaultGrantType = "urn:ietf:params:oauth:grant-type:jwt-bearer" + defaultHeader = &jws.Header{Algorithm: "RS256", Typ: "JWT"} +) + +// Config is the configuration for using JWT to fetch tokens, +// commonly known as "two-legged OAuth 2.0". +type Config struct { + // Email is the OAuth client identifier used when communicating with + // the configured OAuth provider. + Email string + + // PrivateKey contains the contents of an RSA private key or the + // contents of a PEM file that contains a private key. The provided + // private key is used to sign JWT payloads. + // PEM containers with a passphrase are not supported. + // Use the following command to convert a PKCS 12 file into a PEM. + // + // $ openssl pkcs12 -in key.p12 -out key.pem -nodes + // + PrivateKey []byte + + // PrivateKeyID contains an optional hint indicating which key is being + // used. + PrivateKeyID string + + // Subject is the optional user to impersonate. + Subject string + + // Scopes optionally specifies a list of requested permission scopes. + Scopes []string + + // TokenURL is the endpoint required to complete the 2-legged JWT flow. + TokenURL string + + // Expires optionally specifies how long the token is valid for. + Expires time.Duration +} + +// TokenSource returns a JWT TokenSource using the configuration +// in c and the HTTP client from the provided context. +func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource { + return oauth2.ReuseTokenSource(nil, jwtSource{ctx, c}) +} + +// Client returns an HTTP client wrapping the context's +// HTTP transport and adding Authorization headers with tokens +// obtained from c. +// +// The returned client and its Transport should not be modified. +func (c *Config) Client(ctx context.Context) *http.Client { + return oauth2.NewClient(ctx, c.TokenSource(ctx)) +} + +// jwtSource is a source that always does a signed JWT request for a token. +// It should typically be wrapped with a reuseTokenSource. +type jwtSource struct { + ctx context.Context + conf *Config +} + +func (js jwtSource) Token() (*oauth2.Token, error) { + pk, err := internal.ParseKey(js.conf.PrivateKey) + if err != nil { + return nil, err + } + hc := oauth2.NewClient(js.ctx, nil) + claimSet := &jws.ClaimSet{ + Iss: js.conf.Email, + Scope: strings.Join(js.conf.Scopes, " "), + Aud: js.conf.TokenURL, + } + if subject := js.conf.Subject; subject != "" { + claimSet.Sub = subject + // prn is the old name of sub. Keep setting it + // to be compatible with legacy OAuth 2.0 providers. + claimSet.Prn = subject + } + if t := js.conf.Expires; t > 0 { + claimSet.Exp = time.Now().Add(t).Unix() + } + h := *defaultHeader + h.KeyID = js.conf.PrivateKeyID + payload, err := jws.Encode(&h, claimSet, pk) + if err != nil { + return nil, err + } + v := url.Values{} + v.Set("grant_type", defaultGrantType) + v.Set("assertion", payload) + resp, err := hc.PostForm(js.conf.TokenURL, v) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + if c := resp.StatusCode; c < 200 || c > 299 { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v\nResponse: %s", resp.Status, body) + } + // tokenRes is the JSON response body. + var tokenRes struct { + AccessToken string `json:"access_token"` + TokenType string `json:"token_type"` + IDToken string `json:"id_token"` + ExpiresIn int64 `json:"expires_in"` // relative seconds from now + } + if err := json.Unmarshal(body, &tokenRes); err != nil { + return nil, fmt.Errorf("oauth2: cannot fetch token: %v", err) + } + token := &oauth2.Token{ + AccessToken: tokenRes.AccessToken, + TokenType: tokenRes.TokenType, + } + raw := make(map[string]interface{}) + json.Unmarshal(body, &raw) // no error checks for optional fields + token = token.WithExtra(raw) + + if secs := tokenRes.ExpiresIn; secs > 0 { + token.Expiry = time.Now().Add(time.Duration(secs) * time.Second) + } + if v := tokenRes.IDToken; v != "" { + // decode returned id token to get expiry + claimSet, err := jws.Decode(v) + if err != nil { + return nil, fmt.Errorf("oauth2: error decoding JWT token: %v", err) + } + token.Expiry = time.Unix(claimSet.Exp, 0) + } + return token, nil +} diff --git a/vendor/golang.org/x/oauth2/oauth2.go b/vendor/golang.org/x/oauth2/oauth2.go new file mode 100644 index 0000000..3e4835d --- /dev/null +++ b/vendor/golang.org/x/oauth2/oauth2.go @@ -0,0 +1,340 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package oauth2 provides support for making +// OAuth2 authorized and authenticated HTTP requests. +// It can additionally grant authorization with Bearer JWT. +package oauth2 // import "golang.org/x/oauth2" + +import ( + "bytes" + "errors" + "net/http" + "net/url" + "strings" + "sync" + + "golang.org/x/net/context" + "golang.org/x/oauth2/internal" +) + +// NoContext is the default context you should supply if not using +// your own context.Context (see https://golang.org/x/net/context). +// +// Deprecated: Use context.Background() or context.TODO() instead. +var NoContext = context.TODO() + +// RegisterBrokenAuthHeaderProvider registers an OAuth2 server +// identified by the tokenURL prefix as an OAuth2 implementation +// which doesn't support the HTTP Basic authentication +// scheme to authenticate with the authorization server. +// Once a server is registered, credentials (client_id and client_secret) +// will be passed as query parameters rather than being present +// in the Authorization header. +// See https://code.google.com/p/goauth2/issues/detail?id=31 for background. +func RegisterBrokenAuthHeaderProvider(tokenURL string) { + internal.RegisterBrokenAuthHeaderProvider(tokenURL) +} + +// Config describes a typical 3-legged OAuth2 flow, with both the +// client application information and the server's endpoint URLs. +// For the client credentials 2-legged OAuth2 flow, see the clientcredentials +// package (https://golang.org/x/oauth2/clientcredentials). +type Config struct { + // ClientID is the application's ID. + ClientID string + + // ClientSecret is the application's secret. + ClientSecret string + + // Endpoint contains the resource server's token endpoint + // URLs. These are constants specific to each server and are + // often available via site-specific packages, such as + // google.Endpoint or github.Endpoint. + Endpoint Endpoint + + // RedirectURL is the URL to redirect users going through + // the OAuth flow, after the resource owner's URLs. + RedirectURL string + + // Scope specifies optional requested permissions. + Scopes []string +} + +// A TokenSource is anything that can return a token. +type TokenSource interface { + // Token returns a token or an error. + // Token must be safe for concurrent use by multiple goroutines. + // The returned Token must not be modified. + Token() (*Token, error) +} + +// Endpoint contains the OAuth 2.0 provider's authorization and token +// endpoint URLs. +type Endpoint struct { + AuthURL string + TokenURL string +} + +var ( + // AccessTypeOnline and AccessTypeOffline are options passed + // to the Options.AuthCodeURL method. They modify the + // "access_type" field that gets sent in the URL returned by + // AuthCodeURL. + // + // Online is the default if neither is specified. If your + // application needs to refresh access tokens when the user + // is not present at the browser, then use offline. This will + // result in your application obtaining a refresh token the + // first time your application exchanges an authorization + // code for a user. + AccessTypeOnline AuthCodeOption = SetAuthURLParam("access_type", "online") + AccessTypeOffline AuthCodeOption = SetAuthURLParam("access_type", "offline") + + // ApprovalForce forces the users to view the consent dialog + // and confirm the permissions request at the URL returned + // from AuthCodeURL, even if they've already done so. + ApprovalForce AuthCodeOption = SetAuthURLParam("approval_prompt", "force") +) + +// An AuthCodeOption is passed to Config.AuthCodeURL. +type AuthCodeOption interface { + setValue(url.Values) +} + +type setParam struct{ k, v string } + +func (p setParam) setValue(m url.Values) { m.Set(p.k, p.v) } + +// SetAuthURLParam builds an AuthCodeOption which passes key/value parameters +// to a provider's authorization endpoint. +func SetAuthURLParam(key, value string) AuthCodeOption { + return setParam{key, value} +} + +// AuthCodeURL returns a URL to OAuth 2.0 provider's consent page +// that asks for permissions for the required scopes explicitly. +// +// State is a token to protect the user from CSRF attacks. You must +// always provide a non-zero string and validate that it matches the +// the state query parameter on your redirect callback. +// See http://tools.ietf.org/html/rfc6749#section-10.12 for more info. +// +// Opts may include AccessTypeOnline or AccessTypeOffline, as well +// as ApprovalForce. +func (c *Config) AuthCodeURL(state string, opts ...AuthCodeOption) string { + var buf bytes.Buffer + buf.WriteString(c.Endpoint.AuthURL) + v := url.Values{ + "response_type": {"code"}, + "client_id": {c.ClientID}, + "redirect_uri": internal.CondVal(c.RedirectURL), + "scope": internal.CondVal(strings.Join(c.Scopes, " ")), + "state": internal.CondVal(state), + } + for _, opt := range opts { + opt.setValue(v) + } + if strings.Contains(c.Endpoint.AuthURL, "?") { + buf.WriteByte('&') + } else { + buf.WriteByte('?') + } + buf.WriteString(v.Encode()) + return buf.String() +} + +// PasswordCredentialsToken converts a resource owner username and password +// pair into a token. +// +// Per the RFC, this grant type should only be used "when there is a high +// degree of trust between the resource owner and the client (e.g., the client +// is part of the device operating system or a highly privileged application), +// and when other authorization grant types are not available." +// See https://tools.ietf.org/html/rfc6749#section-4.3 for more info. +// +// The HTTP client to use is derived from the context. +// If nil, http.DefaultClient is used. +func (c *Config) PasswordCredentialsToken(ctx context.Context, username, password string) (*Token, error) { + return retrieveToken(ctx, c, url.Values{ + "grant_type": {"password"}, + "username": {username}, + "password": {password}, + "scope": internal.CondVal(strings.Join(c.Scopes, " ")), + }) +} + +// Exchange converts an authorization code into a token. +// +// It is used after a resource provider redirects the user back +// to the Redirect URI (the URL obtained from AuthCodeURL). +// +// The HTTP client to use is derived from the context. +// If a client is not provided via the context, http.DefaultClient is used. +// +// The code will be in the *http.Request.FormValue("code"). Before +// calling Exchange, be sure to validate FormValue("state"). +func (c *Config) Exchange(ctx context.Context, code string) (*Token, error) { + return retrieveToken(ctx, c, url.Values{ + "grant_type": {"authorization_code"}, + "code": {code}, + "redirect_uri": internal.CondVal(c.RedirectURL), + }) +} + +// Client returns an HTTP client using the provided token. +// The token will auto-refresh as necessary. The underlying +// HTTP transport will be obtained using the provided context. +// The returned client and its Transport should not be modified. +func (c *Config) Client(ctx context.Context, t *Token) *http.Client { + return NewClient(ctx, c.TokenSource(ctx, t)) +} + +// TokenSource returns a TokenSource that returns t until t expires, +// automatically refreshing it as necessary using the provided context. +// +// Most users will use Config.Client instead. +func (c *Config) TokenSource(ctx context.Context, t *Token) TokenSource { + tkr := &tokenRefresher{ + ctx: ctx, + conf: c, + } + if t != nil { + tkr.refreshToken = t.RefreshToken + } + return &reuseTokenSource{ + t: t, + new: tkr, + } +} + +// tokenRefresher is a TokenSource that makes "grant_type"=="refresh_token" +// HTTP requests to renew a token using a RefreshToken. +type tokenRefresher struct { + ctx context.Context // used to get HTTP requests + conf *Config + refreshToken string +} + +// WARNING: Token is not safe for concurrent access, as it +// updates the tokenRefresher's refreshToken field. +// Within this package, it is used by reuseTokenSource which +// synchronizes calls to this method with its own mutex. +func (tf *tokenRefresher) Token() (*Token, error) { + if tf.refreshToken == "" { + return nil, errors.New("oauth2: token expired and refresh token is not set") + } + + tk, err := retrieveToken(tf.ctx, tf.conf, url.Values{ + "grant_type": {"refresh_token"}, + "refresh_token": {tf.refreshToken}, + }) + + if err != nil { + return nil, err + } + if tf.refreshToken != tk.RefreshToken { + tf.refreshToken = tk.RefreshToken + } + return tk, err +} + +// reuseTokenSource is a TokenSource that holds a single token in memory +// and validates its expiry before each call to retrieve it with +// Token. If it's expired, it will be auto-refreshed using the +// new TokenSource. +type reuseTokenSource struct { + new TokenSource // called when t is expired. + + mu sync.Mutex // guards t + t *Token +} + +// Token returns the current token if it's still valid, else will +// refresh the current token (using r.Context for HTTP client +// information) and return the new one. +func (s *reuseTokenSource) Token() (*Token, error) { + s.mu.Lock() + defer s.mu.Unlock() + if s.t.Valid() { + return s.t, nil + } + t, err := s.new.Token() + if err != nil { + return nil, err + } + s.t = t + return t, nil +} + +// StaticTokenSource returns a TokenSource that always returns the same token. +// Because the provided token t is never refreshed, StaticTokenSource is only +// useful for tokens that never expire. +func StaticTokenSource(t *Token) TokenSource { + return staticTokenSource{t} +} + +// staticTokenSource is a TokenSource that always returns the same Token. +type staticTokenSource struct { + t *Token +} + +func (s staticTokenSource) Token() (*Token, error) { + return s.t, nil +} + +// HTTPClient is the context key to use with golang.org/x/net/context's +// WithValue function to associate an *http.Client value with a context. +var HTTPClient internal.ContextKey + +// NewClient creates an *http.Client from a Context and TokenSource. +// The returned client is not valid beyond the lifetime of the context. +// +// As a special case, if src is nil, a non-OAuth2 client is returned +// using the provided context. This exists to support related OAuth2 +// packages. +func NewClient(ctx context.Context, src TokenSource) *http.Client { + if src == nil { + c, err := internal.ContextClient(ctx) + if err != nil { + return &http.Client{Transport: internal.ErrorTransport{Err: err}} + } + return c + } + return &http.Client{ + Transport: &Transport{ + Base: internal.ContextTransport(ctx), + Source: ReuseTokenSource(nil, src), + }, + } +} + +// ReuseTokenSource returns a TokenSource which repeatedly returns the +// same token as long as it's valid, starting with t. +// When its cached token is invalid, a new token is obtained from src. +// +// ReuseTokenSource is typically used to reuse tokens from a cache +// (such as a file on disk) between runs of a program, rather than +// obtaining new tokens unnecessarily. +// +// The initial token t may be nil, in which case the TokenSource is +// wrapped in a caching version if it isn't one already. This also +// means it's always safe to wrap ReuseTokenSource around any other +// TokenSource without adverse effects. +func ReuseTokenSource(t *Token, src TokenSource) TokenSource { + // Don't wrap a reuseTokenSource in itself. That would work, + // but cause an unnecessary number of mutex operations. + // Just build the equivalent one. + if rt, ok := src.(*reuseTokenSource); ok { + if t == nil { + // Just use it directly. + return rt + } + src = rt.new + } + return &reuseTokenSource{ + t: t, + new: src, + } +} diff --git a/vendor/golang.org/x/oauth2/token.go b/vendor/golang.org/x/oauth2/token.go new file mode 100644 index 0000000..7a3167f --- /dev/null +++ b/vendor/golang.org/x/oauth2/token.go @@ -0,0 +1,158 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package oauth2 + +import ( + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "golang.org/x/net/context" + "golang.org/x/oauth2/internal" +) + +// expiryDelta determines how earlier a token should be considered +// expired than its actual expiration time. It is used to avoid late +// expirations due to client-server time mismatches. +const expiryDelta = 10 * time.Second + +// Token represents the crendentials used to authorize +// the requests to access protected resources on the OAuth 2.0 +// provider's backend. +// +// Most users of this package should not access fields of Token +// directly. They're exported mostly for use by related packages +// implementing derivative OAuth2 flows. +type Token struct { + // AccessToken is the token that authorizes and authenticates + // the requests. + AccessToken string `json:"access_token"` + + // TokenType is the type of token. + // The Type method returns either this or "Bearer", the default. + TokenType string `json:"token_type,omitempty"` + + // RefreshToken is a token that's used by the application + // (as opposed to the user) to refresh the access token + // if it expires. + RefreshToken string `json:"refresh_token,omitempty"` + + // Expiry is the optional expiration time of the access token. + // + // If zero, TokenSource implementations will reuse the same + // token forever and RefreshToken or equivalent + // mechanisms for that TokenSource will not be used. + Expiry time.Time `json:"expiry,omitempty"` + + // raw optionally contains extra metadata from the server + // when updating a token. + raw interface{} +} + +// Type returns t.TokenType if non-empty, else "Bearer". +func (t *Token) Type() string { + if strings.EqualFold(t.TokenType, "bearer") { + return "Bearer" + } + if strings.EqualFold(t.TokenType, "mac") { + return "MAC" + } + if strings.EqualFold(t.TokenType, "basic") { + return "Basic" + } + if t.TokenType != "" { + return t.TokenType + } + return "Bearer" +} + +// SetAuthHeader sets the Authorization header to r using the access +// token in t. +// +// This method is unnecessary when using Transport or an HTTP Client +// returned by this package. +func (t *Token) SetAuthHeader(r *http.Request) { + r.Header.Set("Authorization", t.Type()+" "+t.AccessToken) +} + +// WithExtra returns a new Token that's a clone of t, but using the +// provided raw extra map. This is only intended for use by packages +// implementing derivative OAuth2 flows. +func (t *Token) WithExtra(extra interface{}) *Token { + t2 := new(Token) + *t2 = *t + t2.raw = extra + return t2 +} + +// Extra returns an extra field. +// Extra fields are key-value pairs returned by the server as a +// part of the token retrieval response. +func (t *Token) Extra(key string) interface{} { + if raw, ok := t.raw.(map[string]interface{}); ok { + return raw[key] + } + + vals, ok := t.raw.(url.Values) + if !ok { + return nil + } + + v := vals.Get(key) + switch s := strings.TrimSpace(v); strings.Count(s, ".") { + case 0: // Contains no "."; try to parse as int + if i, err := strconv.ParseInt(s, 10, 64); err == nil { + return i + } + case 1: // Contains a single "."; try to parse as float + if f, err := strconv.ParseFloat(s, 64); err == nil { + return f + } + } + + return v +} + +// expired reports whether the token is expired. +// t must be non-nil. +func (t *Token) expired() bool { + if t.Expiry.IsZero() { + return false + } + return t.Expiry.Add(-expiryDelta).Before(time.Now()) +} + +// Valid reports whether t is non-nil, has an AccessToken, and is not expired. +func (t *Token) Valid() bool { + return t != nil && t.AccessToken != "" && !t.expired() +} + +// tokenFromInternal maps an *internal.Token struct into +// a *Token struct. +func tokenFromInternal(t *internal.Token) *Token { + if t == nil { + return nil + } + return &Token{ + AccessToken: t.AccessToken, + TokenType: t.TokenType, + RefreshToken: t.RefreshToken, + Expiry: t.Expiry, + raw: t.Raw, + } +} + +// retrieveToken takes a *Config and uses that to retrieve an *internal.Token. +// This token is then mapped from *internal.Token into an *oauth2.Token which is returned along +// with an error.. +func retrieveToken(ctx context.Context, c *Config, v url.Values) (*Token, error) { + tk, err := internal.RetrieveToken(ctx, c.ClientID, c.ClientSecret, c.Endpoint.TokenURL, v) + if err != nil { + return nil, err + } + return tokenFromInternal(tk), nil +} diff --git a/vendor/golang.org/x/oauth2/transport.go b/vendor/golang.org/x/oauth2/transport.go new file mode 100644 index 0000000..92ac7e2 --- /dev/null +++ b/vendor/golang.org/x/oauth2/transport.go @@ -0,0 +1,132 @@ +// Copyright 2014 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package oauth2 + +import ( + "errors" + "io" + "net/http" + "sync" +) + +// Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests, +// wrapping a base RoundTripper and adding an Authorization header +// with a token from the supplied Sources. +// +// Transport is a low-level mechanism. Most code will use the +// higher-level Config.Client method instead. +type Transport struct { + // Source supplies the token to add to outgoing requests' + // Authorization headers. + Source TokenSource + + // Base is the base RoundTripper used to make HTTP requests. + // If nil, http.DefaultTransport is used. + Base http.RoundTripper + + mu sync.Mutex // guards modReq + modReq map[*http.Request]*http.Request // original -> modified +} + +// RoundTrip authorizes and authenticates the request with an +// access token. If no token exists or token is expired, +// tries to refresh/fetch a new token. +func (t *Transport) RoundTrip(req *http.Request) (*http.Response, error) { + if t.Source == nil { + return nil, errors.New("oauth2: Transport's Source is nil") + } + token, err := t.Source.Token() + if err != nil { + return nil, err + } + + req2 := cloneRequest(req) // per RoundTripper contract + token.SetAuthHeader(req2) + t.setModReq(req, req2) + res, err := t.base().RoundTrip(req2) + if err != nil { + t.setModReq(req, nil) + return nil, err + } + res.Body = &onEOFReader{ + rc: res.Body, + fn: func() { t.setModReq(req, nil) }, + } + return res, nil +} + +// CancelRequest cancels an in-flight request by closing its connection. +func (t *Transport) CancelRequest(req *http.Request) { + type canceler interface { + CancelRequest(*http.Request) + } + if cr, ok := t.base().(canceler); ok { + t.mu.Lock() + modReq := t.modReq[req] + delete(t.modReq, req) + t.mu.Unlock() + cr.CancelRequest(modReq) + } +} + +func (t *Transport) base() http.RoundTripper { + if t.Base != nil { + return t.Base + } + return http.DefaultTransport +} + +func (t *Transport) setModReq(orig, mod *http.Request) { + t.mu.Lock() + defer t.mu.Unlock() + if t.modReq == nil { + t.modReq = make(map[*http.Request]*http.Request) + } + if mod == nil { + delete(t.modReq, orig) + } else { + t.modReq[orig] = mod + } +} + +// cloneRequest returns a clone of the provided *http.Request. +// The clone is a shallow copy of the struct and its Header map. +func cloneRequest(r *http.Request) *http.Request { + // shallow copy of the struct + r2 := new(http.Request) + *r2 = *r + // deep copy of the Header + r2.Header = make(http.Header, len(r.Header)) + for k, s := range r.Header { + r2.Header[k] = append([]string(nil), s...) + } + return r2 +} + +type onEOFReader struct { + rc io.ReadCloser + fn func() +} + +func (r *onEOFReader) Read(p []byte) (n int, err error) { + n, err = r.rc.Read(p) + if err == io.EOF { + r.runFunc() + } + return +} + +func (r *onEOFReader) Close() error { + err := r.rc.Close() + r.runFunc() + return err +} + +func (r *onEOFReader) runFunc() { + if fn := r.fn; fn != nil { + fn() + r.fn = nil + } +} diff --git a/vendor/google.golang.org/api/LICENSE b/vendor/google.golang.org/api/LICENSE new file mode 100644 index 0000000..263aa7a --- /dev/null +++ b/vendor/google.golang.org/api/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2011 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/google.golang.org/api/gensupport/backoff.go b/vendor/google.golang.org/api/gensupport/backoff.go new file mode 100644 index 0000000..1356140 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/backoff.go @@ -0,0 +1,46 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "math/rand" + "time" +) + +type BackoffStrategy interface { + // Pause returns the duration of the next pause and true if the operation should be + // retried, or false if no further retries should be attempted. + Pause() (time.Duration, bool) + + // Reset restores the strategy to its initial state. + Reset() +} + +// ExponentialBackoff performs exponential backoff as per https://en.wikipedia.org/wiki/Exponential_backoff. +// The initial pause time is given by Base. +// Once the total pause time exceeds Max, Pause will indicate no further retries. +type ExponentialBackoff struct { + Base time.Duration + Max time.Duration + total time.Duration + n uint +} + +func (eb *ExponentialBackoff) Pause() (time.Duration, bool) { + if eb.total > eb.Max { + return 0, false + } + + // The next pause is selected from randomly from [0, 2^n * Base). + d := time.Duration(rand.Int63n((1 << eb.n) * int64(eb.Base))) + eb.total += d + eb.n++ + return d, true +} + +func (eb *ExponentialBackoff) Reset() { + eb.n = 0 + eb.total = 0 +} diff --git a/vendor/google.golang.org/api/gensupport/buffer.go b/vendor/google.golang.org/api/gensupport/buffer.go new file mode 100644 index 0000000..9921049 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/buffer.go @@ -0,0 +1,77 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "bytes" + "io" + + "google.golang.org/api/googleapi" +) + +// MediaBuffer buffers data from an io.Reader to support uploading media in retryable chunks. +type MediaBuffer struct { + media io.Reader + + chunk []byte // The current chunk which is pending upload. The capacity is the chunk size. + err error // Any error generated when populating chunk by reading media. + + // The absolute position of chunk in the underlying media. + off int64 +} + +func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer { + return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)} +} + +// Chunk returns the current buffered chunk, the offset in the underlying media +// from which the chunk is drawn, and the size of the chunk. +// Successive calls to Chunk return the same chunk between calls to Next. +func (mb *MediaBuffer) Chunk() (chunk io.Reader, off int64, size int, err error) { + // There may already be data in chunk if Next has not been called since the previous call to Chunk. + if mb.err == nil && len(mb.chunk) == 0 { + mb.err = mb.loadChunk() + } + return bytes.NewReader(mb.chunk), mb.off, len(mb.chunk), mb.err +} + +// loadChunk will read from media into chunk, up to the capacity of chunk. +func (mb *MediaBuffer) loadChunk() error { + bufSize := cap(mb.chunk) + mb.chunk = mb.chunk[:bufSize] + + read := 0 + var err error + for err == nil && read < bufSize { + var n int + n, err = mb.media.Read(mb.chunk[read:]) + read += n + } + mb.chunk = mb.chunk[:read] + return err +} + +// Next advances to the next chunk, which will be returned by the next call to Chunk. +// Calls to Next without a corresponding prior call to Chunk will have no effect. +func (mb *MediaBuffer) Next() { + mb.off += int64(len(mb.chunk)) + mb.chunk = mb.chunk[0:0] +} + +type readerTyper struct { + io.Reader + googleapi.ContentTyper +} + +// ReaderAtToReader adapts a ReaderAt to be used as a Reader. +// If ra implements googleapi.ContentTyper, then the returned reader +// will also implement googleapi.ContentTyper, delegating to ra. +func ReaderAtToReader(ra io.ReaderAt, size int64) io.Reader { + r := io.NewSectionReader(ra, 0, size) + if typer, ok := ra.(googleapi.ContentTyper); ok { + return readerTyper{r, typer} + } + return r +} diff --git a/vendor/google.golang.org/api/gensupport/doc.go b/vendor/google.golang.org/api/gensupport/doc.go new file mode 100644 index 0000000..752c4b4 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/doc.go @@ -0,0 +1,10 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package gensupport is an internal implementation detail used by code +// generated by the google-api-go-generator tool. +// +// This package may be modified at any time without regard for backwards +// compatibility. It should not be used directly by API users. +package gensupport diff --git a/vendor/google.golang.org/api/gensupport/header.go b/vendor/google.golang.org/api/gensupport/header.go new file mode 100644 index 0000000..cb5e67c --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/header.go @@ -0,0 +1,22 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "fmt" + "runtime" + "strings" +) + +// GoogleClientHeader returns the value to use for the x-goog-api-client +// header, which is used internally by Google. +func GoogleClientHeader(generatorVersion, clientElement string) string { + elts := []string{"gl-go/" + strings.Replace(runtime.Version(), " ", "_", -1)} + if clientElement != "" { + elts = append(elts, clientElement) + } + elts = append(elts, fmt.Sprintf("gdcl/%s", generatorVersion)) + return strings.Join(elts, " ") +} diff --git a/vendor/google.golang.org/api/gensupport/json.go b/vendor/google.golang.org/api/gensupport/json.go new file mode 100644 index 0000000..c01e321 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/json.go @@ -0,0 +1,211 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "encoding/json" + "fmt" + "reflect" + "strings" +) + +// MarshalJSON returns a JSON encoding of schema containing only selected fields. +// A field is selected if any of the following is true: +// * it has a non-empty value +// * its field name is present in forceSendFields and it is not a nil pointer or nil interface +// * its field name is present in nullFields. +// The JSON key for each selected field is taken from the field's json: struct tag. +func MarshalJSON(schema interface{}, forceSendFields, nullFields []string) ([]byte, error) { + if len(forceSendFields) == 0 && len(nullFields) == 0 { + return json.Marshal(schema) + } + + mustInclude := make(map[string]bool) + for _, f := range forceSendFields { + mustInclude[f] = true + } + useNull := make(map[string]bool) + useNullMaps := make(map[string]map[string]bool) + for _, nf := range nullFields { + parts := strings.SplitN(nf, ".", 2) + field := parts[0] + if len(parts) == 1 { + useNull[field] = true + } else { + if useNullMaps[field] == nil { + useNullMaps[field] = map[string]bool{} + } + useNullMaps[field][parts[1]] = true + } + } + + dataMap, err := schemaToMap(schema, mustInclude, useNull, useNullMaps) + if err != nil { + return nil, err + } + return json.Marshal(dataMap) +} + +func schemaToMap(schema interface{}, mustInclude, useNull map[string]bool, useNullMaps map[string]map[string]bool) (map[string]interface{}, error) { + m := make(map[string]interface{}) + s := reflect.ValueOf(schema) + st := s.Type() + + for i := 0; i < s.NumField(); i++ { + jsonTag := st.Field(i).Tag.Get("json") + if jsonTag == "" { + continue + } + tag, err := parseJSONTag(jsonTag) + if err != nil { + return nil, err + } + if tag.ignore { + continue + } + + v := s.Field(i) + f := st.Field(i) + + if useNull[f.Name] { + if !isEmptyValue(v) { + return nil, fmt.Errorf("field %q in NullFields has non-empty value", f.Name) + } + m[tag.apiName] = nil + continue + } + + if !includeField(v, f, mustInclude) { + continue + } + + // If map fields are explicitly set to null, use a map[string]interface{}. + if f.Type.Kind() == reflect.Map && useNullMaps[f.Name] != nil { + ms, ok := v.Interface().(map[string]string) + if !ok { + return nil, fmt.Errorf("field %q has keys in NullFields but is not a map[string]string", f.Name) + } + mi := map[string]interface{}{} + for k, v := range ms { + mi[k] = v + } + for k := range useNullMaps[f.Name] { + mi[k] = nil + } + m[tag.apiName] = mi + continue + } + + // nil maps are treated as empty maps. + if f.Type.Kind() == reflect.Map && v.IsNil() { + m[tag.apiName] = map[string]string{} + continue + } + + // nil slices are treated as empty slices. + if f.Type.Kind() == reflect.Slice && v.IsNil() { + m[tag.apiName] = []bool{} + continue + } + + if tag.stringFormat { + m[tag.apiName] = formatAsString(v, f.Type.Kind()) + } else { + m[tag.apiName] = v.Interface() + } + } + return m, nil +} + +// formatAsString returns a string representation of v, dereferencing it first if possible. +func formatAsString(v reflect.Value, kind reflect.Kind) string { + if kind == reflect.Ptr && !v.IsNil() { + v = v.Elem() + } + + return fmt.Sprintf("%v", v.Interface()) +} + +// jsonTag represents a restricted version of the struct tag format used by encoding/json. +// It is used to describe the JSON encoding of fields in a Schema struct. +type jsonTag struct { + apiName string + stringFormat bool + ignore bool +} + +// parseJSONTag parses a restricted version of the struct tag format used by encoding/json. +// The format of the tag must match that generated by the Schema.writeSchemaStruct method +// in the api generator. +func parseJSONTag(val string) (jsonTag, error) { + if val == "-" { + return jsonTag{ignore: true}, nil + } + + var tag jsonTag + + i := strings.Index(val, ",") + if i == -1 || val[:i] == "" { + return tag, fmt.Errorf("malformed json tag: %s", val) + } + + tag = jsonTag{ + apiName: val[:i], + } + + switch val[i+1:] { + case "omitempty": + case "omitempty,string": + tag.stringFormat = true + default: + return tag, fmt.Errorf("malformed json tag: %s", val) + } + + return tag, nil +} + +// Reports whether the struct field "f" with value "v" should be included in JSON output. +func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]bool) bool { + // The regular JSON encoding of a nil pointer is "null", which means "delete this field". + // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set. + // However, many fields are not pointers, so there would be no way to delete these fields. + // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields. + // Deletion will be handled by a separate mechanism. + if f.Type.Kind() == reflect.Ptr && v.IsNil() { + return false + } + + // The "any" type is represented as an interface{}. If this interface + // is nil, there is no reasonable representation to send. We ignore + // these fields, for the same reasons as given above for pointers. + if f.Type.Kind() == reflect.Interface && v.IsNil() { + return false + } + + return mustInclude[f.Name] || !isEmptyValue(v) +} + +// isEmptyValue reports whether v is the empty value for its type. This +// implementation is based on that of the encoding/json package, but its +// correctness does not depend on it being identical. What's important is that +// this function return false in situations where v should not be sent as part +// of a PATCH operation. +func isEmptyValue(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + } + return false +} diff --git a/vendor/google.golang.org/api/gensupport/jsonfloat.go b/vendor/google.golang.org/api/gensupport/jsonfloat.go new file mode 100644 index 0000000..cb02335 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/jsonfloat.go @@ -0,0 +1,57 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gensupport + +import ( + "encoding/json" + "errors" + "fmt" + "math" +) + +// JSONFloat64 is a float64 that supports proper unmarshaling of special float +// values in JSON, according to +// https://developers.google.com/protocol-buffers/docs/proto3#json. Although +// that is a proto-to-JSON spec, it applies to all Google APIs. +// +// The jsonpb package +// (https://github.com/golang/protobuf/blob/master/jsonpb/jsonpb.go) has +// similar functionality, but only for direct translation from proto messages +// to JSON. +type JSONFloat64 float64 + +func (f *JSONFloat64) UnmarshalJSON(data []byte) error { + var ff float64 + if err := json.Unmarshal(data, &ff); err == nil { + *f = JSONFloat64(ff) + return nil + } + var s string + if err := json.Unmarshal(data, &s); err == nil { + switch s { + case "NaN": + ff = math.NaN() + case "Infinity": + ff = math.Inf(1) + case "-Infinity": + ff = math.Inf(-1) + default: + return fmt.Errorf("google.golang.org/api/internal: bad float string %q", s) + } + *f = JSONFloat64(ff) + return nil + } + return errors.New("google.golang.org/api/internal: data not float or string") +} diff --git a/vendor/google.golang.org/api/gensupport/media.go b/vendor/google.golang.org/api/gensupport/media.go new file mode 100644 index 0000000..c6410e8 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/media.go @@ -0,0 +1,199 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "fmt" + "io" + "io/ioutil" + "mime/multipart" + "net/http" + "net/textproto" + + "google.golang.org/api/googleapi" +) + +const sniffBuffSize = 512 + +func newContentSniffer(r io.Reader) *contentSniffer { + return &contentSniffer{r: r} +} + +// contentSniffer wraps a Reader, and reports the content type determined by sniffing up to 512 bytes from the Reader. +type contentSniffer struct { + r io.Reader + start []byte // buffer for the sniffed bytes. + err error // set to any error encountered while reading bytes to be sniffed. + + ctype string // set on first sniff. + sniffed bool // set to true on first sniff. +} + +func (cs *contentSniffer) Read(p []byte) (n int, err error) { + // Ensure that the content type is sniffed before any data is consumed from Reader. + _, _ = cs.ContentType() + + if len(cs.start) > 0 { + n := copy(p, cs.start) + cs.start = cs.start[n:] + return n, nil + } + + // We may have read some bytes into start while sniffing, even if the read ended in an error. + // We should first return those bytes, then the error. + if cs.err != nil { + return 0, cs.err + } + + // Now we have handled all bytes that were buffered while sniffing. Now just delegate to the underlying reader. + return cs.r.Read(p) +} + +// ContentType returns the sniffed content type, and whether the content type was succesfully sniffed. +func (cs *contentSniffer) ContentType() (string, bool) { + if cs.sniffed { + return cs.ctype, cs.ctype != "" + } + cs.sniffed = true + // If ReadAll hits EOF, it returns err==nil. + cs.start, cs.err = ioutil.ReadAll(io.LimitReader(cs.r, sniffBuffSize)) + + // Don't try to detect the content type based on possibly incomplete data. + if cs.err != nil { + return "", false + } + + cs.ctype = http.DetectContentType(cs.start) + return cs.ctype, true +} + +// DetermineContentType determines the content type of the supplied reader. +// If the content type is already known, it can be specified via ctype. +// Otherwise, the content of media will be sniffed to determine the content type. +// If media implements googleapi.ContentTyper (deprecated), this will be used +// instead of sniffing the content. +// After calling DetectContentType the caller must not perform further reads on +// media, but rather read from the Reader that is returned. +func DetermineContentType(media io.Reader, ctype string) (io.Reader, string) { + // Note: callers could avoid calling DetectContentType if ctype != "", + // but doing the check inside this function reduces the amount of + // generated code. + if ctype != "" { + return media, ctype + } + + // For backwards compatability, allow clients to set content + // type by providing a ContentTyper for media. + if typer, ok := media.(googleapi.ContentTyper); ok { + return media, typer.ContentType() + } + + sniffer := newContentSniffer(media) + if ctype, ok := sniffer.ContentType(); ok { + return sniffer, ctype + } + // If content type could not be sniffed, reads from sniffer will eventually fail with an error. + return sniffer, "" +} + +type typeReader struct { + io.Reader + typ string +} + +// multipartReader combines the contents of multiple readers to creat a multipart/related HTTP body. +// Close must be called if reads from the multipartReader are abandoned before reaching EOF. +type multipartReader struct { + pr *io.PipeReader + pipeOpen bool + ctype string +} + +func newMultipartReader(parts []typeReader) *multipartReader { + mp := &multipartReader{pipeOpen: true} + var pw *io.PipeWriter + mp.pr, pw = io.Pipe() + mpw := multipart.NewWriter(pw) + mp.ctype = "multipart/related; boundary=" + mpw.Boundary() + go func() { + for _, part := range parts { + w, err := mpw.CreatePart(typeHeader(part.typ)) + if err != nil { + mpw.Close() + pw.CloseWithError(fmt.Errorf("googleapi: CreatePart failed: %v", err)) + return + } + _, err = io.Copy(w, part.Reader) + if err != nil { + mpw.Close() + pw.CloseWithError(fmt.Errorf("googleapi: Copy failed: %v", err)) + return + } + } + + mpw.Close() + pw.Close() + }() + return mp +} + +func (mp *multipartReader) Read(data []byte) (n int, err error) { + return mp.pr.Read(data) +} + +func (mp *multipartReader) Close() error { + if !mp.pipeOpen { + return nil + } + mp.pipeOpen = false + return mp.pr.Close() +} + +// CombineBodyMedia combines a json body with media content to create a multipart/related HTTP body. +// It returns a ReadCloser containing the combined body, and the overall "multipart/related" content type, with random boundary. +// +// The caller must call Close on the returned ReadCloser if reads are abandoned before reaching EOF. +func CombineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType string) (io.ReadCloser, string) { + mp := newMultipartReader([]typeReader{ + {body, bodyContentType}, + {media, mediaContentType}, + }) + return mp, mp.ctype +} + +func typeHeader(contentType string) textproto.MIMEHeader { + h := make(textproto.MIMEHeader) + if contentType != "" { + h.Set("Content-Type", contentType) + } + return h +} + +// PrepareUpload determines whether the data in the supplied reader should be +// uploaded in a single request, or in sequential chunks. +// chunkSize is the size of the chunk that media should be split into. +// If chunkSize is non-zero and the contents of media do not fit in a single +// chunk (or there is an error reading media), then media will be returned as a +// MediaBuffer. Otherwise, media will be returned as a Reader. +// +// After PrepareUpload has been called, media should no longer be used: the +// media content should be accessed via one of the return values. +func PrepareUpload(media io.Reader, chunkSize int) (io.Reader, *MediaBuffer) { + if chunkSize == 0 { // do not chunk + return media, nil + } + + mb := NewMediaBuffer(media, chunkSize) + rdr, _, _, err := mb.Chunk() + + if err == io.EOF { // we can upload this in a single request + return rdr, nil + } + // err might be a non-EOF error. If it is, the next call to mb.Chunk will + // return the same error. Returning a MediaBuffer ensures that this error + // will be handled at some point. + + return nil, mb +} diff --git a/vendor/google.golang.org/api/gensupport/params.go b/vendor/google.golang.org/api/gensupport/params.go new file mode 100644 index 0000000..3b3c743 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/params.go @@ -0,0 +1,50 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "net/url" + + "google.golang.org/api/googleapi" +) + +// URLParams is a simplified replacement for url.Values +// that safely builds up URL parameters for encoding. +type URLParams map[string][]string + +// Get returns the first value for the given key, or "". +func (u URLParams) Get(key string) string { + vs := u[key] + if len(vs) == 0 { + return "" + } + return vs[0] +} + +// Set sets the key to value. +// It replaces any existing values. +func (u URLParams) Set(key, value string) { + u[key] = []string{value} +} + +// SetMulti sets the key to an array of values. +// It replaces any existing values. +// Note that values must not be modified after calling SetMulti +// so the caller is responsible for making a copy if necessary. +func (u URLParams) SetMulti(key string, values []string) { + u[key] = values +} + +// Encode encodes the values into ``URL encoded'' form +// ("bar=baz&foo=quux") sorted by key. +func (u URLParams) Encode() string { + return url.Values(u).Encode() +} + +func SetOptions(u URLParams, opts ...googleapi.CallOption) { + for _, o := range opts { + u.Set(o.Get()) + } +} diff --git a/vendor/google.golang.org/api/gensupport/resumable.go b/vendor/google.golang.org/api/gensupport/resumable.go new file mode 100644 index 0000000..dcd591f --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/resumable.go @@ -0,0 +1,217 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "errors" + "fmt" + "io" + "net/http" + "sync" + "time" + + "golang.org/x/net/context" +) + +const ( + // statusTooManyRequests is returned by the storage API if the + // per-project limits have been temporarily exceeded. The request + // should be retried. + // https://cloud.google.com/storage/docs/json_api/v1/status-codes#standardcodes + statusTooManyRequests = 429 +) + +// ResumableUpload is used by the generated APIs to provide resumable uploads. +// It is not used by developers directly. +type ResumableUpload struct { + Client *http.Client + // URI is the resumable resource destination provided by the server after specifying "&uploadType=resumable". + URI string + UserAgent string // User-Agent for header of the request + // Media is the object being uploaded. + Media *MediaBuffer + // MediaType defines the media type, e.g. "image/jpeg". + MediaType string + + mu sync.Mutex // guards progress + progress int64 // number of bytes uploaded so far + + // Callback is an optional function that will be periodically called with the cumulative number of bytes uploaded. + Callback func(int64) + + // If not specified, a default exponential backoff strategy will be used. + Backoff BackoffStrategy +} + +// Progress returns the number of bytes uploaded at this point. +func (rx *ResumableUpload) Progress() int64 { + rx.mu.Lock() + defer rx.mu.Unlock() + return rx.progress +} + +// doUploadRequest performs a single HTTP request to upload data. +// off specifies the offset in rx.Media from which data is drawn. +// size is the number of bytes in data. +// final specifies whether data is the final chunk to be uploaded. +func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader, off, size int64, final bool) (*http.Response, error) { + req, err := http.NewRequest("POST", rx.URI, data) + if err != nil { + return nil, err + } + + req.ContentLength = size + var contentRange string + if final { + if size == 0 { + contentRange = fmt.Sprintf("bytes */%v", off) + } else { + contentRange = fmt.Sprintf("bytes %v-%v/%v", off, off+size-1, off+size) + } + } else { + contentRange = fmt.Sprintf("bytes %v-%v/*", off, off+size-1) + } + req.Header.Set("Content-Range", contentRange) + req.Header.Set("Content-Type", rx.MediaType) + req.Header.Set("User-Agent", rx.UserAgent) + + // Google's upload endpoint uses status code 308 for a + // different purpose than the "308 Permanent Redirect" + // since-standardized in RFC 7238. Because of the conflict in + // semantics, Google added this new request header which + // causes it to not use "308" and instead reply with 200 OK + // and sets the upload-specific "X-HTTP-Status-Code-Override: + // 308" response header. + req.Header.Set("X-GUploader-No-308", "yes") + + return SendRequest(ctx, rx.Client, req) +} + +func statusResumeIncomplete(resp *http.Response) bool { + // This is how the server signals "status resume incomplete" + // when X-GUploader-No-308 is set to "yes": + return resp != nil && resp.Header.Get("X-Http-Status-Code-Override") == "308" +} + +// reportProgress calls a user-supplied callback to report upload progress. +// If old==updated, the callback is not called. +func (rx *ResumableUpload) reportProgress(old, updated int64) { + if updated-old == 0 { + return + } + rx.mu.Lock() + rx.progress = updated + rx.mu.Unlock() + if rx.Callback != nil { + rx.Callback(updated) + } +} + +// transferChunk performs a single HTTP request to upload a single chunk from rx.Media. +func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, error) { + chunk, off, size, err := rx.Media.Chunk() + + done := err == io.EOF + if !done && err != nil { + return nil, err + } + + res, err := rx.doUploadRequest(ctx, chunk, off, int64(size), done) + if err != nil { + return res, err + } + + // We sent "X-GUploader-No-308: yes" (see comment elsewhere in + // this file), so we don't expect to get a 308. + if res.StatusCode == 308 { + return nil, errors.New("unexpected 308 response status code") + } + + if res.StatusCode == http.StatusOK { + rx.reportProgress(off, off+int64(size)) + } + + if statusResumeIncomplete(res) { + rx.Media.Next() + } + return res, nil +} + +func contextDone(ctx context.Context) bool { + select { + case <-ctx.Done(): + return true + default: + return false + } +} + +// Upload starts the process of a resumable upload with a cancellable context. +// It retries using the provided back off strategy until cancelled or the +// strategy indicates to stop retrying. +// It is called from the auto-generated API code and is not visible to the user. +// Before sending an HTTP request, Upload calls any registered hook functions, +// and calls the returned functions after the request returns (see send.go). +// rx is private to the auto-generated API code. +// Exactly one of resp or err will be nil. If resp is non-nil, the caller must call resp.Body.Close. +func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err error) { + var pause time.Duration + backoff := rx.Backoff + if backoff == nil { + backoff = DefaultBackoffStrategy() + } + + for { + // Ensure that we return in the case of cancelled context, even if pause is 0. + if contextDone(ctx) { + return nil, ctx.Err() + } + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-time.After(pause): + } + + resp, err = rx.transferChunk(ctx) + + var status int + if resp != nil { + status = resp.StatusCode + } + + // Check if we should retry the request. + if shouldRetry(status, err) { + var retry bool + pause, retry = backoff.Pause() + if retry { + if resp != nil && resp.Body != nil { + resp.Body.Close() + } + continue + } + } + + // If the chunk was uploaded successfully, but there's still + // more to go, upload the next chunk without any delay. + if statusResumeIncomplete(resp) { + pause = 0 + backoff.Reset() + resp.Body.Close() + continue + } + + // It's possible for err and resp to both be non-nil here, but we expose a simpler + // contract to our callers: exactly one of resp and err will be non-nil. This means + // that any response body must be closed here before returning a non-nil error. + if err != nil { + if resp != nil && resp.Body != nil { + resp.Body.Close() + } + return nil, err + } + + return resp, nil + } +} diff --git a/vendor/google.golang.org/api/gensupport/retry.go b/vendor/google.golang.org/api/gensupport/retry.go new file mode 100644 index 0000000..c60b3c3 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/retry.go @@ -0,0 +1,85 @@ +// Copyright 2017 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package gensupport + +import ( + "io" + "net" + "net/http" + "time" + + "golang.org/x/net/context" +) + +// Retry invokes the given function, retrying it multiple times if the connection failed or +// the HTTP status response indicates the request should be attempted again. ctx may be nil. +func Retry(ctx context.Context, f func() (*http.Response, error), backoff BackoffStrategy) (*http.Response, error) { + for { + resp, err := f() + + var status int + if resp != nil { + status = resp.StatusCode + } + + // Return if we shouldn't retry. + pause, retry := backoff.Pause() + if !shouldRetry(status, err) || !retry { + return resp, err + } + + // Ensure the response body is closed, if any. + if resp != nil && resp.Body != nil { + resp.Body.Close() + } + + // Pause, but still listen to ctx.Done if context is not nil. + var done <-chan struct{} + if ctx != nil { + done = ctx.Done() + } + select { + case <-done: + return nil, ctx.Err() + case <-time.After(pause): + } + } +} + +// DefaultBackoffStrategy returns a default strategy to use for retrying failed upload requests. +func DefaultBackoffStrategy() BackoffStrategy { + return &ExponentialBackoff{ + Base: 250 * time.Millisecond, + Max: 16 * time.Second, + } +} + +// shouldRetry returns true if the HTTP response / error indicates that the +// request should be attempted again. +func shouldRetry(status int, err error) bool { + if 500 <= status && status <= 599 { + return true + } + if status == statusTooManyRequests { + return true + } + if err == io.ErrUnexpectedEOF { + return true + } + if err, ok := err.(net.Error); ok { + return err.Temporary() + } + return false +} diff --git a/vendor/google.golang.org/api/gensupport/send.go b/vendor/google.golang.org/api/gensupport/send.go new file mode 100644 index 0000000..092044f --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/send.go @@ -0,0 +1,61 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "errors" + "net/http" + + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" +) + +// Hook is the type of a function that is called once before each HTTP request +// that is sent by a generated API. It returns a function that is called after +// the request returns. +// Hooks are not called if the context is nil. +type Hook func(ctx context.Context, req *http.Request) func(resp *http.Response) + +var hooks []Hook + +// RegisterHook registers a Hook to be called before each HTTP request by a +// generated API. Hooks are called in the order they are registered. Each +// hook can return a function; if it is non-nil, it is called after the HTTP +// request returns. These functions are called in the reverse order. +// RegisterHook should not be called concurrently with itself or SendRequest. +func RegisterHook(h Hook) { + hooks = append(hooks, h) +} + +// SendRequest sends a single HTTP request using the given client. +// If ctx is non-nil, it calls all hooks, then sends the request with +// ctxhttp.Do, then calls any functions returned by the hooks in reverse order. +func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + // Disallow Accept-Encoding because it interferes with the automatic gzip handling + // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219. + if _, ok := req.Header["Accept-Encoding"]; ok { + return nil, errors.New("google api: custom Accept-Encoding headers not allowed") + } + if ctx == nil { + return client.Do(req) + } + // Call hooks in order of registration, store returned funcs. + post := make([]func(resp *http.Response), len(hooks)) + for i, h := range hooks { + fn := h(ctx, req) + post[i] = fn + } + + // Send request. + resp, err := ctxhttp.Do(ctx, client, req) + + // Call returned funcs in reverse order. + for i := len(post) - 1; i >= 0; i-- { + if fn := post[i]; fn != nil { + fn(resp) + } + } + return resp, err +} diff --git a/vendor/google.golang.org/api/googleapi/googleapi.go b/vendor/google.golang.org/api/googleapi/googleapi.go new file mode 100644 index 0000000..f6e15be --- /dev/null +++ b/vendor/google.golang.org/api/googleapi/googleapi.go @@ -0,0 +1,406 @@ +// Copyright 2011 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package googleapi contains the common code shared by all Google API +// libraries. +package googleapi // import "google.golang.org/api/googleapi" + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "net/url" + "strings" + + "google.golang.org/api/googleapi/internal/uritemplates" +) + +// ContentTyper is an interface for Readers which know (or would like +// to override) their Content-Type. If a media body doesn't implement +// ContentTyper, the type is sniffed from the content using +// http.DetectContentType. +type ContentTyper interface { + ContentType() string +} + +// A SizeReaderAt is a ReaderAt with a Size method. +// An io.SectionReader implements SizeReaderAt. +type SizeReaderAt interface { + io.ReaderAt + Size() int64 +} + +// ServerResponse is embedded in each Do response and +// provides the HTTP status code and header sent by the server. +type ServerResponse struct { + // HTTPStatusCode is the server's response status code. + // When using a resource method's Do call, this will always be in the 2xx range. + HTTPStatusCode int + // Header contains the response header fields from the server. + Header http.Header +} + +const ( + Version = "0.5" + + // UserAgent is the header string used to identify this package. + UserAgent = "google-api-go-client/" + Version + + // The default chunk size to use for resumable uploads if not specified by the user. + DefaultUploadChunkSize = 8 * 1024 * 1024 + + // The minimum chunk size that can be used for resumable uploads. All + // user-specified chunk sizes must be multiple of this value. + MinUploadChunkSize = 256 * 1024 +) + +// Error contains an error response from the server. +type Error struct { + // Code is the HTTP response status code and will always be populated. + Code int `json:"code"` + // Message is the server response message and is only populated when + // explicitly referenced by the JSON server response. + Message string `json:"message"` + // Body is the raw response returned by the server. + // It is often but not always JSON, depending on how the request fails. + Body string + // Header contains the response header fields from the server. + Header http.Header + + Errors []ErrorItem +} + +// ErrorItem is a detailed error code & message from the Google API frontend. +type ErrorItem struct { + // Reason is the typed error code. For example: "some_example". + Reason string `json:"reason"` + // Message is the human-readable description of the error. + Message string `json:"message"` +} + +func (e *Error) Error() string { + if len(e.Errors) == 0 && e.Message == "" { + return fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", e.Code, e.Body) + } + var buf bytes.Buffer + fmt.Fprintf(&buf, "googleapi: Error %d: ", e.Code) + if e.Message != "" { + fmt.Fprintf(&buf, "%s", e.Message) + } + if len(e.Errors) == 0 { + return strings.TrimSpace(buf.String()) + } + if len(e.Errors) == 1 && e.Errors[0].Message == e.Message { + fmt.Fprintf(&buf, ", %s", e.Errors[0].Reason) + return buf.String() + } + fmt.Fprintln(&buf, "\nMore details:") + for _, v := range e.Errors { + fmt.Fprintf(&buf, "Reason: %s, Message: %s\n", v.Reason, v.Message) + } + return buf.String() +} + +type errorReply struct { + Error *Error `json:"error"` +} + +// CheckResponse returns an error (of type *Error) if the response +// status code is not 2xx. +func CheckResponse(res *http.Response) error { + if res.StatusCode >= 200 && res.StatusCode <= 299 { + return nil + } + slurp, err := ioutil.ReadAll(res.Body) + if err == nil { + jerr := new(errorReply) + err = json.Unmarshal(slurp, jerr) + if err == nil && jerr.Error != nil { + if jerr.Error.Code == 0 { + jerr.Error.Code = res.StatusCode + } + jerr.Error.Body = string(slurp) + return jerr.Error + } + } + return &Error{ + Code: res.StatusCode, + Body: string(slurp), + Header: res.Header, + } +} + +// IsNotModified reports whether err is the result of the +// server replying with http.StatusNotModified. +// Such error values are sometimes returned by "Do" methods +// on calls when If-None-Match is used. +func IsNotModified(err error) bool { + if err == nil { + return false + } + ae, ok := err.(*Error) + return ok && ae.Code == http.StatusNotModified +} + +// CheckMediaResponse returns an error (of type *Error) if the response +// status code is not 2xx. Unlike CheckResponse it does not assume the +// body is a JSON error document. +// It is the caller's responsibility to close res.Body. +func CheckMediaResponse(res *http.Response) error { + if res.StatusCode >= 200 && res.StatusCode <= 299 { + return nil + } + slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20)) + return &Error{ + Code: res.StatusCode, + Body: string(slurp), + } +} + +type MarshalStyle bool + +var WithDataWrapper = MarshalStyle(true) +var WithoutDataWrapper = MarshalStyle(false) + +func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) { + buf := new(bytes.Buffer) + if wrap { + buf.Write([]byte(`{"data": `)) + } + err := json.NewEncoder(buf).Encode(v) + if err != nil { + return nil, err + } + if wrap { + buf.Write([]byte(`}`)) + } + return buf, nil +} + +// endingWithErrorReader from r until it returns an error. If the +// final error from r is io.EOF and e is non-nil, e is used instead. +type endingWithErrorReader struct { + r io.Reader + e error +} + +func (er endingWithErrorReader) Read(p []byte) (n int, err error) { + n, err = er.r.Read(p) + if err == io.EOF && er.e != nil { + err = er.e + } + return +} + +// countingWriter counts the number of bytes it receives to write, but +// discards them. +type countingWriter struct { + n *int64 +} + +func (w countingWriter) Write(p []byte) (int, error) { + *w.n += int64(len(p)) + return len(p), nil +} + +// ProgressUpdater is a function that is called upon every progress update of a resumable upload. +// This is the only part of a resumable upload (from googleapi) that is usable by the developer. +// The remaining usable pieces of resumable uploads is exposed in each auto-generated API. +type ProgressUpdater func(current, total int64) + +type MediaOption interface { + setOptions(o *MediaOptions) +} + +type contentTypeOption string + +func (ct contentTypeOption) setOptions(o *MediaOptions) { + o.ContentType = string(ct) + if o.ContentType == "" { + o.ForceEmptyContentType = true + } +} + +// ContentType returns a MediaOption which sets the Content-Type header for media uploads. +// If ctype is empty, the Content-Type header will be omitted. +func ContentType(ctype string) MediaOption { + return contentTypeOption(ctype) +} + +type chunkSizeOption int + +func (cs chunkSizeOption) setOptions(o *MediaOptions) { + size := int(cs) + if size%MinUploadChunkSize != 0 { + size += MinUploadChunkSize - (size % MinUploadChunkSize) + } + o.ChunkSize = size +} + +// ChunkSize returns a MediaOption which sets the chunk size for media uploads. +// size will be rounded up to the nearest multiple of 256K. +// Media which contains fewer than size bytes will be uploaded in a single request. +// Media which contains size bytes or more will be uploaded in separate chunks. +// If size is zero, media will be uploaded in a single request. +func ChunkSize(size int) MediaOption { + return chunkSizeOption(size) +} + +// MediaOptions stores options for customizing media upload. It is not used by developers directly. +type MediaOptions struct { + ContentType string + ForceEmptyContentType bool + + ChunkSize int +} + +// ProcessMediaOptions stores options from opts in a MediaOptions. +// It is not used by developers directly. +func ProcessMediaOptions(opts []MediaOption) *MediaOptions { + mo := &MediaOptions{ChunkSize: DefaultUploadChunkSize} + for _, o := range opts { + o.setOptions(mo) + } + return mo +} + +func ResolveRelative(basestr, relstr string) string { + u, _ := url.Parse(basestr) + rel, _ := url.Parse(relstr) + u = u.ResolveReference(rel) + us := u.String() + us = strings.Replace(us, "%7B", "{", -1) + us = strings.Replace(us, "%7D", "}", -1) + return us +} + +// Expand subsitutes any {encoded} strings in the URL passed in using +// the map supplied. +// +// This calls SetOpaque to avoid encoding of the parameters in the URL path. +func Expand(u *url.URL, expansions map[string]string) { + escaped, unescaped, err := uritemplates.Expand(u.Path, expansions) + if err == nil { + u.Path = unescaped + u.RawPath = escaped + } +} + +// CloseBody is used to close res.Body. +// Prior to calling Close, it also tries to Read a small amount to see an EOF. +// Not seeing an EOF can prevent HTTP Transports from reusing connections. +func CloseBody(res *http.Response) { + if res == nil || res.Body == nil { + return + } + // Justification for 3 byte reads: two for up to "\r\n" after + // a JSON/XML document, and then 1 to see EOF if we haven't yet. + // TODO(bradfitz): detect Go 1.3+ and skip these reads. + // See https://codereview.appspot.com/58240043 + // and https://codereview.appspot.com/49570044 + buf := make([]byte, 1) + for i := 0; i < 3; i++ { + _, err := res.Body.Read(buf) + if err != nil { + break + } + } + res.Body.Close() + +} + +// VariantType returns the type name of the given variant. +// If the map doesn't contain the named key or the value is not a []interface{}, "" is returned. +// This is used to support "variant" APIs that can return one of a number of different types. +func VariantType(t map[string]interface{}) string { + s, _ := t["type"].(string) + return s +} + +// ConvertVariant uses the JSON encoder/decoder to fill in the struct 'dst' with the fields found in variant 'v'. +// This is used to support "variant" APIs that can return one of a number of different types. +// It reports whether the conversion was successful. +func ConvertVariant(v map[string]interface{}, dst interface{}) bool { + var buf bytes.Buffer + err := json.NewEncoder(&buf).Encode(v) + if err != nil { + return false + } + return json.Unmarshal(buf.Bytes(), dst) == nil +} + +// A Field names a field to be retrieved with a partial response. +// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse +// +// Partial responses can dramatically reduce the amount of data that must be sent to your application. +// In order to request partial responses, you can specify the full list of fields +// that your application needs by adding the Fields option to your request. +// +// Field strings use camelCase with leading lower-case characters to identify fields within the response. +// +// For example, if your response has a "NextPageToken" and a slice of "Items" with "Id" fields, +// you could request just those fields like this: +// +// svc.Events.List().Fields("nextPageToken", "items/id").Do() +// +// or if you were also interested in each Item's "Updated" field, you can combine them like this: +// +// svc.Events.List().Fields("nextPageToken", "items(id,updated)").Do() +// +// More information about field formatting can be found here: +// https://developers.google.com/+/api/#fields-syntax +// +// Another way to find field names is through the Google API explorer: +// https://developers.google.com/apis-explorer/#p/ +type Field string + +// CombineFields combines fields into a single string. +func CombineFields(s []Field) string { + r := make([]string, len(s)) + for i, v := range s { + r[i] = string(v) + } + return strings.Join(r, ",") +} + +// A CallOption is an optional argument to an API call. +// It should be treated as an opaque value by users of Google APIs. +// +// A CallOption is something that configures an API call in a way that is +// not specific to that API; for instance, controlling the quota user for +// an API call is common across many APIs, and is thus a CallOption. +type CallOption interface { + Get() (key, value string) +} + +// QuotaUser returns a CallOption that will set the quota user for a call. +// The quota user can be used by server-side applications to control accounting. +// It can be an arbitrary string up to 40 characters, and will override UserIP +// if both are provided. +func QuotaUser(u string) CallOption { return quotaUser(u) } + +type quotaUser string + +func (q quotaUser) Get() (string, string) { return "quotaUser", string(q) } + +// UserIP returns a CallOption that will set the "userIp" parameter of a call. +// This should be the IP address of the originating request. +func UserIP(ip string) CallOption { return userIP(ip) } + +type userIP string + +func (i userIP) Get() (string, string) { return "userIp", string(i) } + +// Trace returns a CallOption that enables diagnostic tracing for a call. +// traceToken is an ID supplied by Google support. +func Trace(traceToken string) CallOption { return traceTok(traceToken) } + +type traceTok string + +func (t traceTok) Get() (string, string) { return "trace", "token:" + string(t) } + +// TODO: Fields too diff --git a/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE b/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE new file mode 100644 index 0000000..de9c88c --- /dev/null +++ b/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE @@ -0,0 +1,18 @@ +Copyright (c) 2013 Joshua Tacoma + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go b/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go new file mode 100644 index 0000000..63bf053 --- /dev/null +++ b/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go @@ -0,0 +1,248 @@ +// Copyright 2013 Joshua Tacoma. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package uritemplates is a level 3 implementation of RFC 6570 (URI +// Template, http://tools.ietf.org/html/rfc6570). +// uritemplates does not support composite values (in Go: slices or maps) +// and so does not qualify as a level 4 implementation. +package uritemplates + +import ( + "bytes" + "errors" + "regexp" + "strconv" + "strings" +) + +var ( + unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]") + reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]") + validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$") + hex = []byte("0123456789ABCDEF") +) + +func pctEncode(src []byte) []byte { + dst := make([]byte, len(src)*3) + for i, b := range src { + buf := dst[i*3 : i*3+3] + buf[0] = 0x25 + buf[1] = hex[b/16] + buf[2] = hex[b%16] + } + return dst +} + +// pairWriter is a convenience struct which allows escaped and unescaped +// versions of the template to be written in parallel. +type pairWriter struct { + escaped, unescaped bytes.Buffer +} + +// Write writes the provided string directly without any escaping. +func (w *pairWriter) Write(s string) { + w.escaped.WriteString(s) + w.unescaped.WriteString(s) +} + +// Escape writes the provided string, escaping the string for the +// escaped output. +func (w *pairWriter) Escape(s string, allowReserved bool) { + w.unescaped.WriteString(s) + if allowReserved { + w.escaped.Write(reserved.ReplaceAllFunc([]byte(s), pctEncode)) + } else { + w.escaped.Write(unreserved.ReplaceAllFunc([]byte(s), pctEncode)) + } +} + +// Escaped returns the escaped string. +func (w *pairWriter) Escaped() string { + return w.escaped.String() +} + +// Unescaped returns the unescaped string. +func (w *pairWriter) Unescaped() string { + return w.unescaped.String() +} + +// A uriTemplate is a parsed representation of a URI template. +type uriTemplate struct { + raw string + parts []templatePart +} + +// parse parses a URI template string into a uriTemplate object. +func parse(rawTemplate string) (*uriTemplate, error) { + split := strings.Split(rawTemplate, "{") + parts := make([]templatePart, len(split)*2-1) + for i, s := range split { + if i == 0 { + if strings.Contains(s, "}") { + return nil, errors.New("unexpected }") + } + parts[i].raw = s + continue + } + subsplit := strings.Split(s, "}") + if len(subsplit) != 2 { + return nil, errors.New("malformed template") + } + expression := subsplit[0] + var err error + parts[i*2-1], err = parseExpression(expression) + if err != nil { + return nil, err + } + parts[i*2].raw = subsplit[1] + } + return &uriTemplate{ + raw: rawTemplate, + parts: parts, + }, nil +} + +type templatePart struct { + raw string + terms []templateTerm + first string + sep string + named bool + ifemp string + allowReserved bool +} + +type templateTerm struct { + name string + explode bool + truncate int +} + +func parseExpression(expression string) (result templatePart, err error) { + switch expression[0] { + case '+': + result.sep = "," + result.allowReserved = true + expression = expression[1:] + case '.': + result.first = "." + result.sep = "." + expression = expression[1:] + case '/': + result.first = "/" + result.sep = "/" + expression = expression[1:] + case ';': + result.first = ";" + result.sep = ";" + result.named = true + expression = expression[1:] + case '?': + result.first = "?" + result.sep = "&" + result.named = true + result.ifemp = "=" + expression = expression[1:] + case '&': + result.first = "&" + result.sep = "&" + result.named = true + result.ifemp = "=" + expression = expression[1:] + case '#': + result.first = "#" + result.sep = "," + result.allowReserved = true + expression = expression[1:] + default: + result.sep = "," + } + rawterms := strings.Split(expression, ",") + result.terms = make([]templateTerm, len(rawterms)) + for i, raw := range rawterms { + result.terms[i], err = parseTerm(raw) + if err != nil { + break + } + } + return result, err +} + +func parseTerm(term string) (result templateTerm, err error) { + // TODO(djd): Remove "*" suffix parsing once we check that no APIs have + // mistakenly used that attribute. + if strings.HasSuffix(term, "*") { + result.explode = true + term = term[:len(term)-1] + } + split := strings.Split(term, ":") + if len(split) == 1 { + result.name = term + } else if len(split) == 2 { + result.name = split[0] + var parsed int64 + parsed, err = strconv.ParseInt(split[1], 10, 0) + result.truncate = int(parsed) + } else { + err = errors.New("multiple colons in same term") + } + if !validname.MatchString(result.name) { + err = errors.New("not a valid name: " + result.name) + } + if result.explode && result.truncate > 0 { + err = errors.New("both explode and prefix modifers on same term") + } + return result, err +} + +// Expand expands a URI template with a set of values to produce the +// resultant URI. Two forms of the result are returned: one with all the +// elements escaped, and one with the elements unescaped. +func (t *uriTemplate) Expand(values map[string]string) (escaped, unescaped string) { + var w pairWriter + for _, p := range t.parts { + p.expand(&w, values) + } + return w.Escaped(), w.Unescaped() +} + +func (tp *templatePart) expand(w *pairWriter, values map[string]string) { + if len(tp.raw) > 0 { + w.Write(tp.raw) + return + } + var first = true + for _, term := range tp.terms { + value, exists := values[term.name] + if !exists { + continue + } + if first { + w.Write(tp.first) + first = false + } else { + w.Write(tp.sep) + } + tp.expandString(w, term, value) + } +} + +func (tp *templatePart) expandName(w *pairWriter, name string, empty bool) { + if tp.named { + w.Write(name) + if empty { + w.Write(tp.ifemp) + } else { + w.Write("=") + } + } +} + +func (tp *templatePart) expandString(w *pairWriter, t templateTerm, s string) { + if len(s) > t.truncate && t.truncate > 0 { + s = s[:t.truncate] + } + tp.expandName(w, t.name, len(s) == 0) + w.Escape(s, tp.allowReserved) +} diff --git a/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go b/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go new file mode 100644 index 0000000..2e70b81 --- /dev/null +++ b/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go @@ -0,0 +1,17 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package uritemplates + +// Expand parses then expands a URI template with a set of values to produce +// the resultant URI. Two forms of the result are returned: one with all the +// elements escaped, and one with the elements unescaped. +func Expand(path string, values map[string]string) (escaped, unescaped string, err error) { + template, err := parse(path) + if err != nil { + return "", "", err + } + escaped, unescaped = template.Expand(values) + return escaped, unescaped, nil +} diff --git a/vendor/google.golang.org/api/googleapi/types.go b/vendor/google.golang.org/api/googleapi/types.go new file mode 100644 index 0000000..c8fdd54 --- /dev/null +++ b/vendor/google.golang.org/api/googleapi/types.go @@ -0,0 +1,202 @@ +// Copyright 2013 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package googleapi + +import ( + "encoding/json" + "errors" + "strconv" +) + +// Int64s is a slice of int64s that marshal as quoted strings in JSON. +type Int64s []int64 + +func (q *Int64s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return err + } + *q = append(*q, int64(v)) + } + return nil +} + +// Int32s is a slice of int32s that marshal as quoted strings in JSON. +type Int32s []int32 + +func (q *Int32s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseInt(s, 10, 32) + if err != nil { + return err + } + *q = append(*q, int32(v)) + } + return nil +} + +// Uint64s is a slice of uint64s that marshal as quoted strings in JSON. +type Uint64s []uint64 + +func (q *Uint64s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseUint(s, 10, 64) + if err != nil { + return err + } + *q = append(*q, uint64(v)) + } + return nil +} + +// Uint32s is a slice of uint32s that marshal as quoted strings in JSON. +type Uint32s []uint32 + +func (q *Uint32s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseUint(s, 10, 32) + if err != nil { + return err + } + *q = append(*q, uint32(v)) + } + return nil +} + +// Float64s is a slice of float64s that marshal as quoted strings in JSON. +type Float64s []float64 + +func (q *Float64s) UnmarshalJSON(raw []byte) error { + *q = (*q)[:0] + var ss []string + if err := json.Unmarshal(raw, &ss); err != nil { + return err + } + for _, s := range ss { + v, err := strconv.ParseFloat(s, 64) + if err != nil { + return err + } + *q = append(*q, float64(v)) + } + return nil +} + +func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) { + dst := make([]byte, 0, 2+n*10) // somewhat arbitrary + dst = append(dst, '[') + for i := 0; i < n; i++ { + if i > 0 { + dst = append(dst, ',') + } + dst = append(dst, '"') + dst = fn(dst, i) + dst = append(dst, '"') + } + dst = append(dst, ']') + return dst, nil +} + +func (s Int64s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendInt(dst, s[i], 10) + }) +} + +func (s Int32s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendInt(dst, int64(s[i]), 10) + }) +} + +func (s Uint64s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendUint(dst, s[i], 10) + }) +} + +func (s Uint32s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendUint(dst, uint64(s[i]), 10) + }) +} + +func (s Float64s) MarshalJSON() ([]byte, error) { + return quotedList(len(s), func(dst []byte, i int) []byte { + return strconv.AppendFloat(dst, s[i], 'g', -1, 64) + }) +} + +// RawMessage is a raw encoded JSON value. +// It is identical to json.RawMessage, except it does not suffer from +// https://golang.org/issue/14493. +type RawMessage []byte + +// MarshalJSON returns m. +func (m RawMessage) MarshalJSON() ([]byte, error) { + return m, nil +} + +// UnmarshalJSON sets *m to a copy of data. +func (m *RawMessage) UnmarshalJSON(data []byte) error { + if m == nil { + return errors.New("googleapi.RawMessage: UnmarshalJSON on nil pointer") + } + *m = append((*m)[:0], data...) + return nil +} + +/* + * Helper routines for simplifying the creation of optional fields of basic type. + */ + +// Bool is a helper routine that allocates a new bool value +// to store v and returns a pointer to it. +func Bool(v bool) *bool { return &v } + +// Int32 is a helper routine that allocates a new int32 value +// to store v and returns a pointer to it. +func Int32(v int32) *int32 { return &v } + +// Int64 is a helper routine that allocates a new int64 value +// to store v and returns a pointer to it. +func Int64(v int64) *int64 { return &v } + +// Float64 is a helper routine that allocates a new float64 value +// to store v and returns a pointer to it. +func Float64(v float64) *float64 { return &v } + +// Uint32 is a helper routine that allocates a new uint32 value +// to store v and returns a pointer to it. +func Uint32(v uint32) *uint32 { return &v } + +// Uint64 is a helper routine that allocates a new uint64 value +// to store v and returns a pointer to it. +func Uint64(v uint64) *uint64 { return &v } + +// String is a helper routine that allocates a new string value +// to store v and returns a pointer to it. +func String(v string) *string { return &v } diff --git a/vendor/google.golang.org/api/youtube/v3/youtube-api.json b/vendor/google.golang.org/api/youtube/v3/youtube-api.json new file mode 100644 index 0000000..cbe78ed --- /dev/null +++ b/vendor/google.golang.org/api/youtube/v3/youtube-api.json @@ -0,0 +1,10879 @@ +{ + "kind": "discovery#restDescription", + "etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/f81k8b4sv9uLeywfoj2KpL2xcPg\"", + "discoveryVersion": "v1", + "id": "youtube:v3", + "name": "youtube", + "canonicalName": "YouTube", + "version": "v3", + "revision": "20170130", + "title": "YouTube Data API", + "description": "Supports core YouTube features, such as uploading videos, creating and managing playlists, searching for content, and much more.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/youtube-16.png", + "x32": "https://www.google.com/images/icons/product/youtube-32.png" + }, + "documentationLink": "https://developers.google.com/youtube/v3", + "protocol": "rest", + "baseUrl": "https://www.googleapis.com/youtube/v3/", + "basePath": "/youtube/v3/", + "rootUrl": "https://www.googleapis.com/", + "servicePath": "youtube/v3/", + "batchPath": "batch", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" + }, + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "IP address of the site where the request originates. Use this if you want to enforce per-user limits.", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/youtube": { + "description": "Manage your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.force-ssl": { + "description": "Manage your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.readonly": { + "description": "View your YouTube account" + }, + "https://www.googleapis.com/auth/youtube.upload": { + "description": "Manage your YouTube videos" + }, + "https://www.googleapis.com/auth/youtubepartner": { + "description": "View and manage your assets and associated content on YouTube" + }, + "https://www.googleapis.com/auth/youtubepartner-channel-audit": { + "description": "View private information of your YouTube channel relevant during the audit process with a YouTube partner" + } + } + } + }, + "schemas": { + "AccessPolicy": { + "id": "AccessPolicy", + "type": "object", + "description": "Rights management policy for YouTube resources.", + "properties": { + "allowed": { + "type": "boolean", + "description": "The value of allowed indicates whether the access to the policy is allowed or denied by default." + }, + "exception": { + "type": "array", + "description": "A list of region codes that identify countries where the default policy do not apply.", + "items": { + "type": "string" + } + } + } + }, + "Activity": { + "id": "Activity", + "type": "object", + "description": "An activity resource contains information about an action that a particular channel, or user, has taken on YouTube.The actions reported in activity feeds include rating a video, sharing a video, marking a video as a favorite, commenting on a video, uploading a video, and so forth. Each activity resource identifies the type of action, the channel associated with the action, and the resource(s) associated with the action, such as the video that was rated or uploaded.", + "properties": { + "contentDetails": { + "$ref": "ActivityContentDetails", + "description": "The contentDetails object contains information about the content associated with the activity. For example, if the snippet.type value is videoRated, then the contentDetails object's content identifies the rated video." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the activity." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#activity\".", + "default": "youtube#activity" + }, + "snippet": { + "$ref": "ActivitySnippet", + "description": "The snippet object contains basic details about the activity, including the activity's type and group ID." + } + } + }, + "ActivityContentDetails": { + "id": "ActivityContentDetails", + "type": "object", + "description": "Details about the content of an activity: the video that was shared, the channel that was subscribed to, etc.", + "properties": { + "bulletin": { + "$ref": "ActivityContentDetailsBulletin", + "description": "The bulletin object contains details about a channel bulletin post. This object is only present if the snippet.type is bulletin." + }, + "channelItem": { + "$ref": "ActivityContentDetailsChannelItem", + "description": "The channelItem object contains details about a resource which was added to a channel. This property is only present if the snippet.type is channelItem." + }, + "comment": { + "$ref": "ActivityContentDetailsComment", + "description": "The comment object contains information about a resource that received a comment. This property is only present if the snippet.type is comment." + }, + "favorite": { + "$ref": "ActivityContentDetailsFavorite", + "description": "The favorite object contains information about a video that was marked as a favorite video. This property is only present if the snippet.type is favorite." + }, + "like": { + "$ref": "ActivityContentDetailsLike", + "description": "The like object contains information about a resource that received a positive (like) rating. This property is only present if the snippet.type is like." + }, + "playlistItem": { + "$ref": "ActivityContentDetailsPlaylistItem", + "description": "The playlistItem object contains information about a new playlist item. This property is only present if the snippet.type is playlistItem." + }, + "promotedItem": { + "$ref": "ActivityContentDetailsPromotedItem", + "description": "The promotedItem object contains details about a resource which is being promoted. This property is only present if the snippet.type is promotedItem." + }, + "recommendation": { + "$ref": "ActivityContentDetailsRecommendation", + "description": "The recommendation object contains information about a recommended resource. This property is only present if the snippet.type is recommendation." + }, + "social": { + "$ref": "ActivityContentDetailsSocial", + "description": "The social object contains details about a social network post. This property is only present if the snippet.type is social." + }, + "subscription": { + "$ref": "ActivityContentDetailsSubscription", + "description": "The subscription object contains information about a channel that a user subscribed to. This property is only present if the snippet.type is subscription." + }, + "upload": { + "$ref": "ActivityContentDetailsUpload", + "description": "The upload object contains information about the uploaded video. This property is only present if the snippet.type is upload." + } + } + }, + "ActivityContentDetailsBulletin": { + "id": "ActivityContentDetailsBulletin", + "type": "object", + "description": "Details about a channel bulletin post.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource associated with a bulletin post." + } + } + }, + "ActivityContentDetailsChannelItem": { + "id": "ActivityContentDetailsChannelItem", + "type": "object", + "description": "Details about a resource which was added to a channel.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource that was added to the channel." + } + } + }, + "ActivityContentDetailsComment": { + "id": "ActivityContentDetailsComment", + "type": "object", + "description": "Information about a resource that received a comment.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource associated with the comment." + } + } + }, + "ActivityContentDetailsFavorite": { + "id": "ActivityContentDetailsFavorite", + "type": "object", + "description": "Information about a video that was marked as a favorite video.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource that was marked as a favorite." + } + } + }, + "ActivityContentDetailsLike": { + "id": "ActivityContentDetailsLike", + "type": "object", + "description": "Information about a resource that received a positive (like) rating.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the rated resource." + } + } + }, + "ActivityContentDetailsPlaylistItem": { + "id": "ActivityContentDetailsPlaylistItem", + "type": "object", + "description": "Information about a new playlist item.", + "properties": { + "playlistId": { + "type": "string", + "description": "The value that YouTube uses to uniquely identify the playlist." + }, + "playlistItemId": { + "type": "string", + "description": "ID of the item within the playlist." + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information about the resource that was added to the playlist." + } + } + }, + "ActivityContentDetailsPromotedItem": { + "id": "ActivityContentDetailsPromotedItem", + "type": "object", + "description": "Details about a resource which is being promoted.", + "properties": { + "adTag": { + "type": "string", + "description": "The URL the client should fetch to request a promoted item." + }, + "clickTrackingUrl": { + "type": "string", + "description": "The URL the client should ping to indicate that the user clicked through on this promoted item." + }, + "creativeViewUrl": { + "type": "string", + "description": "The URL the client should ping to indicate that the user was shown this promoted item." + }, + "ctaType": { + "type": "string", + "description": "The type of call-to-action, a message to the user indicating action that can be taken.", + "enum": [ + "unspecified", + "visitAdvertiserSite" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "customCtaButtonText": { + "type": "string", + "description": "The custom call-to-action button text. If specified, it will override the default button text for the cta_type." + }, + "descriptionText": { + "type": "string", + "description": "The text description to accompany the promoted item." + }, + "destinationUrl": { + "type": "string", + "description": "The URL the client should direct the user to, if the user chooses to visit the advertiser's website." + }, + "forecastingUrl": { + "type": "array", + "description": "The list of forecasting URLs. The client should ping all of these URLs when a promoted item is not available, to indicate that a promoted item could have been shown.", + "items": { + "type": "string" + } + }, + "impressionUrl": { + "type": "array", + "description": "The list of impression URLs. The client should ping all of these URLs to indicate that the user was shown this promoted item.", + "items": { + "type": "string" + } + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the promoted video." + } + } + }, + "ActivityContentDetailsRecommendation": { + "id": "ActivityContentDetailsRecommendation", + "type": "object", + "description": "Information that identifies the recommended resource.", + "properties": { + "reason": { + "type": "string", + "description": "The reason that the resource is recommended to the user.", + "enum": [ + "unspecified", + "videoFavorited", + "videoLiked", + "videoWatched" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the recommended resource." + }, + "seedResourceId": { + "$ref": "ResourceId", + "description": "The seedResourceId object contains information about the resource that caused the recommendation." + } + } + }, + "ActivityContentDetailsSocial": { + "id": "ActivityContentDetailsSocial", + "type": "object", + "description": "Details about a social network post.", + "properties": { + "author": { + "type": "string", + "description": "The author of the social network post." + }, + "imageUrl": { + "type": "string", + "description": "An image of the post's author." + }, + "referenceUrl": { + "type": "string", + "description": "The URL of the social network post." + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object encapsulates information that identifies the resource associated with a social network post." + }, + "type": { + "type": "string", + "description": "The name of the social network.", + "enum": [ + "facebook", + "googlePlus", + "twitter", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "ActivityContentDetailsSubscription": { + "id": "ActivityContentDetailsSubscription", + "type": "object", + "description": "Information about a channel that a user subscribed to.", + "properties": { + "resourceId": { + "$ref": "ResourceId", + "description": "The resourceId object contains information that identifies the resource that the user subscribed to." + } + } + }, + "ActivityContentDetailsUpload": { + "id": "ActivityContentDetailsUpload", + "type": "object", + "description": "Information about the uploaded video.", + "properties": { + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the uploaded video." + } + } + }, + "ActivityListResponse": { + "id": "ActivityListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of activities, or events, that match the request criteria.", + "items": { + "$ref": "Activity" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#activityListResponse\".", + "default": "youtube#activityListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "ActivitySnippet": { + "id": "ActivitySnippet", + "type": "object", + "description": "Basic details about an activity, including title, description, thumbnails, activity type and group.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel associated with the activity." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel responsible for this activity" + }, + "description": { + "type": "string", + "description": "The description of the resource primarily associated with the activity.", + "annotations": { + "required": [ + "youtube.activities.insert" + ] + } + }, + "groupId": { + "type": "string", + "description": "The group ID associated with the activity. A group ID identifies user events that are associated with the same user and resource. For example, if a user rates a video and marks the same video as a favorite, the entries for those events would have the same group ID in the user's activity feed. In your user interface, you can avoid repetition by grouping events with the same groupId value." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the resource that is primarily associated with the activity. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The title of the resource primarily associated with the activity." + }, + "type": { + "type": "string", + "description": "The type of activity that the resource describes.", + "enum": [ + "bulletin", + "channelItem", + "comment", + "favorite", + "like", + "playlistItem", + "promotedItem", + "recommendation", + "social", + "subscription", + "upload" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "Caption": { + "id": "Caption", + "type": "object", + "description": "A caption resource represents a YouTube caption track. A caption track is associated with exactly one YouTube video.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the caption track.", + "annotations": { + "required": [ + "youtube.captions.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#caption\".", + "default": "youtube#caption" + }, + "snippet": { + "$ref": "CaptionSnippet", + "description": "The snippet object contains basic details about the caption." + } + } + }, + "CaptionListResponse": { + "id": "CaptionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of captions that match the request criteria.", + "items": { + "$ref": "Caption" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#captionListResponse\".", + "default": "youtube#captionListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "CaptionSnippet": { + "id": "CaptionSnippet", + "type": "object", + "description": "Basic details about a caption track, such as its language and name.", + "properties": { + "audioTrackType": { + "type": "string", + "description": "The type of audio track associated with the caption track.", + "enum": [ + "commentary", + "descriptive", + "primary", + "unknown" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "failureReason": { + "type": "string", + "description": "The reason that YouTube failed to process the caption track. This property is only present if the state property's value is failed.", + "enum": [ + "processingFailed", + "unknownFormat", + "unsupportedFormat" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "isAutoSynced": { + "type": "boolean", + "description": "Indicates whether YouTube synchronized the caption track to the audio track in the video. The value will be true if a sync was explicitly requested when the caption track was uploaded. For example, when calling the captions.insert or captions.update methods, you can set the sync parameter to true to instruct YouTube to sync the uploaded track to the video. If the value is false, YouTube uses the time codes in the uploaded caption track to determine when to display captions." + }, + "isCC": { + "type": "boolean", + "description": "Indicates whether the track contains closed captions for the deaf and hard of hearing. The default value is false." + }, + "isDraft": { + "type": "boolean", + "description": "Indicates whether the caption track is a draft. If the value is true, then the track is not publicly visible. The default value is false." + }, + "isEasyReader": { + "type": "boolean", + "description": "Indicates whether caption track is formatted for \"easy reader,\" meaning it is at a third-grade level for language learners. The default value is false." + }, + "isLarge": { + "type": "boolean", + "description": "Indicates whether the caption track uses large text for the vision-impaired. The default value is false." + }, + "language": { + "type": "string", + "description": "The language of the caption track. The property value is a BCP-47 language tag.", + "annotations": { + "required": [ + "youtube.captions.insert" + ] + } + }, + "lastUpdated": { + "type": "string", + "description": "The date and time when the caption track was last updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "name": { + "type": "string", + "description": "The name of the caption track. The name is intended to be visible to the user as an option during playback.", + "annotations": { + "required": [ + "youtube.captions.insert" + ] + } + }, + "status": { + "type": "string", + "description": "The caption track's status.", + "enum": [ + "failed", + "serving", + "syncing" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "trackKind": { + "type": "string", + "description": "The caption track's type.", + "enum": [ + "ASR", + "forced", + "standard" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video associated with the caption track.", + "annotations": { + "required": [ + "youtube.captions.insert" + ] + } + } + } + }, + "CdnSettings": { + "id": "CdnSettings", + "type": "object", + "description": "Brief description of the live stream cdn settings.", + "properties": { + "format": { + "type": "string", + "description": "The format of the video stream that you are sending to Youtube.", + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + } + }, + "frameRate": { + "type": "string", + "description": "The frame rate of the inbound video data.", + "enum": [ + "30fps", + "60fps" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "ingestionInfo": { + "$ref": "IngestionInfo", + "description": "The ingestionInfo object contains information that YouTube provides that you need to transmit your RTMP or HTTP stream to YouTube." + }, + "ingestionType": { + "type": "string", + "description": "The method or protocol used to transmit the video stream.", + "enum": [ + "dash", + "rtmp" + ], + "enumDescriptions": [ + "", + "" + ], + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + } + }, + "resolution": { + "type": "string", + "description": "The resolution of the inbound video data.", + "enum": [ + "1080p", + "1440p", + "2160p", + "240p", + "360p", + "480p", + "720p" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "Channel": { + "id": "Channel", + "type": "object", + "description": "A channel resource contains information about a YouTube channel.", + "properties": { + "auditDetails": { + "$ref": "ChannelAuditDetails", + "description": "The auditionDetails object encapsulates channel data that is relevant for YouTube Partners during the audition process." + }, + "brandingSettings": { + "$ref": "ChannelBrandingSettings", + "description": "The brandingSettings object encapsulates information about the branding of the channel." + }, + "contentDetails": { + "$ref": "ChannelContentDetails", + "description": "The contentDetails object encapsulates information about the channel's content." + }, + "contentOwnerDetails": { + "$ref": "ChannelContentOwnerDetails", + "description": "The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel." + }, + "conversionPings": { + "$ref": "ChannelConversionPings", + "description": "The conversionPings object encapsulates information about conversion pings that need to be respected by the channel." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel." + }, + "invideoPromotion": { + "$ref": "InvideoPromotion", + "description": "The invideoPromotion object encapsulates information about promotion campaign associated with the channel." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channel\".", + "default": "youtube#channel" + }, + "localizations": { + "type": "object", + "description": "Localizations for different languages", + "additionalProperties": { + "$ref": "ChannelLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "snippet": { + "$ref": "ChannelSnippet", + "description": "The snippet object contains basic details about the channel, such as its title, description, and thumbnail images." + }, + "statistics": { + "$ref": "ChannelStatistics", + "description": "The statistics object encapsulates statistics for the channel." + }, + "status": { + "$ref": "ChannelStatus", + "description": "The status object encapsulates information about the privacy status of the channel." + }, + "topicDetails": { + "$ref": "ChannelTopicDetails", + "description": "The topicDetails object encapsulates information about Freebase topics associated with the channel." + } + } + }, + "ChannelAuditDetails": { + "id": "ChannelAuditDetails", + "type": "object", + "description": "The auditDetails object encapsulates channel data that is relevant for YouTube Partners during the audit process.", + "properties": { + "communityGuidelinesGoodStanding": { + "type": "boolean", + "description": "Whether or not the channel respects the community guidelines." + }, + "contentIdClaimsGoodStanding": { + "type": "boolean", + "description": "Whether or not the channel has any unresolved claims." + }, + "copyrightStrikesGoodStanding": { + "type": "boolean", + "description": "Whether or not the channel has any copyright strikes." + }, + "overallGoodStanding": { + "type": "boolean", + "description": "Describes the general state of the channel. This field will always show if there are any issues whatsoever with the channel. Currently this field represents the result of the logical and operation over the community guidelines good standing, the copyright strikes good standing and the content ID claims good standing, but this may change in the future." + } + } + }, + "ChannelBannerResource": { + "id": "ChannelBannerResource", + "type": "object", + "description": "A channel banner returned as the response to a channel_banner.insert call.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelBannerResource\".", + "default": "youtube#channelBannerResource" + }, + "url": { + "type": "string", + "description": "The URL of this banner image." + } + } + }, + "ChannelBrandingSettings": { + "id": "ChannelBrandingSettings", + "type": "object", + "description": "Branding properties of a YouTube channel.", + "properties": { + "channel": { + "$ref": "ChannelSettings", + "description": "Branding properties for the channel view." + }, + "hints": { + "type": "array", + "description": "Additional experimental branding properties.", + "items": { + "$ref": "PropertyValue" + } + }, + "image": { + "$ref": "ImageSettings", + "description": "Branding properties for branding images." + }, + "watch": { + "$ref": "WatchSettings", + "description": "Branding properties for the watch page." + } + } + }, + "ChannelContentDetails": { + "id": "ChannelContentDetails", + "type": "object", + "description": "Details about the content of a channel.", + "properties": { + "relatedPlaylists": { + "type": "object", + "properties": { + "favorites": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s favorite videos. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + }, + "likes": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s liked videos. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + }, + "uploads": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s uploaded videos. Use the videos.insert method to upload new videos and the videos.delete method to delete previously uploaded videos." + }, + "watchHistory": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s watch history. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + }, + "watchLater": { + "type": "string", + "description": "The ID of the playlist that contains the channel\"s watch later playlist. Use the playlistItems.insert and playlistItems.delete to add or remove items from that list." + } + } + } + } + }, + "ChannelContentOwnerDetails": { + "id": "ChannelContentOwnerDetails", + "type": "object", + "description": "The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel.", + "properties": { + "contentOwner": { + "type": "string", + "description": "The ID of the content owner linked to the channel." + }, + "timeLinked": { + "type": "string", + "description": "The date and time of when the channel was linked to the content owner. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "ChannelConversionPing": { + "id": "ChannelConversionPing", + "type": "object", + "description": "Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping.", + "properties": { + "context": { + "type": "string", + "description": "Defines the context of the ping.", + "enum": [ + "cview", + "subscribe", + "unsubscribe" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "conversionUrl": { + "type": "string", + "description": "The url (without the schema) that the player shall send the ping to. It's at caller's descretion to decide which schema to use (http vs https) Example of a returned url: //googleads.g.doubleclick.net/pagead/ viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must append biscotti authentication (ms param in case of mobile, for example) to this ping." + } + } + }, + "ChannelConversionPings": { + "id": "ChannelConversionPings", + "type": "object", + "description": "The conversionPings object encapsulates information about conversion pings that need to be respected by the channel.", + "properties": { + "pings": { + "type": "array", + "description": "Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping.", + "items": { + "$ref": "ChannelConversionPing" + } + } + } + }, + "ChannelListResponse": { + "id": "ChannelListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of channels that match the request criteria.", + "items": { + "$ref": "Channel" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelListResponse\".", + "default": "youtube#channelListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "ChannelLocalization": { + "id": "ChannelLocalization", + "type": "object", + "description": "Channel localization setting", + "properties": { + "description": { + "type": "string", + "description": "The localized strings for channel's description." + }, + "title": { + "type": "string", + "description": "The localized strings for channel's title." + } + } + }, + "ChannelProfileDetails": { + "id": "ChannelProfileDetails", + "type": "object", + "properties": { + "channelId": { + "type": "string", + "description": "The YouTube channel ID." + }, + "channelUrl": { + "type": "string", + "description": "The channel's URL." + }, + "displayName": { + "type": "string", + "description": "The channel's display name." + }, + "profileImageUrl": { + "type": "string", + "description": "The channels's avatar URL." + } + } + }, + "ChannelSection": { + "id": "ChannelSection", + "type": "object", + "properties": { + "contentDetails": { + "$ref": "ChannelSectionContentDetails", + "description": "The contentDetails object contains details about the channel section content, such as a list of playlists or channels featured in the section." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel section." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelSection\".", + "default": "youtube#channelSection" + }, + "localizations": { + "type": "object", + "description": "Localizations for different languages", + "additionalProperties": { + "$ref": "ChannelSectionLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "snippet": { + "$ref": "ChannelSectionSnippet", + "description": "The snippet object contains basic details about the channel section, such as its type, style and title." + }, + "targeting": { + "$ref": "ChannelSectionTargeting", + "description": "The targeting object contains basic targeting settings about the channel section." + } + } + }, + "ChannelSectionContentDetails": { + "id": "ChannelSectionContentDetails", + "type": "object", + "description": "Details about a channelsection, including playlists and channels.", + "properties": { + "channels": { + "type": "array", + "description": "The channel ids for type multiple_channels.", + "items": { + "type": "string" + } + }, + "playlists": { + "type": "array", + "description": "The playlist ids for type single_playlist and multiple_playlists. For singlePlaylist, only one playlistId is allowed.", + "items": { + "type": "string" + } + } + } + }, + "ChannelSectionListResponse": { + "id": "ChannelSectionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of ChannelSections that match the request criteria.", + "items": { + "$ref": "ChannelSection" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#channelSectionListResponse\".", + "default": "youtube#channelSectionListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "ChannelSectionLocalization": { + "id": "ChannelSectionLocalization", + "type": "object", + "description": "ChannelSection localization setting", + "properties": { + "title": { + "type": "string", + "description": "The localized strings for channel section's title." + } + } + }, + "ChannelSectionSnippet": { + "id": "ChannelSectionSnippet", + "type": "object", + "description": "Basic details about a channel section, including title, style and position.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that published the channel section." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the channel section's default title and description." + }, + "localized": { + "$ref": "ChannelSectionLocalization", + "description": "Localized title, read-only." + }, + "position": { + "type": "integer", + "description": "The position of the channel section in the channel.", + "format": "uint32" + }, + "style": { + "type": "string", + "description": "The style of the channel section.", + "enum": [ + "channelsectionStyleUndefined", + "horizontalRow", + "verticalList" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "title": { + "type": "string", + "description": "The channel section's title for multiple_playlists and multiple_channels." + }, + "type": { + "type": "string", + "description": "The type of the channel section.", + "enum": [ + "allPlaylists", + "channelsectionTypeUndefined", + "completedEvents", + "likedPlaylists", + "likes", + "liveEvents", + "multipleChannels", + "multiplePlaylists", + "popularUploads", + "postedPlaylists", + "postedVideos", + "recentActivity", + "recentPosts", + "recentUploads", + "singlePlaylist", + "subscriptions", + "upcomingEvents" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "ChannelSectionTargeting": { + "id": "ChannelSectionTargeting", + "type": "object", + "description": "ChannelSection targeting setting.", + "properties": { + "countries": { + "type": "array", + "description": "The country the channel section is targeting.", + "items": { + "type": "string" + } + }, + "languages": { + "type": "array", + "description": "The language the channel section is targeting.", + "items": { + "type": "string" + } + }, + "regions": { + "type": "array", + "description": "The region the channel section is targeting.", + "items": { + "type": "string" + } + } + } + }, + "ChannelSettings": { + "id": "ChannelSettings", + "type": "object", + "description": "Branding properties for the channel view.", + "properties": { + "country": { + "type": "string", + "description": "The country of the channel." + }, + "defaultLanguage": { + "type": "string" + }, + "defaultTab": { + "type": "string", + "description": "Which content tab users should see when viewing the channel." + }, + "description": { + "type": "string", + "description": "Specifies the channel description." + }, + "featuredChannelsTitle": { + "type": "string", + "description": "Title for the featured channels tab." + }, + "featuredChannelsUrls": { + "type": "array", + "description": "The list of featured channels.", + "items": { + "type": "string" + } + }, + "keywords": { + "type": "string", + "description": "Lists keywords associated with the channel, comma-separated." + }, + "moderateComments": { + "type": "boolean", + "description": "Whether user-submitted comments left on the channel page need to be approved by the channel owner to be publicly visible." + }, + "profileColor": { + "type": "string", + "description": "A prominent color that can be rendered on this channel page." + }, + "showBrowseView": { + "type": "boolean", + "description": "Whether the tab to browse the videos should be displayed." + }, + "showRelatedChannels": { + "type": "boolean", + "description": "Whether related channels should be proposed." + }, + "title": { + "type": "string", + "description": "Specifies the channel title." + }, + "trackingAnalyticsAccountId": { + "type": "string", + "description": "The ID for a Google Analytics account to track and measure traffic to the channels." + }, + "unsubscribedTrailer": { + "type": "string", + "description": "The trailer of the channel, for users that are not subscribers." + } + } + }, + "ChannelSnippet": { + "id": "ChannelSnippet", + "type": "object", + "description": "Basic details about a channel, including title, description and thumbnails. Next available id: 15.", + "properties": { + "country": { + "type": "string", + "description": "The country of the channel." + }, + "customUrl": { + "type": "string", + "description": "The custom url of the channel." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the channel's default title and description." + }, + "description": { + "type": "string", + "description": "The description of the channel." + }, + "localized": { + "$ref": "ChannelLocalization", + "description": "Localized title and description, read-only." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the channel was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the channel. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The channel's title." + } + } + }, + "ChannelStatistics": { + "id": "ChannelStatistics", + "type": "object", + "description": "Statistics about a channel: number of subscribers, number of videos in the channel, etc.", + "properties": { + "commentCount": { + "type": "string", + "description": "The number of comments for the channel.", + "format": "uint64" + }, + "hiddenSubscriberCount": { + "type": "boolean", + "description": "Whether or not the number of subscribers is shown for this user." + }, + "subscriberCount": { + "type": "string", + "description": "The number of subscribers that the channel has.", + "format": "uint64" + }, + "videoCount": { + "type": "string", + "description": "The number of videos uploaded to the channel.", + "format": "uint64" + }, + "viewCount": { + "type": "string", + "description": "The number of times the channel has been viewed.", + "format": "uint64" + } + } + }, + "ChannelStatus": { + "id": "ChannelStatus", + "type": "object", + "description": "JSON template for the status part of a channel.", + "properties": { + "isLinked": { + "type": "boolean", + "description": "If true, then the user is linked to either a YouTube username or G+ account. Otherwise, the user doesn't have a public YouTube identity." + }, + "longUploadsStatus": { + "type": "string", + "description": "The long uploads status of this channel. See", + "enum": [ + "allowed", + "disallowed", + "eligible", + "longUploadsUnspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "privacyStatus": { + "type": "string", + "description": "Privacy status of the channel.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "ChannelTopicDetails": { + "id": "ChannelTopicDetails", + "type": "object", + "description": "Freebase topic information related to the channel.", + "properties": { + "topicCategories": { + "type": "array", + "description": "A list of Wikipedia URLs that describe the channel's content.", + "items": { + "type": "string" + } + }, + "topicIds": { + "type": "array", + "description": "A list of Freebase topic IDs associated with the channel. You can retrieve information about each topic using the Freebase Topic API.", + "items": { + "type": "string" + } + } + } + }, + "Comment": { + "id": "Comment", + "type": "object", + "description": "A comment represents a single YouTube comment.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the comment." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#comment\".", + "default": "youtube#comment" + }, + "snippet": { + "$ref": "CommentSnippet", + "description": "The snippet object contains basic details about the comment." + } + } + }, + "CommentListResponse": { + "id": "CommentListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of comments that match the request criteria.", + "items": { + "$ref": "Comment" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#commentListResponse\".", + "default": "youtube#commentListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "CommentSnippet": { + "id": "CommentSnippet", + "type": "object", + "description": "Basic details about a comment, such as its author and text.", + "properties": { + "authorChannelId": { + "type": "any", + "description": "The id of the author's YouTube channel, if any." + }, + "authorChannelUrl": { + "type": "string", + "description": "Link to the author's YouTube channel, if any." + }, + "authorDisplayName": { + "type": "string", + "description": "The name of the user who posted the comment." + }, + "authorProfileImageUrl": { + "type": "string", + "description": "The URL for the avatar of the user who posted the comment." + }, + "canRate": { + "type": "boolean", + "description": "Whether the current viewer can rate this comment." + }, + "channelId": { + "type": "string", + "description": "The id of the corresponding YouTube channel. In case of a channel comment this is the channel the comment refers to. In case of a video comment it's the video's channel." + }, + "likeCount": { + "type": "integer", + "description": "The total number of likes this comment has received.", + "format": "uint32" + }, + "moderationStatus": { + "type": "string", + "description": "The comment's moderation status. Will not be set if the comments were requested through the id filter.", + "enum": [ + "heldForReview", + "likelySpam", + "published", + "rejected" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "parentId": { + "type": "string", + "description": "The unique id of the parent comment, only set for replies." + }, + "publishedAt": { + "type": "string", + "description": "The date and time when the comment was orignally published. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "textDisplay": { + "type": "string", + "description": "The comment's text. The format is either plain text or HTML dependent on what has been requested. Even the plain text representation may differ from the text originally posted in that it may replace video links with video titles etc." + }, + "textOriginal": { + "type": "string", + "description": "The comment's original raw text as initially posted or last updated. The original text will only be returned if it is accessible to the viewer, which is only guaranteed if the viewer is the comment's author." + }, + "updatedAt": { + "type": "string", + "description": "The date and time when was last updated . The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "videoId": { + "type": "string", + "description": "The ID of the video the comment refers to, if any." + }, + "viewerRating": { + "type": "string", + "description": "The rating the viewer has given to this comment. For the time being this will never return RATE_TYPE_DISLIKE and instead return RATE_TYPE_NONE. This may change in the future.", + "enum": [ + "dislike", + "like", + "none", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "CommentThread": { + "id": "CommentThread", + "type": "object", + "description": "A comment thread represents information that applies to a top level comment and all its replies. It can also include the top level comment itself and some of the replies.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the comment thread." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#commentThread\".", + "default": "youtube#commentThread" + }, + "replies": { + "$ref": "CommentThreadReplies", + "description": "The replies object contains a limited number of replies (if any) to the top level comment found in the snippet." + }, + "snippet": { + "$ref": "CommentThreadSnippet", + "description": "The snippet object contains basic details about the comment thread and also the top level comment." + } + } + }, + "CommentThreadListResponse": { + "id": "CommentThreadListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of comment threads that match the request criteria.", + "items": { + "$ref": "CommentThread" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#commentThreadListResponse\".", + "default": "youtube#commentThreadListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "CommentThreadReplies": { + "id": "CommentThreadReplies", + "type": "object", + "description": "Comments written in (direct or indirect) reply to the top level comment.", + "properties": { + "comments": { + "type": "array", + "description": "A limited number of replies. Unless the number of replies returned equals total_reply_count in the snippet the returned replies are only a subset of the total number of replies.", + "items": { + "$ref": "Comment" + } + } + } + }, + "CommentThreadSnippet": { + "id": "CommentThreadSnippet", + "type": "object", + "description": "Basic details about a comment thread.", + "properties": { + "canReply": { + "type": "boolean", + "description": "Whether the current viewer of the thread can reply to it. This is viewer specific - other viewers may see a different value for this field." + }, + "channelId": { + "type": "string", + "description": "The YouTube channel the comments in the thread refer to or the channel with the video the comments refer to. If video_id isn't set the comments refer to the channel itself." + }, + "isPublic": { + "type": "boolean", + "description": "Whether the thread (and therefore all its comments) is visible to all YouTube users." + }, + "topLevelComment": { + "$ref": "Comment", + "description": "The top level comment of this thread." + }, + "totalReplyCount": { + "type": "integer", + "description": "The total number of replies (not including the top level comment).", + "format": "uint32" + }, + "videoId": { + "type": "string", + "description": "The ID of the video the comments refer to, if any. No video_id implies a channel discussion comment." + } + } + }, + "ContentRating": { + "id": "ContentRating", + "type": "object", + "description": "Ratings schemes. The country-specific ratings are mostly for movies and shows. NEXT_ID: 69", + "properties": { + "acbRating": { + "type": "string", + "description": "The video's Australian Classification Board (ACB) or Australian Communications and Media Authority (ACMA) rating. ACMA ratings are used to classify children's television programming.", + "enum": [ + "acbC", + "acbE", + "acbG", + "acbM", + "acbMa15plus", + "acbP", + "acbPg", + "acbR18plus", + "acbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "agcomRating": { + "type": "string", + "description": "The video's rating from Italy's Autorità per le Garanzie nelle Comunicazioni (AGCOM).", + "enum": [ + "agcomT", + "agcomUnrated", + "agcomVm14", + "agcomVm18" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "anatelRating": { + "type": "string", + "description": "The video's Anatel (Asociación Nacional de Televisión) rating for Chilean television.", + "enum": [ + "anatelA", + "anatelF", + "anatelI", + "anatelI10", + "anatelI12", + "anatelI7", + "anatelR", + "anatelUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bbfcRating": { + "type": "string", + "description": "The video's British Board of Film Classification (BBFC) rating.", + "enum": [ + "bbfc12", + "bbfc12a", + "bbfc15", + "bbfc18", + "bbfcPg", + "bbfcR18", + "bbfcU", + "bbfcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bfvcRating": { + "type": "string", + "description": "The video's rating from Thailand's Board of Film and Video Censors.", + "enum": [ + "bfvc13", + "bfvc15", + "bfvc18", + "bfvc20", + "bfvcB", + "bfvcE", + "bfvcG", + "bfvcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "bmukkRating": { + "type": "string", + "description": "The video's rating from the Austrian Board of Media Classification (Bundesministerium für Unterricht, Kunst und Kultur).", + "enum": [ + "bmukk10", + "bmukk12", + "bmukk14", + "bmukk16", + "bmukk6", + "bmukk8", + "bmukkAa", + "bmukkUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "catvRating": { + "type": "string", + "description": "Rating system for Canadian TV - Canadian TV Classification System The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian English-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.", + "enum": [ + "catv14plus", + "catv18plus", + "catvC", + "catvC8", + "catvG", + "catvPg", + "catvUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "catvfrRating": { + "type": "string", + "description": "The video's rating from the Canadian Radio-Television and Telecommunications Commission (CRTC) for Canadian French-language broadcasts. For more information, see the Canadian Broadcast Standards Council website.", + "enum": [ + "catvfr13plus", + "catvfr16plus", + "catvfr18plus", + "catvfr8plus", + "catvfrG", + "catvfrUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "cbfcRating": { + "type": "string", + "description": "The video's Central Board of Film Certification (CBFC - India) rating.", + "enum": [ + "cbfcA", + "cbfcS", + "cbfcU", + "cbfcUA", + "cbfcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "cccRating": { + "type": "string", + "description": "The video's Consejo de Calificación Cinematográfica (Chile) rating.", + "enum": [ + "ccc14", + "ccc18", + "ccc18s", + "ccc18v", + "ccc6", + "cccTe", + "cccUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "cceRating": { + "type": "string", + "description": "The video's rating from Portugal's Comissão de Classificação de Espect´culos.", + "enum": [ + "cceM12", + "cceM14", + "cceM16", + "cceM18", + "cceM4", + "cceM6", + "cceUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "chfilmRating": { + "type": "string", + "description": "The video's rating in Switzerland.", + "enum": [ + "chfilm0", + "chfilm12", + "chfilm16", + "chfilm18", + "chfilm6", + "chfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "chvrsRating": { + "type": "string", + "description": "The video's Canadian Home Video Rating System (CHVRS) rating.", + "enum": [ + "chvrs14a", + "chvrs18a", + "chvrsE", + "chvrsG", + "chvrsPg", + "chvrsR", + "chvrsUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "cicfRating": { + "type": "string", + "description": "The video's rating from the Commission de Contrôle des Films (Belgium).", + "enum": [ + "cicfE", + "cicfKntEna", + "cicfKtEa", + "cicfUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "cnaRating": { + "type": "string", + "description": "The video's rating from Romania's CONSILIUL NATIONAL AL AUDIOVIZUALULUI (CNA).", + "enum": [ + "cna12", + "cna15", + "cna18", + "cna18plus", + "cnaAp", + "cnaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "cncRating": { + "type": "string", + "description": "Rating system in France - Commission de classification cinematographique", + "enum": [ + "cnc10", + "cnc12", + "cnc16", + "cnc18", + "cncE", + "cncT", + "cncUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "csaRating": { + "type": "string", + "description": "The video's rating from France's Conseil supérieur de l?audiovisuel, which rates broadcast content.", + "enum": [ + "csa10", + "csa12", + "csa16", + "csa18", + "csaInterdiction", + "csaT", + "csaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "cscfRating": { + "type": "string", + "description": "The video's rating from Luxembourg's Commission de surveillance de la classification des films (CSCF).", + "enum": [ + "cscf12", + "cscf16", + "cscf18", + "cscf6", + "cscf9", + "cscfA", + "cscfAl", + "cscfUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "czfilmRating": { + "type": "string", + "description": "The video's rating in the Czech Republic.", + "enum": [ + "czfilm12", + "czfilm14", + "czfilm18", + "czfilmU", + "czfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "djctqRating": { + "type": "string", + "description": "The video's Departamento de Justiça, Classificação, Qualificação e Títulos (DJCQT - Brazil) rating.", + "enum": [ + "djctq10", + "djctq12", + "djctq14", + "djctq16", + "djctq18", + "djctqL", + "djctqUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "djctqRatingReasons": { + "type": "array", + "description": "Reasons that explain why the video received its DJCQT (Brazil) rating.", + "items": { + "type": "string", + "enum": [ + "djctqCriminalActs", + "djctqDrugs", + "djctqExplicitSex", + "djctqExtremeViolence", + "djctqIllegalDrugs", + "djctqImpactingContent", + "djctqInappropriateLanguage", + "djctqLegalDrugs", + "djctqNudity", + "djctqSex", + "djctqSexualContent", + "djctqViolence" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "ecbmctRating": { + "type": "string", + "description": "Rating system in Turkey - Evaluation and Classification Board of the Ministry of Culture and Tourism", + "enum": [ + "ecbmct13a", + "ecbmct13plus", + "ecbmct15a", + "ecbmct15plus", + "ecbmct18plus", + "ecbmct7a", + "ecbmct7plus", + "ecbmctG", + "ecbmctUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "eefilmRating": { + "type": "string", + "description": "The video's rating in Estonia.", + "enum": [ + "eefilmK12", + "eefilmK14", + "eefilmK16", + "eefilmK6", + "eefilmL", + "eefilmMs12", + "eefilmMs6", + "eefilmPere", + "eefilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "egfilmRating": { + "type": "string", + "description": "The video's rating in Egypt.", + "enum": [ + "egfilm18", + "egfilmBn", + "egfilmGn", + "egfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "eirinRating": { + "type": "string", + "description": "The video's Eirin (映倫) rating. Eirin is the Japanese rating system.", + "enum": [ + "eirinG", + "eirinPg12", + "eirinR15plus", + "eirinR18plus", + "eirinUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "fcbmRating": { + "type": "string", + "description": "The video's rating from Malaysia's Film Censorship Board.", + "enum": [ + "fcbm18", + "fcbm18pa", + "fcbm18pl", + "fcbm18sg", + "fcbm18sx", + "fcbmP13", + "fcbmPg13", + "fcbmU", + "fcbmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fcoRating": { + "type": "string", + "description": "The video's rating from Hong Kong's Office for Film, Newspaper and Article Administration.", + "enum": [ + "fcoI", + "fcoIi", + "fcoIia", + "fcoIib", + "fcoIii", + "fcoUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "fmocRating": { + "type": "string", + "description": "This property has been deprecated. Use the contentDetails.contentRating.cncRating instead.", + "enum": [ + "fmoc10", + "fmoc12", + "fmoc16", + "fmoc18", + "fmocE", + "fmocU", + "fmocUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fpbRating": { + "type": "string", + "description": "The video's rating from South Africa's Film and Publication Board.", + "enum": [ + "fpb10", + "fpb1012Pg", + "fpb13", + "fpb16", + "fpb18", + "fpb79Pg", + "fpbA", + "fpbPg", + "fpbUnrated", + "fpbX18", + "fpbXx" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "fpbRatingReasons": { + "type": "array", + "description": "Reasons that explain why the video received its FPB (South Africa) rating.", + "items": { + "type": "string", + "enum": [ + "fpbBlasphemy", + "fpbCriminalTechniques", + "fpbDrugs", + "fpbHorror", + "fpbImitativeActsTechniques", + "fpbLanguage", + "fpbNudity", + "fpbPrejudice", + "fpbSex", + "fpbSexualViolence", + "fpbViolence" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "fskRating": { + "type": "string", + "description": "The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK - Germany) rating.", + "enum": [ + "fsk0", + "fsk12", + "fsk16", + "fsk18", + "fsk6", + "fskUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "grfilmRating": { + "type": "string", + "description": "The video's rating in Greece.", + "enum": [ + "grfilmE", + "grfilmK", + "grfilmK12", + "grfilmK13", + "grfilmK15", + "grfilmK17", + "grfilmK18", + "grfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "icaaRating": { + "type": "string", + "description": "The video's Instituto de la Cinematografía y de las Artes Audiovisuales (ICAA - Spain) rating.", + "enum": [ + "icaa12", + "icaa13", + "icaa16", + "icaa18", + "icaa7", + "icaaApta", + "icaaUnrated", + "icaaX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ifcoRating": { + "type": "string", + "description": "The video's Irish Film Classification Office (IFCO - Ireland) rating. See the IFCO website for more information.", + "enum": [ + "ifco12", + "ifco12a", + "ifco15", + "ifco15a", + "ifco16", + "ifco18", + "ifcoG", + "ifcoPg", + "ifcoUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ilfilmRating": { + "type": "string", + "description": "The video's rating in Israel.", + "enum": [ + "ilfilm12", + "ilfilm16", + "ilfilm18", + "ilfilmAa", + "ilfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "incaaRating": { + "type": "string", + "description": "The video's INCAA (Instituto Nacional de Cine y Artes Audiovisuales - Argentina) rating.", + "enum": [ + "incaaAtp", + "incaaC", + "incaaSam13", + "incaaSam16", + "incaaSam18", + "incaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "kfcbRating": { + "type": "string", + "description": "The video's rating from the Kenya Film Classification Board.", + "enum": [ + "kfcb16plus", + "kfcbG", + "kfcbPg", + "kfcbR", + "kfcbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "kijkwijzerRating": { + "type": "string", + "description": "voor de Classificatie van Audiovisuele Media (Netherlands).", + "enum": [ + "kijkwijzer12", + "kijkwijzer16", + "kijkwijzer18", + "kijkwijzer6", + "kijkwijzer9", + "kijkwijzerAl", + "kijkwijzerUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "kmrbRating": { + "type": "string", + "description": "The video's Korea Media Rating Board (영상물등급위원회) rating. The KMRB rates videos in South Korea.", + "enum": [ + "kmrb12plus", + "kmrb15plus", + "kmrbAll", + "kmrbR", + "kmrbTeenr", + "kmrbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "lsfRating": { + "type": "string", + "description": "The video's rating from Indonesia's Lembaga Sensor Film.", + "enum": [ + "lsf13", + "lsf17", + "lsf21", + "lsfA", + "lsfBo", + "lsfD", + "lsfR", + "lsfSu", + "lsfUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mccaaRating": { + "type": "string", + "description": "The video's rating from Malta's Film Age-Classification Board.", + "enum": [ + "mccaa12", + "mccaa12a", + "mccaa14", + "mccaa15", + "mccaa16", + "mccaa18", + "mccaaPg", + "mccaaU", + "mccaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mccypRating": { + "type": "string", + "description": "The video's rating from the Danish Film Institute's (Det Danske Filminstitut) Media Council for Children and Young People.", + "enum": [ + "mccyp11", + "mccyp15", + "mccyp7", + "mccypA", + "mccypUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "mcstRating": { + "type": "string", + "description": "The video's rating system for Vietnam - MCST", + "enum": [ + "mcst0", + "mcst16plus", + "mcstC13", + "mcstC16", + "mcstC18", + "mcstGPg", + "mcstP", + "mcstUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mdaRating": { + "type": "string", + "description": "The video's rating from Singapore's Media Development Authority (MDA) and, specifically, it's Board of Film Censors (BFC).", + "enum": [ + "mdaG", + "mdaM18", + "mdaNc16", + "mdaPg", + "mdaPg13", + "mdaR21", + "mdaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "medietilsynetRating": { + "type": "string", + "description": "The video's rating from Medietilsynet, the Norwegian Media Authority.", + "enum": [ + "medietilsynet11", + "medietilsynet12", + "medietilsynet15", + "medietilsynet18", + "medietilsynet6", + "medietilsynet7", + "medietilsynet9", + "medietilsynetA", + "medietilsynetUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mekuRating": { + "type": "string", + "description": "The video's rating from Finland's Kansallinen Audiovisuaalinen Instituutti (National Audiovisual Institute).", + "enum": [ + "meku12", + "meku16", + "meku18", + "meku7", + "mekuS", + "mekuUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mibacRating": { + "type": "string", + "description": "The video's rating from the Ministero dei Beni e delle Attività Culturali e del Turismo (Italy).", + "enum": [ + "mibacT", + "mibacUnrated", + "mibacVap", + "mibacVm12", + "mibacVm14", + "mibacVm18" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mocRating": { + "type": "string", + "description": "The video's Ministerio de Cultura (Colombia) rating.", + "enum": [ + "moc12", + "moc15", + "moc18", + "moc7", + "mocBanned", + "mocE", + "mocT", + "mocUnrated", + "mocX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "moctwRating": { + "type": "string", + "description": "The video's rating from Taiwan's Ministry of Culture (文化部).", + "enum": [ + "moctwG", + "moctwP", + "moctwPg", + "moctwR", + "moctwR12", + "moctwR15", + "moctwUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "mpaaRating": { + "type": "string", + "description": "The video's Motion Picture Association of America (MPAA) rating.", + "enum": [ + "mpaaG", + "mpaaNc17", + "mpaaPg", + "mpaaPg13", + "mpaaR", + "mpaaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "mtrcbRating": { + "type": "string", + "description": "The video's rating from the Movie and Television Review and Classification Board (Philippines).", + "enum": [ + "mtrcbG", + "mtrcbPg", + "mtrcbR13", + "mtrcbR16", + "mtrcbR18", + "mtrcbUnrated", + "mtrcbX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "nbcRating": { + "type": "string", + "description": "The video's rating from the Maldives National Bureau of Classification.", + "enum": [ + "nbc12plus", + "nbc15plus", + "nbc18plus", + "nbc18plusr", + "nbcG", + "nbcPg", + "nbcPu", + "nbcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "nbcplRating": { + "type": "string", + "description": "The video's rating in Poland.", + "enum": [ + "nbcpl18plus", + "nbcplI", + "nbcplIi", + "nbcplIii", + "nbcplIv", + "nbcplUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "nfrcRating": { + "type": "string", + "description": "The video's rating from the Bulgarian National Film Center.", + "enum": [ + "nfrcA", + "nfrcB", + "nfrcC", + "nfrcD", + "nfrcUnrated", + "nfrcX" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "nfvcbRating": { + "type": "string", + "description": "The video's rating from Nigeria's National Film and Video Censors Board.", + "enum": [ + "nfvcb12", + "nfvcb12a", + "nfvcb15", + "nfvcb18", + "nfvcbG", + "nfvcbPg", + "nfvcbRe", + "nfvcbUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "nkclvRating": { + "type": "string", + "description": "The video's rating from the Nacionãlais Kino centrs (National Film Centre of Latvia).", + "enum": [ + "nkclv12plus", + "nkclv18plus", + "nkclv7plus", + "nkclvU", + "nkclvUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "oflcRating": { + "type": "string", + "description": "The video's Office of Film and Literature Classification (OFLC - New Zealand) rating.", + "enum": [ + "oflcG", + "oflcM", + "oflcPg", + "oflcR13", + "oflcR15", + "oflcR16", + "oflcR18", + "oflcRp13", + "oflcRp16", + "oflcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "pefilmRating": { + "type": "string", + "description": "The video's rating in Peru.", + "enum": [ + "pefilm14", + "pefilm18", + "pefilmPg", + "pefilmPt", + "pefilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "rcnofRating": { + "type": "string", + "description": "The video's rating from the Hungarian Nemzeti Filmiroda, the Rating Committee of the National Office of Film.", + "enum": [ + "rcnofI", + "rcnofIi", + "rcnofIii", + "rcnofIv", + "rcnofUnrated", + "rcnofV", + "rcnofVi" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "resorteviolenciaRating": { + "type": "string", + "description": "The video's rating in Venezuela.", + "enum": [ + "resorteviolenciaA", + "resorteviolenciaB", + "resorteviolenciaC", + "resorteviolenciaD", + "resorteviolenciaE", + "resorteviolenciaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "rtcRating": { + "type": "string", + "description": "The video's General Directorate of Radio, Television and Cinematography (Mexico) rating.", + "enum": [ + "rtcA", + "rtcAa", + "rtcB", + "rtcB15", + "rtcC", + "rtcD", + "rtcUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "rteRating": { + "type": "string", + "description": "The video's rating from Ireland's Raidió Teilifís Éireann.", + "enum": [ + "rteCh", + "rteGa", + "rteMa", + "rtePs", + "rteUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "russiaRating": { + "type": "string", + "description": "The video's National Film Registry of the Russian Federation (MKRF - Russia) rating.", + "enum": [ + "russia0", + "russia12", + "russia16", + "russia18", + "russia6", + "russiaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "skfilmRating": { + "type": "string", + "description": "The video's rating in Slovakia.", + "enum": [ + "skfilmG", + "skfilmP2", + "skfilmP5", + "skfilmP8", + "skfilmUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "smaisRating": { + "type": "string", + "description": "The video's rating in Iceland.", + "enum": [ + "smais12", + "smais14", + "smais16", + "smais18", + "smais7", + "smaisL", + "smaisUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "smsaRating": { + "type": "string", + "description": "The video's rating from Statens medieråd (Sweden's National Media Council).", + "enum": [ + "smsa11", + "smsa15", + "smsa7", + "smsaA", + "smsaUnrated" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "tvpgRating": { + "type": "string", + "description": "The video's TV Parental Guidelines (TVPG) rating.", + "enum": [ + "pg14", + "tvpgG", + "tvpgMa", + "tvpgPg", + "tvpgUnrated", + "tvpgY", + "tvpgY7", + "tvpgY7Fv" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "ytRating": { + "type": "string", + "description": "A rating that YouTube uses to identify age-restricted content.", + "enum": [ + "ytAgeRestricted" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "FanFundingEvent": { + "id": "FanFundingEvent", + "type": "object", + "description": "A fanFundingEvent resource represents a fan funding event on a YouTube channel. Fan funding events occur when a user gives one-time monetary support to the channel owner.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the fan funding event." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#fanFundingEvent\".", + "default": "youtube#fanFundingEvent" + }, + "snippet": { + "$ref": "FanFundingEventSnippet", + "description": "The snippet object contains basic details about the fan funding event." + } + } + }, + "FanFundingEventListResponse": { + "id": "FanFundingEventListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of fan funding events that match the request criteria.", + "items": { + "$ref": "FanFundingEvent" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#fanFundingEventListResponse\".", + "default": "youtube#fanFundingEventListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "FanFundingEventSnippet": { + "id": "FanFundingEventSnippet", + "type": "object", + "properties": { + "amountMicros": { + "type": "string", + "description": "The amount of funding in micros of fund_currency. e.g., 1 is represented", + "format": "uint64" + }, + "channelId": { + "type": "string", + "description": "Channel id where the funding event occurred." + }, + "commentText": { + "type": "string", + "description": "The text contents of the comment left by the user." + }, + "createdAt": { + "type": "string", + "description": "The date and time when the funding occurred. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "currency": { + "type": "string", + "description": "The currency in which the fund was made. ISO 4217." + }, + "displayString": { + "type": "string", + "description": "A rendered string that displays the fund amount and currency (e.g., \"$1.00\"). The string is rendered for the given language." + }, + "supporterDetails": { + "$ref": "ChannelProfileDetails", + "description": "Details about the supporter. Only filled if the event was made public by the user." + } + } + }, + "GeoPoint": { + "id": "GeoPoint", + "type": "object", + "description": "Geographical coordinates of a point, in WGS84.", + "properties": { + "altitude": { + "type": "number", + "description": "Altitude above the reference ellipsoid, in meters.", + "format": "double" + }, + "latitude": { + "type": "number", + "description": "Latitude in degrees.", + "format": "double" + }, + "longitude": { + "type": "number", + "description": "Longitude in degrees.", + "format": "double" + } + } + }, + "GuideCategory": { + "id": "GuideCategory", + "type": "object", + "description": "A guideCategory resource identifies a category that YouTube algorithmically assigns based on a channel's content or other indicators, such as the channel's popularity. The list is similar to video categories, with the difference being that a video's uploader can assign a video category but only YouTube can assign a channel category.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the guide category." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#guideCategory\".", + "default": "youtube#guideCategory" + }, + "snippet": { + "$ref": "GuideCategorySnippet", + "description": "The snippet object contains basic details about the category, such as its title." + } + } + }, + "GuideCategoryListResponse": { + "id": "GuideCategoryListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of categories that can be associated with YouTube channels. In this map, the category ID is the map key, and its value is the corresponding guideCategory resource.", + "items": { + "$ref": "GuideCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#guideCategoryListResponse\".", + "default": "youtube#guideCategoryListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "GuideCategorySnippet": { + "id": "GuideCategorySnippet", + "type": "object", + "description": "Basic details about a guide category.", + "properties": { + "channelId": { + "type": "string", + "default": "UCBR8-60-B28hp2BmDPdntcQ" + }, + "title": { + "type": "string", + "description": "Description of the guide category." + } + } + }, + "I18nLanguage": { + "id": "I18nLanguage", + "type": "object", + "description": "An i18nLanguage resource identifies a UI language currently supported by YouTube.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the i18n language." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nLanguage\".", + "default": "youtube#i18nLanguage" + }, + "snippet": { + "$ref": "I18nLanguageSnippet", + "description": "The snippet object contains basic details about the i18n language, such as language code and human-readable name." + } + } + }, + "I18nLanguageListResponse": { + "id": "I18nLanguageListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of supported i18n languages. In this map, the i18n language ID is the map key, and its value is the corresponding i18nLanguage resource.", + "items": { + "$ref": "I18nLanguage" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nLanguageListResponse\".", + "default": "youtube#i18nLanguageListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "I18nLanguageSnippet": { + "id": "I18nLanguageSnippet", + "type": "object", + "description": "Basic details about an i18n language, such as language code and human-readable name.", + "properties": { + "hl": { + "type": "string", + "description": "A short BCP-47 code that uniquely identifies a language." + }, + "name": { + "type": "string", + "description": "The human-readable name of the language in the language itself." + } + } + }, + "I18nRegion": { + "id": "I18nRegion", + "type": "object", + "description": "A i18nRegion resource identifies a region where YouTube is available.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the i18n region." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nRegion\".", + "default": "youtube#i18nRegion" + }, + "snippet": { + "$ref": "I18nRegionSnippet", + "description": "The snippet object contains basic details about the i18n region, such as region code and human-readable name." + } + } + }, + "I18nRegionListResponse": { + "id": "I18nRegionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of regions where YouTube is available. In this map, the i18n region ID is the map key, and its value is the corresponding i18nRegion resource.", + "items": { + "$ref": "I18nRegion" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#i18nRegionListResponse\".", + "default": "youtube#i18nRegionListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "I18nRegionSnippet": { + "id": "I18nRegionSnippet", + "type": "object", + "description": "Basic details about an i18n region, such as region code and human-readable name.", + "properties": { + "gl": { + "type": "string", + "description": "The region code as a 2-letter ISO country code." + }, + "name": { + "type": "string", + "description": "The human-readable name of the region." + } + } + }, + "ImageSettings": { + "id": "ImageSettings", + "type": "object", + "description": "Branding properties for images associated with the channel.", + "properties": { + "backgroundImageUrl": { + "$ref": "LocalizedProperty", + "description": "The URL for the background image shown on the video watch page. The image should be 1200px by 615px, with a maximum file size of 128k." + }, + "bannerExternalUrl": { + "type": "string", + "description": "This is used only in update requests; if it's set, we use this URL to generate all of the above banner URLs." + }, + "bannerImageUrl": { + "type": "string", + "description": "Banner image. Desktop size (1060x175)." + }, + "bannerMobileExtraHdImageUrl": { + "type": "string", + "description": "Banner image. Mobile size high resolution (1440x395)." + }, + "bannerMobileHdImageUrl": { + "type": "string", + "description": "Banner image. Mobile size high resolution (1280x360)." + }, + "bannerMobileImageUrl": { + "type": "string", + "description": "Banner image. Mobile size (640x175)." + }, + "bannerMobileLowImageUrl": { + "type": "string", + "description": "Banner image. Mobile size low resolution (320x88)." + }, + "bannerMobileMediumHdImageUrl": { + "type": "string", + "description": "Banner image. Mobile size medium/high resolution (960x263)." + }, + "bannerTabletExtraHdImageUrl": { + "type": "string", + "description": "Banner image. Tablet size extra high resolution (2560x424)." + }, + "bannerTabletHdImageUrl": { + "type": "string", + "description": "Banner image. Tablet size high resolution (2276x377)." + }, + "bannerTabletImageUrl": { + "type": "string", + "description": "Banner image. Tablet size (1707x283)." + }, + "bannerTabletLowImageUrl": { + "type": "string", + "description": "Banner image. Tablet size low resolution (1138x188)." + }, + "bannerTvHighImageUrl": { + "type": "string", + "description": "Banner image. TV size high resolution (1920x1080)." + }, + "bannerTvImageUrl": { + "type": "string", + "description": "Banner image. TV size extra high resolution (2120x1192)." + }, + "bannerTvLowImageUrl": { + "type": "string", + "description": "Banner image. TV size low resolution (854x480)." + }, + "bannerTvMediumImageUrl": { + "type": "string", + "description": "Banner image. TV size medium resolution (1280x720)." + }, + "largeBrandedBannerImageImapScript": { + "$ref": "LocalizedProperty", + "description": "The image map script for the large banner image." + }, + "largeBrandedBannerImageUrl": { + "$ref": "LocalizedProperty", + "description": "The URL for the 854px by 70px image that appears below the video player in the expanded video view of the video watch page." + }, + "smallBrandedBannerImageImapScript": { + "$ref": "LocalizedProperty", + "description": "The image map script for the small banner image." + }, + "smallBrandedBannerImageUrl": { + "$ref": "LocalizedProperty", + "description": "The URL for the 640px by 70px banner image that appears below the video player in the default view of the video watch page." + }, + "trackingImageUrl": { + "type": "string", + "description": "The URL for a 1px by 1px tracking pixel that can be used to collect statistics for views of the channel or video pages." + }, + "watchIconImageUrl": { + "type": "string", + "description": "The URL for the image that appears above the top-left corner of the video player. This is a 25-pixel-high image with a flexible width that cannot exceed 170 pixels." + } + } + }, + "IngestionInfo": { + "id": "IngestionInfo", + "type": "object", + "description": "Describes information necessary for ingesting an RTMP or an HTTP stream.", + "properties": { + "backupIngestionAddress": { + "type": "string", + "description": "The backup ingestion URL that you should use to stream video to YouTube. You have the option of simultaneously streaming the content that you are sending to the ingestionAddress to this URL." + }, + "ingestionAddress": { + "type": "string", + "description": "The primary ingestion URL that you should use to stream video to YouTube. You must stream video to this URL.\n\nDepending on which application or tool you use to encode your video stream, you may need to enter the stream URL and stream name separately or you may need to concatenate them in the following format:\n\nSTREAM_URL/STREAM_NAME" + }, + "streamName": { + "type": "string", + "description": "The HTTP or RTMP stream name that YouTube assigns to the video stream." + } + } + }, + "InvideoBranding": { + "id": "InvideoBranding", + "type": "object", + "properties": { + "imageBytes": { + "type": "string", + "format": "byte" + }, + "imageUrl": { + "type": "string" + }, + "position": { + "$ref": "InvideoPosition" + }, + "targetChannelId": { + "type": "string" + }, + "timing": { + "$ref": "InvideoTiming" + } + } + }, + "InvideoPosition": { + "id": "InvideoPosition", + "type": "object", + "description": "Describes the spatial position of a visual widget inside a video. It is a union of various position types, out of which only will be set one.", + "properties": { + "cornerPosition": { + "type": "string", + "description": "Describes in which corner of the video the visual widget will appear.", + "enum": [ + "bottomLeft", + "bottomRight", + "topLeft", + "topRight" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "Defines the position type.", + "enum": [ + "corner" + ], + "enumDescriptions": [ + "" + ] + } + } + }, + "InvideoPromotion": { + "id": "InvideoPromotion", + "type": "object", + "description": "Describes an invideo promotion campaign consisting of multiple promoted items. A campaign belongs to a single channel_id.", + "properties": { + "defaultTiming": { + "$ref": "InvideoTiming", + "description": "The default temporal position within the video where the promoted item will be displayed. Can be overriden by more specific timing in the item." + }, + "items": { + "type": "array", + "description": "List of promoted items in decreasing priority.", + "items": { + "$ref": "PromotedItem" + } + }, + "position": { + "$ref": "InvideoPosition", + "description": "The spatial position within the video where the promoted item will be displayed." + }, + "useSmartTiming": { + "type": "boolean", + "description": "Indicates whether the channel's promotional campaign uses \"smart timing.\" This feature attempts to show promotions at a point in the video when they are more likely to be clicked and less likely to disrupt the viewing experience. This feature also picks up a single promotion to show on each video." + } + } + }, + "InvideoTiming": { + "id": "InvideoTiming", + "type": "object", + "description": "Describes a temporal position of a visual widget inside a video.", + "properties": { + "durationMs": { + "type": "string", + "description": "Defines the duration in milliseconds for which the promotion should be displayed. If missing, the client should use the default.", + "format": "uint64" + }, + "offsetMs": { + "type": "string", + "description": "Defines the time at which the promotion will appear. Depending on the value of type the value of the offsetMs field will represent a time offset from the start or from the end of the video, expressed in milliseconds.", + "format": "uint64" + }, + "type": { + "type": "string", + "description": "Describes a timing type. If the value is offsetFromStart, then the offsetMs field represents an offset from the start of the video. If the value is offsetFromEnd, then the offsetMs field represents an offset from the end of the video.", + "enum": [ + "offsetFromEnd", + "offsetFromStart" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "LanguageTag": { + "id": "LanguageTag", + "type": "object", + "properties": { + "value": { + "type": "string" + } + } + }, + "LiveBroadcast": { + "id": "LiveBroadcast", + "type": "object", + "description": "A liveBroadcast resource represents an event that will be streamed, via live video, on YouTube.", + "properties": { + "contentDetails": { + "$ref": "LiveBroadcastContentDetails", + "description": "The contentDetails object contains information about the event's video content, such as whether the content can be shown in an embedded video player or if it will be archived and therefore available for viewing after the event has concluded." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the broadcast.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveBroadcast\".", + "default": "youtube#liveBroadcast" + }, + "snippet": { + "$ref": "LiveBroadcastSnippet", + "description": "The snippet object contains basic details about the event, including its title, description, start time, and end time." + }, + "statistics": { + "$ref": "LiveBroadcastStatistics", + "description": "The statistics object contains info about the event's current stats. These include concurrent viewers and total chat count. Statistics can change (in either direction) during the lifetime of an event. Statistics are only returned while the event is live." + }, + "status": { + "$ref": "LiveBroadcastStatus", + "description": "The status object contains information about the event's status." + }, + "topicDetails": { + "$ref": "LiveBroadcastTopicDetails" + } + } + }, + "LiveBroadcastContentDetails": { + "id": "LiveBroadcastContentDetails", + "type": "object", + "description": "Detailed settings of a broadcast.", + "properties": { + "boundStreamId": { + "type": "string", + "description": "This value uniquely identifies the live stream bound to the broadcast." + }, + "boundStreamLastUpdateTimeMs": { + "type": "string", + "description": "The date and time that the live stream referenced by boundStreamId was last updated.", + "format": "date-time" + }, + "closedCaptionsType": { + "type": "string", + "enum": [ + "closedCaptionsDisabled", + "closedCaptionsEmbedded", + "closedCaptionsHttpPost" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "enableClosedCaptions": { + "type": "boolean", + "description": "This setting indicates whether HTTP POST closed captioning is enabled for this broadcast. The ingestion URL of the closed captions is returned through the liveStreams API. This is mutually exclusive with using the closed_captions_type property, and is equivalent to setting closed_captions_type to CLOSED_CAPTIONS_HTTP_POST." + }, + "enableContentEncryption": { + "type": "boolean", + "description": "This setting indicates whether YouTube should enable content encryption for the broadcast.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "enableDvr": { + "type": "boolean", + "description": "This setting determines whether viewers can access DVR controls while watching the video. DVR controls enable the viewer to control the video playback experience by pausing, rewinding, or fast forwarding content. The default value for this property is true.\n\n\n\nImportant: You must set the value to true and also set the enableArchive property's value to true if you want to make playback available immediately after the broadcast ends.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "enableEmbed": { + "type": "boolean", + "description": "This setting indicates whether the broadcast video can be played in an embedded player. If you choose to archive the video (using the enableArchive property), this setting will also apply to the archived video.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "enableLowLatency": { + "type": "boolean", + "description": "Indicates whether this broadcast has low latency enabled." + }, + "monitorStream": { + "$ref": "MonitorStreamInfo", + "description": "The monitorStream object contains information about the monitor stream, which the broadcaster can use to review the event content before the broadcast stream is shown publicly." + }, + "projection": { + "type": "string", + "description": "The projection format of this broadcast. This defaults to rectangular.", + "enum": [ + "360", + "rectangular" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "recordFromStart": { + "type": "boolean", + "description": "Automatically start recording after the event goes live. The default value for this property is true.\n\n\n\nImportant: You must also set the enableDvr property's value to true if you want the playback to be available immediately after the broadcast ends. If you set this property's value to true but do not also set the enableDvr property to true, there may be a delay of around one day before the archived video will be available for playback.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "startWithSlate": { + "type": "boolean", + "description": "This setting indicates whether the broadcast should automatically begin with an in-stream slate when you update the broadcast's status to live. After updating the status, you then need to send a liveCuepoints.insert request that sets the cuepoint's eventState to end to remove the in-stream slate and make your broadcast stream visible to viewers.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + } + } + }, + "LiveBroadcastListResponse": { + "id": "LiveBroadcastListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of broadcasts that match the request criteria.", + "items": { + "$ref": "LiveBroadcast" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveBroadcastListResponse\".", + "default": "youtube#liveBroadcastListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "LiveBroadcastSnippet": { + "id": "LiveBroadcastSnippet", + "type": "object", + "properties": { + "actualEndTime": { + "type": "string", + "description": "The date and time that the broadcast actually ended. This information is only available once the broadcast's state is complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "actualStartTime": { + "type": "string", + "description": "The date and time that the broadcast actually started. This information is only available once the broadcast's state is live. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that is publishing the broadcast." + }, + "description": { + "type": "string", + "description": "The broadcast's description. As with the title, you can set this field by modifying the broadcast resource or by setting the description field of the corresponding video resource." + }, + "isDefaultBroadcast": { + "type": "boolean" + }, + "liveChatId": { + "type": "string", + "description": "The id of the live chat for this broadcast." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the broadcast was added to YouTube's live broadcast schedule. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "scheduledEndTime": { + "type": "string", + "description": "The date and time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "scheduledStartTime": { + "type": "string", + "description": "The date and time that the broadcast is scheduled to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the broadcast. For each nested object in this object, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The broadcast's title. Note that the broadcast represents exactly one YouTube video. You can set this field by modifying the broadcast resource or by setting the title field of the corresponding video resource.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + } + } + }, + "LiveBroadcastStatistics": { + "id": "LiveBroadcastStatistics", + "type": "object", + "description": "Statistics about the live broadcast. These represent a snapshot of the values at the time of the request. Statistics are only returned for live broadcasts.", + "properties": { + "concurrentViewers": { + "type": "string", + "description": "The number of viewers currently watching the broadcast. The property and its value will be present if the broadcast has current viewers and the broadcast owner has not hidden the viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers for a broadcast when the broadcast ends. So, this property would not identify the number of viewers watching an archived video of a live broadcast that already ended.", + "format": "uint64" + }, + "totalChatCount": { + "type": "string", + "description": "The total number of live chat messages currently on the broadcast. The property and its value will be present if the broadcast is public, has the live chat feature enabled, and has at least one message. Note that this field will not be filled after the broadcast ends. So this property would not identify the number of chat messages for an archived video of a completed live broadcast.", + "format": "uint64" + } + } + }, + "LiveBroadcastStatus": { + "id": "LiveBroadcastStatus", + "type": "object", + "properties": { + "lifeCycleStatus": { + "type": "string", + "description": "The broadcast's status. The status can be updated using the API's liveBroadcasts.transition method.", + "enum": [ + "abandoned", + "complete", + "completeStarting", + "created", + "live", + "liveStarting", + "ready", + "reclaimed", + "revoked", + "testStarting", + "testing" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "liveBroadcastPriority": { + "type": "string", + "description": "Priority of the live broadcast event (internal state).", + "enum": [ + "high", + "low", + "normal" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "privacyStatus": { + "type": "string", + "description": "The broadcast's privacy status. Note that the broadcast represents exactly one YouTube video, so the privacy settings are identical to those supported for videos. In addition, you can set this field by modifying the broadcast resource or by setting the privacyStatus field of the corresponding video resource.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ], + "annotations": { + "required": [ + "youtube.liveBroadcasts.insert", + "youtube.liveBroadcasts.update" + ] + } + }, + "recordingStatus": { + "type": "string", + "description": "The broadcast's recording status.", + "enum": [ + "notRecording", + "recorded", + "recording" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "LiveBroadcastTopic": { + "id": "LiveBroadcastTopic", + "type": "object", + "properties": { + "snippet": { + "$ref": "LiveBroadcastTopicSnippet", + "description": "Information about the topic matched." + }, + "type": { + "type": "string", + "description": "The type of the topic.", + "enum": [ + "videoGame" + ], + "enumDescriptions": [ + "" + ] + }, + "unmatched": { + "type": "boolean", + "description": "If this flag is set it means that we have not been able to match the topic title and type provided to a known entity." + } + } + }, + "LiveBroadcastTopicDetails": { + "id": "LiveBroadcastTopicDetails", + "type": "object", + "properties": { + "topics": { + "type": "array", + "items": { + "$ref": "LiveBroadcastTopic" + } + } + } + }, + "LiveBroadcastTopicSnippet": { + "id": "LiveBroadcastTopicSnippet", + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the topic." + }, + "releaseDate": { + "type": "string", + "description": "The date at which the topic was released. Filled for types: videoGame" + } + } + }, + "LiveChatBan": { + "id": "LiveChatBan", + "type": "object", + "description": "A liveChatBan resource represents a ban for a YouTube live chat.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the ban." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveChatBan\".", + "default": "youtube#liveChatBan" + }, + "snippet": { + "$ref": "LiveChatBanSnippet", + "description": "The snippet object contains basic details about the ban." + } + } + }, + "LiveChatBanSnippet": { + "id": "LiveChatBanSnippet", + "type": "object", + "properties": { + "banDurationSeconds": { + "type": "string", + "description": "The duration of a ban, only filled if the ban has type TEMPORARY.", + "format": "uint64" + }, + "bannedUserDetails": { + "$ref": "ChannelProfileDetails" + }, + "liveChatId": { + "type": "string", + "description": "The chat this ban is pertinent to." + }, + "type": { + "type": "string", + "description": "The type of ban.", + "enum": [ + "permanent", + "temporary" + ], + "enumDescriptions": [ + "", + "" + ] + } + } + }, + "LiveChatFanFundingEventDetails": { + "id": "LiveChatFanFundingEventDetails", + "type": "object", + "properties": { + "amountDisplayString": { + "type": "string", + "description": "A rendered string that displays the fund amount and currency to the user." + }, + "amountMicros": { + "type": "string", + "description": "The amount of the fund.", + "format": "uint64" + }, + "currency": { + "type": "string", + "description": "The currency in which the fund was made." + }, + "userComment": { + "type": "string", + "description": "The comment added by the user to this fan funding event." + } + } + }, + "LiveChatMessage": { + "id": "LiveChatMessage", + "type": "object", + "description": "A liveChatMessage resource represents a chat message in a YouTube Live Chat.", + "properties": { + "authorDetails": { + "$ref": "LiveChatMessageAuthorDetails", + "description": "The authorDetails object contains basic details about the user that posted this message." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the message." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveChatMessage\".", + "default": "youtube#liveChatMessage" + }, + "snippet": { + "$ref": "LiveChatMessageSnippet", + "description": "The snippet object contains basic details about the message." + } + } + }, + "LiveChatMessageAuthorDetails": { + "id": "LiveChatMessageAuthorDetails", + "type": "object", + "properties": { + "channelId": { + "type": "string", + "description": "The YouTube channel ID." + }, + "channelUrl": { + "type": "string", + "description": "The channel's URL." + }, + "displayName": { + "type": "string", + "description": "The channel's display name." + }, + "isChatModerator": { + "type": "boolean", + "description": "Whether the author is a moderator of the live chat." + }, + "isChatOwner": { + "type": "boolean", + "description": "Whether the author is the owner of the live chat." + }, + "isChatSponsor": { + "type": "boolean", + "description": "Whether the author is a sponsor of the live chat." + }, + "isVerified": { + "type": "boolean", + "description": "Whether the author's identity has been verified by YouTube." + }, + "profileImageUrl": { + "type": "string", + "description": "The channels's avatar URL." + } + } + }, + "LiveChatMessageDeletedDetails": { + "id": "LiveChatMessageDeletedDetails", + "type": "object", + "properties": { + "deletedMessageId": { + "type": "string" + } + } + }, + "LiveChatMessageListResponse": { + "id": "LiveChatMessageListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of live chat messages.", + "items": { + "$ref": "LiveChatMessage" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveChatMessageListResponse\".", + "default": "youtube#liveChatMessageListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "offlineAt": { + "type": "string", + "description": "The date and time when the underlying stream went offline. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "pollingIntervalMillis": { + "type": "integer", + "description": "The amount of time the client should wait before polling again.", + "format": "uint32" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "LiveChatMessageRetractedDetails": { + "id": "LiveChatMessageRetractedDetails", + "type": "object", + "properties": { + "retractedMessageId": { + "type": "string" + } + } + }, + "LiveChatMessageSnippet": { + "id": "LiveChatMessageSnippet", + "type": "object", + "properties": { + "authorChannelId": { + "type": "string", + "description": "The ID of the user that authored this message, this field is not always filled. textMessageEvent - the user that wrote the message fanFundingEvent - the user that funded the broadcast newSponsorEvent - the user that just became a sponsor messageDeletedEvent - the moderator that took the action messageRetractedEvent - the author that retracted their message userBannedEvent - the moderator that took the action superChatEvent - the user that made the purchase" + }, + "displayMessage": { + "type": "string", + "description": "Contains a string that can be displayed to the user. If this field is not present the message is silent, at the moment only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent." + }, + "fanFundingEventDetails": { + "$ref": "LiveChatFanFundingEventDetails", + "description": "Details about the funding event, this is only set if the type is 'fanFundingEvent'." + }, + "hasDisplayContent": { + "type": "boolean", + "description": "Whether the message has display content that should be displayed to users." + }, + "liveChatId": { + "type": "string" + }, + "messageDeletedDetails": { + "$ref": "LiveChatMessageDeletedDetails" + }, + "messageRetractedDetails": { + "$ref": "LiveChatMessageRetractedDetails" + }, + "pollClosedDetails": { + "$ref": "LiveChatPollClosedDetails" + }, + "pollEditedDetails": { + "$ref": "LiveChatPollEditedDetails" + }, + "pollOpenedDetails": { + "$ref": "LiveChatPollOpenedDetails" + }, + "pollVotedDetails": { + "$ref": "LiveChatPollVotedDetails" + }, + "publishedAt": { + "type": "string", + "description": "The date and time when the message was orignally published. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "superChatDetails": { + "$ref": "LiveChatSuperChatDetails", + "description": "Details about the Super Chat event, this is only set if the type is 'superChatEvent'." + }, + "textMessageDetails": { + "$ref": "LiveChatTextMessageDetails", + "description": "Details about the text message, this is only set if the type is 'textMessageEvent'." + }, + "type": { + "type": "string", + "description": "The type of message, this will always be present, it determines the contents of the message as well as which fields will be present.", + "enum": [ + "chatEndedEvent", + "fanFundingEvent", + "messageDeletedEvent", + "messageRetractedEvent", + "newSponsorEvent", + "pollClosedEvent", + "pollEditedEvent", + "pollOpenedEvent", + "pollVotedEvent", + "sponsorOnlyModeEndedEvent", + "sponsorOnlyModeStartedEvent", + "superChatEvent", + "textMessageEvent", + "tombstone", + "userBannedEvent" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "userBannedDetails": { + "$ref": "LiveChatUserBannedMessageDetails" + } + } + }, + "LiveChatModerator": { + "id": "LiveChatModerator", + "type": "object", + "description": "A liveChatModerator resource represents a moderator for a YouTube live chat. A chat moderator has the ability to ban/unban users from a chat, remove message, etc.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the moderator." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveChatModerator\".", + "default": "youtube#liveChatModerator" + }, + "snippet": { + "$ref": "LiveChatModeratorSnippet", + "description": "The snippet object contains basic details about the moderator." + } + } + }, + "LiveChatModeratorListResponse": { + "id": "LiveChatModeratorListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of moderators that match the request criteria.", + "items": { + "$ref": "LiveChatModerator" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveChatModeratorListResponse\".", + "default": "youtube#liveChatModeratorListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "LiveChatModeratorSnippet": { + "id": "LiveChatModeratorSnippet", + "type": "object", + "properties": { + "liveChatId": { + "type": "string", + "description": "The ID of the live chat this moderator can act on." + }, + "moderatorDetails": { + "$ref": "ChannelProfileDetails", + "description": "Details about the moderator." + } + } + }, + "LiveChatPollClosedDetails": { + "id": "LiveChatPollClosedDetails", + "type": "object", + "properties": { + "pollId": { + "type": "string", + "description": "The id of the poll that was closed." + } + } + }, + "LiveChatPollEditedDetails": { + "id": "LiveChatPollEditedDetails", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "$ref": "LiveChatPollItem" + } + }, + "prompt": { + "type": "string" + } + } + }, + "LiveChatPollItem": { + "id": "LiveChatPollItem", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Plain text description of the item." + }, + "itemId": { + "type": "string" + } + } + }, + "LiveChatPollOpenedDetails": { + "id": "LiveChatPollOpenedDetails", + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "$ref": "LiveChatPollItem" + } + }, + "prompt": { + "type": "string" + } + } + }, + "LiveChatPollVotedDetails": { + "id": "LiveChatPollVotedDetails", + "type": "object", + "properties": { + "itemId": { + "type": "string", + "description": "The poll item the user chose." + }, + "pollId": { + "type": "string", + "description": "The poll the user voted on." + } + } + }, + "LiveChatSuperChatDetails": { + "id": "LiveChatSuperChatDetails", + "type": "object", + "properties": { + "amountDisplayString": { + "type": "string", + "description": "A rendered string that displays the fund amount and currency to the user." + }, + "amountMicros": { + "type": "string", + "description": "The amount purchased by the user, in micros (1,750,000 micros = 1.75).", + "format": "uint64" + }, + "currency": { + "type": "string", + "description": "The currency in which the purchase was made." + }, + "tier": { + "type": "integer", + "description": "The tier in which the amount belongs to. Lower amounts belong to lower tiers. Starts at 1.", + "format": "uint32" + }, + "userComment": { + "type": "string", + "description": "The comment added by the user to this Super Chat event." + } + } + }, + "LiveChatTextMessageDetails": { + "id": "LiveChatTextMessageDetails", + "type": "object", + "properties": { + "messageText": { + "type": "string", + "description": "The user's message." + } + } + }, + "LiveChatUserBannedMessageDetails": { + "id": "LiveChatUserBannedMessageDetails", + "type": "object", + "properties": { + "banDurationSeconds": { + "type": "string", + "description": "The duration of the ban. This property is only present if the banType is temporary.", + "format": "uint64" + }, + "banType": { + "type": "string", + "description": "The type of ban.", + "enum": [ + "permanent", + "temporary" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "bannedUserDetails": { + "$ref": "ChannelProfileDetails", + "description": "The details of the user that was banned." + } + } + }, + "LiveStream": { + "id": "LiveStream", + "type": "object", + "description": "A live stream describes a live ingestion point.", + "properties": { + "cdn": { + "$ref": "CdnSettings", + "description": "The cdn object defines the live stream's content delivery network (CDN) settings. These settings provide details about the manner in which you stream your content to YouTube." + }, + "contentDetails": { + "$ref": "LiveStreamContentDetails", + "description": "The content_details object contains information about the stream, including the closed captions ingestion URL." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the stream.", + "annotations": { + "required": [ + "youtube.liveStreams.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveStream\".", + "default": "youtube#liveStream" + }, + "snippet": { + "$ref": "LiveStreamSnippet", + "description": "The snippet object contains basic details about the stream, including its channel, title, and description." + }, + "status": { + "$ref": "LiveStreamStatus", + "description": "The status object contains information about live stream's status." + } + } + }, + "LiveStreamConfigurationIssue": { + "id": "LiveStreamConfigurationIssue", + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "The long-form description of the issue and how to resolve it." + }, + "reason": { + "type": "string", + "description": "The short-form reason for this issue." + }, + "severity": { + "type": "string", + "description": "How severe this issue is to the stream.", + "enum": [ + "error", + "info", + "warning" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "type": { + "type": "string", + "description": "The kind of error happening.", + "enum": [ + "audioBitrateHigh", + "audioBitrateLow", + "audioBitrateMismatch", + "audioCodec", + "audioCodecMismatch", + "audioSampleRate", + "audioSampleRateMismatch", + "audioStereoMismatch", + "audioTooManyChannels", + "badContainer", + "bitrateHigh", + "bitrateLow", + "frameRateHigh", + "framerateMismatch", + "gopMismatch", + "gopSizeLong", + "gopSizeOver", + "gopSizeShort", + "interlacedVideo", + "multipleAudioStreams", + "multipleVideoStreams", + "noAudioStream", + "noVideoStream", + "openGop", + "resolutionMismatch", + "videoBitrateMismatch", + "videoCodec", + "videoCodecMismatch", + "videoIngestionStarved", + "videoInterlaceMismatch", + "videoProfileMismatch", + "videoResolutionSuboptimal", + "videoResolutionUnsupported" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + } + }, + "LiveStreamContentDetails": { + "id": "LiveStreamContentDetails", + "type": "object", + "description": "Detailed settings of a stream.", + "properties": { + "closedCaptionsIngestionUrl": { + "type": "string", + "description": "The ingestion URL where the closed captions of this stream are sent." + }, + "isReusable": { + "type": "boolean", + "description": "Indicates whether the stream is reusable, which means that it can be bound to multiple broadcasts. It is common for broadcasters to reuse the same stream for many different broadcasts if those broadcasts occur at different times.\n\nIf you set this value to false, then the stream will not be reusable, which means that it can only be bound to one broadcast. Non-reusable streams differ from reusable streams in the following ways: \n- A non-reusable stream can only be bound to one broadcast. \n- A non-reusable stream might be deleted by an automated process after the broadcast ends. \n- The liveStreams.list method does not list non-reusable streams if you call the method and set the mine parameter to true. The only way to use that method to retrieve the resource for a non-reusable stream is to use the id parameter to identify the stream." + } + } + }, + "LiveStreamHealthStatus": { + "id": "LiveStreamHealthStatus", + "type": "object", + "properties": { + "configurationIssues": { + "type": "array", + "description": "The configurations issues on this stream", + "items": { + "$ref": "LiveStreamConfigurationIssue" + } + }, + "lastUpdateTimeSeconds": { + "type": "string", + "description": "The last time this status was updated (in seconds)", + "format": "uint64" + }, + "status": { + "type": "string", + "description": "The status code of this stream", + "enum": [ + "bad", + "good", + "noData", + "ok", + "revoked" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "LiveStreamListResponse": { + "id": "LiveStreamListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of live streams that match the request criteria.", + "items": { + "$ref": "LiveStream" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#liveStreamListResponse\".", + "default": "youtube#liveStreamListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "LiveStreamSnippet": { + "id": "LiveStreamSnippet", + "type": "object", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that is transmitting the stream." + }, + "description": { + "type": "string", + "description": "The stream's description. The value cannot be longer than 10000 characters." + }, + "isDefaultStream": { + "type": "boolean" + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the stream was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "title": { + "type": "string", + "description": "The stream's title. The value must be between 1 and 128 characters long.", + "annotations": { + "required": [ + "youtube.liveStreams.insert", + "youtube.liveStreams.update" + ] + } + } + } + }, + "LiveStreamStatus": { + "id": "LiveStreamStatus", + "type": "object", + "description": "Brief description of the live stream status.", + "properties": { + "healthStatus": { + "$ref": "LiveStreamHealthStatus", + "description": "The health status of the stream." + }, + "streamStatus": { + "type": "string", + "enum": [ + "active", + "created", + "error", + "inactive", + "ready" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "LocalizedProperty": { + "id": "LocalizedProperty", + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "defaultLanguage": { + "$ref": "LanguageTag", + "description": "The language of the default property." + }, + "localized": { + "type": "array", + "items": { + "$ref": "LocalizedString" + } + } + } + }, + "LocalizedString": { + "id": "LocalizedString", + "type": "object", + "properties": { + "language": { + "type": "string" + }, + "value": { + "type": "string" + } + } + }, + "MonitorStreamInfo": { + "id": "MonitorStreamInfo", + "type": "object", + "description": "Settings and Info of the monitor stream", + "properties": { + "broadcastStreamDelayMs": { + "type": "integer", + "description": "If you have set the enableMonitorStream property to true, then this property determines the length of the live broadcast delay.", + "format": "uint32", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + }, + "embedHtml": { + "type": "string", + "description": "HTML code that embeds a player that plays the monitor stream." + }, + "enableMonitorStream": { + "type": "boolean", + "description": "This value determines whether the monitor stream is enabled for the broadcast. If the monitor stream is enabled, then YouTube will broadcast the event content on a special stream intended only for the broadcaster's consumption. The broadcaster can use the stream to review the event content and also to identify the optimal times to insert cuepoints.\n\nYou need to set this value to true if you intend to have a broadcast delay for your event.\n\nNote: This property cannot be updated once the broadcast is in the testing or live state.", + "annotations": { + "required": [ + "youtube.liveBroadcasts.update" + ] + } + } + } + }, + "PageInfo": { + "id": "PageInfo", + "type": "object", + "description": "Paging details for lists of resources, including total number of items available and number of resources returned in a single page.", + "properties": { + "resultsPerPage": { + "type": "integer", + "description": "The number of results included in the API response.", + "format": "int32" + }, + "totalResults": { + "type": "integer", + "description": "The total number of results in the result set.", + "format": "int32" + } + } + }, + "Playlist": { + "id": "Playlist", + "type": "object", + "description": "A playlist resource represents a YouTube playlist. A playlist is a collection of videos that can be viewed sequentially and shared with other users. A playlist can contain up to 200 videos, and YouTube does not limit the number of playlists that each user creates. By default, playlists are publicly visible to other users, but playlists can be public or private.\n\nYouTube also uses playlists to identify special collections of videos for a channel, such as: \n- uploaded videos \n- favorite videos \n- positively rated (liked) videos \n- watch history \n- watch later To be more specific, these lists are associated with a channel, which is a collection of a person, group, or company's videos, playlists, and other YouTube information. You can retrieve the playlist IDs for each of these lists from the channel resource for a given channel.\n\nYou can then use the playlistItems.list method to retrieve any of those lists. You can also add or remove items from those lists by calling the playlistItems.insert and playlistItems.delete methods.", + "properties": { + "contentDetails": { + "$ref": "PlaylistContentDetails", + "description": "The contentDetails object contains information like video count." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the playlist." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlist\".", + "default": "youtube#playlist" + }, + "localizations": { + "type": "object", + "description": "Localizations for different languages", + "additionalProperties": { + "$ref": "PlaylistLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "player": { + "$ref": "PlaylistPlayer", + "description": "The player object contains information that you would use to play the playlist in an embedded player." + }, + "snippet": { + "$ref": "PlaylistSnippet", + "description": "The snippet object contains basic details about the playlist, such as its title and description." + }, + "status": { + "$ref": "PlaylistStatus", + "description": "The status object contains status information for the playlist." + } + } + }, + "PlaylistContentDetails": { + "id": "PlaylistContentDetails", + "type": "object", + "properties": { + "itemCount": { + "type": "integer", + "description": "The number of videos in the playlist.", + "format": "uint32" + } + } + }, + "PlaylistItem": { + "id": "PlaylistItem", + "type": "object", + "description": "A playlistItem resource identifies another resource, such as a video, that is included in a playlist. In addition, the playlistItem resource contains details about the included resource that pertain specifically to how that resource is used in that playlist.\n\nYouTube uses playlists to identify special collections of videos for a channel, such as: \n- uploaded videos \n- favorite videos \n- positively rated (liked) videos \n- watch history \n- watch later To be more specific, these lists are associated with a channel, which is a collection of a person, group, or company's videos, playlists, and other YouTube information.\n\nYou can retrieve the playlist IDs for each of these lists from the channel resource for a given channel. You can then use the playlistItems.list method to retrieve any of those lists. You can also add or remove items from those lists by calling the playlistItems.insert and playlistItems.delete methods. For example, if a user gives a positive rating to a video, you would insert that video into the liked videos playlist for that user's channel.", + "properties": { + "contentDetails": { + "$ref": "PlaylistItemContentDetails", + "description": "The contentDetails object is included in the resource if the included item is a YouTube video. The object contains additional information about the video." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the playlist item." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlistItem\".", + "default": "youtube#playlistItem" + }, + "snippet": { + "$ref": "PlaylistItemSnippet", + "description": "The snippet object contains basic details about the playlist item, such as its title and position in the playlist." + }, + "status": { + "$ref": "PlaylistItemStatus", + "description": "The status object contains information about the playlist item's privacy status." + } + } + }, + "PlaylistItemContentDetails": { + "id": "PlaylistItemContentDetails", + "type": "object", + "properties": { + "endAt": { + "type": "string", + "description": "The time, measured in seconds from the start of the video, when the video should stop playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) By default, assume that the video.endTime is the end of the video." + }, + "note": { + "type": "string", + "description": "A user-generated note for this item." + }, + "startAt": { + "type": "string", + "description": "The time, measured in seconds from the start of the video, when the video should start playing. (The playlist owner can specify the times when the video should start and stop playing when the video is played in the context of the playlist.) The default value is 0." + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify a video. To retrieve the video resource, set the id query parameter to this value in your API request." + }, + "videoPublishedAt": { + "type": "string", + "description": "The date and time that the video was published to YouTube. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "PlaylistItemListResponse": { + "id": "PlaylistItemListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of playlist items that match the request criteria.", + "items": { + "$ref": "PlaylistItem" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlistItemListResponse\".", + "default": "youtube#playlistItemListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "PlaylistItemSnippet": { + "id": "PlaylistItemSnippet", + "type": "object", + "description": "Basic details about a playlist, including title, description and thumbnails.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the user that added the item to the playlist." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel that the playlist item belongs to." + }, + "description": { + "type": "string", + "description": "The item's description." + }, + "playlistId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the playlist that the playlist item is in.", + "annotations": { + "required": [ + "youtube.playlistItems.insert", + "youtube.playlistItems.update" + ] + } + }, + "position": { + "type": "integer", + "description": "The order in which the item appears in the playlist. The value uses a zero-based index, so the first item has a position of 0, the second item has a position of 1, and so forth.", + "format": "uint32" + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the item was added to the playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The id object contains information that can be used to uniquely identify the resource that is included in the playlist as the playlist item.", + "annotations": { + "required": [ + "youtube.playlistItems.insert", + "youtube.playlistItems.update" + ] + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the playlist item. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The item's title." + } + } + }, + "PlaylistItemStatus": { + "id": "PlaylistItemStatus", + "type": "object", + "description": "Information about the playlist item's privacy status.", + "properties": { + "privacyStatus": { + "type": "string", + "description": "This resource's privacy status.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "PlaylistListResponse": { + "id": "PlaylistListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of playlists that match the request criteria.", + "items": { + "$ref": "Playlist" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#playlistListResponse\".", + "default": "youtube#playlistListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "PlaylistLocalization": { + "id": "PlaylistLocalization", + "type": "object", + "description": "Playlist localization setting", + "properties": { + "description": { + "type": "string", + "description": "The localized strings for playlist's description." + }, + "title": { + "type": "string", + "description": "The localized strings for playlist's title." + } + } + }, + "PlaylistPlayer": { + "id": "PlaylistPlayer", + "type": "object", + "properties": { + "embedHtml": { + "type": "string", + "description": "An \u003ciframe\u003e tag that embeds a player that will play the playlist." + } + } + }, + "PlaylistSnippet": { + "id": "PlaylistSnippet", + "type": "object", + "description": "Basic details about a playlist, including title, description and thumbnails.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that published the playlist." + }, + "channelTitle": { + "type": "string", + "description": "The channel title of the channel that the video belongs to." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the playlist's default title and description." + }, + "description": { + "type": "string", + "description": "The playlist's description." + }, + "localized": { + "$ref": "PlaylistLocalization", + "description": "Localized title and description, read-only." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the playlist was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "tags": { + "type": "array", + "description": "Keyword tags associated with the playlist.", + "items": { + "type": "string" + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the playlist. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The playlist's title.", + "annotations": { + "required": [ + "youtube.playlists.insert", + "youtube.playlists.update" + ] + } + } + } + }, + "PlaylistStatus": { + "id": "PlaylistStatus", + "type": "object", + "properties": { + "privacyStatus": { + "type": "string", + "description": "The playlist's privacy status.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + } + } + }, + "PromotedItem": { + "id": "PromotedItem", + "type": "object", + "description": "Describes a single promoted item.", + "properties": { + "customMessage": { + "type": "string", + "description": "A custom message to display for this promotion. This field is currently ignored unless the promoted item is a website." + }, + "id": { + "$ref": "PromotedItemId", + "description": "Identifies the promoted item." + }, + "promotedByContentOwner": { + "type": "boolean", + "description": "If true, the content owner's name will be used when displaying the promotion. This field can only be set when the update is made on behalf of the content owner." + }, + "timing": { + "$ref": "InvideoTiming", + "description": "The temporal position within the video where the promoted item will be displayed. If present, it overrides the default timing." + } + } + }, + "PromotedItemId": { + "id": "PromotedItemId", + "type": "object", + "description": "Describes a single promoted item id. It is a union of various possible types.", + "properties": { + "recentlyUploadedBy": { + "type": "string", + "description": "If type is recentUpload, this field identifies the channel from which to take the recent upload. If missing, the channel is assumed to be the same channel for which the invideoPromotion is set." + }, + "type": { + "type": "string", + "description": "Describes the type of the promoted item.", + "enum": [ + "recentUpload", + "video", + "website" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "videoId": { + "type": "string", + "description": "If the promoted item represents a video, this field represents the unique YouTube ID identifying it. This field will be present only if type has the value video." + }, + "websiteUrl": { + "type": "string", + "description": "If the promoted item represents a website, this field represents the url pointing to the website. This field will be present only if type has the value website." + } + } + }, + "PropertyValue": { + "id": "PropertyValue", + "type": "object", + "description": "A pair Property / Value.", + "properties": { + "property": { + "type": "string", + "description": "A property." + }, + "value": { + "type": "string", + "description": "The property's value." + } + } + }, + "ResourceId": { + "id": "ResourceId", + "type": "object", + "description": "A resource id is a generic reference that points to another YouTube resource.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the referred resource, if that resource is a channel. This property is only present if the resourceId.kind value is youtube#channel." + }, + "kind": { + "type": "string", + "description": "The type of the API resource." + }, + "playlistId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the referred resource, if that resource is a playlist. This property is only present if the resourceId.kind value is youtube#playlist." + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the referred resource, if that resource is a video. This property is only present if the resourceId.kind value is youtube#video." + } + } + }, + "SearchListResponse": { + "id": "SearchListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of results that match the search criteria.", + "items": { + "$ref": "SearchResult" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#searchListResponse\".", + "default": "youtube#searchListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "regionCode": { + "type": "string" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "SearchResult": { + "id": "SearchResult", + "type": "object", + "description": "A search result contains information about a YouTube video, channel, or playlist that matches the search parameters specified in an API request. While a search result points to a uniquely identifiable resource, like a video, it does not have its own persistent data.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "$ref": "ResourceId", + "description": "The id object contains information that can be used to uniquely identify the resource that matches the search request." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#searchResult\".", + "default": "youtube#searchResult" + }, + "snippet": { + "$ref": "SearchResultSnippet", + "description": "The snippet object contains basic details about a search result, such as its title or description. For example, if the search result is a video, then the title will be the video's title and the description will be the video's description." + } + } + }, + "SearchResultSnippet": { + "id": "SearchResultSnippet", + "type": "object", + "description": "Basic details about a search result, including title, description and thumbnails of the item referenced by the search result.", + "properties": { + "channelId": { + "type": "string", + "description": "The value that YouTube uses to uniquely identify the channel that published the resource that the search result identifies." + }, + "channelTitle": { + "type": "string", + "description": "The title of the channel that published the resource that the search result identifies." + }, + "description": { + "type": "string", + "description": "A description of the search result." + }, + "liveBroadcastContent": { + "type": "string", + "description": "It indicates if the resource (video or channel) has upcoming/active live broadcast content. Or it's \"none\" if there is not any upcoming/active live broadcasts.", + "enum": [ + "live", + "none", + "upcoming" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "publishedAt": { + "type": "string", + "description": "The creation date and time of the resource that the search result identifies. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the search result. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The title of the search result." + } + } + }, + "Sponsor": { + "id": "Sponsor", + "type": "object", + "description": "A sponsor resource represents a sponsor for a YouTube channel. A sponsor provides recurring monetary support to a creator and receives special benefits.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the sponsor." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#sponsor\".", + "default": "youtube#sponsor" + }, + "snippet": { + "$ref": "SponsorSnippet", + "description": "The snippet object contains basic details about the sponsor." + } + } + }, + "SponsorListResponse": { + "id": "SponsorListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of sponsors that match the request criteria.", + "items": { + "$ref": "Sponsor" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#sponsorListResponse\".", + "default": "youtube#sponsorListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "SponsorSnippet": { + "id": "SponsorSnippet", + "type": "object", + "properties": { + "channelId": { + "type": "string", + "description": "The id of the channel being sponsored." + }, + "sponsorDetails": { + "$ref": "ChannelProfileDetails", + "description": "Details about the sponsor." + }, + "sponsorSince": { + "type": "string", + "description": "The date and time when the user became a sponsor. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "Subscription": { + "id": "Subscription", + "type": "object", + "description": "A subscription resource contains information about a YouTube user subscription. A subscription notifies a user when new videos are added to a channel or when another user takes one of several actions on YouTube, such as uploading a video, rating a video, or commenting on a video.", + "properties": { + "contentDetails": { + "$ref": "SubscriptionContentDetails", + "description": "The contentDetails object contains basic statistics about the subscription." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the subscription." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#subscription\".", + "default": "youtube#subscription" + }, + "snippet": { + "$ref": "SubscriptionSnippet", + "description": "The snippet object contains basic details about the subscription, including its title and the channel that the user subscribed to." + }, + "subscriberSnippet": { + "$ref": "SubscriptionSubscriberSnippet", + "description": "The subscriberSnippet object contains basic details about the sbuscriber." + } + } + }, + "SubscriptionContentDetails": { + "id": "SubscriptionContentDetails", + "type": "object", + "description": "Details about the content to witch a subscription refers.", + "properties": { + "activityType": { + "type": "string", + "description": "The type of activity this subscription is for (only uploads, everything).", + "enum": [ + "all", + "uploads" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "newItemCount": { + "type": "integer", + "description": "The number of new items in the subscription since its content was last read.", + "format": "uint32" + }, + "totalItemCount": { + "type": "integer", + "description": "The approximate number of items that the subscription points to.", + "format": "uint32" + } + } + }, + "SubscriptionListResponse": { + "id": "SubscriptionListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of subscriptions that match the request criteria.", + "items": { + "$ref": "Subscription" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#subscriptionListResponse\".", + "default": "youtube#subscriptionListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "SubscriptionSnippet": { + "id": "SubscriptionSnippet", + "type": "object", + "description": "Basic details about a subscription, including title, description and thumbnails of the subscribed item.", + "properties": { + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the subscriber's channel." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel that the subscription belongs to." + }, + "description": { + "type": "string", + "description": "The subscription's details." + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the subscription was created. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "resourceId": { + "$ref": "ResourceId", + "description": "The id object contains information about the channel that the user subscribed to.", + "annotations": { + "required": [ + "youtube.subscriptions.insert" + ] + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The subscription's title." + } + } + }, + "SubscriptionSubscriberSnippet": { + "id": "SubscriptionSubscriberSnippet", + "type": "object", + "description": "Basic details about a subscription's subscriber including title, description, channel ID and thumbnails.", + "properties": { + "channelId": { + "type": "string", + "description": "The channel ID of the subscriber." + }, + "description": { + "type": "string", + "description": "The description of the subscriber." + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "Thumbnails for this subscriber." + }, + "title": { + "type": "string", + "description": "The title of the subscriber." + } + } + }, + "SuperChatEvent": { + "id": "SuperChatEvent", + "type": "object", + "description": "A superChatEvent resource represents a Super Chat purchase on a YouTube channel.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube assigns to uniquely identify the Super Chat event." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#superChatEvent\".", + "default": "youtube#superChatEvent" + }, + "snippet": { + "$ref": "SuperChatEventSnippet", + "description": "The snippet object contains basic details about the Super Chat event." + } + } + }, + "SuperChatEventListResponse": { + "id": "SuperChatEventListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of Super Chat purchases that match the request criteria.", + "items": { + "$ref": "SuperChatEvent" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#superChatEventListResponse\".", + "default": "youtube#superChatEventListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "SuperChatEventSnippet": { + "id": "SuperChatEventSnippet", + "type": "object", + "properties": { + "amountMicros": { + "type": "string", + "description": "The purchase amount, in micros of the purchase currency. e.g., 1 is represented as 1000000.", + "format": "uint64" + }, + "channelId": { + "type": "string", + "description": "Channel id where the event occurred." + }, + "commentText": { + "type": "string", + "description": "The text contents of the comment left by the user." + }, + "createdAt": { + "type": "string", + "description": "The date and time when the event occurred. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "currency": { + "type": "string", + "description": "The currency in which the purchase was made. ISO 4217." + }, + "displayString": { + "type": "string", + "description": "A rendered string that displays the purchase amount and currency (e.g., \"$1.00\"). The string is rendered for the given language." + }, + "messageType": { + "type": "integer", + "description": "The tier for the paid message, which is based on the amount of money spent to purchase the message.", + "format": "uint32" + }, + "supporterDetails": { + "$ref": "ChannelProfileDetails", + "description": "Details about the supporter." + } + } + }, + "Thumbnail": { + "id": "Thumbnail", + "type": "object", + "description": "A thumbnail is an image representing a YouTube resource.", + "properties": { + "height": { + "type": "integer", + "description": "(Optional) Height of the thumbnail image.", + "format": "uint32" + }, + "url": { + "type": "string", + "description": "The thumbnail image's URL." + }, + "width": { + "type": "integer", + "description": "(Optional) Width of the thumbnail image.", + "format": "uint32" + } + } + }, + "ThumbnailDetails": { + "id": "ThumbnailDetails", + "type": "object", + "description": "Internal representation of thumbnails for a YouTube resource.", + "properties": { + "default": { + "$ref": "Thumbnail", + "description": "The default image for this resource." + }, + "high": { + "$ref": "Thumbnail", + "description": "The high quality image for this resource." + }, + "maxres": { + "$ref": "Thumbnail", + "description": "The maximum resolution quality image for this resource." + }, + "medium": { + "$ref": "Thumbnail", + "description": "The medium quality image for this resource." + }, + "standard": { + "$ref": "Thumbnail", + "description": "The standard quality image for this resource." + } + } + }, + "ThumbnailSetResponse": { + "id": "ThumbnailSetResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of thumbnails.", + "items": { + "$ref": "ThumbnailDetails" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#thumbnailSetResponse\".", + "default": "youtube#thumbnailSetResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "TokenPagination": { + "id": "TokenPagination", + "type": "object", + "description": "Stub token pagination template to suppress results." + }, + "Video": { + "id": "Video", + "type": "object", + "description": "A video resource represents a YouTube video.", + "properties": { + "ageGating": { + "$ref": "VideoAgeGating", + "description": "Age restriction details related to a video. This data can only be retrieved by the video owner." + }, + "contentDetails": { + "$ref": "VideoContentDetails", + "description": "The contentDetails object contains information about the video content, including the length of the video and its aspect ratio." + }, + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "fileDetails": { + "$ref": "VideoFileDetails", + "description": "The fileDetails object encapsulates information about the video file that was uploaded to YouTube, including the file's resolution, duration, audio and video codecs, stream bitrates, and more. This data can only be retrieved by the video owner." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video.", + "annotations": { + "required": [ + "youtube.videos.update" + ] + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#video\".", + "default": "youtube#video" + }, + "liveStreamingDetails": { + "$ref": "VideoLiveStreamingDetails", + "description": "The liveStreamingDetails object contains metadata about a live video broadcast. The object will only be present in a video resource if the video is an upcoming, live, or completed live broadcast." + }, + "localizations": { + "type": "object", + "description": "List with all localizations.", + "additionalProperties": { + "$ref": "VideoLocalization", + "description": "The language tag, using string since map_key require simple types." + } + }, + "monetizationDetails": { + "$ref": "VideoMonetizationDetails", + "description": "The monetizationDetails object encapsulates information about the monetization status of the video." + }, + "player": { + "$ref": "VideoPlayer", + "description": "The player object contains information that you would use to play the video in an embedded player." + }, + "processingDetails": { + "$ref": "VideoProcessingDetails", + "description": "The processingProgress object encapsulates information about YouTube's progress in processing the uploaded video file. The properties in the object identify the current processing status and an estimate of the time remaining until YouTube finishes processing the video. This part also indicates whether different types of data or content, such as file details or thumbnail images, are available for the video.\n\nThe processingProgress object is designed to be polled so that the video uploaded can track the progress that YouTube has made in processing the uploaded video file. This data can only be retrieved by the video owner." + }, + "projectDetails": { + "$ref": "VideoProjectDetails", + "description": "The projectDetails object contains information about the project specific video metadata." + }, + "recordingDetails": { + "$ref": "VideoRecordingDetails", + "description": "The recordingDetails object encapsulates information about the location, date and address where the video was recorded." + }, + "snippet": { + "$ref": "VideoSnippet", + "description": "The snippet object contains basic details about the video, such as its title, description, and category." + }, + "statistics": { + "$ref": "VideoStatistics", + "description": "The statistics object contains statistics about the video." + }, + "status": { + "$ref": "VideoStatus", + "description": "The status object contains information about the video's uploading, processing, and privacy statuses." + }, + "suggestions": { + "$ref": "VideoSuggestions", + "description": "The suggestions object encapsulates suggestions that identify opportunities to improve the video quality or the metadata for the uploaded video. This data can only be retrieved by the video owner." + }, + "topicDetails": { + "$ref": "VideoTopicDetails", + "description": "The topicDetails object encapsulates information about Freebase topics associated with the video." + } + } + }, + "VideoAbuseReport": { + "id": "VideoAbuseReport", + "type": "object", + "properties": { + "comments": { + "type": "string", + "description": "Additional comments regarding the abuse report." + }, + "language": { + "type": "string", + "description": "The language that the content was viewed in." + }, + "reasonId": { + "type": "string", + "description": "The high-level, or primary, reason that the content is abusive. The value is an abuse report reason ID." + }, + "secondaryReasonId": { + "type": "string", + "description": "The specific, or secondary, reason that this content is abusive (if available). The value is an abuse report reason ID that is a valid secondary reason for the primary reason." + }, + "videoId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video." + } + } + }, + "VideoAbuseReportReason": { + "id": "VideoAbuseReportReason", + "type": "object", + "description": "A videoAbuseReportReason resource identifies a reason that a video could be reported as abusive. Video abuse report reasons are used with video.ReportAbuse.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID of this abuse report reason." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoAbuseReportReason\".", + "default": "youtube#videoAbuseReportReason" + }, + "snippet": { + "$ref": "VideoAbuseReportReasonSnippet", + "description": "The snippet object contains basic details about the abuse report reason." + } + } + }, + "VideoAbuseReportReasonListResponse": { + "id": "VideoAbuseReportReasonListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of valid abuse reasons that are used with video.ReportAbuse.", + "items": { + "$ref": "VideoAbuseReportReason" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoAbuseReportReasonListResponse\".", + "default": "youtube#videoAbuseReportReasonListResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoAbuseReportReasonSnippet": { + "id": "VideoAbuseReportReasonSnippet", + "type": "object", + "description": "Basic details about a video category, such as its localized title.", + "properties": { + "label": { + "type": "string", + "description": "The localized label belonging to this abuse report reason." + }, + "secondaryReasons": { + "type": "array", + "description": "The secondary reasons associated with this reason, if any are available. (There might be 0 or more.)", + "items": { + "$ref": "VideoAbuseReportSecondaryReason" + } + } + } + }, + "VideoAbuseReportSecondaryReason": { + "id": "VideoAbuseReportSecondaryReason", + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of this abuse report secondary reason." + }, + "label": { + "type": "string", + "description": "The localized label for this abuse report secondary reason." + } + } + }, + "VideoAgeGating": { + "id": "VideoAgeGating", + "type": "object", + "properties": { + "alcoholContent": { + "type": "boolean", + "description": "Indicates whether or not the video has alcoholic beverage content. Only users of legal purchasing age in a particular country, as identified by ICAP, can view the content." + }, + "restricted": { + "type": "boolean", + "description": "Age-restricted trailers. For redband trailers and adult-rated video-games. Only users aged 18+ can view the content. The the field is true the content is restricted to viewers aged 18+. Otherwise The field won't be present." + }, + "videoGameRating": { + "type": "string", + "description": "Video game rating, if any.", + "enum": [ + "anyone", + "m15Plus", + "m16Plus", + "m17Plus" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + } + }, + "VideoCategory": { + "id": "VideoCategory", + "type": "object", + "description": "A videoCategory resource identifies a category that has been or could be associated with uploaded videos.", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "id": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the video category." + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoCategory\".", + "default": "youtube#videoCategory" + }, + "snippet": { + "$ref": "VideoCategorySnippet", + "description": "The snippet object contains basic details about the video category, including its title." + } + } + }, + "VideoCategoryListResponse": { + "id": "VideoCategoryListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of video categories that can be associated with YouTube videos. In this map, the video category ID is the map key, and its value is the corresponding videoCategory resource.", + "items": { + "$ref": "VideoCategory" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoCategoryListResponse\".", + "default": "youtube#videoCategoryListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoCategorySnippet": { + "id": "VideoCategorySnippet", + "type": "object", + "description": "Basic details about a video category, such as its localized title.", + "properties": { + "assignable": { + "type": "boolean" + }, + "channelId": { + "type": "string", + "description": "The YouTube channel that created the video category.", + "default": "UCBR8-60-B28hp2BmDPdntcQ" + }, + "title": { + "type": "string", + "description": "The video category's title." + } + } + }, + "VideoContentDetails": { + "id": "VideoContentDetails", + "type": "object", + "description": "Details about the content of a YouTube Video.", + "properties": { + "caption": { + "type": "string", + "description": "The value of captions indicates whether the video has captions or not.", + "enum": [ + "false", + "true" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "contentRating": { + "$ref": "ContentRating", + "description": "Specifies the ratings that the video received under various rating schemes." + }, + "countryRestriction": { + "$ref": "AccessPolicy", + "description": "The countryRestriction object contains information about the countries where a video is (or is not) viewable." + }, + "definition": { + "type": "string", + "description": "The value of definition indicates whether the video is available in high definition or only in standard definition.", + "enum": [ + "hd", + "sd" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "dimension": { + "type": "string", + "description": "The value of dimension indicates whether the video is available in 3D or in 2D." + }, + "duration": { + "type": "string", + "description": "The length of the video. The tag value is an ISO 8601 duration in the format PT#M#S, in which the letters PT indicate that the value specifies a period of time, and the letters M and S refer to length in minutes and seconds, respectively. The # characters preceding the M and S letters are both integers that specify the number of minutes (or seconds) of the video. For example, a value of PT15M51S indicates that the video is 15 minutes and 51 seconds long." + }, + "hasCustomThumbnail": { + "type": "boolean", + "description": "Indicates whether the video uploader has provided a custom thumbnail image for the video. This property is only visible to the video uploader." + }, + "licensedContent": { + "type": "boolean", + "description": "The value of is_license_content indicates whether the video is licensed content." + }, + "projection": { + "type": "string", + "description": "Specifies the projection format of the video.", + "enum": [ + "360", + "rectangular" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "regionRestriction": { + "$ref": "VideoContentDetailsRegionRestriction", + "description": "The regionRestriction object contains information about the countries where a video is (or is not) viewable. The object will contain either the contentDetails.regionRestriction.allowed property or the contentDetails.regionRestriction.blocked property." + } + } + }, + "VideoContentDetailsRegionRestriction": { + "id": "VideoContentDetailsRegionRestriction", + "type": "object", + "description": "DEPRECATED Region restriction of the video.", + "properties": { + "allowed": { + "type": "array", + "description": "A list of region codes that identify countries where the video is viewable. If this property is present and a country is not listed in its value, then the video is blocked from appearing in that country. If this property is present and contains an empty list, the video is blocked in all countries.", + "items": { + "type": "string" + } + }, + "blocked": { + "type": "array", + "description": "A list of region codes that identify countries where the video is blocked. If this property is present and a country is not listed in its value, then the video is viewable in that country. If this property is present and contains an empty list, the video is viewable in all countries.", + "items": { + "type": "string" + } + } + } + }, + "VideoFileDetails": { + "id": "VideoFileDetails", + "type": "object", + "description": "Describes original video file properties, including technical details about audio and video streams, but also metadata information like content length, digitization time, or geotagging information.", + "properties": { + "audioStreams": { + "type": "array", + "description": "A list of audio streams contained in the uploaded video file. Each item in the list contains detailed metadata about an audio stream.", + "items": { + "$ref": "VideoFileDetailsAudioStream" + } + }, + "bitrateBps": { + "type": "string", + "description": "The uploaded video file's combined (video and audio) bitrate in bits per second.", + "format": "uint64" + }, + "container": { + "type": "string", + "description": "The uploaded video file's container format." + }, + "creationTime": { + "type": "string", + "description": "The date and time when the uploaded video file was created. The value is specified in ISO 8601 format. Currently, the following ISO 8601 formats are supported: \n- Date only: YYYY-MM-DD \n- Naive time: YYYY-MM-DDTHH:MM:SS \n- Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM" + }, + "durationMs": { + "type": "string", + "description": "The length of the uploaded video in milliseconds.", + "format": "uint64" + }, + "fileName": { + "type": "string", + "description": "The uploaded file's name. This field is present whether a video file or another type of file was uploaded." + }, + "fileSize": { + "type": "string", + "description": "The uploaded file's size in bytes. This field is present whether a video file or another type of file was uploaded.", + "format": "uint64" + }, + "fileType": { + "type": "string", + "description": "The uploaded file's type as detected by YouTube's video processing engine. Currently, YouTube only processes video files, but this field is present whether a video file or another type of file was uploaded.", + "enum": [ + "archive", + "audio", + "document", + "image", + "other", + "project", + "video" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + }, + "videoStreams": { + "type": "array", + "description": "A list of video streams contained in the uploaded video file. Each item in the list contains detailed metadata about a video stream.", + "items": { + "$ref": "VideoFileDetailsVideoStream" + } + } + } + }, + "VideoFileDetailsAudioStream": { + "id": "VideoFileDetailsAudioStream", + "type": "object", + "description": "Information about an audio stream.", + "properties": { + "bitrateBps": { + "type": "string", + "description": "The audio stream's bitrate, in bits per second.", + "format": "uint64" + }, + "channelCount": { + "type": "integer", + "description": "The number of audio channels that the stream contains.", + "format": "uint32" + }, + "codec": { + "type": "string", + "description": "The audio codec that the stream uses." + }, + "vendor": { + "type": "string", + "description": "A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code." + } + } + }, + "VideoFileDetailsVideoStream": { + "id": "VideoFileDetailsVideoStream", + "type": "object", + "description": "Information about a video stream.", + "properties": { + "aspectRatio": { + "type": "number", + "description": "The video content's display aspect ratio, which specifies the aspect ratio in which the video should be displayed.", + "format": "double" + }, + "bitrateBps": { + "type": "string", + "description": "The video stream's bitrate, in bits per second.", + "format": "uint64" + }, + "codec": { + "type": "string", + "description": "The video codec that the stream uses." + }, + "frameRateFps": { + "type": "number", + "description": "The video stream's frame rate, in frames per second.", + "format": "double" + }, + "heightPixels": { + "type": "integer", + "description": "The encoded video content's height in pixels.", + "format": "uint32" + }, + "rotation": { + "type": "string", + "description": "The amount that YouTube needs to rotate the original source content to properly display the video.", + "enum": [ + "clockwise", + "counterClockwise", + "none", + "other", + "upsideDown" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + }, + "vendor": { + "type": "string", + "description": "A value that uniquely identifies a video vendor. Typically, the value is a four-letter vendor code." + }, + "widthPixels": { + "type": "integer", + "description": "The encoded video content's width in pixels. You can calculate the video's encoding aspect ratio as width_pixels / height_pixels.", + "format": "uint32" + } + } + }, + "VideoGetRatingResponse": { + "id": "VideoGetRatingResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of ratings that match the request criteria.", + "items": { + "$ref": "VideoRating" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoGetRatingResponse\".", + "default": "youtube#videoGetRatingResponse" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoListResponse": { + "id": "VideoListResponse", + "type": "object", + "properties": { + "etag": { + "type": "string", + "description": "Etag of this resource." + }, + "eventId": { + "type": "string", + "description": "Serialized EventId of the request which produced this response." + }, + "items": { + "type": "array", + "description": "A list of videos that match the request criteria.", + "items": { + "$ref": "Video" + } + }, + "kind": { + "type": "string", + "description": "Identifies what kind of resource this is. Value: the fixed string \"youtube#videoListResponse\".", + "default": "youtube#videoListResponse" + }, + "nextPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set." + }, + "pageInfo": { + "$ref": "PageInfo" + }, + "prevPageToken": { + "type": "string", + "description": "The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set." + }, + "tokenPagination": { + "$ref": "TokenPagination" + }, + "visitorId": { + "type": "string", + "description": "The visitorId identifies the visitor." + } + } + }, + "VideoLiveStreamingDetails": { + "id": "VideoLiveStreamingDetails", + "type": "object", + "description": "Details about the live streaming metadata.", + "properties": { + "activeLiveChatId": { + "type": "string", + "description": "The ID of the currently active live chat attached to this video. This field is filled only if the video is a currently live broadcast that has live chat. Once the broadcast transitions to complete this field will be removed and the live chat closed down. For persistent broadcasts that live chat id will no longer be tied to this video but rather to the new video being displayed at the persistent page." + }, + "actualEndTime": { + "type": "string", + "description": "The time that the broadcast actually ended. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available until the broadcast is over.", + "format": "date-time" + }, + "actualStartTime": { + "type": "string", + "description": "The time that the broadcast actually started. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value will not be available until the broadcast begins.", + "format": "date-time" + }, + "concurrentViewers": { + "type": "string", + "description": "The number of viewers currently watching the broadcast. The property and its value will be present if the broadcast has current viewers and the broadcast owner has not hidden the viewcount for the video. Note that YouTube stops tracking the number of concurrent viewers for a broadcast when the broadcast ends. So, this property would not identify the number of viewers watching an archived video of a live broadcast that already ended.", + "format": "uint64" + }, + "scheduledEndTime": { + "type": "string", + "description": "The time that the broadcast is scheduled to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. If the value is empty or the property is not present, then the broadcast is scheduled to continue indefinitely.", + "format": "date-time" + }, + "scheduledStartTime": { + "type": "string", + "description": "The time that the broadcast is scheduled to begin. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + } + } + }, + "VideoLocalization": { + "id": "VideoLocalization", + "type": "object", + "description": "Localized versions of certain video properties (e.g. title).", + "properties": { + "description": { + "type": "string", + "description": "Localized version of the video's description." + }, + "title": { + "type": "string", + "description": "Localized version of the video's title." + } + } + }, + "VideoMonetizationDetails": { + "id": "VideoMonetizationDetails", + "type": "object", + "description": "Details about monetization of a YouTube Video.", + "properties": { + "access": { + "$ref": "AccessPolicy", + "description": "The value of access indicates whether the video can be monetized or not." + } + } + }, + "VideoPlayer": { + "id": "VideoPlayer", + "type": "object", + "description": "Player to be used for a video playback.", + "properties": { + "embedHeight": { + "type": "string", + "format": "int64" + }, + "embedHtml": { + "type": "string", + "description": "An \u003ciframe\u003e tag that embeds a player that will play the video." + }, + "embedWidth": { + "type": "string", + "description": "The embed width", + "format": "int64" + } + } + }, + "VideoProcessingDetails": { + "id": "VideoProcessingDetails", + "type": "object", + "description": "Describes processing status and progress and availability of some other Video resource parts.", + "properties": { + "editorSuggestionsAvailability": { + "type": "string", + "description": "This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request." + }, + "fileDetailsAvailability": { + "type": "string", + "description": "This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request." + }, + "processingFailureReason": { + "type": "string", + "description": "The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed.", + "enum": [ + "other", + "streamingFailed", + "transcodeFailed", + "uploadFailed" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "processingIssuesAvailability": { + "type": "string", + "description": "This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request." + }, + "processingProgress": { + "$ref": "VideoProcessingDetailsProcessingProgress", + "description": "The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing." + }, + "processingStatus": { + "type": "string", + "description": "The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed.", + "enum": [ + "failed", + "processing", + "succeeded", + "terminated" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "tagSuggestionsAvailability": { + "type": "string", + "description": "This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request." + }, + "thumbnailsAvailability": { + "type": "string", + "description": "This value indicates whether thumbnail images have been generated for the video." + } + } + }, + "VideoProcessingDetailsProcessingProgress": { + "id": "VideoProcessingDetailsProcessingProgress", + "type": "object", + "description": "Video processing progress and completion time estimate.", + "properties": { + "partsProcessed": { + "type": "string", + "description": "The number of parts of the video that YouTube has already processed. You can estimate the percentage of the video that YouTube has already processed by calculating:\n100 * parts_processed / parts_total\n\nNote that since the estimated number of parts could increase without a corresponding increase in the number of parts that have already been processed, it is possible that the calculated progress could periodically decrease while YouTube processes a video.", + "format": "uint64" + }, + "partsTotal": { + "type": "string", + "description": "An estimate of the total number of parts that need to be processed for the video. The number may be updated with more precise estimates while YouTube processes the video.", + "format": "uint64" + }, + "timeLeftMs": { + "type": "string", + "description": "An estimate of the amount of time, in millseconds, that YouTube needs to finish processing the video.", + "format": "uint64" + } + } + }, + "VideoProjectDetails": { + "id": "VideoProjectDetails", + "type": "object", + "description": "Project specific details about the content of a YouTube Video.", + "properties": { + "tags": { + "type": "array", + "description": "A list of project tags associated with the video during the upload.", + "items": { + "type": "string" + } + } + } + }, + "VideoRating": { + "id": "VideoRating", + "type": "object", + "properties": { + "rating": { + "type": "string", + "enum": [ + "dislike", + "like", + "none", + "unspecified" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + }, + "videoId": { + "type": "string" + } + } + }, + "VideoRecordingDetails": { + "id": "VideoRecordingDetails", + "type": "object", + "description": "Recording information associated with the video.", + "properties": { + "location": { + "$ref": "GeoPoint", + "description": "The geolocation information associated with the video." + }, + "locationDescription": { + "type": "string", + "description": "The text description of the location where the video was recorded." + }, + "recordingDate": { + "type": "string", + "description": "The date and time when the video was recorded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.", + "format": "date-time" + } + } + }, + "VideoSnippet": { + "id": "VideoSnippet", + "type": "object", + "description": "Basic details about a video, including title, description, uploader, thumbnails and category.", + "properties": { + "categoryId": { + "type": "string", + "description": "The YouTube video category associated with the video." + }, + "channelId": { + "type": "string", + "description": "The ID that YouTube uses to uniquely identify the channel that the video was uploaded to." + }, + "channelTitle": { + "type": "string", + "description": "Channel title for the channel that the video belongs to." + }, + "defaultAudioLanguage": { + "type": "string", + "description": "The default_audio_language property specifies the language spoken in the video's default audio track." + }, + "defaultLanguage": { + "type": "string", + "description": "The language of the videos's default snippet." + }, + "description": { + "type": "string", + "description": "The video's description." + }, + "liveBroadcastContent": { + "type": "string", + "description": "Indicates if the video is an upcoming/active live broadcast. Or it's \"none\" if the video is not an upcoming/active live broadcast.", + "enum": [ + "live", + "none", + "upcoming" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "localized": { + "$ref": "VideoLocalization", + "description": "Localized snippet selected with the hl parameter. If no such localization exists, this field is populated with the default snippet. (Read-only)" + }, + "publishedAt": { + "type": "string", + "description": "The date and time that the video was uploaded. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "tags": { + "type": "array", + "description": "A list of keyword tags associated with the video. Tags may contain spaces.", + "items": { + "type": "string" + } + }, + "thumbnails": { + "$ref": "ThumbnailDetails", + "description": "A map of thumbnail images associated with the video. For each object in the map, the key is the name of the thumbnail image, and the value is an object that contains other information about the thumbnail." + }, + "title": { + "type": "string", + "description": "The video's title." + } + } + }, + "VideoStatistics": { + "id": "VideoStatistics", + "type": "object", + "description": "Statistics about the video, such as the number of times the video was viewed or liked.", + "properties": { + "commentCount": { + "type": "string", + "description": "The number of comments for the video.", + "format": "uint64" + }, + "dislikeCount": { + "type": "string", + "description": "The number of users who have indicated that they disliked the video by giving it a negative rating.", + "format": "uint64" + }, + "favoriteCount": { + "type": "string", + "description": "The number of users who currently have the video marked as a favorite video.", + "format": "uint64" + }, + "likeCount": { + "type": "string", + "description": "The number of users who have indicated that they liked the video by giving it a positive rating.", + "format": "uint64" + }, + "viewCount": { + "type": "string", + "description": "The number of times the video has been viewed.", + "format": "uint64" + } + } + }, + "VideoStatus": { + "id": "VideoStatus", + "type": "object", + "description": "Basic details about a video category, such as its localized title.", + "properties": { + "embeddable": { + "type": "boolean", + "description": "This value indicates if the video can be embedded on another website." + }, + "failureReason": { + "type": "string", + "description": "This value explains why a video failed to upload. This property is only present if the uploadStatus property indicates that the upload failed.", + "enum": [ + "codec", + "conversion", + "emptyFile", + "invalidFile", + "tooSmall", + "uploadAborted" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "" + ] + }, + "license": { + "type": "string", + "description": "The video's license.", + "enum": [ + "creativeCommon", + "youtube" + ], + "enumDescriptions": [ + "", + "" + ] + }, + "privacyStatus": { + "type": "string", + "description": "The video's privacy status.", + "enum": [ + "private", + "public", + "unlisted" + ], + "enumDescriptions": [ + "", + "", + "" + ] + }, + "publicStatsViewable": { + "type": "boolean", + "description": "This value indicates if the extended video statistics on the watch page can be viewed by everyone. Note that the view count, likes, etc will still be visible if this is disabled." + }, + "publishAt": { + "type": "string", + "description": "The date and time when the video is scheduled to publish. It can be set only if the privacy status of the video is private. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time" + }, + "rejectionReason": { + "type": "string", + "description": "This value explains why YouTube rejected an uploaded video. This property is only present if the uploadStatus property indicates that the upload was rejected.", + "enum": [ + "claim", + "copyright", + "duplicate", + "inappropriate", + "legal", + "length", + "termsOfUse", + "trademark", + "uploaderAccountClosed", + "uploaderAccountSuspended" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + "uploadStatus": { + "type": "string", + "description": "The status of the uploaded video.", + "enum": [ + "deleted", + "failed", + "processed", + "rejected", + "uploaded" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + } + }, + "VideoSuggestions": { + "id": "VideoSuggestions", + "type": "object", + "description": "Specifies suggestions on how to improve video content, including encoding hints, tag suggestions, and editor suggestions.", + "properties": { + "editorSuggestions": { + "type": "array", + "description": "A list of video editing operations that might improve the video quality or playback experience of the uploaded video.", + "items": { + "type": "string", + "enum": [ + "audioQuietAudioSwap", + "videoAutoLevels", + "videoCrop", + "videoStabilize" + ], + "enumDescriptions": [ + "", + "", + "", + "" + ] + } + }, + "processingErrors": { + "type": "array", + "description": "A list of errors that will prevent YouTube from successfully processing the uploaded video video. These errors indicate that, regardless of the video's current processing status, eventually, that status will almost certainly be failed.", + "items": { + "type": "string", + "enum": [ + "archiveFile", + "audioFile", + "docFile", + "imageFile", + "notAVideoFile", + "projectFile", + "unsupportedSpatialAudioLayout" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "processingHints": { + "type": "array", + "description": "A list of suggestions that may improve YouTube's ability to process the video.", + "items": { + "type": "string", + "enum": [ + "nonStreamableMov", + "sendBestQualityVideo", + "spatialAudio", + "sphericalVideo", + "vrVideo" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "" + ] + } + }, + "processingWarnings": { + "type": "array", + "description": "A list of reasons why YouTube may have difficulty transcoding the uploaded video or that might result in an erroneous transcoding. These warnings are generated before YouTube actually processes the uploaded video file. In addition, they identify issues that are unlikely to cause the video processing to fail but that might cause problems such as sync issues, video artifacts, or a missing audio track.", + "items": { + "type": "string", + "enum": [ + "hasEditlist", + "inconsistentResolution", + "problematicAudioCodec", + "problematicVideoCodec", + "unknownAudioCodec", + "unknownContainer", + "unknownVideoCodec", + "unsupportedSphericalProjectionType", + "unsupportedVrStereoMode" + ], + "enumDescriptions": [ + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + } + }, + "tagSuggestions": { + "type": "array", + "description": "A list of keyword tags that could be added to the video's metadata to increase the likelihood that users will locate your video when searching or browsing on YouTube.", + "items": { + "$ref": "VideoSuggestionsTagSuggestion" + } + } + } + }, + "VideoSuggestionsTagSuggestion": { + "id": "VideoSuggestionsTagSuggestion", + "type": "object", + "description": "A single tag suggestion with it's relevance information.", + "properties": { + "categoryRestricts": { + "type": "array", + "description": "A set of video categories for which the tag is relevant. You can use this information to display appropriate tag suggestions based on the video category that the video uploader associates with the video. By default, tag suggestions are relevant for all categories if there are no restricts defined for the keyword.", + "items": { + "type": "string" + } + }, + "tag": { + "type": "string", + "description": "The keyword tag suggested for the video." + } + } + }, + "VideoTopicDetails": { + "id": "VideoTopicDetails", + "type": "object", + "description": "Freebase topic information related to the video.", + "properties": { + "relevantTopicIds": { + "type": "array", + "description": "Similar to topic_id, except that these topics are merely relevant to the video. These are topics that may be mentioned in, or appear in the video. You can retrieve information about each topic using Freebase Topic API.", + "items": { + "type": "string" + } + }, + "topicCategories": { + "type": "array", + "description": "A list of Wikipedia URLs that provide a high-level description of the video's content.", + "items": { + "type": "string" + } + }, + "topicIds": { + "type": "array", + "description": "A list of Freebase topic IDs that are centrally associated with the video. These are topics that are centrally featured in the video, and it can be said that the video is mainly about each of these. You can retrieve information about each topic using the Freebase Topic API.", + "items": { + "type": "string" + } + } + } + }, + "WatchSettings": { + "id": "WatchSettings", + "type": "object", + "description": "Branding properties for the watch. All deprecated.", + "properties": { + "backgroundColor": { + "type": "string", + "description": "The text color for the video watch page's branded area." + }, + "featuredPlaylistId": { + "type": "string", + "description": "An ID that uniquely identifies a playlist that displays next to the video player." + }, + "textColor": { + "type": "string", + "description": "The background color for the video watch page's branded area." + } + } + } + }, + "resources": { + "activities": { + "methods": { + "insert": { + "id": "youtube.activities.insert", + "path": "activities", + "httpMethod": "POST", + "description": "Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.)\n\nNote: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Activity" + }, + "response": { + "$ref": "Activity" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.activities.list", + "path": "activities", + "httpMethod": "GET", + "description": "Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities.", + "location": "query" + }, + "home": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's activities.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + }, + "publishedAfter": { + "type": "string", + "description": "The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "location": "query" + }, + "publishedBefore": { + "type": "string", + "description": "The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.", + "format": "date-time", + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "ActivityListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "captions": { + "methods": { + "delete": { + "id": "youtube.captions.delete", + "path": "captions", + "httpMethod": "DELETE", + "description": "Deletes a specified caption track.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource.", + "required": true, + "location": "query" + }, + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "download": { + "id": "youtube.captions.download", + "path": "captions/{id}", + "httpMethod": "GET", + "description": "Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource.", + "required": true, + "location": "path" + }, + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "tfmt": { + "type": "string", + "description": "The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.", + "enum": [ + "sbv", + "scc", + "srt", + "ttml", + "vtt" + ], + "enumDescriptions": [ + "SubViewer subtitle.", + "Scenarist Closed Caption format.", + "SubRip subtitle.", + "Timed Text Markup Language caption.", + "Web Video Text Tracks caption." + ], + "location": "query" + }, + "tlang": { + "type": "string", + "description": "The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaDownload": true + }, + "insert": { + "id": "youtube.captions.insert", + "path": "captions", + "httpMethod": "POST", + "description": "Uploads a caption track.", + "parameters": { + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + }, + "sync": { + "type": "boolean", + "description": "The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions.\n\nYou should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Caption" + }, + "response": { + "$ref": "Caption" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*", + "application/octet-stream", + "text/xml" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/captions" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/captions" + } + } + } + }, + "list": { + "id": "youtube.captions.list", + "path": "captions", + "httpMethod": "GET", + "description": "Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video.", + "location": "query" + }, + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is on behalf of.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet.", + "required": true, + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part", + "videoId" + ], + "response": { + "$ref": "CaptionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.captions.update", + "path": "captions", + "httpMethod": "PUT", + "description": "Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.", + "parameters": { + "onBehalfOf": { + "type": "string", + "description": "ID of the Google+ Page for the channel that the request is be on behalf of", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.", + "required": true, + "location": "query" + }, + "sync": { + "type": "boolean", + "description": "Note: The API server only processes the parameter value if the request contains an updated caption file.\n\nThe sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Caption" + }, + "response": { + "$ref": "Caption" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*", + "application/octet-stream", + "text/xml" + ], + "maxSize": "100MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/captions" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/captions" + } + } + } + } + } + }, + "channelBanners": { + "methods": { + "insert": { + "id": "youtube.channelBanners.insert", + "path": "channelBanners/insert", + "httpMethod": "POST", + "description": "Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n- Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels.\n- Extract the url property's value from the response that the API returns for step 1.\n- Call the channels.update method to update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl property's value to the URL obtained in step 2.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "request": { + "$ref": "ChannelBannerResource" + }, + "response": { + "$ref": "ChannelBannerResource" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.upload" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "image/jpeg", + "image/png" + ], + "maxSize": "6MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/channelBanners/insert" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/channelBanners/insert" + } + } + } + } + } + }, + "channelSections": { + "methods": { + "delete": { + "id": "youtube.channelSections.delete", + "path": "channelSections", + "httpMethod": "DELETE", + "description": "Deletes a channelSection.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.channelSections.insert", + "path": "channelSections", + "httpMethod": "POST", + "description": "Adds a channelSection for the authenticated user's channel.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "ChannelSection" + }, + "response": { + "$ref": "ChannelSection" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.channelSections.list", + "path": "channelSections", + "httpMethod": "GET", + "description": "Returns channelSection resources that match the API request criteria.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections.", + "location": "query" + }, + "hl": { + "type": "string", + "description": "The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID.", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "ChannelSectionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.channelSections.update", + "path": "channelSections", + "httpMethod": "PUT", + "description": "Update a channelSection.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "ChannelSection" + }, + "response": { + "$ref": "ChannelSection" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "channels": { + "methods": { + "list": { + "id": "youtube.channels.list", + "path": "channels", + "httpMethod": "GET", + "description": "Returns a collection of zero or more channel resources that match the request criteria.", + "parameters": { + "categoryId": { + "type": "string", + "description": "The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category.", + "location": "query" + }, + "forUsername": { + "type": "string", + "description": "The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username.", + "location": "query" + }, + "hl": { + "type": "string", + "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID.", + "location": "query" + }, + "managedByMe": { + "type": "boolean", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nSet this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user.", + "location": "query" + }, + "mySubscribers": { + "type": "boolean", + "description": "Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "ChannelListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner", + "https://www.googleapis.com/auth/youtubepartner-channel-audit" + ] + }, + "update": { + "id": "youtube.channels.update", + "path": "channels", + "httpMethod": "PUT", + "description": "Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.)\n\nNote that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Channel" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "commentThreads": { + "methods": { + "insert": { + "id": "youtube.commentThreads.insert", + "path": "commentThreads", + "httpMethod": "POST", + "description": "Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "CommentThread" + }, + "response": { + "$ref": "CommentThread" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.commentThreads.list", + "path": "commentThreads", + "httpMethod": "GET", + "description": "Returns a list of comment threads that match the API request parameters.", + "parameters": { + "allThreadsRelatedToChannelId": { + "type": "string", + "description": "The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos.", + "location": "query" + }, + "channelId": { + "type": "string", + "description": "The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "moderationStatus": { + "type": "string", + "description": "Set this parameter to limit the returned comment threads to a particular moderation state.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "default": "MODERATION_STATUS_PUBLISHED", + "enum": [ + "heldForReview", + "likelySpam", + "published" + ], + "enumDescriptions": [ + "Retrieve comment threads that are awaiting review by a moderator. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment are awaiting review.", + "Retrieve comment threads classified as likely to be spam. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment is considered likely to be spam.", + "Retrieve threads of published comments. This is the default value. A comment thread can be included in the response if its top-level comment has been published." + ], + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the order in which the API response should list comment threads. Valid values are: \n- time - Comment threads are ordered by time. This is the default behavior.\n- relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter.", + "default": "true", + "enum": [ + "relevance", + "time" + ], + "enumDescriptions": [ + "Order by relevance.", + "Order by time." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.", + "required": true, + "location": "query" + }, + "searchTerms": { + "type": "string", + "description": "The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "textFormat": { + "type": "string", + "description": "Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text.", + "default": "FORMAT_HTML", + "enum": [ + "html", + "plainText" + ], + "enumDescriptions": [ + "Returns the comments in HTML format. This is the default value.", + "Returns the comments in plain text format." + ], + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter instructs the API to return comment threads associated with the specified video ID.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "CommentThreadListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "update": { + "id": "youtube.commentThreads.update", + "path": "commentThreads", + "httpMethod": "PUT", + "description": "Modifies the top-level comment in a comment thread.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "CommentThread" + }, + "response": { + "$ref": "CommentThread" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "comments": { + "methods": { + "delete": { + "id": "youtube.comments.delete", + "path": "comments", + "httpMethod": "DELETE", + "description": "Deletes a comment.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the comment ID for the resource that is being deleted.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.comments.insert", + "path": "comments", + "httpMethod": "POST", + "description": "Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.comments.list", + "path": "comments", + "httpMethod": "GET", + "description": "Returns a list of comments that match the API request parameters.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "default": "20", + "format": "uint32", + "minimum": "1", + "maximum": "100", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "parentId": { + "type": "string", + "description": "The parentId parameter specifies the ID of the comment for which replies should be retrieved.\n\nNote: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.", + "required": true, + "location": "query" + }, + "textFormat": { + "type": "string", + "description": "This parameter indicates whether the API should return comments formatted as HTML or as plain text.", + "default": "FORMAT_HTML", + "enum": [ + "html", + "plainText" + ], + "enumDescriptions": [ + "Returns the comments in HTML format. This is the default value.", + "Returns the comments in plain text format." + ], + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "CommentListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "markAsSpam": { + "id": "youtube.comments.markAsSpam", + "path": "comments/markAsSpam", + "httpMethod": "POST", + "description": "Expresses the caller's opinion that one or more comments should be flagged as spam.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "setModerationStatus": { + "id": "youtube.comments.setModerationStatus", + "path": "comments/setModerationStatus", + "httpMethod": "POST", + "description": "Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.", + "parameters": { + "banAuthor": { + "type": "boolean", + "description": "The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author.\n\nNote: This parameter is only valid if the moderationStatus parameter is also set to rejected.", + "default": "false", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.", + "required": true, + "location": "query" + }, + "moderationStatus": { + "type": "string", + "description": "Identifies the new moderation status of the specified comments.", + "required": true, + "enum": [ + "heldForReview", + "published", + "rejected" + ], + "enumDescriptions": [ + "Marks a comment as awaiting review by a moderator.", + "Clears a comment for public display.", + "Rejects a comment as being unfit for display. This action also effectively hides all replies to the rejected comment.\n\nNote: The API does not currently provide a way to list or otherwise discover rejected comments. However, you can change the moderation status of a rejected comment if you still know its ID. If you were to change the moderation status of a rejected comment, the comment replies would subsequently be discoverable again as well." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id", + "moderationStatus" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "update": { + "id": "youtube.comments.update", + "path": "comments", + "httpMethod": "PUT", + "description": "Modifies a comment.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Comment" + }, + "response": { + "$ref": "Comment" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "fanFundingEvents": { + "methods": { + "list": { + "id": "youtube.fanFundingEvents.list", + "path": "fanFundingEvents", + "httpMethod": "GET", + "description": "Lists fan funding events for a channel.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the fanFundingEvent resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "FanFundingEventListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "guideCategories": { + "methods": { + "list": { + "id": "youtube.guideCategories.list", + "path": "guideCategories", + "httpMethod": "GET", + "description": "Returns a list of categories that can be associated with YouTube channels.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that will be used for text values in the API response.", + "default": "en-US", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "GuideCategoryListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "i18nLanguages": { + "methods": { + "list": { + "id": "youtube.i18nLanguages.list", + "path": "i18nLanguages", + "httpMethod": "GET", + "description": "Returns a list of application languages that the YouTube website supports.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "I18nLanguageListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "i18nRegions": { + "methods": { + "list": { + "id": "youtube.i18nRegions.list", + "path": "i18nRegions", + "httpMethod": "GET", + "description": "Returns a list of content regions that the YouTube website supports.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "I18nRegionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "liveBroadcasts": { + "methods": { + "bind": { + "id": "youtube.liveBroadcasts.bind", + "path": "liveBroadcasts/bind", + "httpMethod": "POST", + "description": "Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + }, + "streamId": { + "type": "string", + "description": "The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream.", + "location": "query" + } + }, + "parameterOrder": [ + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "control": { + "id": "youtube.liveBroadcasts.control", + "path": "liveBroadcasts/control", + "httpMethod": "POST", + "description": "Controls the settings for a slate that can be displayed in the broadcast stream.", + "parameters": { + "displaySlate": { + "type": "boolean", + "description": "The displaySlate parameter specifies whether the slate is being enabled or disabled.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated.", + "required": true, + "location": "query" + }, + "offsetTimeMs": { + "type": "string", + "description": "The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time.\n\nIf you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details.\n\nImportant: You should only specify a value for this parameter if your broadcast stream is delayed.", + "format": "uint64", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + }, + "walltime": { + "type": "string", + "description": "The walltime parameter specifies the wall clock time at which the specified slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.", + "format": "date-time", + "location": "query" + } + }, + "parameterOrder": [ + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "delete": { + "id": "youtube.liveBroadcasts.delete", + "path": "liveBroadcasts", + "httpMethod": "DELETE", + "description": "Deletes a broadcast.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.liveBroadcasts.insert", + "path": "liveBroadcasts", + "httpMethod": "POST", + "description": "Creates a broadcast.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveBroadcast" + }, + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.liveBroadcasts.list", + "path": "liveBroadcasts", + "httpMethod": "GET", + "description": "Returns a list of YouTube broadcasts that match the API request parameters.", + "parameters": { + "broadcastStatus": { + "type": "string", + "description": "The broadcastStatus parameter filters the API response to only include broadcasts with the specified status.", + "enum": [ + "active", + "all", + "completed", + "upcoming" + ], + "enumDescriptions": [ + "Return current live broadcasts.", + "Return all broadcasts.", + "Return broadcasts that have already ended.", + "Return broadcasts that have not yet started." + ], + "location": "query" + }, + "broadcastType": { + "type": "string", + "description": "The broadcastType parameter filters the API response to only include broadcasts with the specified type. This is only compatible with the mine filter for now.", + "default": "BROADCAST_TYPE_FILTER_EVENT", + "enum": [ + "all", + "event", + "persistent" + ], + "enumDescriptions": [ + "Return all broadcasts.", + "Return only scheduled event broadcasts.", + "Return only persistent broadcasts." + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "LiveBroadcastListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + }, + "transition": { + "id": "youtube.liveBroadcasts.transition", + "path": "liveBroadcasts/transition", + "httpMethod": "POST", + "description": "Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active.", + "parameters": { + "broadcastStatus": { + "type": "string", + "description": "The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to.", + "required": true, + "enum": [ + "complete", + "live", + "testing" + ], + "enumDescriptions": [ + "The broadcast is over. YouTube stops transmitting video.", + "The broadcast is visible to its audience. YouTube transmits video to the broadcast's monitor stream and its broadcast stream.", + "Start testing the broadcast. YouTube transmits video to the broadcast's monitor stream. Note that you can only transition a broadcast to the testing state if its contentDetails.monitorStream.enableMonitorStream property is set to true." + ], + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies the unique ID of the broadcast that is transitioning to another status.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "broadcastStatus", + "id", + "part" + ], + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "update": { + "id": "youtube.liveBroadcasts.update", + "path": "liveBroadcasts", + "httpMethod": "PUT", + "description": "Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveBroadcast" + }, + "response": { + "$ref": "LiveBroadcast" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "liveChatBans": { + "methods": { + "delete": { + "id": "youtube.liveChatBans.delete", + "path": "liveChat/bans", + "httpMethod": "DELETE", + "description": "Removes a chat ban.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.liveChatBans.insert", + "path": "liveChat/bans", + "httpMethod": "POST", + "description": "Adds a new ban to the chat.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveChatBan" + }, + "response": { + "$ref": "LiveChatBan" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "liveChatMessages": { + "methods": { + "delete": { + "id": "youtube.liveChatMessages.delete", + "path": "liveChat/messages", + "httpMethod": "DELETE", + "description": "Deletes a chat message.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube chat message ID of the resource that is being deleted.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.liveChatMessages.insert", + "path": "liveChat/messages", + "httpMethod": "POST", + "description": "Adds a message to a live chat.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveChatMessage" + }, + "response": { + "$ref": "LiveChatMessage" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.liveChatMessages.list", + "path": "liveChat/messages", + "httpMethod": "GET", + "description": "Lists live chat messages for a specific chat.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.", + "location": "query" + }, + "liveChatId": { + "type": "string", + "description": "The liveChatId parameter specifies the ID of the chat whose messages will be returned.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of messages that should be returned in the result set.", + "default": "500", + "format": "uint32", + "minimum": "200", + "maximum": "2000", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + }, + "profileImageSize": { + "type": "integer", + "description": "The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88.", + "format": "uint32", + "minimum": "16", + "maximum": "720", + "location": "query" + } + }, + "parameterOrder": [ + "liveChatId", + "part" + ], + "response": { + "$ref": "LiveChatMessageListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "liveChatModerators": { + "methods": { + "delete": { + "id": "youtube.liveChatModerators.delete", + "path": "liveChat/moderators", + "httpMethod": "DELETE", + "description": "Removes a chat moderator.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.liveChatModerators.insert", + "path": "liveChat/moderators", + "httpMethod": "POST", + "description": "Adds a new moderator for the chat.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveChatModerator" + }, + "response": { + "$ref": "LiveChatModerator" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.liveChatModerators.list", + "path": "liveChat/moderators", + "httpMethod": "GET", + "description": "Lists moderators for a live chat.", + "parameters": { + "liveChatId": { + "type": "string", + "description": "The liveChatId parameter specifies the YouTube live chat for which the API should return moderators.", + "required": true, + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "liveChatId", + "part" + ], + "response": { + "$ref": "LiveChatModeratorListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "liveStreams": { + "methods": { + "delete": { + "id": "youtube.liveStreams.delete", + "path": "liveStreams", + "httpMethod": "DELETE", + "description": "Deletes a video stream.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube live stream ID for the resource that is being deleted.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "insert": { + "id": "youtube.liveStreams.insert", + "path": "liveStreams", + "httpMethod": "POST", + "description": "Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveStream" + }, + "response": { + "$ref": "LiveStream" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + }, + "list": { + "id": "youtube.liveStreams.list", + "path": "liveStreams", + "httpMethod": "GET", + "description": "Returns a list of video streams that match the API request parameters.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "LiveStreamListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + }, + "update": { + "id": "youtube.liveStreams.update", + "path": "liveStreams", + "httpMethod": "PUT", + "description": "Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "LiveStream" + }, + "response": { + "$ref": "LiveStream" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl" + ] + } + } + }, + "playlistItems": { + "methods": { + "delete": { + "id": "youtube.playlistItems.delete", + "path": "playlistItems", + "httpMethod": "DELETE", + "description": "Deletes a playlist item.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.playlistItems.insert", + "path": "playlistItems", + "httpMethod": "POST", + "description": "Adds a resource to a playlist.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "PlaylistItem" + }, + "response": { + "$ref": "PlaylistItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.playlistItems.list", + "path": "playlistItems", + "httpMethod": "GET", + "description": "Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of one or more unique playlist item IDs.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.", + "required": true, + "location": "query" + }, + "playlistId": { + "type": "string", + "description": "The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter.", + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter specifies that the request should return only the playlist items that contain the specified video.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "PlaylistItemListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsSubscription": true + }, + "update": { + "id": "youtube.playlistItems.update", + "path": "playlistItems", + "httpMethod": "PUT", + "description": "Modifies a playlist item. For example, you could update the item's position in the playlist.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "PlaylistItem" + }, + "response": { + "$ref": "PlaylistItem" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "playlists": { + "methods": { + "delete": { + "id": "youtube.playlists.delete", + "path": "playlists", + "httpMethod": "DELETE", + "description": "Deletes a playlist.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.playlists.insert", + "path": "playlists", + "httpMethod": "POST", + "description": "Creates a playlist.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Playlist" + }, + "response": { + "$ref": "Playlist" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.playlists.list", + "path": "playlists", + "httpMethod": "GET", + "description": "Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs.", + "parameters": { + "channelId": { + "type": "string", + "description": "This value indicates that the API should only return the specified channel's playlists.", + "location": "query" + }, + "hl": { + "type": "string", + "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "PlaylistListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.playlists.update", + "path": "playlists", + "httpMethod": "PUT", + "description": "Modifies a playlist. For example, you could change a playlist's title, description, or privacy status.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Playlist" + }, + "response": { + "$ref": "Playlist" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "search": { + "methods": { + "list": { + "id": "youtube.search.list", + "path": "search", + "httpMethod": "GET", + "description": "Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter indicates that the API response should only contain resources created by the channel", + "location": "query" + }, + "channelType": { + "type": "string", + "description": "The channelType parameter lets you restrict a search to a particular type of channel.", + "enum": [ + "any", + "show" + ], + "enumDescriptions": [ + "Return all channels.", + "Only retrieve shows." + ], + "location": "query" + }, + "eventType": { + "type": "string", + "description": "The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "completed", + "live", + "upcoming" + ], + "enumDescriptions": [ + "Only include completed broadcasts.", + "Only include active broadcasts.", + "Only include upcoming broadcasts." + ], + "location": "query" + }, + "forContentOwner": { + "type": "boolean", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.", + "location": "query" + }, + "forDeveloper": { + "type": "boolean", + "description": "The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites.", + "location": "query" + }, + "forMine": { + "type": "boolean", + "description": "The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video.", + "location": "query" + }, + "location": { + "type": "string", + "description": "The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).\n\n\n- The location parameter value identifies the point at the center of the area.\n- The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter.", + "location": "query" + }, + "locationRadius": { + "type": "string", + "description": "The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area.\n\nThe parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers.\n\nNote: See the definition of the location parameter for more information.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the method that will be used to order resources in the API response.", + "default": "SEARCH_SORT_RELEVANCE", + "enum": [ + "date", + "rating", + "relevance", + "title", + "videoCount", + "viewCount" + ], + "enumDescriptions": [ + "Resources are sorted in reverse chronological order based on the date they were created.", + "Resources are sorted from highest to lowest rating.", + "Resources are sorted based on their relevance to the search query. This is the default value for this parameter.", + "Resources are sorted alphabetically by title.", + "Channels are sorted in descending order of their number of uploaded videos.", + "Resources are sorted from highest to lowest number of views." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + }, + "publishedAfter": { + "type": "string", + "description": "The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).", + "format": "date-time", + "location": "query" + }, + "publishedBefore": { + "type": "string", + "description": "The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).", + "format": "date-time", + "location": "query" + }, + "q": { + "type": "string", + "description": "The q parameter specifies the query term to search for.\n\nYour request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either \"boating\" or \"sailing\", set the q parameter value to boating|sailing. Similarly, to search for videos matching either \"boating\" or \"sailing\" but not \"fishing\", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.", + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + }, + "relatedToVideoId": { + "type": "string", + "description": "The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video.", + "location": "query" + }, + "relevanceLanguage": { + "type": "string", + "description": "The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term.", + "location": "query" + }, + "safeSearch": { + "type": "string", + "description": "The safeSearch parameter indicates whether the search results should include restricted content as well as standard content.", + "enum": [ + "moderate", + "none", + "strict" + ], + "enumDescriptions": [ + "YouTube will filter some content from search results and, at the least, will filter content that is restricted in your locale. Based on their content, search results could be removed from search results or demoted in search results. This is the default parameter value.", + "YouTube will not filter the search result set.", + "YouTube will try to exclude all restricted content from the search result set. Based on their content, search results could be removed from search results or demoted in search results." + ], + "location": "query" + }, + "topicId": { + "type": "string", + "description": "The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID.", + "location": "query" + }, + "type": { + "type": "string", + "description": "The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types.", + "default": "video,channel,playlist", + "location": "query" + }, + "videoCaption": { + "type": "string", + "description": "The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "closedCaption", + "none" + ], + "enumDescriptions": [ + "Do not filter results based on caption availability.", + "Only include videos that have captions.", + "Only include videos that do not have captions." + ], + "location": "query" + }, + "videoCategoryId": { + "type": "string", + "description": "The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "location": "query" + }, + "videoDefinition": { + "type": "string", + "description": "The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "high", + "standard" + ], + "enumDescriptions": [ + "Return all videos, regardless of their resolution.", + "Only retrieve HD videos.", + "Only retrieve videos in standard definition." + ], + "location": "query" + }, + "videoDimension": { + "type": "string", + "description": "The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "2d", + "3d", + "any" + ], + "enumDescriptions": [ + "Restrict search results to exclude 3D videos.", + "Restrict search results to only include 3D videos.", + "Include both 3D and non-3D videos in returned results. This is the default value." + ], + "location": "query" + }, + "videoDuration": { + "type": "string", + "description": "The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "long", + "medium", + "short" + ], + "enumDescriptions": [ + "Do not filter video search results based on their duration. This is the default value.", + "Only include videos longer than 20 minutes.", + "Only include videos that are between four and 20 minutes long (inclusive).", + "Only include videos that are less than four minutes long." + ], + "location": "query" + }, + "videoEmbeddable": { + "type": "string", + "description": "The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "true" + ], + "enumDescriptions": [ + "Return all videos, embeddable or not.", + "Only retrieve embeddable videos." + ], + "location": "query" + }, + "videoLicense": { + "type": "string", + "description": "The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "creativeCommon", + "youtube" + ], + "enumDescriptions": [ + "Return all videos, regardless of which license they have, that match the query parameters.", + "Only return videos that have a Creative Commons license. Users can reuse videos with this license in other videos that they create. Learn more.", + "Only return videos that have the standard YouTube license." + ], + "location": "query" + }, + "videoSyndicated": { + "type": "string", + "description": "The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "true" + ], + "enumDescriptions": [ + "Return all videos, syndicated or not.", + "Only retrieve syndicated videos." + ], + "location": "query" + }, + "videoType": { + "type": "string", + "description": "The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video.", + "enum": [ + "any", + "episode", + "movie" + ], + "enumDescriptions": [ + "Return all videos.", + "Only retrieve episodes of shows.", + "Only retrieve movies." + ], + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "SearchListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "sponsors": { + "methods": { + "list": { + "id": "youtube.sponsors.list", + "path": "sponsors", + "httpMethod": "GET", + "description": "Lists sponsors for a channel.", + "parameters": { + "filter": { + "type": "string", + "description": "The filter parameter specifies which channel sponsors to return.", + "default": "POLL_NEWEST", + "enum": [ + "all", + "newest" + ], + "enumDescriptions": [ + "Return all sponsors, from newest to oldest.", + "Return the most recent sponsors, from newest to oldest." + ], + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "SponsorListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "subscriptions": { + "methods": { + "delete": { + "id": "youtube.subscriptions.delete", + "path": "subscriptions", + "httpMethod": "DELETE", + "description": "Deletes a subscription.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.subscriptions.insert", + "path": "subscriptions", + "httpMethod": "POST", + "description": "Adds a subscription for the authenticated user's channel.", + "parameters": { + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Subscription" + }, + "response": { + "$ref": "Subscription" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "list": { + "id": "youtube.subscriptions.list", + "path": "subscriptions", + "httpMethod": "GET", + "description": "Returns subscription resources that match the API request criteria.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.", + "location": "query" + }, + "forChannelId": { + "type": "string", + "description": "The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "mine": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.", + "location": "query" + }, + "myRecentSubscribers": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in reverse chronological order (newest first).", + "location": "query" + }, + "mySubscribers": { + "type": "boolean", + "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in no particular order.", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "order": { + "type": "string", + "description": "The order parameter specifies the method that will be used to sort resources in the API response.", + "default": "SUBSCRIPTION_ORDER_RELEVANCE", + "enum": [ + "alphabetical", + "relevance", + "unread" + ], + "enumDescriptions": [ + "Sort alphabetically.", + "Sort by relevance.", + "Sort by order of activity." + ], + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "SubscriptionListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "superChatEvents": { + "methods": { + "list": { + "id": "youtube.superChatEvents.list", + "path": "superChatEvents", + "httpMethod": "GET", + "description": "Lists Super Chat events for a channel.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.", + "default": "5", + "format": "uint32", + "minimum": "0", + "maximum": "50", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "SuperChatEventListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "thumbnails": { + "methods": { + "set": { + "id": "youtube.thumbnails.set", + "path": "thumbnails/set", + "httpMethod": "POST", + "description": "Uploads a custom video thumbnail to YouTube and sets it for a video.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "videoId": { + "type": "string", + "description": "The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "videoId" + ], + "response": { + "$ref": "ThumbnailSetResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "image/jpeg", + "image/png" + ], + "maxSize": "2MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/thumbnails/set" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/thumbnails/set" + } + } + } + } + } + }, + "videoAbuseReportReasons": { + "methods": { + "list": { + "id": "youtube.videoAbuseReportReasons.list", + "path": "videoAbuseReportReasons", + "httpMethod": "GET", + "description": "Returns a list of abuse reasons that can be used for reporting abusive videos.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "VideoAbuseReportReasonListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly" + ] + } + } + }, + "videoCategories": { + "methods": { + "list": { + "id": "youtube.videoCategories.list", + "path": "videoCategories", + "httpMethod": "GET", + "description": "Returns a list of categories that can be associated with YouTube videos.", + "parameters": { + "hl": { + "type": "string", + "description": "The hl parameter specifies the language that should be used for text values in the API response.", + "default": "en_US", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.", + "required": true, + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "VideoCategoryListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "videos": { + "methods": { + "delete": { + "id": "youtube.videos.delete", + "path": "videos", + "httpMethod": "DELETE", + "description": "Deletes a YouTube video.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "getRating": { + "id": "youtube.videos.getRating", + "path": "videos/getRating", + "httpMethod": "GET", + "description": "Retrieves the ratings that the authorized user gave to a list of specified videos.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "id" + ], + "response": { + "$ref": "VideoGetRatingResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "insert": { + "id": "youtube.videos.insert", + "path": "videos", + "httpMethod": "POST", + "description": "Uploads a video to YouTube and optionally sets the video's metadata.", + "parameters": { + "autoLevels": { + "type": "boolean", + "description": "The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color.", + "location": "query" + }, + "notifySubscribers": { + "type": "boolean", + "description": "The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers.", + "default": "true", + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "onBehalfOfContentOwnerChannel": { + "type": "string", + "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", + "required": true, + "location": "query" + }, + "stabilize": { + "type": "boolean", + "description": "The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions.", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Video" + }, + "response": { + "$ref": "Video" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "video/*" + ], + "maxSize": "64GB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/videos" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/videos" + } + } + } + }, + "list": { + "id": "youtube.videos.list", + "path": "videos", + "httpMethod": "GET", + "description": "Returns a list of videos that match the API request parameters.", + "parameters": { + "chart": { + "type": "string", + "description": "The chart parameter identifies the chart that you want to retrieve.", + "enum": [ + "mostPopular" + ], + "enumDescriptions": [ + "Return the most popular videos for the specified content region and video category." + ], + "location": "query" + }, + "hl": { + "type": "string", + "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.", + "location": "query" + }, + "id": { + "type": "string", + "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID.", + "location": "query" + }, + "locale": { + "type": "string", + "description": "DEPRECATED", + "location": "query" + }, + "maxHeight": { + "type": "integer", + "description": "The maxHeight parameter specifies a maximum height of the embedded player. If maxWidth is provided, maxHeight may not be reached in order to not violate the width request.", + "format": "uint32", + "minimum": "72", + "maximum": "8192", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter.", + "default": "5", + "format": "uint32", + "minimum": "1", + "maximum": "50", + "location": "query" + }, + "maxWidth": { + "type": "integer", + "description": "The maxWidth parameter specifies a maximum width of the embedded player. If maxHeight is provided, maxWidth may not be reached in order to not violate the height request.", + "format": "uint32", + "minimum": "72", + "maximum": "8192", + "location": "query" + }, + "myRating": { + "type": "string", + "description": "Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user.", + "enum": [ + "dislike", + "like" + ], + "enumDescriptions": [ + "Returns only videos disliked by the authenticated user.", + "Returns only video liked by the authenticated user." + ], + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.\n\nNote: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.", + "required": true, + "location": "query" + }, + "regionCode": { + "type": "string", + "description": "The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.", + "location": "query" + }, + "videoCategoryId": { + "type": "string", + "description": "The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category.", + "default": "0", + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "response": { + "$ref": "VideoListResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.readonly", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "rate": { + "id": "youtube.videos.rate", + "path": "videos/rate", + "httpMethod": "POST", + "description": "Add a like or dislike rating to a video or remove a rating from a video.", + "parameters": { + "id": { + "type": "string", + "description": "The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.", + "required": true, + "location": "query" + }, + "rating": { + "type": "string", + "description": "Specifies the rating to record.", + "required": true, + "enum": [ + "dislike", + "like", + "none" + ], + "enumDescriptions": [ + "Records that the authenticated user disliked the video.", + "Records that the authenticated user liked the video.", + "Removes any rating that the authenticated user had previously set for the video." + ], + "location": "query" + } + }, + "parameterOrder": [ + "id", + "rating" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "reportAbuse": { + "id": "youtube.videos.reportAbuse", + "path": "videos/reportAbuse", + "httpMethod": "POST", + "description": "Report abuse for a video.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "request": { + "$ref": "VideoAbuseReport" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + }, + "update": { + "id": "youtube.videos.update", + "path": "videos", + "httpMethod": "PUT", + "description": "Updates a video's metadata.", + "parameters": { + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + }, + "part": { + "type": "string", + "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.\n\nIn addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.", + "required": true, + "location": "query" + } + }, + "parameterOrder": [ + "part" + ], + "request": { + "$ref": "Video" + }, + "response": { + "$ref": "Video" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + }, + "watermarks": { + "methods": { + "set": { + "id": "youtube.watermarks.set", + "path": "watermarks/set", + "httpMethod": "POST", + "description": "Uploads a watermark image to YouTube and sets it for a channel.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being provided.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "channelId" + ], + "request": { + "$ref": "InvideoBranding" + }, + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtube.upload", + "https://www.googleapis.com/auth/youtubepartner" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "application/octet-stream", + "image/jpeg", + "image/png" + ], + "maxSize": "10MB", + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/youtube/v3/watermarks/set" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/youtube/v3/watermarks/set" + } + } + } + }, + "unset": { + "id": "youtube.watermarks.unset", + "path": "watermarks/unset", + "httpMethod": "POST", + "description": "Deletes a channel's watermark image.", + "parameters": { + "channelId": { + "type": "string", + "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.", + "required": true, + "location": "query" + }, + "onBehalfOfContentOwner": { + "type": "string", + "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.", + "location": "query" + } + }, + "parameterOrder": [ + "channelId" + ], + "scopes": [ + "https://www.googleapis.com/auth/youtube", + "https://www.googleapis.com/auth/youtube.force-ssl", + "https://www.googleapis.com/auth/youtubepartner" + ] + } + } + } + } +} diff --git a/vendor/google.golang.org/api/youtube/v3/youtube-gen.go b/vendor/google.golang.org/api/youtube/v3/youtube-gen.go new file mode 100644 index 0000000..525ce86 --- /dev/null +++ b/vendor/google.golang.org/api/youtube/v3/youtube-gen.go @@ -0,0 +1,23861 @@ +// Package youtube provides access to the YouTube Data API. +// +// See https://developers.google.com/youtube/v3 +// +// Usage example: +// +// import "google.golang.org/api/youtube/v3" +// ... +// youtubeService, err := youtube.New(oauthHttpClient) +package youtube // import "google.golang.org/api/youtube/v3" + +import ( + "bytes" + "encoding/json" + "errors" + "fmt" + context "golang.org/x/net/context" + ctxhttp "golang.org/x/net/context/ctxhttp" + gensupport "google.golang.org/api/gensupport" + googleapi "google.golang.org/api/googleapi" + "io" + "net/http" + "net/url" + "strconv" + "strings" +) + +// Always reference these packages, just in case the auto-generated code +// below doesn't. +var _ = bytes.NewBuffer +var _ = strconv.Itoa +var _ = fmt.Sprintf +var _ = json.NewDecoder +var _ = io.Copy +var _ = url.Parse +var _ = gensupport.MarshalJSON +var _ = googleapi.Version +var _ = errors.New +var _ = strings.Replace +var _ = context.Canceled +var _ = ctxhttp.Do + +const apiId = "youtube:v3" +const apiName = "youtube" +const apiVersion = "v3" +const basePath = "https://www.googleapis.com/youtube/v3/" + +// OAuth2 scopes used by this API. +const ( + // Manage your YouTube account + YoutubeScope = "https://www.googleapis.com/auth/youtube" + + // Manage your YouTube account + YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl" + + // View your YouTube account + YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly" + + // Manage your YouTube videos + YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload" + + // View and manage your assets and associated content on YouTube + YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner" + + // View private information of your YouTube channel relevant during the + // audit process with a YouTube partner + YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit" +) + +func New(client *http.Client) (*Service, error) { + if client == nil { + return nil, errors.New("client is nil") + } + s := &Service{client: client, BasePath: basePath} + s.Activities = NewActivitiesService(s) + s.Captions = NewCaptionsService(s) + s.ChannelBanners = NewChannelBannersService(s) + s.ChannelSections = NewChannelSectionsService(s) + s.Channels = NewChannelsService(s) + s.CommentThreads = NewCommentThreadsService(s) + s.Comments = NewCommentsService(s) + s.FanFundingEvents = NewFanFundingEventsService(s) + s.GuideCategories = NewGuideCategoriesService(s) + s.I18nLanguages = NewI18nLanguagesService(s) + s.I18nRegions = NewI18nRegionsService(s) + s.LiveBroadcasts = NewLiveBroadcastsService(s) + s.LiveChatBans = NewLiveChatBansService(s) + s.LiveChatMessages = NewLiveChatMessagesService(s) + s.LiveChatModerators = NewLiveChatModeratorsService(s) + s.LiveStreams = NewLiveStreamsService(s) + s.PlaylistItems = NewPlaylistItemsService(s) + s.Playlists = NewPlaylistsService(s) + s.Search = NewSearchService(s) + s.Sponsors = NewSponsorsService(s) + s.Subscriptions = NewSubscriptionsService(s) + s.SuperChatEvents = NewSuperChatEventsService(s) + s.Thumbnails = NewThumbnailsService(s) + s.VideoAbuseReportReasons = NewVideoAbuseReportReasonsService(s) + s.VideoCategories = NewVideoCategoriesService(s) + s.Videos = NewVideosService(s) + s.Watermarks = NewWatermarksService(s) + return s, nil +} + +type Service struct { + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + + Activities *ActivitiesService + + Captions *CaptionsService + + ChannelBanners *ChannelBannersService + + ChannelSections *ChannelSectionsService + + Channels *ChannelsService + + CommentThreads *CommentThreadsService + + Comments *CommentsService + + FanFundingEvents *FanFundingEventsService + + GuideCategories *GuideCategoriesService + + I18nLanguages *I18nLanguagesService + + I18nRegions *I18nRegionsService + + LiveBroadcasts *LiveBroadcastsService + + LiveChatBans *LiveChatBansService + + LiveChatMessages *LiveChatMessagesService + + LiveChatModerators *LiveChatModeratorsService + + LiveStreams *LiveStreamsService + + PlaylistItems *PlaylistItemsService + + Playlists *PlaylistsService + + Search *SearchService + + Sponsors *SponsorsService + + Subscriptions *SubscriptionsService + + SuperChatEvents *SuperChatEventsService + + Thumbnails *ThumbnailsService + + VideoAbuseReportReasons *VideoAbuseReportReasonsService + + VideoCategories *VideoCategoriesService + + Videos *VideosService + + Watermarks *WatermarksService +} + +func (s *Service) userAgent() string { + if s.UserAgent == "" { + return googleapi.UserAgent + } + return googleapi.UserAgent + " " + s.UserAgent +} + +func NewActivitiesService(s *Service) *ActivitiesService { + rs := &ActivitiesService{s: s} + return rs +} + +type ActivitiesService struct { + s *Service +} + +func NewCaptionsService(s *Service) *CaptionsService { + rs := &CaptionsService{s: s} + return rs +} + +type CaptionsService struct { + s *Service +} + +func NewChannelBannersService(s *Service) *ChannelBannersService { + rs := &ChannelBannersService{s: s} + return rs +} + +type ChannelBannersService struct { + s *Service +} + +func NewChannelSectionsService(s *Service) *ChannelSectionsService { + rs := &ChannelSectionsService{s: s} + return rs +} + +type ChannelSectionsService struct { + s *Service +} + +func NewChannelsService(s *Service) *ChannelsService { + rs := &ChannelsService{s: s} + return rs +} + +type ChannelsService struct { + s *Service +} + +func NewCommentThreadsService(s *Service) *CommentThreadsService { + rs := &CommentThreadsService{s: s} + return rs +} + +type CommentThreadsService struct { + s *Service +} + +func NewCommentsService(s *Service) *CommentsService { + rs := &CommentsService{s: s} + return rs +} + +type CommentsService struct { + s *Service +} + +func NewFanFundingEventsService(s *Service) *FanFundingEventsService { + rs := &FanFundingEventsService{s: s} + return rs +} + +type FanFundingEventsService struct { + s *Service +} + +func NewGuideCategoriesService(s *Service) *GuideCategoriesService { + rs := &GuideCategoriesService{s: s} + return rs +} + +type GuideCategoriesService struct { + s *Service +} + +func NewI18nLanguagesService(s *Service) *I18nLanguagesService { + rs := &I18nLanguagesService{s: s} + return rs +} + +type I18nLanguagesService struct { + s *Service +} + +func NewI18nRegionsService(s *Service) *I18nRegionsService { + rs := &I18nRegionsService{s: s} + return rs +} + +type I18nRegionsService struct { + s *Service +} + +func NewLiveBroadcastsService(s *Service) *LiveBroadcastsService { + rs := &LiveBroadcastsService{s: s} + return rs +} + +type LiveBroadcastsService struct { + s *Service +} + +func NewLiveChatBansService(s *Service) *LiveChatBansService { + rs := &LiveChatBansService{s: s} + return rs +} + +type LiveChatBansService struct { + s *Service +} + +func NewLiveChatMessagesService(s *Service) *LiveChatMessagesService { + rs := &LiveChatMessagesService{s: s} + return rs +} + +type LiveChatMessagesService struct { + s *Service +} + +func NewLiveChatModeratorsService(s *Service) *LiveChatModeratorsService { + rs := &LiveChatModeratorsService{s: s} + return rs +} + +type LiveChatModeratorsService struct { + s *Service +} + +func NewLiveStreamsService(s *Service) *LiveStreamsService { + rs := &LiveStreamsService{s: s} + return rs +} + +type LiveStreamsService struct { + s *Service +} + +func NewPlaylistItemsService(s *Service) *PlaylistItemsService { + rs := &PlaylistItemsService{s: s} + return rs +} + +type PlaylistItemsService struct { + s *Service +} + +func NewPlaylistsService(s *Service) *PlaylistsService { + rs := &PlaylistsService{s: s} + return rs +} + +type PlaylistsService struct { + s *Service +} + +func NewSearchService(s *Service) *SearchService { + rs := &SearchService{s: s} + return rs +} + +type SearchService struct { + s *Service +} + +func NewSponsorsService(s *Service) *SponsorsService { + rs := &SponsorsService{s: s} + return rs +} + +type SponsorsService struct { + s *Service +} + +func NewSubscriptionsService(s *Service) *SubscriptionsService { + rs := &SubscriptionsService{s: s} + return rs +} + +type SubscriptionsService struct { + s *Service +} + +func NewSuperChatEventsService(s *Service) *SuperChatEventsService { + rs := &SuperChatEventsService{s: s} + return rs +} + +type SuperChatEventsService struct { + s *Service +} + +func NewThumbnailsService(s *Service) *ThumbnailsService { + rs := &ThumbnailsService{s: s} + return rs +} + +type ThumbnailsService struct { + s *Service +} + +func NewVideoAbuseReportReasonsService(s *Service) *VideoAbuseReportReasonsService { + rs := &VideoAbuseReportReasonsService{s: s} + return rs +} + +type VideoAbuseReportReasonsService struct { + s *Service +} + +func NewVideoCategoriesService(s *Service) *VideoCategoriesService { + rs := &VideoCategoriesService{s: s} + return rs +} + +type VideoCategoriesService struct { + s *Service +} + +func NewVideosService(s *Service) *VideosService { + rs := &VideosService{s: s} + return rs +} + +type VideosService struct { + s *Service +} + +func NewWatermarksService(s *Service) *WatermarksService { + rs := &WatermarksService{s: s} + return rs +} + +type WatermarksService struct { + s *Service +} + +// AccessPolicy: Rights management policy for YouTube resources. +type AccessPolicy struct { + // Allowed: The value of allowed indicates whether the access to the + // policy is allowed or denied by default. + Allowed bool `json:"allowed,omitempty"` + + // Exception: A list of region codes that identify countries where the + // default policy do not apply. + Exception []string `json:"exception,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Allowed") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Allowed") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *AccessPolicy) MarshalJSON() ([]byte, error) { + type noMethod AccessPolicy + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Activity: An activity resource contains information about an action +// that a particular channel, or user, has taken on YouTube.The actions +// reported in activity feeds include rating a video, sharing a video, +// marking a video as a favorite, commenting on a video, uploading a +// video, and so forth. Each activity resource identifies the type of +// action, the channel associated with the action, and the resource(s) +// associated with the action, such as the video that was rated or +// uploaded. +type Activity struct { + // ContentDetails: The contentDetails object contains information about + // the content associated with the activity. For example, if the + // snippet.type value is videoRated, then the contentDetails object's + // content identifies the rated video. + ContentDetails *ActivityContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the activity. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#activity". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the + // activity, including the activity's type and group ID. + Snippet *ActivitySnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentDetails") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *Activity) MarshalJSON() ([]byte, error) { + type noMethod Activity + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetails: Details about the content of an activity: the +// video that was shared, the channel that was subscribed to, etc. +type ActivityContentDetails struct { + // Bulletin: The bulletin object contains details about a channel + // bulletin post. This object is only present if the snippet.type is + // bulletin. + Bulletin *ActivityContentDetailsBulletin `json:"bulletin,omitempty"` + + // ChannelItem: The channelItem object contains details about a resource + // which was added to a channel. This property is only present if the + // snippet.type is channelItem. + ChannelItem *ActivityContentDetailsChannelItem `json:"channelItem,omitempty"` + + // Comment: The comment object contains information about a resource + // that received a comment. This property is only present if the + // snippet.type is comment. + Comment *ActivityContentDetailsComment `json:"comment,omitempty"` + + // Favorite: The favorite object contains information about a video that + // was marked as a favorite video. This property is only present if the + // snippet.type is favorite. + Favorite *ActivityContentDetailsFavorite `json:"favorite,omitempty"` + + // Like: The like object contains information about a resource that + // received a positive (like) rating. This property is only present if + // the snippet.type is like. + Like *ActivityContentDetailsLike `json:"like,omitempty"` + + // PlaylistItem: The playlistItem object contains information about a + // new playlist item. This property is only present if the snippet.type + // is playlistItem. + PlaylistItem *ActivityContentDetailsPlaylistItem `json:"playlistItem,omitempty"` + + // PromotedItem: The promotedItem object contains details about a + // resource which is being promoted. This property is only present if + // the snippet.type is promotedItem. + PromotedItem *ActivityContentDetailsPromotedItem `json:"promotedItem,omitempty"` + + // Recommendation: The recommendation object contains information about + // a recommended resource. This property is only present if the + // snippet.type is recommendation. + Recommendation *ActivityContentDetailsRecommendation `json:"recommendation,omitempty"` + + // Social: The social object contains details about a social network + // post. This property is only present if the snippet.type is social. + Social *ActivityContentDetailsSocial `json:"social,omitempty"` + + // Subscription: The subscription object contains information about a + // channel that a user subscribed to. This property is only present if + // the snippet.type is subscription. + Subscription *ActivityContentDetailsSubscription `json:"subscription,omitempty"` + + // Upload: The upload object contains information about the uploaded + // video. This property is only present if the snippet.type is upload. + Upload *ActivityContentDetailsUpload `json:"upload,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Bulletin") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Bulletin") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetails) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsBulletin: Details about a channel bulletin +// post. +type ActivityContentDetailsBulletin struct { + // ResourceId: The resourceId object contains information that + // identifies the resource associated with a bulletin post. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResourceId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsBulletin) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsBulletin + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsChannelItem: Details about a resource which was +// added to a channel. +type ActivityContentDetailsChannelItem struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that was added to the channel. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResourceId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsChannelItem) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsChannelItem + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsComment: Information about a resource that +// received a comment. +type ActivityContentDetailsComment struct { + // ResourceId: The resourceId object contains information that + // identifies the resource associated with the comment. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResourceId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsComment) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsComment + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsFavorite: Information about a video that was +// marked as a favorite video. +type ActivityContentDetailsFavorite struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that was marked as a favorite. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResourceId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsFavorite) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsFavorite + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsLike: Information about a resource that +// received a positive (like) rating. +type ActivityContentDetailsLike struct { + // ResourceId: The resourceId object contains information that + // identifies the rated resource. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResourceId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsLike) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsLike + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsPlaylistItem: Information about a new playlist +// item. +type ActivityContentDetailsPlaylistItem struct { + // PlaylistId: The value that YouTube uses to uniquely identify the + // playlist. + PlaylistId string `json:"playlistId,omitempty"` + + // PlaylistItemId: ID of the item within the playlist. + PlaylistItemId string `json:"playlistItemId,omitempty"` + + // ResourceId: The resourceId object contains information about the + // resource that was added to the playlist. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PlaylistId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PlaylistId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsPlaylistItem) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsPlaylistItem + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsPromotedItem: Details about a resource which is +// being promoted. +type ActivityContentDetailsPromotedItem struct { + // AdTag: The URL the client should fetch to request a promoted item. + AdTag string `json:"adTag,omitempty"` + + // ClickTrackingUrl: The URL the client should ping to indicate that the + // user clicked through on this promoted item. + ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"` + + // CreativeViewUrl: The URL the client should ping to indicate that the + // user was shown this promoted item. + CreativeViewUrl string `json:"creativeViewUrl,omitempty"` + + // CtaType: The type of call-to-action, a message to the user indicating + // action that can be taken. + // + // Possible values: + // "unspecified" + // "visitAdvertiserSite" + CtaType string `json:"ctaType,omitempty"` + + // CustomCtaButtonText: The custom call-to-action button text. If + // specified, it will override the default button text for the cta_type. + CustomCtaButtonText string `json:"customCtaButtonText,omitempty"` + + // DescriptionText: The text description to accompany the promoted item. + DescriptionText string `json:"descriptionText,omitempty"` + + // DestinationUrl: The URL the client should direct the user to, if the + // user chooses to visit the advertiser's website. + DestinationUrl string `json:"destinationUrl,omitempty"` + + // ForecastingUrl: The list of forecasting URLs. The client should ping + // all of these URLs when a promoted item is not available, to indicate + // that a promoted item could have been shown. + ForecastingUrl []string `json:"forecastingUrl,omitempty"` + + // ImpressionUrl: The list of impression URLs. The client should ping + // all of these URLs to indicate that the user was shown this promoted + // item. + ImpressionUrl []string `json:"impressionUrl,omitempty"` + + // VideoId: The ID that YouTube uses to uniquely identify the promoted + // video. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AdTag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AdTag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsPromotedItem) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsPromotedItem + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsRecommendation: Information that identifies the +// recommended resource. +type ActivityContentDetailsRecommendation struct { + // Reason: The reason that the resource is recommended to the user. + // + // Possible values: + // "unspecified" + // "videoFavorited" + // "videoLiked" + // "videoWatched" + Reason string `json:"reason,omitempty"` + + // ResourceId: The resourceId object contains information that + // identifies the recommended resource. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // SeedResourceId: The seedResourceId object contains information about + // the resource that caused the recommendation. + SeedResourceId *ResourceId `json:"seedResourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Reason") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Reason") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsRecommendation) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsRecommendation + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsSocial: Details about a social network post. +type ActivityContentDetailsSocial struct { + // Author: The author of the social network post. + Author string `json:"author,omitempty"` + + // ImageUrl: An image of the post's author. + ImageUrl string `json:"imageUrl,omitempty"` + + // ReferenceUrl: The URL of the social network post. + ReferenceUrl string `json:"referenceUrl,omitempty"` + + // ResourceId: The resourceId object encapsulates information that + // identifies the resource associated with a social network post. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // Type: The name of the social network. + // + // Possible values: + // "facebook" + // "googlePlus" + // "twitter" + // "unspecified" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Author") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Author") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsSocial) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsSocial + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsSubscription: Information about a channel that +// a user subscribed to. +type ActivityContentDetailsSubscription struct { + // ResourceId: The resourceId object contains information that + // identifies the resource that the user subscribed to. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResourceId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResourceId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsSubscription) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsSubscription + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivityContentDetailsUpload: Information about the uploaded video. +type ActivityContentDetailsUpload struct { + // VideoId: The ID that YouTube uses to uniquely identify the uploaded + // video. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "VideoId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "VideoId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityContentDetailsUpload) MarshalJSON() ([]byte, error) { + type noMethod ActivityContentDetailsUpload + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type ActivityListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of activities, or events, that match the request + // criteria. + Items []*Activity `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#activityListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivityListResponse) MarshalJSON() ([]byte, error) { + type noMethod ActivityListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ActivitySnippet: Basic details about an activity, including title, +// description, thumbnails, activity type and group. +type ActivitySnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // associated with the activity. + ChannelId string `json:"channelId,omitempty"` + + // ChannelTitle: Channel title for the channel responsible for this + // activity + ChannelTitle string `json:"channelTitle,omitempty"` + + // Description: The description of the resource primarily associated + // with the activity. + Description string `json:"description,omitempty"` + + // GroupId: The group ID associated with the activity. A group ID + // identifies user events that are associated with the same user and + // resource. For example, if a user rates a video and marks the same + // video as a favorite, the entries for those events would have the same + // group ID in the user's activity feed. In your user interface, you can + // avoid repetition by grouping events with the same groupId value. + GroupId string `json:"groupId,omitempty"` + + // PublishedAt: The date and time that the video was uploaded. The value + // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the resource + // that is primarily associated with the activity. For each object in + // the map, the key is the name of the thumbnail image, and the value is + // an object that contains other information about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The title of the resource primarily associated with the + // activity. + Title string `json:"title,omitempty"` + + // Type: The type of activity that the resource describes. + // + // Possible values: + // "bulletin" + // "channelItem" + // "comment" + // "favorite" + // "like" + // "playlistItem" + // "promotedItem" + // "recommendation" + // "social" + // "subscription" + // "upload" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ActivitySnippet) MarshalJSON() ([]byte, error) { + type noMethod ActivitySnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Caption: A caption resource represents a YouTube caption track. A +// caption track is associated with exactly one YouTube video. +type Caption struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the caption track. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#caption". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the caption. + Snippet *CaptionSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Caption) MarshalJSON() ([]byte, error) { + type noMethod Caption + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type CaptionListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of captions that match the request criteria. + Items []*Caption `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#captionListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CaptionListResponse) MarshalJSON() ([]byte, error) { + type noMethod CaptionListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CaptionSnippet: Basic details about a caption track, such as its +// language and name. +type CaptionSnippet struct { + // AudioTrackType: The type of audio track associated with the caption + // track. + // + // Possible values: + // "commentary" + // "descriptive" + // "primary" + // "unknown" + AudioTrackType string `json:"audioTrackType,omitempty"` + + // FailureReason: The reason that YouTube failed to process the caption + // track. This property is only present if the state property's value is + // failed. + // + // Possible values: + // "processingFailed" + // "unknownFormat" + // "unsupportedFormat" + FailureReason string `json:"failureReason,omitempty"` + + // IsAutoSynced: Indicates whether YouTube synchronized the caption + // track to the audio track in the video. The value will be true if a + // sync was explicitly requested when the caption track was uploaded. + // For example, when calling the captions.insert or captions.update + // methods, you can set the sync parameter to true to instruct YouTube + // to sync the uploaded track to the video. If the value is false, + // YouTube uses the time codes in the uploaded caption track to + // determine when to display captions. + IsAutoSynced bool `json:"isAutoSynced,omitempty"` + + // IsCC: Indicates whether the track contains closed captions for the + // deaf and hard of hearing. The default value is false. + IsCC bool `json:"isCC,omitempty"` + + // IsDraft: Indicates whether the caption track is a draft. If the value + // is true, then the track is not publicly visible. The default value is + // false. + IsDraft bool `json:"isDraft,omitempty"` + + // IsEasyReader: Indicates whether caption track is formatted for "easy + // reader," meaning it is at a third-grade level for language learners. + // The default value is false. + IsEasyReader bool `json:"isEasyReader,omitempty"` + + // IsLarge: Indicates whether the caption track uses large text for the + // vision-impaired. The default value is false. + IsLarge bool `json:"isLarge,omitempty"` + + // Language: The language of the caption track. The property value is a + // BCP-47 language tag. + Language string `json:"language,omitempty"` + + // LastUpdated: The date and time when the caption track was last + // updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + LastUpdated string `json:"lastUpdated,omitempty"` + + // Name: The name of the caption track. The name is intended to be + // visible to the user as an option during playback. + Name string `json:"name,omitempty"` + + // Status: The caption track's status. + // + // Possible values: + // "failed" + // "serving" + // "syncing" + Status string `json:"status,omitempty"` + + // TrackKind: The caption track's type. + // + // Possible values: + // "ASR" + // "forced" + // "standard" + TrackKind string `json:"trackKind,omitempty"` + + // VideoId: The ID that YouTube uses to uniquely identify the video + // associated with the caption track. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AudioTrackType") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AudioTrackType") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CaptionSnippet) MarshalJSON() ([]byte, error) { + type noMethod CaptionSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CdnSettings: Brief description of the live stream cdn settings. +type CdnSettings struct { + // Format: The format of the video stream that you are sending to + // Youtube. + Format string `json:"format,omitempty"` + + // FrameRate: The frame rate of the inbound video data. + // + // Possible values: + // "30fps" + // "60fps" + FrameRate string `json:"frameRate,omitempty"` + + // IngestionInfo: The ingestionInfo object contains information that + // YouTube provides that you need to transmit your RTMP or HTTP stream + // to YouTube. + IngestionInfo *IngestionInfo `json:"ingestionInfo,omitempty"` + + // IngestionType: The method or protocol used to transmit the video + // stream. + // + // Possible values: + // "dash" + // "rtmp" + IngestionType string `json:"ingestionType,omitempty"` + + // Resolution: The resolution of the inbound video data. + // + // Possible values: + // "1080p" + // "1440p" + // "2160p" + // "240p" + // "360p" + // "480p" + // "720p" + Resolution string `json:"resolution,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Format") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Format") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CdnSettings) MarshalJSON() ([]byte, error) { + type noMethod CdnSettings + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Channel: A channel resource contains information about a YouTube +// channel. +type Channel struct { + // AuditDetails: The auditionDetails object encapsulates channel data + // that is relevant for YouTube Partners during the audition process. + AuditDetails *ChannelAuditDetails `json:"auditDetails,omitempty"` + + // BrandingSettings: The brandingSettings object encapsulates + // information about the branding of the channel. + BrandingSettings *ChannelBrandingSettings `json:"brandingSettings,omitempty"` + + // ContentDetails: The contentDetails object encapsulates information + // about the channel's content. + ContentDetails *ChannelContentDetails `json:"contentDetails,omitempty"` + + // ContentOwnerDetails: The contentOwnerDetails object encapsulates + // channel data that is relevant for YouTube Partners linked with the + // channel. + ContentOwnerDetails *ChannelContentOwnerDetails `json:"contentOwnerDetails,omitempty"` + + // ConversionPings: The conversionPings object encapsulates information + // about conversion pings that need to be respected by the channel. + ConversionPings *ChannelConversionPings `json:"conversionPings,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the channel. + Id string `json:"id,omitempty"` + + // InvideoPromotion: The invideoPromotion object encapsulates + // information about promotion campaign associated with the channel. + InvideoPromotion *InvideoPromotion `json:"invideoPromotion,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channel". + Kind string `json:"kind,omitempty"` + + // Localizations: Localizations for different languages + Localizations map[string]ChannelLocalization `json:"localizations,omitempty"` + + // Snippet: The snippet object contains basic details about the channel, + // such as its title, description, and thumbnail images. + Snippet *ChannelSnippet `json:"snippet,omitempty"` + + // Statistics: The statistics object encapsulates statistics for the + // channel. + Statistics *ChannelStatistics `json:"statistics,omitempty"` + + // Status: The status object encapsulates information about the privacy + // status of the channel. + Status *ChannelStatus `json:"status,omitempty"` + + // TopicDetails: The topicDetails object encapsulates information about + // Freebase topics associated with the channel. + TopicDetails *ChannelTopicDetails `json:"topicDetails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuditDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AuditDetails") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Channel) MarshalJSON() ([]byte, error) { + type noMethod Channel + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelAuditDetails: The auditDetails object encapsulates channel +// data that is relevant for YouTube Partners during the audit process. +type ChannelAuditDetails struct { + // CommunityGuidelinesGoodStanding: Whether or not the channel respects + // the community guidelines. + CommunityGuidelinesGoodStanding bool `json:"communityGuidelinesGoodStanding,omitempty"` + + // ContentIdClaimsGoodStanding: Whether or not the channel has any + // unresolved claims. + ContentIdClaimsGoodStanding bool `json:"contentIdClaimsGoodStanding,omitempty"` + + // CopyrightStrikesGoodStanding: Whether or not the channel has any + // copyright strikes. + CopyrightStrikesGoodStanding bool `json:"copyrightStrikesGoodStanding,omitempty"` + + // OverallGoodStanding: Describes the general state of the channel. This + // field will always show if there are any issues whatsoever with the + // channel. Currently this field represents the result of the logical + // and operation over the community guidelines good standing, the + // copyright strikes good standing and the content ID claims good + // standing, but this may change in the future. + OverallGoodStanding bool `json:"overallGoodStanding,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "CommunityGuidelinesGoodStanding") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "CommunityGuidelinesGoodStanding") to include in API requests with + // the JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelAuditDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelAuditDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelBannerResource: A channel banner returned as the response to a +// channel_banner.insert call. +type ChannelBannerResource struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelBannerResource". + Kind string `json:"kind,omitempty"` + + // Url: The URL of this banner image. + Url string `json:"url,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelBannerResource) MarshalJSON() ([]byte, error) { + type noMethod ChannelBannerResource + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelBrandingSettings: Branding properties of a YouTube channel. +type ChannelBrandingSettings struct { + // Channel: Branding properties for the channel view. + Channel *ChannelSettings `json:"channel,omitempty"` + + // Hints: Additional experimental branding properties. + Hints []*PropertyValue `json:"hints,omitempty"` + + // Image: Branding properties for branding images. + Image *ImageSettings `json:"image,omitempty"` + + // Watch: Branding properties for the watch page. + Watch *WatchSettings `json:"watch,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Channel") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Channel") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelBrandingSettings) MarshalJSON() ([]byte, error) { + type noMethod ChannelBrandingSettings + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelContentDetails: Details about the content of a channel. +type ChannelContentDetails struct { + RelatedPlaylists *ChannelContentDetailsRelatedPlaylists `json:"relatedPlaylists,omitempty"` + + // ForceSendFields is a list of field names (e.g. "RelatedPlaylists") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "RelatedPlaylists") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ChannelContentDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type ChannelContentDetailsRelatedPlaylists struct { + // Favorites: The ID of the playlist that contains the channel"s + // favorite videos. Use the playlistItems.insert and + // playlistItems.delete to add or remove items from that list. + Favorites string `json:"favorites,omitempty"` + + // Likes: The ID of the playlist that contains the channel"s liked + // videos. Use the playlistItems.insert and playlistItems.delete to + // add or remove items from that list. + Likes string `json:"likes,omitempty"` + + // Uploads: The ID of the playlist that contains the channel"s uploaded + // videos. Use the videos.insert method to upload new videos and the + // videos.delete method to delete previously uploaded videos. + Uploads string `json:"uploads,omitempty"` + + // WatchHistory: The ID of the playlist that contains the channel"s + // watch history. Use the playlistItems.insert and + // playlistItems.delete to add or remove items from that list. + WatchHistory string `json:"watchHistory,omitempty"` + + // WatchLater: The ID of the playlist that contains the channel"s watch + // later playlist. Use the playlistItems.insert and + // playlistItems.delete to add or remove items from that list. + WatchLater string `json:"watchLater,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Favorites") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Favorites") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelContentDetailsRelatedPlaylists) MarshalJSON() ([]byte, error) { + type noMethod ChannelContentDetailsRelatedPlaylists + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelContentOwnerDetails: The contentOwnerDetails object +// encapsulates channel data that is relevant for YouTube Partners +// linked with the channel. +type ChannelContentOwnerDetails struct { + // ContentOwner: The ID of the content owner linked to the channel. + ContentOwner string `json:"contentOwner,omitempty"` + + // TimeLinked: The date and time of when the channel was linked to the + // content owner. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + TimeLinked string `json:"timeLinked,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ContentOwner") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentOwner") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelContentOwnerDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelContentOwnerDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelConversionPing: Pings that the app shall fire (authenticated +// by biscotti cookie). Each ping has a context, in which the app must +// fire the ping, and a url identifying the ping. +type ChannelConversionPing struct { + // Context: Defines the context of the ping. + // + // Possible values: + // "cview" + // "subscribe" + // "unsubscribe" + Context string `json:"context,omitempty"` + + // ConversionUrl: The url (without the schema) that the player shall + // send the ping to. It's at caller's descretion to decide which schema + // to use (http vs https) Example of a returned url: + // //googleads.g.doubleclick.net/pagead/ + // viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D + // cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must + // append biscotti authentication (ms param in case of mobile, for + // example) to this ping. + ConversionUrl string `json:"conversionUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Context") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Context") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelConversionPing) MarshalJSON() ([]byte, error) { + type noMethod ChannelConversionPing + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelConversionPings: The conversionPings object encapsulates +// information about conversion pings that need to be respected by the +// channel. +type ChannelConversionPings struct { + // Pings: Pings that the app shall fire (authenticated by biscotti + // cookie). Each ping has a context, in which the app must fire the + // ping, and a url identifying the ping. + Pings []*ChannelConversionPing `json:"pings,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Pings") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Pings") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelConversionPings) MarshalJSON() ([]byte, error) { + type noMethod ChannelConversionPings + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type ChannelListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of channels that match the request criteria. + Items []*Channel `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChannelListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelLocalization: Channel localization setting +type ChannelLocalization struct { + // Description: The localized strings for channel's description. + Description string `json:"description,omitempty"` + + // Title: The localized strings for channel's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Description") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelLocalization) MarshalJSON() ([]byte, error) { + type noMethod ChannelLocalization + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type ChannelProfileDetails struct { + // ChannelId: The YouTube channel ID. + ChannelId string `json:"channelId,omitempty"` + + // ChannelUrl: The channel's URL. + ChannelUrl string `json:"channelUrl,omitempty"` + + // DisplayName: The channel's display name. + DisplayName string `json:"displayName,omitempty"` + + // ProfileImageUrl: The channels's avatar URL. + ProfileImageUrl string `json:"profileImageUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelProfileDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelProfileDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type ChannelSection struct { + // ContentDetails: The contentDetails object contains details about the + // channel section content, such as a list of playlists or channels + // featured in the section. + ContentDetails *ChannelSectionContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the channel + // section. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelSection". + Kind string `json:"kind,omitempty"` + + // Localizations: Localizations for different languages + Localizations map[string]ChannelSectionLocalization `json:"localizations,omitempty"` + + // Snippet: The snippet object contains basic details about the channel + // section, such as its type, style and title. + Snippet *ChannelSectionSnippet `json:"snippet,omitempty"` + + // Targeting: The targeting object contains basic targeting settings + // about the channel section. + Targeting *ChannelSectionTargeting `json:"targeting,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentDetails") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSection) MarshalJSON() ([]byte, error) { + type noMethod ChannelSection + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelSectionContentDetails: Details about a channelsection, +// including playlists and channels. +type ChannelSectionContentDetails struct { + // Channels: The channel ids for type multiple_channels. + Channels []string `json:"channels,omitempty"` + + // Playlists: The playlist ids for type single_playlist and + // multiple_playlists. For singlePlaylist, only one playlistId is + // allowed. + Playlists []string `json:"playlists,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Channels") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Channels") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSectionContentDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type ChannelSectionListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of ChannelSections that match the request criteria. + Items []*ChannelSection `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#channelSectionListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSectionListResponse) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelSectionLocalization: ChannelSection localization setting +type ChannelSectionLocalization struct { + // Title: The localized strings for channel section's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Title") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Title") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSectionLocalization) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionLocalization + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelSectionSnippet: Basic details about a channel section, +// including title, style and position. +type ChannelSectionSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that published the channel section. + ChannelId string `json:"channelId,omitempty"` + + // DefaultLanguage: The language of the channel section's default title + // and description. + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // Localized: Localized title, read-only. + Localized *ChannelSectionLocalization `json:"localized,omitempty"` + + // Position: The position of the channel section in the channel. + Position *int64 `json:"position,omitempty"` + + // Style: The style of the channel section. + // + // Possible values: + // "channelsectionStyleUndefined" + // "horizontalRow" + // "verticalList" + Style string `json:"style,omitempty"` + + // Title: The channel section's title for multiple_playlists and + // multiple_channels. + Title string `json:"title,omitempty"` + + // Type: The type of the channel section. + // + // Possible values: + // "allPlaylists" + // "channelsectionTypeUndefined" + // "completedEvents" + // "likedPlaylists" + // "likes" + // "liveEvents" + // "multipleChannels" + // "multiplePlaylists" + // "popularUploads" + // "postedPlaylists" + // "postedVideos" + // "recentActivity" + // "recentPosts" + // "recentUploads" + // "singlePlaylist" + // "subscriptions" + // "upcomingEvents" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSectionSnippet) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelSectionTargeting: ChannelSection targeting setting. +type ChannelSectionTargeting struct { + // Countries: The country the channel section is targeting. + Countries []string `json:"countries,omitempty"` + + // Languages: The language the channel section is targeting. + Languages []string `json:"languages,omitempty"` + + // Regions: The region the channel section is targeting. + Regions []string `json:"regions,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Countries") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Countries") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSectionTargeting) MarshalJSON() ([]byte, error) { + type noMethod ChannelSectionTargeting + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelSettings: Branding properties for the channel view. +type ChannelSettings struct { + // Country: The country of the channel. + Country string `json:"country,omitempty"` + + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // DefaultTab: Which content tab users should see when viewing the + // channel. + DefaultTab string `json:"defaultTab,omitempty"` + + // Description: Specifies the channel description. + Description string `json:"description,omitempty"` + + // FeaturedChannelsTitle: Title for the featured channels tab. + FeaturedChannelsTitle string `json:"featuredChannelsTitle,omitempty"` + + // FeaturedChannelsUrls: The list of featured channels. + FeaturedChannelsUrls []string `json:"featuredChannelsUrls,omitempty"` + + // Keywords: Lists keywords associated with the channel, + // comma-separated. + Keywords string `json:"keywords,omitempty"` + + // ModerateComments: Whether user-submitted comments left on the channel + // page need to be approved by the channel owner to be publicly visible. + ModerateComments bool `json:"moderateComments,omitempty"` + + // ProfileColor: A prominent color that can be rendered on this channel + // page. + ProfileColor string `json:"profileColor,omitempty"` + + // ShowBrowseView: Whether the tab to browse the videos should be + // displayed. + ShowBrowseView bool `json:"showBrowseView,omitempty"` + + // ShowRelatedChannels: Whether related channels should be proposed. + ShowRelatedChannels bool `json:"showRelatedChannels,omitempty"` + + // Title: Specifies the channel title. + Title string `json:"title,omitempty"` + + // TrackingAnalyticsAccountId: The ID for a Google Analytics account to + // track and measure traffic to the channels. + TrackingAnalyticsAccountId string `json:"trackingAnalyticsAccountId,omitempty"` + + // UnsubscribedTrailer: The trailer of the channel, for users that are + // not subscribers. + UnsubscribedTrailer string `json:"unsubscribedTrailer,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Country") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSettings) MarshalJSON() ([]byte, error) { + type noMethod ChannelSettings + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelSnippet: Basic details about a channel, including title, +// description and thumbnails. Next available id: 15. +type ChannelSnippet struct { + // Country: The country of the channel. + Country string `json:"country,omitempty"` + + // CustomUrl: The custom url of the channel. + CustomUrl string `json:"customUrl,omitempty"` + + // DefaultLanguage: The language of the channel's default title and + // description. + DefaultLanguage string `json:"defaultLanguage,omitempty"` + + // Description: The description of the channel. + Description string `json:"description,omitempty"` + + // Localized: Localized title and description, read-only. + Localized *ChannelLocalization `json:"localized,omitempty"` + + // PublishedAt: The date and time that the channel was created. The + // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the channel. + // For each object in the map, the key is the name of the thumbnail + // image, and the value is an object that contains other information + // about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The channel's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Country") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Country") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelSnippet) MarshalJSON() ([]byte, error) { + type noMethod ChannelSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelStatistics: Statistics about a channel: number of subscribers, +// number of videos in the channel, etc. +type ChannelStatistics struct { + // CommentCount: The number of comments for the channel. + CommentCount uint64 `json:"commentCount,omitempty,string"` + + // HiddenSubscriberCount: Whether or not the number of subscribers is + // shown for this user. + HiddenSubscriberCount bool `json:"hiddenSubscriberCount,omitempty"` + + // SubscriberCount: The number of subscribers that the channel has. + SubscriberCount uint64 `json:"subscriberCount,omitempty,string"` + + // VideoCount: The number of videos uploaded to the channel. + VideoCount uint64 `json:"videoCount,omitempty,string"` + + // ViewCount: The number of times the channel has been viewed. + ViewCount uint64 `json:"viewCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "CommentCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CommentCount") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelStatistics) MarshalJSON() ([]byte, error) { + type noMethod ChannelStatistics + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelStatus: JSON template for the status part of a channel. +type ChannelStatus struct { + // IsLinked: If true, then the user is linked to either a YouTube + // username or G+ account. Otherwise, the user doesn't have a public + // YouTube identity. + IsLinked bool `json:"isLinked,omitempty"` + + // LongUploadsStatus: The long uploads status of this channel. See + // + // Possible values: + // "allowed" + // "disallowed" + // "eligible" + // "longUploadsUnspecified" + LongUploadsStatus string `json:"longUploadsStatus,omitempty"` + + // PrivacyStatus: Privacy status of the channel. + // + // Possible values: + // "private" + // "public" + // "unlisted" + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "IsLinked") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "IsLinked") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ChannelStatus) MarshalJSON() ([]byte, error) { + type noMethod ChannelStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ChannelTopicDetails: Freebase topic information related to the +// channel. +type ChannelTopicDetails struct { + // TopicCategories: A list of Wikipedia URLs that describe the channel's + // content. + TopicCategories []string `json:"topicCategories,omitempty"` + + // TopicIds: A list of Freebase topic IDs associated with the channel. + // You can retrieve information about each topic using the Freebase + // Topic API. + TopicIds []string `json:"topicIds,omitempty"` + + // ForceSendFields is a list of field names (e.g. "TopicCategories") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "TopicCategories") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ChannelTopicDetails) MarshalJSON() ([]byte, error) { + type noMethod ChannelTopicDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Comment: A comment represents a single YouTube comment. +type Comment struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the comment. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#comment". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the comment. + Snippet *CommentSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *Comment) MarshalJSON() ([]byte, error) { + type noMethod Comment + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type CommentListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of comments that match the request criteria. + Items []*Comment `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#commentListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CommentListResponse) MarshalJSON() ([]byte, error) { + type noMethod CommentListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CommentSnippet: Basic details about a comment, such as its author and +// text. +type CommentSnippet struct { + // AuthorChannelId: The id of the author's YouTube channel, if any. + AuthorChannelId interface{} `json:"authorChannelId,omitempty"` + + // AuthorChannelUrl: Link to the author's YouTube channel, if any. + AuthorChannelUrl string `json:"authorChannelUrl,omitempty"` + + // AuthorDisplayName: The name of the user who posted the comment. + AuthorDisplayName string `json:"authorDisplayName,omitempty"` + + // AuthorProfileImageUrl: The URL for the avatar of the user who posted + // the comment. + AuthorProfileImageUrl string `json:"authorProfileImageUrl,omitempty"` + + // CanRate: Whether the current viewer can rate this comment. + CanRate bool `json:"canRate,omitempty"` + + // ChannelId: The id of the corresponding YouTube channel. In case of a + // channel comment this is the channel the comment refers to. In case of + // a video comment it's the video's channel. + ChannelId string `json:"channelId,omitempty"` + + // LikeCount: The total number of likes this comment has received. + LikeCount int64 `json:"likeCount,omitempty"` + + // ModerationStatus: The comment's moderation status. Will not be set if + // the comments were requested through the id filter. + // + // Possible values: + // "heldForReview" + // "likelySpam" + // "published" + // "rejected" + ModerationStatus string `json:"moderationStatus,omitempty"` + + // ParentId: The unique id of the parent comment, only set for replies. + ParentId string `json:"parentId,omitempty"` + + // PublishedAt: The date and time when the comment was orignally + // published. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // TextDisplay: The comment's text. The format is either plain text or + // HTML dependent on what has been requested. Even the plain text + // representation may differ from the text originally posted in that it + // may replace video links with video titles etc. + TextDisplay string `json:"textDisplay,omitempty"` + + // TextOriginal: The comment's original raw text as initially posted or + // last updated. The original text will only be returned if it is + // accessible to the viewer, which is only guaranteed if the viewer is + // the comment's author. + TextOriginal string `json:"textOriginal,omitempty"` + + // UpdatedAt: The date and time when was last updated . The value is + // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + UpdatedAt string `json:"updatedAt,omitempty"` + + // VideoId: The ID of the video the comment refers to, if any. + VideoId string `json:"videoId,omitempty"` + + // ViewerRating: The rating the viewer has given to this comment. For + // the time being this will never return RATE_TYPE_DISLIKE and instead + // return RATE_TYPE_NONE. This may change in the future. + // + // Possible values: + // "dislike" + // "like" + // "none" + // "unspecified" + ViewerRating string `json:"viewerRating,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AuthorChannelId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *CommentSnippet) MarshalJSON() ([]byte, error) { + type noMethod CommentSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CommentThread: A comment thread represents information that applies +// to a top level comment and all its replies. It can also include the +// top level comment itself and some of the replies. +type CommentThread struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the comment thread. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#commentThread". + Kind string `json:"kind,omitempty"` + + // Replies: The replies object contains a limited number of replies (if + // any) to the top level comment found in the snippet. + Replies *CommentThreadReplies `json:"replies,omitempty"` + + // Snippet: The snippet object contains basic details about the comment + // thread and also the top level comment. + Snippet *CommentThreadSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CommentThread) MarshalJSON() ([]byte, error) { + type noMethod CommentThread + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type CommentThreadListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of comment threads that match the request criteria. + Items []*CommentThread `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#commentThreadListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CommentThreadListResponse) MarshalJSON() ([]byte, error) { + type noMethod CommentThreadListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CommentThreadReplies: Comments written in (direct or indirect) reply +// to the top level comment. +type CommentThreadReplies struct { + // Comments: A limited number of replies. Unless the number of replies + // returned equals total_reply_count in the snippet the returned replies + // are only a subset of the total number of replies. + Comments []*Comment `json:"comments,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Comments") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Comments") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CommentThreadReplies) MarshalJSON() ([]byte, error) { + type noMethod CommentThreadReplies + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// CommentThreadSnippet: Basic details about a comment thread. +type CommentThreadSnippet struct { + // CanReply: Whether the current viewer of the thread can reply to it. + // This is viewer specific - other viewers may see a different value for + // this field. + CanReply bool `json:"canReply,omitempty"` + + // ChannelId: The YouTube channel the comments in the thread refer to or + // the channel with the video the comments refer to. If video_id isn't + // set the comments refer to the channel itself. + ChannelId string `json:"channelId,omitempty"` + + // IsPublic: Whether the thread (and therefore all its comments) is + // visible to all YouTube users. + IsPublic bool `json:"isPublic,omitempty"` + + // TopLevelComment: The top level comment of this thread. + TopLevelComment *Comment `json:"topLevelComment,omitempty"` + + // TotalReplyCount: The total number of replies (not including the top + // level comment). + TotalReplyCount int64 `json:"totalReplyCount,omitempty"` + + // VideoId: The ID of the video the comments refer to, if any. No + // video_id implies a channel discussion comment. + VideoId string `json:"videoId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CanReply") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CanReply") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *CommentThreadSnippet) MarshalJSON() ([]byte, error) { + type noMethod CommentThreadSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ContentRating: Ratings schemes. The country-specific ratings are +// mostly for movies and shows. NEXT_ID: 69 +type ContentRating struct { + // AcbRating: The video's Australian Classification Board (ACB) or + // Australian Communications and Media Authority (ACMA) rating. ACMA + // ratings are used to classify children's television programming. + // + // Possible values: + // "acbC" + // "acbE" + // "acbG" + // "acbM" + // "acbMa15plus" + // "acbP" + // "acbPg" + // "acbR18plus" + // "acbUnrated" + AcbRating string `json:"acbRating,omitempty"` + + // AgcomRating: The video's rating from Italy's Autorità per le + // Garanzie nelle Comunicazioni (AGCOM). + // + // Possible values: + // "agcomT" + // "agcomUnrated" + // "agcomVm14" + // "agcomVm18" + AgcomRating string `json:"agcomRating,omitempty"` + + // AnatelRating: The video's Anatel (Asociación Nacional de + // Televisión) rating for Chilean television. + // + // Possible values: + // "anatelA" + // "anatelF" + // "anatelI" + // "anatelI10" + // "anatelI12" + // "anatelI7" + // "anatelR" + // "anatelUnrated" + AnatelRating string `json:"anatelRating,omitempty"` + + // BbfcRating: The video's British Board of Film Classification (BBFC) + // rating. + // + // Possible values: + // "bbfc12" + // "bbfc12a" + // "bbfc15" + // "bbfc18" + // "bbfcPg" + // "bbfcR18" + // "bbfcU" + // "bbfcUnrated" + BbfcRating string `json:"bbfcRating,omitempty"` + + // BfvcRating: The video's rating from Thailand's Board of Film and + // Video Censors. + // + // Possible values: + // "bfvc13" + // "bfvc15" + // "bfvc18" + // "bfvc20" + // "bfvcB" + // "bfvcE" + // "bfvcG" + // "bfvcUnrated" + BfvcRating string `json:"bfvcRating,omitempty"` + + // BmukkRating: The video's rating from the Austrian Board of Media + // Classification (Bundesministerium für Unterricht, Kunst und Kultur). + // + // Possible values: + // "bmukk10" + // "bmukk12" + // "bmukk14" + // "bmukk16" + // "bmukk6" + // "bmukk8" + // "bmukkAa" + // "bmukkUnrated" + BmukkRating string `json:"bmukkRating,omitempty"` + + // CatvRating: Rating system for Canadian TV - Canadian TV + // Classification System The video's rating from the Canadian + // Radio-Television and Telecommunications Commission (CRTC) for + // Canadian English-language broadcasts. For more information, see the + // Canadian Broadcast Standards Council website. + // + // Possible values: + // "catv14plus" + // "catv18plus" + // "catvC" + // "catvC8" + // "catvG" + // "catvPg" + // "catvUnrated" + CatvRating string `json:"catvRating,omitempty"` + + // CatvfrRating: The video's rating from the Canadian Radio-Television + // and Telecommunications Commission (CRTC) for Canadian French-language + // broadcasts. For more information, see the Canadian Broadcast + // Standards Council website. + // + // Possible values: + // "catvfr13plus" + // "catvfr16plus" + // "catvfr18plus" + // "catvfr8plus" + // "catvfrG" + // "catvfrUnrated" + CatvfrRating string `json:"catvfrRating,omitempty"` + + // CbfcRating: The video's Central Board of Film Certification (CBFC - + // India) rating. + // + // Possible values: + // "cbfcA" + // "cbfcS" + // "cbfcU" + // "cbfcUA" + // "cbfcUnrated" + CbfcRating string `json:"cbfcRating,omitempty"` + + // CccRating: The video's Consejo de Calificación Cinematográfica + // (Chile) rating. + // + // Possible values: + // "ccc14" + // "ccc18" + // "ccc18s" + // "ccc18v" + // "ccc6" + // "cccTe" + // "cccUnrated" + CccRating string `json:"cccRating,omitempty"` + + // CceRating: The video's rating from Portugal's Comissão de + // Classificação de Espect´culos. + // + // Possible values: + // "cceM12" + // "cceM14" + // "cceM16" + // "cceM18" + // "cceM4" + // "cceM6" + // "cceUnrated" + CceRating string `json:"cceRating,omitempty"` + + // ChfilmRating: The video's rating in Switzerland. + // + // Possible values: + // "chfilm0" + // "chfilm12" + // "chfilm16" + // "chfilm18" + // "chfilm6" + // "chfilmUnrated" + ChfilmRating string `json:"chfilmRating,omitempty"` + + // ChvrsRating: The video's Canadian Home Video Rating System (CHVRS) + // rating. + // + // Possible values: + // "chvrs14a" + // "chvrs18a" + // "chvrsE" + // "chvrsG" + // "chvrsPg" + // "chvrsR" + // "chvrsUnrated" + ChvrsRating string `json:"chvrsRating,omitempty"` + + // CicfRating: The video's rating from the Commission de Contrôle des + // Films (Belgium). + // + // Possible values: + // "cicfE" + // "cicfKntEna" + // "cicfKtEa" + // "cicfUnrated" + CicfRating string `json:"cicfRating,omitempty"` + + // CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL + // AUDIOVIZUALULUI (CNA). + // + // Possible values: + // "cna12" + // "cna15" + // "cna18" + // "cna18plus" + // "cnaAp" + // "cnaUnrated" + CnaRating string `json:"cnaRating,omitempty"` + + // CncRating: Rating system in France - Commission de classification + // cinematographique + // + // Possible values: + // "cnc10" + // "cnc12" + // "cnc16" + // "cnc18" + // "cncE" + // "cncT" + // "cncUnrated" + CncRating string `json:"cncRating,omitempty"` + + // CsaRating: The video's rating from France's Conseil supérieur de + // l?audiovisuel, which rates broadcast content. + // + // Possible values: + // "csa10" + // "csa12" + // "csa16" + // "csa18" + // "csaInterdiction" + // "csaT" + // "csaUnrated" + CsaRating string `json:"csaRating,omitempty"` + + // CscfRating: The video's rating from Luxembourg's Commission de + // surveillance de la classification des films (CSCF). + // + // Possible values: + // "cscf12" + // "cscf16" + // "cscf18" + // "cscf6" + // "cscf9" + // "cscfA" + // "cscfAl" + // "cscfUnrated" + CscfRating string `json:"cscfRating,omitempty"` + + // CzfilmRating: The video's rating in the Czech Republic. + // + // Possible values: + // "czfilm12" + // "czfilm14" + // "czfilm18" + // "czfilmU" + // "czfilmUnrated" + CzfilmRating string `json:"czfilmRating,omitempty"` + + // DjctqRating: The video's Departamento de Justiça, Classificação, + // Qualificação e Títulos (DJCQT - Brazil) rating. + // + // Possible values: + // "djctq10" + // "djctq12" + // "djctq14" + // "djctq16" + // "djctq18" + // "djctqL" + // "djctqUnrated" + DjctqRating string `json:"djctqRating,omitempty"` + + // DjctqRatingReasons: Reasons that explain why the video received its + // DJCQT (Brazil) rating. + // + // Possible values: + // "djctqCriminalActs" + // "djctqDrugs" + // "djctqExplicitSex" + // "djctqExtremeViolence" + // "djctqIllegalDrugs" + // "djctqImpactingContent" + // "djctqInappropriateLanguage" + // "djctqLegalDrugs" + // "djctqNudity" + // "djctqSex" + // "djctqSexualContent" + // "djctqViolence" + DjctqRatingReasons []string `json:"djctqRatingReasons,omitempty"` + + // EcbmctRating: Rating system in Turkey - Evaluation and Classification + // Board of the Ministry of Culture and Tourism + // + // Possible values: + // "ecbmct13a" + // "ecbmct13plus" + // "ecbmct15a" + // "ecbmct15plus" + // "ecbmct18plus" + // "ecbmct7a" + // "ecbmct7plus" + // "ecbmctG" + // "ecbmctUnrated" + EcbmctRating string `json:"ecbmctRating,omitempty"` + + // EefilmRating: The video's rating in Estonia. + // + // Possible values: + // "eefilmK12" + // "eefilmK14" + // "eefilmK16" + // "eefilmK6" + // "eefilmL" + // "eefilmMs12" + // "eefilmMs6" + // "eefilmPere" + // "eefilmUnrated" + EefilmRating string `json:"eefilmRating,omitempty"` + + // EgfilmRating: The video's rating in Egypt. + // + // Possible values: + // "egfilm18" + // "egfilmBn" + // "egfilmGn" + // "egfilmUnrated" + EgfilmRating string `json:"egfilmRating,omitempty"` + + // EirinRating: The video's Eirin (映倫) rating. Eirin is the Japanese + // rating system. + // + // Possible values: + // "eirinG" + // "eirinPg12" + // "eirinR15plus" + // "eirinR18plus" + // "eirinUnrated" + EirinRating string `json:"eirinRating,omitempty"` + + // FcbmRating: The video's rating from Malaysia's Film Censorship Board. + // + // Possible values: + // "fcbm18" + // "fcbm18pa" + // "fcbm18pl" + // "fcbm18sg" + // "fcbm18sx" + // "fcbmP13" + // "fcbmPg13" + // "fcbmU" + // "fcbmUnrated" + FcbmRating string `json:"fcbmRating,omitempty"` + + // FcoRating: The video's rating from Hong Kong's Office for Film, + // Newspaper and Article Administration. + // + // Possible values: + // "fcoI" + // "fcoIi" + // "fcoIia" + // "fcoIib" + // "fcoIii" + // "fcoUnrated" + FcoRating string `json:"fcoRating,omitempty"` + + // FmocRating: This property has been deprecated. Use the + // contentDetails.contentRating.cncRating instead. + // + // Possible values: + // "fmoc10" + // "fmoc12" + // "fmoc16" + // "fmoc18" + // "fmocE" + // "fmocU" + // "fmocUnrated" + FmocRating string `json:"fmocRating,omitempty"` + + // FpbRating: The video's rating from South Africa's Film and + // Publication Board. + // + // Possible values: + // "fpb10" + // "fpb1012Pg" + // "fpb13" + // "fpb16" + // "fpb18" + // "fpb79Pg" + // "fpbA" + // "fpbPg" + // "fpbUnrated" + // "fpbX18" + // "fpbXx" + FpbRating string `json:"fpbRating,omitempty"` + + // FpbRatingReasons: Reasons that explain why the video received its FPB + // (South Africa) rating. + // + // Possible values: + // "fpbBlasphemy" + // "fpbCriminalTechniques" + // "fpbDrugs" + // "fpbHorror" + // "fpbImitativeActsTechniques" + // "fpbLanguage" + // "fpbNudity" + // "fpbPrejudice" + // "fpbSex" + // "fpbSexualViolence" + // "fpbViolence" + FpbRatingReasons []string `json:"fpbRatingReasons,omitempty"` + + // FskRating: The video's Freiwillige Selbstkontrolle der Filmwirtschaft + // (FSK - Germany) rating. + // + // Possible values: + // "fsk0" + // "fsk12" + // "fsk16" + // "fsk18" + // "fsk6" + // "fskUnrated" + FskRating string `json:"fskRating,omitempty"` + + // GrfilmRating: The video's rating in Greece. + // + // Possible values: + // "grfilmE" + // "grfilmK" + // "grfilmK12" + // "grfilmK13" + // "grfilmK15" + // "grfilmK17" + // "grfilmK18" + // "grfilmUnrated" + GrfilmRating string `json:"grfilmRating,omitempty"` + + // IcaaRating: The video's Instituto de la Cinematografía y de las + // Artes Audiovisuales (ICAA - Spain) rating. + // + // Possible values: + // "icaa12" + // "icaa13" + // "icaa16" + // "icaa18" + // "icaa7" + // "icaaApta" + // "icaaUnrated" + // "icaaX" + IcaaRating string `json:"icaaRating,omitempty"` + + // IfcoRating: The video's Irish Film Classification Office (IFCO - + // Ireland) rating. See the IFCO website for more information. + // + // Possible values: + // "ifco12" + // "ifco12a" + // "ifco15" + // "ifco15a" + // "ifco16" + // "ifco18" + // "ifcoG" + // "ifcoPg" + // "ifcoUnrated" + IfcoRating string `json:"ifcoRating,omitempty"` + + // IlfilmRating: The video's rating in Israel. + // + // Possible values: + // "ilfilm12" + // "ilfilm16" + // "ilfilm18" + // "ilfilmAa" + // "ilfilmUnrated" + IlfilmRating string `json:"ilfilmRating,omitempty"` + + // IncaaRating: The video's INCAA (Instituto Nacional de Cine y Artes + // Audiovisuales - Argentina) rating. + // + // Possible values: + // "incaaAtp" + // "incaaC" + // "incaaSam13" + // "incaaSam16" + // "incaaSam18" + // "incaaUnrated" + IncaaRating string `json:"incaaRating,omitempty"` + + // KfcbRating: The video's rating from the Kenya Film Classification + // Board. + // + // Possible values: + // "kfcb16plus" + // "kfcbG" + // "kfcbPg" + // "kfcbR" + // "kfcbUnrated" + KfcbRating string `json:"kfcbRating,omitempty"` + + // KijkwijzerRating: voor de Classificatie van Audiovisuele Media + // (Netherlands). + // + // Possible values: + // "kijkwijzer12" + // "kijkwijzer16" + // "kijkwijzer18" + // "kijkwijzer6" + // "kijkwijzer9" + // "kijkwijzerAl" + // "kijkwijzerUnrated" + KijkwijzerRating string `json:"kijkwijzerRating,omitempty"` + + // KmrbRating: The video's Korea Media Rating Board + // (영상물등급위원회) rating. The KMRB rates videos in South + // Korea. + // + // Possible values: + // "kmrb12plus" + // "kmrb15plus" + // "kmrbAll" + // "kmrbR" + // "kmrbTeenr" + // "kmrbUnrated" + KmrbRating string `json:"kmrbRating,omitempty"` + + // LsfRating: The video's rating from Indonesia's Lembaga Sensor Film. + // + // Possible values: + // "lsf13" + // "lsf17" + // "lsf21" + // "lsfA" + // "lsfBo" + // "lsfD" + // "lsfR" + // "lsfSu" + // "lsfUnrated" + LsfRating string `json:"lsfRating,omitempty"` + + // MccaaRating: The video's rating from Malta's Film Age-Classification + // Board. + // + // Possible values: + // "mccaa12" + // "mccaa12a" + // "mccaa14" + // "mccaa15" + // "mccaa16" + // "mccaa18" + // "mccaaPg" + // "mccaaU" + // "mccaaUnrated" + MccaaRating string `json:"mccaaRating,omitempty"` + + // MccypRating: The video's rating from the Danish Film Institute's (Det + // Danske Filminstitut) Media Council for Children and Young People. + // + // Possible values: + // "mccyp11" + // "mccyp15" + // "mccyp7" + // "mccypA" + // "mccypUnrated" + MccypRating string `json:"mccypRating,omitempty"` + + // McstRating: The video's rating system for Vietnam - MCST + // + // Possible values: + // "mcst0" + // "mcst16plus" + // "mcstC13" + // "mcstC16" + // "mcstC18" + // "mcstGPg" + // "mcstP" + // "mcstUnrated" + McstRating string `json:"mcstRating,omitempty"` + + // MdaRating: The video's rating from Singapore's Media Development + // Authority (MDA) and, specifically, it's Board of Film Censors (BFC). + // + // Possible values: + // "mdaG" + // "mdaM18" + // "mdaNc16" + // "mdaPg" + // "mdaPg13" + // "mdaR21" + // "mdaUnrated" + MdaRating string `json:"mdaRating,omitempty"` + + // MedietilsynetRating: The video's rating from Medietilsynet, the + // Norwegian Media Authority. + // + // Possible values: + // "medietilsynet11" + // "medietilsynet12" + // "medietilsynet15" + // "medietilsynet18" + // "medietilsynet6" + // "medietilsynet7" + // "medietilsynet9" + // "medietilsynetA" + // "medietilsynetUnrated" + MedietilsynetRating string `json:"medietilsynetRating,omitempty"` + + // MekuRating: The video's rating from Finland's Kansallinen + // Audiovisuaalinen Instituutti (National Audiovisual Institute). + // + // Possible values: + // "meku12" + // "meku16" + // "meku18" + // "meku7" + // "mekuS" + // "mekuUnrated" + MekuRating string `json:"mekuRating,omitempty"` + + // MibacRating: The video's rating from the Ministero dei Beni e delle + // Attività Culturali e del Turismo (Italy). + // + // Possible values: + // "mibacT" + // "mibacUnrated" + // "mibacVap" + // "mibacVm12" + // "mibacVm14" + // "mibacVm18" + MibacRating string `json:"mibacRating,omitempty"` + + // MocRating: The video's Ministerio de Cultura (Colombia) rating. + // + // Possible values: + // "moc12" + // "moc15" + // "moc18" + // "moc7" + // "mocBanned" + // "mocE" + // "mocT" + // "mocUnrated" + // "mocX" + MocRating string `json:"mocRating,omitempty"` + + // MoctwRating: The video's rating from Taiwan's Ministry of Culture + // (文化部). + // + // Possible values: + // "moctwG" + // "moctwP" + // "moctwPg" + // "moctwR" + // "moctwR12" + // "moctwR15" + // "moctwUnrated" + MoctwRating string `json:"moctwRating,omitempty"` + + // MpaaRating: The video's Motion Picture Association of America (MPAA) + // rating. + // + // Possible values: + // "mpaaG" + // "mpaaNc17" + // "mpaaPg" + // "mpaaPg13" + // "mpaaR" + // "mpaaUnrated" + MpaaRating string `json:"mpaaRating,omitempty"` + + // MtrcbRating: The video's rating from the Movie and Television Review + // and Classification Board (Philippines). + // + // Possible values: + // "mtrcbG" + // "mtrcbPg" + // "mtrcbR13" + // "mtrcbR16" + // "mtrcbR18" + // "mtrcbUnrated" + // "mtrcbX" + MtrcbRating string `json:"mtrcbRating,omitempty"` + + // NbcRating: The video's rating from the Maldives National Bureau of + // Classification. + // + // Possible values: + // "nbc12plus" + // "nbc15plus" + // "nbc18plus" + // "nbc18plusr" + // "nbcG" + // "nbcPg" + // "nbcPu" + // "nbcUnrated" + NbcRating string `json:"nbcRating,omitempty"` + + // NbcplRating: The video's rating in Poland. + // + // Possible values: + // "nbcpl18plus" + // "nbcplI" + // "nbcplIi" + // "nbcplIii" + // "nbcplIv" + // "nbcplUnrated" + NbcplRating string `json:"nbcplRating,omitempty"` + + // NfrcRating: The video's rating from the Bulgarian National Film + // Center. + // + // Possible values: + // "nfrcA" + // "nfrcB" + // "nfrcC" + // "nfrcD" + // "nfrcUnrated" + // "nfrcX" + NfrcRating string `json:"nfrcRating,omitempty"` + + // NfvcbRating: The video's rating from Nigeria's National Film and + // Video Censors Board. + // + // Possible values: + // "nfvcb12" + // "nfvcb12a" + // "nfvcb15" + // "nfvcb18" + // "nfvcbG" + // "nfvcbPg" + // "nfvcbRe" + // "nfvcbUnrated" + NfvcbRating string `json:"nfvcbRating,omitempty"` + + // NkclvRating: The video's rating from the Nacionãlais Kino centrs + // (National Film Centre of Latvia). + // + // Possible values: + // "nkclv12plus" + // "nkclv18plus" + // "nkclv7plus" + // "nkclvU" + // "nkclvUnrated" + NkclvRating string `json:"nkclvRating,omitempty"` + + // OflcRating: The video's Office of Film and Literature Classification + // (OFLC - New Zealand) rating. + // + // Possible values: + // "oflcG" + // "oflcM" + // "oflcPg" + // "oflcR13" + // "oflcR15" + // "oflcR16" + // "oflcR18" + // "oflcRp13" + // "oflcRp16" + // "oflcUnrated" + OflcRating string `json:"oflcRating,omitempty"` + + // PefilmRating: The video's rating in Peru. + // + // Possible values: + // "pefilm14" + // "pefilm18" + // "pefilmPg" + // "pefilmPt" + // "pefilmUnrated" + PefilmRating string `json:"pefilmRating,omitempty"` + + // RcnofRating: The video's rating from the Hungarian Nemzeti Filmiroda, + // the Rating Committee of the National Office of Film. + // + // Possible values: + // "rcnofI" + // "rcnofIi" + // "rcnofIii" + // "rcnofIv" + // "rcnofUnrated" + // "rcnofV" + // "rcnofVi" + RcnofRating string `json:"rcnofRating,omitempty"` + + // ResorteviolenciaRating: The video's rating in Venezuela. + // + // Possible values: + // "resorteviolenciaA" + // "resorteviolenciaB" + // "resorteviolenciaC" + // "resorteviolenciaD" + // "resorteviolenciaE" + // "resorteviolenciaUnrated" + ResorteviolenciaRating string `json:"resorteviolenciaRating,omitempty"` + + // RtcRating: The video's General Directorate of Radio, Television and + // Cinematography (Mexico) rating. + // + // Possible values: + // "rtcA" + // "rtcAa" + // "rtcB" + // "rtcB15" + // "rtcC" + // "rtcD" + // "rtcUnrated" + RtcRating string `json:"rtcRating,omitempty"` + + // RteRating: The video's rating from Ireland's Raidió Teilifís + // Éireann. + // + // Possible values: + // "rteCh" + // "rteGa" + // "rteMa" + // "rtePs" + // "rteUnrated" + RteRating string `json:"rteRating,omitempty"` + + // RussiaRating: The video's National Film Registry of the Russian + // Federation (MKRF - Russia) rating. + // + // Possible values: + // "russia0" + // "russia12" + // "russia16" + // "russia18" + // "russia6" + // "russiaUnrated" + RussiaRating string `json:"russiaRating,omitempty"` + + // SkfilmRating: The video's rating in Slovakia. + // + // Possible values: + // "skfilmG" + // "skfilmP2" + // "skfilmP5" + // "skfilmP8" + // "skfilmUnrated" + SkfilmRating string `json:"skfilmRating,omitempty"` + + // SmaisRating: The video's rating in Iceland. + // + // Possible values: + // "smais12" + // "smais14" + // "smais16" + // "smais18" + // "smais7" + // "smaisL" + // "smaisUnrated" + SmaisRating string `json:"smaisRating,omitempty"` + + // SmsaRating: The video's rating from Statens medieråd (Sweden's + // National Media Council). + // + // Possible values: + // "smsa11" + // "smsa15" + // "smsa7" + // "smsaA" + // "smsaUnrated" + SmsaRating string `json:"smsaRating,omitempty"` + + // TvpgRating: The video's TV Parental Guidelines (TVPG) rating. + // + // Possible values: + // "pg14" + // "tvpgG" + // "tvpgMa" + // "tvpgPg" + // "tvpgUnrated" + // "tvpgY" + // "tvpgY7" + // "tvpgY7Fv" + TvpgRating string `json:"tvpgRating,omitempty"` + + // YtRating: A rating that YouTube uses to identify age-restricted + // content. + // + // Possible values: + // "ytAgeRestricted" + YtRating string `json:"ytRating,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AcbRating") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AcbRating") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *ContentRating) MarshalJSON() ([]byte, error) { + type noMethod ContentRating + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// FanFundingEvent: A fanFundingEvent resource represents a fan funding +// event on a YouTube channel. Fan funding events occur when a user +// gives one-time monetary support to the channel owner. +type FanFundingEvent struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the fan funding + // event. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#fanFundingEvent". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the fan + // funding event. + Snippet *FanFundingEventSnippet `json:"snippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FanFundingEvent) MarshalJSON() ([]byte, error) { + type noMethod FanFundingEvent + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type FanFundingEventListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of fan funding events that match the request criteria. + Items []*FanFundingEvent `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#fanFundingEventListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FanFundingEventListResponse) MarshalJSON() ([]byte, error) { + type noMethod FanFundingEventListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type FanFundingEventSnippet struct { + // AmountMicros: The amount of funding in micros of fund_currency. e.g., + // 1 is represented + AmountMicros uint64 `json:"amountMicros,omitempty,string"` + + // ChannelId: Channel id where the funding event occurred. + ChannelId string `json:"channelId,omitempty"` + + // CommentText: The text contents of the comment left by the user. + CommentText string `json:"commentText,omitempty"` + + // CreatedAt: The date and time when the funding occurred. The value is + // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + CreatedAt string `json:"createdAt,omitempty"` + + // Currency: The currency in which the fund was made. ISO 4217. + Currency string `json:"currency,omitempty"` + + // DisplayString: A rendered string that displays the fund amount and + // currency (e.g., "$1.00"). The string is rendered for the given + // language. + DisplayString string `json:"displayString,omitempty"` + + // SupporterDetails: Details about the supporter. Only filled if the + // event was made public by the user. + SupporterDetails *ChannelProfileDetails `json:"supporterDetails,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AmountMicros") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AmountMicros") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *FanFundingEventSnippet) MarshalJSON() ([]byte, error) { + type noMethod FanFundingEventSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GeoPoint: Geographical coordinates of a point, in WGS84. +type GeoPoint struct { + // Altitude: Altitude above the reference ellipsoid, in meters. + Altitude float64 `json:"altitude,omitempty"` + + // Latitude: Latitude in degrees. + Latitude float64 `json:"latitude,omitempty"` + + // Longitude: Longitude in degrees. + Longitude float64 `json:"longitude,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Altitude") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Altitude") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GeoPoint) MarshalJSON() ([]byte, error) { + type noMethod GeoPoint + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +func (s *GeoPoint) UnmarshalJSON(data []byte) error { + type noMethod GeoPoint + var s1 struct { + Altitude gensupport.JSONFloat64 `json:"altitude"` + Latitude gensupport.JSONFloat64 `json:"latitude"` + Longitude gensupport.JSONFloat64 `json:"longitude"` + *noMethod + } + s1.noMethod = (*noMethod)(s) + if err := json.Unmarshal(data, &s1); err != nil { + return err + } + s.Altitude = float64(s1.Altitude) + s.Latitude = float64(s1.Latitude) + s.Longitude = float64(s1.Longitude) + return nil +} + +// GuideCategory: A guideCategory resource identifies a category that +// YouTube algorithmically assigns based on a channel's content or other +// indicators, such as the channel's popularity. The list is similar to +// video categories, with the difference being that a video's uploader +// can assign a video category but only YouTube can assign a channel +// category. +type GuideCategory struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the guide category. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#guideCategory". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the + // category, such as its title. + Snippet *GuideCategorySnippet `json:"snippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GuideCategory) MarshalJSON() ([]byte, error) { + type noMethod GuideCategory + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type GuideCategoryListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of categories that can be associated with YouTube + // channels. In this map, the category ID is the map key, and its value + // is the corresponding guideCategory resource. + Items []*GuideCategory `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#guideCategoryListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GuideCategoryListResponse) MarshalJSON() ([]byte, error) { + type noMethod GuideCategoryListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// GuideCategorySnippet: Basic details about a guide category. +type GuideCategorySnippet struct { + ChannelId string `json:"channelId,omitempty"` + + // Title: Description of the guide category. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *GuideCategorySnippet) MarshalJSON() ([]byte, error) { + type noMethod GuideCategorySnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// I18nLanguage: An i18nLanguage resource identifies a UI language +// currently supported by YouTube. +type I18nLanguage struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the i18n language. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nLanguage". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the i18n + // language, such as language code and human-readable name. + Snippet *I18nLanguageSnippet `json:"snippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *I18nLanguage) MarshalJSON() ([]byte, error) { + type noMethod I18nLanguage + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type I18nLanguageListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of supported i18n languages. In this map, the i18n + // language ID is the map key, and its value is the corresponding + // i18nLanguage resource. + Items []*I18nLanguage `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nLanguageListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *I18nLanguageListResponse) MarshalJSON() ([]byte, error) { + type noMethod I18nLanguageListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// I18nLanguageSnippet: Basic details about an i18n language, such as +// language code and human-readable name. +type I18nLanguageSnippet struct { + // Hl: A short BCP-47 code that uniquely identifies a language. + Hl string `json:"hl,omitempty"` + + // Name: The human-readable name of the language in the language itself. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Hl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Hl") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *I18nLanguageSnippet) MarshalJSON() ([]byte, error) { + type noMethod I18nLanguageSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// I18nRegion: A i18nRegion resource identifies a region where YouTube +// is available. +type I18nRegion struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the i18n region. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nRegion". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the i18n + // region, such as region code and human-readable name. + Snippet *I18nRegionSnippet `json:"snippet,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *I18nRegion) MarshalJSON() ([]byte, error) { + type noMethod I18nRegion + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type I18nRegionListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of regions where YouTube is available. In this map, the + // i18n region ID is the map key, and its value is the corresponding + // i18nRegion resource. + Items []*I18nRegion `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#i18nRegionListResponse". + Kind string `json:"kind,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *I18nRegionListResponse) MarshalJSON() ([]byte, error) { + type noMethod I18nRegionListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// I18nRegionSnippet: Basic details about an i18n region, such as region +// code and human-readable name. +type I18nRegionSnippet struct { + // Gl: The region code as a 2-letter ISO country code. + Gl string `json:"gl,omitempty"` + + // Name: The human-readable name of the region. + Name string `json:"name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Gl") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Gl") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *I18nRegionSnippet) MarshalJSON() ([]byte, error) { + type noMethod I18nRegionSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// ImageSettings: Branding properties for images associated with the +// channel. +type ImageSettings struct { + // BackgroundImageUrl: The URL for the background image shown on the + // video watch page. The image should be 1200px by 615px, with a maximum + // file size of 128k. + BackgroundImageUrl *LocalizedProperty `json:"backgroundImageUrl,omitempty"` + + // BannerExternalUrl: This is used only in update requests; if it's set, + // we use this URL to generate all of the above banner URLs. + BannerExternalUrl string `json:"bannerExternalUrl,omitempty"` + + // BannerImageUrl: Banner image. Desktop size (1060x175). + BannerImageUrl string `json:"bannerImageUrl,omitempty"` + + // BannerMobileExtraHdImageUrl: Banner image. Mobile size high + // resolution (1440x395). + BannerMobileExtraHdImageUrl string `json:"bannerMobileExtraHdImageUrl,omitempty"` + + // BannerMobileHdImageUrl: Banner image. Mobile size high resolution + // (1280x360). + BannerMobileHdImageUrl string `json:"bannerMobileHdImageUrl,omitempty"` + + // BannerMobileImageUrl: Banner image. Mobile size (640x175). + BannerMobileImageUrl string `json:"bannerMobileImageUrl,omitempty"` + + // BannerMobileLowImageUrl: Banner image. Mobile size low resolution + // (320x88). + BannerMobileLowImageUrl string `json:"bannerMobileLowImageUrl,omitempty"` + + // BannerMobileMediumHdImageUrl: Banner image. Mobile size medium/high + // resolution (960x263). + BannerMobileMediumHdImageUrl string `json:"bannerMobileMediumHdImageUrl,omitempty"` + + // BannerTabletExtraHdImageUrl: Banner image. Tablet size extra high + // resolution (2560x424). + BannerTabletExtraHdImageUrl string `json:"bannerTabletExtraHdImageUrl,omitempty"` + + // BannerTabletHdImageUrl: Banner image. Tablet size high resolution + // (2276x377). + BannerTabletHdImageUrl string `json:"bannerTabletHdImageUrl,omitempty"` + + // BannerTabletImageUrl: Banner image. Tablet size (1707x283). + BannerTabletImageUrl string `json:"bannerTabletImageUrl,omitempty"` + + // BannerTabletLowImageUrl: Banner image. Tablet size low resolution + // (1138x188). + BannerTabletLowImageUrl string `json:"bannerTabletLowImageUrl,omitempty"` + + // BannerTvHighImageUrl: Banner image. TV size high resolution + // (1920x1080). + BannerTvHighImageUrl string `json:"bannerTvHighImageUrl,omitempty"` + + // BannerTvImageUrl: Banner image. TV size extra high resolution + // (2120x1192). + BannerTvImageUrl string `json:"bannerTvImageUrl,omitempty"` + + // BannerTvLowImageUrl: Banner image. TV size low resolution (854x480). + BannerTvLowImageUrl string `json:"bannerTvLowImageUrl,omitempty"` + + // BannerTvMediumImageUrl: Banner image. TV size medium resolution + // (1280x720). + BannerTvMediumImageUrl string `json:"bannerTvMediumImageUrl,omitempty"` + + // LargeBrandedBannerImageImapScript: The image map script for the large + // banner image. + LargeBrandedBannerImageImapScript *LocalizedProperty `json:"largeBrandedBannerImageImapScript,omitempty"` + + // LargeBrandedBannerImageUrl: The URL for the 854px by 70px image that + // appears below the video player in the expanded video view of the + // video watch page. + LargeBrandedBannerImageUrl *LocalizedProperty `json:"largeBrandedBannerImageUrl,omitempty"` + + // SmallBrandedBannerImageImapScript: The image map script for the small + // banner image. + SmallBrandedBannerImageImapScript *LocalizedProperty `json:"smallBrandedBannerImageImapScript,omitempty"` + + // SmallBrandedBannerImageUrl: The URL for the 640px by 70px banner + // image that appears below the video player in the default view of the + // video watch page. + SmallBrandedBannerImageUrl *LocalizedProperty `json:"smallBrandedBannerImageUrl,omitempty"` + + // TrackingImageUrl: The URL for a 1px by 1px tracking pixel that can be + // used to collect statistics for views of the channel or video pages. + TrackingImageUrl string `json:"trackingImageUrl,omitempty"` + + // WatchIconImageUrl: The URL for the image that appears above the + // top-left corner of the video player. This is a 25-pixel-high image + // with a flexible width that cannot exceed 170 pixels. + WatchIconImageUrl string `json:"watchIconImageUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BackgroundImageUrl") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BackgroundImageUrl") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *ImageSettings) MarshalJSON() ([]byte, error) { + type noMethod ImageSettings + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// IngestionInfo: Describes information necessary for ingesting an RTMP +// or an HTTP stream. +type IngestionInfo struct { + // BackupIngestionAddress: The backup ingestion URL that you should use + // to stream video to YouTube. You have the option of simultaneously + // streaming the content that you are sending to the ingestionAddress to + // this URL. + BackupIngestionAddress string `json:"backupIngestionAddress,omitempty"` + + // IngestionAddress: The primary ingestion URL that you should use to + // stream video to YouTube. You must stream video to this + // URL. + // + // Depending on which application or tool you use to encode your video + // stream, you may need to enter the stream URL and stream name + // separately or you may need to concatenate them in the following + // format: + // + // STREAM_URL/STREAM_NAME + IngestionAddress string `json:"ingestionAddress,omitempty"` + + // StreamName: The HTTP or RTMP stream name that YouTube assigns to the + // video stream. + StreamName string `json:"streamName,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BackupIngestionAddress") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BackupIngestionAddress") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *IngestionInfo) MarshalJSON() ([]byte, error) { + type noMethod IngestionInfo + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type InvideoBranding struct { + ImageBytes string `json:"imageBytes,omitempty"` + + ImageUrl string `json:"imageUrl,omitempty"` + + Position *InvideoPosition `json:"position,omitempty"` + + TargetChannelId string `json:"targetChannelId,omitempty"` + + Timing *InvideoTiming `json:"timing,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ImageBytes") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ImageBytes") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *InvideoBranding) MarshalJSON() ([]byte, error) { + type noMethod InvideoBranding + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// InvideoPosition: Describes the spatial position of a visual widget +// inside a video. It is a union of various position types, out of which +// only will be set one. +type InvideoPosition struct { + // CornerPosition: Describes in which corner of the video the visual + // widget will appear. + // + // Possible values: + // "bottomLeft" + // "bottomRight" + // "topLeft" + // "topRight" + CornerPosition string `json:"cornerPosition,omitempty"` + + // Type: Defines the position type. + // + // Possible values: + // "corner" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "CornerPosition") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "CornerPosition") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *InvideoPosition) MarshalJSON() ([]byte, error) { + type noMethod InvideoPosition + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// InvideoPromotion: Describes an invideo promotion campaign consisting +// of multiple promoted items. A campaign belongs to a single +// channel_id. +type InvideoPromotion struct { + // DefaultTiming: The default temporal position within the video where + // the promoted item will be displayed. Can be overriden by more + // specific timing in the item. + DefaultTiming *InvideoTiming `json:"defaultTiming,omitempty"` + + // Items: List of promoted items in decreasing priority. + Items []*PromotedItem `json:"items,omitempty"` + + // Position: The spatial position within the video where the promoted + // item will be displayed. + Position *InvideoPosition `json:"position,omitempty"` + + // UseSmartTiming: Indicates whether the channel's promotional campaign + // uses "smart timing." This feature attempts to show promotions at a + // point in the video when they are more likely to be clicked and less + // likely to disrupt the viewing experience. This feature also picks up + // a single promotion to show on each video. + UseSmartTiming bool `json:"useSmartTiming,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultTiming") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DefaultTiming") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *InvideoPromotion) MarshalJSON() ([]byte, error) { + type noMethod InvideoPromotion + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// InvideoTiming: Describes a temporal position of a visual widget +// inside a video. +type InvideoTiming struct { + // DurationMs: Defines the duration in milliseconds for which the + // promotion should be displayed. If missing, the client should use the + // default. + DurationMs uint64 `json:"durationMs,omitempty,string"` + + // OffsetMs: Defines the time at which the promotion will appear. + // Depending on the value of type the value of the offsetMs field will + // represent a time offset from the start or from the end of the video, + // expressed in milliseconds. + OffsetMs uint64 `json:"offsetMs,omitempty,string"` + + // Type: Describes a timing type. If the value is offsetFromStart, then + // the offsetMs field represents an offset from the start of the video. + // If the value is offsetFromEnd, then the offsetMs field represents an + // offset from the end of the video. + // + // Possible values: + // "offsetFromEnd" + // "offsetFromStart" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DurationMs") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DurationMs") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *InvideoTiming) MarshalJSON() ([]byte, error) { + type noMethod InvideoTiming + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LanguageTag struct { + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Value") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Value") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LanguageTag) MarshalJSON() ([]byte, error) { + type noMethod LanguageTag + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveBroadcast: A liveBroadcast resource represents an event that will +// be streamed, via live video, on YouTube. +type LiveBroadcast struct { + // ContentDetails: The contentDetails object contains information about + // the event's video content, such as whether the content can be shown + // in an embedded video player or if it will be archived and therefore + // available for viewing after the event has concluded. + ContentDetails *LiveBroadcastContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the broadcast. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveBroadcast". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the event, + // including its title, description, start time, and end time. + Snippet *LiveBroadcastSnippet `json:"snippet,omitempty"` + + // Statistics: The statistics object contains info about the event's + // current stats. These include concurrent viewers and total chat count. + // Statistics can change (in either direction) during the lifetime of an + // event. Statistics are only returned while the event is live. + Statistics *LiveBroadcastStatistics `json:"statistics,omitempty"` + + // Status: The status object contains information about the event's + // status. + Status *LiveBroadcastStatus `json:"status,omitempty"` + + TopicDetails *LiveBroadcastTopicDetails `json:"topicDetails,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentDetails") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcast) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcast + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveBroadcastContentDetails: Detailed settings of a broadcast. +type LiveBroadcastContentDetails struct { + // BoundStreamId: This value uniquely identifies the live stream bound + // to the broadcast. + BoundStreamId string `json:"boundStreamId,omitempty"` + + // BoundStreamLastUpdateTimeMs: The date and time that the live stream + // referenced by boundStreamId was last updated. + BoundStreamLastUpdateTimeMs string `json:"boundStreamLastUpdateTimeMs,omitempty"` + + // Possible values: + // "closedCaptionsDisabled" + // "closedCaptionsEmbedded" + // "closedCaptionsHttpPost" + ClosedCaptionsType string `json:"closedCaptionsType,omitempty"` + + // EnableClosedCaptions: This setting indicates whether HTTP POST closed + // captioning is enabled for this broadcast. The ingestion URL of the + // closed captions is returned through the liveStreams API. This is + // mutually exclusive with using the closed_captions_type property, and + // is equivalent to setting closed_captions_type to + // CLOSED_CAPTIONS_HTTP_POST. + EnableClosedCaptions bool `json:"enableClosedCaptions,omitempty"` + + // EnableContentEncryption: This setting indicates whether YouTube + // should enable content encryption for the broadcast. + EnableContentEncryption bool `json:"enableContentEncryption,omitempty"` + + // EnableDvr: This setting determines whether viewers can access DVR + // controls while watching the video. DVR controls enable the viewer to + // control the video playback experience by pausing, rewinding, or fast + // forwarding content. The default value for this property is + // true. + // + // + // + // Important: You must set the value to true and also set the + // enableArchive property's value to true if you want to make playback + // available immediately after the broadcast ends. + EnableDvr bool `json:"enableDvr,omitempty"` + + // EnableEmbed: This setting indicates whether the broadcast video can + // be played in an embedded player. If you choose to archive the video + // (using the enableArchive property), this setting will also apply to + // the archived video. + EnableEmbed bool `json:"enableEmbed,omitempty"` + + // EnableLowLatency: Indicates whether this broadcast has low latency + // enabled. + EnableLowLatency bool `json:"enableLowLatency,omitempty"` + + // MonitorStream: The monitorStream object contains information about + // the monitor stream, which the broadcaster can use to review the event + // content before the broadcast stream is shown publicly. + MonitorStream *MonitorStreamInfo `json:"monitorStream,omitempty"` + + // Projection: The projection format of this broadcast. This defaults to + // rectangular. + // + // Possible values: + // "360" + // "rectangular" + Projection string `json:"projection,omitempty"` + + // RecordFromStart: Automatically start recording after the event goes + // live. The default value for this property is true. + // + // + // + // Important: You must also set the enableDvr property's value to true + // if you want the playback to be available immediately after the + // broadcast ends. If you set this property's value to true but do not + // also set the enableDvr property to true, there may be a delay of + // around one day before the archived video will be available for + // playback. + RecordFromStart bool `json:"recordFromStart,omitempty"` + + // StartWithSlate: This setting indicates whether the broadcast should + // automatically begin with an in-stream slate when you update the + // broadcast's status to live. After updating the status, you then need + // to send a liveCuepoints.insert request that sets the cuepoint's + // eventState to end to remove the in-stream slate and make your + // broadcast stream visible to viewers. + StartWithSlate bool `json:"startWithSlate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BoundStreamId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BoundStreamId") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastContentDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveBroadcastListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of broadcasts that match the request criteria. + Items []*LiveBroadcast `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveBroadcastListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastListResponse) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveBroadcastSnippet struct { + // ActualEndTime: The date and time that the broadcast actually ended. + // This information is only available once the broadcast's state is + // complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + ActualEndTime string `json:"actualEndTime,omitempty"` + + // ActualStartTime: The date and time that the broadcast actually + // started. This information is only available once the broadcast's + // state is live. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + ActualStartTime string `json:"actualStartTime,omitempty"` + + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that is publishing the broadcast. + ChannelId string `json:"channelId,omitempty"` + + // Description: The broadcast's description. As with the title, you can + // set this field by modifying the broadcast resource or by setting the + // description field of the corresponding video resource. + Description string `json:"description,omitempty"` + + IsDefaultBroadcast bool `json:"isDefaultBroadcast,omitempty"` + + // LiveChatId: The id of the live chat for this broadcast. + LiveChatId string `json:"liveChatId,omitempty"` + + // PublishedAt: The date and time that the broadcast was added to + // YouTube's live broadcast schedule. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // ScheduledEndTime: The date and time that the broadcast is scheduled + // to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + ScheduledEndTime string `json:"scheduledEndTime,omitempty"` + + // ScheduledStartTime: The date and time that the broadcast is scheduled + // to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + ScheduledStartTime string `json:"scheduledStartTime,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the broadcast. + // For each nested object in this object, the key is the name of the + // thumbnail image, and the value is an object that contains other + // information about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The broadcast's title. Note that the broadcast represents + // exactly one YouTube video. You can set this field by modifying the + // broadcast resource or by setting the title field of the corresponding + // video resource. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ActualEndTime") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ActualEndTime") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveBroadcastStatistics: Statistics about the live broadcast. These +// represent a snapshot of the values at the time of the request. +// Statistics are only returned for live broadcasts. +type LiveBroadcastStatistics struct { + // ConcurrentViewers: The number of viewers currently watching the + // broadcast. The property and its value will be present if the + // broadcast has current viewers and the broadcast owner has not hidden + // the viewcount for the video. Note that YouTube stops tracking the + // number of concurrent viewers for a broadcast when the broadcast ends. + // So, this property would not identify the number of viewers watching + // an archived video of a live broadcast that already ended. + ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"` + + // TotalChatCount: The total number of live chat messages currently on + // the broadcast. The property and its value will be present if the + // broadcast is public, has the live chat feature enabled, and has at + // least one message. Note that this field will not be filled after the + // broadcast ends. So this property would not identify the number of + // chat messages for an archived video of a completed live broadcast. + TotalChatCount uint64 `json:"totalChatCount,omitempty,string"` + + // ForceSendFields is a list of field names (e.g. "ConcurrentViewers") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ConcurrentViewers") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastStatistics) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastStatistics + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveBroadcastStatus struct { + // LifeCycleStatus: The broadcast's status. The status can be updated + // using the API's liveBroadcasts.transition method. + // + // Possible values: + // "abandoned" + // "complete" + // "completeStarting" + // "created" + // "live" + // "liveStarting" + // "ready" + // "reclaimed" + // "revoked" + // "testStarting" + // "testing" + LifeCycleStatus string `json:"lifeCycleStatus,omitempty"` + + // LiveBroadcastPriority: Priority of the live broadcast event (internal + // state). + // + // Possible values: + // "high" + // "low" + // "normal" + LiveBroadcastPriority string `json:"liveBroadcastPriority,omitempty"` + + // PrivacyStatus: The broadcast's privacy status. Note that the + // broadcast represents exactly one YouTube video, so the privacy + // settings are identical to those supported for videos. In addition, + // you can set this field by modifying the broadcast resource or by + // setting the privacyStatus field of the corresponding video resource. + // + // Possible values: + // "private" + // "public" + // "unlisted" + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // RecordingStatus: The broadcast's recording status. + // + // Possible values: + // "notRecording" + // "recorded" + // "recording" + RecordingStatus string `json:"recordingStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LifeCycleStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LifeCycleStatus") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastStatus) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveBroadcastTopic struct { + // Snippet: Information about the topic matched. + Snippet *LiveBroadcastTopicSnippet `json:"snippet,omitempty"` + + // Type: The type of the topic. + // + // Possible values: + // "videoGame" + Type string `json:"type,omitempty"` + + // Unmatched: If this flag is set it means that we have not been able to + // match the topic title and type provided to a known entity. + Unmatched bool `json:"unmatched,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Snippet") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Snippet") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastTopic) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastTopic + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveBroadcastTopicDetails struct { + Topics []*LiveBroadcastTopic `json:"topics,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Topics") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Topics") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastTopicDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastTopicDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveBroadcastTopicSnippet struct { + // Name: The name of the topic. + Name string `json:"name,omitempty"` + + // ReleaseDate: The date at which the topic was released. Filled for + // types: videoGame + ReleaseDate string `json:"releaseDate,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Name") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Name") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveBroadcastTopicSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveBroadcastTopicSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveChatBan: A liveChatBan resource represents a ban for a YouTube +// live chat. +type LiveChatBan struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the ban. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveChatBan". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the ban. + Snippet *LiveChatBanSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatBan) MarshalJSON() ([]byte, error) { + type noMethod LiveChatBan + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatBanSnippet struct { + // BanDurationSeconds: The duration of a ban, only filled if the ban has + // type TEMPORARY. + BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"` + + BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"` + + // LiveChatId: The chat this ban is pertinent to. + LiveChatId string `json:"liveChatId,omitempty"` + + // Type: The type of ban. + // + // Possible values: + // "permanent" + // "temporary" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BanDurationSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BanDurationSeconds") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatBanSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveChatBanSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatFanFundingEventDetails struct { + // AmountDisplayString: A rendered string that displays the fund amount + // and currency to the user. + AmountDisplayString string `json:"amountDisplayString,omitempty"` + + // AmountMicros: The amount of the fund. + AmountMicros uint64 `json:"amountMicros,omitempty,string"` + + // Currency: The currency in which the fund was made. + Currency string `json:"currency,omitempty"` + + // UserComment: The comment added by the user to this fan funding event. + UserComment string `json:"userComment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AmountDisplayString") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AmountDisplayString") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatFanFundingEventDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatFanFundingEventDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveChatMessage: A liveChatMessage resource represents a chat message +// in a YouTube Live Chat. +type LiveChatMessage struct { + // AuthorDetails: The authorDetails object contains basic details about + // the user that posted this message. + AuthorDetails *LiveChatMessageAuthorDetails `json:"authorDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the message. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveChatMessage". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the message. + Snippet *LiveChatMessageSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "AuthorDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AuthorDetails") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatMessage) MarshalJSON() ([]byte, error) { + type noMethod LiveChatMessage + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatMessageAuthorDetails struct { + // ChannelId: The YouTube channel ID. + ChannelId string `json:"channelId,omitempty"` + + // ChannelUrl: The channel's URL. + ChannelUrl string `json:"channelUrl,omitempty"` + + // DisplayName: The channel's display name. + DisplayName string `json:"displayName,omitempty"` + + // IsChatModerator: Whether the author is a moderator of the live chat. + IsChatModerator bool `json:"isChatModerator,omitempty"` + + // IsChatOwner: Whether the author is the owner of the live chat. + IsChatOwner bool `json:"isChatOwner,omitempty"` + + // IsChatSponsor: Whether the author is a sponsor of the live chat. + IsChatSponsor bool `json:"isChatSponsor,omitempty"` + + // IsVerified: Whether the author's identity has been verified by + // YouTube. + IsVerified bool `json:"isVerified,omitempty"` + + // ProfileImageUrl: The channels's avatar URL. + ProfileImageUrl string `json:"profileImageUrl,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatMessageAuthorDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatMessageAuthorDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatMessageDeletedDetails struct { + DeletedMessageId string `json:"deletedMessageId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DeletedMessageId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "DeletedMessageId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatMessageDeletedDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatMessageDeletedDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatMessageListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of live chat messages. + Items []*LiveChatMessage `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveChatMessageListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + // OfflineAt: The date and time when the underlying stream went offline. + // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + OfflineAt string `json:"offlineAt,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PollingIntervalMillis: The amount of time the client should wait + // before polling again. + PollingIntervalMillis int64 `json:"pollingIntervalMillis,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatMessageListResponse) MarshalJSON() ([]byte, error) { + type noMethod LiveChatMessageListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatMessageRetractedDetails struct { + RetractedMessageId string `json:"retractedMessageId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "RetractedMessageId") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "RetractedMessageId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatMessageRetractedDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatMessageRetractedDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatMessageSnippet struct { + // AuthorChannelId: The ID of the user that authored this message, this + // field is not always filled. textMessageEvent - the user that wrote + // the message fanFundingEvent - the user that funded the broadcast + // newSponsorEvent - the user that just became a sponsor + // messageDeletedEvent - the moderator that took the action + // messageRetractedEvent - the author that retracted their message + // userBannedEvent - the moderator that took the action superChatEvent - + // the user that made the purchase + AuthorChannelId string `json:"authorChannelId,omitempty"` + + // DisplayMessage: Contains a string that can be displayed to the user. + // If this field is not present the message is silent, at the moment + // only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent. + DisplayMessage string `json:"displayMessage,omitempty"` + + // FanFundingEventDetails: Details about the funding event, this is only + // set if the type is 'fanFundingEvent'. + FanFundingEventDetails *LiveChatFanFundingEventDetails `json:"fanFundingEventDetails,omitempty"` + + // HasDisplayContent: Whether the message has display content that + // should be displayed to users. + HasDisplayContent bool `json:"hasDisplayContent,omitempty"` + + LiveChatId string `json:"liveChatId,omitempty"` + + MessageDeletedDetails *LiveChatMessageDeletedDetails `json:"messageDeletedDetails,omitempty"` + + MessageRetractedDetails *LiveChatMessageRetractedDetails `json:"messageRetractedDetails,omitempty"` + + PollClosedDetails *LiveChatPollClosedDetails `json:"pollClosedDetails,omitempty"` + + PollEditedDetails *LiveChatPollEditedDetails `json:"pollEditedDetails,omitempty"` + + PollOpenedDetails *LiveChatPollOpenedDetails `json:"pollOpenedDetails,omitempty"` + + PollVotedDetails *LiveChatPollVotedDetails `json:"pollVotedDetails,omitempty"` + + // PublishedAt: The date and time when the message was orignally + // published. The value is specified in ISO 8601 + // (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // SuperChatDetails: Details about the Super Chat event, this is only + // set if the type is 'superChatEvent'. + SuperChatDetails *LiveChatSuperChatDetails `json:"superChatDetails,omitempty"` + + // TextMessageDetails: Details about the text message, this is only set + // if the type is 'textMessageEvent'. + TextMessageDetails *LiveChatTextMessageDetails `json:"textMessageDetails,omitempty"` + + // Type: The type of message, this will always be present, it determines + // the contents of the message as well as which fields will be present. + // + // Possible values: + // "chatEndedEvent" + // "fanFundingEvent" + // "messageDeletedEvent" + // "messageRetractedEvent" + // "newSponsorEvent" + // "pollClosedEvent" + // "pollEditedEvent" + // "pollOpenedEvent" + // "pollVotedEvent" + // "sponsorOnlyModeEndedEvent" + // "sponsorOnlyModeStartedEvent" + // "superChatEvent" + // "textMessageEvent" + // "tombstone" + // "userBannedEvent" + Type string `json:"type,omitempty"` + + UserBannedDetails *LiveChatUserBannedMessageDetails `json:"userBannedDetails,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AuthorChannelId") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatMessageSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveChatMessageSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveChatModerator: A liveChatModerator resource represents a +// moderator for a YouTube live chat. A chat moderator has the ability +// to ban/unban users from a chat, remove message, etc. +type LiveChatModerator struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the moderator. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveChatModerator". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the + // moderator. + Snippet *LiveChatModeratorSnippet `json:"snippet,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatModerator) MarshalJSON() ([]byte, error) { + type noMethod LiveChatModerator + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatModeratorListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of moderators that match the request criteria. + Items []*LiveChatModerator `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveChatModeratorListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatModeratorListResponse) MarshalJSON() ([]byte, error) { + type noMethod LiveChatModeratorListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatModeratorSnippet struct { + // LiveChatId: The ID of the live chat this moderator can act on. + LiveChatId string `json:"liveChatId,omitempty"` + + // ModeratorDetails: Details about the moderator. + ModeratorDetails *ChannelProfileDetails `json:"moderatorDetails,omitempty"` + + // ForceSendFields is a list of field names (e.g. "LiveChatId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "LiveChatId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatModeratorSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveChatModeratorSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatPollClosedDetails struct { + // PollId: The id of the poll that was closed. + PollId string `json:"pollId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PollId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PollId") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatPollClosedDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatPollClosedDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatPollEditedDetails struct { + Id string `json:"id,omitempty"` + + Items []*LiveChatPollItem `json:"items,omitempty"` + + Prompt string `json:"prompt,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatPollEditedDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatPollEditedDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatPollItem struct { + // Description: Plain text description of the item. + Description string `json:"description,omitempty"` + + ItemId string `json:"itemId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Description") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatPollItem) MarshalJSON() ([]byte, error) { + type noMethod LiveChatPollItem + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatPollOpenedDetails struct { + Id string `json:"id,omitempty"` + + Items []*LiveChatPollItem `json:"items,omitempty"` + + Prompt string `json:"prompt,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Id") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Id") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatPollOpenedDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatPollOpenedDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatPollVotedDetails struct { + // ItemId: The poll item the user chose. + ItemId string `json:"itemId,omitempty"` + + // PollId: The poll the user voted on. + PollId string `json:"pollId,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ItemId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ItemId") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatPollVotedDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatPollVotedDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatSuperChatDetails struct { + // AmountDisplayString: A rendered string that displays the fund amount + // and currency to the user. + AmountDisplayString string `json:"amountDisplayString,omitempty"` + + // AmountMicros: The amount purchased by the user, in micros (1,750,000 + // micros = 1.75). + AmountMicros uint64 `json:"amountMicros,omitempty,string"` + + // Currency: The currency in which the purchase was made. + Currency string `json:"currency,omitempty"` + + // Tier: The tier in which the amount belongs to. Lower amounts belong + // to lower tiers. Starts at 1. + Tier int64 `json:"tier,omitempty"` + + // UserComment: The comment added by the user to this Super Chat event. + UserComment string `json:"userComment,omitempty"` + + // ForceSendFields is a list of field names (e.g. "AmountDisplayString") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "AmountDisplayString") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatSuperChatDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatSuperChatDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatTextMessageDetails struct { + // MessageText: The user's message. + MessageText string `json:"messageText,omitempty"` + + // ForceSendFields is a list of field names (e.g. "MessageText") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "MessageText") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatTextMessageDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatTextMessageDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveChatUserBannedMessageDetails struct { + // BanDurationSeconds: The duration of the ban. This property is only + // present if the banType is temporary. + BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"` + + // BanType: The type of ban. + // + // Possible values: + // "permanent" + // "temporary" + BanType string `json:"banType,omitempty"` + + // BannedUserDetails: The details of the user that was banned. + BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"` + + // ForceSendFields is a list of field names (e.g. "BanDurationSeconds") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BanDurationSeconds") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveChatUserBannedMessageDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveChatUserBannedMessageDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveStream: A live stream describes a live ingestion point. +type LiveStream struct { + // Cdn: The cdn object defines the live stream's content delivery + // network (CDN) settings. These settings provide details about the + // manner in which you stream your content to YouTube. + Cdn *CdnSettings `json:"cdn,omitempty"` + + // ContentDetails: The content_details object contains information about + // the stream, including the closed captions ingestion URL. + ContentDetails *LiveStreamContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube assigns to uniquely identify the stream. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveStream". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the stream, + // including its channel, title, and description. + Snippet *LiveStreamSnippet `json:"snippet,omitempty"` + + // Status: The status object contains information about live stream's + // status. + Status *LiveStreamStatus `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Cdn") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Cdn") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveStream) MarshalJSON() ([]byte, error) { + type noMethod LiveStream + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveStreamConfigurationIssue struct { + // Description: The long-form description of the issue and how to + // resolve it. + Description string `json:"description,omitempty"` + + // Reason: The short-form reason for this issue. + Reason string `json:"reason,omitempty"` + + // Severity: How severe this issue is to the stream. + // + // Possible values: + // "error" + // "info" + // "warning" + Severity string `json:"severity,omitempty"` + + // Type: The kind of error happening. + // + // Possible values: + // "audioBitrateHigh" + // "audioBitrateLow" + // "audioBitrateMismatch" + // "audioCodec" + // "audioCodecMismatch" + // "audioSampleRate" + // "audioSampleRateMismatch" + // "audioStereoMismatch" + // "audioTooManyChannels" + // "badContainer" + // "bitrateHigh" + // "bitrateLow" + // "frameRateHigh" + // "framerateMismatch" + // "gopMismatch" + // "gopSizeLong" + // "gopSizeOver" + // "gopSizeShort" + // "interlacedVideo" + // "multipleAudioStreams" + // "multipleVideoStreams" + // "noAudioStream" + // "noVideoStream" + // "openGop" + // "resolutionMismatch" + // "videoBitrateMismatch" + // "videoCodec" + // "videoCodecMismatch" + // "videoIngestionStarved" + // "videoInterlaceMismatch" + // "videoProfileMismatch" + // "videoResolutionSuboptimal" + // "videoResolutionUnsupported" + Type string `json:"type,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Description") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveStreamConfigurationIssue) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamConfigurationIssue + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveStreamContentDetails: Detailed settings of a stream. +type LiveStreamContentDetails struct { + // ClosedCaptionsIngestionUrl: The ingestion URL where the closed + // captions of this stream are sent. + ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"` + + // IsReusable: Indicates whether the stream is reusable, which means + // that it can be bound to multiple broadcasts. It is common for + // broadcasters to reuse the same stream for many different broadcasts + // if those broadcasts occur at different times. + // + // If you set this value to false, then the stream will not be reusable, + // which means that it can only be bound to one broadcast. Non-reusable + // streams differ from reusable streams in the following ways: + // - A non-reusable stream can only be bound to one broadcast. + // - A non-reusable stream might be deleted by an automated process + // after the broadcast ends. + // - The liveStreams.list method does not list non-reusable streams if + // you call the method and set the mine parameter to true. The only way + // to use that method to retrieve the resource for a non-reusable stream + // is to use the id parameter to identify the stream. + IsReusable bool `json:"isReusable,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "ClosedCaptionsIngestionUrl") to unconditionally include in API + // requests. By default, fields with empty values are omitted from API + // requests. However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. + // "ClosedCaptionsIngestionUrl") to include in API requests with the + // JSON null value. By default, fields with empty values are omitted + // from API requests. However, any field with an empty value appearing + // in NullFields will be sent to the server as null. It is an error if a + // field in this list has a non-empty value. This may be used to include + // null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveStreamContentDetails) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveStreamHealthStatus struct { + // ConfigurationIssues: The configurations issues on this stream + ConfigurationIssues []*LiveStreamConfigurationIssue `json:"configurationIssues,omitempty"` + + // LastUpdateTimeSeconds: The last time this status was updated (in + // seconds) + LastUpdateTimeSeconds uint64 `json:"lastUpdateTimeSeconds,omitempty,string"` + + // Status: The status code of this stream + // + // Possible values: + // "bad" + // "good" + // "noData" + // "ok" + // "revoked" + Status string `json:"status,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ConfigurationIssues") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ConfigurationIssues") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *LiveStreamHealthStatus) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamHealthStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveStreamListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of live streams that match the request criteria. + Items []*LiveStream `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#liveStreamListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveStreamListResponse) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LiveStreamSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the channel + // that is transmitting the stream. + ChannelId string `json:"channelId,omitempty"` + + // Description: The stream's description. The value cannot be longer + // than 10000 characters. + Description string `json:"description,omitempty"` + + IsDefaultStream bool `json:"isDefaultStream,omitempty"` + + // PublishedAt: The date and time that the stream was created. The value + // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + PublishedAt string `json:"publishedAt,omitempty"` + + // Title: The stream's title. The value must be between 1 and 128 + // characters long. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveStreamSnippet) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// LiveStreamStatus: Brief description of the live stream status. +type LiveStreamStatus struct { + // HealthStatus: The health status of the stream. + HealthStatus *LiveStreamHealthStatus `json:"healthStatus,omitempty"` + + // Possible values: + // "active" + // "created" + // "error" + // "inactive" + // "ready" + StreamStatus string `json:"streamStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "HealthStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "HealthStatus") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LiveStreamStatus) MarshalJSON() ([]byte, error) { + type noMethod LiveStreamStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LocalizedProperty struct { + Default string `json:"default,omitempty"` + + // DefaultLanguage: The language of the default property. + DefaultLanguage *LanguageTag `json:"defaultLanguage,omitempty"` + + Localized []*LocalizedString `json:"localized,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Default") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Default") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LocalizedProperty) MarshalJSON() ([]byte, error) { + type noMethod LocalizedProperty + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type LocalizedString struct { + Language string `json:"language,omitempty"` + + Value string `json:"value,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Language") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Language") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *LocalizedString) MarshalJSON() ([]byte, error) { + type noMethod LocalizedString + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// MonitorStreamInfo: Settings and Info of the monitor stream +type MonitorStreamInfo struct { + // BroadcastStreamDelayMs: If you have set the enableMonitorStream + // property to true, then this property determines the length of the + // live broadcast delay. + BroadcastStreamDelayMs int64 `json:"broadcastStreamDelayMs,omitempty"` + + // EmbedHtml: HTML code that embeds a player that plays the monitor + // stream. + EmbedHtml string `json:"embedHtml,omitempty"` + + // EnableMonitorStream: This value determines whether the monitor stream + // is enabled for the broadcast. If the monitor stream is enabled, then + // YouTube will broadcast the event content on a special stream intended + // only for the broadcaster's consumption. The broadcaster can use the + // stream to review the event content and also to identify the optimal + // times to insert cuepoints. + // + // You need to set this value to true if you intend to have a broadcast + // delay for your event. + // + // Note: This property cannot be updated once the broadcast is in the + // testing or live state. + EnableMonitorStream bool `json:"enableMonitorStream,omitempty"` + + // ForceSendFields is a list of field names (e.g. + // "BroadcastStreamDelayMs") to unconditionally include in API requests. + // By default, fields with empty values are omitted from API requests. + // However, any non-pointer, non-interface field appearing in + // ForceSendFields will be sent to the server regardless of whether the + // field is empty or not. This may be used to include empty fields in + // Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "BroadcastStreamDelayMs") + // to include in API requests with the JSON null value. By default, + // fields with empty values are omitted from API requests. However, any + // field with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *MonitorStreamInfo) MarshalJSON() ([]byte, error) { + type noMethod MonitorStreamInfo + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// PageInfo: Paging details for lists of resources, including total +// number of items available and number of resources returned in a +// single page. +type PageInfo struct { + // ResultsPerPage: The number of results included in the API response. + ResultsPerPage int64 `json:"resultsPerPage,omitempty"` + + // TotalResults: The total number of results in the result set. + TotalResults int64 `json:"totalResults,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ResultsPerPage") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ResultsPerPage") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *PageInfo) MarshalJSON() ([]byte, error) { + type noMethod PageInfo + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// Playlist: A playlist resource represents a YouTube playlist. A +// playlist is a collection of videos that can be viewed sequentially +// and shared with other users. A playlist can contain up to 200 videos, +// and YouTube does not limit the number of playlists that each user +// creates. By default, playlists are publicly visible to other users, +// but playlists can be public or private. +// +// YouTube also uses playlists to identify special collections of videos +// for a channel, such as: +// - uploaded videos +// - favorite videos +// - positively rated (liked) videos +// - watch history +// - watch later To be more specific, these lists are associated with a +// channel, which is a collection of a person, group, or company's +// videos, playlists, and other YouTube information. You can retrieve +// the playlist IDs for each of these lists from the channel resource +// for a given channel. +// +// You can then use the playlistItems.list method to retrieve any of +// those lists. You can also add or remove items from those lists by +// calling the playlistItems.insert and playlistItems.delete +// methods. +type Playlist struct { + // ContentDetails: The contentDetails object contains information like + // video count. + ContentDetails *PlaylistContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the playlist. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlist". + Kind string `json:"kind,omitempty"` + + // Localizations: Localizations for different languages + Localizations map[string]PlaylistLocalization `json:"localizations,omitempty"` + + // Player: The player object contains information that you would use to + // play the playlist in an embedded player. + Player *PlaylistPlayer `json:"player,omitempty"` + + // Snippet: The snippet object contains basic details about the + // playlist, such as its title and description. + Snippet *PlaylistSnippet `json:"snippet,omitempty"` + + // Status: The status object contains status information for the + // playlist. + Status *PlaylistStatus `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentDetails") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *Playlist) MarshalJSON() ([]byte, error) { + type noMethod Playlist + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type PlaylistContentDetails struct { + // ItemCount: The number of videos in the playlist. + ItemCount int64 `json:"itemCount,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ItemCount") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ItemCount") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistContentDetails) MarshalJSON() ([]byte, error) { + type noMethod PlaylistContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// PlaylistItem: A playlistItem resource identifies another resource, +// such as a video, that is included in a playlist. In addition, the +// playlistItem resource contains details about the included resource +// that pertain specifically to how that resource is used in that +// playlist. +// +// YouTube uses playlists to identify special collections of videos for +// a channel, such as: +// - uploaded videos +// - favorite videos +// - positively rated (liked) videos +// - watch history +// - watch later To be more specific, these lists are associated with a +// channel, which is a collection of a person, group, or company's +// videos, playlists, and other YouTube information. +// +// You can retrieve the playlist IDs for each of these lists from the +// channel resource for a given channel. You can then use the +// playlistItems.list method to retrieve any of those lists. You can +// also add or remove items from those lists by calling the +// playlistItems.insert and playlistItems.delete methods. For example, +// if a user gives a positive rating to a video, you would insert that +// video into the liked videos playlist for that user's channel. +type PlaylistItem struct { + // ContentDetails: The contentDetails object is included in the resource + // if the included item is a YouTube video. The object contains + // additional information about the video. + ContentDetails *PlaylistItemContentDetails `json:"contentDetails,omitempty"` + + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // Id: The ID that YouTube uses to uniquely identify the playlist item. + Id string `json:"id,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlistItem". + Kind string `json:"kind,omitempty"` + + // Snippet: The snippet object contains basic details about the playlist + // item, such as its title and position in the playlist. + Snippet *PlaylistItemSnippet `json:"snippet,omitempty"` + + // Status: The status object contains information about the playlist + // item's privacy status. + Status *PlaylistItemStatus `json:"status,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "ContentDetails") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ContentDetails") to + // include in API requests with the JSON null value. By default, fields + // with empty values are omitted from API requests. However, any field + // with an empty value appearing in NullFields will be sent to the + // server as null. It is an error if a field in this list has a + // non-empty value. This may be used to include null fields in Patch + // requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistItem) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItem + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type PlaylistItemContentDetails struct { + // EndAt: The time, measured in seconds from the start of the video, + // when the video should stop playing. (The playlist owner can specify + // the times when the video should start and stop playing when the video + // is played in the context of the playlist.) By default, assume that + // the video.endTime is the end of the video. + EndAt string `json:"endAt,omitempty"` + + // Note: A user-generated note for this item. + Note string `json:"note,omitempty"` + + // StartAt: The time, measured in seconds from the start of the video, + // when the video should start playing. (The playlist owner can specify + // the times when the video should start and stop playing when the video + // is played in the context of the playlist.) The default value is 0. + StartAt string `json:"startAt,omitempty"` + + // VideoId: The ID that YouTube uses to uniquely identify a video. To + // retrieve the video resource, set the id query parameter to this value + // in your API request. + VideoId string `json:"videoId,omitempty"` + + // VideoPublishedAt: The date and time that the video was published to + // YouTube. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + VideoPublishedAt string `json:"videoPublishedAt,omitempty"` + + // ForceSendFields is a list of field names (e.g. "EndAt") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "EndAt") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistItemContentDetails) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemContentDetails + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type PlaylistItemListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of playlist items that match the request criteria. + Items []*PlaylistItem `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlistItemListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistItemListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// PlaylistItemSnippet: Basic details about a playlist, including title, +// description and thumbnails. +type PlaylistItemSnippet struct { + // ChannelId: The ID that YouTube uses to uniquely identify the user + // that added the item to the playlist. + ChannelId string `json:"channelId,omitempty"` + + // ChannelTitle: Channel title for the channel that the playlist item + // belongs to. + ChannelTitle string `json:"channelTitle,omitempty"` + + // Description: The item's description. + Description string `json:"description,omitempty"` + + // PlaylistId: The ID that YouTube uses to uniquely identify the + // playlist that the playlist item is in. + PlaylistId string `json:"playlistId,omitempty"` + + // Position: The order in which the item appears in the playlist. The + // value uses a zero-based index, so the first item has a position of 0, + // the second item has a position of 1, and so forth. + Position int64 `json:"position,omitempty"` + + // PublishedAt: The date and time that the item was added to the + // playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) + // format. + PublishedAt string `json:"publishedAt,omitempty"` + + // ResourceId: The id object contains information that can be used to + // uniquely identify the resource that is included in the playlist as + // the playlist item. + ResourceId *ResourceId `json:"resourceId,omitempty"` + + // Thumbnails: A map of thumbnail images associated with the playlist + // item. For each object in the map, the key is the name of the + // thumbnail image, and the value is an object that contains other + // information about the thumbnail. + Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"` + + // Title: The item's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "ChannelId") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "ChannelId") to include in + // API requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistItemSnippet) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemSnippet + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// PlaylistItemStatus: Information about the playlist item's privacy +// status. +type PlaylistItemStatus struct { + // PrivacyStatus: This resource's privacy status. + // + // Possible values: + // "private" + // "public" + // "unlisted" + PrivacyStatus string `json:"privacyStatus,omitempty"` + + // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "PrivacyStatus") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistItemStatus) MarshalJSON() ([]byte, error) { + type noMethod PlaylistItemStatus + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type PlaylistListResponse struct { + // Etag: Etag of this resource. + Etag string `json:"etag,omitempty"` + + // EventId: Serialized EventId of the request which produced this + // response. + EventId string `json:"eventId,omitempty"` + + // Items: A list of playlists that match the request criteria. + Items []*Playlist `json:"items,omitempty"` + + // Kind: Identifies what kind of resource this is. Value: the fixed + // string "youtube#playlistListResponse". + Kind string `json:"kind,omitempty"` + + // NextPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the next page in the result set. + NextPageToken string `json:"nextPageToken,omitempty"` + + PageInfo *PageInfo `json:"pageInfo,omitempty"` + + // PrevPageToken: The token that can be used as the value of the + // pageToken parameter to retrieve the previous page in the result set. + PrevPageToken string `json:"prevPageToken,omitempty"` + + TokenPagination *TokenPagination `json:"tokenPagination,omitempty"` + + // VisitorId: The visitorId identifies the visitor. + VisitorId string `json:"visitorId,omitempty"` + + // ServerResponse contains the HTTP response code and headers from the + // server. + googleapi.ServerResponse `json:"-"` + + // ForceSendFields is a list of field names (e.g. "Etag") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Etag") to include in API + // requests with the JSON null value. By default, fields with empty + // values are omitted from API requests. However, any field with an + // empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistListResponse) MarshalJSON() ([]byte, error) { + type noMethod PlaylistListResponse + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +// PlaylistLocalization: Playlist localization setting +type PlaylistLocalization struct { + // Description: The localized strings for playlist's description. + Description string `json:"description,omitempty"` + + // Title: The localized strings for playlist's title. + Title string `json:"title,omitempty"` + + // ForceSendFields is a list of field names (e.g. "Description") to + // unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` + + // NullFields is a list of field names (e.g. "Description") to include + // in API requests with the JSON null value. By default, fields with + // empty values are omitted from API requests. However, any field with + // an empty value appearing in NullFields will be sent to the server as + // null. It is an error if a field in this list has a non-empty value. + // This may be used to include null fields in Patch requests. + NullFields []string `json:"-"` +} + +func (s *PlaylistLocalization) MarshalJSON() ([]byte, error) { + type noMethod PlaylistLocalization + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) +} + +type PlaylistPlayer struct { + // EmbedHtml: An