Debian Codegraph @

youtube/v3/youtube-gen.go

raw symbols SCIP
1 // Copyright 2026 Google LLC.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // Code generated file. DO NOT EDIT.
6
7 // Package youtube provides access to the YouTube Data API v3.
8 //
9 // For product documentation, see: https://developers.google.com/youtube/
10 //
11 // # Library status
12 //
13 // These client libraries are officially supported by Google. However, this
14 // library is considered complete and is in maintenance mode. This means
15 // that we will address critical bugs and security issues but will not add
16 // any new features.
17 //
18 // When possible, we recommend using our newer
19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
20 // that are still actively being worked and iterated on.
21 //
22 // # Creating a client
23 //
24 // Usage example:
25 //
26 // import "google.golang.org/api/youtube/v3"
27 // ...
28 // ctx := context.Background()
29 // youtubeService, err := youtube.NewService(ctx)
30 //
31 // In this example, Google Application Default Credentials are used for
32 // authentication. For information on how to create and obtain Application
33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
34 //
35 // # Other authentication options
36 //
37 // By default, all available scopes (see "Constants") are used to authenticate.
38 // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
39 //
40 // youtubeService, err := youtube.NewService(ctx, option.WithScopes(youtube.YoutubepartnerChannelAuditScope))
41 //
42 // To use an API key for authentication (note: some APIs do not support API
43 // keys), use [google.golang.org/api/option.WithAPIKey]:
44 //
45 // youtubeService, err := youtube.NewService(ctx, option.WithAPIKey("AIza..."))
46 //
47 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
48 // flow, use [google.golang.org/api/option.WithTokenSource]:
49 //
50 // config := &oauth2.Config{...}
51 // // ...
52 // token, err := config.Exchange(ctx, ...)
53 // youtubeService, err := youtube.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
54 //
55 // See [google.golang.org/api/option.ClientOption] for details on options.
56 package youtube // import "google.golang.org/api/youtube/v3"
57
58 import (
59 "bytes"
60 "context"
61 "encoding/json"
62 "errors"
63 "fmt"
64 "io"
65 "log/slog"
66 "net/http"
67 "net/url"
68 "strconv"
69 "strings"
70
71 "github.com/googleapis/gax-go/v2/internallog"
72 googleapi "google.golang.org/api/googleapi"
73 internal "google.golang.org/api/internal"
74 gensupport "google.golang.org/api/internal/gensupport"
75 option "google.golang.org/api/option"
76 internaloption "google.golang.org/api/option/internaloption"
77 htransport "google.golang.org/api/transport/http"
78 )
79
80 // Always reference these packages, just in case the auto-generated code
81 // below doesn't.
82 var _ = bytes.NewBuffer
83 var _ = strconv.Itoa
84 var _ = fmt.Sprintf
85 var _ = json.NewDecoder
86 var _ = io.Copy
87 var _ = url.Parse
88 var _ = gensupport.MarshalJSON
89 var _ = googleapi.Version
90 var _ = errors.New
91 var _ = strings.Replace
92 var _ = context.Canceled
93 var _ = internaloption.WithDefaultEndpoint
94 var _ = internal.Version
95 var _ = internallog.New
96
97 const apiId = "youtube:v3"
98 const apiName = "youtube"
99 const apiVersion = "v3"
100 const basePath = "https://youtube.googleapis.com/"
101 const basePathTemplate = "https://youtube.UNIVERSE_DOMAIN/"
102 const mtlsBasePath = "https://youtube.mtls.googleapis.com/"
103
104 // OAuth2 scopes used by this API.
105 const (
106 // Manage your YouTube account
107 YoutubeScope = "https://www.googleapis.com/auth/youtube"
108
109 // See a list of your current active channel members, their current level, and
110 // when they became a member
111 YoutubeChannelMembershipsCreatorScope = "https://www.googleapis.com/auth/youtube.channel-memberships.creator"
112
113 // See, edit, and permanently delete your YouTube videos, ratings, comments and
114 // captions
115 YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl"
116
117 // View your YouTube account
118 YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly"
119
120 // Manage your YouTube videos
121 YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload"
122
123 // View and manage your assets and associated content on YouTube
124 YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner"
125
126 // View private information of your YouTube channel relevant during the audit
127 // process with a YouTube partner
128 YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit"
129 )
130
131 // NewService creates a new Service.
132 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
133 scopesOption := internaloption.WithDefaultScopes(
134 "https://www.googleapis.com/auth/youtube",
135 "https://www.googleapis.com/auth/youtube.channel-memberships.creator",
136 "https://www.googleapis.com/auth/youtube.force-ssl",
137 "https://www.googleapis.com/auth/youtube.readonly",
138 "https://www.googleapis.com/auth/youtube.upload",
139 "https://www.googleapis.com/auth/youtubepartner",
140 "https://www.googleapis.com/auth/youtubepartner-channel-audit",
141 )
142 // NOTE: prepend, so we don't override user-specified scopes.
143 opts = append([]option.ClientOption{scopesOption}, opts...)
144 opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
145 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
146 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
147 opts = append(opts, internaloption.EnableNewAuthLibrary())
148 client, endpoint, err := htransport.NewClient(ctx, opts...)
149 if err != nil {
150 return nil, err
151 }
152 s := &Service{client: client, BasePath: basePath, logger: internaloption.GetLogger(opts)}
153 s.AbuseReports = NewAbuseReportsService(s)
154 s.Activities = NewActivitiesService(s)
155 s.Captions = NewCaptionsService(s)
156 s.ChannelBanners = NewChannelBannersService(s)
157 s.ChannelSections = NewChannelSectionsService(s)
158 s.Channels = NewChannelsService(s)
159 s.CommentThreads = NewCommentThreadsService(s)
160 s.Comments = NewCommentsService(s)
161 s.I18nLanguages = NewI18nLanguagesService(s)
162 s.I18nRegions = NewI18nRegionsService(s)
163 s.LiveBroadcasts = NewLiveBroadcastsService(s)
164 s.LiveChatBans = NewLiveChatBansService(s)
165 s.LiveChatMessages = NewLiveChatMessagesService(s)
166 s.LiveChatModerators = NewLiveChatModeratorsService(s)
167 s.LiveStreams = NewLiveStreamsService(s)
168 s.Members = NewMembersService(s)
169 s.MembershipsLevels = NewMembershipsLevelsService(s)
170 s.PlaylistImages = NewPlaylistImagesService(s)
171 s.PlaylistItems = NewPlaylistItemsService(s)
172 s.Playlists = NewPlaylistsService(s)
173 s.Search = NewSearchService(s)
174 s.Subscriptions = NewSubscriptionsService(s)
175 s.SuperChatEvents = NewSuperChatEventsService(s)
176 s.Tests = NewTestsService(s)
177 s.ThirdPartyLinks = NewThirdPartyLinksService(s)
178 s.Thumbnails = NewThumbnailsService(s)
179 s.VideoAbuseReportReasons = NewVideoAbuseReportReasonsService(s)
180 s.VideoCategories = NewVideoCategoriesService(s)
181 s.VideoTrainability = NewVideoTrainabilityService(s)
182 s.Videos = NewVideosService(s)
183 s.Watermarks = NewWatermarksService(s)
184 s.Youtube = NewYoutubeService(s)
185 if endpoint != "" {
186 s.BasePath = endpoint
187 }
188 return s, nil
189 }
190
191 // New creates a new Service. It uses the provided http.Client for requests.
192 //
193 // Deprecated: please use NewService instead.
194 // To provide a custom HTTP client, use option.WithHTTPClient.
195 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
196 func New(client *http.Client) (*Service, error) {
197 if client == nil {
198 return nil, errors.New("client is nil")
199 }
200 return NewService(context.TODO(), option.WithHTTPClient(client))
201 }
202
203 type Service struct {
204 client *http.Client
205 logger *slog.Logger
206 BasePath string // API endpoint base URL
207 UserAgent string // optional additional User-Agent fragment
208
209 AbuseReports *AbuseReportsService
210
211 Activities *ActivitiesService
212
213 Captions *CaptionsService
214
215 ChannelBanners *ChannelBannersService
216
217 ChannelSections *ChannelSectionsService
218
219 Channels *ChannelsService
220
221 CommentThreads *CommentThreadsService
222
223 Comments *CommentsService
224
225 I18nLanguages *I18nLanguagesService
226
227 I18nRegions *I18nRegionsService
228
229 LiveBroadcasts *LiveBroadcastsService
230
231 LiveChatBans *LiveChatBansService
232
233 LiveChatMessages *LiveChatMessagesService
234
235 LiveChatModerators *LiveChatModeratorsService
236
237 LiveStreams *LiveStreamsService
238
239 Members *MembersService
240
241 MembershipsLevels *MembershipsLevelsService
242
243 PlaylistImages *PlaylistImagesService
244
245 PlaylistItems *PlaylistItemsService
246
247 Playlists *PlaylistsService
248
249 Search *SearchService
250
251 Subscriptions *SubscriptionsService
252
253 SuperChatEvents *SuperChatEventsService
254
255 Tests *TestsService
256
257 ThirdPartyLinks *ThirdPartyLinksService
258
259 Thumbnails *ThumbnailsService
260
261 VideoAbuseReportReasons *VideoAbuseReportReasonsService
262
263 VideoCategories *VideoCategoriesService
264
265 VideoTrainability *VideoTrainabilityService
266
267 Videos *VideosService
268
269 Watermarks *WatermarksService
270
271 Youtube *YoutubeService
272 }
273
274 func (s *Service) userAgent() string {
275 if s.UserAgent == "" {
276 return googleapi.UserAgent
277 }
278 return googleapi.UserAgent + " " + s.UserAgent
279 }
280
281 func NewAbuseReportsService(s *Service) *AbuseReportsService {
282 rs := &AbuseReportsService{s: s}
283 return rs
284 }
285
286 type AbuseReportsService struct {
287 s *Service
288 }
289
290 func NewActivitiesService(s *Service) *ActivitiesService {
291 rs := &ActivitiesService{s: s}
292 return rs
293 }
294
295 type ActivitiesService struct {
296 s *Service
297 }
298
299 func NewCaptionsService(s *Service) *CaptionsService {
300 rs := &CaptionsService{s: s}
301 return rs
302 }
303
304 type CaptionsService struct {
305 s *Service
306 }
307
308 func NewChannelBannersService(s *Service) *ChannelBannersService {
309 rs := &ChannelBannersService{s: s}
310 return rs
311 }
312
313 type ChannelBannersService struct {
314 s *Service
315 }
316
317 func NewChannelSectionsService(s *Service) *ChannelSectionsService {
318 rs := &ChannelSectionsService{s: s}
319 return rs
320 }
321
322 type ChannelSectionsService struct {
323 s *Service
324 }
325
326 func NewChannelsService(s *Service) *ChannelsService {
327 rs := &ChannelsService{s: s}
328 return rs
329 }
330
331 type ChannelsService struct {
332 s *Service
333 }
334
335 func NewCommentThreadsService(s *Service) *CommentThreadsService {
336 rs := &CommentThreadsService{s: s}
337 return rs
338 }
339
340 type CommentThreadsService struct {
341 s *Service
342 }
343
344 func NewCommentsService(s *Service) *CommentsService {
345 rs := &CommentsService{s: s}
346 return rs
347 }
348
349 type CommentsService struct {
350 s *Service
351 }
352
353 func NewI18nLanguagesService(s *Service) *I18nLanguagesService {
354 rs := &I18nLanguagesService{s: s}
355 return rs
356 }
357
358 type I18nLanguagesService struct {
359 s *Service
360 }
361
362 func NewI18nRegionsService(s *Service) *I18nRegionsService {
363 rs := &I18nRegionsService{s: s}
364 return rs
365 }
366
367 type I18nRegionsService struct {
368 s *Service
369 }
370
371 func NewLiveBroadcastsService(s *Service) *LiveBroadcastsService {
372 rs := &LiveBroadcastsService{s: s}
373 return rs
374 }
375
376 type LiveBroadcastsService struct {
377 s *Service
378 }
379
380 func NewLiveChatBansService(s *Service) *LiveChatBansService {
381 rs := &LiveChatBansService{s: s}
382 return rs
383 }
384
385 type LiveChatBansService struct {
386 s *Service
387 }
388
389 func NewLiveChatMessagesService(s *Service) *LiveChatMessagesService {
390 rs := &LiveChatMessagesService{s: s}
391 return rs
392 }
393
394 type LiveChatMessagesService struct {
395 s *Service
396 }
397
398 func NewLiveChatModeratorsService(s *Service) *LiveChatModeratorsService {
399 rs := &LiveChatModeratorsService{s: s}
400 return rs
401 }
402
403 type LiveChatModeratorsService struct {
404 s *Service
405 }
406
407 func NewLiveStreamsService(s *Service) *LiveStreamsService {
408 rs := &LiveStreamsService{s: s}
409 return rs
410 }
411
412 type LiveStreamsService struct {
413 s *Service
414 }
415
416 func NewMembersService(s *Service) *MembersService {
417 rs := &MembersService{s: s}
418 return rs
419 }
420
421 type MembersService struct {
422 s *Service
423 }
424
425 func NewMembershipsLevelsService(s *Service) *MembershipsLevelsService {
426 rs := &MembershipsLevelsService{s: s}
427 return rs
428 }
429
430 type MembershipsLevelsService struct {
431 s *Service
432 }
433
434 func NewPlaylistImagesService(s *Service) *PlaylistImagesService {
435 rs := &PlaylistImagesService{s: s}
436 return rs
437 }
438
439 type PlaylistImagesService struct {
440 s *Service
441 }
442
443 func NewPlaylistItemsService(s *Service) *PlaylistItemsService {
444 rs := &PlaylistItemsService{s: s}
445 return rs
446 }
447
448 type PlaylistItemsService struct {
449 s *Service
450 }
451
452 func NewPlaylistsService(s *Service) *PlaylistsService {
453 rs := &PlaylistsService{s: s}
454 return rs
455 }
456
457 type PlaylistsService struct {
458 s *Service
459 }
460
461 func NewSearchService(s *Service) *SearchService {
462 rs := &SearchService{s: s}
463 return rs
464 }
465
466 type SearchService struct {
467 s *Service
468 }
469
470 func NewSubscriptionsService(s *Service) *SubscriptionsService {
471 rs := &SubscriptionsService{s: s}
472 return rs
473 }
474
475 type SubscriptionsService struct {
476 s *Service
477 }
478
479 func NewSuperChatEventsService(s *Service) *SuperChatEventsService {
480 rs := &SuperChatEventsService{s: s}
481 return rs
482 }
483
484 type SuperChatEventsService struct {
485 s *Service
486 }
487
488 func NewTestsService(s *Service) *TestsService {
489 rs := &TestsService{s: s}
490 return rs
491 }
492
493 type TestsService struct {
494 s *Service
495 }
496
497 func NewThirdPartyLinksService(s *Service) *ThirdPartyLinksService {
498 rs := &ThirdPartyLinksService{s: s}
499 return rs
500 }
501
502 type ThirdPartyLinksService struct {
503 s *Service
504 }
505
506 func NewThumbnailsService(s *Service) *ThumbnailsService {
507 rs := &ThumbnailsService{s: s}
508 return rs
509 }
510
511 type ThumbnailsService struct {
512 s *Service
513 }
514
515 func NewVideoAbuseReportReasonsService(s *Service) *VideoAbuseReportReasonsService {
516 rs := &VideoAbuseReportReasonsService{s: s}
517 return rs
518 }
519
520 type VideoAbuseReportReasonsService struct {
521 s *Service
522 }
523
524 func NewVideoCategoriesService(s *Service) *VideoCategoriesService {
525 rs := &VideoCategoriesService{s: s}
526 return rs
527 }
528
529 type VideoCategoriesService struct {
530 s *Service
531 }
532
533 func NewVideoTrainabilityService(s *Service) *VideoTrainabilityService {
534 rs := &VideoTrainabilityService{s: s}
535 return rs
536 }
537
538 type VideoTrainabilityService struct {
539 s *Service
540 }
541
542 func NewVideosService(s *Service) *VideosService {
543 rs := &VideosService{s: s}
544 return rs
545 }
546
547 type VideosService struct {
548 s *Service
549 }
550
551 func NewWatermarksService(s *Service) *WatermarksService {
552 rs := &WatermarksService{s: s}
553 return rs
554 }
555
556 type WatermarksService struct {
557 s *Service
558 }
559
560 func NewYoutubeService(s *Service) *YoutubeService {
561 rs := &YoutubeService{s: s}
562 rs.V3 = NewYoutubeV3Service(s)
563 return rs
564 }
565
566 type YoutubeService struct {
567 s *Service
568
569 V3 *YoutubeV3Service
570 }
571
572 func NewYoutubeV3Service(s *Service) *YoutubeV3Service {
573 rs := &YoutubeV3Service{s: s}
574 rs.LiveChat = NewYoutubeV3LiveChatService(s)
575 return rs
576 }
577
578 type YoutubeV3Service struct {
579 s *Service
580
581 LiveChat *YoutubeV3LiveChatService
582 }
583
584 func NewYoutubeV3LiveChatService(s *Service) *YoutubeV3LiveChatService {
585 rs := &YoutubeV3LiveChatService{s: s}
586 rs.Messages = NewYoutubeV3LiveChatMessagesService(s)
587 return rs
588 }
589
590 type YoutubeV3LiveChatService struct {
591 s *Service
592
593 Messages *YoutubeV3LiveChatMessagesService
594 }
595
596 func NewYoutubeV3LiveChatMessagesService(s *Service) *YoutubeV3LiveChatMessagesService {
597 rs := &YoutubeV3LiveChatMessagesService{s: s}
598 return rs
599 }
600
601 type YoutubeV3LiveChatMessagesService struct {
602 s *Service
603 }
604
605 type AbuseReport struct {
606 AbuseTypes []*AbuseType `json:"abuseTypes,omitempty"`
607 Description string `json:"description,omitempty"`
608 RelatedEntities []*RelatedEntity `json:"relatedEntities,omitempty"`
609 Subject *Entity `json:"subject,omitempty"`
610
611 // ServerResponse contains the HTTP response code and headers from the server.
612 googleapi.ServerResponse `json:"-"`
613 // ForceSendFields is a list of field names (e.g. "AbuseTypes") to
614 // unconditionally include in API requests. By default, fields with empty or
615 // default values are omitted from API requests. See
616 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
617 // details.
618 ForceSendFields []string `json:"-"`
619 // NullFields is a list of field names (e.g. "AbuseTypes") to include in API
620 // requests with the JSON null value. By default, fields with empty values are
621 // omitted from API requests. See
622 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
623 NullFields []string `json:"-"`
624 }
625
626 func (s AbuseReport) MarshalJSON() ([]byte, error) {
627 type NoMethod AbuseReport
628 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
629 }
630
631 type AbuseType struct {
632 Id string `json:"id,omitempty"`
633 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
634 // include in API requests. By default, fields with empty or default values are
635 // omitted from API requests. See
636 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
637 // details.
638 ForceSendFields []string `json:"-"`
639 // NullFields is a list of field names (e.g. "Id") to include in API requests
640 // with the JSON null value. By default, fields with empty values are omitted
641 // from API requests. See
642 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
643 NullFields []string `json:"-"`
644 }
645
646 func (s AbuseType) MarshalJSON() ([]byte, error) {
647 type NoMethod AbuseType
648 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
649 }
650
651 // AccessPolicy: Rights management policy for YouTube resources.
652 type AccessPolicy struct {
653 // Allowed: The value of allowed indicates whether the access to the policy is
654 // allowed or denied by default.
655 Allowed bool `json:"allowed,omitempty"`
656 // Exception: A list of region codes that identify countries where the default
657 // policy do not apply.
658 Exception []string `json:"exception,omitempty"`
659 // ForceSendFields is a list of field names (e.g. "Allowed") to unconditionally
660 // include in API requests. By default, fields with empty or default values are
661 // omitted from API requests. See
662 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
663 // details.
664 ForceSendFields []string `json:"-"`
665 // NullFields is a list of field names (e.g. "Allowed") to include in API
666 // requests with the JSON null value. By default, fields with empty values are
667 // omitted from API requests. See
668 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
669 NullFields []string `json:"-"`
670 }
671
672 func (s AccessPolicy) MarshalJSON() ([]byte, error) {
673 type NoMethod AccessPolicy
674 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
675 }
676
677 // Activity: An *activity* resource contains information about an action that a
678 // particular channel, or user, has taken on YouTube.The actions reported in
679 // activity feeds include rating a video, sharing a video, marking a video as a
680 // favorite, commenting on a video, uploading a video, and so forth. Each
681 // activity resource identifies the type of action, the channel associated with
682 // the action, and the resource(s) associated with the action, such as the
683 // video that was rated or uploaded.
684 type Activity struct {
685 // ContentDetails: The contentDetails object contains information about the
686 // content associated with the activity. For example, if the snippet.type value
687 // is videoRated, then the contentDetails object's content identifies the rated
688 // video.
689 ContentDetails *ActivityContentDetails `json:"contentDetails,omitempty"`
690 // Etag: Etag of this resource
691 Etag string `json:"etag,omitempty"`
692 // Id: The ID that YouTube uses to uniquely identify the activity.
693 Id string `json:"id,omitempty"`
694 // Kind: Identifies what kind of resource this is. Value: the fixed string
695 // "youtube#activity".
696 Kind string `json:"kind,omitempty"`
697 // Snippet: The snippet object contains basic details about the activity,
698 // including the activity's type and group ID.
699 Snippet *ActivitySnippet `json:"snippet,omitempty"`
700 // ForceSendFields is a list of field names (e.g. "ContentDetails") to
701 // unconditionally include in API requests. By default, fields with empty or
702 // default values are omitted from API requests. See
703 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
704 // details.
705 ForceSendFields []string `json:"-"`
706 // NullFields is a list of field names (e.g. "ContentDetails") to include in
707 // API requests with the JSON null value. By default, fields with empty values
708 // are omitted from API requests. See
709 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
710 NullFields []string `json:"-"`
711 }
712
713 func (s Activity) MarshalJSON() ([]byte, error) {
714 type NoMethod Activity
715 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
716 }
717
718 // ActivityContentDetails: Details about the content of an activity: the video
719 // that was shared, the channel that was subscribed to, etc.
720 type ActivityContentDetails struct {
721 // Bulletin: The bulletin object contains details about a channel bulletin
722 // post. This object is only present if the snippet.type is bulletin.
723 Bulletin *ActivityContentDetailsBulletin `json:"bulletin,omitempty"`
724 // ChannelItem: The channelItem object contains details about a resource which
725 // was added to a channel. This property is only present if the snippet.type is
726 // channelItem.
727 ChannelItem *ActivityContentDetailsChannelItem `json:"channelItem,omitempty"`
728 // Comment: The comment object contains information about a resource that
729 // received a comment. This property is only present if the snippet.type is
730 // comment.
731 Comment *ActivityContentDetailsComment `json:"comment,omitempty"`
732 // Favorite: The favorite object contains information about a video that was
733 // marked as a favorite video. This property is only present if the
734 // snippet.type is favorite.
735 Favorite *ActivityContentDetailsFavorite `json:"favorite,omitempty"`
736 // Like: The like object contains information about a resource that received a
737 // positive (like) rating. This property is only present if the snippet.type is
738 // like.
739 Like *ActivityContentDetailsLike `json:"like,omitempty"`
740 // PlaylistItem: The playlistItem object contains information about a new
741 // playlist item. This property is only present if the snippet.type is
742 // playlistItem.
743 PlaylistItem *ActivityContentDetailsPlaylistItem `json:"playlistItem,omitempty"`
744 // PromotedItem: The promotedItem object contains details about a resource
745 // which is being promoted. This property is only present if the snippet.type
746 // is promotedItem.
747 PromotedItem *ActivityContentDetailsPromotedItem `json:"promotedItem,omitempty"`
748 // Recommendation: The recommendation object contains information about a
749 // recommended resource. This property is only present if the snippet.type is
750 // recommendation.
751 Recommendation *ActivityContentDetailsRecommendation `json:"recommendation,omitempty"`
752 // Social: The social object contains details about a social network post. This
753 // property is only present if the snippet.type is social.
754 Social *ActivityContentDetailsSocial `json:"social,omitempty"`
755 // Subscription: The subscription object contains information about a channel
756 // that a user subscribed to. This property is only present if the snippet.type
757 // is subscription.
758 Subscription *ActivityContentDetailsSubscription `json:"subscription,omitempty"`
759 // Upload: The upload object contains information about the uploaded video.
760 // This property is only present if the snippet.type is upload.
761 Upload *ActivityContentDetailsUpload `json:"upload,omitempty"`
762 // ForceSendFields is a list of field names (e.g. "Bulletin") to
763 // unconditionally include in API requests. By default, fields with empty or
764 // default values are omitted from API requests. See
765 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
766 // details.
767 ForceSendFields []string `json:"-"`
768 // NullFields is a list of field names (e.g. "Bulletin") to include in API
769 // requests with the JSON null value. By default, fields with empty values are
770 // omitted from API requests. See
771 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
772 NullFields []string `json:"-"`
773 }
774
775 func (s ActivityContentDetails) MarshalJSON() ([]byte, error) {
776 type NoMethod ActivityContentDetails
777 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
778 }
779
780 // ActivityContentDetailsBulletin: Details about a channel bulletin post.
781 type ActivityContentDetailsBulletin struct {
782 // ResourceId: The resourceId object contains information that identifies the
783 // resource associated with a bulletin post. @mutable youtube.activities.insert
784 ResourceId *ResourceId `json:"resourceId,omitempty"`
785 // ForceSendFields is a list of field names (e.g. "ResourceId") to
786 // unconditionally include in API requests. By default, fields with empty or
787 // default values are omitted from API requests. See
788 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
789 // details.
790 ForceSendFields []string `json:"-"`
791 // NullFields is a list of field names (e.g. "ResourceId") to include in API
792 // requests with the JSON null value. By default, fields with empty values are
793 // omitted from API requests. See
794 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
795 NullFields []string `json:"-"`
796 }
797
798 func (s ActivityContentDetailsBulletin) MarshalJSON() ([]byte, error) {
799 type NoMethod ActivityContentDetailsBulletin
800 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
801 }
802
803 // ActivityContentDetailsChannelItem: Details about a resource which was added
804 // to a channel.
805 type ActivityContentDetailsChannelItem struct {
806 // ResourceId: The resourceId object contains information that identifies the
807 // resource that was added to the channel.
808 ResourceId *ResourceId `json:"resourceId,omitempty"`
809 // ForceSendFields is a list of field names (e.g. "ResourceId") to
810 // unconditionally include in API requests. By default, fields with empty or
811 // default values are omitted from API requests. See
812 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
813 // details.
814 ForceSendFields []string `json:"-"`
815 // NullFields is a list of field names (e.g. "ResourceId") to include in API
816 // requests with the JSON null value. By default, fields with empty values are
817 // omitted from API requests. See
818 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
819 NullFields []string `json:"-"`
820 }
821
822 func (s ActivityContentDetailsChannelItem) MarshalJSON() ([]byte, error) {
823 type NoMethod ActivityContentDetailsChannelItem
824 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
825 }
826
827 // ActivityContentDetailsComment: Information about a resource that received a
828 // comment.
829 type ActivityContentDetailsComment struct {
830 // ResourceId: The resourceId object contains information that identifies the
831 // resource associated with the comment.
832 ResourceId *ResourceId `json:"resourceId,omitempty"`
833 // ForceSendFields is a list of field names (e.g. "ResourceId") to
834 // unconditionally include in API requests. By default, fields with empty or
835 // default values are omitted from API requests. See
836 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
837 // details.
838 ForceSendFields []string `json:"-"`
839 // NullFields is a list of field names (e.g. "ResourceId") to include in API
840 // requests with the JSON null value. By default, fields with empty values are
841 // omitted from API requests. See
842 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
843 NullFields []string `json:"-"`
844 }
845
846 func (s ActivityContentDetailsComment) MarshalJSON() ([]byte, error) {
847 type NoMethod ActivityContentDetailsComment
848 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
849 }
850
851 // ActivityContentDetailsFavorite: Information about a video that was marked as
852 // a favorite video.
853 type ActivityContentDetailsFavorite struct {
854 // ResourceId: The resourceId object contains information that identifies the
855 // resource that was marked as a favorite.
856 ResourceId *ResourceId `json:"resourceId,omitempty"`
857 // ForceSendFields is a list of field names (e.g. "ResourceId") to
858 // unconditionally include in API requests. By default, fields with empty or
859 // default values are omitted from API requests. See
860 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
861 // details.
862 ForceSendFields []string `json:"-"`
863 // NullFields is a list of field names (e.g. "ResourceId") to include in API
864 // requests with the JSON null value. By default, fields with empty values are
865 // omitted from API requests. See
866 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
867 NullFields []string `json:"-"`
868 }
869
870 func (s ActivityContentDetailsFavorite) MarshalJSON() ([]byte, error) {
871 type NoMethod ActivityContentDetailsFavorite
872 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
873 }
874
875 // ActivityContentDetailsLike: Information about a resource that received a
876 // positive (like) rating.
877 type ActivityContentDetailsLike struct {
878 // ResourceId: The resourceId object contains information that identifies the
879 // rated resource.
880 ResourceId *ResourceId `json:"resourceId,omitempty"`
881 // ForceSendFields is a list of field names (e.g. "ResourceId") to
882 // unconditionally include in API requests. By default, fields with empty or
883 // default values are omitted from API requests. See
884 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
885 // details.
886 ForceSendFields []string `json:"-"`
887 // NullFields is a list of field names (e.g. "ResourceId") to include in API
888 // requests with the JSON null value. By default, fields with empty values are
889 // omitted from API requests. See
890 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
891 NullFields []string `json:"-"`
892 }
893
894 func (s ActivityContentDetailsLike) MarshalJSON() ([]byte, error) {
895 type NoMethod ActivityContentDetailsLike
896 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
897 }
898
899 // ActivityContentDetailsPlaylistItem: Information about a new playlist item.
900 type ActivityContentDetailsPlaylistItem struct {
901 // PlaylistId: The value that YouTube uses to uniquely identify the playlist.
902 PlaylistId string `json:"playlistId,omitempty"`
903 // PlaylistItemId: ID of the item within the playlist.
904 PlaylistItemId string `json:"playlistItemId,omitempty"`
905 // ResourceId: The resourceId object contains information about the resource
906 // that was added to the playlist.
907 ResourceId *ResourceId `json:"resourceId,omitempty"`
908 // ForceSendFields is a list of field names (e.g. "PlaylistId") to
909 // unconditionally include in API requests. By default, fields with empty or
910 // default values are omitted from API requests. See
911 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
912 // details.
913 ForceSendFields []string `json:"-"`
914 // NullFields is a list of field names (e.g. "PlaylistId") to include in API
915 // requests with the JSON null value. By default, fields with empty values are
916 // omitted from API requests. See
917 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
918 NullFields []string `json:"-"`
919 }
920
921 func (s ActivityContentDetailsPlaylistItem) MarshalJSON() ([]byte, error) {
922 type NoMethod ActivityContentDetailsPlaylistItem
923 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
924 }
925
926 // ActivityContentDetailsPromotedItem: Details about a resource which is being
927 // promoted.
928 type ActivityContentDetailsPromotedItem struct {
929 // AdTag: The URL the client should fetch to request a promoted item.
930 AdTag string `json:"adTag,omitempty"`
931 // ClickTrackingUrl: The URL the client should ping to indicate that the user
932 // clicked through on this promoted item.
933 ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
934 // CreativeViewUrl: The URL the client should ping to indicate that the user
935 // was shown this promoted item.
936 CreativeViewUrl string `json:"creativeViewUrl,omitempty"`
937 // CtaType: The type of call-to-action, a message to the user indicating action
938 // that can be taken.
939 //
940 // Possible values:
941 // "ctaTypeUnspecified"
942 // "visitAdvertiserSite"
943 CtaType string `json:"ctaType,omitempty"`
944 // CustomCtaButtonText: The custom call-to-action button text. If specified, it
945 // will override the default button text for the cta_type.
946 CustomCtaButtonText string `json:"customCtaButtonText,omitempty"`
947 // DescriptionText: The text description to accompany the promoted item.
948 DescriptionText string `json:"descriptionText,omitempty"`
949 // DestinationUrl: The URL the client should direct the user to, if the user
950 // chooses to visit the advertiser's website.
951 DestinationUrl string `json:"destinationUrl,omitempty"`
952 // ForecastingUrl: The list of forecasting URLs. The client should ping all of
953 // these URLs when a promoted item is not available, to indicate that a
954 // promoted item could have been shown.
955 ForecastingUrl []string `json:"forecastingUrl,omitempty"`
956 // ImpressionUrl: The list of impression URLs. The client should ping all of
957 // these URLs to indicate that the user was shown this promoted item.
958 ImpressionUrl []string `json:"impressionUrl,omitempty"`
959 // VideoId: The ID that YouTube uses to uniquely identify the promoted video.
960 VideoId string `json:"videoId,omitempty"`
961 // ForceSendFields is a list of field names (e.g. "AdTag") to unconditionally
962 // include in API requests. By default, fields with empty or default values are
963 // omitted from API requests. See
964 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
965 // details.
966 ForceSendFields []string `json:"-"`
967 // NullFields is a list of field names (e.g. "AdTag") to include in API
968 // requests with the JSON null value. By default, fields with empty values are
969 // omitted from API requests. See
970 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
971 NullFields []string `json:"-"`
972 }
973
974 func (s ActivityContentDetailsPromotedItem) MarshalJSON() ([]byte, error) {
975 type NoMethod ActivityContentDetailsPromotedItem
976 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
977 }
978
979 // ActivityContentDetailsRecommendation: Information that identifies the
980 // recommended resource.
981 type ActivityContentDetailsRecommendation struct {
982 // Reason: The reason that the resource is recommended to the user.
983 //
984 // Possible values:
985 // "reasonUnspecified"
986 // "videoFavorited"
987 // "videoLiked"
988 // "videoWatched"
989 Reason string `json:"reason,omitempty"`
990 // ResourceId: The resourceId object contains information that identifies the
991 // recommended resource.
992 ResourceId *ResourceId `json:"resourceId,omitempty"`
993 // SeedResourceId: The seedResourceId object contains information about the
994 // resource that caused the recommendation.
995 SeedResourceId *ResourceId `json:"seedResourceId,omitempty"`
996 // ForceSendFields is a list of field names (e.g. "Reason") to unconditionally
997 // include in API requests. By default, fields with empty or default values are
998 // omitted from API requests. See
999 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1000 // details.
1001 ForceSendFields []string `json:"-"`
1002 // NullFields is a list of field names (e.g. "Reason") to include in API
1003 // requests with the JSON null value. By default, fields with empty values are
1004 // omitted from API requests. See
1005 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1006 NullFields []string `json:"-"`
1007 }
1008
1009 func (s ActivityContentDetailsRecommendation) MarshalJSON() ([]byte, error) {
1010 type NoMethod ActivityContentDetailsRecommendation
1011 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1012 }
1013
1014 // ActivityContentDetailsSocial: Details about a social network post.
1015 type ActivityContentDetailsSocial struct {
1016 // Author: The author of the social network post.
1017 Author string `json:"author,omitempty"`
1018 // ImageUrl: An image of the post's author.
1019 ImageUrl string `json:"imageUrl,omitempty"`
1020 // ReferenceUrl: The URL of the social network post.
1021 ReferenceUrl string `json:"referenceUrl,omitempty"`
1022 // ResourceId: The resourceId object encapsulates information that identifies
1023 // the resource associated with a social network post.
1024 ResourceId *ResourceId `json:"resourceId,omitempty"`
1025 // Type: The name of the social network.
1026 //
1027 // Possible values:
1028 // "unspecified"
1029 // "googlePlus"
1030 // "facebook"
1031 // "twitter"
1032 Type string `json:"type,omitempty"`
1033 // ForceSendFields is a list of field names (e.g. "Author") to unconditionally
1034 // include in API requests. By default, fields with empty or default values are
1035 // omitted from API requests. See
1036 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1037 // details.
1038 ForceSendFields []string `json:"-"`
1039 // NullFields is a list of field names (e.g. "Author") to include in API
1040 // requests with the JSON null value. By default, fields with empty values are
1041 // omitted from API requests. See
1042 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1043 NullFields []string `json:"-"`
1044 }
1045
1046 func (s ActivityContentDetailsSocial) MarshalJSON() ([]byte, error) {
1047 type NoMethod ActivityContentDetailsSocial
1048 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1049 }
1050
1051 // ActivityContentDetailsSubscription: Information about a channel that a user
1052 // subscribed to.
1053 type ActivityContentDetailsSubscription struct {
1054 // ResourceId: The resourceId object contains information that identifies the
1055 // resource that the user subscribed to.
1056 ResourceId *ResourceId `json:"resourceId,omitempty"`
1057 // ForceSendFields is a list of field names (e.g. "ResourceId") to
1058 // unconditionally include in API requests. By default, fields with empty or
1059 // default values are omitted from API requests. See
1060 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1061 // details.
1062 ForceSendFields []string `json:"-"`
1063 // NullFields is a list of field names (e.g. "ResourceId") to include in API
1064 // requests with the JSON null value. By default, fields with empty values are
1065 // omitted from API requests. See
1066 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1067 NullFields []string `json:"-"`
1068 }
1069
1070 func (s ActivityContentDetailsSubscription) MarshalJSON() ([]byte, error) {
1071 type NoMethod ActivityContentDetailsSubscription
1072 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1073 }
1074
1075 // ActivityContentDetailsUpload: Information about the uploaded video.
1076 type ActivityContentDetailsUpload struct {
1077 // VideoId: The ID that YouTube uses to uniquely identify the uploaded video.
1078 VideoId string `json:"videoId,omitempty"`
1079 // ForceSendFields is a list of field names (e.g. "VideoId") to unconditionally
1080 // include in API requests. By default, fields with empty or default values are
1081 // omitted from API requests. See
1082 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1083 // details.
1084 ForceSendFields []string `json:"-"`
1085 // NullFields is a list of field names (e.g. "VideoId") to include in API
1086 // requests with the JSON null value. By default, fields with empty values are
1087 // omitted from API requests. See
1088 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1089 NullFields []string `json:"-"`
1090 }
1091
1092 func (s ActivityContentDetailsUpload) MarshalJSON() ([]byte, error) {
1093 type NoMethod ActivityContentDetailsUpload
1094 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1095 }
1096
1097 type ActivityListResponse struct {
1098 // Etag: Etag of this resource.
1099 Etag string `json:"etag,omitempty"`
1100 // EventId: Serialized EventId of the request which produced this response.
1101 EventId string `json:"eventId,omitempty"`
1102 Items []*Activity `json:"items,omitempty"`
1103 // Kind: Identifies what kind of resource this is. Value: the fixed string
1104 // "youtube#activityListResponse".
1105 Kind string `json:"kind,omitempty"`
1106 // NextPageToken: The token that can be used as the value of the pageToken
1107 // parameter to retrieve the next page in the result set.
1108 NextPageToken string `json:"nextPageToken,omitempty"`
1109 // PageInfo: General pagination information.
1110 PageInfo *PageInfo `json:"pageInfo,omitempty"`
1111 // PrevPageToken: The token that can be used as the value of the pageToken
1112 // parameter to retrieve the previous page in the result set.
1113 PrevPageToken string `json:"prevPageToken,omitempty"`
1114 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
1115 // VisitorId: The visitorId identifies the visitor.
1116 VisitorId string `json:"visitorId,omitempty"`
1117
1118 // ServerResponse contains the HTTP response code and headers from the server.
1119 googleapi.ServerResponse `json:"-"`
1120 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1121 // include in API requests. By default, fields with empty or default values are
1122 // omitted from API requests. See
1123 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1124 // details.
1125 ForceSendFields []string `json:"-"`
1126 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1127 // with the JSON null value. By default, fields with empty values are omitted
1128 // from API requests. See
1129 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1130 NullFields []string `json:"-"`
1131 }
1132
1133 func (s ActivityListResponse) MarshalJSON() ([]byte, error) {
1134 type NoMethod ActivityListResponse
1135 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1136 }
1137
1138 // ActivitySnippet: Basic details about an activity, including title,
1139 // description, thumbnails, activity type and group. Next ID: 12
1140 type ActivitySnippet struct {
1141 // ChannelId: The ID that YouTube uses to uniquely identify the channel
1142 // associated with the activity.
1143 ChannelId string `json:"channelId,omitempty"`
1144 // ChannelTitle: Channel title for the channel responsible for this activity
1145 ChannelTitle string `json:"channelTitle,omitempty"`
1146 // Description: The description of the resource primarily associated with the
1147 // activity. @mutable youtube.activities.insert
1148 Description string `json:"description,omitempty"`
1149 // GroupId: The group ID associated with the activity. A group ID identifies
1150 // user events that are associated with the same user and resource. For
1151 // example, if a user rates a video and marks the same video as a favorite, the
1152 // entries for those events would have the same group ID in the user's activity
1153 // feed. In your user interface, you can avoid repetition by grouping events
1154 // with the same groupId value.
1155 GroupId string `json:"groupId,omitempty"`
1156 // PublishedAt: The date and time that the video was uploaded.
1157 PublishedAt string `json:"publishedAt,omitempty"`
1158 // Thumbnails: A map of thumbnail images associated with the resource that is
1159 // primarily associated with the activity. For each object in the map, the key
1160 // is the name of the thumbnail image, and the value is an object that contains
1161 // other information about the thumbnail.
1162 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
1163 // Title: The title of the resource primarily associated with the activity.
1164 Title string `json:"title,omitempty"`
1165 // Type: The type of activity that the resource describes.
1166 //
1167 // Possible values:
1168 // "typeUnspecified"
1169 // "upload"
1170 // "like"
1171 // "favorite"
1172 // "comment"
1173 // "subscription"
1174 // "playlistItem"
1175 // "recommendation"
1176 // "bulletin"
1177 // "social"
1178 // "channelItem"
1179 // "promotedItem"
1180 Type string `json:"type,omitempty"`
1181 // ForceSendFields is a list of field names (e.g. "ChannelId") to
1182 // unconditionally include in API requests. By default, fields with empty or
1183 // default values are omitted from API requests. See
1184 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1185 // details.
1186 ForceSendFields []string `json:"-"`
1187 // NullFields is a list of field names (e.g. "ChannelId") to include in API
1188 // requests with the JSON null value. By default, fields with empty values are
1189 // omitted from API requests. See
1190 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1191 NullFields []string `json:"-"`
1192 }
1193
1194 func (s ActivitySnippet) MarshalJSON() ([]byte, error) {
1195 type NoMethod ActivitySnippet
1196 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1197 }
1198
1199 // Caption: A *caption* resource represents a YouTube caption track. A caption
1200 // track is associated with exactly one YouTube video.
1201 type Caption struct {
1202 // Etag: Etag of this resource.
1203 Etag string `json:"etag,omitempty"`
1204 // Id: The ID that YouTube uses to uniquely identify the caption track.
1205 Id string `json:"id,omitempty"`
1206 // Kind: Identifies what kind of resource this is. Value: the fixed string
1207 // "youtube#caption".
1208 Kind string `json:"kind,omitempty"`
1209 // Snippet: The snippet object contains basic details about the caption.
1210 Snippet *CaptionSnippet `json:"snippet,omitempty"`
1211
1212 // ServerResponse contains the HTTP response code and headers from the server.
1213 googleapi.ServerResponse `json:"-"`
1214 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1215 // include in API requests. By default, fields with empty or default values are
1216 // omitted from API requests. See
1217 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1218 // details.
1219 ForceSendFields []string `json:"-"`
1220 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1221 // with the JSON null value. By default, fields with empty values are omitted
1222 // from API requests. See
1223 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1224 NullFields []string `json:"-"`
1225 }
1226
1227 func (s Caption) MarshalJSON() ([]byte, error) {
1228 type NoMethod Caption
1229 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1230 }
1231
1232 type CaptionListResponse struct {
1233 // Etag: Etag of this resource.
1234 Etag string `json:"etag,omitempty"`
1235 // EventId: Serialized EventId of the request which produced this response.
1236 EventId string `json:"eventId,omitempty"`
1237 // Items: A list of captions that match the request criteria.
1238 Items []*Caption `json:"items,omitempty"`
1239 // Kind: Identifies what kind of resource this is. Value: the fixed string
1240 // "youtube#captionListResponse".
1241 Kind string `json:"kind,omitempty"`
1242 // VisitorId: The visitorId identifies the visitor.
1243 VisitorId string `json:"visitorId,omitempty"`
1244
1245 // ServerResponse contains the HTTP response code and headers from the server.
1246 googleapi.ServerResponse `json:"-"`
1247 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1248 // include in API requests. By default, fields with empty or default values are
1249 // omitted from API requests. See
1250 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1251 // details.
1252 ForceSendFields []string `json:"-"`
1253 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1254 // with the JSON null value. By default, fields with empty values are omitted
1255 // from API requests. See
1256 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1257 NullFields []string `json:"-"`
1258 }
1259
1260 func (s CaptionListResponse) MarshalJSON() ([]byte, error) {
1261 type NoMethod CaptionListResponse
1262 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1263 }
1264
1265 // CaptionSnippet: Basic details about a caption track, such as its language
1266 // and name.
1267 type CaptionSnippet struct {
1268 // AudioTrackType: The type of audio track associated with the caption track.
1269 //
1270 // Possible values:
1271 // "unknown"
1272 // "primary"
1273 // "commentary"
1274 // "descriptive"
1275 AudioTrackType string `json:"audioTrackType,omitempty"`
1276 // FailureReason: The reason that YouTube failed to process the caption track.
1277 // This property is only present if the state property's value is failed.
1278 //
1279 // Possible values:
1280 // "unknownFormat"
1281 // "unsupportedFormat"
1282 // "processingFailed"
1283 FailureReason string `json:"failureReason,omitempty"`
1284 // IsAutoSynced: Indicates whether YouTube synchronized the caption track to
1285 // the audio track in the video. The value will be true if a sync was
1286 // explicitly requested when the caption track was uploaded. For example, when
1287 // calling the captions.insert or captions.update methods, you can set the sync
1288 // parameter to true to instruct YouTube to sync the uploaded track to the
1289 // video. If the value is false, YouTube uses the time codes in the uploaded
1290 // caption track to determine when to display captions.
1291 IsAutoSynced bool `json:"isAutoSynced,omitempty"`
1292 // IsCC: Indicates whether the track contains closed captions for the deaf and
1293 // hard of hearing. The default value is false.
1294 IsCC bool `json:"isCC,omitempty"`
1295 // IsDraft: Indicates whether the caption track is a draft. If the value is
1296 // true, then the track is not publicly visible. The default value is false.
1297 // @mutable youtube.captions.insert youtube.captions.update
1298 IsDraft bool `json:"isDraft,omitempty"`
1299 // IsEasyReader: Indicates whether caption track is formatted for "easy
1300 // reader," meaning it is at a third-grade level for language learners. The
1301 // default value is false.
1302 IsEasyReader bool `json:"isEasyReader,omitempty"`
1303 // IsLarge: Indicates whether the caption track uses large text for the
1304 // vision-impaired. The default value is false.
1305 IsLarge bool `json:"isLarge,omitempty"`
1306 // Language: The language of the caption track. The property value is a BCP-47
1307 // language tag.
1308 Language string `json:"language,omitempty"`
1309 // LastUpdated: The date and time when the caption track was last updated.
1310 LastUpdated string `json:"lastUpdated,omitempty"`
1311 // Name: The name of the caption track. The name is intended to be visible to
1312 // the user as an option during playback.
1313 Name string `json:"name,omitempty"`
1314 // Status: The caption track's status.
1315 //
1316 // Possible values:
1317 // "serving"
1318 // "syncing"
1319 // "failed"
1320 Status string `json:"status,omitempty"`
1321 // TrackKind: The caption track's type.
1322 //
1323 // Possible values:
1324 // "standard"
1325 // "ASR"
1326 // "forced"
1327 TrackKind string `json:"trackKind,omitempty"`
1328 // VideoId: The ID that YouTube uses to uniquely identify the video associated
1329 // with the caption track. @mutable youtube.captions.insert
1330 VideoId string `json:"videoId,omitempty"`
1331 // ForceSendFields is a list of field names (e.g. "AudioTrackType") to
1332 // unconditionally include in API requests. By default, fields with empty or
1333 // default values are omitted from API requests. See
1334 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1335 // details.
1336 ForceSendFields []string `json:"-"`
1337 // NullFields is a list of field names (e.g. "AudioTrackType") to include in
1338 // API requests with the JSON null value. By default, fields with empty values
1339 // are omitted from API requests. See
1340 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1341 NullFields []string `json:"-"`
1342 }
1343
1344 func (s CaptionSnippet) MarshalJSON() ([]byte, error) {
1345 type NoMethod CaptionSnippet
1346 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1347 }
1348
1349 // CdnSettings: Brief description of the live stream cdn settings.
1350 type CdnSettings struct {
1351 // Format: The format of the video stream that you are sending to Youtube.
1352 Format string `json:"format,omitempty"`
1353 // FrameRate: The frame rate of the inbound video data.
1354 //
1355 // Possible values:
1356 // "30fps"
1357 // "60fps"
1358 // "variable"
1359 FrameRate string `json:"frameRate,omitempty"`
1360 // IngestionInfo: The ingestionInfo object contains information that YouTube
1361 // provides that you need to transmit your RTMP or HTTP stream to YouTube.
1362 IngestionInfo *IngestionInfo `json:"ingestionInfo,omitempty"`
1363 // IngestionType: The method or protocol used to transmit the video stream.
1364 //
1365 // Possible values:
1366 // "rtmp"
1367 // "dash"
1368 // "webrtc"
1369 // "hls"
1370 IngestionType string `json:"ingestionType,omitempty"`
1371 // Resolution: The resolution of the inbound video data.
1372 //
1373 // Possible values:
1374 // "240p"
1375 // "360p"
1376 // "480p"
1377 // "720p"
1378 // "1080p"
1379 // "1440p"
1380 // "2160p"
1381 // "variable"
1382 Resolution string `json:"resolution,omitempty"`
1383 // ForceSendFields is a list of field names (e.g. "Format") to unconditionally
1384 // include in API requests. By default, fields with empty or default values are
1385 // omitted from API requests. See
1386 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1387 // details.
1388 ForceSendFields []string `json:"-"`
1389 // NullFields is a list of field names (e.g. "Format") to include in API
1390 // requests with the JSON null value. By default, fields with empty values are
1391 // omitted from API requests. See
1392 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1393 NullFields []string `json:"-"`
1394 }
1395
1396 func (s CdnSettings) MarshalJSON() ([]byte, error) {
1397 type NoMethod CdnSettings
1398 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1399 }
1400
1401 // Channel: A *channel* resource contains information about a YouTube channel.
1402 type Channel struct {
1403 // AuditDetails: The auditionDetails object encapsulates channel data that is
1404 // relevant for YouTube Partners during the audition process.
1405 AuditDetails *ChannelAuditDetails `json:"auditDetails,omitempty"`
1406 // BrandingSettings: The brandingSettings object encapsulates information about
1407 // the branding of the channel.
1408 BrandingSettings *ChannelBrandingSettings `json:"brandingSettings,omitempty"`
1409 // ContentDetails: The contentDetails object encapsulates information about the
1410 // channel's content.
1411 ContentDetails *ChannelContentDetails `json:"contentDetails,omitempty"`
1412 // ContentOwnerDetails: The contentOwnerDetails object encapsulates channel
1413 // data that is relevant for YouTube Partners linked with the channel.
1414 ContentOwnerDetails *ChannelContentOwnerDetails `json:"contentOwnerDetails,omitempty"`
1415 // ConversionPings: The conversionPings object encapsulates information about
1416 // conversion pings that need to be respected by the channel.
1417 ConversionPings *ChannelConversionPings `json:"conversionPings,omitempty"`
1418 // Etag: Etag of this resource.
1419 Etag string `json:"etag,omitempty"`
1420 // Id: The ID that YouTube uses to uniquely identify the channel.
1421 Id string `json:"id,omitempty"`
1422 // Kind: Identifies what kind of resource this is. Value: the fixed string
1423 // "youtube#channel".
1424 Kind string `json:"kind,omitempty"`
1425 // Localizations: Localizations for different languages
1426 Localizations map[string]ChannelLocalization `json:"localizations,omitempty"`
1427 // Snippet: The snippet object contains basic details about the channel, such
1428 // as its title, description, and thumbnail images.
1429 Snippet *ChannelSnippet `json:"snippet,omitempty"`
1430 // Statistics: The statistics object encapsulates statistics for the channel.
1431 Statistics *ChannelStatistics `json:"statistics,omitempty"`
1432 // Status: The status object encapsulates information about the privacy status
1433 // of the channel.
1434 Status *ChannelStatus `json:"status,omitempty"`
1435 // TopicDetails: The topicDetails object encapsulates information about
1436 // Freebase topics associated with the channel.
1437 TopicDetails *ChannelTopicDetails `json:"topicDetails,omitempty"`
1438
1439 // ServerResponse contains the HTTP response code and headers from the server.
1440 googleapi.ServerResponse `json:"-"`
1441 // ForceSendFields is a list of field names (e.g. "AuditDetails") to
1442 // unconditionally include in API requests. By default, fields with empty or
1443 // default values are omitted from API requests. See
1444 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1445 // details.
1446 ForceSendFields []string `json:"-"`
1447 // NullFields is a list of field names (e.g. "AuditDetails") to include in API
1448 // requests with the JSON null value. By default, fields with empty values are
1449 // omitted from API requests. See
1450 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1451 NullFields []string `json:"-"`
1452 }
1453
1454 func (s Channel) MarshalJSON() ([]byte, error) {
1455 type NoMethod Channel
1456 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1457 }
1458
1459 // ChannelAuditDetails: The auditDetails object encapsulates channel data that
1460 // is relevant for YouTube Partners during the audit process.
1461 type ChannelAuditDetails struct {
1462 // CommunityGuidelinesGoodStanding: Whether or not the channel respects the
1463 // community guidelines.
1464 CommunityGuidelinesGoodStanding bool `json:"communityGuidelinesGoodStanding,omitempty"`
1465 // ContentIdClaimsGoodStanding: Whether or not the channel has any unresolved
1466 // claims.
1467 ContentIdClaimsGoodStanding bool `json:"contentIdClaimsGoodStanding,omitempty"`
1468 // CopyrightStrikesGoodStanding: Whether or not the channel has any copyright
1469 // strikes.
1470 CopyrightStrikesGoodStanding bool `json:"copyrightStrikesGoodStanding,omitempty"`
1471 // ForceSendFields is a list of field names (e.g.
1472 // "CommunityGuidelinesGoodStanding") to unconditionally include in API
1473 // requests. By default, fields with empty or default values are omitted from
1474 // API requests. See
1475 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1476 // details.
1477 ForceSendFields []string `json:"-"`
1478 // NullFields is a list of field names (e.g. "CommunityGuidelinesGoodStanding")
1479 // to include in API requests with the JSON null value. By default, fields with
1480 // empty values are omitted from API requests. See
1481 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1482 NullFields []string `json:"-"`
1483 }
1484
1485 func (s ChannelAuditDetails) MarshalJSON() ([]byte, error) {
1486 type NoMethod ChannelAuditDetails
1487 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1488 }
1489
1490 // ChannelBannerResource: A channel banner returned as the response to a
1491 // channel_banner.insert call.
1492 type ChannelBannerResource struct {
1493 Etag string `json:"etag,omitempty"`
1494 // Kind: Identifies what kind of resource this is. Value: the fixed string
1495 // "youtube#channelBannerResource".
1496 Kind string `json:"kind,omitempty"`
1497 // Url: The URL of this banner image.
1498 Url string `json:"url,omitempty"`
1499
1500 // ServerResponse contains the HTTP response code and headers from the server.
1501 googleapi.ServerResponse `json:"-"`
1502 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1503 // include in API requests. By default, fields with empty or default values are
1504 // omitted from API requests. See
1505 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1506 // details.
1507 ForceSendFields []string `json:"-"`
1508 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1509 // with the JSON null value. By default, fields with empty values are omitted
1510 // from API requests. See
1511 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1512 NullFields []string `json:"-"`
1513 }
1514
1515 func (s ChannelBannerResource) MarshalJSON() ([]byte, error) {
1516 type NoMethod ChannelBannerResource
1517 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1518 }
1519
1520 // ChannelBrandingSettings: Branding properties of a YouTube channel.
1521 type ChannelBrandingSettings struct {
1522 // Channel: Branding properties for the channel view.
1523 Channel *ChannelSettings `json:"channel,omitempty"`
1524 // Hints: Additional experimental branding properties.
1525 Hints []*PropertyValue `json:"hints,omitempty"`
1526 // Image: Branding properties for branding images.
1527 Image *ImageSettings `json:"image,omitempty"`
1528 // Watch: Branding properties for the watch page.
1529 Watch *WatchSettings `json:"watch,omitempty"`
1530 // ForceSendFields is a list of field names (e.g. "Channel") to unconditionally
1531 // include in API requests. By default, fields with empty or default values are
1532 // omitted from API requests. See
1533 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1534 // details.
1535 ForceSendFields []string `json:"-"`
1536 // NullFields is a list of field names (e.g. "Channel") to include in API
1537 // requests with the JSON null value. By default, fields with empty values are
1538 // omitted from API requests. See
1539 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1540 NullFields []string `json:"-"`
1541 }
1542
1543 func (s ChannelBrandingSettings) MarshalJSON() ([]byte, error) {
1544 type NoMethod ChannelBrandingSettings
1545 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1546 }
1547
1548 // ChannelContentDetails: Details about the content of a channel.
1549 type ChannelContentDetails struct {
1550 RelatedPlaylists *ChannelContentDetailsRelatedPlaylists `json:"relatedPlaylists,omitempty"`
1551 // ForceSendFields is a list of field names (e.g. "RelatedPlaylists") to
1552 // unconditionally include in API requests. By default, fields with empty or
1553 // default values are omitted from API requests. See
1554 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1555 // details.
1556 ForceSendFields []string `json:"-"`
1557 // NullFields is a list of field names (e.g. "RelatedPlaylists") to include in
1558 // API requests with the JSON null value. By default, fields with empty values
1559 // are omitted from API requests. See
1560 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1561 NullFields []string `json:"-"`
1562 }
1563
1564 func (s ChannelContentDetails) MarshalJSON() ([]byte, error) {
1565 type NoMethod ChannelContentDetails
1566 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1567 }
1568
1569 type ChannelContentDetailsRelatedPlaylists struct {
1570 // Favorites: The ID of the playlist that contains the channel"s favorite
1571 // videos. Use the playlistItems.insert and playlistItems.delete to add or
1572 // remove items from that list.
1573 Favorites string `json:"favorites,omitempty"`
1574 // Likes: The ID of the playlist that contains the channel"s liked videos. Use
1575 // the playlistItems.insert and playlistItems.delete to add or remove items
1576 // from that list.
1577 Likes string `json:"likes,omitempty"`
1578 // Uploads: The ID of the playlist that contains the channel"s uploaded videos.
1579 // Use the videos.insert method to upload new videos and the videos.delete
1580 // method to delete previously uploaded videos.
1581 Uploads string `json:"uploads,omitempty"`
1582 // WatchHistory: The ID of the playlist that contains the channel"s watch
1583 // history. Use the playlistItems.insert and playlistItems.delete to add or
1584 // remove items from that list.
1585 WatchHistory string `json:"watchHistory,omitempty"`
1586 // WatchLater: The ID of the playlist that contains the channel"s watch later
1587 // playlist. Use the playlistItems.insert and playlistItems.delete to add or
1588 // remove items from that list.
1589 WatchLater string `json:"watchLater,omitempty"`
1590 // ForceSendFields is a list of field names (e.g. "Favorites") to
1591 // unconditionally include in API requests. By default, fields with empty or
1592 // default values are omitted from API requests. See
1593 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1594 // details.
1595 ForceSendFields []string `json:"-"`
1596 // NullFields is a list of field names (e.g. "Favorites") to include in API
1597 // requests with the JSON null value. By default, fields with empty values are
1598 // omitted from API requests. See
1599 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1600 NullFields []string `json:"-"`
1601 }
1602
1603 func (s ChannelContentDetailsRelatedPlaylists) MarshalJSON() ([]byte, error) {
1604 type NoMethod ChannelContentDetailsRelatedPlaylists
1605 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1606 }
1607
1608 // ChannelContentOwnerDetails: The contentOwnerDetails object encapsulates
1609 // channel data that is relevant for YouTube Partners linked with the channel.
1610 type ChannelContentOwnerDetails struct {
1611 // ContentOwner: The ID of the content owner linked to the channel.
1612 ContentOwner string `json:"contentOwner,omitempty"`
1613 // TimeLinked: The date and time when the channel was linked to the content
1614 // owner.
1615 TimeLinked string `json:"timeLinked,omitempty"`
1616 // ForceSendFields is a list of field names (e.g. "ContentOwner") to
1617 // unconditionally include in API requests. By default, fields with empty or
1618 // default values are omitted from API requests. See
1619 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1620 // details.
1621 ForceSendFields []string `json:"-"`
1622 // NullFields is a list of field names (e.g. "ContentOwner") to include in API
1623 // requests with the JSON null value. By default, fields with empty values are
1624 // omitted from API requests. See
1625 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1626 NullFields []string `json:"-"`
1627 }
1628
1629 func (s ChannelContentOwnerDetails) MarshalJSON() ([]byte, error) {
1630 type NoMethod ChannelContentOwnerDetails
1631 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1632 }
1633
1634 // ChannelConversionPing: Pings that the app shall fire (authenticated by
1635 // biscotti cookie). Each ping has a context, in which the app must fire the
1636 // ping, and a url identifying the ping.
1637 type ChannelConversionPing struct {
1638 // Context: Defines the context of the ping.
1639 //
1640 // Possible values:
1641 // "subscribe"
1642 // "unsubscribe"
1643 // "cview"
1644 Context string `json:"context,omitempty"`
1645 // ConversionUrl: The url (without the schema) that the player shall send the
1646 // ping to. It's at caller's descretion to decide which schema to use (http vs
1647 // https) Example of a returned url: //googleads.g.doubleclick.net/pagead/
1648 // viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D
1649 // cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must append
1650 // biscotti authentication (ms param in case of mobile, for example) to this
1651 // ping.
1652 ConversionUrl string `json:"conversionUrl,omitempty"`
1653 // ForceSendFields is a list of field names (e.g. "Context") to unconditionally
1654 // include in API requests. By default, fields with empty or default values are
1655 // omitted from API requests. See
1656 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1657 // details.
1658 ForceSendFields []string `json:"-"`
1659 // NullFields is a list of field names (e.g. "Context") to include in API
1660 // requests with the JSON null value. By default, fields with empty values are
1661 // omitted from API requests. See
1662 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1663 NullFields []string `json:"-"`
1664 }
1665
1666 func (s ChannelConversionPing) MarshalJSON() ([]byte, error) {
1667 type NoMethod ChannelConversionPing
1668 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1669 }
1670
1671 // ChannelConversionPings: The conversionPings object encapsulates information
1672 // about conversion pings that need to be respected by the channel.
1673 type ChannelConversionPings struct {
1674 // Pings: Pings that the app shall fire (authenticated by biscotti cookie).
1675 // Each ping has a context, in which the app must fire the ping, and a url
1676 // identifying the ping.
1677 Pings []*ChannelConversionPing `json:"pings,omitempty"`
1678 // ForceSendFields is a list of field names (e.g. "Pings") to unconditionally
1679 // include in API requests. By default, fields with empty or default values are
1680 // omitted from API requests. See
1681 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1682 // details.
1683 ForceSendFields []string `json:"-"`
1684 // NullFields is a list of field names (e.g. "Pings") to include in API
1685 // requests with the JSON null value. By default, fields with empty values are
1686 // omitted from API requests. See
1687 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1688 NullFields []string `json:"-"`
1689 }
1690
1691 func (s ChannelConversionPings) MarshalJSON() ([]byte, error) {
1692 type NoMethod ChannelConversionPings
1693 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1694 }
1695
1696 type ChannelListResponse struct {
1697 // Etag: Etag of this resource.
1698 Etag string `json:"etag,omitempty"`
1699 // EventId: Serialized EventId of the request which produced this response.
1700 EventId string `json:"eventId,omitempty"`
1701 Items []*Channel `json:"items,omitempty"`
1702 // Kind: Identifies what kind of resource this is. Value: the fixed string
1703 // "youtube#channelListResponse".
1704 Kind string `json:"kind,omitempty"`
1705 // NextPageToken: The token that can be used as the value of the pageToken
1706 // parameter to retrieve the next page in the result set.
1707 NextPageToken string `json:"nextPageToken,omitempty"`
1708 // PageInfo: General pagination information.
1709 PageInfo *PageInfo `json:"pageInfo,omitempty"`
1710 // PrevPageToken: The token that can be used as the value of the pageToken
1711 // parameter to retrieve the previous page in the result set.
1712 PrevPageToken string `json:"prevPageToken,omitempty"`
1713 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
1714 // VisitorId: The visitorId identifies the visitor.
1715 VisitorId string `json:"visitorId,omitempty"`
1716
1717 // ServerResponse contains the HTTP response code and headers from the server.
1718 googleapi.ServerResponse `json:"-"`
1719 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1720 // include in API requests. By default, fields with empty or default values are
1721 // omitted from API requests. See
1722 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1723 // details.
1724 ForceSendFields []string `json:"-"`
1725 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1726 // with the JSON null value. By default, fields with empty values are omitted
1727 // from API requests. See
1728 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1729 NullFields []string `json:"-"`
1730 }
1731
1732 func (s ChannelListResponse) MarshalJSON() ([]byte, error) {
1733 type NoMethod ChannelListResponse
1734 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1735 }
1736
1737 // ChannelLocalization: Channel localization setting
1738 type ChannelLocalization struct {
1739 // Description: The localized strings for channel's description.
1740 Description string `json:"description,omitempty"`
1741 // Title: The localized strings for channel's title.
1742 Title string `json:"title,omitempty"`
1743 // ForceSendFields is a list of field names (e.g. "Description") to
1744 // unconditionally include in API requests. By default, fields with empty or
1745 // default values are omitted from API requests. See
1746 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1747 // details.
1748 ForceSendFields []string `json:"-"`
1749 // NullFields is a list of field names (e.g. "Description") to include in API
1750 // requests with the JSON null value. By default, fields with empty values are
1751 // omitted from API requests. See
1752 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1753 NullFields []string `json:"-"`
1754 }
1755
1756 func (s ChannelLocalization) MarshalJSON() ([]byte, error) {
1757 type NoMethod ChannelLocalization
1758 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1759 }
1760
1761 type ChannelProfileDetails struct {
1762 // ChannelId: The YouTube channel ID.
1763 ChannelId string `json:"channelId,omitempty"`
1764 // ChannelUrl: The channel's URL.
1765 ChannelUrl string `json:"channelUrl,omitempty"`
1766 // DisplayName: The channel's display name.
1767 DisplayName string `json:"displayName,omitempty"`
1768 // ProfileImageUrl: The channels's avatar URL.
1769 ProfileImageUrl string `json:"profileImageUrl,omitempty"`
1770 // ForceSendFields is a list of field names (e.g. "ChannelId") to
1771 // unconditionally include in API requests. By default, fields with empty or
1772 // default values are omitted from API requests. See
1773 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1774 // details.
1775 ForceSendFields []string `json:"-"`
1776 // NullFields is a list of field names (e.g. "ChannelId") to include in API
1777 // requests with the JSON null value. By default, fields with empty values are
1778 // omitted from API requests. See
1779 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1780 NullFields []string `json:"-"`
1781 }
1782
1783 func (s ChannelProfileDetails) MarshalJSON() ([]byte, error) {
1784 type NoMethod ChannelProfileDetails
1785 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1786 }
1787
1788 type ChannelSection struct {
1789 // ContentDetails: The contentDetails object contains details about the channel
1790 // section content, such as a list of playlists or channels featured in the
1791 // section.
1792 ContentDetails *ChannelSectionContentDetails `json:"contentDetails,omitempty"`
1793 // Etag: Etag of this resource.
1794 Etag string `json:"etag,omitempty"`
1795 // Id: The ID that YouTube uses to uniquely identify the channel section.
1796 Id string `json:"id,omitempty"`
1797 // Kind: Identifies what kind of resource this is. Value: the fixed string
1798 // "youtube#channelSection".
1799 Kind string `json:"kind,omitempty"`
1800 // Localizations: Localizations for different languages
1801 Localizations map[string]ChannelSectionLocalization `json:"localizations,omitempty"`
1802 // Snippet: The snippet object contains basic details about the channel
1803 // section, such as its type, style and title.
1804 Snippet *ChannelSectionSnippet `json:"snippet,omitempty"`
1805 // Targeting: The targeting object contains basic targeting settings about the
1806 // channel section.
1807 Targeting *ChannelSectionTargeting `json:"targeting,omitempty"`
1808
1809 // ServerResponse contains the HTTP response code and headers from the server.
1810 googleapi.ServerResponse `json:"-"`
1811 // ForceSendFields is a list of field names (e.g. "ContentDetails") to
1812 // unconditionally include in API requests. By default, fields with empty or
1813 // default values are omitted from API requests. See
1814 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1815 // details.
1816 ForceSendFields []string `json:"-"`
1817 // NullFields is a list of field names (e.g. "ContentDetails") to include in
1818 // API requests with the JSON null value. By default, fields with empty values
1819 // are omitted from API requests. See
1820 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1821 NullFields []string `json:"-"`
1822 }
1823
1824 func (s ChannelSection) MarshalJSON() ([]byte, error) {
1825 type NoMethod ChannelSection
1826 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1827 }
1828
1829 // ChannelSectionContentDetails: Details about a channelsection, including
1830 // playlists and channels.
1831 type ChannelSectionContentDetails struct {
1832 // Channels: The channel ids for type multiple_channels.
1833 Channels []string `json:"channels,omitempty"`
1834 // Playlists: The playlist ids for type single_playlist and multiple_playlists.
1835 // For singlePlaylist, only one playlistId is allowed.
1836 Playlists []string `json:"playlists,omitempty"`
1837 // ForceSendFields is a list of field names (e.g. "Channels") to
1838 // unconditionally include in API requests. By default, fields with empty or
1839 // default values are omitted from API requests. See
1840 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1841 // details.
1842 ForceSendFields []string `json:"-"`
1843 // NullFields is a list of field names (e.g. "Channels") to include in API
1844 // requests with the JSON null value. By default, fields with empty values are
1845 // omitted from API requests. See
1846 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1847 NullFields []string `json:"-"`
1848 }
1849
1850 func (s ChannelSectionContentDetails) MarshalJSON() ([]byte, error) {
1851 type NoMethod ChannelSectionContentDetails
1852 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1853 }
1854
1855 type ChannelSectionListResponse struct {
1856 // Etag: Etag of this resource.
1857 Etag string `json:"etag,omitempty"`
1858 // EventId: Serialized EventId of the request which produced this response.
1859 EventId string `json:"eventId,omitempty"`
1860 // Items: A list of ChannelSections that match the request criteria.
1861 Items []*ChannelSection `json:"items,omitempty"`
1862 // Kind: Identifies what kind of resource this is. Value: the fixed string
1863 // "youtube#channelSectionListResponse".
1864 Kind string `json:"kind,omitempty"`
1865 // VisitorId: The visitorId identifies the visitor.
1866 VisitorId string `json:"visitorId,omitempty"`
1867
1868 // ServerResponse contains the HTTP response code and headers from the server.
1869 googleapi.ServerResponse `json:"-"`
1870 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
1871 // include in API requests. By default, fields with empty or default values are
1872 // omitted from API requests. See
1873 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1874 // details.
1875 ForceSendFields []string `json:"-"`
1876 // NullFields is a list of field names (e.g. "Etag") to include in API requests
1877 // with the JSON null value. By default, fields with empty values are omitted
1878 // from API requests. See
1879 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1880 NullFields []string `json:"-"`
1881 }
1882
1883 func (s ChannelSectionListResponse) MarshalJSON() ([]byte, error) {
1884 type NoMethod ChannelSectionListResponse
1885 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1886 }
1887
1888 // ChannelSectionLocalization: ChannelSection localization setting
1889 type ChannelSectionLocalization struct {
1890 // Title: The localized strings for channel section's title.
1891 Title string `json:"title,omitempty"`
1892 // ForceSendFields is a list of field names (e.g. "Title") to unconditionally
1893 // include in API requests. By default, fields with empty or default values are
1894 // omitted from API requests. See
1895 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1896 // details.
1897 ForceSendFields []string `json:"-"`
1898 // NullFields is a list of field names (e.g. "Title") to include in API
1899 // requests with the JSON null value. By default, fields with empty values are
1900 // omitted from API requests. See
1901 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1902 NullFields []string `json:"-"`
1903 }
1904
1905 func (s ChannelSectionLocalization) MarshalJSON() ([]byte, error) {
1906 type NoMethod ChannelSectionLocalization
1907 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1908 }
1909
1910 // ChannelSectionSnippet: Basic details about a channel section, including
1911 // title, style and position.
1912 type ChannelSectionSnippet struct {
1913 // ChannelId: The ID that YouTube uses to uniquely identify the channel that
1914 // published the channel section.
1915 ChannelId string `json:"channelId,omitempty"`
1916 // DefaultLanguage: The language of the channel section's default title and
1917 // description.
1918 DefaultLanguage string `json:"defaultLanguage,omitempty"`
1919 // Localized: Localized title, read-only.
1920 Localized *ChannelSectionLocalization `json:"localized,omitempty"`
1921 // Position: The position of the channel section in the channel.
1922 Position *int64 `json:"position,omitempty"`
1923 // Style: The style of the channel section.
1924 //
1925 // Possible values:
1926 // "channelsectionStyleUnspecified"
1927 // "horizontalRow"
1928 // "verticalList"
1929 Style string `json:"style,omitempty"`
1930 // Title: The channel section's title for multiple_playlists and
1931 // multiple_channels.
1932 Title string `json:"title,omitempty"`
1933 // Type: The type of the channel section.
1934 //
1935 // Possible values:
1936 // "channelsectionTypeUndefined"
1937 // "singlePlaylist"
1938 // "multiplePlaylists"
1939 // "popularUploads"
1940 // "recentUploads"
1941 // "likes"
1942 // "allPlaylists"
1943 // "likedPlaylists"
1944 // "recentPosts"
1945 // "recentActivity"
1946 // "liveEvents"
1947 // "upcomingEvents"
1948 // "completedEvents"
1949 // "multipleChannels"
1950 // "postedVideos"
1951 // "postedPlaylists"
1952 // "subscriptions"
1953 Type string `json:"type,omitempty"`
1954 // ForceSendFields is a list of field names (e.g. "ChannelId") to
1955 // unconditionally include in API requests. By default, fields with empty or
1956 // default values are omitted from API requests. See
1957 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1958 // details.
1959 ForceSendFields []string `json:"-"`
1960 // NullFields is a list of field names (e.g. "ChannelId") to include in API
1961 // requests with the JSON null value. By default, fields with empty values are
1962 // omitted from API requests. See
1963 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1964 NullFields []string `json:"-"`
1965 }
1966
1967 func (s ChannelSectionSnippet) MarshalJSON() ([]byte, error) {
1968 type NoMethod ChannelSectionSnippet
1969 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1970 }
1971
1972 // ChannelSectionTargeting: ChannelSection targeting setting.
1973 type ChannelSectionTargeting struct {
1974 // Countries: The country the channel section is targeting.
1975 Countries []string `json:"countries,omitempty"`
1976 // Languages: The language the channel section is targeting.
1977 Languages []string `json:"languages,omitempty"`
1978 // Regions: The region the channel section is targeting.
1979 Regions []string `json:"regions,omitempty"`
1980 // ForceSendFields is a list of field names (e.g. "Countries") to
1981 // unconditionally include in API requests. By default, fields with empty or
1982 // default values are omitted from API requests. See
1983 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
1984 // details.
1985 ForceSendFields []string `json:"-"`
1986 // NullFields is a list of field names (e.g. "Countries") to include in API
1987 // requests with the JSON null value. By default, fields with empty values are
1988 // omitted from API requests. See
1989 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
1990 NullFields []string `json:"-"`
1991 }
1992
1993 func (s ChannelSectionTargeting) MarshalJSON() ([]byte, error) {
1994 type NoMethod ChannelSectionTargeting
1995 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
1996 }
1997
1998 // ChannelSettings: Branding properties for the channel view.
1999 type ChannelSettings struct {
2000 // Country: The country of the channel.
2001 Country string `json:"country,omitempty"`
2002 DefaultLanguage string `json:"defaultLanguage,omitempty"`
2003 // DefaultTab: Which content tab users should see when viewing the channel.
2004 DefaultTab string `json:"defaultTab,omitempty"`
2005 // Description: Specifies the channel description.
2006 Description string `json:"description,omitempty"`
2007 // FeaturedChannelsTitle: Title for the featured channels tab.
2008 FeaturedChannelsTitle string `json:"featuredChannelsTitle,omitempty"`
2009 // FeaturedChannelsUrls: The list of featured channels.
2010 FeaturedChannelsUrls []string `json:"featuredChannelsUrls,omitempty"`
2011 // Keywords: Lists keywords associated with the channel, comma-separated.
2012 Keywords string `json:"keywords,omitempty"`
2013 // ModerateComments: Whether user-submitted comments left on the channel page
2014 // need to be approved by the channel owner to be publicly visible.
2015 ModerateComments bool `json:"moderateComments,omitempty"`
2016 // ProfileColor: A prominent color that can be rendered on this channel page.
2017 ProfileColor string `json:"profileColor,omitempty"`
2018 // ShowBrowseView: Whether the tab to browse the videos should be displayed.
2019 ShowBrowseView bool `json:"showBrowseView,omitempty"`
2020 // ShowRelatedChannels: Whether related channels should be proposed.
2021 ShowRelatedChannels bool `json:"showRelatedChannels,omitempty"`
2022 // Title: Specifies the channel title.
2023 Title string `json:"title,omitempty"`
2024 // TrackingAnalyticsAccountId: The ID for a Google Analytics account to track
2025 // and measure traffic to the channels.
2026 TrackingAnalyticsAccountId string `json:"trackingAnalyticsAccountId,omitempty"`
2027 // UnsubscribedTrailer: The trailer of the channel, for users that are not
2028 // subscribers.
2029 UnsubscribedTrailer string `json:"unsubscribedTrailer,omitempty"`
2030 // ForceSendFields is a list of field names (e.g. "Country") to unconditionally
2031 // include in API requests. By default, fields with empty or default values are
2032 // omitted from API requests. See
2033 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2034 // details.
2035 ForceSendFields []string `json:"-"`
2036 // NullFields is a list of field names (e.g. "Country") to include in API
2037 // requests with the JSON null value. By default, fields with empty values are
2038 // omitted from API requests. See
2039 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2040 NullFields []string `json:"-"`
2041 }
2042
2043 func (s ChannelSettings) MarshalJSON() ([]byte, error) {
2044 type NoMethod ChannelSettings
2045 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2046 }
2047
2048 // ChannelSnippet: Basic details about a channel, including title, description
2049 // and thumbnails.
2050 type ChannelSnippet struct {
2051 // Country: The country of the channel.
2052 Country string `json:"country,omitempty"`
2053 // CustomUrl: The custom url of the channel.
2054 CustomUrl string `json:"customUrl,omitempty"`
2055 // DefaultLanguage: The language of the channel's default title and
2056 // description.
2057 DefaultLanguage string `json:"defaultLanguage,omitempty"`
2058 // Description: The description of the channel.
2059 Description string `json:"description,omitempty"`
2060 // Localized: Localized title and description, read-only.
2061 Localized *ChannelLocalization `json:"localized,omitempty"`
2062 // PublishedAt: The date and time that the channel was created.
2063 PublishedAt string `json:"publishedAt,omitempty"`
2064 // Thumbnails: A map of thumbnail images associated with the channel. For each
2065 // object in the map, the key is the name of the thumbnail image, and the value
2066 // is an object that contains other information about the thumbnail. When
2067 // displaying thumbnails in your application, make sure that your code uses the
2068 // image URLs exactly as they are returned in API responses. For example, your
2069 // application should not use the http domain instead of the https domain in a
2070 // URL returned in an API response. Beginning in July 2018, channel thumbnail
2071 // URLs will only be available in the https domain, which is how the URLs
2072 // appear in API responses. After that time, you might see broken images in
2073 // your application if it tries to load YouTube images from the http domain.
2074 // Thumbnail images might be empty for newly created channels and might take up
2075 // to one day to populate.
2076 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
2077 // Title: The channel's title.
2078 Title string `json:"title,omitempty"`
2079 // ForceSendFields is a list of field names (e.g. "Country") to unconditionally
2080 // include in API requests. By default, fields with empty or default values are
2081 // omitted from API requests. See
2082 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2083 // details.
2084 ForceSendFields []string `json:"-"`
2085 // NullFields is a list of field names (e.g. "Country") to include in API
2086 // requests with the JSON null value. By default, fields with empty values are
2087 // omitted from API requests. See
2088 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2089 NullFields []string `json:"-"`
2090 }
2091
2092 func (s ChannelSnippet) MarshalJSON() ([]byte, error) {
2093 type NoMethod ChannelSnippet
2094 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2095 }
2096
2097 // ChannelStatistics: Statistics about a channel: number of subscribers, number
2098 // of videos in the channel, etc.
2099 type ChannelStatistics struct {
2100 // CommentCount: The number of comments for the channel.
2101 CommentCount uint64 `json:"commentCount,omitempty,string"`
2102 // HiddenSubscriberCount: Whether or not the number of subscribers is shown for
2103 // this user.
2104 HiddenSubscriberCount bool `json:"hiddenSubscriberCount,omitempty"`
2105 // SubscriberCount: The number of subscribers that the channel has.
2106 SubscriberCount uint64 `json:"subscriberCount,omitempty,string"`
2107 // VideoCount: The number of videos uploaded to the channel.
2108 VideoCount uint64 `json:"videoCount,omitempty,string"`
2109 // ViewCount: The number of times the channel has been viewed.
2110 ViewCount uint64 `json:"viewCount,omitempty,string"`
2111 // ForceSendFields is a list of field names (e.g. "CommentCount") to
2112 // unconditionally include in API requests. By default, fields with empty or
2113 // default values are omitted from API requests. See
2114 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2115 // details.
2116 ForceSendFields []string `json:"-"`
2117 // NullFields is a list of field names (e.g. "CommentCount") to include in API
2118 // requests with the JSON null value. By default, fields with empty values are
2119 // omitted from API requests. See
2120 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2121 NullFields []string `json:"-"`
2122 }
2123
2124 func (s ChannelStatistics) MarshalJSON() ([]byte, error) {
2125 type NoMethod ChannelStatistics
2126 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2127 }
2128
2129 // ChannelStatus: JSON template for the status part of a channel.
2130 type ChannelStatus struct {
2131 // IsChannelMonetizationEnabled: Whether the channel is considered ypp
2132 // monetization enabled. See go/yppornot for more details.
2133 IsChannelMonetizationEnabled bool `json:"isChannelMonetizationEnabled,omitempty"`
2134 // IsLinked: If true, then the user is linked to either a YouTube username or
2135 // G+ account. Otherwise, the user doesn't have a public YouTube identity.
2136 IsLinked bool `json:"isLinked,omitempty"`
2137 // LongUploadsStatus: The long uploads status of this channel. See
2138 // https://support.google.com/youtube/answer/71673 for more information.
2139 //
2140 // Possible values:
2141 // "longUploadsUnspecified"
2142 // "allowed"
2143 // "eligible"
2144 // "disallowed"
2145 LongUploadsStatus string `json:"longUploadsStatus,omitempty"`
2146 MadeForKids bool `json:"madeForKids,omitempty"`
2147 // PrivacyStatus: Privacy status of the channel.
2148 //
2149 // Possible values:
2150 // "public"
2151 // "unlisted"
2152 // "private"
2153 PrivacyStatus string `json:"privacyStatus,omitempty"`
2154 SelfDeclaredMadeForKids bool `json:"selfDeclaredMadeForKids,omitempty"`
2155 // ForceSendFields is a list of field names (e.g.
2156 // "IsChannelMonetizationEnabled") to unconditionally include in API requests.
2157 // By default, fields with empty or default values are omitted from API
2158 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
2159 // for more details.
2160 ForceSendFields []string `json:"-"`
2161 // NullFields is a list of field names (e.g. "IsChannelMonetizationEnabled") to
2162 // include in API requests with the JSON null value. By default, fields with
2163 // empty values are omitted from API requests. See
2164 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2165 NullFields []string `json:"-"`
2166 }
2167
2168 func (s ChannelStatus) MarshalJSON() ([]byte, error) {
2169 type NoMethod ChannelStatus
2170 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2171 }
2172
2173 // ChannelToStoreLinkDetails: Information specific to a store on a
2174 // merchandising platform linked to a YouTube channel.
2175 type ChannelToStoreLinkDetails struct {
2176 // BillingDetails: Information specific to billing (read-only).
2177 BillingDetails *ChannelToStoreLinkDetailsBillingDetails `json:"billingDetails,omitempty"`
2178 // MerchantAffiliateProgramDetails: Information specific to merchant affiliate
2179 // program (read-only).
2180 MerchantAffiliateProgramDetails *ChannelToStoreLinkDetailsMerchantAffiliateProgramDetails `json:"merchantAffiliateProgramDetails,omitempty"`
2181 // MerchantId: Google Merchant Center id of the store.
2182 MerchantId uint64 `json:"merchantId,omitempty,string"`
2183 // StoreName: Name of the store.
2184 StoreName string `json:"storeName,omitempty"`
2185 // StoreUrl: Landing page of the store.
2186 StoreUrl string `json:"storeUrl,omitempty"`
2187 // ForceSendFields is a list of field names (e.g. "BillingDetails") to
2188 // unconditionally include in API requests. By default, fields with empty or
2189 // default values are omitted from API requests. See
2190 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2191 // details.
2192 ForceSendFields []string `json:"-"`
2193 // NullFields is a list of field names (e.g. "BillingDetails") to include in
2194 // API requests with the JSON null value. By default, fields with empty values
2195 // are omitted from API requests. See
2196 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2197 NullFields []string `json:"-"`
2198 }
2199
2200 func (s ChannelToStoreLinkDetails) MarshalJSON() ([]byte, error) {
2201 type NoMethod ChannelToStoreLinkDetails
2202 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2203 }
2204
2205 // ChannelToStoreLinkDetailsBillingDetails: Information specific to billing.
2206 type ChannelToStoreLinkDetailsBillingDetails struct {
2207 // BillingStatus: The current billing profile status.
2208 //
2209 // Possible values:
2210 // "billingStatusUnspecified"
2211 // "billingStatusPending"
2212 // "billingStatusActive"
2213 // "billingStatusInactive"
2214 BillingStatus string `json:"billingStatus,omitempty"`
2215 // ForceSendFields is a list of field names (e.g. "BillingStatus") to
2216 // unconditionally include in API requests. By default, fields with empty or
2217 // default values are omitted from API requests. See
2218 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2219 // details.
2220 ForceSendFields []string `json:"-"`
2221 // NullFields is a list of field names (e.g. "BillingStatus") to include in API
2222 // requests with the JSON null value. By default, fields with empty values are
2223 // omitted from API requests. See
2224 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2225 NullFields []string `json:"-"`
2226 }
2227
2228 func (s ChannelToStoreLinkDetailsBillingDetails) MarshalJSON() ([]byte, error) {
2229 type NoMethod ChannelToStoreLinkDetailsBillingDetails
2230 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2231 }
2232
2233 // ChannelToStoreLinkDetailsMerchantAffiliateProgramDetails: Information
2234 // specific to merchant affiliate program.
2235 type ChannelToStoreLinkDetailsMerchantAffiliateProgramDetails struct {
2236 // Status: The current merchant affiliate program status.
2237 //
2238 // Possible values:
2239 // "merchantAffiliateProgramStatusUnspecified" - Unspecified status.
2240 // "merchantAffiliateProgramStatusEligible" - Merchant is eligible for the
2241 // merchant affiliate program.
2242 // "merchantAffiliateProgramStatusActive" - Merchant affiliate program is
2243 // active.
2244 // "merchantAffiliateProgramStatusPaused" - Merchant affiliate program is
2245 // paused.
2246 Status string `json:"status,omitempty"`
2247 // ForceSendFields is a list of field names (e.g. "Status") to unconditionally
2248 // include in API requests. By default, fields with empty or default values are
2249 // omitted from API requests. See
2250 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2251 // details.
2252 ForceSendFields []string `json:"-"`
2253 // NullFields is a list of field names (e.g. "Status") to include in API
2254 // requests with the JSON null value. By default, fields with empty values are
2255 // omitted from API requests. See
2256 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2257 NullFields []string `json:"-"`
2258 }
2259
2260 func (s ChannelToStoreLinkDetailsMerchantAffiliateProgramDetails) MarshalJSON() ([]byte, error) {
2261 type NoMethod ChannelToStoreLinkDetailsMerchantAffiliateProgramDetails
2262 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2263 }
2264
2265 // ChannelTopicDetails: Freebase topic information related to the channel.
2266 type ChannelTopicDetails struct {
2267 // TopicCategories: A list of Wikipedia URLs that describe the channel's
2268 // content.
2269 TopicCategories []string `json:"topicCategories,omitempty"`
2270 // TopicIds: A list of Freebase topic IDs associated with the channel. You can
2271 // retrieve information about each topic using the Freebase Topic API.
2272 TopicIds []string `json:"topicIds,omitempty"`
2273 // ForceSendFields is a list of field names (e.g. "TopicCategories") to
2274 // unconditionally include in API requests. By default, fields with empty or
2275 // default values are omitted from API requests. See
2276 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2277 // details.
2278 ForceSendFields []string `json:"-"`
2279 // NullFields is a list of field names (e.g. "TopicCategories") to include in
2280 // API requests with the JSON null value. By default, fields with empty values
2281 // are omitted from API requests. See
2282 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2283 NullFields []string `json:"-"`
2284 }
2285
2286 func (s ChannelTopicDetails) MarshalJSON() ([]byte, error) {
2287 type NoMethod ChannelTopicDetails
2288 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2289 }
2290
2291 // Comment: A *comment* represents a single YouTube comment.
2292 type Comment struct {
2293 // Etag: Etag of this resource.
2294 Etag string `json:"etag,omitempty"`
2295 // Id: The ID that YouTube uses to uniquely identify the comment.
2296 Id string `json:"id,omitempty"`
2297 // Kind: Identifies what kind of resource this is. Value: the fixed string
2298 // "youtube#comment".
2299 Kind string `json:"kind,omitempty"`
2300 // Snippet: The snippet object contains basic details about the comment.
2301 Snippet *CommentSnippet `json:"snippet,omitempty"`
2302
2303 // ServerResponse contains the HTTP response code and headers from the server.
2304 googleapi.ServerResponse `json:"-"`
2305 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
2306 // include in API requests. By default, fields with empty or default values are
2307 // omitted from API requests. See
2308 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2309 // details.
2310 ForceSendFields []string `json:"-"`
2311 // NullFields is a list of field names (e.g. "Etag") to include in API requests
2312 // with the JSON null value. By default, fields with empty values are omitted
2313 // from API requests. See
2314 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2315 NullFields []string `json:"-"`
2316 }
2317
2318 func (s Comment) MarshalJSON() ([]byte, error) {
2319 type NoMethod Comment
2320 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2321 }
2322
2323 type CommentListResponse struct {
2324 // Etag: Etag of this resource.
2325 Etag string `json:"etag,omitempty"`
2326 // EventId: Serialized EventId of the request which produced this response.
2327 EventId string `json:"eventId,omitempty"`
2328 // Items: A list of comments that match the request criteria.
2329 Items []*Comment `json:"items,omitempty"`
2330 // Kind: Identifies what kind of resource this is. Value: the fixed string
2331 // "youtube#commentListResponse".
2332 Kind string `json:"kind,omitempty"`
2333 // NextPageToken: The token that can be used as the value of the pageToken
2334 // parameter to retrieve the next page in the result set.
2335 NextPageToken string `json:"nextPageToken,omitempty"`
2336 // PageInfo: General pagination information.
2337 PageInfo *PageInfo `json:"pageInfo,omitempty"`
2338 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
2339 // VisitorId: The visitorId identifies the visitor.
2340 VisitorId string `json:"visitorId,omitempty"`
2341
2342 // ServerResponse contains the HTTP response code and headers from the server.
2343 googleapi.ServerResponse `json:"-"`
2344 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
2345 // include in API requests. By default, fields with empty or default values are
2346 // omitted from API requests. See
2347 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2348 // details.
2349 ForceSendFields []string `json:"-"`
2350 // NullFields is a list of field names (e.g. "Etag") to include in API requests
2351 // with the JSON null value. By default, fields with empty values are omitted
2352 // from API requests. See
2353 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2354 NullFields []string `json:"-"`
2355 }
2356
2357 func (s CommentListResponse) MarshalJSON() ([]byte, error) {
2358 type NoMethod CommentListResponse
2359 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2360 }
2361
2362 // CommentSnippet: Basic details about a comment, such as its author and text.
2363 type CommentSnippet struct {
2364 AuthorChannelId *CommentSnippetAuthorChannelId `json:"authorChannelId,omitempty"`
2365 // AuthorChannelUrl: Link to the author's YouTube channel, if any.
2366 AuthorChannelUrl string `json:"authorChannelUrl,omitempty"`
2367 // AuthorDisplayName: The name of the user who posted the comment.
2368 AuthorDisplayName string `json:"authorDisplayName,omitempty"`
2369 // AuthorProfileImageUrl: The URL for the avatar of the user who posted the
2370 // comment.
2371 AuthorProfileImageUrl string `json:"authorProfileImageUrl,omitempty"`
2372 // CanRate: Whether the current viewer can rate this comment.
2373 CanRate bool `json:"canRate,omitempty"`
2374 // ChannelId: The id of the corresponding YouTube channel. In case of a channel
2375 // comment this is the channel the comment refers to. In case of a video or
2376 // post comment it's the video/post's channel.
2377 ChannelId string `json:"channelId,omitempty"`
2378 // LikeCount: The total number of likes this comment has received.
2379 LikeCount int64 `json:"likeCount,omitempty"`
2380 // ModerationStatus: The comment's moderation status. Will not be set if the
2381 // comments were requested through the id filter.
2382 //
2383 // Possible values:
2384 // "published" - The comment is available for public display.
2385 // "heldForReview" - The comment is awaiting review by a moderator.
2386 // "likelySpam"
2387 // "rejected" - The comment is unfit for display.
2388 ModerationStatus string `json:"moderationStatus,omitempty"`
2389 // ParentId: The unique id of the top-level comment, only set for replies.
2390 ParentId string `json:"parentId,omitempty"`
2391 // PostId: The ID of the post the comment refers to, if any.
2392 PostId string `json:"postId,omitempty"`
2393 // PublishedAt: The date and time when the comment was originally published.
2394 PublishedAt string `json:"publishedAt,omitempty"`
2395 // TextDisplay: The comment's text. The format is either plain text or HTML
2396 // dependent on what has been requested. Even the plain text representation may
2397 // differ from the text originally posted in that it may replace video links
2398 // with video titles etc.
2399 TextDisplay string `json:"textDisplay,omitempty"`
2400 // TextOriginal: The comment's original raw text as initially posted or last
2401 // updated. The original text will only be returned if it is accessible to the
2402 // viewer, which is only guaranteed if the viewer is the comment's author.
2403 TextOriginal string `json:"textOriginal,omitempty"`
2404 // UpdatedAt: The date and time when the comment was last updated.
2405 UpdatedAt string `json:"updatedAt,omitempty"`
2406 // VideoId: The ID of the video the comment refers to, if any.
2407 VideoId string `json:"videoId,omitempty"`
2408 // ViewerRating: The rating the viewer has given to this comment. For the time
2409 // being this will never return RATE_TYPE_DISLIKE and instead return
2410 // RATE_TYPE_NONE. This may change in the future.
2411 //
2412 // Possible values:
2413 // "none"
2414 // "like" - The entity is liked.
2415 // "dislike" - The entity is disliked.
2416 ViewerRating string `json:"viewerRating,omitempty"`
2417 // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
2418 // unconditionally include in API requests. By default, fields with empty or
2419 // default values are omitted from API requests. See
2420 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2421 // details.
2422 ForceSendFields []string `json:"-"`
2423 // NullFields is a list of field names (e.g. "AuthorChannelId") to include in
2424 // API requests with the JSON null value. By default, fields with empty values
2425 // are omitted from API requests. See
2426 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2427 NullFields []string `json:"-"`
2428 }
2429
2430 func (s CommentSnippet) MarshalJSON() ([]byte, error) {
2431 type NoMethod CommentSnippet
2432 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2433 }
2434
2435 // CommentSnippetAuthorChannelId: Contains the id of the author's YouTube
2436 // channel, if any.
2437 type CommentSnippetAuthorChannelId struct {
2438 // Value: The id of the author's YouTube channel.
2439 Value string `json:"value,omitempty"`
2440 // ForceSendFields is a list of field names (e.g. "Value") to unconditionally
2441 // include in API requests. By default, fields with empty or default values are
2442 // omitted from API requests. See
2443 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2444 // details.
2445 ForceSendFields []string `json:"-"`
2446 // NullFields is a list of field names (e.g. "Value") to include in API
2447 // requests with the JSON null value. By default, fields with empty values are
2448 // omitted from API requests. See
2449 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2450 NullFields []string `json:"-"`
2451 }
2452
2453 func (s CommentSnippetAuthorChannelId) MarshalJSON() ([]byte, error) {
2454 type NoMethod CommentSnippetAuthorChannelId
2455 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2456 }
2457
2458 // CommentThread: A *comment thread* represents information that applies to a
2459 // top level comment and all its replies. It can also include the top level
2460 // comment itself and some of the replies.
2461 type CommentThread struct {
2462 // Etag: Etag of this resource.
2463 Etag string `json:"etag,omitempty"`
2464 // Id: The ID that YouTube uses to uniquely identify the comment thread.
2465 Id string `json:"id,omitempty"`
2466 // Kind: Identifies what kind of resource this is. Value: the fixed string
2467 // "youtube#commentThread".
2468 Kind string `json:"kind,omitempty"`
2469 // Replies: The replies object contains a limited number of replies (if any) to
2470 // the top level comment found in the snippet.
2471 Replies *CommentThreadReplies `json:"replies,omitempty"`
2472 // Snippet: The snippet object contains basic details about the comment thread
2473 // and also the top level comment.
2474 Snippet *CommentThreadSnippet `json:"snippet,omitempty"`
2475
2476 // ServerResponse contains the HTTP response code and headers from the server.
2477 googleapi.ServerResponse `json:"-"`
2478 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
2479 // include in API requests. By default, fields with empty or default values are
2480 // omitted from API requests. See
2481 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2482 // details.
2483 ForceSendFields []string `json:"-"`
2484 // NullFields is a list of field names (e.g. "Etag") to include in API requests
2485 // with the JSON null value. By default, fields with empty values are omitted
2486 // from API requests. See
2487 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2488 NullFields []string `json:"-"`
2489 }
2490
2491 func (s CommentThread) MarshalJSON() ([]byte, error) {
2492 type NoMethod CommentThread
2493 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2494 }
2495
2496 type CommentThreadListResponse struct {
2497 // Etag: Etag of this resource.
2498 Etag string `json:"etag,omitempty"`
2499 // EventId: Serialized EventId of the request which produced this response.
2500 EventId string `json:"eventId,omitempty"`
2501 // Items: A list of comment threads that match the request criteria.
2502 Items []*CommentThread `json:"items,omitempty"`
2503 // Kind: Identifies what kind of resource this is. Value: the fixed string
2504 // "youtube#commentThreadListResponse".
2505 Kind string `json:"kind,omitempty"`
2506 // NextPageToken: The token that can be used as the value of the pageToken
2507 // parameter to retrieve the next page in the result set.
2508 NextPageToken string `json:"nextPageToken,omitempty"`
2509 // PageInfo: General pagination information.
2510 PageInfo *PageInfo `json:"pageInfo,omitempty"`
2511 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
2512 // VisitorId: The visitorId identifies the visitor.
2513 VisitorId string `json:"visitorId,omitempty"`
2514
2515 // ServerResponse contains the HTTP response code and headers from the server.
2516 googleapi.ServerResponse `json:"-"`
2517 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
2518 // include in API requests. By default, fields with empty or default values are
2519 // omitted from API requests. See
2520 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2521 // details.
2522 ForceSendFields []string `json:"-"`
2523 // NullFields is a list of field names (e.g. "Etag") to include in API requests
2524 // with the JSON null value. By default, fields with empty values are omitted
2525 // from API requests. See
2526 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2527 NullFields []string `json:"-"`
2528 }
2529
2530 func (s CommentThreadListResponse) MarshalJSON() ([]byte, error) {
2531 type NoMethod CommentThreadListResponse
2532 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2533 }
2534
2535 // CommentThreadReplies: Comments written in (direct or indirect) reply to the
2536 // top level comment.
2537 type CommentThreadReplies struct {
2538 // Comments: A limited number of replies. Unless the number of replies returned
2539 // equals total_reply_count in the snippet the returned replies are only a
2540 // subset of the total number of replies.
2541 Comments []*Comment `json:"comments,omitempty"`
2542 // ForceSendFields is a list of field names (e.g. "Comments") to
2543 // unconditionally include in API requests. By default, fields with empty or
2544 // default values are omitted from API requests. See
2545 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2546 // details.
2547 ForceSendFields []string `json:"-"`
2548 // NullFields is a list of field names (e.g. "Comments") to include in API
2549 // requests with the JSON null value. By default, fields with empty values are
2550 // omitted from API requests. See
2551 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2552 NullFields []string `json:"-"`
2553 }
2554
2555 func (s CommentThreadReplies) MarshalJSON() ([]byte, error) {
2556 type NoMethod CommentThreadReplies
2557 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2558 }
2559
2560 // CommentThreadSnippet: Basic details about a comment thread.
2561 type CommentThreadSnippet struct {
2562 // CanReply: Whether the current viewer of the thread can reply to it. This is
2563 // viewer specific - other viewers may see a different value for this field.
2564 CanReply bool `json:"canReply,omitempty"`
2565 // ChannelId: The YouTube channel the comments in the thread refer to or the
2566 // channel with the video the comments refer to. If neither video_id nor
2567 // post_id is set the comments refer to the channel itself.
2568 ChannelId string `json:"channelId,omitempty"`
2569 // IsPublic: Whether the thread (and therefore all its comments) is visible to
2570 // all YouTube users.
2571 IsPublic bool `json:"isPublic,omitempty"`
2572 // PostId: The ID of the post the comments refer to, if any.
2573 PostId string `json:"postId,omitempty"`
2574 // TopLevelComment: The top level comment of this thread.
2575 TopLevelComment *Comment `json:"topLevelComment,omitempty"`
2576 // TotalReplyCount: The total number of replies (not including the top level
2577 // comment).
2578 TotalReplyCount int64 `json:"totalReplyCount,omitempty"`
2579 // VideoId: The ID of the video the comments refer to, if any.
2580 VideoId string `json:"videoId,omitempty"`
2581 // ForceSendFields is a list of field names (e.g. "CanReply") to
2582 // unconditionally include in API requests. By default, fields with empty or
2583 // default values are omitted from API requests. See
2584 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
2585 // details.
2586 ForceSendFields []string `json:"-"`
2587 // NullFields is a list of field names (e.g. "CanReply") to include in API
2588 // requests with the JSON null value. By default, fields with empty values are
2589 // omitted from API requests. See
2590 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
2591 NullFields []string `json:"-"`
2592 }
2593
2594 func (s CommentThreadSnippet) MarshalJSON() ([]byte, error) {
2595 type NoMethod CommentThreadSnippet
2596 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
2597 }
2598
2599 // ContentRating: Ratings schemes. The country-specific ratings are mostly for
2600 // movies and shows. LINT.IfChange
2601 type ContentRating struct {
2602 // AcbRating: The video's Australian Classification Board (ACB) or Australian
2603 // Communications and Media Authority (ACMA) rating. ACMA ratings are used to
2604 // classify children's television programming.
2605 //
2606 // Possible values:
2607 // "acbUnspecified"
2608 // "acbE" - E
2609 // "acbP" - Programs that have been given a P classification by the
2610 // Australian Communications and Media Authority. These programs are intended
2611 // for preschool children.
2612 // "acbC" - Programs that have been given a C classification by the
2613 // Australian Communications and Media Authority. These programs are intended
2614 // for children (other than preschool children) who are younger than 14 years
2615 // of age.
2616 // "acbG" - G
2617 // "acbPg" - PG
2618 // "acbM" - M
2619 // "acbMa15plus" - MA15+
2620 // "acbR18plus" - R18+
2621 // "acbUnrated"
2622 AcbRating string `json:"acbRating,omitempty"`
2623 // AgcomRating: The video's rating from Italy's Autorità per le Garanzie nelle
2624 // Comunicazioni (AGCOM).
2625 //
2626 // Possible values:
2627 // "agcomUnspecified"
2628 // "agcomT" - T
2629 // "agcomVm14" - VM14
2630 // "agcomVm18" - VM18
2631 // "agcomUnrated"
2632 AgcomRating string `json:"agcomRating,omitempty"`
2633 // AnatelRating: The video's Anatel (Asociación Nacional de Televisión)
2634 // rating for Chilean television.
2635 //
2636 // Possible values:
2637 // "anatelUnspecified"
2638 // "anatelF" - F
2639 // "anatelI" - I
2640 // "anatelI7" - I-7
2641 // "anatelI10" - I-10
2642 // "anatelI12" - I-12
2643 // "anatelR" - R
2644 // "anatelA" - A
2645 // "anatelUnrated"
2646 AnatelRating string `json:"anatelRating,omitempty"`
2647 // BbfcRating: The video's British Board of Film Classification (BBFC) rating.
2648 //
2649 // Possible values:
2650 // "bbfcUnspecified"
2651 // "bbfcU" - U
2652 // "bbfcPg" - PG
2653 // "bbfc12a" - 12A
2654 // "bbfc12" - 12
2655 // "bbfc15" - 15
2656 // "bbfc18" - 18
2657 // "bbfcR18" - R18
2658 // "bbfcUnrated"
2659 BbfcRating string `json:"bbfcRating,omitempty"`
2660 // BfvcRating: The video's rating from Thailand's Board of Film and Video
2661 // Censors.
2662 //
2663 // Possible values:
2664 // "bfvcUnspecified"
2665 // "bfvcG" - G
2666 // "bfvcE" - E
2667 // "bfvc13" - 13
2668 // "bfvc15" - 15
2669 // "bfvc18" - 18
2670 // "bfvc20" - 20
2671 // "bfvcB" - B
2672 // "bfvcUnrated"
2673 BfvcRating string `json:"bfvcRating,omitempty"`
2674 // BmukkRating: The video's rating from the Austrian Board of Media
2675 // Classification (Bundesministerium für Unterricht, Kunst und Kultur).
2676 //
2677 // Possible values:
2678 // "bmukkUnspecified"
2679 // "bmukkAa" - Unrestricted
2680 // "bmukk6" - 6+
2681 // "bmukk8" - 8+
2682 // "bmukk10" - 10+
2683 // "bmukk12" - 12+
2684 // "bmukk14" - 14+
2685 // "bmukk16" - 16+
2686 // "bmukkUnrated"
2687 BmukkRating string `json:"bmukkRating,omitempty"`
2688 // CatvRating: Rating system for Canadian TV - Canadian TV Classification
2689 // System The video's rating from the Canadian Radio-Television and
2690 // Telecommunications Commission (CRTC) for Canadian English-language
2691 // broadcasts. For more information, see the Canadian Broadcast Standards
2692 // Council website.
2693 //
2694 // Possible values:
2695 // "catvUnspecified"
2696 // "catvC" - C
2697 // "catvC8" - C8
2698 // "catvG" - G
2699 // "catvPg" - PG
2700 // "catv14plus" - 14+
2701 // "catv18plus" - 18+
2702 // "catvUnrated"
2703 // "catvE"
2704 CatvRating string `json:"catvRating,omitempty"`
2705 // CatvfrRating: The video's rating from the Canadian Radio-Television and
2706 // Telecommunications Commission (CRTC) for Canadian French-language
2707 // broadcasts. For more information, see the Canadian Broadcast Standards
2708 // Council website.
2709 //
2710 // Possible values:
2711 // "catvfrUnspecified"
2712 // "catvfrG" - G
2713 // "catvfr8plus" - 8+
2714 // "catvfr13plus" - 13+
2715 // "catvfr16plus" - 16+
2716 // "catvfr18plus" - 18+
2717 // "catvfrUnrated"
2718 // "catvfrE"
2719 CatvfrRating string `json:"catvfrRating,omitempty"`
2720 // CbfcRating: The video's Central Board of Film Certification (CBFC - India)
2721 // rating.
2722 //
2723 // Possible values:
2724 // "cbfcUnspecified"
2725 // "cbfcU" - U
2726 // "cbfcUA" - U/A
2727 // "cbfcUA7plus" - U/A 7+
2728 // "cbfcUA13plus" - U/A 13+
2729 // "cbfcUA16plus" - U/A 16+
2730 // "cbfcA" - A
2731 // "cbfcS" - S
2732 // "cbfcUnrated"
2733 CbfcRating string `json:"cbfcRating,omitempty"`
2734 // CccRating: The video's Consejo de Calificación Cinematográfica (Chile)
2735 // rating.
2736 //
2737 // Possible values:
2738 // "cccUnspecified"
2739 // "cccTe" - Todo espectador
2740 // "ccc6" - 6+ - Inconveniente para menores de 7 años
2741 // "ccc14" - 14+
2742 // "ccc18" - 18+
2743 // "ccc18v" - 18+ - contenido excesivamente violento
2744 // "ccc18s" - 18+ - contenido pornográfico
2745 // "cccUnrated"
2746 CccRating string `json:"cccRating,omitempty"`
2747 // CceRating: The video's rating from Portugal's Comissão de Classificação
2748 // de Espect´culos.
2749 //
2750 // Possible values:
2751 // "cceUnspecified"
2752 // "cceM4" - 4
2753 // "cceM6" - 6
2754 // "cceM12" - 12
2755 // "cceM16" - 16
2756 // "cceM18" - 18
2757 // "cceUnrated"
2758 // "cceM14" - 14
2759 CceRating string `json:"cceRating,omitempty"`
2760 // ChfilmRating: The video's rating in Switzerland.
2761 //
2762 // Possible values:
2763 // "chfilmUnspecified"
2764 // "chfilm0" - 0
2765 // "chfilm6" - 6
2766 // "chfilm12" - 12
2767 // "chfilm16" - 16
2768 // "chfilm18" - 18
2769 // "chfilmUnrated"
2770 ChfilmRating string `json:"chfilmRating,omitempty"`
2771 // ChvrsRating: The video's Canadian Home Video Rating System (CHVRS) rating.
2772 //
2773 // Possible values:
2774 // "chvrsUnspecified"
2775 // "chvrsG" - G
2776 // "chvrsPg" - PG
2777 // "chvrs14a" - 14A
2778 // "chvrs18a" - 18A
2779 // "chvrsR" - R
2780 // "chvrsE" - E
2781 // "chvrsUnrated"
2782 ChvrsRating string `json:"chvrsRating,omitempty"`
2783 // CicfRating: The video's rating from the Commission de Contrôle des Films
2784 // (Belgium).
2785 //
2786 // Possible values:
2787 // "cicfUnspecified"
2788 // "cicfE" - E
2789 // "cicfKtEa" - KT/EA
2790 // "cicfKntEna" - KNT/ENA
2791 // "cicfUnrated"
2792 CicfRating string `json:"cicfRating,omitempty"`
2793 // CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL
2794 // AUDIOVIZUALULUI (CNA).
2795 //
2796 // Possible values:
2797 // "cnaUnspecified"
2798 // "cnaAp" - AP
2799 // "cna12" - 12
2800 // "cna15" - 15
2801 // "cna18" - 18
2802 // "cna18plus" - 18+
2803 // "cnaUnrated"
2804 CnaRating string `json:"cnaRating,omitempty"`
2805 // CncRating: Rating system in France - Commission de classification
2806 // cinematographique
2807 //
2808 // Possible values:
2809 // "cncUnspecified"
2810 // "cncT" - T
2811 // "cnc10" - 10
2812 // "cnc12" - 12
2813 // "cnc16" - 16
2814 // "cnc18" - 18
2815 // "cncE" - E
2816 // "cncInterdiction" - interdiction
2817 // "cncUnrated"
2818 CncRating string `json:"cncRating,omitempty"`
2819 // CsaRating: The video's rating from France's Conseil supérieur de
2820 // l’audiovisuel, which rates broadcast content.
2821 //
2822 // Possible values:
2823 // "csaUnspecified"
2824 // "csaT" - T
2825 // "csa10" - 10
2826 // "csa12" - 12
2827 // "csa16" - 16
2828 // "csa18" - 18
2829 // "csaInterdiction" - Interdiction
2830 // "csaUnrated"
2831 CsaRating string `json:"csaRating,omitempty"`
2832 // CscfRating: The video's rating from Luxembourg's Commission de surveillance
2833 // de la classification des films (CSCF).
2834 //
2835 // Possible values:
2836 // "cscfUnspecified"
2837 // "cscfAl" - AL
2838 // "cscfA" - A
2839 // "cscf6" - 6
2840 // "cscf9" - 9
2841 // "cscf12" - 12
2842 // "cscf16" - 16
2843 // "cscf18" - 18
2844 // "cscfUnrated"
2845 CscfRating string `json:"cscfRating,omitempty"`
2846 // CzfilmRating: The video's rating in the Czech Republic.
2847 //
2848 // Possible values:
2849 // "czfilmUnspecified"
2850 // "czfilmU" - U
2851 // "czfilm12" - 12
2852 // "czfilm14" - 14
2853 // "czfilm18" - 18
2854 // "czfilmUnrated"
2855 CzfilmRating string `json:"czfilmRating,omitempty"`
2856 // DjctqRating: The video's Departamento de Justiça, Classificação,
2857 // Qualificação e Títulos (DJCQT - Brazil) rating.
2858 //
2859 // Possible values:
2860 // "djctqUnspecified"
2861 // "djctqL" - L
2862 // "djctq10" - 10
2863 // "djctq12" - 12
2864 // "djctq14" - 14
2865 // "djctq16" - 16
2866 // "djctq18" - 18
2867 // "djctqEr"
2868 // "djctqL10"
2869 // "djctqL12"
2870 // "djctqL14"
2871 // "djctqL16"
2872 // "djctqL18"
2873 // "djctq1012"
2874 // "djctq1014"
2875 // "djctq1016"
2876 // "djctq1018"
2877 // "djctq1214"
2878 // "djctq1216"
2879 // "djctq1218"
2880 // "djctq1416"
2881 // "djctq1418"
2882 // "djctq1618"
2883 // "djctqUnrated"
2884 DjctqRating string `json:"djctqRating,omitempty"`
2885 // DjctqRatingReasons: Reasons that explain why the video received its DJCQT
2886 // (Brazil) rating.
2887 //
2888 // Possible values:
2889 // "djctqRatingReasonUnspecified"
2890 // "djctqViolence" - Brazil rating content descriptors. See
2891 // http://go/brazilratings section F. Violência (Violence)
2892 // "djctqExtremeViolence" - Violência extrema (Extreme violence)
2893 // "djctqSexualContent" - Conteúdo sexual (Sexual content)
2894 // "djctqNudity" - Nudez (Nudity)
2895 // "djctqSex" - Sexo (Sex)
2896 // "djctqExplicitSex" - Sexo Explícito (Explicit sex)
2897 // "djctqDrugs" - Drogas (Drugs)
2898 // "djctqLegalDrugs" - Drogas Lícitas (Legal drugs)
2899 // "djctqIllegalDrugs" - Drogas Ilícitas (Illegal drugs)
2900 // "djctqInappropriateLanguage" - Linguagem Imprópria (Inappropriate
2901 // language)
2902 // "djctqCriminalActs" - Atos Criminosos (Criminal Acts)
2903 // "djctqImpactingContent" - Conteúdo Impactante (Impacting content)
2904 // "djctqFear" - Temer (Fear)
2905 // "djctqMedicalProcedures" - Procedimentos médicos (Medical Procedures)
2906 // "djctqSensitiveTopics" - Tópicos sensíveis (Sensitive Topics)
2907 // "djctqFantasyViolence" - Fantasia Violência (Fantasy Violence)
2908 DjctqRatingReasons []string `json:"djctqRatingReasons,omitempty"`
2909 // EcbmctRating: Rating system in Turkey - Evaluation and Classification Board
2910 // of the Ministry of Culture and Tourism
2911 //
2912 // Possible values:
2913 // "ecbmctUnspecified"
2914 // "ecbmctG" - G
2915 // "ecbmct7a" - 7A
2916 // "ecbmct7plus" - 7+
2917 // "ecbmct13a" - 13A
2918 // "ecbmct13plus" - 13+
2919 // "ecbmct15a" - 15A
2920 // "ecbmct15plus" - 15+
2921 // "ecbmct18plus" - 18+
2922 // "ecbmctUnrated"
2923 EcbmctRating string `json:"ecbmctRating,omitempty"`
2924 // EefilmRating: The video's rating in Estonia.
2925 //
2926 // Possible values:
2927 // "eefilmUnspecified"
2928 // "eefilmPere" - Pere
2929 // "eefilmL" - L
2930 // "eefilmMs6" - MS-6
2931 // "eefilmK6" - K-6
2932 // "eefilmMs12" - MS-12
2933 // "eefilmK12" - K-12
2934 // "eefilmK14" - K-14
2935 // "eefilmK16" - K-16
2936 // "eefilmUnrated"
2937 EefilmRating string `json:"eefilmRating,omitempty"`
2938 // EgfilmRating: The video's rating in Egypt.
2939 //
2940 // Possible values:
2941 // "egfilmUnspecified"
2942 // "egfilmGn" - GN
2943 // "egfilm18" - 18
2944 // "egfilmBn" - BN
2945 // "egfilmUnrated"
2946 EgfilmRating string `json:"egfilmRating,omitempty"`
2947 // EirinRating: The video's Eirin (映倫) rating. Eirin is the Japanese rating
2948 // system.
2949 //
2950 // Possible values:
2951 // "eirinUnspecified"
2952 // "eirinG" - G
2953 // "eirinPg12" - PG-12
2954 // "eirinR15plus" - R15+
2955 // "eirinR18plus" - R18+
2956 // "eirinUnrated"
2957 EirinRating string `json:"eirinRating,omitempty"`
2958 // FcbmRating: The video's rating from Malaysia's Film Censorship Board.
2959 //
2960 // Possible values:
2961 // "fcbmUnspecified"
2962 // "fcbmU" - U
2963 // "fcbmPg13" - PG13
2964 // "fcbmP13" - P13
2965 // "fcbm18" - 18
2966 // "fcbm18sx" - 18SX
2967 // "fcbm18pa" - 18PA
2968 // "fcbm18sg" - 18SG
2969 // "fcbm18pl" - 18PL
2970 // "fcbmUnrated"
2971 FcbmRating string `json:"fcbmRating,omitempty"`
2972 // FcoRating: The video's rating from Hong Kong's Office for Film, Newspaper
2973 // and Article Administration.
2974 //
2975 // Possible values:
2976 // "fcoUnspecified"
2977 // "fcoI" - I
2978 // "fcoIia" - IIA
2979 // "fcoIib" - IIB
2980 // "fcoIi" - II
2981 // "fcoIii" - III
2982 // "fcoUnrated"
2983 FcoRating string `json:"fcoRating,omitempty"`
2984 // FmocRating: This property has been deprecated. Use the
2985 // contentDetails.contentRating.cncRating instead.
2986 //
2987 // Possible values:
2988 // "fmocUnspecified"
2989 // "fmocU" - U
2990 // "fmoc10" - 10
2991 // "fmoc12" - 12
2992 // "fmoc16" - 16
2993 // "fmoc18" - 18
2994 // "fmocE" - E
2995 // "fmocUnrated"
2996 FmocRating string `json:"fmocRating,omitempty"`
2997 // FpbRating: The video's rating from South Africa's Film and Publication
2998 // Board.
2999 //
3000 // Possible values:
3001 // "fpbUnspecified"
3002 // "fpbA" - A
3003 // "fpbPg" - PG
3004 // "fpb79Pg" - 7-9PG
3005 // "fpb1012Pg" - 10-12PG
3006 // "fpb13" - 13
3007 // "fpb16" - 16
3008 // "fpb18" - 18
3009 // "fpbX18" - X18
3010 // "fpbXx" - XX
3011 // "fpbUnrated"
3012 // "fpb10" - 10
3013 FpbRating string `json:"fpbRating,omitempty"`
3014 // FpbRatingReasons: Reasons that explain why the video received its FPB (South
3015 // Africa) rating.
3016 //
3017 // Possible values:
3018 // "fpbRatingReasonUnspecified"
3019 // "fpbBlasphemy" - South Africa rating content descriptors.
3020 // "fpbLanguage"
3021 // "fpbNudity"
3022 // "fpbPrejudice"
3023 // "fpbSex"
3024 // "fpbViolence"
3025 // "fpbDrugs"
3026 // "fpbSexualViolence"
3027 // "fpbHorror"
3028 // "fpbCriminalTechniques"
3029 // "fpbImitativeActsTechniques"
3030 FpbRatingReasons []string `json:"fpbRatingReasons,omitempty"`
3031 // FskRating: The video's Freiwillige Selbstkontrolle der Filmwirtschaft (FSK -
3032 // Germany) rating.
3033 //
3034 // Possible values:
3035 // "fskUnspecified"
3036 // "fsk0" - FSK 0
3037 // "fsk6" - FSK 6
3038 // "fsk12" - FSK 12
3039 // "fsk16" - FSK 16
3040 // "fsk18" - FSK 18
3041 // "fskUnrated"
3042 FskRating string `json:"fskRating,omitempty"`
3043 // GrfilmRating: The video's rating in Greece.
3044 //
3045 // Possible values:
3046 // "grfilmUnspecified"
3047 // "grfilmK" - K
3048 // "grfilmE" - E
3049 // "grfilmK12" - K-12
3050 // "grfilmK13" - K-13
3051 // "grfilmK15" - K-15
3052 // "grfilmK17" - K-17
3053 // "grfilmK18" - K-18
3054 // "grfilmUnrated"
3055 GrfilmRating string `json:"grfilmRating,omitempty"`
3056 // IcaaRating: The video's Instituto de la Cinematografía y de las Artes
3057 // Audiovisuales (ICAA - Spain) rating.
3058 //
3059 // Possible values:
3060 // "icaaUnspecified"
3061 // "icaaApta" - APTA
3062 // "icaa7" - 7
3063 // "icaa12" - 12
3064 // "icaa13" - 13
3065 // "icaa16" - 16
3066 // "icaa18" - 18
3067 // "icaaX" - X
3068 // "icaaUnrated"
3069 IcaaRating string `json:"icaaRating,omitempty"`
3070 // IfcoRating: The video's Irish Film Classification Office (IFCO - Ireland)
3071 // rating. See the IFCO website for more information.
3072 //
3073 // Possible values:
3074 // "ifcoUnspecified"
3075 // "ifcoG" - G
3076 // "ifcoPg" - PG
3077 // "ifco12" - 12
3078 // "ifco12a" - 12A
3079 // "ifco15" - 15
3080 // "ifco15a" - 15A
3081 // "ifco16" - 16
3082 // "ifco18" - 18
3083 // "ifcoUnrated"
3084 IfcoRating string `json:"ifcoRating,omitempty"`
3085 // IlfilmRating: The video's rating in Israel.
3086 //
3087 // Possible values:
3088 // "ilfilmUnspecified"
3089 // "ilfilmAa" - AA
3090 // "ilfilm12" - 12
3091 // "ilfilm14" - 14
3092 // "ilfilm16" - 16
3093 // "ilfilm18" - 18
3094 // "ilfilmUnrated"
3095 IlfilmRating string `json:"ilfilmRating,omitempty"`
3096 // IncaaRating: The video's INCAA (Instituto Nacional de Cine y Artes
3097 // Audiovisuales - Argentina) rating.
3098 //
3099 // Possible values:
3100 // "incaaUnspecified"
3101 // "incaaAtp" - ATP (Apta para todo publico)
3102 // "incaaSam13" - 13 (Solo apta para mayores de 13 años)
3103 // "incaaSam16" - 16 (Solo apta para mayores de 16 años)
3104 // "incaaSam18" - 18 (Solo apta para mayores de 18 años)
3105 // "incaaC" - X (Solo apta para mayores de 18 años, de exhibición
3106 // condicionada)
3107 // "incaaUnrated"
3108 IncaaRating string `json:"incaaRating,omitempty"`
3109 // KfcbRating: The video's rating from the Kenya Film Classification Board.
3110 //
3111 // Possible values:
3112 // "kfcbUnspecified"
3113 // "kfcbG" - GE
3114 // "kfcbPg" - PG
3115 // "kfcb16plus" - 16
3116 // "kfcbR" - 18
3117 // "kfcbUnrated"
3118 KfcbRating string `json:"kfcbRating,omitempty"`
3119 // KijkwijzerRating: The video's NICAM/Kijkwijzer rating from the Nederlands
3120 // Instituut voor de Classificatie van Audiovisuele Media (Netherlands).
3121 //
3122 // Possible values:
3123 // "kijkwijzerUnspecified"
3124 // "kijkwijzerAl" - AL
3125 // "kijkwijzer6" - 6
3126 // "kijkwijzer9" - 9
3127 // "kijkwijzer12" - 12
3128 // "kijkwijzer16" - 16
3129 // "kijkwijzer18"
3130 // "kijkwijzerUnrated"
3131 KijkwijzerRating string `json:"kijkwijzerRating,omitempty"`
3132 // KmrbRating: The video's Korea Media Rating Board (영상물등급위원회)
3133 // rating. The KMRB rates videos in South Korea.
3134 //
3135 // Possible values:
3136 // "kmrbUnspecified"
3137 // "kmrbAll" - 전체관람가
3138 // "kmrb12plus" - 12세 이상 관람가
3139 // "kmrb15plus" - 15세 이상 관람가
3140 // "kmrbTeenr"
3141 // "kmrbR" - 청소년 관람불가
3142 // "kmrbUnrated"
3143 KmrbRating string `json:"kmrbRating,omitempty"`
3144 // LsfRating: The video's rating from Indonesia's Lembaga Sensor Film.
3145 //
3146 // Possible values:
3147 // "lsfUnspecified"
3148 // "lsfSu" - SU
3149 // "lsfA" - A
3150 // "lsfBo" - BO
3151 // "lsf13" - 13
3152 // "lsfR" - R
3153 // "lsf17" - 17
3154 // "lsfD" - D
3155 // "lsf21" - 21
3156 // "lsfUnrated"
3157 LsfRating string `json:"lsfRating,omitempty"`
3158 // MccaaRating: The video's rating from Malta's Film Age-Classification Board.
3159 //
3160 // Possible values:
3161 // "mccaaUnspecified"
3162 // "mccaaU" - U
3163 // "mccaaPg" - PG
3164 // "mccaa12a" - 12A
3165 // "mccaa12" - 12
3166 // "mccaa14" - 14 - this rating was removed from the new classification
3167 // structure introduced in 2013.
3168 // "mccaa15" - 15
3169 // "mccaa16" - 16 - this rating was removed from the new classification
3170 // structure introduced in 2013.
3171 // "mccaa18" - 18
3172 // "mccaaUnrated"
3173 MccaaRating string `json:"mccaaRating,omitempty"`
3174 // MccypRating: The video's rating from the Danish Film Institute's (Det Danske
3175 // Filminstitut) Media Council for Children and Young People.
3176 //
3177 // Possible values:
3178 // "mccypUnspecified"
3179 // "mccypA" - A
3180 // "mccyp7" - 7
3181 // "mccyp11" - 11
3182 // "mccyp15" - 15
3183 // "mccypUnrated"
3184 MccypRating string `json:"mccypRating,omitempty"`
3185 // McstRating: The video's rating system for Vietnam - MCST
3186 //
3187 // Possible values:
3188 // "mcstUnspecified"
3189 // "mcstP" - P
3190 // "mcst0" - 0
3191 // "mcstC13" - C13
3192 // "mcstC16" - C16
3193 // "mcst16plus" - 16+
3194 // "mcstC18" - C18
3195 // "mcstGPg" - MCST_G_PG
3196 // "mcstUnrated"
3197 McstRating string `json:"mcstRating,omitempty"`
3198 // MdaRating: The video's rating from Singapore's Media Development Authority
3199 // (MDA) and, specifically, it's Board of Film Censors (BFC).
3200 //
3201 // Possible values:
3202 // "mdaUnspecified"
3203 // "mdaG" - G
3204 // "mdaPg" - PG
3205 // "mdaPg13" - PG13
3206 // "mdaNc16" - NC16
3207 // "mdaM18" - M18
3208 // "mdaR21" - R21
3209 // "mdaUnrated"
3210 MdaRating string `json:"mdaRating,omitempty"`
3211 // MedietilsynetRating: The video's rating from Medietilsynet, the Norwegian
3212 // Media Authority.
3213 //
3214 // Possible values:
3215 // "medietilsynetUnspecified"
3216 // "medietilsynetA" - A
3217 // "medietilsynet6" - 6
3218 // "medietilsynet7" - 7
3219 // "medietilsynet9" - 9
3220 // "medietilsynet11" - 11
3221 // "medietilsynet12" - 12
3222 // "medietilsynet15" - 15
3223 // "medietilsynet18" - 18
3224 // "medietilsynetUnrated"
3225 MedietilsynetRating string `json:"medietilsynetRating,omitempty"`
3226 // MekuRating: The video's rating from Finland's Kansallinen Audiovisuaalinen
3227 // Instituutti (National Audiovisual Institute).
3228 //
3229 // Possible values:
3230 // "mekuUnspecified"
3231 // "mekuS" - S
3232 // "meku7" - 7
3233 // "meku12" - 12
3234 // "meku16" - 16
3235 // "meku18" - 18
3236 // "mekuUnrated"
3237 MekuRating string `json:"mekuRating,omitempty"`
3238 // MenaMpaaRating: The rating system for MENA countries, a clone of MPAA. It is
3239 // needed to prevent titles go live w/o additional QC check, since some of them
3240 // can be inappropriate for the countries at all. See b/33408548 for more
3241 // details.
3242 //
3243 // Possible values:
3244 // "menaMpaaUnspecified"
3245 // "menaMpaaG" - G
3246 // "menaMpaaPg" - PG
3247 // "menaMpaaPg13" - PG-13
3248 // "menaMpaaR" - R
3249 // "menaMpaaUnrated" - To keep the same enum values as MPAA's items have,
3250 // skip NC_17.
3251 MenaMpaaRating string `json:"menaMpaaRating,omitempty"`
3252 // MibacRating: The video's rating from the Ministero dei Beni e delle
3253 // Attività Culturali e del Turismo (Italy).
3254 //
3255 // Possible values:
3256 // "mibacUnspecified"
3257 // "mibacT"
3258 // "mibacVap"
3259 // "mibacVm6"
3260 // "mibacVm12"
3261 // "mibacVm14"
3262 // "mibacVm16"
3263 // "mibacVm18"
3264 // "mibacUnrated"
3265 MibacRating string `json:"mibacRating,omitempty"`
3266 // MocRating: The video's Ministerio de Cultura (Colombia) rating.
3267 //
3268 // Possible values:
3269 // "mocUnspecified"
3270 // "mocE" - E
3271 // "mocT" - T
3272 // "moc7" - 7
3273 // "moc12" - 12
3274 // "moc15" - 15
3275 // "moc18" - 18
3276 // "mocX" - X
3277 // "mocBanned" - Banned
3278 // "mocUnrated"
3279 MocRating string `json:"mocRating,omitempty"`
3280 // MoctwRating: The video's rating from Taiwan's Ministry of Culture
3281 // (文化部).
3282 //
3283 // Possible values:
3284 // "moctwUnspecified"
3285 // "moctwG" - G
3286 // "moctwP" - P
3287 // "moctwPg" - PG
3288 // "moctwR" - R
3289 // "moctwUnrated"
3290 // "moctwR12" - R-12
3291 // "moctwR15" - R-15
3292 MoctwRating string `json:"moctwRating,omitempty"`
3293 // MpaaRating: The video's Motion Picture Association of America (MPAA) rating.
3294 //
3295 // Possible values:
3296 // "mpaaUnspecified"
3297 // "mpaaG" - G
3298 // "mpaaPg" - PG
3299 // "mpaaPg13" - PG-13
3300 // "mpaaR" - R
3301 // "mpaaNc17" - NC-17
3302 // "mpaaX" - ! X
3303 // "mpaaUnrated"
3304 MpaaRating string `json:"mpaaRating,omitempty"`
3305 // MpaatRating: The rating system for trailer, DVD, and Ad in the US. See
3306 // http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html.
3307 //
3308 // Possible values:
3309 // "mpaatUnspecified"
3310 // "mpaatGb" - GB
3311 // "mpaatRb" - RB
3312 MpaatRating string `json:"mpaatRating,omitempty"`
3313 // MtrcbRating: The video's rating from the Movie and Television Review and
3314 // Classification Board (Philippines).
3315 //
3316 // Possible values:
3317 // "mtrcbUnspecified"
3318 // "mtrcbG" - G
3319 // "mtrcbPg" - PG
3320 // "mtrcbR13" - R-13
3321 // "mtrcbR16" - R-16
3322 // "mtrcbR18" - R-18
3323 // "mtrcbX" - X
3324 // "mtrcbUnrated"
3325 MtrcbRating string `json:"mtrcbRating,omitempty"`
3326 // NbcRating: The video's rating from the Maldives National Bureau of
3327 // Classification.
3328 //
3329 // Possible values:
3330 // "nbcUnspecified"
3331 // "nbcG" - G
3332 // "nbcPg" - PG
3333 // "nbc12plus" - 12+
3334 // "nbc15plus" - 15+
3335 // "nbc18plus" - 18+
3336 // "nbc18plusr" - 18+R
3337 // "nbcPu" - PU
3338 // "nbcUnrated"
3339 NbcRating string `json:"nbcRating,omitempty"`
3340 // NbcplRating: The video's rating in Poland.
3341 //
3342 // Possible values:
3343 // "nbcplUnspecified"
3344 // "nbcplI"
3345 // "nbcplIi"
3346 // "nbcplIii"
3347 // "nbcplIv"
3348 // "nbcpl18plus"
3349 // "nbcplUnrated"
3350 NbcplRating string `json:"nbcplRating,omitempty"`
3351 // NfrcRating: The video's rating from the Bulgarian National Film Center.
3352 //
3353 // Possible values:
3354 // "nfrcUnspecified"
3355 // "nfrcA" - A
3356 // "nfrcB" - B
3357 // "nfrcC" - C
3358 // "nfrcD" - D
3359 // "nfrcX" - X
3360 // "nfrcUnrated"
3361 NfrcRating string `json:"nfrcRating,omitempty"`
3362 // NfvcbRating: The video's rating from Nigeria's National Film and Video
3363 // Censors Board.
3364 //
3365 // Possible values:
3366 // "nfvcbUnspecified"
3367 // "nfvcbG" - G
3368 // "nfvcbPg" - PG
3369 // "nfvcb12" - 12
3370 // "nfvcb12a" - 12A
3371 // "nfvcb15" - 15
3372 // "nfvcb18" - 18
3373 // "nfvcbRe" - RE
3374 // "nfvcbUnrated"
3375 NfvcbRating string `json:"nfvcbRating,omitempty"`
3376 // NkclvRating: The video's rating from the Nacionãlais Kino centrs (National
3377 // Film Centre of Latvia).
3378 //
3379 // Possible values:
3380 // "nkclvUnspecified"
3381 // "nkclvU" - U
3382 // "nkclv7plus" - 7+
3383 // "nkclv12plus" - 12+
3384 // "nkclv16plus" - ! 16+
3385 // "nkclv18plus" - 18+
3386 // "nkclvUnrated"
3387 NkclvRating string `json:"nkclvRating,omitempty"`
3388 // NmcRating: The National Media Council ratings system for United Arab
3389 // Emirates.
3390 //
3391 // Possible values:
3392 // "nmcUnspecified"
3393 // "nmcG" - G
3394 // "nmcPg" - PG
3395 // "nmcPg13" - PG-13
3396 // "nmcPg15" - PG-15
3397 // "nmc15plus" - 15+
3398 // "nmc18plus" - 18+
3399 // "nmc18tc" - 18TC
3400 // "nmcUnrated"
3401 NmcRating string `json:"nmcRating,omitempty"`
3402 // OflcRating: The video's Office of Film and Literature Classification (OFLC -
3403 // New Zealand) rating.
3404 //
3405 // Possible values:
3406 // "oflcUnspecified"
3407 // "oflcG" - G
3408 // "oflcPg" - PG
3409 // "oflcM" - M
3410 // "oflcR13" - R13
3411 // "oflcR15" - R15
3412 // "oflcR16" - R16
3413 // "oflcR18" - R18
3414 // "oflcUnrated"
3415 // "oflcRp13" - RP13
3416 // "oflcRp16" - RP16
3417 // "oflcRp18" - RP18
3418 OflcRating string `json:"oflcRating,omitempty"`
3419 // PefilmRating: The video's rating in Peru.
3420 //
3421 // Possible values:
3422 // "pefilmUnspecified"
3423 // "pefilmPt" - PT
3424 // "pefilmPg" - PG
3425 // "pefilm14" - 14
3426 // "pefilm18" - 18
3427 // "pefilmUnrated"
3428 PefilmRating string `json:"pefilmRating,omitempty"`
3429 // RcnofRating: The video's rating from the Hungarian Nemzeti Filmiroda, the
3430 // Rating Committee of the National Office of Film.
3431 //
3432 // Possible values:
3433 // "rcnofUnspecified"
3434 // "rcnofI"
3435 // "rcnofIi"
3436 // "rcnofIii"
3437 // "rcnofIv"
3438 // "rcnofV"
3439 // "rcnofVi"
3440 // "rcnofUnrated"
3441 RcnofRating string `json:"rcnofRating,omitempty"`
3442 // ResorteviolenciaRating: The video's rating in Venezuela.
3443 //
3444 // Possible values:
3445 // "resorteviolenciaUnspecified"
3446 // "resorteviolenciaA" - A
3447 // "resorteviolenciaB" - B
3448 // "resorteviolenciaC" - C
3449 // "resorteviolenciaD" - D
3450 // "resorteviolenciaE" - E
3451 // "resorteviolenciaUnrated"
3452 ResorteviolenciaRating string `json:"resorteviolenciaRating,omitempty"`
3453 // RtcRating: The video's General Directorate of Radio, Television and
3454 // Cinematography (Mexico) rating.
3455 //
3456 // Possible values:
3457 // "rtcUnspecified"
3458 // "rtcAa" - AA
3459 // "rtcA" - A
3460 // "rtcB" - B
3461 // "rtcB15" - B15
3462 // "rtcC" - C
3463 // "rtcD" - D
3464 // "rtcUnrated"
3465 RtcRating string `json:"rtcRating,omitempty"`
3466 // RteRating: The video's rating from Ireland's Raidió Teilifís Éireann.
3467 //
3468 // Possible values:
3469 // "rteUnspecified"
3470 // "rteGa" - GA
3471 // "rteCh" - CH
3472 // "rtePs" - PS
3473 // "rteMa" - MA
3474 // "rteUnrated"
3475 RteRating string `json:"rteRating,omitempty"`
3476 // RussiaRating: The video's National Film Registry of the Russian Federation
3477 // (MKRF - Russia) rating.
3478 //
3479 // Possible values:
3480 // "russiaUnspecified"
3481 // "russia0" - 0+
3482 // "russia6" - 6+
3483 // "russia12" - 12+
3484 // "russia16" - 16+
3485 // "russia18" - 18+
3486 // "russiaUnrated"
3487 RussiaRating string `json:"russiaRating,omitempty"`
3488 // SkfilmRating: The video's rating in Slovakia.
3489 //
3490 // Possible values:
3491 // "skfilmUnspecified"
3492 // "skfilmG" - G
3493 // "skfilmP2" - P2
3494 // "skfilmP5" - P5
3495 // "skfilmP8" - P8
3496 // "skfilmUnrated"
3497 SkfilmRating string `json:"skfilmRating,omitempty"`
3498 // SmaisRating: The video's rating in Iceland.
3499 //
3500 // Possible values:
3501 // "smaisUnspecified"
3502 // "smaisL" - L
3503 // "smais7" - 7
3504 // "smais12" - 12
3505 // "smais14" - 14
3506 // "smais16" - 16
3507 // "smais18" - 18
3508 // "smaisUnrated"
3509 SmaisRating string `json:"smaisRating,omitempty"`
3510 // SmsaRating: The video's rating from Statens medieråd (Sweden's National
3511 // Media Council).
3512 //
3513 // Possible values:
3514 // "smsaUnspecified"
3515 // "smsaA" - All ages
3516 // "smsa7" - 7
3517 // "smsa11" - 11
3518 // "smsa15" - 15
3519 // "smsaUnrated"
3520 SmsaRating string `json:"smsaRating,omitempty"`
3521 // TvpgRating: The video's TV Parental Guidelines (TVPG) rating.
3522 //
3523 // Possible values:
3524 // "tvpgUnspecified"
3525 // "tvpgY" - TV-Y
3526 // "tvpgY7" - TV-Y7
3527 // "tvpgY7Fv" - TV-Y7-FV
3528 // "tvpgG" - TV-G
3529 // "tvpgPg" - TV-PG
3530 // "pg14" - TV-14
3531 // "tvpgMa" - TV-MA
3532 // "tvpgUnrated"
3533 TvpgRating string `json:"tvpgRating,omitempty"`
3534 // YtRating: A rating that YouTube uses to identify age-restricted content.
3535 //
3536 // Possible values:
3537 // "ytUnspecified"
3538 // "ytAgeRestricted"
3539 YtRating string `json:"ytRating,omitempty"`
3540 // ForceSendFields is a list of field names (e.g. "AcbRating") to
3541 // unconditionally include in API requests. By default, fields with empty or
3542 // default values are omitted from API requests. See
3543 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3544 // details.
3545 ForceSendFields []string `json:"-"`
3546 // NullFields is a list of field names (e.g. "AcbRating") to include in API
3547 // requests with the JSON null value. By default, fields with empty values are
3548 // omitted from API requests. See
3549 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3550 NullFields []string `json:"-"`
3551 }
3552
3553 func (s ContentRating) MarshalJSON() ([]byte, error) {
3554 type NoMethod ContentRating
3555 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3556 }
3557
3558 // Cuepoint: Note that there may be a 5-second end-point resolution issue. For
3559 // instance, if a cuepoint comes in for 22:03:27, we may stuff the cuepoint
3560 // into 22:03:25 or 22:03:30, depending. This is an artifact of HLS.
3561 type Cuepoint struct {
3562 // Possible values:
3563 // "cueTypeUnspecified"
3564 // "cueTypeAd"
3565 CueType string `json:"cueType,omitempty"`
3566 // DurationSecs: The duration of this cuepoint.
3567 DurationSecs int64 `json:"durationSecs,omitempty"`
3568 Etag string `json:"etag,omitempty"`
3569 // Id: The identifier for cuepoint resource.
3570 Id string `json:"id,omitempty"`
3571 // InsertionOffsetTimeMs: The time when the cuepoint should be inserted by
3572 // offset to the broadcast actual start time.
3573 InsertionOffsetTimeMs int64 `json:"insertionOffsetTimeMs,omitempty,string"`
3574 // WalltimeMs: The wall clock time at which the cuepoint should be inserted.
3575 // Only one of insertion_offset_time_ms and walltime_ms may be set at a time.
3576 WalltimeMs uint64 `json:"walltimeMs,omitempty,string"`
3577
3578 // ServerResponse contains the HTTP response code and headers from the server.
3579 googleapi.ServerResponse `json:"-"`
3580 // ForceSendFields is a list of field names (e.g. "CueType") to unconditionally
3581 // include in API requests. By default, fields with empty or default values are
3582 // omitted from API requests. See
3583 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3584 // details.
3585 ForceSendFields []string `json:"-"`
3586 // NullFields is a list of field names (e.g. "CueType") to include in API
3587 // requests with the JSON null value. By default, fields with empty values are
3588 // omitted from API requests. See
3589 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3590 NullFields []string `json:"-"`
3591 }
3592
3593 func (s Cuepoint) MarshalJSON() ([]byte, error) {
3594 type NoMethod Cuepoint
3595 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3596 }
3597
3598 // CuepointSchedule: Schedule to insert cuepoints into a broadcast by ads
3599 // automator.
3600 type CuepointSchedule struct {
3601 // Enabled: This field is semantically required. If it is set false or not set,
3602 // other fields in this message will be ignored.
3603 Enabled bool `json:"enabled,omitempty"`
3604 // PauseAdsUntil: If set, automatic cuepoint insertion is paused until this
3605 // timestamp ("No Ad Zone"). The value is specified in ISO 8601 format.
3606 PauseAdsUntil string `json:"pauseAdsUntil,omitempty"`
3607 // RepeatIntervalSecs: Interval frequency in seconds that api uses to insert
3608 // cuepoints automatically.
3609 RepeatIntervalSecs int64 `json:"repeatIntervalSecs,omitempty"`
3610 // ScheduleStrategy: The strategy to use when scheduling cuepoints.
3611 //
3612 // Possible values:
3613 // "scheduleStrategyUnspecified"
3614 // "concurrent" - Strategy to schedule cuepoints at one time for all viewers.
3615 // "nonConcurrent" - Strategy to schedule cuepoints at an increased rate to
3616 // allow viewers to receive cuepoints when eligible. See
3617 // go/lcr-non-concurrent-ads for more details.
3618 ScheduleStrategy string `json:"scheduleStrategy,omitempty"`
3619 // ForceSendFields is a list of field names (e.g. "Enabled") to unconditionally
3620 // include in API requests. By default, fields with empty or default values are
3621 // omitted from API requests. See
3622 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3623 // details.
3624 ForceSendFields []string `json:"-"`
3625 // NullFields is a list of field names (e.g. "Enabled") to include in API
3626 // requests with the JSON null value. By default, fields with empty values are
3627 // omitted from API requests. See
3628 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3629 NullFields []string `json:"-"`
3630 }
3631
3632 func (s CuepointSchedule) MarshalJSON() ([]byte, error) {
3633 type NoMethod CuepointSchedule
3634 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3635 }
3636
3637 type Entity struct {
3638 Id string `json:"id,omitempty"`
3639 TypeId string `json:"typeId,omitempty"`
3640 Url string `json:"url,omitempty"`
3641 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
3642 // include in API requests. By default, fields with empty or default values are
3643 // omitted from API requests. See
3644 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3645 // details.
3646 ForceSendFields []string `json:"-"`
3647 // NullFields is a list of field names (e.g. "Id") to include in API requests
3648 // with the JSON null value. By default, fields with empty values are omitted
3649 // from API requests. See
3650 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3651 NullFields []string `json:"-"`
3652 }
3653
3654 func (s Entity) MarshalJSON() ([]byte, error) {
3655 type NoMethod Entity
3656 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3657 }
3658
3659 // GeoPoint: Geographical coordinates of a point, in WGS84.
3660 type GeoPoint struct {
3661 // Altitude: Altitude above the reference ellipsoid, in meters.
3662 Altitude float64 `json:"altitude,omitempty"`
3663 // Latitude: Latitude in degrees.
3664 Latitude float64 `json:"latitude,omitempty"`
3665 // Longitude: Longitude in degrees.
3666 Longitude float64 `json:"longitude,omitempty"`
3667 // ForceSendFields is a list of field names (e.g. "Altitude") to
3668 // unconditionally include in API requests. By default, fields with empty or
3669 // default values are omitted from API requests. See
3670 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3671 // details.
3672 ForceSendFields []string `json:"-"`
3673 // NullFields is a list of field names (e.g. "Altitude") to include in API
3674 // requests with the JSON null value. By default, fields with empty values are
3675 // omitted from API requests. See
3676 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3677 NullFields []string `json:"-"`
3678 }
3679
3680 func (s GeoPoint) MarshalJSON() ([]byte, error) {
3681 type NoMethod GeoPoint
3682 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3683 }
3684
3685 func (s *GeoPoint) UnmarshalJSON(data []byte) error {
3686 type NoMethod GeoPoint
3687 var s1 struct {
3688 Altitude gensupport.JSONFloat64 `json:"altitude"`
3689 Latitude gensupport.JSONFloat64 `json:"latitude"`
3690 Longitude gensupport.JSONFloat64 `json:"longitude"`
3691 *NoMethod
3692 }
3693 s1.NoMethod = (*NoMethod)(s)
3694 if err := json.Unmarshal(data, &s1); err != nil {
3695 return err
3696 }
3697 s.Altitude = float64(s1.Altitude)
3698 s.Latitude = float64(s1.Latitude)
3699 s.Longitude = float64(s1.Longitude)
3700 return nil
3701 }
3702
3703 // I18nLanguage: An *i18nLanguage* resource identifies a UI language currently
3704 // supported by YouTube.
3705 type I18nLanguage struct {
3706 // Etag: Etag of this resource.
3707 Etag string `json:"etag,omitempty"`
3708 // Id: The ID that YouTube uses to uniquely identify the i18n language.
3709 Id string `json:"id,omitempty"`
3710 // Kind: Identifies what kind of resource this is. Value: the fixed string
3711 // "youtube#i18nLanguage".
3712 Kind string `json:"kind,omitempty"`
3713 // Snippet: The snippet object contains basic details about the i18n language,
3714 // such as language code and human-readable name.
3715 Snippet *I18nLanguageSnippet `json:"snippet,omitempty"`
3716 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
3717 // include in API requests. By default, fields with empty or default values are
3718 // omitted from API requests. See
3719 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3720 // details.
3721 ForceSendFields []string `json:"-"`
3722 // NullFields is a list of field names (e.g. "Etag") to include in API requests
3723 // with the JSON null value. By default, fields with empty values are omitted
3724 // from API requests. See
3725 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3726 NullFields []string `json:"-"`
3727 }
3728
3729 func (s I18nLanguage) MarshalJSON() ([]byte, error) {
3730 type NoMethod I18nLanguage
3731 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3732 }
3733
3734 type I18nLanguageListResponse struct {
3735 // Etag: Etag of this resource.
3736 Etag string `json:"etag,omitempty"`
3737 // EventId: Serialized EventId of the request which produced this response.
3738 EventId string `json:"eventId,omitempty"`
3739 // Items: A list of supported i18n languages. In this map, the i18n language ID
3740 // is the map key, and its value is the corresponding i18nLanguage resource.
3741 Items []*I18nLanguage `json:"items,omitempty"`
3742 // Kind: Identifies what kind of resource this is. Value: the fixed string
3743 // "youtube#i18nLanguageListResponse".
3744 Kind string `json:"kind,omitempty"`
3745 // VisitorId: The visitorId identifies the visitor.
3746 VisitorId string `json:"visitorId,omitempty"`
3747
3748 // ServerResponse contains the HTTP response code and headers from the server.
3749 googleapi.ServerResponse `json:"-"`
3750 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
3751 // include in API requests. By default, fields with empty or default values are
3752 // omitted from API requests. See
3753 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3754 // details.
3755 ForceSendFields []string `json:"-"`
3756 // NullFields is a list of field names (e.g. "Etag") to include in API requests
3757 // with the JSON null value. By default, fields with empty values are omitted
3758 // from API requests. See
3759 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3760 NullFields []string `json:"-"`
3761 }
3762
3763 func (s I18nLanguageListResponse) MarshalJSON() ([]byte, error) {
3764 type NoMethod I18nLanguageListResponse
3765 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3766 }
3767
3768 // I18nLanguageSnippet: Basic details about an i18n language, such as language
3769 // code and human-readable name.
3770 type I18nLanguageSnippet struct {
3771 // Hl: A short BCP-47 code that uniquely identifies a language.
3772 Hl string `json:"hl,omitempty"`
3773 // Name: The human-readable name of the language in the language itself.
3774 Name string `json:"name,omitempty"`
3775 // ForceSendFields is a list of field names (e.g. "Hl") to unconditionally
3776 // include in API requests. By default, fields with empty or default values are
3777 // omitted from API requests. See
3778 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3779 // details.
3780 ForceSendFields []string `json:"-"`
3781 // NullFields is a list of field names (e.g. "Hl") to include in API requests
3782 // with the JSON null value. By default, fields with empty values are omitted
3783 // from API requests. See
3784 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3785 NullFields []string `json:"-"`
3786 }
3787
3788 func (s I18nLanguageSnippet) MarshalJSON() ([]byte, error) {
3789 type NoMethod I18nLanguageSnippet
3790 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3791 }
3792
3793 // I18nRegion: A *i18nRegion* resource identifies a region where YouTube is
3794 // available.
3795 type I18nRegion struct {
3796 // Etag: Etag of this resource.
3797 Etag string `json:"etag,omitempty"`
3798 // Id: The ID that YouTube uses to uniquely identify the i18n region.
3799 Id string `json:"id,omitempty"`
3800 // Kind: Identifies what kind of resource this is. Value: the fixed string
3801 // "youtube#i18nRegion".
3802 Kind string `json:"kind,omitempty"`
3803 // Snippet: The snippet object contains basic details about the i18n region,
3804 // such as region code and human-readable name.
3805 Snippet *I18nRegionSnippet `json:"snippet,omitempty"`
3806 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
3807 // include in API requests. By default, fields with empty or default values are
3808 // omitted from API requests. See
3809 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3810 // details.
3811 ForceSendFields []string `json:"-"`
3812 // NullFields is a list of field names (e.g. "Etag") to include in API requests
3813 // with the JSON null value. By default, fields with empty values are omitted
3814 // from API requests. See
3815 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3816 NullFields []string `json:"-"`
3817 }
3818
3819 func (s I18nRegion) MarshalJSON() ([]byte, error) {
3820 type NoMethod I18nRegion
3821 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3822 }
3823
3824 type I18nRegionListResponse struct {
3825 // Etag: Etag of this resource.
3826 Etag string `json:"etag,omitempty"`
3827 // EventId: Serialized EventId of the request which produced this response.
3828 EventId string `json:"eventId,omitempty"`
3829 // Items: A list of regions where YouTube is available. In this map, the i18n
3830 // region ID is the map key, and its value is the corresponding i18nRegion
3831 // resource.
3832 Items []*I18nRegion `json:"items,omitempty"`
3833 // Kind: Identifies what kind of resource this is. Value: the fixed string
3834 // "youtube#i18nRegionListResponse".
3835 Kind string `json:"kind,omitempty"`
3836 // VisitorId: The visitorId identifies the visitor.
3837 VisitorId string `json:"visitorId,omitempty"`
3838
3839 // ServerResponse contains the HTTP response code and headers from the server.
3840 googleapi.ServerResponse `json:"-"`
3841 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
3842 // include in API requests. By default, fields with empty or default values are
3843 // omitted from API requests. See
3844 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3845 // details.
3846 ForceSendFields []string `json:"-"`
3847 // NullFields is a list of field names (e.g. "Etag") to include in API requests
3848 // with the JSON null value. By default, fields with empty values are omitted
3849 // from API requests. See
3850 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3851 NullFields []string `json:"-"`
3852 }
3853
3854 func (s I18nRegionListResponse) MarshalJSON() ([]byte, error) {
3855 type NoMethod I18nRegionListResponse
3856 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3857 }
3858
3859 // I18nRegionSnippet: Basic details about an i18n region, such as region code
3860 // and human-readable name.
3861 type I18nRegionSnippet struct {
3862 // Gl: The region code as a 2-letter ISO country code.
3863 Gl string `json:"gl,omitempty"`
3864 // Name: The human-readable name of the region.
3865 Name string `json:"name,omitempty"`
3866 // ForceSendFields is a list of field names (e.g. "Gl") to unconditionally
3867 // include in API requests. By default, fields with empty or default values are
3868 // omitted from API requests. See
3869 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3870 // details.
3871 ForceSendFields []string `json:"-"`
3872 // NullFields is a list of field names (e.g. "Gl") to include in API requests
3873 // with the JSON null value. By default, fields with empty values are omitted
3874 // from API requests. See
3875 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3876 NullFields []string `json:"-"`
3877 }
3878
3879 func (s I18nRegionSnippet) MarshalJSON() ([]byte, error) {
3880 type NoMethod I18nRegionSnippet
3881 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3882 }
3883
3884 // ImageSettings: Branding properties for images associated with the channel.
3885 type ImageSettings struct {
3886 // BackgroundImageUrl: The URL for the background image shown on the video
3887 // watch page. The image should be 1200px by 615px, with a maximum file size of
3888 // 128k.
3889 BackgroundImageUrl *LocalizedProperty `json:"backgroundImageUrl,omitempty"`
3890 // BannerExternalUrl: This is generated when a ChannelBanner.Insert request has
3891 // succeeded for the given channel.
3892 BannerExternalUrl string `json:"bannerExternalUrl,omitempty"`
3893 // BannerImageUrl: Banner image. Desktop size (1060x175).
3894 BannerImageUrl string `json:"bannerImageUrl,omitempty"`
3895 // BannerMobileExtraHdImageUrl: Banner image. Mobile size high resolution
3896 // (1440x395).
3897 BannerMobileExtraHdImageUrl string `json:"bannerMobileExtraHdImageUrl,omitempty"`
3898 // BannerMobileHdImageUrl: Banner image. Mobile size high resolution
3899 // (1280x360).
3900 BannerMobileHdImageUrl string `json:"bannerMobileHdImageUrl,omitempty"`
3901 // BannerMobileImageUrl: Banner image. Mobile size (640x175).
3902 BannerMobileImageUrl string `json:"bannerMobileImageUrl,omitempty"`
3903 // BannerMobileLowImageUrl: Banner image. Mobile size low resolution (320x88).
3904 BannerMobileLowImageUrl string `json:"bannerMobileLowImageUrl,omitempty"`
3905 // BannerMobileMediumHdImageUrl: Banner image. Mobile size medium/high
3906 // resolution (960x263).
3907 BannerMobileMediumHdImageUrl string `json:"bannerMobileMediumHdImageUrl,omitempty"`
3908 // BannerTabletExtraHdImageUrl: Banner image. Tablet size extra high resolution
3909 // (2560x424).
3910 BannerTabletExtraHdImageUrl string `json:"bannerTabletExtraHdImageUrl,omitempty"`
3911 // BannerTabletHdImageUrl: Banner image. Tablet size high resolution
3912 // (2276x377).
3913 BannerTabletHdImageUrl string `json:"bannerTabletHdImageUrl,omitempty"`
3914 // BannerTabletImageUrl: Banner image. Tablet size (1707x283).
3915 BannerTabletImageUrl string `json:"bannerTabletImageUrl,omitempty"`
3916 // BannerTabletLowImageUrl: Banner image. Tablet size low resolution
3917 // (1138x188).
3918 BannerTabletLowImageUrl string `json:"bannerTabletLowImageUrl,omitempty"`
3919 // BannerTvHighImageUrl: Banner image. TV size high resolution (1920x1080).
3920 BannerTvHighImageUrl string `json:"bannerTvHighImageUrl,omitempty"`
3921 // BannerTvImageUrl: Banner image. TV size extra high resolution (2120x1192).
3922 BannerTvImageUrl string `json:"bannerTvImageUrl,omitempty"`
3923 // BannerTvLowImageUrl: Banner image. TV size low resolution (854x480).
3924 BannerTvLowImageUrl string `json:"bannerTvLowImageUrl,omitempty"`
3925 // BannerTvMediumImageUrl: Banner image. TV size medium resolution (1280x720).
3926 BannerTvMediumImageUrl string `json:"bannerTvMediumImageUrl,omitempty"`
3927 // LargeBrandedBannerImageImapScript: The image map script for the large banner
3928 // image.
3929 LargeBrandedBannerImageImapScript *LocalizedProperty `json:"largeBrandedBannerImageImapScript,omitempty"`
3930 // LargeBrandedBannerImageUrl: The URL for the 854px by 70px image that appears
3931 // below the video player in the expanded video view of the video watch page.
3932 LargeBrandedBannerImageUrl *LocalizedProperty `json:"largeBrandedBannerImageUrl,omitempty"`
3933 // SmallBrandedBannerImageImapScript: The image map script for the small banner
3934 // image.
3935 SmallBrandedBannerImageImapScript *LocalizedProperty `json:"smallBrandedBannerImageImapScript,omitempty"`
3936 // SmallBrandedBannerImageUrl: The URL for the 640px by 70px banner image that
3937 // appears below the video player in the default view of the video watch page.
3938 // The URL for the image that appears above the top-left corner of the video
3939 // player. This is a 25-pixel-high image with a flexible width that cannot
3940 // exceed 170 pixels.
3941 SmallBrandedBannerImageUrl *LocalizedProperty `json:"smallBrandedBannerImageUrl,omitempty"`
3942 // TrackingImageUrl: The URL for a 1px by 1px tracking pixel that can be used
3943 // to collect statistics for views of the channel or video pages.
3944 TrackingImageUrl string `json:"trackingImageUrl,omitempty"`
3945 WatchIconImageUrl string `json:"watchIconImageUrl,omitempty"`
3946 // ForceSendFields is a list of field names (e.g. "BackgroundImageUrl") to
3947 // unconditionally include in API requests. By default, fields with empty or
3948 // default values are omitted from API requests. See
3949 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3950 // details.
3951 ForceSendFields []string `json:"-"`
3952 // NullFields is a list of field names (e.g. "BackgroundImageUrl") to include
3953 // in API requests with the JSON null value. By default, fields with empty
3954 // values are omitted from API requests. See
3955 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3956 NullFields []string `json:"-"`
3957 }
3958
3959 func (s ImageSettings) MarshalJSON() ([]byte, error) {
3960 type NoMethod ImageSettings
3961 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
3962 }
3963
3964 // IngestionInfo: Describes information necessary for ingesting an RTMP, HTTP,
3965 // or SRT stream.
3966 type IngestionInfo struct {
3967 // BackupIngestionAddress: The backup ingestion URL that you should use to
3968 // stream video to YouTube. You have the option of simultaneously streaming the
3969 // content that you are sending to the ingestionAddress to this URL.
3970 BackupIngestionAddress string `json:"backupIngestionAddress,omitempty"`
3971 // IngestionAddress: The primary ingestion URL that you should use to stream
3972 // video to YouTube. You must stream video to this URL. Depending on which
3973 // application or tool you use to encode your video stream, you may need to
3974 // enter the stream URL and stream name separately or you may need to
3975 // concatenate them in the following format: *STREAM_URL/STREAM_NAME*
3976 IngestionAddress string `json:"ingestionAddress,omitempty"`
3977 // RtmpsBackupIngestionAddress: This ingestion url may be used instead of
3978 // backupIngestionAddress in order to stream via RTMPS. Not applicable to
3979 // non-RTMP streams.
3980 RtmpsBackupIngestionAddress string `json:"rtmpsBackupIngestionAddress,omitempty"`
3981 // RtmpsIngestionAddress: This ingestion url may be used instead of
3982 // ingestionAddress in order to stream via RTMPS. Not applicable to non-RTMP
3983 // streams.
3984 RtmpsIngestionAddress string `json:"rtmpsIngestionAddress,omitempty"`
3985 // StreamName: The stream name that YouTube assigns to the video stream.
3986 StreamName string `json:"streamName,omitempty"`
3987 // ForceSendFields is a list of field names (e.g. "BackupIngestionAddress") to
3988 // unconditionally include in API requests. By default, fields with empty or
3989 // default values are omitted from API requests. See
3990 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
3991 // details.
3992 ForceSendFields []string `json:"-"`
3993 // NullFields is a list of field names (e.g. "BackupIngestionAddress") to
3994 // include in API requests with the JSON null value. By default, fields with
3995 // empty values are omitted from API requests. See
3996 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
3997 NullFields []string `json:"-"`
3998 }
3999
4000 func (s IngestionInfo) MarshalJSON() ([]byte, error) {
4001 type NoMethod IngestionInfo
4002 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4003 }
4004
4005 // InvideoBranding: Describes an invideo branding.
4006 type InvideoBranding struct {
4007 // ImageBytes: The bytes the uploaded image. Only used in api to youtube
4008 // communication.
4009 ImageBytes string `json:"imageBytes,omitempty"`
4010 // ImageUrl: The url of the uploaded image. Only used in apiary to api
4011 // communication.
4012 ImageUrl string `json:"imageUrl,omitempty"`
4013 // Position: The spatial position within the video where the branding watermark
4014 // will be displayed.
4015 Position *InvideoPosition `json:"position,omitempty"`
4016 // TargetChannelId: The channel to which this branding links. If not present it
4017 // defaults to the current channel.
4018 TargetChannelId string `json:"targetChannelId,omitempty"`
4019 // Timing: The temporal position within the video where watermark will be
4020 // displayed.
4021 Timing *InvideoTiming `json:"timing,omitempty"`
4022 // ForceSendFields is a list of field names (e.g. "ImageBytes") to
4023 // unconditionally include in API requests. By default, fields with empty or
4024 // default values are omitted from API requests. See
4025 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4026 // details.
4027 ForceSendFields []string `json:"-"`
4028 // NullFields is a list of field names (e.g. "ImageBytes") to include in API
4029 // requests with the JSON null value. By default, fields with empty values are
4030 // omitted from API requests. See
4031 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4032 NullFields []string `json:"-"`
4033 }
4034
4035 func (s InvideoBranding) MarshalJSON() ([]byte, error) {
4036 type NoMethod InvideoBranding
4037 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4038 }
4039
4040 // InvideoPosition: Describes the spatial position of a visual widget inside a
4041 // video. It is a union of various position types, out of which only will be
4042 // set one.
4043 type InvideoPosition struct {
4044 // CornerPosition: Describes in which corner of the video the visual widget
4045 // will appear.
4046 //
4047 // Possible values:
4048 // "topLeft"
4049 // "topRight"
4050 // "bottomLeft"
4051 // "bottomRight"
4052 CornerPosition string `json:"cornerPosition,omitempty"`
4053 // Type: Defines the position type.
4054 //
4055 // Possible values:
4056 // "corner"
4057 Type string `json:"type,omitempty"`
4058 // ForceSendFields is a list of field names (e.g. "CornerPosition") to
4059 // unconditionally include in API requests. By default, fields with empty or
4060 // default values are omitted from API requests. See
4061 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4062 // details.
4063 ForceSendFields []string `json:"-"`
4064 // NullFields is a list of field names (e.g. "CornerPosition") to include in
4065 // API requests with the JSON null value. By default, fields with empty values
4066 // are omitted from API requests. See
4067 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4068 NullFields []string `json:"-"`
4069 }
4070
4071 func (s InvideoPosition) MarshalJSON() ([]byte, error) {
4072 type NoMethod InvideoPosition
4073 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4074 }
4075
4076 // InvideoTiming: Describes a temporal position of a visual widget inside a
4077 // video.
4078 type InvideoTiming struct {
4079 // DurationMs: Defines the duration in milliseconds for which the promotion
4080 // should be displayed. If missing, the client should use the default.
4081 DurationMs uint64 `json:"durationMs,omitempty,string"`
4082 // OffsetMs: Defines the time at which the promotion will appear. Depending on
4083 // the value of type the value of the offsetMs field will represent a time
4084 // offset from the start or from the end of the video, expressed in
4085 // milliseconds.
4086 OffsetMs uint64 `json:"offsetMs,omitempty,string"`
4087 // Type: Describes a timing type. If the value is offsetFromStart, then the
4088 // offsetMs field represents an offset from the start of the video. If the
4089 // value is offsetFromEnd, then the offsetMs field represents an offset from
4090 // the end of the video.
4091 //
4092 // Possible values:
4093 // "offsetFromStart"
4094 // "offsetFromEnd"
4095 Type string `json:"type,omitempty"`
4096 // ForceSendFields is a list of field names (e.g. "DurationMs") to
4097 // unconditionally include in API requests. By default, fields with empty or
4098 // default values are omitted from API requests. See
4099 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4100 // details.
4101 ForceSendFields []string `json:"-"`
4102 // NullFields is a list of field names (e.g. "DurationMs") to include in API
4103 // requests with the JSON null value. By default, fields with empty values are
4104 // omitted from API requests. See
4105 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4106 NullFields []string `json:"-"`
4107 }
4108
4109 func (s InvideoTiming) MarshalJSON() ([]byte, error) {
4110 type NoMethod InvideoTiming
4111 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4112 }
4113
4114 type LanguageTag struct {
4115 Value string `json:"value,omitempty"`
4116 // ForceSendFields is a list of field names (e.g. "Value") to unconditionally
4117 // include in API requests. By default, fields with empty or default values are
4118 // omitted from API requests. See
4119 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4120 // details.
4121 ForceSendFields []string `json:"-"`
4122 // NullFields is a list of field names (e.g. "Value") to include in API
4123 // requests with the JSON null value. By default, fields with empty values are
4124 // omitted from API requests. See
4125 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4126 NullFields []string `json:"-"`
4127 }
4128
4129 func (s LanguageTag) MarshalJSON() ([]byte, error) {
4130 type NoMethod LanguageTag
4131 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4132 }
4133
4134 type LevelDetails struct {
4135 // DisplayName: The name that should be used when referring to this level.
4136 DisplayName string `json:"displayName,omitempty"`
4137 // ForceSendFields is a list of field names (e.g. "DisplayName") to
4138 // unconditionally include in API requests. By default, fields with empty or
4139 // default values are omitted from API requests. See
4140 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4141 // details.
4142 ForceSendFields []string `json:"-"`
4143 // NullFields is a list of field names (e.g. "DisplayName") to include in API
4144 // requests with the JSON null value. By default, fields with empty values are
4145 // omitted from API requests. See
4146 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4147 NullFields []string `json:"-"`
4148 }
4149
4150 func (s LevelDetails) MarshalJSON() ([]byte, error) {
4151 type NoMethod LevelDetails
4152 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4153 }
4154
4155 // LiveBroadcast: A *liveBroadcast* resource represents an event that will be
4156 // streamed, via live video, on YouTube.
4157 type LiveBroadcast struct {
4158 // ContentDetails: The contentDetails object contains information about the
4159 // event's video content, such as whether the content can be shown in an
4160 // embedded video player or if it will be archived and therefore available for
4161 // viewing after the event has concluded.
4162 ContentDetails *LiveBroadcastContentDetails `json:"contentDetails,omitempty"`
4163 // Etag: Etag of this resource.
4164 Etag string `json:"etag,omitempty"`
4165 // Id: The ID that YouTube assigns to uniquely identify the broadcast.
4166 Id string `json:"id,omitempty"`
4167 // Kind: Identifies what kind of resource this is. Value: the fixed string
4168 // "youtube#liveBroadcast".
4169 Kind string `json:"kind,omitempty"`
4170 // MonetizationDetails: The monetizationDetails object contains information
4171 // about the event's monetization details.
4172 MonetizationDetails *LiveBroadcastMonetizationDetails `json:"monetizationDetails,omitempty"`
4173 // Snippet: The snippet object contains basic details about the event,
4174 // including its title, description, start time, and end time.
4175 Snippet *LiveBroadcastSnippet `json:"snippet,omitempty"`
4176 // Statistics: The statistics object contains info about the event's current
4177 // stats. These include concurrent viewers and total chat count. Statistics can
4178 // change (in either direction) during the lifetime of an event. Statistics are
4179 // only returned while the event is live.
4180 Statistics *LiveBroadcastStatistics `json:"statistics,omitempty"`
4181 // Status: The status object contains information about the event's status.
4182 Status *LiveBroadcastStatus `json:"status,omitempty"`
4183
4184 // ServerResponse contains the HTTP response code and headers from the server.
4185 googleapi.ServerResponse `json:"-"`
4186 // ForceSendFields is a list of field names (e.g. "ContentDetails") to
4187 // unconditionally include in API requests. By default, fields with empty or
4188 // default values are omitted from API requests. See
4189 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4190 // details.
4191 ForceSendFields []string `json:"-"`
4192 // NullFields is a list of field names (e.g. "ContentDetails") to include in
4193 // API requests with the JSON null value. By default, fields with empty values
4194 // are omitted from API requests. See
4195 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4196 NullFields []string `json:"-"`
4197 }
4198
4199 func (s LiveBroadcast) MarshalJSON() ([]byte, error) {
4200 type NoMethod LiveBroadcast
4201 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4202 }
4203
4204 // LiveBroadcastContentDetails: Detailed settings of a broadcast.
4205 type LiveBroadcastContentDetails struct {
4206 // BoundStreamId: This value uniquely identifies the live stream bound to the
4207 // broadcast.
4208 BoundStreamId string `json:"boundStreamId,omitempty"`
4209 // BoundStreamLastUpdateTimeMs: The date and time that the live stream
4210 // referenced by boundStreamId was last updated.
4211 BoundStreamLastUpdateTimeMs string `json:"boundStreamLastUpdateTimeMs,omitempty"`
4212 // Possible values:
4213 // "closedCaptionsTypeUnspecified"
4214 // "closedCaptionsDisabled"
4215 // "closedCaptionsHttpPost"
4216 // "closedCaptionsEmbedded"
4217 ClosedCaptionsType string `json:"closedCaptionsType,omitempty"`
4218 // EnableAutoStart: This setting indicates whether auto start is enabled for
4219 // this broadcast. The default value for this property is false. This setting
4220 // can only be used by Events.
4221 EnableAutoStart bool `json:"enableAutoStart,omitempty"`
4222 // EnableAutoStop: This setting indicates whether auto stop is enabled for this
4223 // broadcast. The default value for this property is false. This setting can
4224 // only be used by Events.
4225 EnableAutoStop bool `json:"enableAutoStop,omitempty"`
4226 // EnableClosedCaptions: This setting indicates whether HTTP POST closed
4227 // captioning is enabled for this broadcast. The ingestion URL of the closed
4228 // captions is returned through the liveStreams API. This is mutually exclusive
4229 // with using the closed_captions_type property, and is equivalent to setting
4230 // closed_captions_type to CLOSED_CAPTIONS_HTTP_POST.
4231 EnableClosedCaptions bool `json:"enableClosedCaptions,omitempty"`
4232 // EnableContentEncryption: This setting indicates whether YouTube should
4233 // enable content encryption for the broadcast.
4234 EnableContentEncryption bool `json:"enableContentEncryption,omitempty"`
4235 // EnableDvr: This setting determines whether viewers can access DVR controls
4236 // while watching the video. DVR controls enable the viewer to control the
4237 // video playback experience by pausing, rewinding, or fast forwarding content.
4238 // The default value for this property is true. *Important:* You must set the
4239 // value to true and also set the enableArchive property's value to true if you
4240 // want to make playback available immediately after the broadcast ends.
4241 EnableDvr bool `json:"enableDvr,omitempty"`
4242 // EnableEmbed: This setting indicates whether the broadcast video can be
4243 // played in an embedded player. If you choose to archive the video (using the
4244 // enableArchive property), this setting will also apply to the archived video.
4245 EnableEmbed bool `json:"enableEmbed,omitempty"`
4246 // EnableLowLatency: Indicates whether this broadcast has low latency enabled.
4247 EnableLowLatency bool `json:"enableLowLatency,omitempty"`
4248 // LatencyPreference: If both this and enable_low_latency are set, they must
4249 // match. LATENCY_NORMAL should match enable_low_latency=false LATENCY_LOW
4250 // should match enable_low_latency=true LATENCY_ULTRA_LOW should have
4251 // enable_low_latency omitted.
4252 //
4253 // Possible values:
4254 // "latencyPreferenceUnspecified"
4255 // "normal" - Best for: highest quality viewer playbacks and higher
4256 // resolutions.
4257 // "low" - Best for: near real-time interaction, with minimal playback
4258 // buffering.
4259 // "ultraLow" - Best for: real-time interaction Does not support: Closed
4260 // captions, 1440p, and 4k resolutions
4261 LatencyPreference string `json:"latencyPreference,omitempty"`
4262 // Mesh: The mesh for projecting the video if projection is mesh. The mesh
4263 // value must be a UTF-8 string containing the base-64 encoding of 3D mesh data
4264 // that follows the Spherical Video V2 RFC specification for an mshp box,
4265 // excluding the box size and type but including the following four reserved
4266 // zero bytes for the version and flags.
4267 Mesh string `json:"mesh,omitempty"`
4268 // MonitorStream: The monitorStream object contains information about the
4269 // monitor stream, which the broadcaster can use to review the event content
4270 // before the broadcast stream is shown publicly.
4271 MonitorStream *MonitorStreamInfo `json:"monitorStream,omitempty"`
4272 // Projection: The projection format of this broadcast. This defaults to
4273 // rectangular.
4274 //
4275 // Possible values:
4276 // "projectionUnspecified"
4277 // "rectangular"
4278 // "360"
4279 // "mesh"
4280 Projection string `json:"projection,omitempty"`
4281 // RecordFromStart: Automatically start recording after the event goes live.
4282 // The default value for this property is true. *Important:* You must also set
4283 // the enableDvr property's value to true if you want the playback to be
4284 // available immediately after the broadcast ends. If you set this property's
4285 // value to true but do not also set the enableDvr property to true, there may
4286 // be a delay of around one day before the archived video will be available for
4287 // playback.
4288 RecordFromStart bool `json:"recordFromStart,omitempty"`
4289 // StartWithSlate: This setting indicates whether the broadcast should
4290 // automatically begin with an in-stream slate when you update the broadcast's
4291 // status to live. After updating the status, you then need to send a
4292 // liveCuepoints.insert request that sets the cuepoint's eventState to end to
4293 // remove the in-stream slate and make your broadcast stream visible to
4294 // viewers.
4295 StartWithSlate bool `json:"startWithSlate,omitempty"`
4296 // StereoLayout: The 3D stereo layout of this broadcast. This defaults to mono.
4297 //
4298 // Possible values:
4299 // "stereoLayoutUnspecified"
4300 // "mono"
4301 // "leftRight"
4302 // "topBottom"
4303 StereoLayout string `json:"stereoLayout,omitempty"`
4304 // ForceSendFields is a list of field names (e.g. "BoundStreamId") to
4305 // unconditionally include in API requests. By default, fields with empty or
4306 // default values are omitted from API requests. See
4307 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4308 // details.
4309 ForceSendFields []string `json:"-"`
4310 // NullFields is a list of field names (e.g. "BoundStreamId") to include in API
4311 // requests with the JSON null value. By default, fields with empty values are
4312 // omitted from API requests. See
4313 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4314 NullFields []string `json:"-"`
4315 }
4316
4317 func (s LiveBroadcastContentDetails) MarshalJSON() ([]byte, error) {
4318 type NoMethod LiveBroadcastContentDetails
4319 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4320 }
4321
4322 type LiveBroadcastListResponse struct {
4323 // Etag: Etag of this resource.
4324 Etag string `json:"etag,omitempty"`
4325 // EventId: Serialized EventId of the request which produced this response.
4326 EventId string `json:"eventId,omitempty"`
4327 // Items: A list of broadcasts that match the request criteria.
4328 Items []*LiveBroadcast `json:"items,omitempty"`
4329 // Kind: Identifies what kind of resource this is. Value: the fixed string
4330 // "youtube#liveBroadcastListResponse".
4331 Kind string `json:"kind,omitempty"`
4332 // NextPageToken: The token that can be used as the value of the pageToken
4333 // parameter to retrieve the next page in the result set.
4334 NextPageToken string `json:"nextPageToken,omitempty"`
4335 // PageInfo: General pagination information.
4336 PageInfo *PageInfo `json:"pageInfo,omitempty"`
4337 // PrevPageToken: The token that can be used as the value of the pageToken
4338 // parameter to retrieve the previous page in the result set.
4339 PrevPageToken string `json:"prevPageToken,omitempty"`
4340 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
4341 // VisitorId: The visitorId identifies the visitor.
4342 VisitorId string `json:"visitorId,omitempty"`
4343
4344 // ServerResponse contains the HTTP response code and headers from the server.
4345 googleapi.ServerResponse `json:"-"`
4346 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
4347 // include in API requests. By default, fields with empty or default values are
4348 // omitted from API requests. See
4349 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4350 // details.
4351 ForceSendFields []string `json:"-"`
4352 // NullFields is a list of field names (e.g. "Etag") to include in API requests
4353 // with the JSON null value. By default, fields with empty values are omitted
4354 // from API requests. See
4355 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4356 NullFields []string `json:"-"`
4357 }
4358
4359 func (s LiveBroadcastListResponse) MarshalJSON() ([]byte, error) {
4360 type NoMethod LiveBroadcastListResponse
4361 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4362 }
4363
4364 // LiveBroadcastMonetizationDetails: Monetization settings of a broadcast.
4365 type LiveBroadcastMonetizationDetails struct {
4366 CuepointSchedule *CuepointSchedule `json:"cuepointSchedule,omitempty"`
4367 // ForceSendFields is a list of field names (e.g. "CuepointSchedule") to
4368 // unconditionally include in API requests. By default, fields with empty or
4369 // default values are omitted from API requests. See
4370 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4371 // details.
4372 ForceSendFields []string `json:"-"`
4373 // NullFields is a list of field names (e.g. "CuepointSchedule") to include in
4374 // API requests with the JSON null value. By default, fields with empty values
4375 // are omitted from API requests. See
4376 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4377 NullFields []string `json:"-"`
4378 }
4379
4380 func (s LiveBroadcastMonetizationDetails) MarshalJSON() ([]byte, error) {
4381 type NoMethod LiveBroadcastMonetizationDetails
4382 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4383 }
4384
4385 // LiveBroadcastSnippet: Basic broadcast information.
4386 type LiveBroadcastSnippet struct {
4387 // ActualEndTime: The date and time that the broadcast actually ended. This
4388 // information is only available once the broadcast's state is complete.
4389 ActualEndTime string `json:"actualEndTime,omitempty"`
4390 // ActualStartTime: The date and time that the broadcast actually started. This
4391 // information is only available once the broadcast's state is live.
4392 ActualStartTime string `json:"actualStartTime,omitempty"`
4393 // ChannelId: The ID that YouTube uses to uniquely identify the channel that is
4394 // publishing the broadcast.
4395 ChannelId string `json:"channelId,omitempty"`
4396 // Description: The broadcast's description. As with the title, you can set
4397 // this field by modifying the broadcast resource or by setting the description
4398 // field of the corresponding video resource.
4399 Description string `json:"description,omitempty"`
4400 // IsDefaultBroadcast: Indicates whether this broadcast is the default
4401 // broadcast. Internal only.
4402 IsDefaultBroadcast bool `json:"isDefaultBroadcast,omitempty"`
4403 // LiveChatId: The id of the live chat for this broadcast.
4404 LiveChatId string `json:"liveChatId,omitempty"`
4405 // PublishedAt: The date and time that the broadcast was added to YouTube's
4406 // live broadcast schedule.
4407 PublishedAt string `json:"publishedAt,omitempty"`
4408 // ScheduledEndTime: The date and time that the broadcast is scheduled to end.
4409 ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
4410 // ScheduledStartTime: The date and time that the broadcast is scheduled to
4411 // start.
4412 ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
4413 // Thumbnails: A map of thumbnail images associated with the broadcast. For
4414 // each nested object in this object, the key is the name of the thumbnail
4415 // image, and the value is an object that contains other information about the
4416 // thumbnail.
4417 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
4418 // Title: The broadcast's title. Note that the broadcast represents exactly one
4419 // YouTube video. You can set this field by modifying the broadcast resource or
4420 // by setting the title field of the corresponding video resource.
4421 Title string `json:"title,omitempty"`
4422 // ForceSendFields is a list of field names (e.g. "ActualEndTime") to
4423 // unconditionally include in API requests. By default, fields with empty or
4424 // default values are omitted from API requests. See
4425 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4426 // details.
4427 ForceSendFields []string `json:"-"`
4428 // NullFields is a list of field names (e.g. "ActualEndTime") to include in API
4429 // requests with the JSON null value. By default, fields with empty values are
4430 // omitted from API requests. See
4431 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4432 NullFields []string `json:"-"`
4433 }
4434
4435 func (s LiveBroadcastSnippet) MarshalJSON() ([]byte, error) {
4436 type NoMethod LiveBroadcastSnippet
4437 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4438 }
4439
4440 // LiveBroadcastStatistics: Statistics about the live broadcast. These
4441 // represent a snapshot of the values at the time of the request. Statistics
4442 // are only returned for live broadcasts.
4443 type LiveBroadcastStatistics struct {
4444 // ConcurrentViewers: The number of viewers currently watching the broadcast.
4445 // The property and its value will be present if the broadcast has current
4446 // viewers and the broadcast owner has not hidden the viewcount for the video.
4447 // Note that YouTube stops tracking the number of concurrent viewers for a
4448 // broadcast when the broadcast ends. So, this property would not identify the
4449 // number of viewers watching an archived video of a live broadcast that
4450 // already ended.
4451 ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
4452 // ForceSendFields is a list of field names (e.g. "ConcurrentViewers") to
4453 // unconditionally include in API requests. By default, fields with empty or
4454 // default values are omitted from API requests. See
4455 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4456 // details.
4457 ForceSendFields []string `json:"-"`
4458 // NullFields is a list of field names (e.g. "ConcurrentViewers") to include in
4459 // API requests with the JSON null value. By default, fields with empty values
4460 // are omitted from API requests. See
4461 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4462 NullFields []string `json:"-"`
4463 }
4464
4465 func (s LiveBroadcastStatistics) MarshalJSON() ([]byte, error) {
4466 type NoMethod LiveBroadcastStatistics
4467 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4468 }
4469
4470 // LiveBroadcastStatus: Live broadcast state.
4471 type LiveBroadcastStatus struct {
4472 // LifeCycleStatus: The broadcast's status. The status can be updated using the
4473 // API's liveBroadcasts.transition method.
4474 //
4475 // Possible values:
4476 // "lifeCycleStatusUnspecified" - No value or the value is unknown.
4477 // "created" - Incomplete settings, but otherwise valid
4478 // "ready" - Complete settings
4479 // "testing" - Visible only to partner, may need special UI treatment
4480 // "live" - Viper is recording; this means the "clock" is running
4481 // "complete" - The broadcast is finished.
4482 // "revoked" - This broadcast was removed by admin action
4483 // "testStarting" - Transition into TESTING has been requested
4484 // "liveStarting" - Transition into LIVE has been requested
4485 LifeCycleStatus string `json:"lifeCycleStatus,omitempty"`
4486 // LiveBroadcastPriority: Priority of the live broadcast event (internal
4487 // state).
4488 //
4489 // Possible values:
4490 // "liveBroadcastPriorityUnspecified"
4491 // "low" - Low priority broadcast: for low view count HoAs or other low
4492 // priority broadcasts.
4493 // "normal" - Normal priority broadcast: for regular HoAs and broadcasts.
4494 // "high" - High priority broadcast: for high profile HoAs, like PixelCorp
4495 // ones.
4496 LiveBroadcastPriority string `json:"liveBroadcastPriority,omitempty"`
4497 // MadeForKids: Whether the broadcast is made for kids or not, decided by
4498 // YouTube instead of the creator. This field is read only.
4499 MadeForKids bool `json:"madeForKids,omitempty"`
4500 // PrivacyStatus: The broadcast's privacy status. Note that the broadcast
4501 // represents exactly one YouTube video, so the privacy settings are identical
4502 // to those supported for videos. In addition, you can set this field by
4503 // modifying the broadcast resource or by setting the privacyStatus field of
4504 // the corresponding video resource.
4505 //
4506 // Possible values:
4507 // "public"
4508 // "unlisted"
4509 // "private"
4510 PrivacyStatus string `json:"privacyStatus,omitempty"`
4511 // RecordingStatus: The broadcast's recording status.
4512 //
4513 // Possible values:
4514 // "liveBroadcastRecordingStatusUnspecified" - No value or the value is
4515 // unknown.
4516 // "notRecording" - The recording has not yet been started.
4517 // "recording" - The recording is currently on.
4518 // "recorded" - The recording is completed, and cannot be started again.
4519 RecordingStatus string `json:"recordingStatus,omitempty"`
4520 // SelfDeclaredMadeForKids: This field will be set to True if the creator
4521 // declares the broadcast to be kids only: go/live-cw-work.
4522 SelfDeclaredMadeForKids bool `json:"selfDeclaredMadeForKids,omitempty"`
4523 // ForceSendFields is a list of field names (e.g. "LifeCycleStatus") to
4524 // unconditionally include in API requests. By default, fields with empty or
4525 // default values are omitted from API requests. See
4526 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4527 // details.
4528 ForceSendFields []string `json:"-"`
4529 // NullFields is a list of field names (e.g. "LifeCycleStatus") to include in
4530 // API requests with the JSON null value. By default, fields with empty values
4531 // are omitted from API requests. See
4532 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4533 NullFields []string `json:"-"`
4534 }
4535
4536 func (s LiveBroadcastStatus) MarshalJSON() ([]byte, error) {
4537 type NoMethod LiveBroadcastStatus
4538 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4539 }
4540
4541 // LiveChatBan: A `__liveChatBan__` resource represents a ban for a YouTube
4542 // live chat.
4543 type LiveChatBan struct {
4544 // Etag: Etag of this resource.
4545 Etag string `json:"etag,omitempty"`
4546 // Id: The ID that YouTube assigns to uniquely identify the ban.
4547 Id string `json:"id,omitempty"`
4548 // Kind: Identifies what kind of resource this is. Value: the fixed string
4549 // "youtube#liveChatBan".
4550 Kind string `json:"kind,omitempty"`
4551 // Snippet: The `snippet` object contains basic details about the ban.
4552 Snippet *LiveChatBanSnippet `json:"snippet,omitempty"`
4553
4554 // ServerResponse contains the HTTP response code and headers from the server.
4555 googleapi.ServerResponse `json:"-"`
4556 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
4557 // include in API requests. By default, fields with empty or default values are
4558 // omitted from API requests. See
4559 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4560 // details.
4561 ForceSendFields []string `json:"-"`
4562 // NullFields is a list of field names (e.g. "Etag") to include in API requests
4563 // with the JSON null value. By default, fields with empty values are omitted
4564 // from API requests. See
4565 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4566 NullFields []string `json:"-"`
4567 }
4568
4569 func (s LiveChatBan) MarshalJSON() ([]byte, error) {
4570 type NoMethod LiveChatBan
4571 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4572 }
4573
4574 type LiveChatBanSnippet struct {
4575 // BanDurationSeconds: The duration of a ban, only filled if the ban has type
4576 // TEMPORARY.
4577 BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
4578 BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
4579 // LiveChatId: The chat this ban is pertinent to.
4580 LiveChatId string `json:"liveChatId,omitempty"`
4581 // Type: The type of ban.
4582 //
4583 // Possible values:
4584 // "liveChatBanTypeUnspecified" - An invalid ban type.
4585 // "permanent" - A permanent ban.
4586 // "temporary" - A temporary ban.
4587 Type string `json:"type,omitempty"`
4588 // ForceSendFields is a list of field names (e.g. "BanDurationSeconds") to
4589 // unconditionally include in API requests. By default, fields with empty or
4590 // default values are omitted from API requests. See
4591 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4592 // details.
4593 ForceSendFields []string `json:"-"`
4594 // NullFields is a list of field names (e.g. "BanDurationSeconds") to include
4595 // in API requests with the JSON null value. By default, fields with empty
4596 // values are omitted from API requests. See
4597 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4598 NullFields []string `json:"-"`
4599 }
4600
4601 func (s LiveChatBanSnippet) MarshalJSON() ([]byte, error) {
4602 type NoMethod LiveChatBanSnippet
4603 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4604 }
4605
4606 type LiveChatFanFundingEventDetails struct {
4607 // AmountDisplayString: A rendered string that displays the fund amount and
4608 // currency to the user.
4609 AmountDisplayString string `json:"amountDisplayString,omitempty"`
4610 // AmountMicros: The amount of the fund.
4611 AmountMicros uint64 `json:"amountMicros,omitempty,string"`
4612 // Currency: The currency in which the fund was made.
4613 Currency string `json:"currency,omitempty"`
4614 // UserComment: The comment added by the user to this fan funding event.
4615 UserComment string `json:"userComment,omitempty"`
4616 // ForceSendFields is a list of field names (e.g. "AmountDisplayString") to
4617 // unconditionally include in API requests. By default, fields with empty or
4618 // default values are omitted from API requests. See
4619 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4620 // details.
4621 ForceSendFields []string `json:"-"`
4622 // NullFields is a list of field names (e.g. "AmountDisplayString") to include
4623 // in API requests with the JSON null value. By default, fields with empty
4624 // values are omitted from API requests. See
4625 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4626 NullFields []string `json:"-"`
4627 }
4628
4629 func (s LiveChatFanFundingEventDetails) MarshalJSON() ([]byte, error) {
4630 type NoMethod LiveChatFanFundingEventDetails
4631 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4632 }
4633
4634 // LiveChatGiftDetails: Details about the gift event, this is only set if the
4635 // type is 'giftEvent'.
4636 type LiveChatGiftDetails struct {
4637 // AltText: The alternative text to be used for accessibility.
4638 AltText string `json:"altText,omitempty"`
4639 // ComboCount: The number of times the gift has been sent in a row.
4640 ComboCount int64 `json:"comboCount,omitempty"`
4641 // GiftDuration: The duration of the gift.
4642 GiftDuration string `json:"giftDuration,omitempty"`
4643 // GiftName: The name of the gift.
4644 GiftName string `json:"giftName,omitempty"`
4645 // GiftUrl: The URL of the gift image.
4646 GiftUrl string `json:"giftUrl,omitempty"`
4647 // HasVisualEffect: Whether the gift involves a visual effect.
4648 HasVisualEffect bool `json:"hasVisualEffect,omitempty"`
4649 // JewelsAmount: The value of the gift in jewels.
4650 JewelsAmount int64 `json:"jewelsAmount,omitempty"`
4651 // Language: The BCP-47 language code of the gift.
4652 Language string `json:"language,omitempty"`
4653 // ForceSendFields is a list of field names (e.g. "AltText") to unconditionally
4654 // include in API requests. By default, fields with empty or default values are
4655 // omitted from API requests. See
4656 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4657 // details.
4658 ForceSendFields []string `json:"-"`
4659 // NullFields is a list of field names (e.g. "AltText") to include in API
4660 // requests with the JSON null value. By default, fields with empty values are
4661 // omitted from API requests. See
4662 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4663 NullFields []string `json:"-"`
4664 }
4665
4666 func (s LiveChatGiftDetails) MarshalJSON() ([]byte, error) {
4667 type NoMethod LiveChatGiftDetails
4668 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4669 }
4670
4671 type LiveChatGiftMembershipReceivedDetails struct {
4672 // AssociatedMembershipGiftingMessageId: The ID of the membership gifting
4673 // message that is related to this gift membership. This ID will always refer
4674 // to a message whose type is 'membershipGiftingEvent'.
4675 AssociatedMembershipGiftingMessageId string `json:"associatedMembershipGiftingMessageId,omitempty"`
4676 // GifterChannelId: The ID of the user that made the membership gifting
4677 // purchase. This matches the `snippet.authorChannelId` of the associated
4678 // membership gifting message.
4679 GifterChannelId string `json:"gifterChannelId,omitempty"`
4680 // MemberLevelName: The name of the Level at which the viewer is a member. This
4681 // matches the `snippet.membershipGiftingDetails.giftMembershipsLevelName` of
4682 // the associated membership gifting message. The Level names are defined by
4683 // the YouTube channel offering the Membership. In some situations this field
4684 // isn't filled.
4685 MemberLevelName string `json:"memberLevelName,omitempty"`
4686 // ForceSendFields is a list of field names (e.g.
4687 // "AssociatedMembershipGiftingMessageId") to unconditionally include in API
4688 // requests. By default, fields with empty or default values are omitted from
4689 // API requests. See
4690 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4691 // details.
4692 ForceSendFields []string `json:"-"`
4693 // NullFields is a list of field names (e.g.
4694 // "AssociatedMembershipGiftingMessageId") to include in API requests with the
4695 // JSON null value. By default, fields with empty values are omitted from API
4696 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-NullFields for
4697 // more details.
4698 NullFields []string `json:"-"`
4699 }
4700
4701 func (s LiveChatGiftMembershipReceivedDetails) MarshalJSON() ([]byte, error) {
4702 type NoMethod LiveChatGiftMembershipReceivedDetails
4703 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4704 }
4705
4706 type LiveChatMemberMilestoneChatDetails struct {
4707 // MemberLevelName: The name of the Level at which the viever is a member. The
4708 // Level names are defined by the YouTube channel offering the Membership. In
4709 // some situations this field isn't filled.
4710 MemberLevelName string `json:"memberLevelName,omitempty"`
4711 // MemberMonth: The total amount of months (rounded up) the viewer has been a
4712 // member that granted them this Member Milestone Chat. This is the same number
4713 // of months as is being displayed to YouTube users.
4714 MemberMonth int64 `json:"memberMonth,omitempty"`
4715 // UserComment: The comment added by the member to this Member Milestone Chat.
4716 // This field is empty for messages without a comment from the member.
4717 UserComment string `json:"userComment,omitempty"`
4718 // ForceSendFields is a list of field names (e.g. "MemberLevelName") to
4719 // unconditionally include in API requests. By default, fields with empty or
4720 // default values are omitted from API requests. See
4721 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4722 // details.
4723 ForceSendFields []string `json:"-"`
4724 // NullFields is a list of field names (e.g. "MemberLevelName") to include in
4725 // API requests with the JSON null value. By default, fields with empty values
4726 // are omitted from API requests. See
4727 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4728 NullFields []string `json:"-"`
4729 }
4730
4731 func (s LiveChatMemberMilestoneChatDetails) MarshalJSON() ([]byte, error) {
4732 type NoMethod LiveChatMemberMilestoneChatDetails
4733 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4734 }
4735
4736 type LiveChatMembershipGiftingDetails struct {
4737 // GiftMembershipsCount: The number of gift memberships purchased by the user.
4738 GiftMembershipsCount int64 `json:"giftMembershipsCount,omitempty"`
4739 // GiftMembershipsLevelName: The name of the level of the gift memberships
4740 // purchased by the user. The Level names are defined by the YouTube channel
4741 // offering the Membership. In some situations this field isn't filled.
4742 GiftMembershipsLevelName string `json:"giftMembershipsLevelName,omitempty"`
4743 // ForceSendFields is a list of field names (e.g. "GiftMembershipsCount") to
4744 // unconditionally include in API requests. By default, fields with empty or
4745 // default values are omitted from API requests. See
4746 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4747 // details.
4748 ForceSendFields []string `json:"-"`
4749 // NullFields is a list of field names (e.g. "GiftMembershipsCount") to include
4750 // in API requests with the JSON null value. By default, fields with empty
4751 // values are omitted from API requests. See
4752 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4753 NullFields []string `json:"-"`
4754 }
4755
4756 func (s LiveChatMembershipGiftingDetails) MarshalJSON() ([]byte, error) {
4757 type NoMethod LiveChatMembershipGiftingDetails
4758 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4759 }
4760
4761 // LiveChatMessage: A *liveChatMessage* resource represents a chat message in a
4762 // YouTube Live Chat.
4763 type LiveChatMessage struct {
4764 // AuthorDetails: The authorDetails object contains basic details about the
4765 // user that posted this message.
4766 AuthorDetails *LiveChatMessageAuthorDetails `json:"authorDetails,omitempty"`
4767 // Etag: Etag of this resource.
4768 Etag string `json:"etag,omitempty"`
4769 // Id: The ID that YouTube assigns to uniquely identify the message.
4770 Id string `json:"id,omitempty"`
4771 // Kind: Identifies what kind of resource this is. Value: the fixed string
4772 // "youtube#liveChatMessage".
4773 Kind string `json:"kind,omitempty"`
4774 // Snippet: The snippet object contains basic details about the message.
4775 Snippet *LiveChatMessageSnippet `json:"snippet,omitempty"`
4776
4777 // ServerResponse contains the HTTP response code and headers from the server.
4778 googleapi.ServerResponse `json:"-"`
4779 // ForceSendFields is a list of field names (e.g. "AuthorDetails") to
4780 // unconditionally include in API requests. By default, fields with empty or
4781 // default values are omitted from API requests. See
4782 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4783 // details.
4784 ForceSendFields []string `json:"-"`
4785 // NullFields is a list of field names (e.g. "AuthorDetails") to include in API
4786 // requests with the JSON null value. By default, fields with empty values are
4787 // omitted from API requests. See
4788 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4789 NullFields []string `json:"-"`
4790 }
4791
4792 func (s LiveChatMessage) MarshalJSON() ([]byte, error) {
4793 type NoMethod LiveChatMessage
4794 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4795 }
4796
4797 type LiveChatMessageAuthorDetails struct {
4798 // ChannelId: The YouTube channel ID.
4799 ChannelId string `json:"channelId,omitempty"`
4800 // ChannelUrl: The channel's URL.
4801 ChannelUrl string `json:"channelUrl,omitempty"`
4802 // DisplayName: The channel's display name.
4803 DisplayName string `json:"displayName,omitempty"`
4804 // IsChatModerator: Whether the author is a moderator of the live chat.
4805 IsChatModerator bool `json:"isChatModerator,omitempty"`
4806 // IsChatOwner: Whether the author is the owner of the live chat.
4807 IsChatOwner bool `json:"isChatOwner,omitempty"`
4808 // IsChatSponsor: Whether the author is a sponsor of the live chat.
4809 IsChatSponsor bool `json:"isChatSponsor,omitempty"`
4810 // IsVerified: Whether the author's identity has been verified by YouTube.
4811 IsVerified bool `json:"isVerified,omitempty"`
4812 // ProfileImageUrl: The channels's avatar URL.
4813 ProfileImageUrl string `json:"profileImageUrl,omitempty"`
4814 // ForceSendFields is a list of field names (e.g. "ChannelId") to
4815 // unconditionally include in API requests. By default, fields with empty or
4816 // default values are omitted from API requests. See
4817 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4818 // details.
4819 ForceSendFields []string `json:"-"`
4820 // NullFields is a list of field names (e.g. "ChannelId") to include in API
4821 // requests with the JSON null value. By default, fields with empty values are
4822 // omitted from API requests. See
4823 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4824 NullFields []string `json:"-"`
4825 }
4826
4827 func (s LiveChatMessageAuthorDetails) MarshalJSON() ([]byte, error) {
4828 type NoMethod LiveChatMessageAuthorDetails
4829 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4830 }
4831
4832 type LiveChatMessageDeletedDetails struct {
4833 DeletedMessageId string `json:"deletedMessageId,omitempty"`
4834 // ForceSendFields is a list of field names (e.g. "DeletedMessageId") to
4835 // unconditionally include in API requests. By default, fields with empty or
4836 // default values are omitted from API requests. See
4837 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4838 // details.
4839 ForceSendFields []string `json:"-"`
4840 // NullFields is a list of field names (e.g. "DeletedMessageId") to include in
4841 // API requests with the JSON null value. By default, fields with empty values
4842 // are omitted from API requests. See
4843 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4844 NullFields []string `json:"-"`
4845 }
4846
4847 func (s LiveChatMessageDeletedDetails) MarshalJSON() ([]byte, error) {
4848 type NoMethod LiveChatMessageDeletedDetails
4849 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4850 }
4851
4852 type LiveChatMessageListResponse struct {
4853 // ActivePollItem: Set when there is an active poll.
4854 ActivePollItem *LiveChatMessage `json:"activePollItem,omitempty"`
4855 // Etag: Etag of this resource.
4856 Etag string `json:"etag,omitempty"`
4857 // EventId: Serialized EventId of the request which produced this response.
4858 EventId string `json:"eventId,omitempty"`
4859 Items []*LiveChatMessage `json:"items,omitempty"`
4860 // Kind: Identifies what kind of resource this is. Value: the fixed string
4861 // "youtube#liveChatMessageListResponse".
4862 Kind string `json:"kind,omitempty"`
4863 NextPageToken string `json:"nextPageToken,omitempty"`
4864 // OfflineAt: The date and time when the underlying stream went offline.
4865 OfflineAt string `json:"offlineAt,omitempty"`
4866 // PageInfo: General pagination information.
4867 PageInfo *PageInfo `json:"pageInfo,omitempty"`
4868 // PollingIntervalMillis: The amount of time the client should wait before
4869 // polling again.
4870 PollingIntervalMillis int64 `json:"pollingIntervalMillis,omitempty"`
4871 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
4872 // VisitorId: The visitorId identifies the visitor.
4873 VisitorId string `json:"visitorId,omitempty"`
4874
4875 // ServerResponse contains the HTTP response code and headers from the server.
4876 googleapi.ServerResponse `json:"-"`
4877 // ForceSendFields is a list of field names (e.g. "ActivePollItem") to
4878 // unconditionally include in API requests. By default, fields with empty or
4879 // default values are omitted from API requests. See
4880 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4881 // details.
4882 ForceSendFields []string `json:"-"`
4883 // NullFields is a list of field names (e.g. "ActivePollItem") to include in
4884 // API requests with the JSON null value. By default, fields with empty values
4885 // are omitted from API requests. See
4886 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4887 NullFields []string `json:"-"`
4888 }
4889
4890 func (s LiveChatMessageListResponse) MarshalJSON() ([]byte, error) {
4891 type NoMethod LiveChatMessageListResponse
4892 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4893 }
4894
4895 type LiveChatMessageRetractedDetails struct {
4896 RetractedMessageId string `json:"retractedMessageId,omitempty"`
4897 // ForceSendFields is a list of field names (e.g. "RetractedMessageId") to
4898 // unconditionally include in API requests. By default, fields with empty or
4899 // default values are omitted from API requests. See
4900 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
4901 // details.
4902 ForceSendFields []string `json:"-"`
4903 // NullFields is a list of field names (e.g. "RetractedMessageId") to include
4904 // in API requests with the JSON null value. By default, fields with empty
4905 // values are omitted from API requests. See
4906 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
4907 NullFields []string `json:"-"`
4908 }
4909
4910 func (s LiveChatMessageRetractedDetails) MarshalJSON() ([]byte, error) {
4911 type NoMethod LiveChatMessageRetractedDetails
4912 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
4913 }
4914
4915 // LiveChatMessageSnippet: Next ID: 35
4916 type LiveChatMessageSnippet struct {
4917 // AuthorChannelId: The ID of the user that authored this message, this field
4918 // is not always filled. textMessageEvent - the user that wrote the message
4919 // fanFundingEvent - the user that funded the broadcast newSponsorEvent - the
4920 // user that just became a sponsor memberMilestoneChatEvent - the member that
4921 // sent the message membershipGiftingEvent - the user that made the purchase
4922 // giftMembershipReceivedEvent - the user that received the gift membership
4923 // messageDeletedEvent - the moderator that took the action
4924 // messageRetractedEvent - the author that retracted their message
4925 // userBannedEvent - the moderator that took the action superChatEvent - the
4926 // user that made the purchase superStickerEvent - the user that made the
4927 // purchase pollEvent - the user that created the poll
4928 AuthorChannelId string `json:"authorChannelId,omitempty"`
4929 // DisplayMessage: Contains a string that can be displayed to the user. If this
4930 // field is not present the message is silent, at the moment only messages of
4931 // type TOMBSTONE and CHAT_ENDED_EVENT are silent.
4932 DisplayMessage string `json:"displayMessage,omitempty"`
4933 // FanFundingEventDetails: Details about the funding event, this is only set if
4934 // the type is 'fanFundingEvent'.
4935 FanFundingEventDetails *LiveChatFanFundingEventDetails `json:"fanFundingEventDetails,omitempty"`
4936 // GiftDetails: Details about the gift event, this is only set if the type is
4937 // 'giftEvent'.
4938 GiftDetails *LiveChatGiftDetails `json:"giftDetails,omitempty"`
4939 // GiftMembershipReceivedDetails: Details about the Gift Membership Received
4940 // event, this is only set if the type is 'giftMembershipReceivedEvent'.
4941 GiftMembershipReceivedDetails *LiveChatGiftMembershipReceivedDetails `json:"giftMembershipReceivedDetails,omitempty"`
4942 // HasDisplayContent: Whether the message has display content that should be
4943 // displayed to users.
4944 HasDisplayContent bool `json:"hasDisplayContent,omitempty"`
4945 LiveChatId string `json:"liveChatId,omitempty"`
4946 // MemberMilestoneChatDetails: Details about the Member Milestone Chat event,
4947 // this is only set if the type is 'memberMilestoneChatEvent'.
4948 MemberMilestoneChatDetails *LiveChatMemberMilestoneChatDetails `json:"memberMilestoneChatDetails,omitempty"`
4949 // MembershipGiftingDetails: Details about the Membership Gifting event, this
4950 // is only set if the type is 'membershipGiftingEvent'.
4951 MembershipGiftingDetails *LiveChatMembershipGiftingDetails `json:"membershipGiftingDetails,omitempty"`
4952 MessageDeletedDetails *LiveChatMessageDeletedDetails `json:"messageDeletedDetails,omitempty"`
4953 MessageRetractedDetails *LiveChatMessageRetractedDetails `json:"messageRetractedDetails,omitempty"`
4954 // NewSponsorDetails: Details about the New Member Announcement event, this is
4955 // only set if the type is 'newSponsorEvent'. Please note that "member" is the
4956 // new term for "sponsor".
4957 NewSponsorDetails *LiveChatNewSponsorDetails `json:"newSponsorDetails,omitempty"`
4958 // PollDetails: Details about the poll event, this is only set if the type is
4959 // 'pollEvent'.
4960 PollDetails *LiveChatPollDetails `json:"pollDetails,omitempty"`
4961 // PublishedAt: The date and time when the message was orignally published.
4962 PublishedAt string `json:"publishedAt,omitempty"`
4963 // SuperChatDetails: Details about the Super Chat event, this is only set if
4964 // the type is 'superChatEvent'.
4965 SuperChatDetails *LiveChatSuperChatDetails `json:"superChatDetails,omitempty"`
4966 // SuperStickerDetails: Details about the Super Sticker event, this is only set
4967 // if the type is 'superStickerEvent'.
4968 SuperStickerDetails *LiveChatSuperStickerDetails `json:"superStickerDetails,omitempty"`
4969 // TextMessageDetails: Details about the text message, this is only set if the
4970 // type is 'textMessageEvent'.
4971 TextMessageDetails *LiveChatTextMessageDetails `json:"textMessageDetails,omitempty"`
4972 // Type: The type of message, this will always be present, it determines the
4973 // contents of the message as well as which fields will be present.
4974 //
4975 // Possible values:
4976 // "invalidType"
4977 // "textMessageEvent"
4978 // "tombstone"
4979 // "fanFundingEvent"
4980 // "chatEndedEvent"
4981 // "sponsorOnlyModeStartedEvent"
4982 // "sponsorOnlyModeEndedEvent"
4983 // "newSponsorEvent"
4984 // "memberMilestoneChatEvent"
4985 // "membershipGiftingEvent"
4986 // "giftMembershipReceivedEvent"
4987 // "messageDeletedEvent"
4988 // "messageRetractedEvent"
4989 // "userBannedEvent"
4990 // "superChatEvent"
4991 // "superStickerEvent"
4992 // "pollEvent"
4993 // "giftEvent" - A virtual gift sent by a viewer to support a creator.
4994 Type string `json:"type,omitempty"`
4995 UserBannedDetails *LiveChatUserBannedMessageDetails `json:"userBannedDetails,omitempty"`
4996 // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
4997 // unconditionally include in API requests. By default, fields with empty or
4998 // default values are omitted from API requests. See
4999 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5000 // details.
5001 ForceSendFields []string `json:"-"`
5002 // NullFields is a list of field names (e.g. "AuthorChannelId") to include in
5003 // API requests with the JSON null value. By default, fields with empty values
5004 // are omitted from API requests. See
5005 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5006 NullFields []string `json:"-"`
5007 }
5008
5009 func (s LiveChatMessageSnippet) MarshalJSON() ([]byte, error) {
5010 type NoMethod LiveChatMessageSnippet
5011 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5012 }
5013
5014 // LiveChatModerator: A *liveChatModerator* resource represents a moderator for
5015 // a YouTube live chat. A chat moderator has the ability to ban/unban users
5016 // from a chat, remove message, etc.
5017 type LiveChatModerator struct {
5018 // Etag: Etag of this resource.
5019 Etag string `json:"etag,omitempty"`
5020 // Id: The ID that YouTube assigns to uniquely identify the moderator.
5021 Id string `json:"id,omitempty"`
5022 // Kind: Identifies what kind of resource this is. Value: the fixed string
5023 // "youtube#liveChatModerator".
5024 Kind string `json:"kind,omitempty"`
5025 // Snippet: The snippet object contains basic details about the moderator.
5026 Snippet *LiveChatModeratorSnippet `json:"snippet,omitempty"`
5027
5028 // ServerResponse contains the HTTP response code and headers from the server.
5029 googleapi.ServerResponse `json:"-"`
5030 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5031 // include in API requests. By default, fields with empty or default values are
5032 // omitted from API requests. See
5033 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5034 // details.
5035 ForceSendFields []string `json:"-"`
5036 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5037 // with the JSON null value. By default, fields with empty values are omitted
5038 // from API requests. See
5039 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5040 NullFields []string `json:"-"`
5041 }
5042
5043 func (s LiveChatModerator) MarshalJSON() ([]byte, error) {
5044 type NoMethod LiveChatModerator
5045 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5046 }
5047
5048 type LiveChatModeratorListResponse struct {
5049 // Etag: Etag of this resource.
5050 Etag string `json:"etag,omitempty"`
5051 // EventId: Serialized EventId of the request which produced this response.
5052 EventId string `json:"eventId,omitempty"`
5053 // Items: A list of moderators that match the request criteria.
5054 Items []*LiveChatModerator `json:"items,omitempty"`
5055 // Kind: Identifies what kind of resource this is. Value: the fixed string
5056 // "youtube#liveChatModeratorListResponse".
5057 Kind string `json:"kind,omitempty"`
5058 // NextPageToken: The token that can be used as the value of the pageToken
5059 // parameter to retrieve the next page in the result set.
5060 NextPageToken string `json:"nextPageToken,omitempty"`
5061 // PageInfo: General pagination information.
5062 PageInfo *PageInfo `json:"pageInfo,omitempty"`
5063 // PrevPageToken: The token that can be used as the value of the pageToken
5064 // parameter to retrieve the previous page in the result set.
5065 PrevPageToken string `json:"prevPageToken,omitempty"`
5066 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
5067 // VisitorId: The visitorId identifies the visitor.
5068 VisitorId string `json:"visitorId,omitempty"`
5069
5070 // ServerResponse contains the HTTP response code and headers from the server.
5071 googleapi.ServerResponse `json:"-"`
5072 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5073 // include in API requests. By default, fields with empty or default values are
5074 // omitted from API requests. See
5075 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5076 // details.
5077 ForceSendFields []string `json:"-"`
5078 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5079 // with the JSON null value. By default, fields with empty values are omitted
5080 // from API requests. See
5081 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5082 NullFields []string `json:"-"`
5083 }
5084
5085 func (s LiveChatModeratorListResponse) MarshalJSON() ([]byte, error) {
5086 type NoMethod LiveChatModeratorListResponse
5087 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5088 }
5089
5090 type LiveChatModeratorSnippet struct {
5091 // LiveChatId: The ID of the live chat this moderator can act on.
5092 LiveChatId string `json:"liveChatId,omitempty"`
5093 // ModeratorDetails: Details about the moderator.
5094 ModeratorDetails *ChannelProfileDetails `json:"moderatorDetails,omitempty"`
5095 // ForceSendFields is a list of field names (e.g. "LiveChatId") to
5096 // unconditionally include in API requests. By default, fields with empty or
5097 // default values are omitted from API requests. See
5098 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5099 // details.
5100 ForceSendFields []string `json:"-"`
5101 // NullFields is a list of field names (e.g. "LiveChatId") to include in API
5102 // requests with the JSON null value. By default, fields with empty values are
5103 // omitted from API requests. See
5104 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5105 NullFields []string `json:"-"`
5106 }
5107
5108 func (s LiveChatModeratorSnippet) MarshalJSON() ([]byte, error) {
5109 type NoMethod LiveChatModeratorSnippet
5110 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5111 }
5112
5113 type LiveChatNewSponsorDetails struct {
5114 // IsUpgrade: If the viewer just had upgraded from a lower level. For viewers
5115 // that were not members at the time of purchase, this field is false.
5116 IsUpgrade bool `json:"isUpgrade,omitempty"`
5117 // MemberLevelName: The name of the Level that the viewer just had joined. The
5118 // Level names are defined by the YouTube channel offering the Membership. In
5119 // some situations this field isn't filled.
5120 MemberLevelName string `json:"memberLevelName,omitempty"`
5121 // ForceSendFields is a list of field names (e.g. "IsUpgrade") to
5122 // unconditionally include in API requests. By default, fields with empty or
5123 // default values are omitted from API requests. See
5124 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5125 // details.
5126 ForceSendFields []string `json:"-"`
5127 // NullFields is a list of field names (e.g. "IsUpgrade") to include in API
5128 // requests with the JSON null value. By default, fields with empty values are
5129 // omitted from API requests. See
5130 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5131 NullFields []string `json:"-"`
5132 }
5133
5134 func (s LiveChatNewSponsorDetails) MarshalJSON() ([]byte, error) {
5135 type NoMethod LiveChatNewSponsorDetails
5136 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5137 }
5138
5139 type LiveChatPollDetails struct {
5140 Metadata *LiveChatPollDetailsPollMetadata `json:"metadata,omitempty"`
5141 // Possible values:
5142 // "unknown"
5143 // "active"
5144 // "closed"
5145 Status string `json:"status,omitempty"`
5146 // ForceSendFields is a list of field names (e.g. "Metadata") to
5147 // unconditionally include in API requests. By default, fields with empty or
5148 // default values are omitted from API requests. See
5149 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5150 // details.
5151 ForceSendFields []string `json:"-"`
5152 // NullFields is a list of field names (e.g. "Metadata") to include in API
5153 // requests with the JSON null value. By default, fields with empty values are
5154 // omitted from API requests. See
5155 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5156 NullFields []string `json:"-"`
5157 }
5158
5159 func (s LiveChatPollDetails) MarshalJSON() ([]byte, error) {
5160 type NoMethod LiveChatPollDetails
5161 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5162 }
5163
5164 type LiveChatPollDetailsPollMetadata struct {
5165 // Options: The options will be returned in the order that is displayed in 1P
5166 Options []*LiveChatPollDetailsPollMetadataPollOption `json:"options,omitempty"`
5167 QuestionText string `json:"questionText,omitempty"`
5168 // ForceSendFields is a list of field names (e.g. "Options") to unconditionally
5169 // include in API requests. By default, fields with empty or default values are
5170 // omitted from API requests. See
5171 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5172 // details.
5173 ForceSendFields []string `json:"-"`
5174 // NullFields is a list of field names (e.g. "Options") to include in API
5175 // requests with the JSON null value. By default, fields with empty values are
5176 // omitted from API requests. See
5177 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5178 NullFields []string `json:"-"`
5179 }
5180
5181 func (s LiveChatPollDetailsPollMetadata) MarshalJSON() ([]byte, error) {
5182 type NoMethod LiveChatPollDetailsPollMetadata
5183 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5184 }
5185
5186 type LiveChatPollDetailsPollMetadataPollOption struct {
5187 OptionText string `json:"optionText,omitempty"`
5188 Tally int64 `json:"tally,omitempty,string"`
5189 // ForceSendFields is a list of field names (e.g. "OptionText") to
5190 // unconditionally include in API requests. By default, fields with empty or
5191 // default values are omitted from API requests. See
5192 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5193 // details.
5194 ForceSendFields []string `json:"-"`
5195 // NullFields is a list of field names (e.g. "OptionText") to include in API
5196 // requests with the JSON null value. By default, fields with empty values are
5197 // omitted from API requests. See
5198 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5199 NullFields []string `json:"-"`
5200 }
5201
5202 func (s LiveChatPollDetailsPollMetadataPollOption) MarshalJSON() ([]byte, error) {
5203 type NoMethod LiveChatPollDetailsPollMetadataPollOption
5204 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5205 }
5206
5207 type LiveChatSuperChatDetails struct {
5208 // AmountDisplayString: A rendered string that displays the fund amount and
5209 // currency to the user.
5210 AmountDisplayString string `json:"amountDisplayString,omitempty"`
5211 // AmountMicros: The amount purchased by the user, in micros (1,750,000 micros
5212 // = 1.75).
5213 AmountMicros uint64 `json:"amountMicros,omitempty,string"`
5214 // Currency: The currency in which the purchase was made.
5215 Currency string `json:"currency,omitempty"`
5216 // Tier: The tier in which the amount belongs. Lower amounts belong to lower
5217 // tiers. The lowest tier is 1.
5218 Tier int64 `json:"tier,omitempty"`
5219 // UserComment: The comment added by the user to this Super Chat event.
5220 UserComment string `json:"userComment,omitempty"`
5221 // ForceSendFields is a list of field names (e.g. "AmountDisplayString") to
5222 // unconditionally include in API requests. By default, fields with empty or
5223 // default values are omitted from API requests. See
5224 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5225 // details.
5226 ForceSendFields []string `json:"-"`
5227 // NullFields is a list of field names (e.g. "AmountDisplayString") to include
5228 // in API requests with the JSON null value. By default, fields with empty
5229 // values are omitted from API requests. See
5230 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5231 NullFields []string `json:"-"`
5232 }
5233
5234 func (s LiveChatSuperChatDetails) MarshalJSON() ([]byte, error) {
5235 type NoMethod LiveChatSuperChatDetails
5236 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5237 }
5238
5239 type LiveChatSuperStickerDetails struct {
5240 // AmountDisplayString: A rendered string that displays the fund amount and
5241 // currency to the user.
5242 AmountDisplayString string `json:"amountDisplayString,omitempty"`
5243 // AmountMicros: The amount purchased by the user, in micros (1,750,000 micros
5244 // = 1.75).
5245 AmountMicros uint64 `json:"amountMicros,omitempty,string"`
5246 // Currency: The currency in which the purchase was made.
5247 Currency string `json:"currency,omitempty"`
5248 // SuperStickerMetadata: Information about the Super Sticker.
5249 SuperStickerMetadata *SuperStickerMetadata `json:"superStickerMetadata,omitempty"`
5250 // Tier: The tier in which the amount belongs. Lower amounts belong to lower
5251 // tiers. The lowest tier is 1.
5252 Tier int64 `json:"tier,omitempty"`
5253 // ForceSendFields is a list of field names (e.g. "AmountDisplayString") to
5254 // unconditionally include in API requests. By default, fields with empty or
5255 // default values are omitted from API requests. See
5256 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5257 // details.
5258 ForceSendFields []string `json:"-"`
5259 // NullFields is a list of field names (e.g. "AmountDisplayString") to include
5260 // in API requests with the JSON null value. By default, fields with empty
5261 // values are omitted from API requests. See
5262 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5263 NullFields []string `json:"-"`
5264 }
5265
5266 func (s LiveChatSuperStickerDetails) MarshalJSON() ([]byte, error) {
5267 type NoMethod LiveChatSuperStickerDetails
5268 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5269 }
5270
5271 type LiveChatTextMessageDetails struct {
5272 // MessageText: The user's message.
5273 MessageText string `json:"messageText,omitempty"`
5274 // ForceSendFields is a list of field names (e.g. "MessageText") to
5275 // unconditionally include in API requests. By default, fields with empty or
5276 // default values are omitted from API requests. See
5277 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5278 // details.
5279 ForceSendFields []string `json:"-"`
5280 // NullFields is a list of field names (e.g. "MessageText") to include in API
5281 // requests with the JSON null value. By default, fields with empty values are
5282 // omitted from API requests. See
5283 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5284 NullFields []string `json:"-"`
5285 }
5286
5287 func (s LiveChatTextMessageDetails) MarshalJSON() ([]byte, error) {
5288 type NoMethod LiveChatTextMessageDetails
5289 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5290 }
5291
5292 type LiveChatUserBannedMessageDetails struct {
5293 // BanDurationSeconds: The duration of the ban. This property is only present
5294 // if the banType is temporary.
5295 BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
5296 // BanType: The type of ban.
5297 //
5298 // Possible values:
5299 // "permanent"
5300 // "temporary"
5301 BanType string `json:"banType,omitempty"`
5302 // BannedUserDetails: The details of the user that was banned.
5303 BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
5304 // ForceSendFields is a list of field names (e.g. "BanDurationSeconds") to
5305 // unconditionally include in API requests. By default, fields with empty or
5306 // default values are omitted from API requests. See
5307 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5308 // details.
5309 ForceSendFields []string `json:"-"`
5310 // NullFields is a list of field names (e.g. "BanDurationSeconds") to include
5311 // in API requests with the JSON null value. By default, fields with empty
5312 // values are omitted from API requests. See
5313 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5314 NullFields []string `json:"-"`
5315 }
5316
5317 func (s LiveChatUserBannedMessageDetails) MarshalJSON() ([]byte, error) {
5318 type NoMethod LiveChatUserBannedMessageDetails
5319 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5320 }
5321
5322 // LiveStream: A live stream describes a live ingestion point.
5323 type LiveStream struct {
5324 // Cdn: The cdn object defines the live stream's content delivery network (CDN)
5325 // settings. These settings provide details about the manner in which you
5326 // stream your content to YouTube.
5327 Cdn *CdnSettings `json:"cdn,omitempty"`
5328 // ContentDetails: The content_details object contains information about the
5329 // stream, including the closed captions ingestion URL.
5330 ContentDetails *LiveStreamContentDetails `json:"contentDetails,omitempty"`
5331 // Etag: Etag of this resource.
5332 Etag string `json:"etag,omitempty"`
5333 // Id: The ID that YouTube assigns to uniquely identify the stream.
5334 Id string `json:"id,omitempty"`
5335 // Kind: Identifies what kind of resource this is. Value: the fixed string
5336 // "youtube#liveStream".
5337 Kind string `json:"kind,omitempty"`
5338 // Snippet: The snippet object contains basic details about the stream,
5339 // including its channel, title, and description.
5340 Snippet *LiveStreamSnippet `json:"snippet,omitempty"`
5341 // Status: The status object contains information about live stream's status.
5342 Status *LiveStreamStatus `json:"status,omitempty"`
5343
5344 // ServerResponse contains the HTTP response code and headers from the server.
5345 googleapi.ServerResponse `json:"-"`
5346 // ForceSendFields is a list of field names (e.g. "Cdn") to unconditionally
5347 // include in API requests. By default, fields with empty or default values are
5348 // omitted from API requests. See
5349 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5350 // details.
5351 ForceSendFields []string `json:"-"`
5352 // NullFields is a list of field names (e.g. "Cdn") to include in API requests
5353 // with the JSON null value. By default, fields with empty values are omitted
5354 // from API requests. See
5355 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5356 NullFields []string `json:"-"`
5357 }
5358
5359 func (s LiveStream) MarshalJSON() ([]byte, error) {
5360 type NoMethod LiveStream
5361 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5362 }
5363
5364 type LiveStreamConfigurationIssue struct {
5365 // Description: The long-form description of the issue and how to resolve it.
5366 Description string `json:"description,omitempty"`
5367 // Reason: The short-form reason for this issue.
5368 Reason string `json:"reason,omitempty"`
5369 // Severity: How severe this issue is to the stream.
5370 //
5371 // Possible values:
5372 // "info"
5373 // "warning"
5374 // "error"
5375 Severity string `json:"severity,omitempty"`
5376 // Type: The kind of error happening.
5377 //
5378 // Possible values:
5379 // "gopSizeOver"
5380 // "gopSizeLong"
5381 // "gopSizeShort"
5382 // "openGop"
5383 // "badContainer"
5384 // "audioBitrateHigh"
5385 // "audioBitrateLow"
5386 // "audioSampleRate"
5387 // "bitrateHigh"
5388 // "bitrateLow"
5389 // "audioCodec"
5390 // "videoCodec"
5391 // "noAudioStream"
5392 // "noVideoStream"
5393 // "multipleVideoStreams"
5394 // "multipleAudioStreams"
5395 // "audioTooManyChannels"
5396 // "interlacedVideo"
5397 // "frameRateHigh"
5398 // "resolutionMismatch"
5399 // "videoCodecMismatch"
5400 // "videoInterlaceMismatch"
5401 // "videoProfileMismatch"
5402 // "videoBitrateMismatch"
5403 // "framerateMismatch"
5404 // "gopMismatch"
5405 // "audioSampleRateMismatch"
5406 // "audioStereoMismatch"
5407 // "audioCodecMismatch"
5408 // "audioBitrateMismatch"
5409 // "videoResolutionSuboptimal"
5410 // "videoResolutionUnsupported"
5411 // "videoIngestionStarved"
5412 // "videoIngestionFasterThanRealtime"
5413 Type string `json:"type,omitempty"`
5414 // ForceSendFields is a list of field names (e.g. "Description") to
5415 // unconditionally include in API requests. By default, fields with empty or
5416 // default values are omitted from API requests. See
5417 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5418 // details.
5419 ForceSendFields []string `json:"-"`
5420 // NullFields is a list of field names (e.g. "Description") to include in API
5421 // requests with the JSON null value. By default, fields with empty values are
5422 // omitted from API requests. See
5423 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5424 NullFields []string `json:"-"`
5425 }
5426
5427 func (s LiveStreamConfigurationIssue) MarshalJSON() ([]byte, error) {
5428 type NoMethod LiveStreamConfigurationIssue
5429 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5430 }
5431
5432 // LiveStreamContentDetails: Detailed settings of a stream.
5433 type LiveStreamContentDetails struct {
5434 // ClosedCaptionsIngestionUrl: The ingestion URL where the closed captions of
5435 // this stream are sent.
5436 ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"`
5437 // IsReusable: Indicates whether the stream is reusable, which means that it
5438 // can be bound to multiple broadcasts. It is common for broadcasters to reuse
5439 // the same stream for many different broadcasts if those broadcasts occur at
5440 // different times. If you set this value to false, then the stream will not be
5441 // reusable, which means that it can only be bound to one broadcast.
5442 // Non-reusable streams differ from reusable streams in the following ways: - A
5443 // non-reusable stream can only be bound to one broadcast. - A non-reusable
5444 // stream might be deleted by an automated process after the broadcast ends. -
5445 // The liveStreams.list method does not list non-reusable streams if you call
5446 // the method and set the mine parameter to true. The only way to use that
5447 // method to retrieve the resource for a non-reusable stream is to use the id
5448 // parameter to identify the stream.
5449 IsReusable bool `json:"isReusable,omitempty"`
5450 // ForceSendFields is a list of field names (e.g. "ClosedCaptionsIngestionUrl")
5451 // to unconditionally include in API requests. By default, fields with empty or
5452 // default values are omitted from API requests. See
5453 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5454 // details.
5455 ForceSendFields []string `json:"-"`
5456 // NullFields is a list of field names (e.g. "ClosedCaptionsIngestionUrl") to
5457 // include in API requests with the JSON null value. By default, fields with
5458 // empty values are omitted from API requests. See
5459 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5460 NullFields []string `json:"-"`
5461 }
5462
5463 func (s LiveStreamContentDetails) MarshalJSON() ([]byte, error) {
5464 type NoMethod LiveStreamContentDetails
5465 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5466 }
5467
5468 type LiveStreamHealthStatus struct {
5469 // ConfigurationIssues: The configurations issues on this stream
5470 ConfigurationIssues []*LiveStreamConfigurationIssue `json:"configurationIssues,omitempty"`
5471 // LastUpdateTimeSeconds: The last time this status was updated (in seconds)
5472 LastUpdateTimeSeconds uint64 `json:"lastUpdateTimeSeconds,omitempty,string"`
5473 // Status: The status code of this stream
5474 //
5475 // Possible values:
5476 // "good"
5477 // "ok"
5478 // "bad"
5479 // "noData"
5480 // "revoked"
5481 Status string `json:"status,omitempty"`
5482 // ForceSendFields is a list of field names (e.g. "ConfigurationIssues") to
5483 // unconditionally include in API requests. By default, fields with empty or
5484 // default values are omitted from API requests. See
5485 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5486 // details.
5487 ForceSendFields []string `json:"-"`
5488 // NullFields is a list of field names (e.g. "ConfigurationIssues") to include
5489 // in API requests with the JSON null value. By default, fields with empty
5490 // values are omitted from API requests. See
5491 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5492 NullFields []string `json:"-"`
5493 }
5494
5495 func (s LiveStreamHealthStatus) MarshalJSON() ([]byte, error) {
5496 type NoMethod LiveStreamHealthStatus
5497 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5498 }
5499
5500 type LiveStreamListResponse struct {
5501 // Etag: Etag of this resource.
5502 Etag string `json:"etag,omitempty"`
5503 // EventId: Serialized EventId of the request which produced this response.
5504 EventId string `json:"eventId,omitempty"`
5505 // Items: A list of live streams that match the request criteria.
5506 Items []*LiveStream `json:"items,omitempty"`
5507 // Kind: Identifies what kind of resource this is. Value: the fixed string
5508 // "youtube#liveStreamListResponse".
5509 Kind string `json:"kind,omitempty"`
5510 // NextPageToken: The token that can be used as the value of the pageToken
5511 // parameter to retrieve the next page in the result set.
5512 NextPageToken string `json:"nextPageToken,omitempty"`
5513 PageInfo *PageInfo `json:"pageInfo,omitempty"`
5514 // PrevPageToken: The token that can be used as the value of the pageToken
5515 // parameter to retrieve the previous page in the result set.
5516 PrevPageToken string `json:"prevPageToken,omitempty"`
5517 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
5518 // VisitorId: The visitorId identifies the visitor.
5519 VisitorId string `json:"visitorId,omitempty"`
5520
5521 // ServerResponse contains the HTTP response code and headers from the server.
5522 googleapi.ServerResponse `json:"-"`
5523 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5524 // include in API requests. By default, fields with empty or default values are
5525 // omitted from API requests. See
5526 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5527 // details.
5528 ForceSendFields []string `json:"-"`
5529 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5530 // with the JSON null value. By default, fields with empty values are omitted
5531 // from API requests. See
5532 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5533 NullFields []string `json:"-"`
5534 }
5535
5536 func (s LiveStreamListResponse) MarshalJSON() ([]byte, error) {
5537 type NoMethod LiveStreamListResponse
5538 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5539 }
5540
5541 type LiveStreamSnippet struct {
5542 // ChannelId: The ID that YouTube uses to uniquely identify the channel that is
5543 // transmitting the stream.
5544 ChannelId string `json:"channelId,omitempty"`
5545 // Description: The stream's description. The value cannot be longer than 10000
5546 // characters.
5547 Description string `json:"description,omitempty"`
5548 IsDefaultStream bool `json:"isDefaultStream,omitempty"`
5549 // PublishedAt: The date and time that the stream was created.
5550 PublishedAt string `json:"publishedAt,omitempty"`
5551 // Title: The stream's title. The value must be between 1 and 128 characters
5552 // long.
5553 Title string `json:"title,omitempty"`
5554 // ForceSendFields is a list of field names (e.g. "ChannelId") to
5555 // unconditionally include in API requests. By default, fields with empty or
5556 // default values are omitted from API requests. See
5557 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5558 // details.
5559 ForceSendFields []string `json:"-"`
5560 // NullFields is a list of field names (e.g. "ChannelId") to include in API
5561 // requests with the JSON null value. By default, fields with empty values are
5562 // omitted from API requests. See
5563 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5564 NullFields []string `json:"-"`
5565 }
5566
5567 func (s LiveStreamSnippet) MarshalJSON() ([]byte, error) {
5568 type NoMethod LiveStreamSnippet
5569 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5570 }
5571
5572 // LiveStreamStatus: Brief description of the live stream status.
5573 type LiveStreamStatus struct {
5574 // HealthStatus: The health status of the stream.
5575 HealthStatus *LiveStreamHealthStatus `json:"healthStatus,omitempty"`
5576 // Possible values:
5577 // "created"
5578 // "ready"
5579 // "active"
5580 // "inactive"
5581 // "error"
5582 StreamStatus string `json:"streamStatus,omitempty"`
5583 // ForceSendFields is a list of field names (e.g. "HealthStatus") to
5584 // unconditionally include in API requests. By default, fields with empty or
5585 // default values are omitted from API requests. See
5586 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5587 // details.
5588 ForceSendFields []string `json:"-"`
5589 // NullFields is a list of field names (e.g. "HealthStatus") to include in API
5590 // requests with the JSON null value. By default, fields with empty values are
5591 // omitted from API requests. See
5592 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5593 NullFields []string `json:"-"`
5594 }
5595
5596 func (s LiveStreamStatus) MarshalJSON() ([]byte, error) {
5597 type NoMethod LiveStreamStatus
5598 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5599 }
5600
5601 type LocalizedProperty struct {
5602 Default string `json:"default,omitempty"`
5603 // DefaultLanguage: The language of the default property.
5604 DefaultLanguage *LanguageTag `json:"defaultLanguage,omitempty"`
5605 Localized []*LocalizedString `json:"localized,omitempty"`
5606 // ForceSendFields is a list of field names (e.g. "Default") to unconditionally
5607 // include in API requests. By default, fields with empty or default values are
5608 // omitted from API requests. See
5609 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5610 // details.
5611 ForceSendFields []string `json:"-"`
5612 // NullFields is a list of field names (e.g. "Default") to include in API
5613 // requests with the JSON null value. By default, fields with empty values are
5614 // omitted from API requests. See
5615 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5616 NullFields []string `json:"-"`
5617 }
5618
5619 func (s LocalizedProperty) MarshalJSON() ([]byte, error) {
5620 type NoMethod LocalizedProperty
5621 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5622 }
5623
5624 type LocalizedString struct {
5625 Language string `json:"language,omitempty"`
5626 Value string `json:"value,omitempty"`
5627 // ForceSendFields is a list of field names (e.g. "Language") to
5628 // unconditionally include in API requests. By default, fields with empty or
5629 // default values are omitted from API requests. See
5630 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5631 // details.
5632 ForceSendFields []string `json:"-"`
5633 // NullFields is a list of field names (e.g. "Language") to include in API
5634 // requests with the JSON null value. By default, fields with empty values are
5635 // omitted from API requests. See
5636 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5637 NullFields []string `json:"-"`
5638 }
5639
5640 func (s LocalizedString) MarshalJSON() ([]byte, error) {
5641 type NoMethod LocalizedString
5642 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5643 }
5644
5645 // Member: A *member* resource represents a member for a YouTube channel. A
5646 // member provides recurring monetary support to a creator and receives special
5647 // benefits.
5648 type Member struct {
5649 // Etag: Etag of this resource.
5650 Etag string `json:"etag,omitempty"`
5651 // Kind: Identifies what kind of resource this is. Value: the fixed string
5652 // "youtube#member".
5653 Kind string `json:"kind,omitempty"`
5654 // Snippet: The snippet object contains basic details about the member.
5655 Snippet *MemberSnippet `json:"snippet,omitempty"`
5656 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5657 // include in API requests. By default, fields with empty or default values are
5658 // omitted from API requests. See
5659 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5660 // details.
5661 ForceSendFields []string `json:"-"`
5662 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5663 // with the JSON null value. By default, fields with empty values are omitted
5664 // from API requests. See
5665 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5666 NullFields []string `json:"-"`
5667 }
5668
5669 func (s Member) MarshalJSON() ([]byte, error) {
5670 type NoMethod Member
5671 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5672 }
5673
5674 type MemberListResponse struct {
5675 // Etag: Etag of this resource.
5676 Etag string `json:"etag,omitempty"`
5677 // EventId: Serialized EventId of the request which produced this response.
5678 EventId string `json:"eventId,omitempty"`
5679 // Items: A list of members that match the request criteria.
5680 Items []*Member `json:"items,omitempty"`
5681 // Kind: Identifies what kind of resource this is. Value: the fixed string
5682 // "youtube#memberListResponse".
5683 Kind string `json:"kind,omitempty"`
5684 // NextPageToken: The token that can be used as the value of the pageToken
5685 // parameter to retrieve the next page in the result set.
5686 NextPageToken string `json:"nextPageToken,omitempty"`
5687 PageInfo *PageInfo `json:"pageInfo,omitempty"`
5688 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
5689 // VisitorId: The visitorId identifies the visitor.
5690 VisitorId string `json:"visitorId,omitempty"`
5691
5692 // ServerResponse contains the HTTP response code and headers from the server.
5693 googleapi.ServerResponse `json:"-"`
5694 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5695 // include in API requests. By default, fields with empty or default values are
5696 // omitted from API requests. See
5697 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5698 // details.
5699 ForceSendFields []string `json:"-"`
5700 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5701 // with the JSON null value. By default, fields with empty values are omitted
5702 // from API requests. See
5703 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5704 NullFields []string `json:"-"`
5705 }
5706
5707 func (s MemberListResponse) MarshalJSON() ([]byte, error) {
5708 type NoMethod MemberListResponse
5709 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5710 }
5711
5712 type MemberSnippet struct {
5713 // CreatorChannelId: The id of the channel that's offering memberships.
5714 CreatorChannelId string `json:"creatorChannelId,omitempty"`
5715 // MemberDetails: Details about the member.
5716 MemberDetails *ChannelProfileDetails `json:"memberDetails,omitempty"`
5717 // MembershipsDetails: Details about the user's membership.
5718 MembershipsDetails *MembershipsDetails `json:"membershipsDetails,omitempty"`
5719 // ForceSendFields is a list of field names (e.g. "CreatorChannelId") to
5720 // unconditionally include in API requests. By default, fields with empty or
5721 // default values are omitted from API requests. See
5722 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5723 // details.
5724 ForceSendFields []string `json:"-"`
5725 // NullFields is a list of field names (e.g. "CreatorChannelId") to include in
5726 // API requests with the JSON null value. By default, fields with empty values
5727 // are omitted from API requests. See
5728 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5729 NullFields []string `json:"-"`
5730 }
5731
5732 func (s MemberSnippet) MarshalJSON() ([]byte, error) {
5733 type NoMethod MemberSnippet
5734 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5735 }
5736
5737 type MembershipsDetails struct {
5738 // AccessibleLevels: Ids of all levels that the user has access to. This
5739 // includes the currently active level and all other levels that are included
5740 // because of a higher purchase.
5741 AccessibleLevels []string `json:"accessibleLevels,omitempty"`
5742 // HighestAccessibleLevel: Id of the highest level that the user has access to
5743 // at the moment.
5744 HighestAccessibleLevel string `json:"highestAccessibleLevel,omitempty"`
5745 // HighestAccessibleLevelDisplayName: Display name for the highest level that
5746 // the user has access to at the moment.
5747 HighestAccessibleLevelDisplayName string `json:"highestAccessibleLevelDisplayName,omitempty"`
5748 // MembershipsDuration: Data about memberships duration without taking into
5749 // consideration pricing levels.
5750 MembershipsDuration *MembershipsDuration `json:"membershipsDuration,omitempty"`
5751 // MembershipsDurationAtLevels: Data about memberships duration on particular
5752 // pricing levels.
5753 MembershipsDurationAtLevels []*MembershipsDurationAtLevel `json:"membershipsDurationAtLevels,omitempty"`
5754 // ForceSendFields is a list of field names (e.g. "AccessibleLevels") to
5755 // unconditionally include in API requests. By default, fields with empty or
5756 // default values are omitted from API requests. See
5757 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5758 // details.
5759 ForceSendFields []string `json:"-"`
5760 // NullFields is a list of field names (e.g. "AccessibleLevels") to include in
5761 // API requests with the JSON null value. By default, fields with empty values
5762 // are omitted from API requests. See
5763 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5764 NullFields []string `json:"-"`
5765 }
5766
5767 func (s MembershipsDetails) MarshalJSON() ([]byte, error) {
5768 type NoMethod MembershipsDetails
5769 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5770 }
5771
5772 type MembershipsDuration struct {
5773 // MemberSince: The date and time when the user became a continuous member
5774 // across all levels.
5775 MemberSince string `json:"memberSince,omitempty"`
5776 // MemberTotalDurationMonths: The cumulative time the user has been a member
5777 // across all levels in complete months (the time is rounded down to the
5778 // nearest integer).
5779 MemberTotalDurationMonths int64 `json:"memberTotalDurationMonths,omitempty"`
5780 // ForceSendFields is a list of field names (e.g. "MemberSince") to
5781 // unconditionally include in API requests. By default, fields with empty or
5782 // default values are omitted from API requests. See
5783 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5784 // details.
5785 ForceSendFields []string `json:"-"`
5786 // NullFields is a list of field names (e.g. "MemberSince") to include in API
5787 // requests with the JSON null value. By default, fields with empty values are
5788 // omitted from API requests. See
5789 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5790 NullFields []string `json:"-"`
5791 }
5792
5793 func (s MembershipsDuration) MarshalJSON() ([]byte, error) {
5794 type NoMethod MembershipsDuration
5795 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5796 }
5797
5798 type MembershipsDurationAtLevel struct {
5799 // Level: Pricing level ID.
5800 Level string `json:"level,omitempty"`
5801 // MemberSince: The date and time when the user became a continuous member for
5802 // the given level.
5803 MemberSince string `json:"memberSince,omitempty"`
5804 // MemberTotalDurationMonths: The cumulative time the user has been a member
5805 // for the given level in complete months (the time is rounded down to the
5806 // nearest integer).
5807 MemberTotalDurationMonths int64 `json:"memberTotalDurationMonths,omitempty"`
5808 // ForceSendFields is a list of field names (e.g. "Level") to unconditionally
5809 // include in API requests. By default, fields with empty or default values are
5810 // omitted from API requests. See
5811 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5812 // details.
5813 ForceSendFields []string `json:"-"`
5814 // NullFields is a list of field names (e.g. "Level") to include in API
5815 // requests with the JSON null value. By default, fields with empty values are
5816 // omitted from API requests. See
5817 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5818 NullFields []string `json:"-"`
5819 }
5820
5821 func (s MembershipsDurationAtLevel) MarshalJSON() ([]byte, error) {
5822 type NoMethod MembershipsDurationAtLevel
5823 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5824 }
5825
5826 // MembershipsLevel: A *membershipsLevel* resource represents an offer made by
5827 // YouTube creators for their fans. Users can become members of the channel by
5828 // joining one of the available levels. They will provide recurring monetary
5829 // support and receives special benefits.
5830 type MembershipsLevel struct {
5831 // Etag: Etag of this resource.
5832 Etag string `json:"etag,omitempty"`
5833 // Id: The ID that YouTube assigns to uniquely identify the memberships level.
5834 Id string `json:"id,omitempty"`
5835 // Kind: Identifies what kind of resource this is. Value: the fixed string
5836 // "youtube#membershipsLevelListResponse".
5837 Kind string `json:"kind,omitempty"`
5838 // Snippet: The snippet object contains basic details about the level.
5839 Snippet *MembershipsLevelSnippet `json:"snippet,omitempty"`
5840 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5841 // include in API requests. By default, fields with empty or default values are
5842 // omitted from API requests. See
5843 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5844 // details.
5845 ForceSendFields []string `json:"-"`
5846 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5847 // with the JSON null value. By default, fields with empty values are omitted
5848 // from API requests. See
5849 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5850 NullFields []string `json:"-"`
5851 }
5852
5853 func (s MembershipsLevel) MarshalJSON() ([]byte, error) {
5854 type NoMethod MembershipsLevel
5855 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5856 }
5857
5858 type MembershipsLevelListResponse struct {
5859 // Etag: Etag of this resource.
5860 Etag string `json:"etag,omitempty"`
5861 // EventId: Serialized EventId of the request which produced this response.
5862 EventId string `json:"eventId,omitempty"`
5863 // Items: A list of pricing levels offered by a creator to the fans.
5864 Items []*MembershipsLevel `json:"items,omitempty"`
5865 // Kind: Identifies what kind of resource this is. Value: the fixed string
5866 // "youtube#membershipsLevelListResponse".
5867 Kind string `json:"kind,omitempty"`
5868 // VisitorId: The visitorId identifies the visitor.
5869 VisitorId string `json:"visitorId,omitempty"`
5870
5871 // ServerResponse contains the HTTP response code and headers from the server.
5872 googleapi.ServerResponse `json:"-"`
5873 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
5874 // include in API requests. By default, fields with empty or default values are
5875 // omitted from API requests. See
5876 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5877 // details.
5878 ForceSendFields []string `json:"-"`
5879 // NullFields is a list of field names (e.g. "Etag") to include in API requests
5880 // with the JSON null value. By default, fields with empty values are omitted
5881 // from API requests. See
5882 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5883 NullFields []string `json:"-"`
5884 }
5885
5886 func (s MembershipsLevelListResponse) MarshalJSON() ([]byte, error) {
5887 type NoMethod MembershipsLevelListResponse
5888 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5889 }
5890
5891 type MembershipsLevelSnippet struct {
5892 // CreatorChannelId: The id of the channel that's offering channel memberships.
5893 CreatorChannelId string `json:"creatorChannelId,omitempty"`
5894 // LevelDetails: Details about the pricing level.
5895 LevelDetails *LevelDetails `json:"levelDetails,omitempty"`
5896 // ForceSendFields is a list of field names (e.g. "CreatorChannelId") to
5897 // unconditionally include in API requests. By default, fields with empty or
5898 // default values are omitted from API requests. See
5899 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5900 // details.
5901 ForceSendFields []string `json:"-"`
5902 // NullFields is a list of field names (e.g. "CreatorChannelId") to include in
5903 // API requests with the JSON null value. By default, fields with empty values
5904 // are omitted from API requests. See
5905 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5906 NullFields []string `json:"-"`
5907 }
5908
5909 func (s MembershipsLevelSnippet) MarshalJSON() ([]byte, error) {
5910 type NoMethod MembershipsLevelSnippet
5911 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5912 }
5913
5914 // MonitorStreamInfo: Settings and Info of the monitor stream
5915 type MonitorStreamInfo struct {
5916 // BroadcastStreamDelayMs: If you have set the enableMonitorStream property to
5917 // true, then this property determines the length of the live broadcast delay.
5918 BroadcastStreamDelayMs int64 `json:"broadcastStreamDelayMs,omitempty"`
5919 // EmbedHtml: HTML code that embeds a player that plays the monitor stream.
5920 EmbedHtml string `json:"embedHtml,omitempty"`
5921 // EnableMonitorStream: This value determines whether the monitor stream is
5922 // enabled for the broadcast. If the monitor stream is enabled, then YouTube
5923 // will broadcast the event content on a special stream intended only for the
5924 // broadcaster's consumption. The broadcaster can use the stream to review the
5925 // event content and also to identify the optimal times to insert cuepoints.
5926 // You need to set this value to true if you intend to have a broadcast delay
5927 // for your event. *Note:* This property cannot be updated once the broadcast
5928 // is in the testing or live state.
5929 EnableMonitorStream *bool `json:"enableMonitorStream,omitempty"`
5930 // ForceSendFields is a list of field names (e.g. "BroadcastStreamDelayMs") to
5931 // unconditionally include in API requests. By default, fields with empty or
5932 // default values are omitted from API requests. See
5933 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5934 // details.
5935 ForceSendFields []string `json:"-"`
5936 // NullFields is a list of field names (e.g. "BroadcastStreamDelayMs") to
5937 // include in API requests with the JSON null value. By default, fields with
5938 // empty values are omitted from API requests. See
5939 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5940 NullFields []string `json:"-"`
5941 }
5942
5943 func (s MonitorStreamInfo) MarshalJSON() ([]byte, error) {
5944 type NoMethod MonitorStreamInfo
5945 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5946 }
5947
5948 // PageInfo: Paging details for lists of resources, including total number of
5949 // items available and number of resources returned in a single page.
5950 type PageInfo struct {
5951 // ResultsPerPage: The number of results included in the API response.
5952 ResultsPerPage int64 `json:"resultsPerPage,omitempty"`
5953 // TotalResults: The total number of results in the result set.
5954 TotalResults int64 `json:"totalResults,omitempty"`
5955 // ForceSendFields is a list of field names (e.g. "ResultsPerPage") to
5956 // unconditionally include in API requests. By default, fields with empty or
5957 // default values are omitted from API requests. See
5958 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
5959 // details.
5960 ForceSendFields []string `json:"-"`
5961 // NullFields is a list of field names (e.g. "ResultsPerPage") to include in
5962 // API requests with the JSON null value. By default, fields with empty values
5963 // are omitted from API requests. See
5964 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
5965 NullFields []string `json:"-"`
5966 }
5967
5968 func (s PageInfo) MarshalJSON() ([]byte, error) {
5969 type NoMethod PageInfo
5970 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
5971 }
5972
5973 // Playlist: A *playlist* resource represents a YouTube playlist. A playlist is
5974 // a collection of videos that can be viewed sequentially and shared with other
5975 // users. A playlist can contain up to 200 videos, and YouTube does not limit
5976 // the number of playlists that each user creates. By default, playlists are
5977 // publicly visible to other users, but playlists can be public or private.
5978 // YouTube also uses playlists to identify special collections of videos for a
5979 // channel, such as: - uploaded videos - favorite videos - positively rated
5980 // (liked) videos - watch history - watch later To be more specific, these
5981 // lists are associated with a channel, which is a collection of a person,
5982 // group, or company's videos, playlists, and other YouTube information. You
5983 // can retrieve the playlist IDs for each of these lists from the channel
5984 // resource for a given channel. You can then use the playlistItems.list method
5985 // to retrieve any of those lists. You can also add or remove items from those
5986 // lists by calling the playlistItems.insert and playlistItems.delete methods.
5987 type Playlist struct {
5988 // ContentDetails: The contentDetails object contains information like video
5989 // count.
5990 ContentDetails *PlaylistContentDetails `json:"contentDetails,omitempty"`
5991 // Etag: Etag of this resource.
5992 Etag string `json:"etag,omitempty"`
5993 // Id: The ID that YouTube uses to uniquely identify the playlist.
5994 Id string `json:"id,omitempty"`
5995 // Kind: Identifies what kind of resource this is. Value: the fixed string
5996 // "youtube#playlist".
5997 Kind string `json:"kind,omitempty"`
5998 // Localizations: Localizations for different languages
5999 Localizations map[string]PlaylistLocalization `json:"localizations,omitempty"`
6000 // Player: The player object contains information that you would use to play
6001 // the playlist in an embedded player.
6002 Player *PlaylistPlayer `json:"player,omitempty"`
6003 // Snippet: The snippet object contains basic details about the playlist, such
6004 // as its title and description.
6005 Snippet *PlaylistSnippet `json:"snippet,omitempty"`
6006 // Status: The status object contains status information for the playlist.
6007 Status *PlaylistStatus `json:"status,omitempty"`
6008
6009 // ServerResponse contains the HTTP response code and headers from the server.
6010 googleapi.ServerResponse `json:"-"`
6011 // ForceSendFields is a list of field names (e.g. "ContentDetails") to
6012 // unconditionally include in API requests. By default, fields with empty or
6013 // default values are omitted from API requests. See
6014 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6015 // details.
6016 ForceSendFields []string `json:"-"`
6017 // NullFields is a list of field names (e.g. "ContentDetails") to include in
6018 // API requests with the JSON null value. By default, fields with empty values
6019 // are omitted from API requests. See
6020 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6021 NullFields []string `json:"-"`
6022 }
6023
6024 func (s Playlist) MarshalJSON() ([]byte, error) {
6025 type NoMethod Playlist
6026 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6027 }
6028
6029 type PlaylistContentDetails struct {
6030 // ItemCount: The number of videos in the playlist.
6031 ItemCount int64 `json:"itemCount,omitempty"`
6032 // ForceSendFields is a list of field names (e.g. "ItemCount") to
6033 // unconditionally include in API requests. By default, fields with empty or
6034 // default values are omitted from API requests. See
6035 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6036 // details.
6037 ForceSendFields []string `json:"-"`
6038 // NullFields is a list of field names (e.g. "ItemCount") to include in API
6039 // requests with the JSON null value. By default, fields with empty values are
6040 // omitted from API requests. See
6041 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6042 NullFields []string `json:"-"`
6043 }
6044
6045 func (s PlaylistContentDetails) MarshalJSON() ([]byte, error) {
6046 type NoMethod PlaylistContentDetails
6047 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6048 }
6049
6050 type PlaylistImage struct {
6051 // Id: Identifies this resource (playlist id and image type).
6052 Id string `json:"id,omitempty"`
6053 // Kind: Identifies what kind of resource this is. Value: the fixed string
6054 // "youtube#playlistImages".
6055 Kind string `json:"kind,omitempty"`
6056 Snippet *PlaylistImageSnippet `json:"snippet,omitempty"`
6057
6058 // ServerResponse contains the HTTP response code and headers from the server.
6059 googleapi.ServerResponse `json:"-"`
6060 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
6061 // include in API requests. By default, fields with empty or default values are
6062 // omitted from API requests. See
6063 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6064 // details.
6065 ForceSendFields []string `json:"-"`
6066 // NullFields is a list of field names (e.g. "Id") to include in API requests
6067 // with the JSON null value. By default, fields with empty values are omitted
6068 // from API requests. See
6069 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6070 NullFields []string `json:"-"`
6071 }
6072
6073 func (s PlaylistImage) MarshalJSON() ([]byte, error) {
6074 type NoMethod PlaylistImage
6075 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6076 }
6077
6078 type PlaylistImageListResponse struct {
6079 Items []*PlaylistImage `json:"items,omitempty"`
6080 // Kind: Identifies what kind of resource this is. Value: the fixed string
6081 // "youtube#playlistImageListResponse".
6082 Kind string `json:"kind,omitempty"`
6083 // NextPageToken: The token that can be used as the value of the pageToken
6084 // parameter to retrieve the next page in the result set.
6085 NextPageToken string `json:"nextPageToken,omitempty"`
6086 // PageInfo: General pagination information.
6087 PageInfo *PageInfo `json:"pageInfo,omitempty"`
6088 // PrevPageToken: The token that can be used as the value of the pageToken
6089 // parameter to retrieve the previous page in the result set.
6090 PrevPageToken string `json:"prevPageToken,omitempty"`
6091
6092 // ServerResponse contains the HTTP response code and headers from the server.
6093 googleapi.ServerResponse `json:"-"`
6094 // ForceSendFields is a list of field names (e.g. "Items") to unconditionally
6095 // include in API requests. By default, fields with empty or default values are
6096 // omitted from API requests. See
6097 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6098 // details.
6099 ForceSendFields []string `json:"-"`
6100 // NullFields is a list of field names (e.g. "Items") to include in API
6101 // requests with the JSON null value. By default, fields with empty values are
6102 // omitted from API requests. See
6103 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6104 NullFields []string `json:"-"`
6105 }
6106
6107 func (s PlaylistImageListResponse) MarshalJSON() ([]byte, error) {
6108 type NoMethod PlaylistImageListResponse
6109 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6110 }
6111
6112 // PlaylistImageSnippet: A *playlistImage* resource identifies another
6113 // resource, such as a image, that is associated with a playlist. In addition,
6114 // the playlistImage resource contains details about the included resource that
6115 // pertain specifically to how that resource is used in that playlist. YouTube
6116 // uses playlists to identify special collections of videos for a channel, such
6117 // as: - uploaded videos - favorite videos - positively rated (liked) videos -
6118 // watch history To be more specific, these lists are associated with a
6119 // channel, which is a collection of a person, group, or company's videos,
6120 // playlists, and other YouTube information. You can retrieve the playlist IDs
6121 // for each of these lists from the channel resource for a given channel. You
6122 // can then use the playlistImages.list method to retrieve image data for any
6123 // of those playlists. You can also add or remove images from those lists by
6124 // calling the playlistImages.insert and playlistImages.delete methods.
6125 type PlaylistImageSnippet struct {
6126 // Height: The image height.
6127 Height int64 `json:"height,omitempty"`
6128 // PlaylistId: The Playlist ID of the playlist this image is associated with.
6129 PlaylistId string `json:"playlistId,omitempty"`
6130 // Type: The image type.
6131 //
6132 // Possible values:
6133 // "hero" - The main image that will be used for this playlist.
6134 Type string `json:"type,omitempty"`
6135 // Width: The image width.
6136 Width int64 `json:"width,omitempty"`
6137 // ForceSendFields is a list of field names (e.g. "Height") to unconditionally
6138 // include in API requests. By default, fields with empty or default values are
6139 // omitted from API requests. See
6140 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6141 // details.
6142 ForceSendFields []string `json:"-"`
6143 // NullFields is a list of field names (e.g. "Height") to include in API
6144 // requests with the JSON null value. By default, fields with empty values are
6145 // omitted from API requests. See
6146 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6147 NullFields []string `json:"-"`
6148 }
6149
6150 func (s PlaylistImageSnippet) MarshalJSON() ([]byte, error) {
6151 type NoMethod PlaylistImageSnippet
6152 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6153 }
6154
6155 // PlaylistItem: A *playlistItem* resource identifies another resource, such as
6156 // a video, that is included in a playlist. In addition, the playlistItem
6157 // resource contains details about the included resource that pertain
6158 // specifically to how that resource is used in that playlist. YouTube uses
6159 // playlists to identify special collections of videos for a channel, such as:
6160 // - uploaded videos - favorite videos - positively rated (liked) videos -
6161 // watch history - watch later To be more specific, these lists are associated
6162 // with a channel, which is a collection of a person, group, or company's
6163 // videos, playlists, and other YouTube information. You can retrieve the
6164 // playlist IDs for each of these lists from the channel resource for a given
6165 // channel. You can then use the playlistItems.list method to retrieve any of
6166 // those lists. You can also add or remove items from those lists by calling
6167 // the playlistItems.insert and playlistItems.delete methods. For example, if a
6168 // user gives a positive rating to a video, you would insert that video into
6169 // the liked videos playlist for that user's channel.
6170 type PlaylistItem struct {
6171 // ContentDetails: The contentDetails object is included in the resource if the
6172 // included item is a YouTube video. The object contains additional information
6173 // about the video.
6174 ContentDetails *PlaylistItemContentDetails `json:"contentDetails,omitempty"`
6175 // Etag: Etag of this resource.
6176 Etag string `json:"etag,omitempty"`
6177 // Id: The ID that YouTube uses to uniquely identify the playlist item.
6178 Id string `json:"id,omitempty"`
6179 // Kind: Identifies what kind of resource this is. Value: the fixed string
6180 // "youtube#playlistItem".
6181 Kind string `json:"kind,omitempty"`
6182 // Snippet: The snippet object contains basic details about the playlist item,
6183 // such as its title and position in the playlist.
6184 Snippet *PlaylistItemSnippet `json:"snippet,omitempty"`
6185 // Status: The status object contains information about the playlist item's
6186 // privacy status.
6187 Status *PlaylistItemStatus `json:"status,omitempty"`
6188
6189 // ServerResponse contains the HTTP response code and headers from the server.
6190 googleapi.ServerResponse `json:"-"`
6191 // ForceSendFields is a list of field names (e.g. "ContentDetails") to
6192 // unconditionally include in API requests. By default, fields with empty or
6193 // default values are omitted from API requests. See
6194 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6195 // details.
6196 ForceSendFields []string `json:"-"`
6197 // NullFields is a list of field names (e.g. "ContentDetails") to include in
6198 // API requests with the JSON null value. By default, fields with empty values
6199 // are omitted from API requests. See
6200 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6201 NullFields []string `json:"-"`
6202 }
6203
6204 func (s PlaylistItem) MarshalJSON() ([]byte, error) {
6205 type NoMethod PlaylistItem
6206 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6207 }
6208
6209 type PlaylistItemContentDetails struct {
6210 // EndAt: The time, measured in seconds from the start of the video, when the
6211 // video should stop playing. (The playlist owner can specify the times when
6212 // the video should start and stop playing when the video is played in the
6213 // context of the playlist.) By default, assume that the video.endTime is the
6214 // end of the video.
6215 EndAt string `json:"endAt,omitempty"`
6216 // Note: A user-generated note for this item.
6217 Note string `json:"note,omitempty"`
6218 // StartAt: The time, measured in seconds from the start of the video, when the
6219 // video should start playing. (The playlist owner can specify the times when
6220 // the video should start and stop playing when the video is played in the
6221 // context of the playlist.) The default value is 0.
6222 StartAt string `json:"startAt,omitempty"`
6223 // VideoId: The ID that YouTube uses to uniquely identify a video. To retrieve
6224 // the video resource, set the id query parameter to this value in your API
6225 // request.
6226 VideoId string `json:"videoId,omitempty"`
6227 // VideoPublishedAt: The date and time that the video was published to YouTube.
6228 VideoPublishedAt string `json:"videoPublishedAt,omitempty"`
6229 // ForceSendFields is a list of field names (e.g. "EndAt") to unconditionally
6230 // include in API requests. By default, fields with empty or default values are
6231 // omitted from API requests. See
6232 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6233 // details.
6234 ForceSendFields []string `json:"-"`
6235 // NullFields is a list of field names (e.g. "EndAt") to include in API
6236 // requests with the JSON null value. By default, fields with empty values are
6237 // omitted from API requests. See
6238 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6239 NullFields []string `json:"-"`
6240 }
6241
6242 func (s PlaylistItemContentDetails) MarshalJSON() ([]byte, error) {
6243 type NoMethod PlaylistItemContentDetails
6244 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6245 }
6246
6247 type PlaylistItemListResponse struct {
6248 Etag string `json:"etag,omitempty"`
6249 // EventId: Serialized EventId of the request which produced this response.
6250 EventId string `json:"eventId,omitempty"`
6251 // Items: A list of playlist items that match the request criteria.
6252 Items []*PlaylistItem `json:"items,omitempty"`
6253 // Kind: Identifies what kind of resource this is. Value: the fixed string
6254 // "youtube#playlistItemListResponse".
6255 Kind string `json:"kind,omitempty"`
6256 // NextPageToken: The token that can be used as the value of the pageToken
6257 // parameter to retrieve the next page in the result set.
6258 NextPageToken string `json:"nextPageToken,omitempty"`
6259 // PageInfo: General pagination information.
6260 PageInfo *PageInfo `json:"pageInfo,omitempty"`
6261 // PrevPageToken: The token that can be used as the value of the pageToken
6262 // parameter to retrieve the previous page in the result set.
6263 PrevPageToken string `json:"prevPageToken,omitempty"`
6264 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
6265 // VisitorId: The visitorId identifies the visitor.
6266 VisitorId string `json:"visitorId,omitempty"`
6267
6268 // ServerResponse contains the HTTP response code and headers from the server.
6269 googleapi.ServerResponse `json:"-"`
6270 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6271 // include in API requests. By default, fields with empty or default values are
6272 // omitted from API requests. See
6273 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6274 // details.
6275 ForceSendFields []string `json:"-"`
6276 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6277 // with the JSON null value. By default, fields with empty values are omitted
6278 // from API requests. See
6279 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6280 NullFields []string `json:"-"`
6281 }
6282
6283 func (s PlaylistItemListResponse) MarshalJSON() ([]byte, error) {
6284 type NoMethod PlaylistItemListResponse
6285 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6286 }
6287
6288 // PlaylistItemSnippet: Basic details about a playlist, including title,
6289 // description and thumbnails. Basic details of a YouTube Playlist item
6290 // provided by the author. Next ID: 15
6291 type PlaylistItemSnippet struct {
6292 // ChannelId: The ID that YouTube uses to uniquely identify the user that added
6293 // the item to the playlist.
6294 ChannelId string `json:"channelId,omitempty"`
6295 // ChannelTitle: Channel title for the channel that the playlist item belongs
6296 // to.
6297 ChannelTitle string `json:"channelTitle,omitempty"`
6298 // Description: The item's description.
6299 Description string `json:"description,omitempty"`
6300 // PlaylistId: The ID that YouTube uses to uniquely identify thGe playlist that
6301 // the playlist item is in.
6302 PlaylistId string `json:"playlistId,omitempty"`
6303 // Position: The order in which the item appears in the playlist. The value
6304 // uses a zero-based index, so the first item has a position of 0, the second
6305 // item has a position of 1, and so forth.
6306 Position int64 `json:"position,omitempty"`
6307 // PublishedAt: The date and time that the item was added to the playlist.
6308 PublishedAt string `json:"publishedAt,omitempty"`
6309 // ResourceId: The id object contains information that can be used to uniquely
6310 // identify the resource that is included in the playlist as the playlist item.
6311 ResourceId *ResourceId `json:"resourceId,omitempty"`
6312 // Thumbnails: A map of thumbnail images associated with the playlist item. For
6313 // each object in the map, the key is the name of the thumbnail image, and the
6314 // value is an object that contains other information about the thumbnail.
6315 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
6316 // Title: The item's title.
6317 Title string `json:"title,omitempty"`
6318 // VideoOwnerChannelId: Channel id for the channel this video belongs to.
6319 VideoOwnerChannelId string `json:"videoOwnerChannelId,omitempty"`
6320 // VideoOwnerChannelTitle: Channel title for the channel this video belongs to.
6321 VideoOwnerChannelTitle string `json:"videoOwnerChannelTitle,omitempty"`
6322 // ForceSendFields is a list of field names (e.g. "ChannelId") to
6323 // unconditionally include in API requests. By default, fields with empty or
6324 // default values are omitted from API requests. See
6325 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6326 // details.
6327 ForceSendFields []string `json:"-"`
6328 // NullFields is a list of field names (e.g. "ChannelId") to include in API
6329 // requests with the JSON null value. By default, fields with empty values are
6330 // omitted from API requests. See
6331 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6332 NullFields []string `json:"-"`
6333 }
6334
6335 func (s PlaylistItemSnippet) MarshalJSON() ([]byte, error) {
6336 type NoMethod PlaylistItemSnippet
6337 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6338 }
6339
6340 // PlaylistItemStatus: Information about the playlist item's privacy status.
6341 type PlaylistItemStatus struct {
6342 // PrivacyStatus: This resource's privacy status.
6343 //
6344 // Possible values:
6345 // "public"
6346 // "unlisted"
6347 // "private"
6348 PrivacyStatus string `json:"privacyStatus,omitempty"`
6349 // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
6350 // unconditionally include in API requests. By default, fields with empty or
6351 // default values are omitted from API requests. See
6352 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6353 // details.
6354 ForceSendFields []string `json:"-"`
6355 // NullFields is a list of field names (e.g. "PrivacyStatus") to include in API
6356 // requests with the JSON null value. By default, fields with empty values are
6357 // omitted from API requests. See
6358 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6359 NullFields []string `json:"-"`
6360 }
6361
6362 func (s PlaylistItemStatus) MarshalJSON() ([]byte, error) {
6363 type NoMethod PlaylistItemStatus
6364 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6365 }
6366
6367 type PlaylistListResponse struct {
6368 // Etag: Etag of this resource.
6369 Etag string `json:"etag,omitempty"`
6370 // EventId: Serialized EventId of the request which produced this response.
6371 EventId string `json:"eventId,omitempty"`
6372 // Items: A list of playlists that match the request criteria
6373 Items []*Playlist `json:"items,omitempty"`
6374 // Kind: Identifies what kind of resource this is. Value: the fixed string
6375 // "youtube#playlistListResponse".
6376 Kind string `json:"kind,omitempty"`
6377 // NextPageToken: The token that can be used as the value of the pageToken
6378 // parameter to retrieve the next page in the result set.
6379 NextPageToken string `json:"nextPageToken,omitempty"`
6380 // PageInfo: General pagination information.
6381 PageInfo *PageInfo `json:"pageInfo,omitempty"`
6382 // PrevPageToken: The token that can be used as the value of the pageToken
6383 // parameter to retrieve the previous page in the result set.
6384 PrevPageToken string `json:"prevPageToken,omitempty"`
6385 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
6386 // VisitorId: The visitorId identifies the visitor.
6387 VisitorId string `json:"visitorId,omitempty"`
6388
6389 // ServerResponse contains the HTTP response code and headers from the server.
6390 googleapi.ServerResponse `json:"-"`
6391 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6392 // include in API requests. By default, fields with empty or default values are
6393 // omitted from API requests. See
6394 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6395 // details.
6396 ForceSendFields []string `json:"-"`
6397 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6398 // with the JSON null value. By default, fields with empty values are omitted
6399 // from API requests. See
6400 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6401 NullFields []string `json:"-"`
6402 }
6403
6404 func (s PlaylistListResponse) MarshalJSON() ([]byte, error) {
6405 type NoMethod PlaylistListResponse
6406 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6407 }
6408
6409 // PlaylistLocalization: Playlist localization setting
6410 type PlaylistLocalization struct {
6411 // Description: The localized strings for playlist's description.
6412 Description string `json:"description,omitempty"`
6413 // Title: The localized strings for playlist's title.
6414 Title string `json:"title,omitempty"`
6415 // ForceSendFields is a list of field names (e.g. "Description") to
6416 // unconditionally include in API requests. By default, fields with empty or
6417 // default values are omitted from API requests. See
6418 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6419 // details.
6420 ForceSendFields []string `json:"-"`
6421 // NullFields is a list of field names (e.g. "Description") to include in API
6422 // requests with the JSON null value. By default, fields with empty values are
6423 // omitted from API requests. See
6424 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6425 NullFields []string `json:"-"`
6426 }
6427
6428 func (s PlaylistLocalization) MarshalJSON() ([]byte, error) {
6429 type NoMethod PlaylistLocalization
6430 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6431 }
6432
6433 type PlaylistPlayer struct {
6434 // EmbedHtml: An <iframe> tag that embeds a player that will play the playlist.
6435 EmbedHtml string `json:"embedHtml,omitempty"`
6436 // ForceSendFields is a list of field names (e.g. "EmbedHtml") to
6437 // unconditionally include in API requests. By default, fields with empty or
6438 // default values are omitted from API requests. See
6439 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6440 // details.
6441 ForceSendFields []string `json:"-"`
6442 // NullFields is a list of field names (e.g. "EmbedHtml") to include in API
6443 // requests with the JSON null value. By default, fields with empty values are
6444 // omitted from API requests. See
6445 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6446 NullFields []string `json:"-"`
6447 }
6448
6449 func (s PlaylistPlayer) MarshalJSON() ([]byte, error) {
6450 type NoMethod PlaylistPlayer
6451 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6452 }
6453
6454 // PlaylistSnippet: Basic details about a playlist, including title,
6455 // description and thumbnails.
6456 type PlaylistSnippet struct {
6457 // ChannelId: The ID that YouTube uses to uniquely identify the channel that
6458 // published the playlist.
6459 ChannelId string `json:"channelId,omitempty"`
6460 // ChannelTitle: The channel title of the channel that the video belongs to.
6461 ChannelTitle string `json:"channelTitle,omitempty"`
6462 // DefaultLanguage: The language of the playlist's default title and
6463 // description.
6464 DefaultLanguage string `json:"defaultLanguage,omitempty"`
6465 // Description: The playlist's description.
6466 Description string `json:"description,omitempty"`
6467 // Localized: Localized title and description, read-only.
6468 Localized *PlaylistLocalization `json:"localized,omitempty"`
6469 // PublishedAt: The date and time that the playlist was created.
6470 PublishedAt string `json:"publishedAt,omitempty"`
6471 // Tags: Keyword tags associated with the playlist.
6472 Tags []string `json:"tags,omitempty"`
6473 // ThumbnailVideoId: Note: if the playlist has a custom thumbnail, this field
6474 // will not be populated. The video id selected by the user that will be used
6475 // as the thumbnail of this playlist. This field defaults to the first publicly
6476 // viewable video in the playlist, if: 1. The user has never selected a video
6477 // to be the thumbnail of the playlist. 2. The user selects a video to be the
6478 // thumbnail, and then removes that video from the playlist. 3. The user
6479 // selects a non-owned video to be the thumbnail, but that video becomes
6480 // private, or gets deleted.
6481 ThumbnailVideoId string `json:"thumbnailVideoId,omitempty"`
6482 // Thumbnails: A map of thumbnail images associated with the playlist. For each
6483 // object in the map, the key is the name of the thumbnail image, and the value
6484 // is an object that contains other information about the thumbnail.
6485 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
6486 // Title: The playlist's title.
6487 Title string `json:"title,omitempty"`
6488 // ForceSendFields is a list of field names (e.g. "ChannelId") to
6489 // unconditionally include in API requests. By default, fields with empty or
6490 // default values are omitted from API requests. See
6491 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6492 // details.
6493 ForceSendFields []string `json:"-"`
6494 // NullFields is a list of field names (e.g. "ChannelId") to include in API
6495 // requests with the JSON null value. By default, fields with empty values are
6496 // omitted from API requests. See
6497 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6498 NullFields []string `json:"-"`
6499 }
6500
6501 func (s PlaylistSnippet) MarshalJSON() ([]byte, error) {
6502 type NoMethod PlaylistSnippet
6503 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6504 }
6505
6506 type PlaylistStatus struct {
6507 // PodcastStatus: The playlist's podcast status.
6508 //
6509 // Possible values:
6510 // "enabled"
6511 // "disabled"
6512 PodcastStatus string `json:"podcastStatus,omitempty"`
6513 // PrivacyStatus: The playlist's privacy status.
6514 //
6515 // Possible values:
6516 // "public"
6517 // "unlisted"
6518 // "private"
6519 PrivacyStatus string `json:"privacyStatus,omitempty"`
6520 // ForceSendFields is a list of field names (e.g. "PodcastStatus") to
6521 // unconditionally include in API requests. By default, fields with empty or
6522 // default values are omitted from API requests. See
6523 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6524 // details.
6525 ForceSendFields []string `json:"-"`
6526 // NullFields is a list of field names (e.g. "PodcastStatus") to include in API
6527 // requests with the JSON null value. By default, fields with empty values are
6528 // omitted from API requests. See
6529 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6530 NullFields []string `json:"-"`
6531 }
6532
6533 func (s PlaylistStatus) MarshalJSON() ([]byte, error) {
6534 type NoMethod PlaylistStatus
6535 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6536 }
6537
6538 // PropertyValue: A pair Property / Value.
6539 type PropertyValue struct {
6540 // Property: A property.
6541 Property string `json:"property,omitempty"`
6542 // Value: The property's value.
6543 Value string `json:"value,omitempty"`
6544 // ForceSendFields is a list of field names (e.g. "Property") to
6545 // unconditionally include in API requests. By default, fields with empty or
6546 // default values are omitted from API requests. See
6547 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6548 // details.
6549 ForceSendFields []string `json:"-"`
6550 // NullFields is a list of field names (e.g. "Property") to include in API
6551 // requests with the JSON null value. By default, fields with empty values are
6552 // omitted from API requests. See
6553 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6554 NullFields []string `json:"-"`
6555 }
6556
6557 func (s PropertyValue) MarshalJSON() ([]byte, error) {
6558 type NoMethod PropertyValue
6559 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6560 }
6561
6562 type RelatedEntity struct {
6563 Entity *Entity `json:"entity,omitempty"`
6564 // ForceSendFields is a list of field names (e.g. "Entity") to unconditionally
6565 // include in API requests. By default, fields with empty or default values are
6566 // omitted from API requests. See
6567 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6568 // details.
6569 ForceSendFields []string `json:"-"`
6570 // NullFields is a list of field names (e.g. "Entity") to include in API
6571 // requests with the JSON null value. By default, fields with empty values are
6572 // omitted from API requests. See
6573 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6574 NullFields []string `json:"-"`
6575 }
6576
6577 func (s RelatedEntity) MarshalJSON() ([]byte, error) {
6578 type NoMethod RelatedEntity
6579 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6580 }
6581
6582 // ResourceId: A resource id is a generic reference that points to another
6583 // YouTube resource.
6584 type ResourceId struct {
6585 // ChannelId: The ID that YouTube uses to uniquely identify the referred
6586 // resource, if that resource is a channel. This property is only present if
6587 // the resourceId.kind value is youtube#channel.
6588 ChannelId string `json:"channelId,omitempty"`
6589 // Kind: The type of the API resource.
6590 Kind string `json:"kind,omitempty"`
6591 // PlaylistId: The ID that YouTube uses to uniquely identify the referred
6592 // resource, if that resource is a playlist. This property is only present if
6593 // the resourceId.kind value is youtube#playlist.
6594 PlaylistId string `json:"playlistId,omitempty"`
6595 // VideoId: The ID that YouTube uses to uniquely identify the referred
6596 // resource, if that resource is a video. This property is only present if the
6597 // resourceId.kind value is youtube#video.
6598 VideoId string `json:"videoId,omitempty"`
6599 // ForceSendFields is a list of field names (e.g. "ChannelId") to
6600 // unconditionally include in API requests. By default, fields with empty or
6601 // default values are omitted from API requests. See
6602 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6603 // details.
6604 ForceSendFields []string `json:"-"`
6605 // NullFields is a list of field names (e.g. "ChannelId") to include in API
6606 // requests with the JSON null value. By default, fields with empty values are
6607 // omitted from API requests. See
6608 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6609 NullFields []string `json:"-"`
6610 }
6611
6612 func (s ResourceId) MarshalJSON() ([]byte, error) {
6613 type NoMethod ResourceId
6614 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6615 }
6616
6617 type SearchListResponse struct {
6618 // Etag: Etag of this resource.
6619 Etag string `json:"etag,omitempty"`
6620 // EventId: Serialized EventId of the request which produced this response.
6621 EventId string `json:"eventId,omitempty"`
6622 // Items: Pagination information for token pagination.
6623 Items []*SearchResult `json:"items,omitempty"`
6624 // Kind: Identifies what kind of resource this is. Value: the fixed string
6625 // "youtube#searchListResponse".
6626 Kind string `json:"kind,omitempty"`
6627 // NextPageToken: The token that can be used as the value of the pageToken
6628 // parameter to retrieve the next page in the result set.
6629 NextPageToken string `json:"nextPageToken,omitempty"`
6630 // PageInfo: General pagination information.
6631 PageInfo *PageInfo `json:"pageInfo,omitempty"`
6632 // PrevPageToken: The token that can be used as the value of the pageToken
6633 // parameter to retrieve the previous page in the result set.
6634 PrevPageToken string `json:"prevPageToken,omitempty"`
6635 RegionCode string `json:"regionCode,omitempty"`
6636 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
6637 // VisitorId: The visitorId identifies the visitor.
6638 VisitorId string `json:"visitorId,omitempty"`
6639
6640 // ServerResponse contains the HTTP response code and headers from the server.
6641 googleapi.ServerResponse `json:"-"`
6642 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6643 // include in API requests. By default, fields with empty or default values are
6644 // omitted from API requests. See
6645 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6646 // details.
6647 ForceSendFields []string `json:"-"`
6648 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6649 // with the JSON null value. By default, fields with empty values are omitted
6650 // from API requests. See
6651 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6652 NullFields []string `json:"-"`
6653 }
6654
6655 func (s SearchListResponse) MarshalJSON() ([]byte, error) {
6656 type NoMethod SearchListResponse
6657 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6658 }
6659
6660 // SearchResult: A search result contains information about a YouTube video,
6661 // channel, or playlist that matches the search parameters specified in an API
6662 // request. While a search result points to a uniquely identifiable resource,
6663 // like a video, it does not have its own persistent data.
6664 type SearchResult struct {
6665 // Etag: Etag of this resource.
6666 Etag string `json:"etag,omitempty"`
6667 // Id: The id object contains information that can be used to uniquely identify
6668 // the resource that matches the search request.
6669 Id *ResourceId `json:"id,omitempty"`
6670 // Kind: Identifies what kind of resource this is. Value: the fixed string
6671 // "youtube#searchResult".
6672 Kind string `json:"kind,omitempty"`
6673 // Snippet: The snippet object contains basic details about a search result,
6674 // such as its title or description. For example, if the search result is a
6675 // video, then the title will be the video's title and the description will be
6676 // the video's description.
6677 Snippet *SearchResultSnippet `json:"snippet,omitempty"`
6678 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6679 // include in API requests. By default, fields with empty or default values are
6680 // omitted from API requests. See
6681 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6682 // details.
6683 ForceSendFields []string `json:"-"`
6684 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6685 // with the JSON null value. By default, fields with empty values are omitted
6686 // from API requests. See
6687 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6688 NullFields []string `json:"-"`
6689 }
6690
6691 func (s SearchResult) MarshalJSON() ([]byte, error) {
6692 type NoMethod SearchResult
6693 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6694 }
6695
6696 // SearchResultSnippet: Basic details about a search result, including title,
6697 // description and thumbnails of the item referenced by the search result.
6698 type SearchResultSnippet struct {
6699 // ChannelId: The value that YouTube uses to uniquely identify the channel that
6700 // published the resource that the search result identifies.
6701 ChannelId string `json:"channelId,omitempty"`
6702 // ChannelTitle: The title of the channel that published the resource that the
6703 // search result identifies.
6704 ChannelTitle string `json:"channelTitle,omitempty"`
6705 // Description: A description of the search result.
6706 Description string `json:"description,omitempty"`
6707 // LiveBroadcastContent: It indicates if the resource (video or channel) has
6708 // upcoming/active live broadcast content. Or it's "none" if there is not any
6709 // upcoming/active live broadcasts.
6710 //
6711 // Possible values:
6712 // "none"
6713 // "upcoming" - The live broadcast is upcoming.
6714 // "live" - The live broadcast is active.
6715 // "completed" - The live broadcast has been completed.
6716 LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
6717 // PublishedAt: The creation date and time of the resource that the search
6718 // result identifies.
6719 PublishedAt string `json:"publishedAt,omitempty"`
6720 // Thumbnails: A map of thumbnail images associated with the search result. For
6721 // each object in the map, the key is the name of the thumbnail image, and the
6722 // value is an object that contains other information about the thumbnail.
6723 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
6724 // Title: The title of the search result.
6725 Title string `json:"title,omitempty"`
6726 // ForceSendFields is a list of field names (e.g. "ChannelId") to
6727 // unconditionally include in API requests. By default, fields with empty or
6728 // default values are omitted from API requests. See
6729 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6730 // details.
6731 ForceSendFields []string `json:"-"`
6732 // NullFields is a list of field names (e.g. "ChannelId") to include in API
6733 // requests with the JSON null value. By default, fields with empty values are
6734 // omitted from API requests. See
6735 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6736 NullFields []string `json:"-"`
6737 }
6738
6739 func (s SearchResultSnippet) MarshalJSON() ([]byte, error) {
6740 type NoMethod SearchResultSnippet
6741 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6742 }
6743
6744 // Subscription: A *subscription* resource contains information about a YouTube
6745 // user subscription. A subscription notifies a user when new videos are added
6746 // to a channel or when another user takes one of several actions on YouTube,
6747 // such as uploading a video, rating a video, or commenting on a video.
6748 type Subscription struct {
6749 // ContentDetails: The contentDetails object contains basic statistics about
6750 // the subscription.
6751 ContentDetails *SubscriptionContentDetails `json:"contentDetails,omitempty"`
6752 // Etag: Etag of this resource.
6753 Etag string `json:"etag,omitempty"`
6754 // Id: The ID that YouTube uses to uniquely identify the subscription.
6755 Id string `json:"id,omitempty"`
6756 // Kind: Identifies what kind of resource this is. Value: the fixed string
6757 // "youtube#subscription".
6758 Kind string `json:"kind,omitempty"`
6759 // Snippet: The snippet object contains basic details about the subscription,
6760 // including its title and the channel that the user subscribed to.
6761 Snippet *SubscriptionSnippet `json:"snippet,omitempty"`
6762 // SubscriberSnippet: The subscriberSnippet object contains basic details about
6763 // the subscriber.
6764 SubscriberSnippet *SubscriptionSubscriberSnippet `json:"subscriberSnippet,omitempty"`
6765
6766 // ServerResponse contains the HTTP response code and headers from the server.
6767 googleapi.ServerResponse `json:"-"`
6768 // ForceSendFields is a list of field names (e.g. "ContentDetails") to
6769 // unconditionally include in API requests. By default, fields with empty or
6770 // default values are omitted from API requests. See
6771 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6772 // details.
6773 ForceSendFields []string `json:"-"`
6774 // NullFields is a list of field names (e.g. "ContentDetails") to include in
6775 // API requests with the JSON null value. By default, fields with empty values
6776 // are omitted from API requests. See
6777 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6778 NullFields []string `json:"-"`
6779 }
6780
6781 func (s Subscription) MarshalJSON() ([]byte, error) {
6782 type NoMethod Subscription
6783 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6784 }
6785
6786 // SubscriptionContentDetails: Details about the content to witch a
6787 // subscription refers.
6788 type SubscriptionContentDetails struct {
6789 // ActivityType: The type of activity this subscription is for (only uploads,
6790 // everything).
6791 //
6792 // Possible values:
6793 // "subscriptionActivityTypeUnspecified"
6794 // "all"
6795 // "uploads"
6796 ActivityType string `json:"activityType,omitempty"`
6797 // NewItemCount: The number of new items in the subscription since its content
6798 // was last read.
6799 NewItemCount int64 `json:"newItemCount,omitempty"`
6800 // TotalItemCount: The approximate number of items that the subscription points
6801 // to.
6802 TotalItemCount int64 `json:"totalItemCount,omitempty"`
6803 // ForceSendFields is a list of field names (e.g. "ActivityType") to
6804 // unconditionally include in API requests. By default, fields with empty or
6805 // default values are omitted from API requests. See
6806 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6807 // details.
6808 ForceSendFields []string `json:"-"`
6809 // NullFields is a list of field names (e.g. "ActivityType") to include in API
6810 // requests with the JSON null value. By default, fields with empty values are
6811 // omitted from API requests. See
6812 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6813 NullFields []string `json:"-"`
6814 }
6815
6816 func (s SubscriptionContentDetails) MarshalJSON() ([]byte, error) {
6817 type NoMethod SubscriptionContentDetails
6818 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6819 }
6820
6821 type SubscriptionListResponse struct {
6822 // Etag: Etag of this resource.
6823 Etag string `json:"etag,omitempty"`
6824 // EventId: Serialized EventId of the request which produced this response.
6825 EventId string `json:"eventId,omitempty"`
6826 // Items: A list of subscriptions that match the request criteria.
6827 Items []*Subscription `json:"items,omitempty"`
6828 // Kind: Identifies what kind of resource this is. Value: the fixed string
6829 // "youtube#subscriptionListResponse".
6830 Kind string `json:"kind,omitempty"`
6831 // NextPageToken: The token that can be used as the value of the pageToken
6832 // parameter to retrieve the next page in the result set.
6833 NextPageToken string `json:"nextPageToken,omitempty"`
6834 PageInfo *PageInfo `json:"pageInfo,omitempty"`
6835 // PrevPageToken: The token that can be used as the value of the pageToken
6836 // parameter to retrieve the previous page in the result set.
6837 PrevPageToken string `json:"prevPageToken,omitempty"`
6838 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
6839 // VisitorId: The visitorId identifies the visitor.
6840 VisitorId string `json:"visitorId,omitempty"`
6841
6842 // ServerResponse contains the HTTP response code and headers from the server.
6843 googleapi.ServerResponse `json:"-"`
6844 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6845 // include in API requests. By default, fields with empty or default values are
6846 // omitted from API requests. See
6847 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6848 // details.
6849 ForceSendFields []string `json:"-"`
6850 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6851 // with the JSON null value. By default, fields with empty values are omitted
6852 // from API requests. See
6853 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6854 NullFields []string `json:"-"`
6855 }
6856
6857 func (s SubscriptionListResponse) MarshalJSON() ([]byte, error) {
6858 type NoMethod SubscriptionListResponse
6859 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6860 }
6861
6862 // SubscriptionSnippet: Basic details about a subscription, including title,
6863 // description and thumbnails of the subscribed item.
6864 type SubscriptionSnippet struct {
6865 // ChannelId: The ID that YouTube uses to uniquely identify the subscriber's
6866 // channel.
6867 ChannelId string `json:"channelId,omitempty"`
6868 // Description: The subscription's details.
6869 Description string `json:"description,omitempty"`
6870 // PublishedAt: The date and time that the subscription was created.
6871 PublishedAt string `json:"publishedAt,omitempty"`
6872 // ResourceId: The id object contains information about the channel that the
6873 // user subscribed to.
6874 ResourceId *ResourceId `json:"resourceId,omitempty"`
6875 // Thumbnails: A map of thumbnail images associated with the video. For each
6876 // object in the map, the key is the name of the thumbnail image, and the value
6877 // is an object that contains other information about the thumbnail.
6878 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
6879 // Title: The subscription's title.
6880 Title string `json:"title,omitempty"`
6881 // ForceSendFields is a list of field names (e.g. "ChannelId") to
6882 // unconditionally include in API requests. By default, fields with empty or
6883 // default values are omitted from API requests. See
6884 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6885 // details.
6886 ForceSendFields []string `json:"-"`
6887 // NullFields is a list of field names (e.g. "ChannelId") to include in API
6888 // requests with the JSON null value. By default, fields with empty values are
6889 // omitted from API requests. See
6890 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6891 NullFields []string `json:"-"`
6892 }
6893
6894 func (s SubscriptionSnippet) MarshalJSON() ([]byte, error) {
6895 type NoMethod SubscriptionSnippet
6896 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6897 }
6898
6899 // SubscriptionSubscriberSnippet: Basic details about a subscription's
6900 // subscriber including title, description, channel ID and thumbnails.
6901 type SubscriptionSubscriberSnippet struct {
6902 // ChannelId: The channel ID of the subscriber.
6903 ChannelId string `json:"channelId,omitempty"`
6904 // Description: The description of the subscriber.
6905 Description string `json:"description,omitempty"`
6906 // Thumbnails: Thumbnails for this subscriber.
6907 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
6908 // Title: The title of the subscriber.
6909 Title string `json:"title,omitempty"`
6910 // ForceSendFields is a list of field names (e.g. "ChannelId") to
6911 // unconditionally include in API requests. By default, fields with empty or
6912 // default values are omitted from API requests. See
6913 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6914 // details.
6915 ForceSendFields []string `json:"-"`
6916 // NullFields is a list of field names (e.g. "ChannelId") to include in API
6917 // requests with the JSON null value. By default, fields with empty values are
6918 // omitted from API requests. See
6919 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6920 NullFields []string `json:"-"`
6921 }
6922
6923 func (s SubscriptionSubscriberSnippet) MarshalJSON() ([]byte, error) {
6924 type NoMethod SubscriptionSubscriberSnippet
6925 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6926 }
6927
6928 // SuperChatEvent: A `__superChatEvent__` resource represents a Super Chat
6929 // purchase on a YouTube channel.
6930 type SuperChatEvent struct {
6931 // Etag: Etag of this resource.
6932 Etag string `json:"etag,omitempty"`
6933 // Id: The ID that YouTube assigns to uniquely identify the Super Chat event.
6934 Id string `json:"id,omitempty"`
6935 // Kind: Identifies what kind of resource this is. Value: the fixed string
6936 // "youtube#superChatEvent".
6937 Kind string `json:"kind,omitempty"`
6938 // Snippet: The `snippet` object contains basic details about the Super Chat
6939 // event.
6940 Snippet *SuperChatEventSnippet `json:"snippet,omitempty"`
6941 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6942 // include in API requests. By default, fields with empty or default values are
6943 // omitted from API requests. See
6944 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6945 // details.
6946 ForceSendFields []string `json:"-"`
6947 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6948 // with the JSON null value. By default, fields with empty values are omitted
6949 // from API requests. See
6950 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6951 NullFields []string `json:"-"`
6952 }
6953
6954 func (s SuperChatEvent) MarshalJSON() ([]byte, error) {
6955 type NoMethod SuperChatEvent
6956 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6957 }
6958
6959 type SuperChatEventListResponse struct {
6960 // Etag: Etag of this resource.
6961 Etag string `json:"etag,omitempty"`
6962 // EventId: Serialized EventId of the request which produced this response.
6963 EventId string `json:"eventId,omitempty"`
6964 // Items: A list of Super Chat purchases that match the request criteria.
6965 Items []*SuperChatEvent `json:"items,omitempty"`
6966 // Kind: Identifies what kind of resource this is. Value: the fixed string
6967 // "youtube#superChatEventListResponse".
6968 Kind string `json:"kind,omitempty"`
6969 // NextPageToken: The token that can be used as the value of the pageToken
6970 // parameter to retrieve the next page in the result set.
6971 NextPageToken string `json:"nextPageToken,omitempty"`
6972 PageInfo *PageInfo `json:"pageInfo,omitempty"`
6973 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
6974 // VisitorId: The visitorId identifies the visitor.
6975 VisitorId string `json:"visitorId,omitempty"`
6976
6977 // ServerResponse contains the HTTP response code and headers from the server.
6978 googleapi.ServerResponse `json:"-"`
6979 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
6980 // include in API requests. By default, fields with empty or default values are
6981 // omitted from API requests. See
6982 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
6983 // details.
6984 ForceSendFields []string `json:"-"`
6985 // NullFields is a list of field names (e.g. "Etag") to include in API requests
6986 // with the JSON null value. By default, fields with empty values are omitted
6987 // from API requests. See
6988 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
6989 NullFields []string `json:"-"`
6990 }
6991
6992 func (s SuperChatEventListResponse) MarshalJSON() ([]byte, error) {
6993 type NoMethod SuperChatEventListResponse
6994 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
6995 }
6996
6997 type SuperChatEventSnippet struct {
6998 // AmountMicros: The purchase amount, in micros of the purchase currency. e.g.,
6999 // 1 is represented as 1000000.
7000 AmountMicros uint64 `json:"amountMicros,omitempty,string"`
7001 // ChannelId: Channel id where the event occurred.
7002 ChannelId string `json:"channelId,omitempty"`
7003 // CommentText: The text contents of the comment left by the user.
7004 CommentText string `json:"commentText,omitempty"`
7005 // CreatedAt: The date and time when the event occurred.
7006 CreatedAt string `json:"createdAt,omitempty"`
7007 // Currency: The currency in which the purchase was made. ISO 4217.
7008 Currency string `json:"currency,omitempty"`
7009 // DisplayString: A rendered string that displays the purchase amount and
7010 // currency (e.g., "$1.00"). The string is rendered for the given language.
7011 DisplayString string `json:"displayString,omitempty"`
7012 // IsSuperStickerEvent: True if this event is a Super Sticker event.
7013 IsSuperStickerEvent bool `json:"isSuperStickerEvent,omitempty"`
7014 // MessageType: The tier for the paid message, which is based on the amount of
7015 // money spent to purchase the message.
7016 MessageType int64 `json:"messageType,omitempty"`
7017 // SuperStickerMetadata: If this event is a Super Sticker event, this field
7018 // will contain metadata about the Super Sticker.
7019 SuperStickerMetadata *SuperStickerMetadata `json:"superStickerMetadata,omitempty"`
7020 // SupporterDetails: Details about the supporter.
7021 SupporterDetails *ChannelProfileDetails `json:"supporterDetails,omitempty"`
7022 // ForceSendFields is a list of field names (e.g. "AmountMicros") to
7023 // unconditionally include in API requests. By default, fields with empty or
7024 // default values are omitted from API requests. See
7025 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7026 // details.
7027 ForceSendFields []string `json:"-"`
7028 // NullFields is a list of field names (e.g. "AmountMicros") to include in API
7029 // requests with the JSON null value. By default, fields with empty values are
7030 // omitted from API requests. See
7031 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7032 NullFields []string `json:"-"`
7033 }
7034
7035 func (s SuperChatEventSnippet) MarshalJSON() ([]byte, error) {
7036 type NoMethod SuperChatEventSnippet
7037 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7038 }
7039
7040 type SuperStickerMetadata struct {
7041 // AltText: Internationalized alt text that describes the sticker image and any
7042 // animation associated with it.
7043 AltText string `json:"altText,omitempty"`
7044 // AltTextLanguage: Specifies the localization language in which the alt text
7045 // is returned.
7046 AltTextLanguage string `json:"altTextLanguage,omitempty"`
7047 // StickerId: Unique identifier of the Super Sticker. This is a shorter form of
7048 // the alt_text that includes pack name and a recognizable characteristic of
7049 // the sticker.
7050 StickerId string `json:"stickerId,omitempty"`
7051 // ForceSendFields is a list of field names (e.g. "AltText") to unconditionally
7052 // include in API requests. By default, fields with empty or default values are
7053 // omitted from API requests. See
7054 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7055 // details.
7056 ForceSendFields []string `json:"-"`
7057 // NullFields is a list of field names (e.g. "AltText") to include in API
7058 // requests with the JSON null value. By default, fields with empty values are
7059 // omitted from API requests. See
7060 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7061 NullFields []string `json:"-"`
7062 }
7063
7064 func (s SuperStickerMetadata) MarshalJSON() ([]byte, error) {
7065 type NoMethod SuperStickerMetadata
7066 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7067 }
7068
7069 type TestItem struct {
7070 // Etag: Etag for the resource. See https://en.wikipedia.org/wiki/HTTP_ETag.
7071 Etag string `json:"etag,omitempty"`
7072 FeaturedPart bool `json:"featuredPart,omitempty"`
7073 Gaia int64 `json:"gaia,omitempty,string"`
7074 Id string `json:"id,omitempty"`
7075 Snippet *TestItemTestItemSnippet `json:"snippet,omitempty"`
7076
7077 // ServerResponse contains the HTTP response code and headers from the server.
7078 googleapi.ServerResponse `json:"-"`
7079 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7080 // include in API requests. By default, fields with empty or default values are
7081 // omitted from API requests. See
7082 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7083 // details.
7084 ForceSendFields []string `json:"-"`
7085 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7086 // with the JSON null value. By default, fields with empty values are omitted
7087 // from API requests. See
7088 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7089 NullFields []string `json:"-"`
7090 }
7091
7092 func (s TestItem) MarshalJSON() ([]byte, error) {
7093 type NoMethod TestItem
7094 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7095 }
7096
7097 type TestItemTestItemSnippet struct {
7098 }
7099
7100 // ThirdPartyLink: A *third party account link* resource represents a link
7101 // between a YouTube account or a channel and an account on a third-party
7102 // service.
7103 type ThirdPartyLink struct {
7104 // Etag: Etag of this resource
7105 Etag string `json:"etag,omitempty"`
7106 // Kind: Identifies what kind of resource this is. Value: the fixed string
7107 // "youtube#thirdPartyLink".
7108 Kind string `json:"kind,omitempty"`
7109 // LinkingToken: The linking_token identifies a YouTube account and channel
7110 // with which the third party account is linked.
7111 LinkingToken string `json:"linkingToken,omitempty"`
7112 // Snippet: The snippet object contains basic details about the third- party
7113 // account link.
7114 Snippet *ThirdPartyLinkSnippet `json:"snippet,omitempty"`
7115 // Status: The status object contains information about the status of the link.
7116 Status *ThirdPartyLinkStatus `json:"status,omitempty"`
7117
7118 // ServerResponse contains the HTTP response code and headers from the server.
7119 googleapi.ServerResponse `json:"-"`
7120 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7121 // include in API requests. By default, fields with empty or default values are
7122 // omitted from API requests. See
7123 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7124 // details.
7125 ForceSendFields []string `json:"-"`
7126 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7127 // with the JSON null value. By default, fields with empty values are omitted
7128 // from API requests. See
7129 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7130 NullFields []string `json:"-"`
7131 }
7132
7133 func (s ThirdPartyLink) MarshalJSON() ([]byte, error) {
7134 type NoMethod ThirdPartyLink
7135 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7136 }
7137
7138 type ThirdPartyLinkListResponse struct {
7139 // Etag: Etag of this resource.
7140 Etag string `json:"etag,omitempty"`
7141 Items []*ThirdPartyLink `json:"items,omitempty"`
7142 // Kind: Identifies what kind of resource this is. Value: the fixed string
7143 // "youtube#thirdPartyLinkListResponse".
7144 Kind string `json:"kind,omitempty"`
7145
7146 // ServerResponse contains the HTTP response code and headers from the server.
7147 googleapi.ServerResponse `json:"-"`
7148 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7149 // include in API requests. By default, fields with empty or default values are
7150 // omitted from API requests. See
7151 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7152 // details.
7153 ForceSendFields []string `json:"-"`
7154 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7155 // with the JSON null value. By default, fields with empty values are omitted
7156 // from API requests. See
7157 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7158 NullFields []string `json:"-"`
7159 }
7160
7161 func (s ThirdPartyLinkListResponse) MarshalJSON() ([]byte, error) {
7162 type NoMethod ThirdPartyLinkListResponse
7163 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7164 }
7165
7166 // ThirdPartyLinkSnippet: Basic information about a third party account link,
7167 // including its type and type-specific information.
7168 type ThirdPartyLinkSnippet struct {
7169 // ChannelToStoreLink: Information specific to a link between a channel and a
7170 // store on a merchandising platform.
7171 ChannelToStoreLink *ChannelToStoreLinkDetails `json:"channelToStoreLink,omitempty"`
7172 // Type: Type of the link named after the entities that are being linked.
7173 //
7174 // Possible values:
7175 // "linkUnspecified"
7176 // "channelToStoreLink" - A link that is connecting (or about to connect) a
7177 // channel with a store on a merchandising platform in order to enable retail
7178 // commerce capabilities for that channel on YouTube.
7179 Type string `json:"type,omitempty"`
7180 // ForceSendFields is a list of field names (e.g. "ChannelToStoreLink") to
7181 // unconditionally include in API requests. By default, fields with empty or
7182 // default values are omitted from API requests. See
7183 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7184 // details.
7185 ForceSendFields []string `json:"-"`
7186 // NullFields is a list of field names (e.g. "ChannelToStoreLink") to include
7187 // in API requests with the JSON null value. By default, fields with empty
7188 // values are omitted from API requests. See
7189 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7190 NullFields []string `json:"-"`
7191 }
7192
7193 func (s ThirdPartyLinkSnippet) MarshalJSON() ([]byte, error) {
7194 type NoMethod ThirdPartyLinkSnippet
7195 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7196 }
7197
7198 // ThirdPartyLinkStatus: The third-party link status object contains
7199 // information about the status of the link.
7200 type ThirdPartyLinkStatus struct {
7201 // Possible values:
7202 // "unknown"
7203 // "failed"
7204 // "pending"
7205 // "linked"
7206 LinkStatus string `json:"linkStatus,omitempty"`
7207 // ForceSendFields is a list of field names (e.g. "LinkStatus") to
7208 // unconditionally include in API requests. By default, fields with empty or
7209 // default values are omitted from API requests. See
7210 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7211 // details.
7212 ForceSendFields []string `json:"-"`
7213 // NullFields is a list of field names (e.g. "LinkStatus") to include in API
7214 // requests with the JSON null value. By default, fields with empty values are
7215 // omitted from API requests. See
7216 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7217 NullFields []string `json:"-"`
7218 }
7219
7220 func (s ThirdPartyLinkStatus) MarshalJSON() ([]byte, error) {
7221 type NoMethod ThirdPartyLinkStatus
7222 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7223 }
7224
7225 // Thumbnail: A thumbnail is an image representing a YouTube resource.
7226 type Thumbnail struct {
7227 // Height: (Optional) Height of the thumbnail image.
7228 Height int64 `json:"height,omitempty"`
7229 // Url: The thumbnail image's URL.
7230 Url string `json:"url,omitempty"`
7231 // Width: (Optional) Width of the thumbnail image.
7232 Width int64 `json:"width,omitempty"`
7233 // ForceSendFields is a list of field names (e.g. "Height") to unconditionally
7234 // include in API requests. By default, fields with empty or default values are
7235 // omitted from API requests. See
7236 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7237 // details.
7238 ForceSendFields []string `json:"-"`
7239 // NullFields is a list of field names (e.g. "Height") to include in API
7240 // requests with the JSON null value. By default, fields with empty values are
7241 // omitted from API requests. See
7242 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7243 NullFields []string `json:"-"`
7244 }
7245
7246 func (s Thumbnail) MarshalJSON() ([]byte, error) {
7247 type NoMethod Thumbnail
7248 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7249 }
7250
7251 // ThumbnailDetails: Internal representation of thumbnails for a YouTube
7252 // resource.
7253 type ThumbnailDetails struct {
7254 // Default: The default image for this resource.
7255 Default *Thumbnail `json:"default,omitempty"`
7256 // High: The high quality image for this resource.
7257 High *Thumbnail `json:"high,omitempty"`
7258 // Maxres: The maximum resolution quality image for this resource.
7259 Maxres *Thumbnail `json:"maxres,omitempty"`
7260 // Medium: The medium quality image for this resource.
7261 Medium *Thumbnail `json:"medium,omitempty"`
7262 // Standard: The standard quality image for this resource.
7263 Standard *Thumbnail `json:"standard,omitempty"`
7264 // ForceSendFields is a list of field names (e.g. "Default") to unconditionally
7265 // include in API requests. By default, fields with empty or default values are
7266 // omitted from API requests. See
7267 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7268 // details.
7269 ForceSendFields []string `json:"-"`
7270 // NullFields is a list of field names (e.g. "Default") to include in API
7271 // requests with the JSON null value. By default, fields with empty values are
7272 // omitted from API requests. See
7273 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7274 NullFields []string `json:"-"`
7275 }
7276
7277 func (s ThumbnailDetails) MarshalJSON() ([]byte, error) {
7278 type NoMethod ThumbnailDetails
7279 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7280 }
7281
7282 type ThumbnailSetResponse struct {
7283 // Etag: Etag of this resource.
7284 Etag string `json:"etag,omitempty"`
7285 // EventId: Serialized EventId of the request which produced this response.
7286 EventId string `json:"eventId,omitempty"`
7287 // Items: A list of thumbnails.
7288 Items []*ThumbnailDetails `json:"items,omitempty"`
7289 // Kind: Identifies what kind of resource this is. Value: the fixed string
7290 // "youtube#thumbnailSetResponse".
7291 Kind string `json:"kind,omitempty"`
7292 // VisitorId: The visitorId identifies the visitor.
7293 VisitorId string `json:"visitorId,omitempty"`
7294
7295 // ServerResponse contains the HTTP response code and headers from the server.
7296 googleapi.ServerResponse `json:"-"`
7297 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7298 // include in API requests. By default, fields with empty or default values are
7299 // omitted from API requests. See
7300 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7301 // details.
7302 ForceSendFields []string `json:"-"`
7303 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7304 // with the JSON null value. By default, fields with empty values are omitted
7305 // from API requests. See
7306 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7307 NullFields []string `json:"-"`
7308 }
7309
7310 func (s ThumbnailSetResponse) MarshalJSON() ([]byte, error) {
7311 type NoMethod ThumbnailSetResponse
7312 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7313 }
7314
7315 // TokenPagination: Stub token pagination template to suppress results.
7316 type TokenPagination struct {
7317 }
7318
7319 // Video: A *video* resource represents a YouTube video.
7320 type Video struct {
7321 // AgeGating: Age restriction details related to a video. This data can only be
7322 // retrieved by the video owner.
7323 AgeGating *VideoAgeGating `json:"ageGating,omitempty"`
7324 // ContentDetails: The contentDetails object contains information about the
7325 // video content, including the length of the video and its aspect ratio.
7326 ContentDetails *VideoContentDetails `json:"contentDetails,omitempty"`
7327 // Etag: Etag of this resource.
7328 Etag string `json:"etag,omitempty"`
7329 // FileDetails: The fileDetails object encapsulates information about the video
7330 // file that was uploaded to YouTube, including the file's resolution,
7331 // duration, audio and video codecs, stream bitrates, and more. This data can
7332 // only be retrieved by the video owner.
7333 FileDetails *VideoFileDetails `json:"fileDetails,omitempty"`
7334 // Id: The ID that YouTube uses to uniquely identify the video.
7335 Id string `json:"id,omitempty"`
7336 // Kind: Identifies what kind of resource this is. Value: the fixed string
7337 // "youtube#video".
7338 Kind string `json:"kind,omitempty"`
7339 // LiveStreamingDetails: The liveStreamingDetails object contains metadata
7340 // about a live video broadcast. The object will only be present in a video
7341 // resource if the video is an upcoming, live, or completed live broadcast.
7342 LiveStreamingDetails *VideoLiveStreamingDetails `json:"liveStreamingDetails,omitempty"`
7343 // Localizations: The localizations object contains localized versions of the
7344 // basic details about the video, such as its title and description.
7345 Localizations map[string]VideoLocalization `json:"localizations,omitempty"`
7346 // MonetizationDetails: The monetizationDetails object encapsulates information
7347 // about the monetization status of the video.
7348 MonetizationDetails *VideoMonetizationDetails `json:"monetizationDetails,omitempty"`
7349 PaidProductPlacementDetails *VideoPaidProductPlacementDetails `json:"paidProductPlacementDetails,omitempty"`
7350 // Player: The player object contains information that you would use to play
7351 // the video in an embedded player.
7352 Player *VideoPlayer `json:"player,omitempty"`
7353 // ProcessingDetails: The processingDetails object encapsulates information
7354 // about YouTube's progress in processing the uploaded video file. The
7355 // properties in the object identify the current processing status and an
7356 // estimate of the time remaining until YouTube finishes processing the video.
7357 // This part also indicates whether different types of data or content, such as
7358 // file details or thumbnail images, are available for the video. The
7359 // processingProgress object is designed to be polled so that the video
7360 // uploaded can track the progress that YouTube has made in processing the
7361 // uploaded video file. This data can only be retrieved by the video owner.
7362 ProcessingDetails *VideoProcessingDetails `json:"processingDetails,omitempty"`
7363 // ProjectDetails: The projectDetails object contains information about the
7364 // project specific video metadata. b/157517979: This part was never populated
7365 // after it was added. However, it sees non-zero traffic because there is
7366 // generated client code in the wild that refers to it [1]. We keep this field
7367 // and do NOT remove it because otherwise V3 would return an error when this
7368 // part gets requested [2]. [1]
7369 // https://developers.google.com/resources/api-libraries/documentation/youtube/v3/csharp/latest/classGoogle_1_1Apis_1_1YouTube_1_1v3_1_1Data_1_1VideoProjectDetails.html
7370 // [2]
7371 // http://google3/video/youtube/src/python/servers/data_api/common.py?l=1565-1569&rcl=344141677
7372 ProjectDetails *VideoProjectDetails `json:"projectDetails,omitempty"`
7373 // RecordingDetails: The recordingDetails object encapsulates information about
7374 // the location, date and address where the video was recorded.
7375 RecordingDetails *VideoRecordingDetails `json:"recordingDetails,omitempty"`
7376 // Snippet: The snippet object contains basic details about the video, such as
7377 // its title, description, and category.
7378 Snippet *VideoSnippet `json:"snippet,omitempty"`
7379 // Statistics: The statistics object contains statistics about the video.
7380 Statistics *VideoStatistics `json:"statistics,omitempty"`
7381 // Status: The status object contains information about the video's uploading,
7382 // processing, and privacy statuses.
7383 Status *VideoStatus `json:"status,omitempty"`
7384 // Suggestions: The suggestions object encapsulates suggestions that identify
7385 // opportunities to improve the video quality or the metadata for the uploaded
7386 // video. This data can only be retrieved by the video owner.
7387 Suggestions *VideoSuggestions `json:"suggestions,omitempty"`
7388 // TopicDetails: The topicDetails object encapsulates information about
7389 // Freebase topics associated with the video.
7390 TopicDetails *VideoTopicDetails `json:"topicDetails,omitempty"`
7391
7392 // ServerResponse contains the HTTP response code and headers from the server.
7393 googleapi.ServerResponse `json:"-"`
7394 // ForceSendFields is a list of field names (e.g. "AgeGating") to
7395 // unconditionally include in API requests. By default, fields with empty or
7396 // default values are omitted from API requests. See
7397 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7398 // details.
7399 ForceSendFields []string `json:"-"`
7400 // NullFields is a list of field names (e.g. "AgeGating") to include in API
7401 // requests with the JSON null value. By default, fields with empty values are
7402 // omitted from API requests. See
7403 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7404 NullFields []string `json:"-"`
7405 }
7406
7407 func (s Video) MarshalJSON() ([]byte, error) {
7408 type NoMethod Video
7409 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7410 }
7411
7412 type VideoAbuseReport struct {
7413 // Comments: Additional comments regarding the abuse report.
7414 Comments string `json:"comments,omitempty"`
7415 // Language: The language that the content was viewed in.
7416 Language string `json:"language,omitempty"`
7417 // ReasonId: The high-level, or primary, reason that the content is abusive.
7418 // The value is an abuse report reason ID.
7419 ReasonId string `json:"reasonId,omitempty"`
7420 // SecondaryReasonId: The specific, or secondary, reason that this content is
7421 // abusive (if available). The value is an abuse report reason ID that is a
7422 // valid secondary reason for the primary reason.
7423 SecondaryReasonId string `json:"secondaryReasonId,omitempty"`
7424 // VideoId: The ID that YouTube uses to uniquely identify the video.
7425 VideoId string `json:"videoId,omitempty"`
7426 // ForceSendFields is a list of field names (e.g. "Comments") to
7427 // unconditionally include in API requests. By default, fields with empty or
7428 // default values are omitted from API requests. See
7429 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7430 // details.
7431 ForceSendFields []string `json:"-"`
7432 // NullFields is a list of field names (e.g. "Comments") to include in API
7433 // requests with the JSON null value. By default, fields with empty values are
7434 // omitted from API requests. See
7435 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7436 NullFields []string `json:"-"`
7437 }
7438
7439 func (s VideoAbuseReport) MarshalJSON() ([]byte, error) {
7440 type NoMethod VideoAbuseReport
7441 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7442 }
7443
7444 // VideoAbuseReportReason: A `__videoAbuseReportReason__` resource identifies a
7445 // reason that a video could be reported as abusive. Video abuse report reasons
7446 // are used with `video.ReportAbuse`.
7447 type VideoAbuseReportReason struct {
7448 // Etag: Etag of this resource.
7449 Etag string `json:"etag,omitempty"`
7450 // Id: The ID of this abuse report reason.
7451 Id string `json:"id,omitempty"`
7452 // Kind: Identifies what kind of resource this is. Value: the fixed string
7453 // "youtube#videoAbuseReportReason".
7454 Kind string `json:"kind,omitempty"`
7455 // Snippet: The `snippet` object contains basic details about the abuse report
7456 // reason.
7457 Snippet *VideoAbuseReportReasonSnippet `json:"snippet,omitempty"`
7458 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7459 // include in API requests. By default, fields with empty or default values are
7460 // omitted from API requests. See
7461 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7462 // details.
7463 ForceSendFields []string `json:"-"`
7464 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7465 // with the JSON null value. By default, fields with empty values are omitted
7466 // from API requests. See
7467 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7468 NullFields []string `json:"-"`
7469 }
7470
7471 func (s VideoAbuseReportReason) MarshalJSON() ([]byte, error) {
7472 type NoMethod VideoAbuseReportReason
7473 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7474 }
7475
7476 type VideoAbuseReportReasonListResponse struct {
7477 // Etag: Etag of this resource.
7478 Etag string `json:"etag,omitempty"`
7479 // EventId: Serialized EventId of the request which produced this response.
7480 EventId string `json:"eventId,omitempty"`
7481 // Items: A list of valid abuse reasons that are used with `video.ReportAbuse`.
7482 Items []*VideoAbuseReportReason `json:"items,omitempty"`
7483 // Kind: Identifies what kind of resource this is. Value: the fixed string
7484 // "youtube#videoAbuseReportReasonListResponse".
7485 Kind string `json:"kind,omitempty"`
7486 // VisitorId: The `visitorId` identifies the visitor.
7487 VisitorId string `json:"visitorId,omitempty"`
7488
7489 // ServerResponse contains the HTTP response code and headers from the server.
7490 googleapi.ServerResponse `json:"-"`
7491 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7492 // include in API requests. By default, fields with empty or default values are
7493 // omitted from API requests. See
7494 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7495 // details.
7496 ForceSendFields []string `json:"-"`
7497 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7498 // with the JSON null value. By default, fields with empty values are omitted
7499 // from API requests. See
7500 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7501 NullFields []string `json:"-"`
7502 }
7503
7504 func (s VideoAbuseReportReasonListResponse) MarshalJSON() ([]byte, error) {
7505 type NoMethod VideoAbuseReportReasonListResponse
7506 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7507 }
7508
7509 // VideoAbuseReportReasonSnippet: Basic details about a video category, such as
7510 // its localized title.
7511 type VideoAbuseReportReasonSnippet struct {
7512 // Label: The localized label belonging to this abuse report reason.
7513 Label string `json:"label,omitempty"`
7514 // SecondaryReasons: The secondary reasons associated with this reason, if any
7515 // are available. (There might be 0 or more.)
7516 SecondaryReasons []*VideoAbuseReportSecondaryReason `json:"secondaryReasons,omitempty"`
7517 // ForceSendFields is a list of field names (e.g. "Label") to unconditionally
7518 // include in API requests. By default, fields with empty or default values are
7519 // omitted from API requests. See
7520 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7521 // details.
7522 ForceSendFields []string `json:"-"`
7523 // NullFields is a list of field names (e.g. "Label") to include in API
7524 // requests with the JSON null value. By default, fields with empty values are
7525 // omitted from API requests. See
7526 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7527 NullFields []string `json:"-"`
7528 }
7529
7530 func (s VideoAbuseReportReasonSnippet) MarshalJSON() ([]byte, error) {
7531 type NoMethod VideoAbuseReportReasonSnippet
7532 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7533 }
7534
7535 type VideoAbuseReportSecondaryReason struct {
7536 // Id: The ID of this abuse report secondary reason.
7537 Id string `json:"id,omitempty"`
7538 // Label: The localized label for this abuse report secondary reason.
7539 Label string `json:"label,omitempty"`
7540 // ForceSendFields is a list of field names (e.g. "Id") to unconditionally
7541 // include in API requests. By default, fields with empty or default values are
7542 // omitted from API requests. See
7543 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7544 // details.
7545 ForceSendFields []string `json:"-"`
7546 // NullFields is a list of field names (e.g. "Id") to include in API requests
7547 // with the JSON null value. By default, fields with empty values are omitted
7548 // from API requests. See
7549 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7550 NullFields []string `json:"-"`
7551 }
7552
7553 func (s VideoAbuseReportSecondaryReason) MarshalJSON() ([]byte, error) {
7554 type NoMethod VideoAbuseReportSecondaryReason
7555 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7556 }
7557
7558 type VideoAgeGating struct {
7559 // AlcoholContent: Indicates whether or not the video has alcoholic beverage
7560 // content. Only users of legal purchasing age in a particular country, as
7561 // identified by ICAP, can view the content.
7562 AlcoholContent bool `json:"alcoholContent,omitempty"`
7563 // Restricted: Age-restricted trailers. For redband trailers and adult-rated
7564 // video-games. Only users aged 18+ can view the content. The the field is true
7565 // the content is restricted to viewers aged 18+. Otherwise The field won't be
7566 // present.
7567 Restricted bool `json:"restricted,omitempty"`
7568 // VideoGameRating: Video game rating, if any.
7569 //
7570 // Possible values:
7571 // "anyone"
7572 // "m15Plus"
7573 // "m16Plus"
7574 // "m17Plus"
7575 VideoGameRating string `json:"videoGameRating,omitempty"`
7576 // ForceSendFields is a list of field names (e.g. "AlcoholContent") to
7577 // unconditionally include in API requests. By default, fields with empty or
7578 // default values are omitted from API requests. See
7579 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7580 // details.
7581 ForceSendFields []string `json:"-"`
7582 // NullFields is a list of field names (e.g. "AlcoholContent") to include in
7583 // API requests with the JSON null value. By default, fields with empty values
7584 // are omitted from API requests. See
7585 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7586 NullFields []string `json:"-"`
7587 }
7588
7589 func (s VideoAgeGating) MarshalJSON() ([]byte, error) {
7590 type NoMethod VideoAgeGating
7591 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7592 }
7593
7594 // VideoCategory: A *videoCategory* resource identifies a category that has
7595 // been or could be associated with uploaded videos.
7596 type VideoCategory struct {
7597 // Etag: Etag of this resource.
7598 Etag string `json:"etag,omitempty"`
7599 // Id: The ID that YouTube uses to uniquely identify the video category.
7600 Id string `json:"id,omitempty"`
7601 // Kind: Identifies what kind of resource this is. Value: the fixed string
7602 // "youtube#videoCategory".
7603 Kind string `json:"kind,omitempty"`
7604 // Snippet: The snippet object contains basic details about the video category,
7605 // including its title.
7606 Snippet *VideoCategorySnippet `json:"snippet,omitempty"`
7607 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7608 // include in API requests. By default, fields with empty or default values are
7609 // omitted from API requests. See
7610 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7611 // details.
7612 ForceSendFields []string `json:"-"`
7613 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7614 // with the JSON null value. By default, fields with empty values are omitted
7615 // from API requests. See
7616 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7617 NullFields []string `json:"-"`
7618 }
7619
7620 func (s VideoCategory) MarshalJSON() ([]byte, error) {
7621 type NoMethod VideoCategory
7622 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7623 }
7624
7625 type VideoCategoryListResponse struct {
7626 // Etag: Etag of this resource.
7627 Etag string `json:"etag,omitempty"`
7628 // EventId: Serialized EventId of the request which produced this response.
7629 EventId string `json:"eventId,omitempty"`
7630 // Items: A list of video categories that can be associated with YouTube
7631 // videos. In this map, the video category ID is the map key, and its value is
7632 // the corresponding videoCategory resource.
7633 Items []*VideoCategory `json:"items,omitempty"`
7634 // Kind: Identifies what kind of resource this is. Value: the fixed string
7635 // "youtube#videoCategoryListResponse".
7636 Kind string `json:"kind,omitempty"`
7637 // NextPageToken: The token that can be used as the value of the pageToken
7638 // parameter to retrieve the next page in the result set.
7639 NextPageToken string `json:"nextPageToken,omitempty"`
7640 // PageInfo: General pagination information.
7641 PageInfo *PageInfo `json:"pageInfo,omitempty"`
7642 // PrevPageToken: The token that can be used as the value of the pageToken
7643 // parameter to retrieve the previous page in the result set.
7644 PrevPageToken string `json:"prevPageToken,omitempty"`
7645 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
7646 // VisitorId: The visitorId identifies the visitor.
7647 VisitorId string `json:"visitorId,omitempty"`
7648
7649 // ServerResponse contains the HTTP response code and headers from the server.
7650 googleapi.ServerResponse `json:"-"`
7651 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7652 // include in API requests. By default, fields with empty or default values are
7653 // omitted from API requests. See
7654 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7655 // details.
7656 ForceSendFields []string `json:"-"`
7657 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7658 // with the JSON null value. By default, fields with empty values are omitted
7659 // from API requests. See
7660 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7661 NullFields []string `json:"-"`
7662 }
7663
7664 func (s VideoCategoryListResponse) MarshalJSON() ([]byte, error) {
7665 type NoMethod VideoCategoryListResponse
7666 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7667 }
7668
7669 // VideoCategorySnippet: Basic details about a video category, such as its
7670 // localized title.
7671 type VideoCategorySnippet struct {
7672 Assignable bool `json:"assignable,omitempty"`
7673 // ChannelId: The YouTube channel that created the video category.
7674 ChannelId string `json:"channelId,omitempty"`
7675 // Title: The video category's title.
7676 Title string `json:"title,omitempty"`
7677 // ForceSendFields is a list of field names (e.g. "Assignable") to
7678 // unconditionally include in API requests. By default, fields with empty or
7679 // default values are omitted from API requests. See
7680 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7681 // details.
7682 ForceSendFields []string `json:"-"`
7683 // NullFields is a list of field names (e.g. "Assignable") to include in API
7684 // requests with the JSON null value. By default, fields with empty values are
7685 // omitted from API requests. See
7686 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7687 NullFields []string `json:"-"`
7688 }
7689
7690 func (s VideoCategorySnippet) MarshalJSON() ([]byte, error) {
7691 type NoMethod VideoCategorySnippet
7692 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7693 }
7694
7695 // VideoContentDetails: Details about the content of a YouTube Video.
7696 type VideoContentDetails struct {
7697 // Caption: The value of captions indicates whether the video has captions or
7698 // not.
7699 //
7700 // Possible values:
7701 // "true"
7702 // "false"
7703 Caption string `json:"caption,omitempty"`
7704 // ContentRating: Specifies the ratings that the video received under various
7705 // rating schemes.
7706 ContentRating *ContentRating `json:"contentRating,omitempty"`
7707 // CountryRestriction: The countryRestriction object contains information about
7708 // the countries where a video is (or is not) viewable.
7709 CountryRestriction *AccessPolicy `json:"countryRestriction,omitempty"`
7710 // Definition: The value of definition indicates whether the video is available
7711 // in high definition or only in standard definition.
7712 //
7713 // Possible values:
7714 // "sd" - sd
7715 // "hd" - hd
7716 Definition string `json:"definition,omitempty"`
7717 // Dimension: The value of dimension indicates whether the video is available
7718 // in 3D or in 2D.
7719 Dimension string `json:"dimension,omitempty"`
7720 // Duration: The length of the video. The tag value is an ISO 8601 duration in
7721 // the format PT#M#S, in which the letters PT indicate that the value specifies
7722 // a period of time, and the letters M and S refer to length in minutes and
7723 // seconds, respectively. The # characters preceding the M and S letters are
7724 // both integers that specify the number of minutes (or seconds) of the video.
7725 // For example, a value of PT15M51S indicates that the video is 15 minutes and
7726 // 51 seconds long.
7727 Duration string `json:"duration,omitempty"`
7728 // HasCustomThumbnail: Indicates whether the video uploader has provided a
7729 // custom thumbnail image for the video. This property is only visible to the
7730 // video uploader.
7731 HasCustomThumbnail bool `json:"hasCustomThumbnail,omitempty"`
7732 // LicensedContent: The value of is_license_content indicates whether the video
7733 // is licensed content.
7734 LicensedContent bool `json:"licensedContent,omitempty"`
7735 // Projection: Specifies the projection format of the video.
7736 //
7737 // Possible values:
7738 // "rectangular"
7739 // "360"
7740 Projection string `json:"projection,omitempty"`
7741 // RegionRestriction: The regionRestriction object contains information about
7742 // the countries where a video is (or is not) viewable. The object will contain
7743 // either the contentDetails.regionRestriction.allowed property or the
7744 // contentDetails.regionRestriction.blocked property.
7745 RegionRestriction *VideoContentDetailsRegionRestriction `json:"regionRestriction,omitempty"`
7746 // ForceSendFields is a list of field names (e.g. "Caption") to unconditionally
7747 // include in API requests. By default, fields with empty or default values are
7748 // omitted from API requests. See
7749 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7750 // details.
7751 ForceSendFields []string `json:"-"`
7752 // NullFields is a list of field names (e.g. "Caption") to include in API
7753 // requests with the JSON null value. By default, fields with empty values are
7754 // omitted from API requests. See
7755 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7756 NullFields []string `json:"-"`
7757 }
7758
7759 func (s VideoContentDetails) MarshalJSON() ([]byte, error) {
7760 type NoMethod VideoContentDetails
7761 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7762 }
7763
7764 // VideoContentDetailsRegionRestriction: DEPRECATED Region restriction of the
7765 // video.
7766 type VideoContentDetailsRegionRestriction struct {
7767 // Allowed: A list of region codes that identify countries where the video is
7768 // viewable. If this property is present and a country is not listed in its
7769 // value, then the video is blocked from appearing in that country. If this
7770 // property is present and contains an empty list, the video is blocked in all
7771 // countries.
7772 Allowed []string `json:"allowed,omitempty"`
7773 // Blocked: A list of region codes that identify countries where the video is
7774 // blocked. If this property is present and a country is not listed in its
7775 // value, then the video is viewable in that country. If this property is
7776 // present and contains an empty list, the video is viewable in all countries.
7777 Blocked []string `json:"blocked,omitempty"`
7778 // ForceSendFields is a list of field names (e.g. "Allowed") to unconditionally
7779 // include in API requests. By default, fields with empty or default values are
7780 // omitted from API requests. See
7781 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7782 // details.
7783 ForceSendFields []string `json:"-"`
7784 // NullFields is a list of field names (e.g. "Allowed") to include in API
7785 // requests with the JSON null value. By default, fields with empty values are
7786 // omitted from API requests. See
7787 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7788 NullFields []string `json:"-"`
7789 }
7790
7791 func (s VideoContentDetailsRegionRestriction) MarshalJSON() ([]byte, error) {
7792 type NoMethod VideoContentDetailsRegionRestriction
7793 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7794 }
7795
7796 // VideoFileDetails: Describes original video file properties, including
7797 // technical details about audio and video streams, but also metadata
7798 // information like content length, digitization time, or geotagging
7799 // information.
7800 type VideoFileDetails struct {
7801 // AudioStreams: A list of audio streams contained in the uploaded video file.
7802 // Each item in the list contains detailed metadata about an audio stream.
7803 AudioStreams []*VideoFileDetailsAudioStream `json:"audioStreams,omitempty"`
7804 // BitrateBps: The uploaded video file's combined (video and audio) bitrate in
7805 // bits per second.
7806 BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
7807 // Container: The uploaded video file's container format.
7808 Container string `json:"container,omitempty"`
7809 // CreationTime: The date and time when the uploaded video file was created.
7810 // The value is specified in ISO 8601 format. Currently, the following ISO 8601
7811 // formats are supported: - Date only: YYYY-MM-DD - Naive time:
7812 // YYYY-MM-DDTHH:MM:SS - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM
7813 CreationTime string `json:"creationTime,omitempty"`
7814 // DurationMs: The length of the uploaded video in milliseconds.
7815 DurationMs uint64 `json:"durationMs,omitempty,string"`
7816 // FileName: The uploaded file's name. This field is present whether a video
7817 // file or another type of file was uploaded.
7818 FileName string `json:"fileName,omitempty"`
7819 // FileSize: The uploaded file's size in bytes. This field is present whether a
7820 // video file or another type of file was uploaded.
7821 FileSize uint64 `json:"fileSize,omitempty,string"`
7822 // FileType: The uploaded file's type as detected by YouTube's video processing
7823 // engine. Currently, YouTube only processes video files, but this field is
7824 // present whether a video file or another type of file was uploaded.
7825 //
7826 // Possible values:
7827 // "video" - Known video file (e.g., an MP4 file).
7828 // "audio" - Audio only file (e.g., an MP3 file).
7829 // "image" - Image file (e.g., a JPEG image).
7830 // "archive" - Archive file (e.g., a ZIP archive).
7831 // "document" - Document or text file (e.g., MS Word document).
7832 // "project" - Movie project file (e.g., Microsoft Windows Movie Maker
7833 // project).
7834 // "other" - Other non-video file type.
7835 FileType string `json:"fileType,omitempty"`
7836 // VideoStreams: A list of video streams contained in the uploaded video file.
7837 // Each item in the list contains detailed metadata about a video stream.
7838 VideoStreams []*VideoFileDetailsVideoStream `json:"videoStreams,omitempty"`
7839 // ForceSendFields is a list of field names (e.g. "AudioStreams") to
7840 // unconditionally include in API requests. By default, fields with empty or
7841 // default values are omitted from API requests. See
7842 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7843 // details.
7844 ForceSendFields []string `json:"-"`
7845 // NullFields is a list of field names (e.g. "AudioStreams") to include in API
7846 // requests with the JSON null value. By default, fields with empty values are
7847 // omitted from API requests. See
7848 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7849 NullFields []string `json:"-"`
7850 }
7851
7852 func (s VideoFileDetails) MarshalJSON() ([]byte, error) {
7853 type NoMethod VideoFileDetails
7854 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7855 }
7856
7857 // VideoFileDetailsAudioStream: Information about an audio stream.
7858 type VideoFileDetailsAudioStream struct {
7859 // BitrateBps: The audio stream's bitrate, in bits per second.
7860 BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
7861 // ChannelCount: The number of audio channels that the stream contains.
7862 ChannelCount int64 `json:"channelCount,omitempty"`
7863 // Codec: The audio codec that the stream uses.
7864 Codec string `json:"codec,omitempty"`
7865 // Vendor: A value that uniquely identifies a video vendor. Typically, the
7866 // value is a four-letter vendor code.
7867 Vendor string `json:"vendor,omitempty"`
7868 // ForceSendFields is a list of field names (e.g. "BitrateBps") to
7869 // unconditionally include in API requests. By default, fields with empty or
7870 // default values are omitted from API requests. See
7871 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7872 // details.
7873 ForceSendFields []string `json:"-"`
7874 // NullFields is a list of field names (e.g. "BitrateBps") to include in API
7875 // requests with the JSON null value. By default, fields with empty values are
7876 // omitted from API requests. See
7877 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7878 NullFields []string `json:"-"`
7879 }
7880
7881 func (s VideoFileDetailsAudioStream) MarshalJSON() ([]byte, error) {
7882 type NoMethod VideoFileDetailsAudioStream
7883 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7884 }
7885
7886 // VideoFileDetailsVideoStream: Information about a video stream.
7887 type VideoFileDetailsVideoStream struct {
7888 // AspectRatio: The video content's display aspect ratio, which specifies the
7889 // aspect ratio in which the video should be displayed.
7890 AspectRatio float64 `json:"aspectRatio,omitempty"`
7891 // BitrateBps: The video stream's bitrate, in bits per second.
7892 BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
7893 // Codec: The video codec that the stream uses.
7894 Codec string `json:"codec,omitempty"`
7895 // FrameRateFps: The video stream's frame rate, in frames per second.
7896 FrameRateFps float64 `json:"frameRateFps,omitempty"`
7897 // HeightPixels: The encoded video content's height in pixels.
7898 HeightPixels int64 `json:"heightPixels,omitempty"`
7899 // Rotation: The amount that YouTube needs to rotate the original source
7900 // content to properly display the video.
7901 //
7902 // Possible values:
7903 // "none"
7904 // "clockwise"
7905 // "upsideDown"
7906 // "counterClockwise"
7907 // "other"
7908 Rotation string `json:"rotation,omitempty"`
7909 // Vendor: A value that uniquely identifies a video vendor. Typically, the
7910 // value is a four-letter vendor code.
7911 Vendor string `json:"vendor,omitempty"`
7912 // WidthPixels: The encoded video content's width in pixels. You can calculate
7913 // the video's encoding aspect ratio as width_pixels / height_pixels.
7914 WidthPixels int64 `json:"widthPixels,omitempty"`
7915 // ForceSendFields is a list of field names (e.g. "AspectRatio") to
7916 // unconditionally include in API requests. By default, fields with empty or
7917 // default values are omitted from API requests. See
7918 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7919 // details.
7920 ForceSendFields []string `json:"-"`
7921 // NullFields is a list of field names (e.g. "AspectRatio") to include in API
7922 // requests with the JSON null value. By default, fields with empty values are
7923 // omitted from API requests. See
7924 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7925 NullFields []string `json:"-"`
7926 }
7927
7928 func (s VideoFileDetailsVideoStream) MarshalJSON() ([]byte, error) {
7929 type NoMethod VideoFileDetailsVideoStream
7930 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7931 }
7932
7933 func (s *VideoFileDetailsVideoStream) UnmarshalJSON(data []byte) error {
7934 type NoMethod VideoFileDetailsVideoStream
7935 var s1 struct {
7936 AspectRatio gensupport.JSONFloat64 `json:"aspectRatio"`
7937 FrameRateFps gensupport.JSONFloat64 `json:"frameRateFps"`
7938 *NoMethod
7939 }
7940 s1.NoMethod = (*NoMethod)(s)
7941 if err := json.Unmarshal(data, &s1); err != nil {
7942 return err
7943 }
7944 s.AspectRatio = float64(s1.AspectRatio)
7945 s.FrameRateFps = float64(s1.FrameRateFps)
7946 return nil
7947 }
7948
7949 type VideoGetRatingResponse struct {
7950 // Etag: Etag of this resource.
7951 Etag string `json:"etag,omitempty"`
7952 // EventId: Serialized EventId of the request which produced this response.
7953 EventId string `json:"eventId,omitempty"`
7954 // Items: A list of ratings that match the request criteria.
7955 Items []*VideoRating `json:"items,omitempty"`
7956 // Kind: Identifies what kind of resource this is. Value: the fixed string
7957 // "youtube#videoGetRatingResponse".
7958 Kind string `json:"kind,omitempty"`
7959 // VisitorId: The visitorId identifies the visitor.
7960 VisitorId string `json:"visitorId,omitempty"`
7961
7962 // ServerResponse contains the HTTP response code and headers from the server.
7963 googleapi.ServerResponse `json:"-"`
7964 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
7965 // include in API requests. By default, fields with empty or default values are
7966 // omitted from API requests. See
7967 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
7968 // details.
7969 ForceSendFields []string `json:"-"`
7970 // NullFields is a list of field names (e.g. "Etag") to include in API requests
7971 // with the JSON null value. By default, fields with empty values are omitted
7972 // from API requests. See
7973 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
7974 NullFields []string `json:"-"`
7975 }
7976
7977 func (s VideoGetRatingResponse) MarshalJSON() ([]byte, error) {
7978 type NoMethod VideoGetRatingResponse
7979 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
7980 }
7981
7982 type VideoListResponse struct {
7983 // Etag: Etag of this resource.
7984 Etag string `json:"etag,omitempty"`
7985 // EventId: Serialized EventId of the request which produced this response.
7986 EventId string `json:"eventId,omitempty"`
7987 Items []*Video `json:"items,omitempty"`
7988 // Kind: Identifies what kind of resource this is. Value: the fixed string
7989 // "youtube#videoListResponse".
7990 Kind string `json:"kind,omitempty"`
7991 // NextPageToken: The token that can be used as the value of the pageToken
7992 // parameter to retrieve the next page in the result set.
7993 NextPageToken string `json:"nextPageToken,omitempty"`
7994 // PageInfo: General pagination information.
7995 PageInfo *PageInfo `json:"pageInfo,omitempty"`
7996 // PrevPageToken: The token that can be used as the value of the pageToken
7997 // parameter to retrieve the previous page in the result set.
7998 PrevPageToken string `json:"prevPageToken,omitempty"`
7999 TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
8000 // VisitorId: The visitorId identifies the visitor.
8001 VisitorId string `json:"visitorId,omitempty"`
8002
8003 // ServerResponse contains the HTTP response code and headers from the server.
8004 googleapi.ServerResponse `json:"-"`
8005 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
8006 // include in API requests. By default, fields with empty or default values are
8007 // omitted from API requests. See
8008 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8009 // details.
8010 ForceSendFields []string `json:"-"`
8011 // NullFields is a list of field names (e.g. "Etag") to include in API requests
8012 // with the JSON null value. By default, fields with empty values are omitted
8013 // from API requests. See
8014 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8015 NullFields []string `json:"-"`
8016 }
8017
8018 func (s VideoListResponse) MarshalJSON() ([]byte, error) {
8019 type NoMethod VideoListResponse
8020 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8021 }
8022
8023 // VideoLiveStreamingDetails: Details about the live streaming metadata.
8024 type VideoLiveStreamingDetails struct {
8025 // ActiveLiveChatId: The ID of the currently active live chat attached to this
8026 // video. This field is filled only if the video is a currently live broadcast
8027 // that has live chat. Once the broadcast transitions to complete this field
8028 // will be removed and the live chat closed down. For persistent broadcasts
8029 // that live chat id will no longer be tied to this video but rather to the new
8030 // video being displayed at the persistent page.
8031 ActiveLiveChatId string `json:"activeLiveChatId,omitempty"`
8032 // ActualEndTime: The time that the broadcast actually ended. This value will
8033 // not be available until the broadcast is over.
8034 ActualEndTime string `json:"actualEndTime,omitempty"`
8035 // ActualStartTime: The time that the broadcast actually started. This value
8036 // will not be available until the broadcast begins.
8037 ActualStartTime string `json:"actualStartTime,omitempty"`
8038 // ConcurrentViewers: The number of viewers currently watching the broadcast.
8039 // The property and its value will be present if the broadcast has current
8040 // viewers and the broadcast owner has not hidden the viewcount for the video.
8041 // Note that YouTube stops tracking the number of concurrent viewers for a
8042 // broadcast when the broadcast ends. So, this property would not identify the
8043 // number of viewers watching an archived video of a live broadcast that
8044 // already ended.
8045 ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
8046 // ScheduledEndTime: The time that the broadcast is scheduled to end. If the
8047 // value is empty or the property is not present, then the broadcast is
8048 // scheduled to continue indefinitely.
8049 ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
8050 // ScheduledStartTime: The time that the broadcast is scheduled to begin.
8051 ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
8052 // ForceSendFields is a list of field names (e.g. "ActiveLiveChatId") to
8053 // unconditionally include in API requests. By default, fields with empty or
8054 // default values are omitted from API requests. See
8055 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8056 // details.
8057 ForceSendFields []string `json:"-"`
8058 // NullFields is a list of field names (e.g. "ActiveLiveChatId") to include in
8059 // API requests with the JSON null value. By default, fields with empty values
8060 // are omitted from API requests. See
8061 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8062 NullFields []string `json:"-"`
8063 }
8064
8065 func (s VideoLiveStreamingDetails) MarshalJSON() ([]byte, error) {
8066 type NoMethod VideoLiveStreamingDetails
8067 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8068 }
8069
8070 // VideoLocalization: Localized versions of certain video properties (e.g.
8071 // title).
8072 type VideoLocalization struct {
8073 // Description: Localized version of the video's description.
8074 Description string `json:"description,omitempty"`
8075 // Title: Localized version of the video's title.
8076 Title string `json:"title,omitempty"`
8077 // ForceSendFields is a list of field names (e.g. "Description") to
8078 // unconditionally include in API requests. By default, fields with empty or
8079 // default values are omitted from API requests. See
8080 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8081 // details.
8082 ForceSendFields []string `json:"-"`
8083 // NullFields is a list of field names (e.g. "Description") to include in API
8084 // requests with the JSON null value. By default, fields with empty values are
8085 // omitted from API requests. See
8086 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8087 NullFields []string `json:"-"`
8088 }
8089
8090 func (s VideoLocalization) MarshalJSON() ([]byte, error) {
8091 type NoMethod VideoLocalization
8092 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8093 }
8094
8095 // VideoMonetizationDetails: Details about monetization of a YouTube Video.
8096 type VideoMonetizationDetails struct {
8097 // Access: The value of access indicates whether the video can be monetized or
8098 // not.
8099 Access *AccessPolicy `json:"access,omitempty"`
8100 // ForceSendFields is a list of field names (e.g. "Access") to unconditionally
8101 // include in API requests. By default, fields with empty or default values are
8102 // omitted from API requests. See
8103 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8104 // details.
8105 ForceSendFields []string `json:"-"`
8106 // NullFields is a list of field names (e.g. "Access") to include in API
8107 // requests with the JSON null value. By default, fields with empty values are
8108 // omitted from API requests. See
8109 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8110 NullFields []string `json:"-"`
8111 }
8112
8113 func (s VideoMonetizationDetails) MarshalJSON() ([]byte, error) {
8114 type NoMethod VideoMonetizationDetails
8115 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8116 }
8117
8118 // VideoPaidProductPlacementDetails: Details about paid content, such as paid
8119 // product placement, sponsorships or endorsement, contained in a YouTube video
8120 // and a method to inform viewers of paid promotion. This data can only be
8121 // retrieved by the video owner.
8122 type VideoPaidProductPlacementDetails struct {
8123 // HasPaidProductPlacement: This boolean represents whether the video contains
8124 // Paid Product Placement, Studio equivalent:
8125 // https://screenshot.googleplex.com/4Me79DE6AfT2ktp.png
8126 HasPaidProductPlacement bool `json:"hasPaidProductPlacement,omitempty"`
8127 // ForceSendFields is a list of field names (e.g. "HasPaidProductPlacement") to
8128 // unconditionally include in API requests. By default, fields with empty or
8129 // default values are omitted from API requests. See
8130 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8131 // details.
8132 ForceSendFields []string `json:"-"`
8133 // NullFields is a list of field names (e.g. "HasPaidProductPlacement") to
8134 // include in API requests with the JSON null value. By default, fields with
8135 // empty values are omitted from API requests. See
8136 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8137 NullFields []string `json:"-"`
8138 }
8139
8140 func (s VideoPaidProductPlacementDetails) MarshalJSON() ([]byte, error) {
8141 type NoMethod VideoPaidProductPlacementDetails
8142 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8143 }
8144
8145 // VideoPlayer: Player to be used for a video playback.
8146 type VideoPlayer struct {
8147 EmbedHeight int64 `json:"embedHeight,omitempty,string"`
8148 // EmbedHtml: An <iframe> tag that embeds a player that will play the video.
8149 EmbedHtml string `json:"embedHtml,omitempty"`
8150 // EmbedWidth: The embed width
8151 EmbedWidth int64 `json:"embedWidth,omitempty,string"`
8152 // ForceSendFields is a list of field names (e.g. "EmbedHeight") to
8153 // unconditionally include in API requests. By default, fields with empty or
8154 // default values are omitted from API requests. See
8155 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8156 // details.
8157 ForceSendFields []string `json:"-"`
8158 // NullFields is a list of field names (e.g. "EmbedHeight") to include in API
8159 // requests with the JSON null value. By default, fields with empty values are
8160 // omitted from API requests. See
8161 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8162 NullFields []string `json:"-"`
8163 }
8164
8165 func (s VideoPlayer) MarshalJSON() ([]byte, error) {
8166 type NoMethod VideoPlayer
8167 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8168 }
8169
8170 // VideoProcessingDetails: Describes processing status and progress and
8171 // availability of some other Video resource parts.
8172 type VideoProcessingDetails struct {
8173 // EditorSuggestionsAvailability: This value indicates whether video editing
8174 // suggestions, which might improve video quality or the playback experience,
8175 // are available for the video. You can retrieve these suggestions by
8176 // requesting the suggestions part in your videos.list() request.
8177 EditorSuggestionsAvailability string `json:"editorSuggestionsAvailability,omitempty"`
8178 // FileDetailsAvailability: This value indicates whether file details are
8179 // available for the uploaded video. You can retrieve a video's file details by
8180 // requesting the fileDetails part in your videos.list() request.
8181 FileDetailsAvailability string `json:"fileDetailsAvailability,omitempty"`
8182 // ProcessingFailureReason: The reason that YouTube failed to process the
8183 // video. This property will only have a value if the processingStatus
8184 // property's value is failed.
8185 //
8186 // Possible values:
8187 // "uploadFailed"
8188 // "transcodeFailed"
8189 // "streamingFailed"
8190 // "other"
8191 ProcessingFailureReason string `json:"processingFailureReason,omitempty"`
8192 // ProcessingIssuesAvailability: This value indicates whether the video
8193 // processing engine has generated suggestions that might improve YouTube's
8194 // ability to process the the video, warnings that explain video processing
8195 // problems, or errors that cause video processing problems. You can retrieve
8196 // these suggestions by requesting the suggestions part in your videos.list()
8197 // request.
8198 ProcessingIssuesAvailability string `json:"processingIssuesAvailability,omitempty"`
8199 // ProcessingProgress: The processingProgress object contains information about
8200 // the progress YouTube has made in processing the video. The values are really
8201 // only relevant if the video's processing status is processing.
8202 ProcessingProgress *VideoProcessingDetailsProcessingProgress `json:"processingProgress,omitempty"`
8203 // ProcessingStatus: The video's processing status. This value indicates
8204 // whether YouTube was able to process the video or if the video is still being
8205 // processed.
8206 //
8207 // Possible values:
8208 // "processing"
8209 // "succeeded"
8210 // "failed"
8211 // "terminated"
8212 ProcessingStatus string `json:"processingStatus,omitempty"`
8213 // TagSuggestionsAvailability: This value indicates whether keyword (tag)
8214 // suggestions are available for the video. Tags can be added to a video's
8215 // metadata to make it easier for other users to find the video. You can
8216 // retrieve these suggestions by requesting the suggestions part in your
8217 // videos.list() request.
8218 TagSuggestionsAvailability string `json:"tagSuggestionsAvailability,omitempty"`
8219 // ThumbnailsAvailability: This value indicates whether thumbnail images have
8220 // been generated for the video.
8221 ThumbnailsAvailability string `json:"thumbnailsAvailability,omitempty"`
8222 // ForceSendFields is a list of field names (e.g.
8223 // "EditorSuggestionsAvailability") to unconditionally include in API requests.
8224 // By default, fields with empty or default values are omitted from API
8225 // requests. See https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields
8226 // for more details.
8227 ForceSendFields []string `json:"-"`
8228 // NullFields is a list of field names (e.g. "EditorSuggestionsAvailability")
8229 // to include in API requests with the JSON null value. By default, fields with
8230 // empty values are omitted from API requests. See
8231 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8232 NullFields []string `json:"-"`
8233 }
8234
8235 func (s VideoProcessingDetails) MarshalJSON() ([]byte, error) {
8236 type NoMethod VideoProcessingDetails
8237 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8238 }
8239
8240 // VideoProcessingDetailsProcessingProgress: Video processing progress and
8241 // completion time estimate.
8242 type VideoProcessingDetailsProcessingProgress struct {
8243 // PartsProcessed: The number of parts of the video that YouTube has already
8244 // processed. You can estimate the percentage of the video that YouTube has
8245 // already processed by calculating: 100 * parts_processed / parts_total Note
8246 // that since the estimated number of parts could increase without a
8247 // corresponding increase in the number of parts that have already been
8248 // processed, it is possible that the calculated progress could periodically
8249 // decrease while YouTube processes a video.
8250 PartsProcessed uint64 `json:"partsProcessed,omitempty,string"`
8251 // PartsTotal: An estimate of the total number of parts that need to be
8252 // processed for the video. The number may be updated with more precise
8253 // estimates while YouTube processes the video.
8254 PartsTotal uint64 `json:"partsTotal,omitempty,string"`
8255 // TimeLeftMs: An estimate of the amount of time, in millseconds, that YouTube
8256 // needs to finish processing the video.
8257 TimeLeftMs uint64 `json:"timeLeftMs,omitempty,string"`
8258 // ForceSendFields is a list of field names (e.g. "PartsProcessed") to
8259 // unconditionally include in API requests. By default, fields with empty or
8260 // default values are omitted from API requests. See
8261 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8262 // details.
8263 ForceSendFields []string `json:"-"`
8264 // NullFields is a list of field names (e.g. "PartsProcessed") to include in
8265 // API requests with the JSON null value. By default, fields with empty values
8266 // are omitted from API requests. See
8267 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8268 NullFields []string `json:"-"`
8269 }
8270
8271 func (s VideoProcessingDetailsProcessingProgress) MarshalJSON() ([]byte, error) {
8272 type NoMethod VideoProcessingDetailsProcessingProgress
8273 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8274 }
8275
8276 // VideoProjectDetails: DEPRECATED. b/157517979: This part was never populated
8277 // after it was added. However, it sees non-zero traffic because there is
8278 // generated client code in the wild that refers to it [1]. We keep this field
8279 // and do NOT remove it because otherwise V3 would return an error when this
8280 // part gets requested [2]. [1]
8281 // https://developers.google.com/resources/api-libraries/documentation/youtube/v3/csharp/latest/classGoogle_1_1Apis_1_1YouTube_1_1v3_1_1Data_1_1VideoProjectDetails.html
8282 // [2]
8283 // http://google3/video/youtube/src/python/servers/data_api/common.py?l=1565-1569&rcl=344141677
8284 type VideoProjectDetails struct {
8285 }
8286
8287 // VideoRating: Basic details about rating of a video.
8288 type VideoRating struct {
8289 // Rating: Rating of a video.
8290 //
8291 // Possible values:
8292 // "none"
8293 // "like" - The entity is liked.
8294 // "dislike" - The entity is disliked.
8295 Rating string `json:"rating,omitempty"`
8296 // VideoId: The ID that YouTube uses to uniquely identify the video.
8297 VideoId string `json:"videoId,omitempty"`
8298 // ForceSendFields is a list of field names (e.g. "Rating") to unconditionally
8299 // include in API requests. By default, fields with empty or default values are
8300 // omitted from API requests. See
8301 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8302 // details.
8303 ForceSendFields []string `json:"-"`
8304 // NullFields is a list of field names (e.g. "Rating") to include in API
8305 // requests with the JSON null value. By default, fields with empty values are
8306 // omitted from API requests. See
8307 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8308 NullFields []string `json:"-"`
8309 }
8310
8311 func (s VideoRating) MarshalJSON() ([]byte, error) {
8312 type NoMethod VideoRating
8313 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8314 }
8315
8316 // VideoRecordingDetails: Recording information associated with the video.
8317 type VideoRecordingDetails struct {
8318 // Location: The geolocation information associated with the video.
8319 Location *GeoPoint `json:"location,omitempty"`
8320 // LocationDescription: The text description of the location where the video
8321 // was recorded.
8322 LocationDescription string `json:"locationDescription,omitempty"`
8323 // RecordingDate: The date and time when the video was recorded.
8324 RecordingDate string `json:"recordingDate,omitempty"`
8325 // ForceSendFields is a list of field names (e.g. "Location") to
8326 // unconditionally include in API requests. By default, fields with empty or
8327 // default values are omitted from API requests. See
8328 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8329 // details.
8330 ForceSendFields []string `json:"-"`
8331 // NullFields is a list of field names (e.g. "Location") to include in API
8332 // requests with the JSON null value. By default, fields with empty values are
8333 // omitted from API requests. See
8334 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8335 NullFields []string `json:"-"`
8336 }
8337
8338 func (s VideoRecordingDetails) MarshalJSON() ([]byte, error) {
8339 type NoMethod VideoRecordingDetails
8340 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8341 }
8342
8343 // VideoSnippet: Basic details about a video, including title, description,
8344 // uploader, thumbnails and category.
8345 type VideoSnippet struct {
8346 // CategoryId: The YouTube video category associated with the video.
8347 CategoryId string `json:"categoryId,omitempty"`
8348 // ChannelId: The ID that YouTube uses to uniquely identify the channel that
8349 // the video was uploaded to.
8350 ChannelId string `json:"channelId,omitempty"`
8351 // ChannelTitle: Channel title for the channel that the video belongs to.
8352 ChannelTitle string `json:"channelTitle,omitempty"`
8353 // DefaultAudioLanguage: The default_audio_language property specifies the
8354 // language spoken in the video's default audio track.
8355 DefaultAudioLanguage string `json:"defaultAudioLanguage,omitempty"`
8356 // DefaultLanguage: The language of the videos's default snippet.
8357 DefaultLanguage string `json:"defaultLanguage,omitempty"`
8358 // Description: The video's description. @mutable youtube.videos.insert
8359 // youtube.videos.update
8360 Description string `json:"description,omitempty"`
8361 // LiveBroadcastContent: Indicates if the video is an upcoming/active live
8362 // broadcast. Or it's "none" if the video is not an upcoming/active live
8363 // broadcast.
8364 //
8365 // Possible values:
8366 // "none"
8367 // "upcoming" - The live broadcast is upcoming.
8368 // "live" - The live broadcast is active.
8369 // "completed" - The live broadcast has been completed.
8370 LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
8371 // Localized: Localized snippet selected with the hl parameter. If no such
8372 // localization exists, this field is populated with the default snippet.
8373 // (Read-only)
8374 Localized *VideoLocalization `json:"localized,omitempty"`
8375 // PublishedAt: The date and time when the video was uploaded.
8376 PublishedAt string `json:"publishedAt,omitempty"`
8377 // Tags: A list of keyword tags associated with the video. Tags may contain
8378 // spaces.
8379 Tags []string `json:"tags,omitempty"`
8380 // Thumbnails: A map of thumbnail images associated with the video. For each
8381 // object in the map, the key is the name of the thumbnail image, and the value
8382 // is an object that contains other information about the thumbnail.
8383 Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
8384 // Title: The video's title. @mutable youtube.videos.insert
8385 // youtube.videos.update
8386 Title string `json:"title,omitempty"`
8387 // ForceSendFields is a list of field names (e.g. "CategoryId") to
8388 // unconditionally include in API requests. By default, fields with empty or
8389 // default values are omitted from API requests. See
8390 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8391 // details.
8392 ForceSendFields []string `json:"-"`
8393 // NullFields is a list of field names (e.g. "CategoryId") to include in API
8394 // requests with the JSON null value. By default, fields with empty values are
8395 // omitted from API requests. See
8396 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8397 NullFields []string `json:"-"`
8398 }
8399
8400 func (s VideoSnippet) MarshalJSON() ([]byte, error) {
8401 type NoMethod VideoSnippet
8402 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8403 }
8404
8405 // VideoStatistics: Statistics about the video, such as the number of times the
8406 // video was viewed or liked.
8407 type VideoStatistics struct {
8408 // CommentCount: The number of comments for the video.
8409 CommentCount uint64 `json:"commentCount,omitempty,string"`
8410 // DislikeCount: The number of users who have indicated that they disliked the
8411 // video by giving it a negative rating.
8412 DislikeCount uint64 `json:"dislikeCount,omitempty,string"`
8413 // FavoriteCount: The number of users who currently have the video marked as a
8414 // favorite video.
8415 FavoriteCount uint64 `json:"favoriteCount,omitempty,string"`
8416 // LikeCount: The number of users who have indicated that they liked the video
8417 // by giving it a positive rating.
8418 LikeCount uint64 `json:"likeCount,omitempty,string"`
8419 // ViewCount: The number of times the video has been viewed.
8420 ViewCount uint64 `json:"viewCount,omitempty,string"`
8421 // ForceSendFields is a list of field names (e.g. "CommentCount") to
8422 // unconditionally include in API requests. By default, fields with empty or
8423 // default values are omitted from API requests. See
8424 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8425 // details.
8426 ForceSendFields []string `json:"-"`
8427 // NullFields is a list of field names (e.g. "CommentCount") to include in API
8428 // requests with the JSON null value. By default, fields with empty values are
8429 // omitted from API requests. See
8430 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8431 NullFields []string `json:"-"`
8432 }
8433
8434 func (s VideoStatistics) MarshalJSON() ([]byte, error) {
8435 type NoMethod VideoStatistics
8436 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8437 }
8438
8439 // VideoStatus: Basic details about a video category, such as its localized
8440 // title. Next Id: 19
8441 type VideoStatus struct {
8442 // ContainsSyntheticMedia: Indicates if the video contains altered or synthetic
8443 // media.
8444 ContainsSyntheticMedia bool `json:"containsSyntheticMedia,omitempty"`
8445 // Embeddable: This value indicates if the video can be embedded on another
8446 // website. @mutable youtube.videos.insert youtube.videos.update
8447 Embeddable bool `json:"embeddable,omitempty"`
8448 // FailureReason: This value explains why a video failed to upload. This
8449 // property is only present if the uploadStatus property indicates that the
8450 // upload failed.
8451 //
8452 // Possible values:
8453 // "conversion" - Unable to convert video content.
8454 // "invalidFile" - Invalid file format.
8455 // "emptyFile" - Empty file.
8456 // "tooSmall" - File was too small.
8457 // "codec" - Unsupported codec.
8458 // "uploadAborted" - Upload wasn't finished.
8459 FailureReason string `json:"failureReason,omitempty"`
8460 // License: The video's license. @mutable youtube.videos.insert
8461 // youtube.videos.update
8462 //
8463 // Possible values:
8464 // "youtube"
8465 // "creativeCommon"
8466 License string `json:"license,omitempty"`
8467 MadeForKids bool `json:"madeForKids,omitempty"`
8468 // PrivacyStatus: The video's privacy status.
8469 //
8470 // Possible values:
8471 // "public"
8472 // "unlisted"
8473 // "private"
8474 PrivacyStatus string `json:"privacyStatus,omitempty"`
8475 // PublicStatsViewable: This value indicates if the extended video statistics
8476 // on the watch page can be viewed by everyone. Note that the view count,
8477 // likes, etc will still be visible if this is disabled. @mutable
8478 // youtube.videos.insert youtube.videos.update
8479 PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
8480 // PublishAt: The date and time when the video is scheduled to publish. It can
8481 // be set only if the privacy status of the video is private..
8482 PublishAt string `json:"publishAt,omitempty"`
8483 // RejectionReason: This value explains why YouTube rejected an uploaded video.
8484 // This property is only present if the uploadStatus property indicates that
8485 // the upload was rejected.
8486 //
8487 // Possible values:
8488 // "copyright" - Copyright infringement.
8489 // "inappropriate" - Inappropriate video content.
8490 // "duplicate" - Duplicate upload in the same channel.
8491 // "termsOfUse" - Terms of use violation.
8492 // "uploaderAccountSuspended" - Uploader account was suspended.
8493 // "length" - Video duration was too long.
8494 // "claim" - Blocked by content owner.
8495 // "uploaderAccountClosed" - Uploader closed his/her account.
8496 // "trademark" - Trademark infringement.
8497 // "legal" - An unspecified legal reason.
8498 RejectionReason string `json:"rejectionReason,omitempty"`
8499 SelfDeclaredMadeForKids bool `json:"selfDeclaredMadeForKids,omitempty"`
8500 // UploadStatus: The status of the uploaded video.
8501 //
8502 // Possible values:
8503 // "uploaded" - Video has been uploaded but not processed yet.
8504 // "processed" - Video has been successfully processed.
8505 // "failed" - Processing has failed. See FailureReason.
8506 // "rejected" - Video has been rejected. See RejectionReason.
8507 // "deleted" - Video has been deleted.
8508 UploadStatus string `json:"uploadStatus,omitempty"`
8509 // ForceSendFields is a list of field names (e.g. "ContainsSyntheticMedia") to
8510 // unconditionally include in API requests. By default, fields with empty or
8511 // default values are omitted from API requests. See
8512 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8513 // details.
8514 ForceSendFields []string `json:"-"`
8515 // NullFields is a list of field names (e.g. "ContainsSyntheticMedia") to
8516 // include in API requests with the JSON null value. By default, fields with
8517 // empty values are omitted from API requests. See
8518 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8519 NullFields []string `json:"-"`
8520 }
8521
8522 func (s VideoStatus) MarshalJSON() ([]byte, error) {
8523 type NoMethod VideoStatus
8524 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8525 }
8526
8527 // VideoSuggestions: Specifies suggestions on how to improve video content,
8528 // including encoding hints, tag suggestions, and editor suggestions.
8529 type VideoSuggestions struct {
8530 // EditorSuggestions: A list of video editing operations that might improve the
8531 // video quality or playback experience of the uploaded video.
8532 //
8533 // Possible values:
8534 // "videoAutoLevels" - Picture brightness levels seem off and could be
8535 // corrected.
8536 // "videoStabilize" - The video appears shaky and could be stabilized.
8537 // "videoCrop" - Margins (mattes) detected around the picture could be
8538 // cropped.
8539 // "audioQuietAudioSwap" - The audio track appears silent and could be
8540 // swapped with a better quality one.
8541 EditorSuggestions []string `json:"editorSuggestions,omitempty"`
8542 // ProcessingErrors: A list of errors that will prevent YouTube from
8543 // successfully processing the uploaded video video. These errors indicate
8544 // that, regardless of the video's current processing status, eventually, that
8545 // status will almost certainly be failed.
8546 //
8547 // Possible values:
8548 // "audioFile" - File contains audio only (e.g., an MP3 file).
8549 // "imageFile" - Image file (e.g., a JPEG image).
8550 // "projectFile" - Movie project file (e.g., Microsoft Windows Movie Maker
8551 // project).
8552 // "notAVideoFile" - Other non-video file.
8553 // "docFile" - Document or text file (e.g., MS Word document).
8554 // "archiveFile" - An archive file (e.g., a ZIP archive).
8555 // "unsupportedSpatialAudioLayout" - Unsupported spatial audio layout type.
8556 ProcessingErrors []string `json:"processingErrors,omitempty"`
8557 // ProcessingHints: A list of suggestions that may improve YouTube's ability to
8558 // process the video.
8559 //
8560 // Possible values:
8561 // "nonStreamableMov" - The MP4 file is not streamable, this will slow down
8562 // the processing. MOOV atom was not found at the beginning of the file.
8563 // "sendBestQualityVideo" - Probably a better quality version of the video
8564 // exists. The video has wide screen aspect ratio, but is not an HD video.
8565 // "sphericalVideo" - Uploaded video is spherical video.
8566 // "spatialAudio" - Uploaded video has spatial audio.
8567 // "vrVideo" - Uploaded video is VR video.
8568 // "hdrVideo" - Uploaded video is HDR video.
8569 ProcessingHints []string `json:"processingHints,omitempty"`
8570 // ProcessingWarnings: A list of reasons why YouTube may have difficulty
8571 // transcoding the uploaded video or that might result in an erroneous
8572 // transcoding. These warnings are generated before YouTube actually processes
8573 // the uploaded video file. In addition, they identify issues that are unlikely
8574 // to cause the video processing to fail but that might cause problems such as
8575 // sync issues, video artifacts, or a missing audio track.
8576 //
8577 // Possible values:
8578 // "unknownContainer" - Unrecognized file format, transcoding is likely to
8579 // fail.
8580 // "unknownVideoCodec" - Unrecognized video codec, transcoding is likely to
8581 // fail.
8582 // "unknownAudioCodec" - Unrecognized audio codec, transcoding is likely to
8583 // fail.
8584 // "inconsistentResolution" - Conflicting container and stream resolutions.
8585 // "hasEditlist" - Edit lists are not currently supported.
8586 // "problematicVideoCodec" - Video codec that is known to cause problems was
8587 // used.
8588 // "problematicAudioCodec" - Audio codec that is known to cause problems was
8589 // used.
8590 // "unsupportedVrStereoMode" - Unsupported VR video stereo mode.
8591 // "unsupportedSphericalProjectionType" - Unsupported spherical video
8592 // projection type.
8593 // "unsupportedHdrPixelFormat" - Unsupported HDR pixel format.
8594 // "unsupportedHdrColorMetadata" - Unspecified HDR color metadata.
8595 // "problematicHdrLookupTable" - Problematic HDR lookup table attached.
8596 ProcessingWarnings []string `json:"processingWarnings,omitempty"`
8597 // TagSuggestions: A list of keyword tags that could be added to the video's
8598 // metadata to increase the likelihood that users will locate your video when
8599 // searching or browsing on YouTube.
8600 TagSuggestions []*VideoSuggestionsTagSuggestion `json:"tagSuggestions,omitempty"`
8601 // ForceSendFields is a list of field names (e.g. "EditorSuggestions") to
8602 // unconditionally include in API requests. By default, fields with empty or
8603 // default values are omitted from API requests. See
8604 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8605 // details.
8606 ForceSendFields []string `json:"-"`
8607 // NullFields is a list of field names (e.g. "EditorSuggestions") to include in
8608 // API requests with the JSON null value. By default, fields with empty values
8609 // are omitted from API requests. See
8610 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8611 NullFields []string `json:"-"`
8612 }
8613
8614 func (s VideoSuggestions) MarshalJSON() ([]byte, error) {
8615 type NoMethod VideoSuggestions
8616 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8617 }
8618
8619 // VideoSuggestionsTagSuggestion: A single tag suggestion with its relevance
8620 // information.
8621 type VideoSuggestionsTagSuggestion struct {
8622 // CategoryRestricts: A set of video categories for which the tag is relevant.
8623 // You can use this information to display appropriate tag suggestions based on
8624 // the video category that the video uploader associates with the video. By
8625 // default, tag suggestions are relevant for all categories if there are no
8626 // restricts defined for the keyword.
8627 CategoryRestricts []string `json:"categoryRestricts,omitempty"`
8628 // Tag: The keyword tag suggested for the video.
8629 Tag string `json:"tag,omitempty"`
8630 // ForceSendFields is a list of field names (e.g. "CategoryRestricts") to
8631 // unconditionally include in API requests. By default, fields with empty or
8632 // default values are omitted from API requests. See
8633 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8634 // details.
8635 ForceSendFields []string `json:"-"`
8636 // NullFields is a list of field names (e.g. "CategoryRestricts") to include in
8637 // API requests with the JSON null value. By default, fields with empty values
8638 // are omitted from API requests. See
8639 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8640 NullFields []string `json:"-"`
8641 }
8642
8643 func (s VideoSuggestionsTagSuggestion) MarshalJSON() ([]byte, error) {
8644 type NoMethod VideoSuggestionsTagSuggestion
8645 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8646 }
8647
8648 // VideoTopicDetails: Freebase topic information related to the video.
8649 type VideoTopicDetails struct {
8650 // RelevantTopicIds: Similar to topic_id, except that these topics are merely
8651 // relevant to the video. These are topics that may be mentioned in, or appear
8652 // in the video. You can retrieve information about each topic using Freebase
8653 // Topic API.
8654 RelevantTopicIds []string `json:"relevantTopicIds,omitempty"`
8655 // TopicCategories: A list of Wikipedia URLs that provide a high-level
8656 // description of the video's content.
8657 TopicCategories []string `json:"topicCategories,omitempty"`
8658 // TopicIds: A list of Freebase topic IDs that are centrally associated with
8659 // the video. These are topics that are centrally featured in the video, and it
8660 // can be said that the video is mainly about each of these. You can retrieve
8661 // information about each topic using the < a
8662 // href="http://wiki.freebase.com/wiki/Topic_API">Freebase Topic API.
8663 TopicIds []string `json:"topicIds,omitempty"`
8664 // ForceSendFields is a list of field names (e.g. "RelevantTopicIds") to
8665 // unconditionally include in API requests. By default, fields with empty or
8666 // default values are omitted from API requests. See
8667 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8668 // details.
8669 ForceSendFields []string `json:"-"`
8670 // NullFields is a list of field names (e.g. "RelevantTopicIds") to include in
8671 // API requests with the JSON null value. By default, fields with empty values
8672 // are omitted from API requests. See
8673 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8674 NullFields []string `json:"-"`
8675 }
8676
8677 func (s VideoTopicDetails) MarshalJSON() ([]byte, error) {
8678 type NoMethod VideoTopicDetails
8679 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8680 }
8681
8682 // VideoTrainability: Specifies who is allowed to train on the video.
8683 type VideoTrainability struct {
8684 // Etag: Etag of this resource.
8685 Etag string `json:"etag,omitempty"`
8686 // Kind: Identifies what kind of resource this is. Value: the fixed string
8687 // "youtube#videoTrainability".
8688 Kind string `json:"kind,omitempty"`
8689 // Permitted: Specifies who is allowed to train on the video. Valid values are:
8690 // - a single string "all" - a single string "none" - a list of allowed parties
8691 Permitted []string `json:"permitted,omitempty"`
8692 // VideoId: The ID of the video.
8693 VideoId string `json:"videoId,omitempty"`
8694
8695 // ServerResponse contains the HTTP response code and headers from the server.
8696 googleapi.ServerResponse `json:"-"`
8697 // ForceSendFields is a list of field names (e.g. "Etag") to unconditionally
8698 // include in API requests. By default, fields with empty or default values are
8699 // omitted from API requests. See
8700 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8701 // details.
8702 ForceSendFields []string `json:"-"`
8703 // NullFields is a list of field names (e.g. "Etag") to include in API requests
8704 // with the JSON null value. By default, fields with empty values are omitted
8705 // from API requests. See
8706 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8707 NullFields []string `json:"-"`
8708 }
8709
8710 func (s VideoTrainability) MarshalJSON() ([]byte, error) {
8711 type NoMethod VideoTrainability
8712 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8713 }
8714
8715 // WatchSettings: Branding properties for the watch. All deprecated.
8716 type WatchSettings struct {
8717 // BackgroundColor: The text color for the video watch page's branded area.
8718 BackgroundColor string `json:"backgroundColor,omitempty"`
8719 // FeaturedPlaylistId: An ID that uniquely identifies a playlist that displays
8720 // next to the video player.
8721 FeaturedPlaylistId string `json:"featuredPlaylistId,omitempty"`
8722 // TextColor: The background color for the video watch page's branded area.
8723 TextColor string `json:"textColor,omitempty"`
8724 // ForceSendFields is a list of field names (e.g. "BackgroundColor") to
8725 // unconditionally include in API requests. By default, fields with empty or
8726 // default values are omitted from API requests. See
8727 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
8728 // details.
8729 ForceSendFields []string `json:"-"`
8730 // NullFields is a list of field names (e.g. "BackgroundColor") to include in
8731 // API requests with the JSON null value. By default, fields with empty values
8732 // are omitted from API requests. See
8733 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
8734 NullFields []string `json:"-"`
8735 }
8736
8737 func (s WatchSettings) MarshalJSON() ([]byte, error) {
8738 type NoMethod WatchSettings
8739 return gensupport.MarshalJSON(NoMethod(s), s.ForceSendFields, s.NullFields)
8740 }
8741
8742 type AbuseReportsInsertCall struct {
8743 s *Service
8744 abusereport *AbuseReport
8745 urlParams_ gensupport.URLParams
8746 ctx_ context.Context
8747 header_ http.Header
8748 }
8749
8750 // Insert: Inserts a new resource into this collection.
8751 //
8752 // - part: The *part* parameter serves two purposes in this operation. It
8753 // identifies the properties that the write operation will set as well as the
8754 // properties that the API response will include.
8755 func (r *AbuseReportsService) Insert(part []string, abusereport *AbuseReport) *AbuseReportsInsertCall {
8756 c := &AbuseReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8757 c.urlParams_.SetMulti("part", append([]string{}, part...))
8758 c.abusereport = abusereport
8759 return c
8760 }
8761
8762 // Fields allows partial responses to be retrieved. See
8763 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8764 // details.
8765 func (c *AbuseReportsInsertCall) Fields(s ...googleapi.Field) *AbuseReportsInsertCall {
8766 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8767 return c
8768 }
8769
8770 // Context sets the context to be used in this call's Do method.
8771 func (c *AbuseReportsInsertCall) Context(ctx context.Context) *AbuseReportsInsertCall {
8772 c.ctx_ = ctx
8773 return c
8774 }
8775
8776 // Header returns a http.Header that can be modified by the caller to add
8777 // headers to the request.
8778 func (c *AbuseReportsInsertCall) Header() http.Header {
8779 if c.header_ == nil {
8780 c.header_ = make(http.Header)
8781 }
8782 return c.header_
8783 }
8784
8785 func (c *AbuseReportsInsertCall) doRequest(alt string) (*http.Response, error) {
8786 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
8787 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.abusereport)
8788 if err != nil {
8789 return nil, err
8790 }
8791 c.urlParams_.Set("alt", alt)
8792 c.urlParams_.Set("prettyPrint", "false")
8793 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/abuseReports")
8794 urls += "?" + c.urlParams_.Encode()
8795 req, err := http.NewRequest("POST", urls, body)
8796 if err != nil {
8797 return nil, err
8798 }
8799 req.Header = reqHeaders
8800 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.abuseReports.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
8801 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8802 }
8803
8804 // Do executes the "youtube.abuseReports.insert" call.
8805 // Any non-2xx status code is an error. Response headers are in either
8806 // *AbuseReport.ServerResponse.Header or (if a response was returned at all) in
8807 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
8808 // whether the returned error was because http.StatusNotModified was returned.
8809 func (c *AbuseReportsInsertCall) Do(opts ...googleapi.CallOption) (*AbuseReport, error) {
8810 gensupport.SetOptions(c.urlParams_, opts...)
8811 res, err := c.doRequest("json")
8812 if res != nil && res.StatusCode == http.StatusNotModified {
8813 if res.Body != nil {
8814 res.Body.Close()
8815 }
8816 return nil, gensupport.WrapError(&googleapi.Error{
8817 Code: res.StatusCode,
8818 Header: res.Header,
8819 })
8820 }
8821 if err != nil {
8822 return nil, err
8823 }
8824 defer googleapi.CloseBody(res)
8825 if err := googleapi.CheckResponse(res); err != nil {
8826 return nil, gensupport.WrapError(err)
8827 }
8828 ret := &AbuseReport{
8829 ServerResponse: googleapi.ServerResponse{
8830 Header: res.Header,
8831 HTTPStatusCode: res.StatusCode,
8832 },
8833 }
8834 target := &ret
8835 b, err := gensupport.DecodeResponseBytes(target, res)
8836 if err != nil {
8837 return nil, err
8838 }
8839 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.abuseReports.insert", "response", internallog.HTTPResponse(res, b))
8840 return ret, nil
8841 }
8842
8843 type ActivitiesListCall struct {
8844 s *Service
8845 urlParams_ gensupport.URLParams
8846 ifNoneMatch_ string
8847 ctx_ context.Context
8848 header_ http.Header
8849 }
8850
8851 // List: Retrieves a list of resources, possibly filtered.
8852 //
8853 // - part: The *part* parameter specifies a comma-separated list of one or more
8854 // activity resource properties that the API response will include. If the
8855 // parameter identifies a property that contains child properties, the child
8856 // properties will be included in the response. For example, in an activity
8857 // resource, the snippet property contains other properties that identify the
8858 // type of activity, a display title for the activity, and so forth. If you
8859 // set *part=snippet*, the API response will also contain all of those nested
8860 // properties.
8861 func (r *ActivitiesService) List(part []string) *ActivitiesListCall {
8862 c := &ActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8863 c.urlParams_.SetMulti("part", append([]string{}, part...))
8864 return c
8865 }
8866
8867 // ChannelId sets the optional parameter "channelId":
8868 func (c *ActivitiesListCall) ChannelId(channelId string) *ActivitiesListCall {
8869 c.urlParams_.Set("channelId", channelId)
8870 return c
8871 }
8872
8873 // Home sets the optional parameter "home":
8874 func (c *ActivitiesListCall) Home(home bool) *ActivitiesListCall {
8875 c.urlParams_.Set("home", fmt.Sprint(home))
8876 return c
8877 }
8878
8879 // MaxResults sets the optional parameter "maxResults": The *maxResults*
8880 // parameter specifies the maximum number of items that should be returned in
8881 // the result set.
8882 func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall {
8883 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
8884 return c
8885 }
8886
8887 // Mine sets the optional parameter "mine":
8888 func (c *ActivitiesListCall) Mine(mine bool) *ActivitiesListCall {
8889 c.urlParams_.Set("mine", fmt.Sprint(mine))
8890 return c
8891 }
8892
8893 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
8894 // identifies a specific page in the result set that should be returned. In an
8895 // API response, the nextPageToken and prevPageToken properties identify other
8896 // pages that could be retrieved.
8897 func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall {
8898 c.urlParams_.Set("pageToken", pageToken)
8899 return c
8900 }
8901
8902 // PublishedAfter sets the optional parameter "publishedAfter":
8903 func (c *ActivitiesListCall) PublishedAfter(publishedAfter string) *ActivitiesListCall {
8904 c.urlParams_.Set("publishedAfter", publishedAfter)
8905 return c
8906 }
8907
8908 // PublishedBefore sets the optional parameter "publishedBefore":
8909 func (c *ActivitiesListCall) PublishedBefore(publishedBefore string) *ActivitiesListCall {
8910 c.urlParams_.Set("publishedBefore", publishedBefore)
8911 return c
8912 }
8913
8914 // RegionCode sets the optional parameter "regionCode":
8915 func (c *ActivitiesListCall) RegionCode(regionCode string) *ActivitiesListCall {
8916 c.urlParams_.Set("regionCode", regionCode)
8917 return c
8918 }
8919
8920 // Fields allows partial responses to be retrieved. See
8921 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
8922 // details.
8923 func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall {
8924 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8925 return c
8926 }
8927
8928 // IfNoneMatch sets an optional parameter which makes the operation fail if the
8929 // object's ETag matches the given value. This is useful for getting updates
8930 // only after the object has changed since the last request.
8931 func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall {
8932 c.ifNoneMatch_ = entityTag
8933 return c
8934 }
8935
8936 // Context sets the context to be used in this call's Do method.
8937 func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {
8938 c.ctx_ = ctx
8939 return c
8940 }
8941
8942 // Header returns a http.Header that can be modified by the caller to add
8943 // headers to the request.
8944 func (c *ActivitiesListCall) Header() http.Header {
8945 if c.header_ == nil {
8946 c.header_ = make(http.Header)
8947 }
8948 return c.header_
8949 }
8950
8951 func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) {
8952 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
8953 if c.ifNoneMatch_ != "" {
8954 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8955 }
8956 c.urlParams_.Set("alt", alt)
8957 c.urlParams_.Set("prettyPrint", "false")
8958 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/activities")
8959 urls += "?" + c.urlParams_.Encode()
8960 req, err := http.NewRequest("GET", urls, nil)
8961 if err != nil {
8962 return nil, err
8963 }
8964 req.Header = reqHeaders
8965 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.activities.list", "request", internallog.HTTPRequest(req, nil))
8966 return gensupport.SendRequest(c.ctx_, c.s.client, req)
8967 }
8968
8969 // Do executes the "youtube.activities.list" call.
8970 // Any non-2xx status code is an error. Response headers are in either
8971 // *ActivityListResponse.ServerResponse.Header or (if a response was returned
8972 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8973 // check whether the returned error was because http.StatusNotModified was
8974 // returned.
8975 func (c *ActivitiesListCall) Do(opts ...googleapi.CallOption) (*ActivityListResponse, error) {
8976 gensupport.SetOptions(c.urlParams_, opts...)
8977 res, err := c.doRequest("json")
8978 if res != nil && res.StatusCode == http.StatusNotModified {
8979 if res.Body != nil {
8980 res.Body.Close()
8981 }
8982 return nil, gensupport.WrapError(&googleapi.Error{
8983 Code: res.StatusCode,
8984 Header: res.Header,
8985 })
8986 }
8987 if err != nil {
8988 return nil, err
8989 }
8990 defer googleapi.CloseBody(res)
8991 if err := googleapi.CheckResponse(res); err != nil {
8992 return nil, gensupport.WrapError(err)
8993 }
8994 ret := &ActivityListResponse{
8995 ServerResponse: googleapi.ServerResponse{
8996 Header: res.Header,
8997 HTTPStatusCode: res.StatusCode,
8998 },
8999 }
9000 target := &ret
9001 b, err := gensupport.DecodeResponseBytes(target, res)
9002 if err != nil {
9003 return nil, err
9004 }
9005 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.activities.list", "response", internallog.HTTPResponse(res, b))
9006 return ret, nil
9007 }
9008
9009 // Pages invokes f for each page of results.
9010 // A non-nil error returned from f will halt the iteration.
9011 // The provided context supersedes any context provided to the Context method.
9012 func (c *ActivitiesListCall) Pages(ctx context.Context, f func(*ActivityListResponse) error) error {
9013 c.ctx_ = ctx
9014 defer c.PageToken(c.urlParams_.Get("pageToken"))
9015 for {
9016 x, err := c.Do()
9017 if err != nil {
9018 return err
9019 }
9020 if err := f(x); err != nil {
9021 return err
9022 }
9023 if x.NextPageToken == "" {
9024 return nil
9025 }
9026 c.PageToken(x.NextPageToken)
9027 }
9028 }
9029
9030 type CaptionsDeleteCall struct {
9031 s *Service
9032 urlParams_ gensupport.URLParams
9033 ctx_ context.Context
9034 header_ http.Header
9035 }
9036
9037 // Delete: Deletes a resource.
9038 //
9039 // - id: .
9040 func (r *CaptionsService) Delete(id string) *CaptionsDeleteCall {
9041 c := &CaptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9042 c.urlParams_.Set("id", id)
9043 return c
9044 }
9045
9046 // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the Google+ Page
9047 // for the channel that the request is be on behalf of
9048 func (c *CaptionsDeleteCall) OnBehalfOf(onBehalfOf string) *CaptionsDeleteCall {
9049 c.urlParams_.Set("onBehalfOf", onBehalfOf)
9050 return c
9051 }
9052
9053 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
9054 // *Note:* This parameter is intended exclusively for YouTube content partners.
9055 // The *onBehalfOfContentOwner* parameter indicates that the request's
9056 // authorization credentials identify a YouTube CMS user who is acting on
9057 // behalf of the content owner specified in the parameter value. This parameter
9058 // is intended for YouTube content partners that own and manage many different
9059 // YouTube channels. It allows content owners to authenticate once and get
9060 // access to all their video and channel data, without having to provide
9061 // authentication credentials for each individual channel. The actual CMS
9062 // account that the user authenticates with must be linked to the specified
9063 // YouTube content owner.
9064 func (c *CaptionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDeleteCall {
9065 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
9066 return c
9067 }
9068
9069 // Fields allows partial responses to be retrieved. See
9070 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9071 // details.
9072 func (c *CaptionsDeleteCall) Fields(s ...googleapi.Field) *CaptionsDeleteCall {
9073 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9074 return c
9075 }
9076
9077 // Context sets the context to be used in this call's Do method.
9078 func (c *CaptionsDeleteCall) Context(ctx context.Context) *CaptionsDeleteCall {
9079 c.ctx_ = ctx
9080 return c
9081 }
9082
9083 // Header returns a http.Header that can be modified by the caller to add
9084 // headers to the request.
9085 func (c *CaptionsDeleteCall) Header() http.Header {
9086 if c.header_ == nil {
9087 c.header_ = make(http.Header)
9088 }
9089 return c.header_
9090 }
9091
9092 func (c *CaptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9093 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9094 c.urlParams_.Set("alt", alt)
9095 c.urlParams_.Set("prettyPrint", "false")
9096 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions")
9097 urls += "?" + c.urlParams_.Encode()
9098 req, err := http.NewRequest("DELETE", urls, nil)
9099 if err != nil {
9100 return nil, err
9101 }
9102 req.Header = reqHeaders
9103 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.captions.delete", "request", internallog.HTTPRequest(req, nil))
9104 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9105 }
9106
9107 // Do executes the "youtube.captions.delete" call.
9108 func (c *CaptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
9109 gensupport.SetOptions(c.urlParams_, opts...)
9110 res, err := c.doRequest("json")
9111 if err != nil {
9112 return err
9113 }
9114 defer googleapi.CloseBody(res)
9115 if err := googleapi.CheckResponse(res); err != nil {
9116 return gensupport.WrapError(err)
9117 }
9118 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.captions.delete", "response", internallog.HTTPResponse(res, nil))
9119 return nil
9120 }
9121
9122 type CaptionsDownloadCall struct {
9123 s *Service
9124 id string
9125 urlParams_ gensupport.URLParams
9126 ifNoneMatch_ string
9127 ctx_ context.Context
9128 header_ http.Header
9129 }
9130
9131 // Download: Downloads a caption track.
9132 //
9133 // - id: The ID of the caption track to download, required for One Platform.
9134 func (r *CaptionsService) Download(id string) *CaptionsDownloadCall {
9135 c := &CaptionsDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9136 c.id = id
9137 return c
9138 }
9139
9140 // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the Google+ Page
9141 // for the channel that the request is be on behalf of
9142 func (c *CaptionsDownloadCall) OnBehalfOf(onBehalfOf string) *CaptionsDownloadCall {
9143 c.urlParams_.Set("onBehalfOf", onBehalfOf)
9144 return c
9145 }
9146
9147 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
9148 // *Note:* This parameter is intended exclusively for YouTube content partners.
9149 // The *onBehalfOfContentOwner* parameter indicates that the request's
9150 // authorization credentials identify a YouTube CMS user who is acting on
9151 // behalf of the content owner specified in the parameter value. This parameter
9152 // is intended for YouTube content partners that own and manage many different
9153 // YouTube channels. It allows content owners to authenticate once and get
9154 // access to all their video and channel data, without having to provide
9155 // authentication credentials for each individual channel. The actual CMS
9156 // account that the user authenticates with must be linked to the specified
9157 // YouTube content owner.
9158 func (c *CaptionsDownloadCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDownloadCall {
9159 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
9160 return c
9161 }
9162
9163 // Tfmt sets the optional parameter "tfmt": Convert the captions into this
9164 // format. Supported options are sbv, srt, and vtt.
9165 func (c *CaptionsDownloadCall) Tfmt(tfmt string) *CaptionsDownloadCall {
9166 c.urlParams_.Set("tfmt", tfmt)
9167 return c
9168 }
9169
9170 // Tlang sets the optional parameter "tlang": tlang is the language code;
9171 // machine translate the captions into this language.
9172 func (c *CaptionsDownloadCall) Tlang(tlang string) *CaptionsDownloadCall {
9173 c.urlParams_.Set("tlang", tlang)
9174 return c
9175 }
9176
9177 // Fields allows partial responses to be retrieved. See
9178 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9179 // details.
9180 func (c *CaptionsDownloadCall) Fields(s ...googleapi.Field) *CaptionsDownloadCall {
9181 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9182 return c
9183 }
9184
9185 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9186 // object's ETag matches the given value. This is useful for getting updates
9187 // only after the object has changed since the last request.
9188 func (c *CaptionsDownloadCall) IfNoneMatch(entityTag string) *CaptionsDownloadCall {
9189 c.ifNoneMatch_ = entityTag
9190 return c
9191 }
9192
9193 // Context sets the context to be used in this call's Do and Download methods.
9194 func (c *CaptionsDownloadCall) Context(ctx context.Context) *CaptionsDownloadCall {
9195 c.ctx_ = ctx
9196 return c
9197 }
9198
9199 // Header returns a http.Header that can be modified by the caller to add
9200 // headers to the request.
9201 func (c *CaptionsDownloadCall) Header() http.Header {
9202 if c.header_ == nil {
9203 c.header_ = make(http.Header)
9204 }
9205 return c.header_
9206 }
9207
9208 func (c *CaptionsDownloadCall) doRequest(alt string) (*http.Response, error) {
9209 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9210 if c.ifNoneMatch_ != "" {
9211 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9212 }
9213 c.urlParams_.Set("alt", alt)
9214 c.urlParams_.Set("prettyPrint", "false")
9215 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions/{id}")
9216 urls += "?" + c.urlParams_.Encode()
9217 req, err := http.NewRequest("GET", urls, nil)
9218 if err != nil {
9219 return nil, err
9220 }
9221 req.Header = reqHeaders
9222 googleapi.Expand(req.URL, map[string]string{
9223 "id": c.id,
9224 })
9225 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.captions.download", "request", internallog.HTTPRequest(req, nil))
9226 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9227 }
9228
9229 // Download fetches the API endpoint's "media" value, instead of the normal
9230 // API response value. If the returned error is nil, the Response is guaranteed to
9231 // have a 2xx status code. Callers must close the Response.Body as usual.
9232 func (c *CaptionsDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
9233 gensupport.SetOptions(c.urlParams_, opts...)
9234 res, err := c.doRequest("media")
9235 if err != nil {
9236 return nil, err
9237 }
9238 if err := googleapi.CheckResponse(res); err != nil {
9239 res.Body.Close()
9240 return nil, gensupport.WrapError(err)
9241 }
9242 return res, nil
9243 }
9244
9245 // Do executes the "youtube.captions.download" call.
9246 func (c *CaptionsDownloadCall) Do(opts ...googleapi.CallOption) error {
9247 gensupport.SetOptions(c.urlParams_, opts...)
9248 res, err := c.doRequest("json")
9249 if err != nil {
9250 return err
9251 }
9252 defer googleapi.CloseBody(res)
9253 if err := googleapi.CheckResponse(res); err != nil {
9254 return gensupport.WrapError(err)
9255 }
9256 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.captions.download", "response", internallog.HTTPResponse(res, nil))
9257 return nil
9258 }
9259
9260 type CaptionsInsertCall struct {
9261 s *Service
9262 caption *Caption
9263 urlParams_ gensupport.URLParams
9264 mediaInfo_ *gensupport.MediaInfo
9265 ctx_ context.Context
9266 header_ http.Header
9267 }
9268
9269 // Insert: Inserts a new resource into this collection.
9270 //
9271 // - part: The *part* parameter specifies the caption resource parts that the
9272 // API response will include. Set the parameter value to snippet.
9273 func (r *CaptionsService) Insert(part []string, caption *Caption) *CaptionsInsertCall {
9274 c := &CaptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9275 c.urlParams_.SetMulti("part", append([]string{}, part...))
9276 c.caption = caption
9277 return c
9278 }
9279
9280 // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the Google+ Page
9281 // for the channel that the request is be on behalf of
9282 func (c *CaptionsInsertCall) OnBehalfOf(onBehalfOf string) *CaptionsInsertCall {
9283 c.urlParams_.Set("onBehalfOf", onBehalfOf)
9284 return c
9285 }
9286
9287 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
9288 // *Note:* This parameter is intended exclusively for YouTube content partners.
9289 // The *onBehalfOfContentOwner* parameter indicates that the request's
9290 // authorization credentials identify a YouTube CMS user who is acting on
9291 // behalf of the content owner specified in the parameter value. This parameter
9292 // is intended for YouTube content partners that own and manage many different
9293 // YouTube channels. It allows content owners to authenticate once and get
9294 // access to all their video and channel data, without having to provide
9295 // authentication credentials for each individual channel. The actual CMS
9296 // account that the user authenticates with must be linked to the specified
9297 // YouTube content owner.
9298 func (c *CaptionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsInsertCall {
9299 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
9300 return c
9301 }
9302
9303 // Sync sets the optional parameter "sync": Extra parameter to allow
9304 // automatically syncing the uploaded caption/transcript with the audio.
9305 func (c *CaptionsInsertCall) Sync(sync bool) *CaptionsInsertCall {
9306 c.urlParams_.Set("sync", fmt.Sprint(sync))
9307 return c
9308 }
9309
9310 // Media specifies the media to upload in one or more chunks. The chunk size
9311 // may be controlled by supplying a MediaOption generated by
9312 // googleapi.ChunkSize. The chunk size defaults to
9313 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
9314 // request will be determined by sniffing the contents of r, unless a
9315 // MediaOption generated by googleapi.ContentType is supplied.
9316 // At most one of Media and ResumableMedia may be set.
9317 func (c *CaptionsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsInsertCall {
9318 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9319 return c
9320 }
9321
9322 // ResumableMedia specifies the media to upload in chunks and can be canceled
9323 // with ctx.
9324 //
9325 // Deprecated: use Media instead.
9326 //
9327 // At most one of Media and ResumableMedia may be set. mediaType identifies the
9328 // MIME media type of the upload, such as "image/png". If mediaType is "", it
9329 // will be auto-detected. The provided ctx will supersede any context
9330 // previously provided to the Context method.
9331 func (c *CaptionsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsInsertCall {
9332 c.ctx_ = ctx
9333 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9334 return c
9335 }
9336
9337 // ProgressUpdater provides a callback function that will be called after every
9338 // chunk. It should be a low-latency function in order to not slow down the
9339 // upload operation. This should only be called when using ResumableMedia (as
9340 // opposed to Media).
9341 func (c *CaptionsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsInsertCall {
9342 c.mediaInfo_.SetProgressUpdater(pu)
9343 return c
9344 }
9345
9346 // Fields allows partial responses to be retrieved. See
9347 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9348 // details.
9349 func (c *CaptionsInsertCall) Fields(s ...googleapi.Field) *CaptionsInsertCall {
9350 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9351 return c
9352 }
9353
9354 // Context sets the context to be used in this call's Do method.
9355 // This context will supersede any context previously provided to the
9356 // ResumableMedia method.
9357 func (c *CaptionsInsertCall) Context(ctx context.Context) *CaptionsInsertCall {
9358 c.ctx_ = ctx
9359 return c
9360 }
9361
9362 // Header returns a http.Header that can be modified by the caller to add
9363 // headers to the request.
9364 func (c *CaptionsInsertCall) Header() http.Header {
9365 if c.header_ == nil {
9366 c.header_ = make(http.Header)
9367 }
9368 return c.header_
9369 }
9370
9371 func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) {
9372 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9373 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.caption)
9374 if err != nil {
9375 return nil, err
9376 }
9377 c.urlParams_.Set("alt", alt)
9378 c.urlParams_.Set("prettyPrint", "false")
9379 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions")
9380 if c.mediaInfo_ != nil {
9381 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/captions")
9382 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
9383 }
9384 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9385 defer cleanup()
9386 urls += "?" + c.urlParams_.Encode()
9387 req, err := http.NewRequest("POST", urls, newBody)
9388 if err != nil {
9389 return nil, err
9390 }
9391 req.Header = reqHeaders
9392 req.GetBody = getBody
9393 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.captions.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
9394 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9395 }
9396
9397 // Do executes the "youtube.captions.insert" call.
9398 // Any non-2xx status code is an error. Response headers are in either
9399 // *Caption.ServerResponse.Header or (if a response was returned at all) in
9400 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9401 // whether the returned error was because http.StatusNotModified was returned.
9402 func (c *CaptionsInsertCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
9403 gensupport.SetOptions(c.urlParams_, opts...)
9404 res, err := c.doRequest("json")
9405 if res != nil && res.StatusCode == http.StatusNotModified {
9406 if res.Body != nil {
9407 res.Body.Close()
9408 }
9409 return nil, gensupport.WrapError(&googleapi.Error{
9410 Code: res.StatusCode,
9411 Header: res.Header,
9412 })
9413 }
9414 if err != nil {
9415 return nil, err
9416 }
9417 defer googleapi.CloseBody(res)
9418 if err := googleapi.CheckResponse(res); err != nil {
9419 return nil, gensupport.WrapError(err)
9420 }
9421 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9422 if rx != nil {
9423 rx.Client = c.s.client
9424 rx.UserAgent = c.s.userAgent()
9425 ctx := c.ctx_
9426 if ctx == nil {
9427 ctx = context.TODO()
9428 }
9429 res, err = rx.Upload(ctx)
9430 if err != nil {
9431 return nil, err
9432 }
9433 defer res.Body.Close()
9434 if err := googleapi.CheckResponse(res); err != nil {
9435 return nil, gensupport.WrapError(err)
9436 }
9437 }
9438 ret := &Caption{
9439 ServerResponse: googleapi.ServerResponse{
9440 Header: res.Header,
9441 HTTPStatusCode: res.StatusCode,
9442 },
9443 }
9444 target := &ret
9445 b, err := gensupport.DecodeResponseBytes(target, res)
9446 if err != nil {
9447 return nil, err
9448 }
9449 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.captions.insert", "response", internallog.HTTPResponse(res, b))
9450 return ret, nil
9451 }
9452
9453 type CaptionsListCall struct {
9454 s *Service
9455 urlParams_ gensupport.URLParams
9456 ifNoneMatch_ string
9457 ctx_ context.Context
9458 header_ http.Header
9459 }
9460
9461 // List: Retrieves a list of resources, possibly filtered.
9462 //
9463 // - part: The *part* parameter specifies a comma-separated list of one or more
9464 // caption resource parts that the API response will include. The part names
9465 // that you can include in the parameter value are id and snippet.
9466 // - videoId: Returns the captions for the specified video.
9467 func (r *CaptionsService) List(part []string, videoId string) *CaptionsListCall {
9468 c := &CaptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9469 c.urlParams_.SetMulti("part", append([]string{}, part...))
9470 c.urlParams_.Set("videoId", videoId)
9471 return c
9472 }
9473
9474 // Id sets the optional parameter "id": Returns the captions with the given IDs
9475 // for Stubby or Apiary.
9476 func (c *CaptionsListCall) Id(id ...string) *CaptionsListCall {
9477 c.urlParams_.SetMulti("id", append([]string{}, id...))
9478 return c
9479 }
9480
9481 // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the Google+ Page
9482 // for the channel that the request is on behalf of.
9483 func (c *CaptionsListCall) OnBehalfOf(onBehalfOf string) *CaptionsListCall {
9484 c.urlParams_.Set("onBehalfOf", onBehalfOf)
9485 return c
9486 }
9487
9488 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
9489 // *Note:* This parameter is intended exclusively for YouTube content partners.
9490 // The *onBehalfOfContentOwner* parameter indicates that the request's
9491 // authorization credentials identify a YouTube CMS user who is acting on
9492 // behalf of the content owner specified in the parameter value. This parameter
9493 // is intended for YouTube content partners that own and manage many different
9494 // YouTube channels. It allows content owners to authenticate once and get
9495 // access to all their video and channel data, without having to provide
9496 // authentication credentials for each individual channel. The actual CMS
9497 // account that the user authenticates with must be linked to the specified
9498 // YouTube content owner.
9499 func (c *CaptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsListCall {
9500 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
9501 return c
9502 }
9503
9504 // Fields allows partial responses to be retrieved. See
9505 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9506 // details.
9507 func (c *CaptionsListCall) Fields(s ...googleapi.Field) *CaptionsListCall {
9508 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9509 return c
9510 }
9511
9512 // IfNoneMatch sets an optional parameter which makes the operation fail if the
9513 // object's ETag matches the given value. This is useful for getting updates
9514 // only after the object has changed since the last request.
9515 func (c *CaptionsListCall) IfNoneMatch(entityTag string) *CaptionsListCall {
9516 c.ifNoneMatch_ = entityTag
9517 return c
9518 }
9519
9520 // Context sets the context to be used in this call's Do method.
9521 func (c *CaptionsListCall) Context(ctx context.Context) *CaptionsListCall {
9522 c.ctx_ = ctx
9523 return c
9524 }
9525
9526 // Header returns a http.Header that can be modified by the caller to add
9527 // headers to the request.
9528 func (c *CaptionsListCall) Header() http.Header {
9529 if c.header_ == nil {
9530 c.header_ = make(http.Header)
9531 }
9532 return c.header_
9533 }
9534
9535 func (c *CaptionsListCall) doRequest(alt string) (*http.Response, error) {
9536 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
9537 if c.ifNoneMatch_ != "" {
9538 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9539 }
9540 c.urlParams_.Set("alt", alt)
9541 c.urlParams_.Set("prettyPrint", "false")
9542 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions")
9543 urls += "?" + c.urlParams_.Encode()
9544 req, err := http.NewRequest("GET", urls, nil)
9545 if err != nil {
9546 return nil, err
9547 }
9548 req.Header = reqHeaders
9549 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.captions.list", "request", internallog.HTTPRequest(req, nil))
9550 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9551 }
9552
9553 // Do executes the "youtube.captions.list" call.
9554 // Any non-2xx status code is an error. Response headers are in either
9555 // *CaptionListResponse.ServerResponse.Header or (if a response was returned at
9556 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9557 // check whether the returned error was because http.StatusNotModified was
9558 // returned.
9559 func (c *CaptionsListCall) Do(opts ...googleapi.CallOption) (*CaptionListResponse, error) {
9560 gensupport.SetOptions(c.urlParams_, opts...)
9561 res, err := c.doRequest("json")
9562 if res != nil && res.StatusCode == http.StatusNotModified {
9563 if res.Body != nil {
9564 res.Body.Close()
9565 }
9566 return nil, gensupport.WrapError(&googleapi.Error{
9567 Code: res.StatusCode,
9568 Header: res.Header,
9569 })
9570 }
9571 if err != nil {
9572 return nil, err
9573 }
9574 defer googleapi.CloseBody(res)
9575 if err := googleapi.CheckResponse(res); err != nil {
9576 return nil, gensupport.WrapError(err)
9577 }
9578 ret := &CaptionListResponse{
9579 ServerResponse: googleapi.ServerResponse{
9580 Header: res.Header,
9581 HTTPStatusCode: res.StatusCode,
9582 },
9583 }
9584 target := &ret
9585 b, err := gensupport.DecodeResponseBytes(target, res)
9586 if err != nil {
9587 return nil, err
9588 }
9589 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.captions.list", "response", internallog.HTTPResponse(res, b))
9590 return ret, nil
9591 }
9592
9593 type CaptionsUpdateCall struct {
9594 s *Service
9595 caption *Caption
9596 urlParams_ gensupport.URLParams
9597 mediaInfo_ *gensupport.MediaInfo
9598 ctx_ context.Context
9599 header_ http.Header
9600 }
9601
9602 // Update: Updates an existing resource.
9603 //
9604 // - part: The *part* parameter specifies a comma-separated list of one or more
9605 // caption resource parts that the API response will include. The part names
9606 // that you can include in the parameter value are id and snippet.
9607 func (r *CaptionsService) Update(part []string, caption *Caption) *CaptionsUpdateCall {
9608 c := &CaptionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9609 c.urlParams_.SetMulti("part", append([]string{}, part...))
9610 c.caption = caption
9611 return c
9612 }
9613
9614 // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the Google+ Page
9615 // for the channel that the request is on behalf of.
9616 func (c *CaptionsUpdateCall) OnBehalfOf(onBehalfOf string) *CaptionsUpdateCall {
9617 c.urlParams_.Set("onBehalfOf", onBehalfOf)
9618 return c
9619 }
9620
9621 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
9622 // *Note:* This parameter is intended exclusively for YouTube content partners.
9623 // The *onBehalfOfContentOwner* parameter indicates that the request's
9624 // authorization credentials identify a YouTube CMS user who is acting on
9625 // behalf of the content owner specified in the parameter value. This parameter
9626 // is intended for YouTube content partners that own and manage many different
9627 // YouTube channels. It allows content owners to authenticate once and get
9628 // access to all their video and channel data, without having to provide
9629 // authentication credentials for each individual channel. The actual CMS
9630 // account that the user authenticates with must be linked to the specified
9631 // YouTube content owner.
9632 func (c *CaptionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsUpdateCall {
9633 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
9634 return c
9635 }
9636
9637 // Sync sets the optional parameter "sync": Extra parameter to allow
9638 // automatically syncing the uploaded caption/transcript with the audio.
9639 func (c *CaptionsUpdateCall) Sync(sync bool) *CaptionsUpdateCall {
9640 c.urlParams_.Set("sync", fmt.Sprint(sync))
9641 return c
9642 }
9643
9644 // Media specifies the media to upload in one or more chunks. The chunk size
9645 // may be controlled by supplying a MediaOption generated by
9646 // googleapi.ChunkSize. The chunk size defaults to
9647 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
9648 // request will be determined by sniffing the contents of r, unless a
9649 // MediaOption generated by googleapi.ContentType is supplied.
9650 // At most one of Media and ResumableMedia may be set.
9651 func (c *CaptionsUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsUpdateCall {
9652 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9653 return c
9654 }
9655
9656 // ResumableMedia specifies the media to upload in chunks and can be canceled
9657 // with ctx.
9658 //
9659 // Deprecated: use Media instead.
9660 //
9661 // At most one of Media and ResumableMedia may be set. mediaType identifies the
9662 // MIME media type of the upload, such as "image/png". If mediaType is "", it
9663 // will be auto-detected. The provided ctx will supersede any context
9664 // previously provided to the Context method.
9665 func (c *CaptionsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsUpdateCall {
9666 c.ctx_ = ctx
9667 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9668 return c
9669 }
9670
9671 // ProgressUpdater provides a callback function that will be called after every
9672 // chunk. It should be a low-latency function in order to not slow down the
9673 // upload operation. This should only be called when using ResumableMedia (as
9674 // opposed to Media).
9675 func (c *CaptionsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsUpdateCall {
9676 c.mediaInfo_.SetProgressUpdater(pu)
9677 return c
9678 }
9679
9680 // Fields allows partial responses to be retrieved. See
9681 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9682 // details.
9683 func (c *CaptionsUpdateCall) Fields(s ...googleapi.Field) *CaptionsUpdateCall {
9684 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9685 return c
9686 }
9687
9688 // Context sets the context to be used in this call's Do method.
9689 // This context will supersede any context previously provided to the
9690 // ResumableMedia method.
9691 func (c *CaptionsUpdateCall) Context(ctx context.Context) *CaptionsUpdateCall {
9692 c.ctx_ = ctx
9693 return c
9694 }
9695
9696 // Header returns a http.Header that can be modified by the caller to add
9697 // headers to the request.
9698 func (c *CaptionsUpdateCall) Header() http.Header {
9699 if c.header_ == nil {
9700 c.header_ = make(http.Header)
9701 }
9702 return c.header_
9703 }
9704
9705 func (c *CaptionsUpdateCall) doRequest(alt string) (*http.Response, error) {
9706 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9707 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.caption)
9708 if err != nil {
9709 return nil, err
9710 }
9711 c.urlParams_.Set("alt", alt)
9712 c.urlParams_.Set("prettyPrint", "false")
9713 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/captions")
9714 if c.mediaInfo_ != nil {
9715 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/captions")
9716 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
9717 }
9718 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9719 defer cleanup()
9720 urls += "?" + c.urlParams_.Encode()
9721 req, err := http.NewRequest("PUT", urls, newBody)
9722 if err != nil {
9723 return nil, err
9724 }
9725 req.Header = reqHeaders
9726 req.GetBody = getBody
9727 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.captions.update", "request", internallog.HTTPRequest(req, body.Bytes()))
9728 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9729 }
9730
9731 // Do executes the "youtube.captions.update" call.
9732 // Any non-2xx status code is an error. Response headers are in either
9733 // *Caption.ServerResponse.Header or (if a response was returned at all) in
9734 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
9735 // whether the returned error was because http.StatusNotModified was returned.
9736 func (c *CaptionsUpdateCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
9737 gensupport.SetOptions(c.urlParams_, opts...)
9738 res, err := c.doRequest("json")
9739 if res != nil && res.StatusCode == http.StatusNotModified {
9740 if res.Body != nil {
9741 res.Body.Close()
9742 }
9743 return nil, gensupport.WrapError(&googleapi.Error{
9744 Code: res.StatusCode,
9745 Header: res.Header,
9746 })
9747 }
9748 if err != nil {
9749 return nil, err
9750 }
9751 defer googleapi.CloseBody(res)
9752 if err := googleapi.CheckResponse(res); err != nil {
9753 return nil, gensupport.WrapError(err)
9754 }
9755 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9756 if rx != nil {
9757 rx.Client = c.s.client
9758 rx.UserAgent = c.s.userAgent()
9759 ctx := c.ctx_
9760 if ctx == nil {
9761 ctx = context.TODO()
9762 }
9763 res, err = rx.Upload(ctx)
9764 if err != nil {
9765 return nil, err
9766 }
9767 defer res.Body.Close()
9768 if err := googleapi.CheckResponse(res); err != nil {
9769 return nil, gensupport.WrapError(err)
9770 }
9771 }
9772 ret := &Caption{
9773 ServerResponse: googleapi.ServerResponse{
9774 Header: res.Header,
9775 HTTPStatusCode: res.StatusCode,
9776 },
9777 }
9778 target := &ret
9779 b, err := gensupport.DecodeResponseBytes(target, res)
9780 if err != nil {
9781 return nil, err
9782 }
9783 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.captions.update", "response", internallog.HTTPResponse(res, b))
9784 return ret, nil
9785 }
9786
9787 type ChannelBannersInsertCall struct {
9788 s *Service
9789 channelbannerresource *ChannelBannerResource
9790 urlParams_ gensupport.URLParams
9791 mediaInfo_ *gensupport.MediaInfo
9792 ctx_ context.Context
9793 header_ http.Header
9794 }
9795
9796 // Insert: Inserts a new resource into this collection.
9797 func (r *ChannelBannersService) Insert(channelbannerresource *ChannelBannerResource) *ChannelBannersInsertCall {
9798 c := &ChannelBannersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9799 c.channelbannerresource = channelbannerresource
9800 return c
9801 }
9802
9803 // ChannelId sets the optional parameter "channelId": Unused, channel_id is
9804 // currently derived from the security context of the requestor.
9805 func (c *ChannelBannersInsertCall) ChannelId(channelId string) *ChannelBannersInsertCall {
9806 c.urlParams_.Set("channelId", channelId)
9807 return c
9808 }
9809
9810 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
9811 // *Note:* This parameter is intended exclusively for YouTube content partners.
9812 // The *onBehalfOfContentOwner* parameter indicates that the request's
9813 // authorization credentials identify a YouTube CMS user who is acting on
9814 // behalf of the content owner specified in the parameter value. This parameter
9815 // is intended for YouTube content partners that own and manage many different
9816 // YouTube channels. It allows content owners to authenticate once and get
9817 // access to all their video and channel data, without having to provide
9818 // authentication credentials for each individual channel. The actual CMS
9819 // account that the user authenticates with must be linked to the specified
9820 // YouTube content owner.
9821 func (c *ChannelBannersInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelBannersInsertCall {
9822 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
9823 return c
9824 }
9825
9826 // OnBehalfOfContentOwnerChannel sets the optional parameter
9827 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
9828 // properly authorized request. *Note:* This parameter is intended exclusively
9829 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
9830 // specifies the YouTube channel ID of the channel to which a video is being
9831 // added. This parameter is required when a request specifies a value for the
9832 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
9833 // with that parameter. In addition, the request must be authorized using a CMS
9834 // account that is linked to the content owner that the onBehalfOfContentOwner
9835 // parameter specifies. Finally, the channel that the
9836 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
9837 // the content owner that the onBehalfOfContentOwner parameter specifies. This
9838 // parameter is intended for YouTube content partners that own and manage many
9839 // different YouTube channels. It allows content owners to authenticate once
9840 // and perform actions on behalf of the channel specified in the parameter
9841 // value, without having to provide authentication credentials for each
9842 // separate channel.
9843 func (c *ChannelBannersInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *ChannelBannersInsertCall {
9844 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
9845 return c
9846 }
9847
9848 // Media specifies the media to upload in one or more chunks. The chunk size
9849 // may be controlled by supplying a MediaOption generated by
9850 // googleapi.ChunkSize. The chunk size defaults to
9851 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
9852 // request will be determined by sniffing the contents of r, unless a
9853 // MediaOption generated by googleapi.ContentType is supplied.
9854 // At most one of Media and ResumableMedia may be set.
9855 func (c *ChannelBannersInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ChannelBannersInsertCall {
9856 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
9857 return c
9858 }
9859
9860 // ResumableMedia specifies the media to upload in chunks and can be canceled
9861 // with ctx.
9862 //
9863 // Deprecated: use Media instead.
9864 //
9865 // At most one of Media and ResumableMedia may be set. mediaType identifies the
9866 // MIME media type of the upload, such as "image/png". If mediaType is "", it
9867 // will be auto-detected. The provided ctx will supersede any context
9868 // previously provided to the Context method.
9869 func (c *ChannelBannersInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ChannelBannersInsertCall {
9870 c.ctx_ = ctx
9871 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
9872 return c
9873 }
9874
9875 // ProgressUpdater provides a callback function that will be called after every
9876 // chunk. It should be a low-latency function in order to not slow down the
9877 // upload operation. This should only be called when using ResumableMedia (as
9878 // opposed to Media).
9879 func (c *ChannelBannersInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ChannelBannersInsertCall {
9880 c.mediaInfo_.SetProgressUpdater(pu)
9881 return c
9882 }
9883
9884 // Fields allows partial responses to be retrieved. See
9885 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
9886 // details.
9887 func (c *ChannelBannersInsertCall) Fields(s ...googleapi.Field) *ChannelBannersInsertCall {
9888 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9889 return c
9890 }
9891
9892 // Context sets the context to be used in this call's Do method.
9893 // This context will supersede any context previously provided to the
9894 // ResumableMedia method.
9895 func (c *ChannelBannersInsertCall) Context(ctx context.Context) *ChannelBannersInsertCall {
9896 c.ctx_ = ctx
9897 return c
9898 }
9899
9900 // Header returns a http.Header that can be modified by the caller to add
9901 // headers to the request.
9902 func (c *ChannelBannersInsertCall) Header() http.Header {
9903 if c.header_ == nil {
9904 c.header_ = make(http.Header)
9905 }
9906 return c.header_
9907 }
9908
9909 func (c *ChannelBannersInsertCall) doRequest(alt string) (*http.Response, error) {
9910 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
9911 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelbannerresource)
9912 if err != nil {
9913 return nil, err
9914 }
9915 c.urlParams_.Set("alt", alt)
9916 c.urlParams_.Set("prettyPrint", "false")
9917 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelBanners/insert")
9918 if c.mediaInfo_ != nil {
9919 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/channelBanners/insert")
9920 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
9921 }
9922 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
9923 defer cleanup()
9924 urls += "?" + c.urlParams_.Encode()
9925 req, err := http.NewRequest("POST", urls, newBody)
9926 if err != nil {
9927 return nil, err
9928 }
9929 req.Header = reqHeaders
9930 req.GetBody = getBody
9931 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channelBanners.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
9932 return gensupport.SendRequest(c.ctx_, c.s.client, req)
9933 }
9934
9935 // Do executes the "youtube.channelBanners.insert" call.
9936 // Any non-2xx status code is an error. Response headers are in either
9937 // *ChannelBannerResource.ServerResponse.Header or (if a response was returned
9938 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9939 // check whether the returned error was because http.StatusNotModified was
9940 // returned.
9941 func (c *ChannelBannersInsertCall) Do(opts ...googleapi.CallOption) (*ChannelBannerResource, error) {
9942 gensupport.SetOptions(c.urlParams_, opts...)
9943 res, err := c.doRequest("json")
9944 if res != nil && res.StatusCode == http.StatusNotModified {
9945 if res.Body != nil {
9946 res.Body.Close()
9947 }
9948 return nil, gensupport.WrapError(&googleapi.Error{
9949 Code: res.StatusCode,
9950 Header: res.Header,
9951 })
9952 }
9953 if err != nil {
9954 return nil, err
9955 }
9956 defer googleapi.CloseBody(res)
9957 if err := googleapi.CheckResponse(res); err != nil {
9958 return nil, gensupport.WrapError(err)
9959 }
9960 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
9961 if rx != nil {
9962 rx.Client = c.s.client
9963 rx.UserAgent = c.s.userAgent()
9964 ctx := c.ctx_
9965 if ctx == nil {
9966 ctx = context.TODO()
9967 }
9968 res, err = rx.Upload(ctx)
9969 if err != nil {
9970 return nil, err
9971 }
9972 defer res.Body.Close()
9973 if err := googleapi.CheckResponse(res); err != nil {
9974 return nil, gensupport.WrapError(err)
9975 }
9976 }
9977 ret := &ChannelBannerResource{
9978 ServerResponse: googleapi.ServerResponse{
9979 Header: res.Header,
9980 HTTPStatusCode: res.StatusCode,
9981 },
9982 }
9983 target := &ret
9984 b, err := gensupport.DecodeResponseBytes(target, res)
9985 if err != nil {
9986 return nil, err
9987 }
9988 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channelBanners.insert", "response", internallog.HTTPResponse(res, b))
9989 return ret, nil
9990 }
9991
9992 type ChannelSectionsDeleteCall struct {
9993 s *Service
9994 urlParams_ gensupport.URLParams
9995 ctx_ context.Context
9996 header_ http.Header
9997 }
9998
9999 // Delete: Deletes a resource.
10000 //
10001 // - id: .
10002 func (r *ChannelSectionsService) Delete(id string) *ChannelSectionsDeleteCall {
10003 c := &ChannelSectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10004 c.urlParams_.Set("id", id)
10005 return c
10006 }
10007
10008 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
10009 // *Note:* This parameter is intended exclusively for YouTube content partners.
10010 // The *onBehalfOfContentOwner* parameter indicates that the request's
10011 // authorization credentials identify a YouTube CMS user who is acting on
10012 // behalf of the content owner specified in the parameter value. This parameter
10013 // is intended for YouTube content partners that own and manage many different
10014 // YouTube channels. It allows content owners to authenticate once and get
10015 // access to all their video and channel data, without having to provide
10016 // authentication credentials for each individual channel. The CMS account that
10017 // the user authenticates with must be linked to the specified YouTube content
10018 // owner.
10019 func (c *ChannelSectionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsDeleteCall {
10020 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
10021 return c
10022 }
10023
10024 // Fields allows partial responses to be retrieved. See
10025 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10026 // details.
10027 func (c *ChannelSectionsDeleteCall) Fields(s ...googleapi.Field) *ChannelSectionsDeleteCall {
10028 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10029 return c
10030 }
10031
10032 // Context sets the context to be used in this call's Do method.
10033 func (c *ChannelSectionsDeleteCall) Context(ctx context.Context) *ChannelSectionsDeleteCall {
10034 c.ctx_ = ctx
10035 return c
10036 }
10037
10038 // Header returns a http.Header that can be modified by the caller to add
10039 // headers to the request.
10040 func (c *ChannelSectionsDeleteCall) Header() http.Header {
10041 if c.header_ == nil {
10042 c.header_ = make(http.Header)
10043 }
10044 return c.header_
10045 }
10046
10047 func (c *ChannelSectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
10048 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10049 c.urlParams_.Set("alt", alt)
10050 c.urlParams_.Set("prettyPrint", "false")
10051 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelSections")
10052 urls += "?" + c.urlParams_.Encode()
10053 req, err := http.NewRequest("DELETE", urls, nil)
10054 if err != nil {
10055 return nil, err
10056 }
10057 req.Header = reqHeaders
10058 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channelSections.delete", "request", internallog.HTTPRequest(req, nil))
10059 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10060 }
10061
10062 // Do executes the "youtube.channelSections.delete" call.
10063 func (c *ChannelSectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
10064 gensupport.SetOptions(c.urlParams_, opts...)
10065 res, err := c.doRequest("json")
10066 if err != nil {
10067 return err
10068 }
10069 defer googleapi.CloseBody(res)
10070 if err := googleapi.CheckResponse(res); err != nil {
10071 return gensupport.WrapError(err)
10072 }
10073 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channelSections.delete", "response", internallog.HTTPResponse(res, nil))
10074 return nil
10075 }
10076
10077 type ChannelSectionsInsertCall struct {
10078 s *Service
10079 channelsection *ChannelSection
10080 urlParams_ gensupport.URLParams
10081 ctx_ context.Context
10082 header_ http.Header
10083 }
10084
10085 // Insert: Inserts a new resource into this collection.
10086 //
10087 // - part: The *part* parameter serves two purposes in this operation. It
10088 // identifies the properties that the write operation will set as well as the
10089 // properties that the API response will include. The part names that you can
10090 // include in the parameter value are snippet and contentDetails.
10091 func (r *ChannelSectionsService) Insert(part []string, channelsection *ChannelSection) *ChannelSectionsInsertCall {
10092 c := &ChannelSectionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10093 c.urlParams_.SetMulti("part", append([]string{}, part...))
10094 c.channelsection = channelsection
10095 return c
10096 }
10097
10098 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
10099 // *Note:* This parameter is intended exclusively for YouTube content partners.
10100 // The *onBehalfOfContentOwner* parameter indicates that the request's
10101 // authorization credentials identify a YouTube CMS user who is acting on
10102 // behalf of the content owner specified in the parameter value. This parameter
10103 // is intended for YouTube content partners that own and manage many different
10104 // YouTube channels. It allows content owners to authenticate once and get
10105 // access to all their video and channel data, without having to provide
10106 // authentication credentials for each individual channel. The CMS account that
10107 // the user authenticates with must be linked to the specified YouTube content
10108 // owner.
10109 func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsInsertCall {
10110 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
10111 return c
10112 }
10113
10114 // OnBehalfOfContentOwnerChannel sets the optional parameter
10115 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
10116 // properly authorized request. *Note:* This parameter is intended exclusively
10117 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
10118 // specifies the YouTube channel ID of the channel to which a video is being
10119 // added. This parameter is required when a request specifies a value for the
10120 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
10121 // with that parameter. In addition, the request must be authorized using a CMS
10122 // account that is linked to the content owner that the onBehalfOfContentOwner
10123 // parameter specifies. Finally, the channel that the
10124 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
10125 // the content owner that the onBehalfOfContentOwner parameter specifies. This
10126 // parameter is intended for YouTube content partners that own and manage many
10127 // different YouTube channels. It allows content owners to authenticate once
10128 // and perform actions on behalf of the channel specified in the parameter
10129 // value, without having to provide authentication credentials for each
10130 // separate channel.
10131 func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *ChannelSectionsInsertCall {
10132 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
10133 return c
10134 }
10135
10136 // Fields allows partial responses to be retrieved. See
10137 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10138 // details.
10139 func (c *ChannelSectionsInsertCall) Fields(s ...googleapi.Field) *ChannelSectionsInsertCall {
10140 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10141 return c
10142 }
10143
10144 // Context sets the context to be used in this call's Do method.
10145 func (c *ChannelSectionsInsertCall) Context(ctx context.Context) *ChannelSectionsInsertCall {
10146 c.ctx_ = ctx
10147 return c
10148 }
10149
10150 // Header returns a http.Header that can be modified by the caller to add
10151 // headers to the request.
10152 func (c *ChannelSectionsInsertCall) Header() http.Header {
10153 if c.header_ == nil {
10154 c.header_ = make(http.Header)
10155 }
10156 return c.header_
10157 }
10158
10159 func (c *ChannelSectionsInsertCall) doRequest(alt string) (*http.Response, error) {
10160 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10161 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelsection)
10162 if err != nil {
10163 return nil, err
10164 }
10165 c.urlParams_.Set("alt", alt)
10166 c.urlParams_.Set("prettyPrint", "false")
10167 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelSections")
10168 urls += "?" + c.urlParams_.Encode()
10169 req, err := http.NewRequest("POST", urls, body)
10170 if err != nil {
10171 return nil, err
10172 }
10173 req.Header = reqHeaders
10174 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channelSections.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
10175 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10176 }
10177
10178 // Do executes the "youtube.channelSections.insert" call.
10179 // Any non-2xx status code is an error. Response headers are in either
10180 // *ChannelSection.ServerResponse.Header or (if a response was returned at all)
10181 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10182 // whether the returned error was because http.StatusNotModified was returned.
10183 func (c *ChannelSectionsInsertCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
10184 gensupport.SetOptions(c.urlParams_, opts...)
10185 res, err := c.doRequest("json")
10186 if res != nil && res.StatusCode == http.StatusNotModified {
10187 if res.Body != nil {
10188 res.Body.Close()
10189 }
10190 return nil, gensupport.WrapError(&googleapi.Error{
10191 Code: res.StatusCode,
10192 Header: res.Header,
10193 })
10194 }
10195 if err != nil {
10196 return nil, err
10197 }
10198 defer googleapi.CloseBody(res)
10199 if err := googleapi.CheckResponse(res); err != nil {
10200 return nil, gensupport.WrapError(err)
10201 }
10202 ret := &ChannelSection{
10203 ServerResponse: googleapi.ServerResponse{
10204 Header: res.Header,
10205 HTTPStatusCode: res.StatusCode,
10206 },
10207 }
10208 target := &ret
10209 b, err := gensupport.DecodeResponseBytes(target, res)
10210 if err != nil {
10211 return nil, err
10212 }
10213 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channelSections.insert", "response", internallog.HTTPResponse(res, b))
10214 return ret, nil
10215 }
10216
10217 type ChannelSectionsListCall struct {
10218 s *Service
10219 urlParams_ gensupport.URLParams
10220 ifNoneMatch_ string
10221 ctx_ context.Context
10222 header_ http.Header
10223 }
10224
10225 // List: Retrieves a list of resources, possibly filtered.
10226 //
10227 // - part: The *part* parameter specifies a comma-separated list of one or more
10228 // channelSection resource properties that the API response will include. The
10229 // part names that you can include in the parameter value are id, snippet,
10230 // and contentDetails. If the parameter identifies a property that contains
10231 // child properties, the child properties will be included in the response.
10232 // For example, in a channelSection resource, the snippet property contains
10233 // other properties, such as a display title for the channelSection. If you
10234 // set *part=snippet*, the API response will also contain all of those nested
10235 // properties.
10236 func (r *ChannelSectionsService) List(part []string) *ChannelSectionsListCall {
10237 c := &ChannelSectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10238 c.urlParams_.SetMulti("part", append([]string{}, part...))
10239 return c
10240 }
10241
10242 // ChannelId sets the optional parameter "channelId": Return the
10243 // ChannelSections owned by the specified channel ID.
10244 func (c *ChannelSectionsListCall) ChannelId(channelId string) *ChannelSectionsListCall {
10245 c.urlParams_.Set("channelId", channelId)
10246 return c
10247 }
10248
10249 // Hl sets the optional parameter "hl": Return content in specified language
10250 func (c *ChannelSectionsListCall) Hl(hl string) *ChannelSectionsListCall {
10251 c.urlParams_.Set("hl", hl)
10252 return c
10253 }
10254
10255 // Id sets the optional parameter "id": Return the ChannelSections with the
10256 // given IDs for Stubby or Apiary.
10257 func (c *ChannelSectionsListCall) Id(id ...string) *ChannelSectionsListCall {
10258 c.urlParams_.SetMulti("id", append([]string{}, id...))
10259 return c
10260 }
10261
10262 // Mine sets the optional parameter "mine": Return the ChannelSections owned by
10263 // the authenticated user.
10264 func (c *ChannelSectionsListCall) Mine(mine bool) *ChannelSectionsListCall {
10265 c.urlParams_.Set("mine", fmt.Sprint(mine))
10266 return c
10267 }
10268
10269 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
10270 // *Note:* This parameter is intended exclusively for YouTube content partners.
10271 // The *onBehalfOfContentOwner* parameter indicates that the request's
10272 // authorization credentials identify a YouTube CMS user who is acting on
10273 // behalf of the content owner specified in the parameter value. This parameter
10274 // is intended for YouTube content partners that own and manage many different
10275 // YouTube channels. It allows content owners to authenticate once and get
10276 // access to all their video and channel data, without having to provide
10277 // authentication credentials for each individual channel. The CMS account that
10278 // the user authenticates with must be linked to the specified YouTube content
10279 // owner.
10280 func (c *ChannelSectionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsListCall {
10281 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
10282 return c
10283 }
10284
10285 // Fields allows partial responses to be retrieved. See
10286 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10287 // details.
10288 func (c *ChannelSectionsListCall) Fields(s ...googleapi.Field) *ChannelSectionsListCall {
10289 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10290 return c
10291 }
10292
10293 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10294 // object's ETag matches the given value. This is useful for getting updates
10295 // only after the object has changed since the last request.
10296 func (c *ChannelSectionsListCall) IfNoneMatch(entityTag string) *ChannelSectionsListCall {
10297 c.ifNoneMatch_ = entityTag
10298 return c
10299 }
10300
10301 // Context sets the context to be used in this call's Do method.
10302 func (c *ChannelSectionsListCall) Context(ctx context.Context) *ChannelSectionsListCall {
10303 c.ctx_ = ctx
10304 return c
10305 }
10306
10307 // Header returns a http.Header that can be modified by the caller to add
10308 // headers to the request.
10309 func (c *ChannelSectionsListCall) Header() http.Header {
10310 if c.header_ == nil {
10311 c.header_ = make(http.Header)
10312 }
10313 return c.header_
10314 }
10315
10316 func (c *ChannelSectionsListCall) doRequest(alt string) (*http.Response, error) {
10317 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10318 if c.ifNoneMatch_ != "" {
10319 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10320 }
10321 c.urlParams_.Set("alt", alt)
10322 c.urlParams_.Set("prettyPrint", "false")
10323 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelSections")
10324 urls += "?" + c.urlParams_.Encode()
10325 req, err := http.NewRequest("GET", urls, nil)
10326 if err != nil {
10327 return nil, err
10328 }
10329 req.Header = reqHeaders
10330 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channelSections.list", "request", internallog.HTTPRequest(req, nil))
10331 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10332 }
10333
10334 // Do executes the "youtube.channelSections.list" call.
10335 // Any non-2xx status code is an error. Response headers are in either
10336 // *ChannelSectionListResponse.ServerResponse.Header or (if a response was
10337 // returned at all) in error.(*googleapi.Error).Header. Use
10338 // googleapi.IsNotModified to check whether the returned error was because
10339 // http.StatusNotModified was returned.
10340 func (c *ChannelSectionsListCall) Do(opts ...googleapi.CallOption) (*ChannelSectionListResponse, error) {
10341 gensupport.SetOptions(c.urlParams_, opts...)
10342 res, err := c.doRequest("json")
10343 if res != nil && res.StatusCode == http.StatusNotModified {
10344 if res.Body != nil {
10345 res.Body.Close()
10346 }
10347 return nil, gensupport.WrapError(&googleapi.Error{
10348 Code: res.StatusCode,
10349 Header: res.Header,
10350 })
10351 }
10352 if err != nil {
10353 return nil, err
10354 }
10355 defer googleapi.CloseBody(res)
10356 if err := googleapi.CheckResponse(res); err != nil {
10357 return nil, gensupport.WrapError(err)
10358 }
10359 ret := &ChannelSectionListResponse{
10360 ServerResponse: googleapi.ServerResponse{
10361 Header: res.Header,
10362 HTTPStatusCode: res.StatusCode,
10363 },
10364 }
10365 target := &ret
10366 b, err := gensupport.DecodeResponseBytes(target, res)
10367 if err != nil {
10368 return nil, err
10369 }
10370 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channelSections.list", "response", internallog.HTTPResponse(res, b))
10371 return ret, nil
10372 }
10373
10374 type ChannelSectionsUpdateCall struct {
10375 s *Service
10376 channelsection *ChannelSection
10377 urlParams_ gensupport.URLParams
10378 ctx_ context.Context
10379 header_ http.Header
10380 }
10381
10382 // Update: Updates an existing resource.
10383 //
10384 // - part: The *part* parameter serves two purposes in this operation. It
10385 // identifies the properties that the write operation will set as well as the
10386 // properties that the API response will include. The part names that you can
10387 // include in the parameter value are snippet and contentDetails.
10388 func (r *ChannelSectionsService) Update(part []string, channelsection *ChannelSection) *ChannelSectionsUpdateCall {
10389 c := &ChannelSectionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10390 c.urlParams_.SetMulti("part", append([]string{}, part...))
10391 c.channelsection = channelsection
10392 return c
10393 }
10394
10395 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
10396 // *Note:* This parameter is intended exclusively for YouTube content partners.
10397 // The *onBehalfOfContentOwner* parameter indicates that the request's
10398 // authorization credentials identify a YouTube CMS user who is acting on
10399 // behalf of the content owner specified in the parameter value. This parameter
10400 // is intended for YouTube content partners that own and manage many different
10401 // YouTube channels. It allows content owners to authenticate once and get
10402 // access to all their video and channel data, without having to provide
10403 // authentication credentials for each individual channel. The CMS account that
10404 // the user authenticates with must be linked to the specified YouTube content
10405 // owner.
10406 func (c *ChannelSectionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsUpdateCall {
10407 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
10408 return c
10409 }
10410
10411 // Fields allows partial responses to be retrieved. See
10412 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10413 // details.
10414 func (c *ChannelSectionsUpdateCall) Fields(s ...googleapi.Field) *ChannelSectionsUpdateCall {
10415 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10416 return c
10417 }
10418
10419 // Context sets the context to be used in this call's Do method.
10420 func (c *ChannelSectionsUpdateCall) Context(ctx context.Context) *ChannelSectionsUpdateCall {
10421 c.ctx_ = ctx
10422 return c
10423 }
10424
10425 // Header returns a http.Header that can be modified by the caller to add
10426 // headers to the request.
10427 func (c *ChannelSectionsUpdateCall) Header() http.Header {
10428 if c.header_ == nil {
10429 c.header_ = make(http.Header)
10430 }
10431 return c.header_
10432 }
10433
10434 func (c *ChannelSectionsUpdateCall) doRequest(alt string) (*http.Response, error) {
10435 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10436 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channelsection)
10437 if err != nil {
10438 return nil, err
10439 }
10440 c.urlParams_.Set("alt", alt)
10441 c.urlParams_.Set("prettyPrint", "false")
10442 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channelSections")
10443 urls += "?" + c.urlParams_.Encode()
10444 req, err := http.NewRequest("PUT", urls, body)
10445 if err != nil {
10446 return nil, err
10447 }
10448 req.Header = reqHeaders
10449 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channelSections.update", "request", internallog.HTTPRequest(req, body.Bytes()))
10450 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10451 }
10452
10453 // Do executes the "youtube.channelSections.update" call.
10454 // Any non-2xx status code is an error. Response headers are in either
10455 // *ChannelSection.ServerResponse.Header or (if a response was returned at all)
10456 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10457 // whether the returned error was because http.StatusNotModified was returned.
10458 func (c *ChannelSectionsUpdateCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
10459 gensupport.SetOptions(c.urlParams_, opts...)
10460 res, err := c.doRequest("json")
10461 if res != nil && res.StatusCode == http.StatusNotModified {
10462 if res.Body != nil {
10463 res.Body.Close()
10464 }
10465 return nil, gensupport.WrapError(&googleapi.Error{
10466 Code: res.StatusCode,
10467 Header: res.Header,
10468 })
10469 }
10470 if err != nil {
10471 return nil, err
10472 }
10473 defer googleapi.CloseBody(res)
10474 if err := googleapi.CheckResponse(res); err != nil {
10475 return nil, gensupport.WrapError(err)
10476 }
10477 ret := &ChannelSection{
10478 ServerResponse: googleapi.ServerResponse{
10479 Header: res.Header,
10480 HTTPStatusCode: res.StatusCode,
10481 },
10482 }
10483 target := &ret
10484 b, err := gensupport.DecodeResponseBytes(target, res)
10485 if err != nil {
10486 return nil, err
10487 }
10488 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channelSections.update", "response", internallog.HTTPResponse(res, b))
10489 return ret, nil
10490 }
10491
10492 type ChannelsListCall struct {
10493 s *Service
10494 urlParams_ gensupport.URLParams
10495 ifNoneMatch_ string
10496 ctx_ context.Context
10497 header_ http.Header
10498 }
10499
10500 // List: Retrieves a list of resources, possibly filtered.
10501 //
10502 // - part: The *part* parameter specifies a comma-separated list of one or more
10503 // channel resource properties that the API response will include. If the
10504 // parameter identifies a property that contains child properties, the child
10505 // properties will be included in the response. For example, in a channel
10506 // resource, the contentDetails property contains other properties, such as
10507 // the uploads properties. As such, if you set *part=contentDetails*, the API
10508 // response will also contain all of those nested properties.
10509 func (r *ChannelsService) List(part []string) *ChannelsListCall {
10510 c := &ChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10511 c.urlParams_.SetMulti("part", append([]string{}, part...))
10512 return c
10513 }
10514
10515 // CategoryId sets the optional parameter "categoryId": Return the channels
10516 // within the specified guide category ID.
10517 func (c *ChannelsListCall) CategoryId(categoryId string) *ChannelsListCall {
10518 c.urlParams_.Set("categoryId", categoryId)
10519 return c
10520 }
10521
10522 // ForHandle sets the optional parameter "forHandle": Return the channel
10523 // associated with a YouTube handle.
10524 func (c *ChannelsListCall) ForHandle(forHandle string) *ChannelsListCall {
10525 c.urlParams_.Set("forHandle", forHandle)
10526 return c
10527 }
10528
10529 // ForUsername sets the optional parameter "forUsername": Return the channel
10530 // associated with a YouTube username.
10531 func (c *ChannelsListCall) ForUsername(forUsername string) *ChannelsListCall {
10532 c.urlParams_.Set("forUsername", forUsername)
10533 return c
10534 }
10535
10536 // Hl sets the optional parameter "hl": Stands for "host language". Specifies
10537 // the localization language of the metadata to be filled into
10538 // snippet.localized. The field is filled with the default metadata if there is
10539 // no localization in the specified language. The parameter value must be a
10540 // language code included in the list returned by the i18nLanguages.list method
10541 // (e.g. en_US, es_MX).
10542 func (c *ChannelsListCall) Hl(hl string) *ChannelsListCall {
10543 c.urlParams_.Set("hl", hl)
10544 return c
10545 }
10546
10547 // Id sets the optional parameter "id": Return the channels with the specified
10548 // IDs.
10549 func (c *ChannelsListCall) Id(id ...string) *ChannelsListCall {
10550 c.urlParams_.SetMulti("id", append([]string{}, id...))
10551 return c
10552 }
10553
10554 // ManagedByMe sets the optional parameter "managedByMe": Return the channels
10555 // managed by the authenticated user.
10556 func (c *ChannelsListCall) ManagedByMe(managedByMe bool) *ChannelsListCall {
10557 c.urlParams_.Set("managedByMe", fmt.Sprint(managedByMe))
10558 return c
10559 }
10560
10561 // MaxResults sets the optional parameter "maxResults": The *maxResults*
10562 // parameter specifies the maximum number of items that should be returned in
10563 // the result set.
10564 func (c *ChannelsListCall) MaxResults(maxResults int64) *ChannelsListCall {
10565 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10566 return c
10567 }
10568
10569 // Mine sets the optional parameter "mine": Return the ids of channels owned by
10570 // the authenticated user.
10571 func (c *ChannelsListCall) Mine(mine bool) *ChannelsListCall {
10572 c.urlParams_.Set("mine", fmt.Sprint(mine))
10573 return c
10574 }
10575
10576 // MySubscribers sets the optional parameter "mySubscribers": Return the
10577 // channels subscribed to the authenticated user
10578 func (c *ChannelsListCall) MySubscribers(mySubscribers bool) *ChannelsListCall {
10579 c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
10580 return c
10581 }
10582
10583 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
10584 // *Note:* This parameter is intended exclusively for YouTube content partners.
10585 // The *onBehalfOfContentOwner* parameter indicates that the request's
10586 // authorization credentials identify a YouTube CMS user who is acting on
10587 // behalf of the content owner specified in the parameter value. This parameter
10588 // is intended for YouTube content partners that own and manage many different
10589 // YouTube channels. It allows content owners to authenticate once and get
10590 // access to all their video and channel data, without having to provide
10591 // authentication credentials for each individual channel. The CMS account that
10592 // the user authenticates with must be linked to the specified YouTube content
10593 // owner.
10594 func (c *ChannelsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsListCall {
10595 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
10596 return c
10597 }
10598
10599 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
10600 // identifies a specific page in the result set that should be returned. In an
10601 // API response, the nextPageToken and prevPageToken properties identify other
10602 // pages that could be retrieved.
10603 func (c *ChannelsListCall) PageToken(pageToken string) *ChannelsListCall {
10604 c.urlParams_.Set("pageToken", pageToken)
10605 return c
10606 }
10607
10608 // Fields allows partial responses to be retrieved. See
10609 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10610 // details.
10611 func (c *ChannelsListCall) Fields(s ...googleapi.Field) *ChannelsListCall {
10612 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10613 return c
10614 }
10615
10616 // IfNoneMatch sets an optional parameter which makes the operation fail if the
10617 // object's ETag matches the given value. This is useful for getting updates
10618 // only after the object has changed since the last request.
10619 func (c *ChannelsListCall) IfNoneMatch(entityTag string) *ChannelsListCall {
10620 c.ifNoneMatch_ = entityTag
10621 return c
10622 }
10623
10624 // Context sets the context to be used in this call's Do method.
10625 func (c *ChannelsListCall) Context(ctx context.Context) *ChannelsListCall {
10626 c.ctx_ = ctx
10627 return c
10628 }
10629
10630 // Header returns a http.Header that can be modified by the caller to add
10631 // headers to the request.
10632 func (c *ChannelsListCall) Header() http.Header {
10633 if c.header_ == nil {
10634 c.header_ = make(http.Header)
10635 }
10636 return c.header_
10637 }
10638
10639 func (c *ChannelsListCall) doRequest(alt string) (*http.Response, error) {
10640 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
10641 if c.ifNoneMatch_ != "" {
10642 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10643 }
10644 c.urlParams_.Set("alt", alt)
10645 c.urlParams_.Set("prettyPrint", "false")
10646 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channels")
10647 urls += "?" + c.urlParams_.Encode()
10648 req, err := http.NewRequest("GET", urls, nil)
10649 if err != nil {
10650 return nil, err
10651 }
10652 req.Header = reqHeaders
10653 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channels.list", "request", internallog.HTTPRequest(req, nil))
10654 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10655 }
10656
10657 // Do executes the "youtube.channels.list" call.
10658 // Any non-2xx status code is an error. Response headers are in either
10659 // *ChannelListResponse.ServerResponse.Header or (if a response was returned at
10660 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10661 // check whether the returned error was because http.StatusNotModified was
10662 // returned.
10663 func (c *ChannelsListCall) Do(opts ...googleapi.CallOption) (*ChannelListResponse, error) {
10664 gensupport.SetOptions(c.urlParams_, opts...)
10665 res, err := c.doRequest("json")
10666 if res != nil && res.StatusCode == http.StatusNotModified {
10667 if res.Body != nil {
10668 res.Body.Close()
10669 }
10670 return nil, gensupport.WrapError(&googleapi.Error{
10671 Code: res.StatusCode,
10672 Header: res.Header,
10673 })
10674 }
10675 if err != nil {
10676 return nil, err
10677 }
10678 defer googleapi.CloseBody(res)
10679 if err := googleapi.CheckResponse(res); err != nil {
10680 return nil, gensupport.WrapError(err)
10681 }
10682 ret := &ChannelListResponse{
10683 ServerResponse: googleapi.ServerResponse{
10684 Header: res.Header,
10685 HTTPStatusCode: res.StatusCode,
10686 },
10687 }
10688 target := &ret
10689 b, err := gensupport.DecodeResponseBytes(target, res)
10690 if err != nil {
10691 return nil, err
10692 }
10693 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channels.list", "response", internallog.HTTPResponse(res, b))
10694 return ret, nil
10695 }
10696
10697 // Pages invokes f for each page of results.
10698 // A non-nil error returned from f will halt the iteration.
10699 // The provided context supersedes any context provided to the Context method.
10700 func (c *ChannelsListCall) Pages(ctx context.Context, f func(*ChannelListResponse) error) error {
10701 c.ctx_ = ctx
10702 defer c.PageToken(c.urlParams_.Get("pageToken"))
10703 for {
10704 x, err := c.Do()
10705 if err != nil {
10706 return err
10707 }
10708 if err := f(x); err != nil {
10709 return err
10710 }
10711 if x.NextPageToken == "" {
10712 return nil
10713 }
10714 c.PageToken(x.NextPageToken)
10715 }
10716 }
10717
10718 type ChannelsUpdateCall struct {
10719 s *Service
10720 channel *Channel
10721 urlParams_ gensupport.URLParams
10722 ctx_ context.Context
10723 header_ http.Header
10724 }
10725
10726 // Update: Updates an existing resource.
10727 //
10728 // - part: The *part* parameter serves two purposes in this operation. It
10729 // identifies the properties that the write operation will set as well as the
10730 // properties that the API response will include. The API currently only
10731 // allows the parameter value to be set to either brandingSettings or
10732 // invideoPromotion. (You cannot update both of those parts with a single
10733 // request.) Note that this method overrides the existing values for all of
10734 // the mutable properties that are contained in any parts that the parameter
10735 // value specifies.
10736 func (r *ChannelsService) Update(part []string, channel *Channel) *ChannelsUpdateCall {
10737 c := &ChannelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10738 c.urlParams_.SetMulti("part", append([]string{}, part...))
10739 c.channel = channel
10740 return c
10741 }
10742
10743 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
10744 // The *onBehalfOfContentOwner* parameter indicates that the authenticated user
10745 // is acting on behalf of the content owner specified in the parameter value.
10746 // This parameter is intended for YouTube content partners that own and manage
10747 // many different YouTube channels. It allows content owners to authenticate
10748 // once and get access to all their video and channel data, without having to
10749 // provide authentication credentials for each individual channel. The actual
10750 // CMS account that the user authenticates with needs to be linked to the
10751 // specified YouTube content owner.
10752 func (c *ChannelsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsUpdateCall {
10753 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
10754 return c
10755 }
10756
10757 // Fields allows partial responses to be retrieved. See
10758 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10759 // details.
10760 func (c *ChannelsUpdateCall) Fields(s ...googleapi.Field) *ChannelsUpdateCall {
10761 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10762 return c
10763 }
10764
10765 // Context sets the context to be used in this call's Do method.
10766 func (c *ChannelsUpdateCall) Context(ctx context.Context) *ChannelsUpdateCall {
10767 c.ctx_ = ctx
10768 return c
10769 }
10770
10771 // Header returns a http.Header that can be modified by the caller to add
10772 // headers to the request.
10773 func (c *ChannelsUpdateCall) Header() http.Header {
10774 if c.header_ == nil {
10775 c.header_ = make(http.Header)
10776 }
10777 return c.header_
10778 }
10779
10780 func (c *ChannelsUpdateCall) doRequest(alt string) (*http.Response, error) {
10781 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10782 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.channel)
10783 if err != nil {
10784 return nil, err
10785 }
10786 c.urlParams_.Set("alt", alt)
10787 c.urlParams_.Set("prettyPrint", "false")
10788 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/channels")
10789 urls += "?" + c.urlParams_.Encode()
10790 req, err := http.NewRequest("PUT", urls, body)
10791 if err != nil {
10792 return nil, err
10793 }
10794 req.Header = reqHeaders
10795 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.channels.update", "request", internallog.HTTPRequest(req, body.Bytes()))
10796 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10797 }
10798
10799 // Do executes the "youtube.channels.update" call.
10800 // Any non-2xx status code is an error. Response headers are in either
10801 // *Channel.ServerResponse.Header or (if a response was returned at all) in
10802 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10803 // whether the returned error was because http.StatusNotModified was returned.
10804 func (c *ChannelsUpdateCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
10805 gensupport.SetOptions(c.urlParams_, opts...)
10806 res, err := c.doRequest("json")
10807 if res != nil && res.StatusCode == http.StatusNotModified {
10808 if res.Body != nil {
10809 res.Body.Close()
10810 }
10811 return nil, gensupport.WrapError(&googleapi.Error{
10812 Code: res.StatusCode,
10813 Header: res.Header,
10814 })
10815 }
10816 if err != nil {
10817 return nil, err
10818 }
10819 defer googleapi.CloseBody(res)
10820 if err := googleapi.CheckResponse(res); err != nil {
10821 return nil, gensupport.WrapError(err)
10822 }
10823 ret := &Channel{
10824 ServerResponse: googleapi.ServerResponse{
10825 Header: res.Header,
10826 HTTPStatusCode: res.StatusCode,
10827 },
10828 }
10829 target := &ret
10830 b, err := gensupport.DecodeResponseBytes(target, res)
10831 if err != nil {
10832 return nil, err
10833 }
10834 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.channels.update", "response", internallog.HTTPResponse(res, b))
10835 return ret, nil
10836 }
10837
10838 type CommentThreadsInsertCall struct {
10839 s *Service
10840 commentthread *CommentThread
10841 urlParams_ gensupport.URLParams
10842 ctx_ context.Context
10843 header_ http.Header
10844 }
10845
10846 // Insert: Inserts a new resource into this collection.
10847 //
10848 // - part: The *part* parameter identifies the properties that the API response
10849 // will include. Set the parameter value to snippet. The snippet part has a
10850 // quota cost of 2 units.
10851 func (r *CommentThreadsService) Insert(part []string, commentthread *CommentThread) *CommentThreadsInsertCall {
10852 c := &CommentThreadsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10853 c.urlParams_.SetMulti("part", append([]string{}, part...))
10854 c.commentthread = commentthread
10855 return c
10856 }
10857
10858 // Fields allows partial responses to be retrieved. See
10859 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
10860 // details.
10861 func (c *CommentThreadsInsertCall) Fields(s ...googleapi.Field) *CommentThreadsInsertCall {
10862 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10863 return c
10864 }
10865
10866 // Context sets the context to be used in this call's Do method.
10867 func (c *CommentThreadsInsertCall) Context(ctx context.Context) *CommentThreadsInsertCall {
10868 c.ctx_ = ctx
10869 return c
10870 }
10871
10872 // Header returns a http.Header that can be modified by the caller to add
10873 // headers to the request.
10874 func (c *CommentThreadsInsertCall) Header() http.Header {
10875 if c.header_ == nil {
10876 c.header_ = make(http.Header)
10877 }
10878 return c.header_
10879 }
10880
10881 func (c *CommentThreadsInsertCall) doRequest(alt string) (*http.Response, error) {
10882 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
10883 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentthread)
10884 if err != nil {
10885 return nil, err
10886 }
10887 c.urlParams_.Set("alt", alt)
10888 c.urlParams_.Set("prettyPrint", "false")
10889 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/commentThreads")
10890 urls += "?" + c.urlParams_.Encode()
10891 req, err := http.NewRequest("POST", urls, body)
10892 if err != nil {
10893 return nil, err
10894 }
10895 req.Header = reqHeaders
10896 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.commentThreads.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
10897 return gensupport.SendRequest(c.ctx_, c.s.client, req)
10898 }
10899
10900 // Do executes the "youtube.commentThreads.insert" call.
10901 // Any non-2xx status code is an error. Response headers are in either
10902 // *CommentThread.ServerResponse.Header or (if a response was returned at all)
10903 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
10904 // whether the returned error was because http.StatusNotModified was returned.
10905 func (c *CommentThreadsInsertCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
10906 gensupport.SetOptions(c.urlParams_, opts...)
10907 res, err := c.doRequest("json")
10908 if res != nil && res.StatusCode == http.StatusNotModified {
10909 if res.Body != nil {
10910 res.Body.Close()
10911 }
10912 return nil, gensupport.WrapError(&googleapi.Error{
10913 Code: res.StatusCode,
10914 Header: res.Header,
10915 })
10916 }
10917 if err != nil {
10918 return nil, err
10919 }
10920 defer googleapi.CloseBody(res)
10921 if err := googleapi.CheckResponse(res); err != nil {
10922 return nil, gensupport.WrapError(err)
10923 }
10924 ret := &CommentThread{
10925 ServerResponse: googleapi.ServerResponse{
10926 Header: res.Header,
10927 HTTPStatusCode: res.StatusCode,
10928 },
10929 }
10930 target := &ret
10931 b, err := gensupport.DecodeResponseBytes(target, res)
10932 if err != nil {
10933 return nil, err
10934 }
10935 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.commentThreads.insert", "response", internallog.HTTPResponse(res, b))
10936 return ret, nil
10937 }
10938
10939 type CommentThreadsListCall struct {
10940 s *Service
10941 urlParams_ gensupport.URLParams
10942 ifNoneMatch_ string
10943 ctx_ context.Context
10944 header_ http.Header
10945 }
10946
10947 // List: Retrieves a list of resources, possibly filtered.
10948 //
10949 // - part: The *part* parameter specifies a comma-separated list of one or more
10950 // commentThread resource properties that the API response will include.
10951 func (r *CommentThreadsService) List(part []string) *CommentThreadsListCall {
10952 c := &CommentThreadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10953 c.urlParams_.SetMulti("part", append([]string{}, part...))
10954 return c
10955 }
10956
10957 // AllThreadsRelatedToChannelId sets the optional parameter
10958 // "allThreadsRelatedToChannelId": Returns the comment threads of all videos of
10959 // the channel and the channel comments as well.
10960 func (c *CommentThreadsListCall) AllThreadsRelatedToChannelId(allThreadsRelatedToChannelId string) *CommentThreadsListCall {
10961 c.urlParams_.Set("allThreadsRelatedToChannelId", allThreadsRelatedToChannelId)
10962 return c
10963 }
10964
10965 // ChannelId sets the optional parameter "channelId": Returns the comment
10966 // threads for all the channel comments (ie does not include comments left on
10967 // videos).
10968 func (c *CommentThreadsListCall) ChannelId(channelId string) *CommentThreadsListCall {
10969 c.urlParams_.Set("channelId", channelId)
10970 return c
10971 }
10972
10973 // Id sets the optional parameter "id": Returns the comment threads with the
10974 // given IDs for Stubby or Apiary.
10975 func (c *CommentThreadsListCall) Id(id ...string) *CommentThreadsListCall {
10976 c.urlParams_.SetMulti("id", append([]string{}, id...))
10977 return c
10978 }
10979
10980 // MaxResults sets the optional parameter "maxResults": The *maxResults*
10981 // parameter specifies the maximum number of items that should be returned in
10982 // the result set.
10983 func (c *CommentThreadsListCall) MaxResults(maxResults int64) *CommentThreadsListCall {
10984 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
10985 return c
10986 }
10987
10988 // ModerationStatus sets the optional parameter "moderationStatus": Limits the
10989 // returned comment threads to those with the specified moderation status. Not
10990 // compatible with the 'id' filter. Valid values: published, heldForReview,
10991 // likelySpam.
10992 //
10993 // Possible values:
10994 //
10995 // "published" (default) - The comment is available for public display.
10996 // "heldForReview" - The comment is awaiting review by a moderator.
10997 // "likelySpam"
10998 // "rejected" - The comment is unfit for display.
10999 func (c *CommentThreadsListCall) ModerationStatus(moderationStatus string) *CommentThreadsListCall {
11000 c.urlParams_.Set("moderationStatus", moderationStatus)
11001 return c
11002 }
11003
11004 // Order sets the optional parameter "order":
11005 //
11006 // Possible values:
11007 //
11008 // "orderUnspecified"
11009 // "time" (default) - Order by time.
11010 // "relevance" - Order by relevance.
11011 func (c *CommentThreadsListCall) Order(order string) *CommentThreadsListCall {
11012 c.urlParams_.Set("order", order)
11013 return c
11014 }
11015
11016 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
11017 // identifies a specific page in the result set that should be returned. In an
11018 // API response, the nextPageToken and prevPageToken properties identify other
11019 // pages that could be retrieved.
11020 func (c *CommentThreadsListCall) PageToken(pageToken string) *CommentThreadsListCall {
11021 c.urlParams_.Set("pageToken", pageToken)
11022 return c
11023 }
11024
11025 // PostId sets the optional parameter "postId": Returns the comment threads of
11026 // the specified post.
11027 func (c *CommentThreadsListCall) PostId(postId string) *CommentThreadsListCall {
11028 c.urlParams_.Set("postId", postId)
11029 return c
11030 }
11031
11032 // SearchTerms sets the optional parameter "searchTerms": Limits the returned
11033 // comment threads to those matching the specified key words. Not compatible
11034 // with the 'id' filter.
11035 func (c *CommentThreadsListCall) SearchTerms(searchTerms string) *CommentThreadsListCall {
11036 c.urlParams_.Set("searchTerms", searchTerms)
11037 return c
11038 }
11039
11040 // TextFormat sets the optional parameter "textFormat": The requested text
11041 // format for the returned comments.
11042 //
11043 // Possible values:
11044 //
11045 // "textFormatUnspecified"
11046 // "html" (default) - Returns the comments in HTML format. This is the
11047 //
11048 // default value.
11049 //
11050 // "plainText" - Returns the comments in plain text format.
11051 func (c *CommentThreadsListCall) TextFormat(textFormat string) *CommentThreadsListCall {
11052 c.urlParams_.Set("textFormat", textFormat)
11053 return c
11054 }
11055
11056 // VideoId sets the optional parameter "videoId": Returns the comment threads
11057 // of the specified video.
11058 func (c *CommentThreadsListCall) VideoId(videoId string) *CommentThreadsListCall {
11059 c.urlParams_.Set("videoId", videoId)
11060 return c
11061 }
11062
11063 // Fields allows partial responses to be retrieved. See
11064 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11065 // details.
11066 func (c *CommentThreadsListCall) Fields(s ...googleapi.Field) *CommentThreadsListCall {
11067 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11068 return c
11069 }
11070
11071 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11072 // object's ETag matches the given value. This is useful for getting updates
11073 // only after the object has changed since the last request.
11074 func (c *CommentThreadsListCall) IfNoneMatch(entityTag string) *CommentThreadsListCall {
11075 c.ifNoneMatch_ = entityTag
11076 return c
11077 }
11078
11079 // Context sets the context to be used in this call's Do method.
11080 func (c *CommentThreadsListCall) Context(ctx context.Context) *CommentThreadsListCall {
11081 c.ctx_ = ctx
11082 return c
11083 }
11084
11085 // Header returns a http.Header that can be modified by the caller to add
11086 // headers to the request.
11087 func (c *CommentThreadsListCall) Header() http.Header {
11088 if c.header_ == nil {
11089 c.header_ = make(http.Header)
11090 }
11091 return c.header_
11092 }
11093
11094 func (c *CommentThreadsListCall) doRequest(alt string) (*http.Response, error) {
11095 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11096 if c.ifNoneMatch_ != "" {
11097 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11098 }
11099 c.urlParams_.Set("alt", alt)
11100 c.urlParams_.Set("prettyPrint", "false")
11101 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/commentThreads")
11102 urls += "?" + c.urlParams_.Encode()
11103 req, err := http.NewRequest("GET", urls, nil)
11104 if err != nil {
11105 return nil, err
11106 }
11107 req.Header = reqHeaders
11108 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.commentThreads.list", "request", internallog.HTTPRequest(req, nil))
11109 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11110 }
11111
11112 // Do executes the "youtube.commentThreads.list" call.
11113 // Any non-2xx status code is an error. Response headers are in either
11114 // *CommentThreadListResponse.ServerResponse.Header or (if a response was
11115 // returned at all) in error.(*googleapi.Error).Header. Use
11116 // googleapi.IsNotModified to check whether the returned error was because
11117 // http.StatusNotModified was returned.
11118 func (c *CommentThreadsListCall) Do(opts ...googleapi.CallOption) (*CommentThreadListResponse, error) {
11119 gensupport.SetOptions(c.urlParams_, opts...)
11120 res, err := c.doRequest("json")
11121 if res != nil && res.StatusCode == http.StatusNotModified {
11122 if res.Body != nil {
11123 res.Body.Close()
11124 }
11125 return nil, gensupport.WrapError(&googleapi.Error{
11126 Code: res.StatusCode,
11127 Header: res.Header,
11128 })
11129 }
11130 if err != nil {
11131 return nil, err
11132 }
11133 defer googleapi.CloseBody(res)
11134 if err := googleapi.CheckResponse(res); err != nil {
11135 return nil, gensupport.WrapError(err)
11136 }
11137 ret := &CommentThreadListResponse{
11138 ServerResponse: googleapi.ServerResponse{
11139 Header: res.Header,
11140 HTTPStatusCode: res.StatusCode,
11141 },
11142 }
11143 target := &ret
11144 b, err := gensupport.DecodeResponseBytes(target, res)
11145 if err != nil {
11146 return nil, err
11147 }
11148 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.commentThreads.list", "response", internallog.HTTPResponse(res, b))
11149 return ret, nil
11150 }
11151
11152 // Pages invokes f for each page of results.
11153 // A non-nil error returned from f will halt the iteration.
11154 // The provided context supersedes any context provided to the Context method.
11155 func (c *CommentThreadsListCall) Pages(ctx context.Context, f func(*CommentThreadListResponse) error) error {
11156 c.ctx_ = ctx
11157 defer c.PageToken(c.urlParams_.Get("pageToken"))
11158 for {
11159 x, err := c.Do()
11160 if err != nil {
11161 return err
11162 }
11163 if err := f(x); err != nil {
11164 return err
11165 }
11166 if x.NextPageToken == "" {
11167 return nil
11168 }
11169 c.PageToken(x.NextPageToken)
11170 }
11171 }
11172
11173 type CommentsDeleteCall struct {
11174 s *Service
11175 urlParams_ gensupport.URLParams
11176 ctx_ context.Context
11177 header_ http.Header
11178 }
11179
11180 // Delete: Deletes a resource.
11181 //
11182 // - id: .
11183 func (r *CommentsService) Delete(id string) *CommentsDeleteCall {
11184 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11185 c.urlParams_.Set("id", id)
11186 return c
11187 }
11188
11189 // Fields allows partial responses to be retrieved. See
11190 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11191 // details.
11192 func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
11193 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11194 return c
11195 }
11196
11197 // Context sets the context to be used in this call's Do method.
11198 func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
11199 c.ctx_ = ctx
11200 return c
11201 }
11202
11203 // Header returns a http.Header that can be modified by the caller to add
11204 // headers to the request.
11205 func (c *CommentsDeleteCall) Header() http.Header {
11206 if c.header_ == nil {
11207 c.header_ = make(http.Header)
11208 }
11209 return c.header_
11210 }
11211
11212 func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
11213 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11214 c.urlParams_.Set("alt", alt)
11215 c.urlParams_.Set("prettyPrint", "false")
11216 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments")
11217 urls += "?" + c.urlParams_.Encode()
11218 req, err := http.NewRequest("DELETE", urls, nil)
11219 if err != nil {
11220 return nil, err
11221 }
11222 req.Header = reqHeaders
11223 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.comments.delete", "request", internallog.HTTPRequest(req, nil))
11224 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11225 }
11226
11227 // Do executes the "youtube.comments.delete" call.
11228 func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
11229 gensupport.SetOptions(c.urlParams_, opts...)
11230 res, err := c.doRequest("json")
11231 if err != nil {
11232 return err
11233 }
11234 defer googleapi.CloseBody(res)
11235 if err := googleapi.CheckResponse(res); err != nil {
11236 return gensupport.WrapError(err)
11237 }
11238 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.comments.delete", "response", internallog.HTTPResponse(res, nil))
11239 return nil
11240 }
11241
11242 type CommentsInsertCall struct {
11243 s *Service
11244 comment *Comment
11245 urlParams_ gensupport.URLParams
11246 ctx_ context.Context
11247 header_ http.Header
11248 }
11249
11250 // Insert: Inserts a new resource into this collection.
11251 //
11252 // - part: The *part* parameter identifies the properties that the API response
11253 // will include. Set the parameter value to snippet. The snippet part has a
11254 // quota cost of 2 units.
11255 func (r *CommentsService) Insert(part []string, comment *Comment) *CommentsInsertCall {
11256 c := &CommentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11257 c.urlParams_.SetMulti("part", append([]string{}, part...))
11258 c.comment = comment
11259 return c
11260 }
11261
11262 // Fields allows partial responses to be retrieved. See
11263 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11264 // details.
11265 func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall {
11266 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11267 return c
11268 }
11269
11270 // Context sets the context to be used in this call's Do method.
11271 func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall {
11272 c.ctx_ = ctx
11273 return c
11274 }
11275
11276 // Header returns a http.Header that can be modified by the caller to add
11277 // headers to the request.
11278 func (c *CommentsInsertCall) Header() http.Header {
11279 if c.header_ == nil {
11280 c.header_ = make(http.Header)
11281 }
11282 return c.header_
11283 }
11284
11285 func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) {
11286 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11287 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment)
11288 if err != nil {
11289 return nil, err
11290 }
11291 c.urlParams_.Set("alt", alt)
11292 c.urlParams_.Set("prettyPrint", "false")
11293 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments")
11294 urls += "?" + c.urlParams_.Encode()
11295 req, err := http.NewRequest("POST", urls, body)
11296 if err != nil {
11297 return nil, err
11298 }
11299 req.Header = reqHeaders
11300 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.comments.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
11301 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11302 }
11303
11304 // Do executes the "youtube.comments.insert" call.
11305 // Any non-2xx status code is an error. Response headers are in either
11306 // *Comment.ServerResponse.Header or (if a response was returned at all) in
11307 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11308 // whether the returned error was because http.StatusNotModified was returned.
11309 func (c *CommentsInsertCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
11310 gensupport.SetOptions(c.urlParams_, opts...)
11311 res, err := c.doRequest("json")
11312 if res != nil && res.StatusCode == http.StatusNotModified {
11313 if res.Body != nil {
11314 res.Body.Close()
11315 }
11316 return nil, gensupport.WrapError(&googleapi.Error{
11317 Code: res.StatusCode,
11318 Header: res.Header,
11319 })
11320 }
11321 if err != nil {
11322 return nil, err
11323 }
11324 defer googleapi.CloseBody(res)
11325 if err := googleapi.CheckResponse(res); err != nil {
11326 return nil, gensupport.WrapError(err)
11327 }
11328 ret := &Comment{
11329 ServerResponse: googleapi.ServerResponse{
11330 Header: res.Header,
11331 HTTPStatusCode: res.StatusCode,
11332 },
11333 }
11334 target := &ret
11335 b, err := gensupport.DecodeResponseBytes(target, res)
11336 if err != nil {
11337 return nil, err
11338 }
11339 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.comments.insert", "response", internallog.HTTPResponse(res, b))
11340 return ret, nil
11341 }
11342
11343 type CommentsListCall struct {
11344 s *Service
11345 urlParams_ gensupport.URLParams
11346 ifNoneMatch_ string
11347 ctx_ context.Context
11348 header_ http.Header
11349 }
11350
11351 // List: Retrieves a list of resources, possibly filtered.
11352 //
11353 // - part: The *part* parameter specifies a comma-separated list of one or more
11354 // comment resource properties that the API response will include.
11355 func (r *CommentsService) List(part []string) *CommentsListCall {
11356 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11357 c.urlParams_.SetMulti("part", append([]string{}, part...))
11358 return c
11359 }
11360
11361 // Id sets the optional parameter "id": Returns the comments with the given IDs
11362 // for One Platform.
11363 func (c *CommentsListCall) Id(id ...string) *CommentsListCall {
11364 c.urlParams_.SetMulti("id", append([]string{}, id...))
11365 return c
11366 }
11367
11368 // MaxResults sets the optional parameter "maxResults": The *maxResults*
11369 // parameter specifies the maximum number of items that should be returned in
11370 // the result set.
11371 func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
11372 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
11373 return c
11374 }
11375
11376 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
11377 // identifies a specific page in the result set that should be returned. In an
11378 // API response, the nextPageToken and prevPageToken properties identify other
11379 // pages that could be retrieved.
11380 func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
11381 c.urlParams_.Set("pageToken", pageToken)
11382 return c
11383 }
11384
11385 // ParentId sets the optional parameter "parentId": Returns replies to the
11386 // specified comment. Note, currently YouTube features only one level of
11387 // replies (ie replies to top level comments). However replies to replies may
11388 // be supported in the future.
11389 func (c *CommentsListCall) ParentId(parentId string) *CommentsListCall {
11390 c.urlParams_.Set("parentId", parentId)
11391 return c
11392 }
11393
11394 // TextFormat sets the optional parameter "textFormat": The requested text
11395 // format for the returned comments.
11396 //
11397 // Possible values:
11398 //
11399 // "textFormatUnspecified"
11400 // "html" (default) - Returns the comments in HTML format. This is the
11401 //
11402 // default value.
11403 //
11404 // "plainText" - Returns the comments in plain text format.
11405 func (c *CommentsListCall) TextFormat(textFormat string) *CommentsListCall {
11406 c.urlParams_.Set("textFormat", textFormat)
11407 return c
11408 }
11409
11410 // Fields allows partial responses to be retrieved. See
11411 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11412 // details.
11413 func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
11414 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11415 return c
11416 }
11417
11418 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11419 // object's ETag matches the given value. This is useful for getting updates
11420 // only after the object has changed since the last request.
11421 func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
11422 c.ifNoneMatch_ = entityTag
11423 return c
11424 }
11425
11426 // Context sets the context to be used in this call's Do method.
11427 func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
11428 c.ctx_ = ctx
11429 return c
11430 }
11431
11432 // Header returns a http.Header that can be modified by the caller to add
11433 // headers to the request.
11434 func (c *CommentsListCall) Header() http.Header {
11435 if c.header_ == nil {
11436 c.header_ = make(http.Header)
11437 }
11438 return c.header_
11439 }
11440
11441 func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
11442 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11443 if c.ifNoneMatch_ != "" {
11444 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11445 }
11446 c.urlParams_.Set("alt", alt)
11447 c.urlParams_.Set("prettyPrint", "false")
11448 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments")
11449 urls += "?" + c.urlParams_.Encode()
11450 req, err := http.NewRequest("GET", urls, nil)
11451 if err != nil {
11452 return nil, err
11453 }
11454 req.Header = reqHeaders
11455 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.comments.list", "request", internallog.HTTPRequest(req, nil))
11456 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11457 }
11458
11459 // Do executes the "youtube.comments.list" call.
11460 // Any non-2xx status code is an error. Response headers are in either
11461 // *CommentListResponse.ServerResponse.Header or (if a response was returned at
11462 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11463 // check whether the returned error was because http.StatusNotModified was
11464 // returned.
11465 func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentListResponse, error) {
11466 gensupport.SetOptions(c.urlParams_, opts...)
11467 res, err := c.doRequest("json")
11468 if res != nil && res.StatusCode == http.StatusNotModified {
11469 if res.Body != nil {
11470 res.Body.Close()
11471 }
11472 return nil, gensupport.WrapError(&googleapi.Error{
11473 Code: res.StatusCode,
11474 Header: res.Header,
11475 })
11476 }
11477 if err != nil {
11478 return nil, err
11479 }
11480 defer googleapi.CloseBody(res)
11481 if err := googleapi.CheckResponse(res); err != nil {
11482 return nil, gensupport.WrapError(err)
11483 }
11484 ret := &CommentListResponse{
11485 ServerResponse: googleapi.ServerResponse{
11486 Header: res.Header,
11487 HTTPStatusCode: res.StatusCode,
11488 },
11489 }
11490 target := &ret
11491 b, err := gensupport.DecodeResponseBytes(target, res)
11492 if err != nil {
11493 return nil, err
11494 }
11495 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.comments.list", "response", internallog.HTTPResponse(res, b))
11496 return ret, nil
11497 }
11498
11499 // Pages invokes f for each page of results.
11500 // A non-nil error returned from f will halt the iteration.
11501 // The provided context supersedes any context provided to the Context method.
11502 func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentListResponse) error) error {
11503 c.ctx_ = ctx
11504 defer c.PageToken(c.urlParams_.Get("pageToken"))
11505 for {
11506 x, err := c.Do()
11507 if err != nil {
11508 return err
11509 }
11510 if err := f(x); err != nil {
11511 return err
11512 }
11513 if x.NextPageToken == "" {
11514 return nil
11515 }
11516 c.PageToken(x.NextPageToken)
11517 }
11518 }
11519
11520 type CommentsMarkAsSpamCall struct {
11521 s *Service
11522 urlParams_ gensupport.URLParams
11523 ctx_ context.Context
11524 header_ http.Header
11525 }
11526
11527 // MarkAsSpam: Expresses the caller's opinion that one or more comments should
11528 // be flagged as spam.
11529 //
11530 // - id: Flags the comments with the given IDs as spam in the caller's opinion.
11531 func (r *CommentsService) MarkAsSpam(id []string) *CommentsMarkAsSpamCall {
11532 c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11533 c.urlParams_.SetMulti("id", append([]string{}, id...))
11534 return c
11535 }
11536
11537 // Fields allows partial responses to be retrieved. See
11538 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11539 // details.
11540 func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
11541 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11542 return c
11543 }
11544
11545 // Context sets the context to be used in this call's Do method.
11546 func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall {
11547 c.ctx_ = ctx
11548 return c
11549 }
11550
11551 // Header returns a http.Header that can be modified by the caller to add
11552 // headers to the request.
11553 func (c *CommentsMarkAsSpamCall) Header() http.Header {
11554 if c.header_ == nil {
11555 c.header_ = make(http.Header)
11556 }
11557 return c.header_
11558 }
11559
11560 func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) {
11561 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11562 c.urlParams_.Set("alt", alt)
11563 c.urlParams_.Set("prettyPrint", "false")
11564 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments/markAsSpam")
11565 urls += "?" + c.urlParams_.Encode()
11566 req, err := http.NewRequest("POST", urls, nil)
11567 if err != nil {
11568 return nil, err
11569 }
11570 req.Header = reqHeaders
11571 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.comments.markAsSpam", "request", internallog.HTTPRequest(req, nil))
11572 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11573 }
11574
11575 // Do executes the "youtube.comments.markAsSpam" call.
11576 func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) error {
11577 gensupport.SetOptions(c.urlParams_, opts...)
11578 res, err := c.doRequest("json")
11579 if err != nil {
11580 return err
11581 }
11582 defer googleapi.CloseBody(res)
11583 if err := googleapi.CheckResponse(res); err != nil {
11584 return gensupport.WrapError(err)
11585 }
11586 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.comments.markAsSpam", "response", internallog.HTTPResponse(res, nil))
11587 return nil
11588 }
11589
11590 type CommentsSetModerationStatusCall struct {
11591 s *Service
11592 urlParams_ gensupport.URLParams
11593 ctx_ context.Context
11594 header_ http.Header
11595 }
11596
11597 // SetModerationStatus: Sets the moderation status of one or more comments.
11598 //
11599 // - id: Modifies the moderation status of the comments with the given IDs.
11600 // - moderationStatus: Specifies the requested moderation status. Note,
11601 // comments can be in statuses, which are not available through this call.
11602 // For example, this call does not allow to mark a comment as 'likely spam'.
11603 // Valid values: 'heldForReview', 'published' or 'rejected'.
11604 func (r *CommentsService) SetModerationStatus(id []string, moderationStatus string) *CommentsSetModerationStatusCall {
11605 c := &CommentsSetModerationStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11606 c.urlParams_.SetMulti("id", append([]string{}, id...))
11607 c.urlParams_.Set("moderationStatus", moderationStatus)
11608 return c
11609 }
11610
11611 // BanAuthor sets the optional parameter "banAuthor": If set to true the author
11612 // of the comment gets added to the ban list. This means all future comments of
11613 // the author will autmomatically be rejected. Only valid in combination with
11614 // STATUS_REJECTED.
11615 func (c *CommentsSetModerationStatusCall) BanAuthor(banAuthor bool) *CommentsSetModerationStatusCall {
11616 c.urlParams_.Set("banAuthor", fmt.Sprint(banAuthor))
11617 return c
11618 }
11619
11620 // Fields allows partial responses to be retrieved. See
11621 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11622 // details.
11623 func (c *CommentsSetModerationStatusCall) Fields(s ...googleapi.Field) *CommentsSetModerationStatusCall {
11624 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11625 return c
11626 }
11627
11628 // Context sets the context to be used in this call's Do method.
11629 func (c *CommentsSetModerationStatusCall) Context(ctx context.Context) *CommentsSetModerationStatusCall {
11630 c.ctx_ = ctx
11631 return c
11632 }
11633
11634 // Header returns a http.Header that can be modified by the caller to add
11635 // headers to the request.
11636 func (c *CommentsSetModerationStatusCall) Header() http.Header {
11637 if c.header_ == nil {
11638 c.header_ = make(http.Header)
11639 }
11640 return c.header_
11641 }
11642
11643 func (c *CommentsSetModerationStatusCall) doRequest(alt string) (*http.Response, error) {
11644 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11645 c.urlParams_.Set("alt", alt)
11646 c.urlParams_.Set("prettyPrint", "false")
11647 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments/setModerationStatus")
11648 urls += "?" + c.urlParams_.Encode()
11649 req, err := http.NewRequest("POST", urls, nil)
11650 if err != nil {
11651 return nil, err
11652 }
11653 req.Header = reqHeaders
11654 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.comments.setModerationStatus", "request", internallog.HTTPRequest(req, nil))
11655 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11656 }
11657
11658 // Do executes the "youtube.comments.setModerationStatus" call.
11659 func (c *CommentsSetModerationStatusCall) Do(opts ...googleapi.CallOption) error {
11660 gensupport.SetOptions(c.urlParams_, opts...)
11661 res, err := c.doRequest("json")
11662 if err != nil {
11663 return err
11664 }
11665 defer googleapi.CloseBody(res)
11666 if err := googleapi.CheckResponse(res); err != nil {
11667 return gensupport.WrapError(err)
11668 }
11669 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.comments.setModerationStatus", "response", internallog.HTTPResponse(res, nil))
11670 return nil
11671 }
11672
11673 type CommentsUpdateCall struct {
11674 s *Service
11675 comment *Comment
11676 urlParams_ gensupport.URLParams
11677 ctx_ context.Context
11678 header_ http.Header
11679 }
11680
11681 // Update: Updates an existing resource.
11682 //
11683 // - part: The *part* parameter identifies the properties that the API response
11684 // will include. You must at least include the snippet part in the parameter
11685 // value since that part contains all of the properties that the API request
11686 // can update.
11687 func (r *CommentsService) Update(part []string, comment *Comment) *CommentsUpdateCall {
11688 c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11689 c.urlParams_.SetMulti("part", append([]string{}, part...))
11690 c.comment = comment
11691 return c
11692 }
11693
11694 // Fields allows partial responses to be retrieved. See
11695 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11696 // details.
11697 func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
11698 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11699 return c
11700 }
11701
11702 // Context sets the context to be used in this call's Do method.
11703 func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
11704 c.ctx_ = ctx
11705 return c
11706 }
11707
11708 // Header returns a http.Header that can be modified by the caller to add
11709 // headers to the request.
11710 func (c *CommentsUpdateCall) Header() http.Header {
11711 if c.header_ == nil {
11712 c.header_ = make(http.Header)
11713 }
11714 return c.header_
11715 }
11716
11717 func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
11718 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
11719 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.comment)
11720 if err != nil {
11721 return nil, err
11722 }
11723 c.urlParams_.Set("alt", alt)
11724 c.urlParams_.Set("prettyPrint", "false")
11725 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/comments")
11726 urls += "?" + c.urlParams_.Encode()
11727 req, err := http.NewRequest("PUT", urls, body)
11728 if err != nil {
11729 return nil, err
11730 }
11731 req.Header = reqHeaders
11732 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.comments.update", "request", internallog.HTTPRequest(req, body.Bytes()))
11733 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11734 }
11735
11736 // Do executes the "youtube.comments.update" call.
11737 // Any non-2xx status code is an error. Response headers are in either
11738 // *Comment.ServerResponse.Header or (if a response was returned at all) in
11739 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
11740 // whether the returned error was because http.StatusNotModified was returned.
11741 func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
11742 gensupport.SetOptions(c.urlParams_, opts...)
11743 res, err := c.doRequest("json")
11744 if res != nil && res.StatusCode == http.StatusNotModified {
11745 if res.Body != nil {
11746 res.Body.Close()
11747 }
11748 return nil, gensupport.WrapError(&googleapi.Error{
11749 Code: res.StatusCode,
11750 Header: res.Header,
11751 })
11752 }
11753 if err != nil {
11754 return nil, err
11755 }
11756 defer googleapi.CloseBody(res)
11757 if err := googleapi.CheckResponse(res); err != nil {
11758 return nil, gensupport.WrapError(err)
11759 }
11760 ret := &Comment{
11761 ServerResponse: googleapi.ServerResponse{
11762 Header: res.Header,
11763 HTTPStatusCode: res.StatusCode,
11764 },
11765 }
11766 target := &ret
11767 b, err := gensupport.DecodeResponseBytes(target, res)
11768 if err != nil {
11769 return nil, err
11770 }
11771 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.comments.update", "response", internallog.HTTPResponse(res, b))
11772 return ret, nil
11773 }
11774
11775 type I18nLanguagesListCall struct {
11776 s *Service
11777 urlParams_ gensupport.URLParams
11778 ifNoneMatch_ string
11779 ctx_ context.Context
11780 header_ http.Header
11781 }
11782
11783 // List: Retrieves a list of resources, possibly filtered.
11784 //
11785 // - part: The *part* parameter specifies the i18nLanguage resource properties
11786 // that the API response will include. Set the parameter value to snippet.
11787 func (r *I18nLanguagesService) List(part []string) *I18nLanguagesListCall {
11788 c := &I18nLanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11789 c.urlParams_.SetMulti("part", append([]string{}, part...))
11790 return c
11791 }
11792
11793 // Hl sets the optional parameter "hl":
11794 func (c *I18nLanguagesListCall) Hl(hl string) *I18nLanguagesListCall {
11795 c.urlParams_.Set("hl", hl)
11796 return c
11797 }
11798
11799 // Fields allows partial responses to be retrieved. See
11800 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11801 // details.
11802 func (c *I18nLanguagesListCall) Fields(s ...googleapi.Field) *I18nLanguagesListCall {
11803 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11804 return c
11805 }
11806
11807 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11808 // object's ETag matches the given value. This is useful for getting updates
11809 // only after the object has changed since the last request.
11810 func (c *I18nLanguagesListCall) IfNoneMatch(entityTag string) *I18nLanguagesListCall {
11811 c.ifNoneMatch_ = entityTag
11812 return c
11813 }
11814
11815 // Context sets the context to be used in this call's Do method.
11816 func (c *I18nLanguagesListCall) Context(ctx context.Context) *I18nLanguagesListCall {
11817 c.ctx_ = ctx
11818 return c
11819 }
11820
11821 // Header returns a http.Header that can be modified by the caller to add
11822 // headers to the request.
11823 func (c *I18nLanguagesListCall) Header() http.Header {
11824 if c.header_ == nil {
11825 c.header_ = make(http.Header)
11826 }
11827 return c.header_
11828 }
11829
11830 func (c *I18nLanguagesListCall) doRequest(alt string) (*http.Response, error) {
11831 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11832 if c.ifNoneMatch_ != "" {
11833 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11834 }
11835 c.urlParams_.Set("alt", alt)
11836 c.urlParams_.Set("prettyPrint", "false")
11837 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/i18nLanguages")
11838 urls += "?" + c.urlParams_.Encode()
11839 req, err := http.NewRequest("GET", urls, nil)
11840 if err != nil {
11841 return nil, err
11842 }
11843 req.Header = reqHeaders
11844 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.i18nLanguages.list", "request", internallog.HTTPRequest(req, nil))
11845 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11846 }
11847
11848 // Do executes the "youtube.i18nLanguages.list" call.
11849 // Any non-2xx status code is an error. Response headers are in either
11850 // *I18nLanguageListResponse.ServerResponse.Header or (if a response was
11851 // returned at all) in error.(*googleapi.Error).Header. Use
11852 // googleapi.IsNotModified to check whether the returned error was because
11853 // http.StatusNotModified was returned.
11854 func (c *I18nLanguagesListCall) Do(opts ...googleapi.CallOption) (*I18nLanguageListResponse, error) {
11855 gensupport.SetOptions(c.urlParams_, opts...)
11856 res, err := c.doRequest("json")
11857 if res != nil && res.StatusCode == http.StatusNotModified {
11858 if res.Body != nil {
11859 res.Body.Close()
11860 }
11861 return nil, gensupport.WrapError(&googleapi.Error{
11862 Code: res.StatusCode,
11863 Header: res.Header,
11864 })
11865 }
11866 if err != nil {
11867 return nil, err
11868 }
11869 defer googleapi.CloseBody(res)
11870 if err := googleapi.CheckResponse(res); err != nil {
11871 return nil, gensupport.WrapError(err)
11872 }
11873 ret := &I18nLanguageListResponse{
11874 ServerResponse: googleapi.ServerResponse{
11875 Header: res.Header,
11876 HTTPStatusCode: res.StatusCode,
11877 },
11878 }
11879 target := &ret
11880 b, err := gensupport.DecodeResponseBytes(target, res)
11881 if err != nil {
11882 return nil, err
11883 }
11884 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.i18nLanguages.list", "response", internallog.HTTPResponse(res, b))
11885 return ret, nil
11886 }
11887
11888 type I18nRegionsListCall struct {
11889 s *Service
11890 urlParams_ gensupport.URLParams
11891 ifNoneMatch_ string
11892 ctx_ context.Context
11893 header_ http.Header
11894 }
11895
11896 // List: Retrieves a list of resources, possibly filtered.
11897 //
11898 // - part: The *part* parameter specifies the i18nRegion resource properties
11899 // that the API response will include. Set the parameter value to snippet.
11900 func (r *I18nRegionsService) List(part []string) *I18nRegionsListCall {
11901 c := &I18nRegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11902 c.urlParams_.SetMulti("part", append([]string{}, part...))
11903 return c
11904 }
11905
11906 // Hl sets the optional parameter "hl":
11907 func (c *I18nRegionsListCall) Hl(hl string) *I18nRegionsListCall {
11908 c.urlParams_.Set("hl", hl)
11909 return c
11910 }
11911
11912 // Fields allows partial responses to be retrieved. See
11913 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
11914 // details.
11915 func (c *I18nRegionsListCall) Fields(s ...googleapi.Field) *I18nRegionsListCall {
11916 c.urlParams_.Set("fields", googleapi.CombineFields(s))
11917 return c
11918 }
11919
11920 // IfNoneMatch sets an optional parameter which makes the operation fail if the
11921 // object's ETag matches the given value. This is useful for getting updates
11922 // only after the object has changed since the last request.
11923 func (c *I18nRegionsListCall) IfNoneMatch(entityTag string) *I18nRegionsListCall {
11924 c.ifNoneMatch_ = entityTag
11925 return c
11926 }
11927
11928 // Context sets the context to be used in this call's Do method.
11929 func (c *I18nRegionsListCall) Context(ctx context.Context) *I18nRegionsListCall {
11930 c.ctx_ = ctx
11931 return c
11932 }
11933
11934 // Header returns a http.Header that can be modified by the caller to add
11935 // headers to the request.
11936 func (c *I18nRegionsListCall) Header() http.Header {
11937 if c.header_ == nil {
11938 c.header_ = make(http.Header)
11939 }
11940 return c.header_
11941 }
11942
11943 func (c *I18nRegionsListCall) doRequest(alt string) (*http.Response, error) {
11944 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
11945 if c.ifNoneMatch_ != "" {
11946 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11947 }
11948 c.urlParams_.Set("alt", alt)
11949 c.urlParams_.Set("prettyPrint", "false")
11950 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/i18nRegions")
11951 urls += "?" + c.urlParams_.Encode()
11952 req, err := http.NewRequest("GET", urls, nil)
11953 if err != nil {
11954 return nil, err
11955 }
11956 req.Header = reqHeaders
11957 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.i18nRegions.list", "request", internallog.HTTPRequest(req, nil))
11958 return gensupport.SendRequest(c.ctx_, c.s.client, req)
11959 }
11960
11961 // Do executes the "youtube.i18nRegions.list" call.
11962 // Any non-2xx status code is an error. Response headers are in either
11963 // *I18nRegionListResponse.ServerResponse.Header or (if a response was returned
11964 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11965 // check whether the returned error was because http.StatusNotModified was
11966 // returned.
11967 func (c *I18nRegionsListCall) Do(opts ...googleapi.CallOption) (*I18nRegionListResponse, error) {
11968 gensupport.SetOptions(c.urlParams_, opts...)
11969 res, err := c.doRequest("json")
11970 if res != nil && res.StatusCode == http.StatusNotModified {
11971 if res.Body != nil {
11972 res.Body.Close()
11973 }
11974 return nil, gensupport.WrapError(&googleapi.Error{
11975 Code: res.StatusCode,
11976 Header: res.Header,
11977 })
11978 }
11979 if err != nil {
11980 return nil, err
11981 }
11982 defer googleapi.CloseBody(res)
11983 if err := googleapi.CheckResponse(res); err != nil {
11984 return nil, gensupport.WrapError(err)
11985 }
11986 ret := &I18nRegionListResponse{
11987 ServerResponse: googleapi.ServerResponse{
11988 Header: res.Header,
11989 HTTPStatusCode: res.StatusCode,
11990 },
11991 }
11992 target := &ret
11993 b, err := gensupport.DecodeResponseBytes(target, res)
11994 if err != nil {
11995 return nil, err
11996 }
11997 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.i18nRegions.list", "response", internallog.HTTPResponse(res, b))
11998 return ret, nil
11999 }
12000
12001 type LiveBroadcastsBindCall struct {
12002 s *Service
12003 urlParams_ gensupport.URLParams
12004 ctx_ context.Context
12005 header_ http.Header
12006 }
12007
12008 // Bind: Bind a broadcast to a stream.
12009 //
12010 // - id: Broadcast to bind to the stream.
12011 // - part: The *part* parameter specifies a comma-separated list of one or more
12012 // liveBroadcast resource properties that the API response will include. The
12013 // part names that you can include in the parameter value are id, snippet,
12014 // contentDetails, and status.
12015 func (r *LiveBroadcastsService) Bind(id string, part []string) *LiveBroadcastsBindCall {
12016 c := &LiveBroadcastsBindCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12017 c.urlParams_.Set("id", id)
12018 c.urlParams_.SetMulti("part", append([]string{}, part...))
12019 return c
12020 }
12021
12022 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12023 // *Note:* This parameter is intended exclusively for YouTube content partners.
12024 // The *onBehalfOfContentOwner* parameter indicates that the request's
12025 // authorization credentials identify a YouTube CMS user who is acting on
12026 // behalf of the content owner specified in the parameter value. This parameter
12027 // is intended for YouTube content partners that own and manage many different
12028 // YouTube channels. It allows content owners to authenticate once and get
12029 // access to all their video and channel data, without having to provide
12030 // authentication credentials for each individual channel. The CMS account that
12031 // the user authenticates with must be linked to the specified YouTube content
12032 // owner.
12033 func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsBindCall {
12034 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12035 return c
12036 }
12037
12038 // OnBehalfOfContentOwnerChannel sets the optional parameter
12039 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12040 // properly authorized request. *Note:* This parameter is intended exclusively
12041 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12042 // specifies the YouTube channel ID of the channel to which a video is being
12043 // added. This parameter is required when a request specifies a value for the
12044 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12045 // with that parameter. In addition, the request must be authorized using a CMS
12046 // account that is linked to the content owner that the onBehalfOfContentOwner
12047 // parameter specifies. Finally, the channel that the
12048 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12049 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12050 // parameter is intended for YouTube content partners that own and manage many
12051 // different YouTube channels. It allows content owners to authenticate once
12052 // and perform actions on behalf of the channel specified in the parameter
12053 // value, without having to provide authentication credentials for each
12054 // separate channel.
12055 func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsBindCall {
12056 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12057 return c
12058 }
12059
12060 // StreamId sets the optional parameter "streamId": Stream to bind, if not set
12061 // unbind the current one.
12062 func (c *LiveBroadcastsBindCall) StreamId(streamId string) *LiveBroadcastsBindCall {
12063 c.urlParams_.Set("streamId", streamId)
12064 return c
12065 }
12066
12067 // Fields allows partial responses to be retrieved. See
12068 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12069 // details.
12070 func (c *LiveBroadcastsBindCall) Fields(s ...googleapi.Field) *LiveBroadcastsBindCall {
12071 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12072 return c
12073 }
12074
12075 // Context sets the context to be used in this call's Do method.
12076 func (c *LiveBroadcastsBindCall) Context(ctx context.Context) *LiveBroadcastsBindCall {
12077 c.ctx_ = ctx
12078 return c
12079 }
12080
12081 // Header returns a http.Header that can be modified by the caller to add
12082 // headers to the request.
12083 func (c *LiveBroadcastsBindCall) Header() http.Header {
12084 if c.header_ == nil {
12085 c.header_ = make(http.Header)
12086 }
12087 return c.header_
12088 }
12089
12090 func (c *LiveBroadcastsBindCall) doRequest(alt string) (*http.Response, error) {
12091 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12092 c.urlParams_.Set("alt", alt)
12093 c.urlParams_.Set("prettyPrint", "false")
12094 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts/bind")
12095 urls += "?" + c.urlParams_.Encode()
12096 req, err := http.NewRequest("POST", urls, nil)
12097 if err != nil {
12098 return nil, err
12099 }
12100 req.Header = reqHeaders
12101 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.bind", "request", internallog.HTTPRequest(req, nil))
12102 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12103 }
12104
12105 // Do executes the "youtube.liveBroadcasts.bind" call.
12106 // Any non-2xx status code is an error. Response headers are in either
12107 // *LiveBroadcast.ServerResponse.Header or (if a response was returned at all)
12108 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12109 // whether the returned error was because http.StatusNotModified was returned.
12110 func (c *LiveBroadcastsBindCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
12111 gensupport.SetOptions(c.urlParams_, opts...)
12112 res, err := c.doRequest("json")
12113 if res != nil && res.StatusCode == http.StatusNotModified {
12114 if res.Body != nil {
12115 res.Body.Close()
12116 }
12117 return nil, gensupport.WrapError(&googleapi.Error{
12118 Code: res.StatusCode,
12119 Header: res.Header,
12120 })
12121 }
12122 if err != nil {
12123 return nil, err
12124 }
12125 defer googleapi.CloseBody(res)
12126 if err := googleapi.CheckResponse(res); err != nil {
12127 return nil, gensupport.WrapError(err)
12128 }
12129 ret := &LiveBroadcast{
12130 ServerResponse: googleapi.ServerResponse{
12131 Header: res.Header,
12132 HTTPStatusCode: res.StatusCode,
12133 },
12134 }
12135 target := &ret
12136 b, err := gensupport.DecodeResponseBytes(target, res)
12137 if err != nil {
12138 return nil, err
12139 }
12140 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.bind", "response", internallog.HTTPResponse(res, b))
12141 return ret, nil
12142 }
12143
12144 type LiveBroadcastsDeleteCall struct {
12145 s *Service
12146 urlParams_ gensupport.URLParams
12147 ctx_ context.Context
12148 header_ http.Header
12149 }
12150
12151 // Delete: Delete a given broadcast.
12152 //
12153 // - id: Broadcast to delete.
12154 func (r *LiveBroadcastsService) Delete(id string) *LiveBroadcastsDeleteCall {
12155 c := &LiveBroadcastsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12156 c.urlParams_.Set("id", id)
12157 return c
12158 }
12159
12160 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12161 // *Note:* This parameter is intended exclusively for YouTube content partners.
12162 // The *onBehalfOfContentOwner* parameter indicates that the request's
12163 // authorization credentials identify a YouTube CMS user who is acting on
12164 // behalf of the content owner specified in the parameter value. This parameter
12165 // is intended for YouTube content partners that own and manage many different
12166 // YouTube channels. It allows content owners to authenticate once and get
12167 // access to all their video and channel data, without having to provide
12168 // authentication credentials for each individual channel. The CMS account that
12169 // the user authenticates with must be linked to the specified YouTube content
12170 // owner.
12171 func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsDeleteCall {
12172 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12173 return c
12174 }
12175
12176 // OnBehalfOfContentOwnerChannel sets the optional parameter
12177 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12178 // properly authorized request. *Note:* This parameter is intended exclusively
12179 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12180 // specifies the YouTube channel ID of the channel to which a video is being
12181 // added. This parameter is required when a request specifies a value for the
12182 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12183 // with that parameter. In addition, the request must be authorized using a CMS
12184 // account that is linked to the content owner that the onBehalfOfContentOwner
12185 // parameter specifies. Finally, the channel that the
12186 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12187 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12188 // parameter is intended for YouTube content partners that own and manage many
12189 // different YouTube channels. It allows content owners to authenticate once
12190 // and perform actions on behalf of the channel specified in the parameter
12191 // value, without having to provide authentication credentials for each
12192 // separate channel.
12193 func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsDeleteCall {
12194 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12195 return c
12196 }
12197
12198 // Fields allows partial responses to be retrieved. See
12199 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12200 // details.
12201 func (c *LiveBroadcastsDeleteCall) Fields(s ...googleapi.Field) *LiveBroadcastsDeleteCall {
12202 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12203 return c
12204 }
12205
12206 // Context sets the context to be used in this call's Do method.
12207 func (c *LiveBroadcastsDeleteCall) Context(ctx context.Context) *LiveBroadcastsDeleteCall {
12208 c.ctx_ = ctx
12209 return c
12210 }
12211
12212 // Header returns a http.Header that can be modified by the caller to add
12213 // headers to the request.
12214 func (c *LiveBroadcastsDeleteCall) Header() http.Header {
12215 if c.header_ == nil {
12216 c.header_ = make(http.Header)
12217 }
12218 return c.header_
12219 }
12220
12221 func (c *LiveBroadcastsDeleteCall) doRequest(alt string) (*http.Response, error) {
12222 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12223 c.urlParams_.Set("alt", alt)
12224 c.urlParams_.Set("prettyPrint", "false")
12225 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts")
12226 urls += "?" + c.urlParams_.Encode()
12227 req, err := http.NewRequest("DELETE", urls, nil)
12228 if err != nil {
12229 return nil, err
12230 }
12231 req.Header = reqHeaders
12232 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.delete", "request", internallog.HTTPRequest(req, nil))
12233 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12234 }
12235
12236 // Do executes the "youtube.liveBroadcasts.delete" call.
12237 func (c *LiveBroadcastsDeleteCall) Do(opts ...googleapi.CallOption) error {
12238 gensupport.SetOptions(c.urlParams_, opts...)
12239 res, err := c.doRequest("json")
12240 if err != nil {
12241 return err
12242 }
12243 defer googleapi.CloseBody(res)
12244 if err := googleapi.CheckResponse(res); err != nil {
12245 return gensupport.WrapError(err)
12246 }
12247 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.delete", "response", internallog.HTTPResponse(res, nil))
12248 return nil
12249 }
12250
12251 type LiveBroadcastsInsertCall struct {
12252 s *Service
12253 livebroadcast *LiveBroadcast
12254 urlParams_ gensupport.URLParams
12255 ctx_ context.Context
12256 header_ http.Header
12257 }
12258
12259 // Insert: Inserts a new stream for the authenticated user.
12260 //
12261 // - part: The *part* parameter serves two purposes in this operation. It
12262 // identifies the properties that the write operation will set as well as the
12263 // properties that the API response will include. The part properties that
12264 // you can include in the parameter value are id, snippet, contentDetails,
12265 // and status.
12266 func (r *LiveBroadcastsService) Insert(part []string, livebroadcast *LiveBroadcast) *LiveBroadcastsInsertCall {
12267 c := &LiveBroadcastsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12268 c.urlParams_.SetMulti("part", append([]string{}, part...))
12269 c.livebroadcast = livebroadcast
12270 return c
12271 }
12272
12273 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12274 // *Note:* This parameter is intended exclusively for YouTube content partners.
12275 // The *onBehalfOfContentOwner* parameter indicates that the request's
12276 // authorization credentials identify a YouTube CMS user who is acting on
12277 // behalf of the content owner specified in the parameter value. This parameter
12278 // is intended for YouTube content partners that own and manage many different
12279 // YouTube channels. It allows content owners to authenticate once and get
12280 // access to all their video and channel data, without having to provide
12281 // authentication credentials for each individual channel. The CMS account that
12282 // the user authenticates with must be linked to the specified YouTube content
12283 // owner.
12284 func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsInsertCall {
12285 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12286 return c
12287 }
12288
12289 // OnBehalfOfContentOwnerChannel sets the optional parameter
12290 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12291 // properly authorized request. *Note:* This parameter is intended exclusively
12292 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12293 // specifies the YouTube channel ID of the channel to which a video is being
12294 // added. This parameter is required when a request specifies a value for the
12295 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12296 // with that parameter. In addition, the request must be authorized using a CMS
12297 // account that is linked to the content owner that the onBehalfOfContentOwner
12298 // parameter specifies. Finally, the channel that the
12299 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12300 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12301 // parameter is intended for YouTube content partners that own and manage many
12302 // different YouTube channels. It allows content owners to authenticate once
12303 // and perform actions on behalf of the channel specified in the parameter
12304 // value, without having to provide authentication credentials for each
12305 // separate channel.
12306 func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsInsertCall {
12307 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12308 return c
12309 }
12310
12311 // Fields allows partial responses to be retrieved. See
12312 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12313 // details.
12314 func (c *LiveBroadcastsInsertCall) Fields(s ...googleapi.Field) *LiveBroadcastsInsertCall {
12315 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12316 return c
12317 }
12318
12319 // Context sets the context to be used in this call's Do method.
12320 func (c *LiveBroadcastsInsertCall) Context(ctx context.Context) *LiveBroadcastsInsertCall {
12321 c.ctx_ = ctx
12322 return c
12323 }
12324
12325 // Header returns a http.Header that can be modified by the caller to add
12326 // headers to the request.
12327 func (c *LiveBroadcastsInsertCall) Header() http.Header {
12328 if c.header_ == nil {
12329 c.header_ = make(http.Header)
12330 }
12331 return c.header_
12332 }
12333
12334 func (c *LiveBroadcastsInsertCall) doRequest(alt string) (*http.Response, error) {
12335 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12336 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livebroadcast)
12337 if err != nil {
12338 return nil, err
12339 }
12340 c.urlParams_.Set("alt", alt)
12341 c.urlParams_.Set("prettyPrint", "false")
12342 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts")
12343 urls += "?" + c.urlParams_.Encode()
12344 req, err := http.NewRequest("POST", urls, body)
12345 if err != nil {
12346 return nil, err
12347 }
12348 req.Header = reqHeaders
12349 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
12350 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12351 }
12352
12353 // Do executes the "youtube.liveBroadcasts.insert" call.
12354 // Any non-2xx status code is an error. Response headers are in either
12355 // *LiveBroadcast.ServerResponse.Header or (if a response was returned at all)
12356 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12357 // whether the returned error was because http.StatusNotModified was returned.
12358 func (c *LiveBroadcastsInsertCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
12359 gensupport.SetOptions(c.urlParams_, opts...)
12360 res, err := c.doRequest("json")
12361 if res != nil && res.StatusCode == http.StatusNotModified {
12362 if res.Body != nil {
12363 res.Body.Close()
12364 }
12365 return nil, gensupport.WrapError(&googleapi.Error{
12366 Code: res.StatusCode,
12367 Header: res.Header,
12368 })
12369 }
12370 if err != nil {
12371 return nil, err
12372 }
12373 defer googleapi.CloseBody(res)
12374 if err := googleapi.CheckResponse(res); err != nil {
12375 return nil, gensupport.WrapError(err)
12376 }
12377 ret := &LiveBroadcast{
12378 ServerResponse: googleapi.ServerResponse{
12379 Header: res.Header,
12380 HTTPStatusCode: res.StatusCode,
12381 },
12382 }
12383 target := &ret
12384 b, err := gensupport.DecodeResponseBytes(target, res)
12385 if err != nil {
12386 return nil, err
12387 }
12388 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.insert", "response", internallog.HTTPResponse(res, b))
12389 return ret, nil
12390 }
12391
12392 type LiveBroadcastsInsertCuepointCall struct {
12393 s *Service
12394 cuepoint *Cuepoint
12395 urlParams_ gensupport.URLParams
12396 ctx_ context.Context
12397 header_ http.Header
12398 }
12399
12400 // InsertCuepoint: Insert cuepoints in a broadcast
12401 func (r *LiveBroadcastsService) InsertCuepoint(cuepoint *Cuepoint) *LiveBroadcastsInsertCuepointCall {
12402 c := &LiveBroadcastsInsertCuepointCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12403 c.cuepoint = cuepoint
12404 return c
12405 }
12406
12407 // Id sets the optional parameter "id": Broadcast to insert ads to, or
12408 // equivalently `external_video_id` for internal use.
12409 func (c *LiveBroadcastsInsertCuepointCall) Id(id string) *LiveBroadcastsInsertCuepointCall {
12410 c.urlParams_.Set("id", id)
12411 return c
12412 }
12413
12414 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12415 // *Note:* This parameter is intended exclusively for YouTube content partners.
12416 // The *onBehalfOfContentOwner* parameter indicates that the request's
12417 // authorization credentials identify a YouTube CMS user who is acting on
12418 // behalf of the content owner specified in the parameter value. This parameter
12419 // is intended for YouTube content partners that own and manage many different
12420 // YouTube channels. It allows content owners to authenticate once and get
12421 // access to all their video and channel data, without having to provide
12422 // authentication credentials for each individual channel. The CMS account that
12423 // the user authenticates with must be linked to the specified YouTube content
12424 // owner.
12425 func (c *LiveBroadcastsInsertCuepointCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsInsertCuepointCall {
12426 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12427 return c
12428 }
12429
12430 // OnBehalfOfContentOwnerChannel sets the optional parameter
12431 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12432 // properly authorized request. *Note:* This parameter is intended exclusively
12433 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12434 // specifies the YouTube channel ID of the channel to which a video is being
12435 // added. This parameter is required when a request specifies a value for the
12436 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12437 // with that parameter. In addition, the request must be authorized using a CMS
12438 // account that is linked to the content owner that the onBehalfOfContentOwner
12439 // parameter specifies. Finally, the channel that the
12440 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12441 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12442 // parameter is intended for YouTube content partners that own and manage many
12443 // different YouTube channels. It allows content owners to authenticate once
12444 // and perform actions on behalf of the channel specified in the parameter
12445 // value, without having to provide authentication credentials for each
12446 // separate channel.
12447 func (c *LiveBroadcastsInsertCuepointCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsInsertCuepointCall {
12448 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12449 return c
12450 }
12451
12452 // Part sets the optional parameter "part": The *part* parameter specifies a
12453 // comma-separated list of one or more liveBroadcast resource properties that
12454 // the API response will include. The part names that you can include in the
12455 // parameter value are id, snippet, contentDetails, and status.
12456 func (c *LiveBroadcastsInsertCuepointCall) Part(part ...string) *LiveBroadcastsInsertCuepointCall {
12457 c.urlParams_.SetMulti("part", append([]string{}, part...))
12458 return c
12459 }
12460
12461 // Fields allows partial responses to be retrieved. See
12462 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12463 // details.
12464 func (c *LiveBroadcastsInsertCuepointCall) Fields(s ...googleapi.Field) *LiveBroadcastsInsertCuepointCall {
12465 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12466 return c
12467 }
12468
12469 // Context sets the context to be used in this call's Do method.
12470 func (c *LiveBroadcastsInsertCuepointCall) Context(ctx context.Context) *LiveBroadcastsInsertCuepointCall {
12471 c.ctx_ = ctx
12472 return c
12473 }
12474
12475 // Header returns a http.Header that can be modified by the caller to add
12476 // headers to the request.
12477 func (c *LiveBroadcastsInsertCuepointCall) Header() http.Header {
12478 if c.header_ == nil {
12479 c.header_ = make(http.Header)
12480 }
12481 return c.header_
12482 }
12483
12484 func (c *LiveBroadcastsInsertCuepointCall) doRequest(alt string) (*http.Response, error) {
12485 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
12486 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.cuepoint)
12487 if err != nil {
12488 return nil, err
12489 }
12490 c.urlParams_.Set("alt", alt)
12491 c.urlParams_.Set("prettyPrint", "false")
12492 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts/cuepoint")
12493 urls += "?" + c.urlParams_.Encode()
12494 req, err := http.NewRequest("POST", urls, body)
12495 if err != nil {
12496 return nil, err
12497 }
12498 req.Header = reqHeaders
12499 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.insertCuepoint", "request", internallog.HTTPRequest(req, body.Bytes()))
12500 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12501 }
12502
12503 // Do executes the "youtube.liveBroadcasts.insertCuepoint" call.
12504 // Any non-2xx status code is an error. Response headers are in either
12505 // *Cuepoint.ServerResponse.Header or (if a response was returned at all) in
12506 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12507 // whether the returned error was because http.StatusNotModified was returned.
12508 func (c *LiveBroadcastsInsertCuepointCall) Do(opts ...googleapi.CallOption) (*Cuepoint, error) {
12509 gensupport.SetOptions(c.urlParams_, opts...)
12510 res, err := c.doRequest("json")
12511 if res != nil && res.StatusCode == http.StatusNotModified {
12512 if res.Body != nil {
12513 res.Body.Close()
12514 }
12515 return nil, gensupport.WrapError(&googleapi.Error{
12516 Code: res.StatusCode,
12517 Header: res.Header,
12518 })
12519 }
12520 if err != nil {
12521 return nil, err
12522 }
12523 defer googleapi.CloseBody(res)
12524 if err := googleapi.CheckResponse(res); err != nil {
12525 return nil, gensupport.WrapError(err)
12526 }
12527 ret := &Cuepoint{
12528 ServerResponse: googleapi.ServerResponse{
12529 Header: res.Header,
12530 HTTPStatusCode: res.StatusCode,
12531 },
12532 }
12533 target := &ret
12534 b, err := gensupport.DecodeResponseBytes(target, res)
12535 if err != nil {
12536 return nil, err
12537 }
12538 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.insertCuepoint", "response", internallog.HTTPResponse(res, b))
12539 return ret, nil
12540 }
12541
12542 type LiveBroadcastsListCall struct {
12543 s *Service
12544 urlParams_ gensupport.URLParams
12545 ifNoneMatch_ string
12546 ctx_ context.Context
12547 header_ http.Header
12548 }
12549
12550 // List: Retrieve the list of broadcasts associated with the given channel.
12551 //
12552 // - part: The *part* parameter specifies a comma-separated list of one or more
12553 // liveBroadcast resource properties that the API response will include. The
12554 // part names that you can include in the parameter value are id, snippet,
12555 // contentDetails, status and statistics.
12556 func (r *LiveBroadcastsService) List(part []string) *LiveBroadcastsListCall {
12557 c := &LiveBroadcastsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12558 c.urlParams_.SetMulti("part", append([]string{}, part...))
12559 return c
12560 }
12561
12562 // BroadcastStatus sets the optional parameter "broadcastStatus": Return
12563 // broadcasts with a certain status, e.g. active broadcasts.
12564 //
12565 // Possible values:
12566 //
12567 // "broadcastStatusFilterUnspecified"
12568 // "all" - Return all broadcasts.
12569 // "active" - Return current live broadcasts.
12570 // "upcoming" - Return broadcasts that have not yet started.
12571 // "completed" - Return broadcasts that have already ended.
12572 func (c *LiveBroadcastsListCall) BroadcastStatus(broadcastStatus string) *LiveBroadcastsListCall {
12573 c.urlParams_.Set("broadcastStatus", broadcastStatus)
12574 return c
12575 }
12576
12577 // BroadcastType sets the optional parameter "broadcastType": Return only
12578 // broadcasts with the selected type.
12579 //
12580 // Possible values:
12581 //
12582 // "broadcastTypeFilterUnspecified"
12583 // "all" - Return all broadcasts.
12584 // "event" (default) - Return only scheduled event broadcasts.
12585 // "persistent" - Return only persistent broadcasts.
12586 func (c *LiveBroadcastsListCall) BroadcastType(broadcastType string) *LiveBroadcastsListCall {
12587 c.urlParams_.Set("broadcastType", broadcastType)
12588 return c
12589 }
12590
12591 // Id sets the optional parameter "id": Return broadcasts with the given ids
12592 // from Stubby or Apiary.
12593 func (c *LiveBroadcastsListCall) Id(id ...string) *LiveBroadcastsListCall {
12594 c.urlParams_.SetMulti("id", append([]string{}, id...))
12595 return c
12596 }
12597
12598 // MaxResults sets the optional parameter "maxResults": The *maxResults*
12599 // parameter specifies the maximum number of items that should be returned in
12600 // the result set.
12601 func (c *LiveBroadcastsListCall) MaxResults(maxResults int64) *LiveBroadcastsListCall {
12602 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
12603 return c
12604 }
12605
12606 // Mine sets the optional parameter "mine":
12607 func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall {
12608 c.urlParams_.Set("mine", fmt.Sprint(mine))
12609 return c
12610 }
12611
12612 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12613 // *Note:* This parameter is intended exclusively for YouTube content partners.
12614 // The *onBehalfOfContentOwner* parameter indicates that the request's
12615 // authorization credentials identify a YouTube CMS user who is acting on
12616 // behalf of the content owner specified in the parameter value. This parameter
12617 // is intended for YouTube content partners that own and manage many different
12618 // YouTube channels. It allows content owners to authenticate once and get
12619 // access to all their video and channel data, without having to provide
12620 // authentication credentials for each individual channel. The CMS account that
12621 // the user authenticates with must be linked to the specified YouTube content
12622 // owner.
12623 func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsListCall {
12624 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12625 return c
12626 }
12627
12628 // OnBehalfOfContentOwnerChannel sets the optional parameter
12629 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12630 // properly authorized request. *Note:* This parameter is intended exclusively
12631 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12632 // specifies the YouTube channel ID of the channel to which a video is being
12633 // added. This parameter is required when a request specifies a value for the
12634 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12635 // with that parameter. In addition, the request must be authorized using a CMS
12636 // account that is linked to the content owner that the onBehalfOfContentOwner
12637 // parameter specifies. Finally, the channel that the
12638 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12639 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12640 // parameter is intended for YouTube content partners that own and manage many
12641 // different YouTube channels. It allows content owners to authenticate once
12642 // and perform actions on behalf of the channel specified in the parameter
12643 // value, without having to provide authentication credentials for each
12644 // separate channel.
12645 func (c *LiveBroadcastsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsListCall {
12646 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12647 return c
12648 }
12649
12650 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
12651 // identifies a specific page in the result set that should be returned. In an
12652 // API response, the nextPageToken and prevPageToken properties identify other
12653 // pages that could be retrieved.
12654 func (c *LiveBroadcastsListCall) PageToken(pageToken string) *LiveBroadcastsListCall {
12655 c.urlParams_.Set("pageToken", pageToken)
12656 return c
12657 }
12658
12659 // Fields allows partial responses to be retrieved. See
12660 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12661 // details.
12662 func (c *LiveBroadcastsListCall) Fields(s ...googleapi.Field) *LiveBroadcastsListCall {
12663 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12664 return c
12665 }
12666
12667 // IfNoneMatch sets an optional parameter which makes the operation fail if the
12668 // object's ETag matches the given value. This is useful for getting updates
12669 // only after the object has changed since the last request.
12670 func (c *LiveBroadcastsListCall) IfNoneMatch(entityTag string) *LiveBroadcastsListCall {
12671 c.ifNoneMatch_ = entityTag
12672 return c
12673 }
12674
12675 // Context sets the context to be used in this call's Do method.
12676 func (c *LiveBroadcastsListCall) Context(ctx context.Context) *LiveBroadcastsListCall {
12677 c.ctx_ = ctx
12678 return c
12679 }
12680
12681 // Header returns a http.Header that can be modified by the caller to add
12682 // headers to the request.
12683 func (c *LiveBroadcastsListCall) Header() http.Header {
12684 if c.header_ == nil {
12685 c.header_ = make(http.Header)
12686 }
12687 return c.header_
12688 }
12689
12690 func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) {
12691 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12692 if c.ifNoneMatch_ != "" {
12693 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12694 }
12695 c.urlParams_.Set("alt", alt)
12696 c.urlParams_.Set("prettyPrint", "false")
12697 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts")
12698 urls += "?" + c.urlParams_.Encode()
12699 req, err := http.NewRequest("GET", urls, nil)
12700 if err != nil {
12701 return nil, err
12702 }
12703 req.Header = reqHeaders
12704 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.list", "request", internallog.HTTPRequest(req, nil))
12705 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12706 }
12707
12708 // Do executes the "youtube.liveBroadcasts.list" call.
12709 // Any non-2xx status code is an error. Response headers are in either
12710 // *LiveBroadcastListResponse.ServerResponse.Header or (if a response was
12711 // returned at all) in error.(*googleapi.Error).Header. Use
12712 // googleapi.IsNotModified to check whether the returned error was because
12713 // http.StatusNotModified was returned.
12714 func (c *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcastListResponse, error) {
12715 gensupport.SetOptions(c.urlParams_, opts...)
12716 res, err := c.doRequest("json")
12717 if res != nil && res.StatusCode == http.StatusNotModified {
12718 if res.Body != nil {
12719 res.Body.Close()
12720 }
12721 return nil, gensupport.WrapError(&googleapi.Error{
12722 Code: res.StatusCode,
12723 Header: res.Header,
12724 })
12725 }
12726 if err != nil {
12727 return nil, err
12728 }
12729 defer googleapi.CloseBody(res)
12730 if err := googleapi.CheckResponse(res); err != nil {
12731 return nil, gensupport.WrapError(err)
12732 }
12733 ret := &LiveBroadcastListResponse{
12734 ServerResponse: googleapi.ServerResponse{
12735 Header: res.Header,
12736 HTTPStatusCode: res.StatusCode,
12737 },
12738 }
12739 target := &ret
12740 b, err := gensupport.DecodeResponseBytes(target, res)
12741 if err != nil {
12742 return nil, err
12743 }
12744 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.list", "response", internallog.HTTPResponse(res, b))
12745 return ret, nil
12746 }
12747
12748 // Pages invokes f for each page of results.
12749 // A non-nil error returned from f will halt the iteration.
12750 // The provided context supersedes any context provided to the Context method.
12751 func (c *LiveBroadcastsListCall) Pages(ctx context.Context, f func(*LiveBroadcastListResponse) error) error {
12752 c.ctx_ = ctx
12753 defer c.PageToken(c.urlParams_.Get("pageToken"))
12754 for {
12755 x, err := c.Do()
12756 if err != nil {
12757 return err
12758 }
12759 if err := f(x); err != nil {
12760 return err
12761 }
12762 if x.NextPageToken == "" {
12763 return nil
12764 }
12765 c.PageToken(x.NextPageToken)
12766 }
12767 }
12768
12769 type LiveBroadcastsTransitionCall struct {
12770 s *Service
12771 urlParams_ gensupport.URLParams
12772 ctx_ context.Context
12773 header_ http.Header
12774 }
12775
12776 // Transition: Transition a broadcast to a given status.
12777 //
12778 // - broadcastStatus: The status to which the broadcast is going to transition.
12779 // - id: Broadcast to transition.
12780 // - part: The *part* parameter specifies a comma-separated list of one or more
12781 // liveBroadcast resource properties that the API response will include. The
12782 // part names that you can include in the parameter value are id, snippet,
12783 // contentDetails, and status.
12784 func (r *LiveBroadcastsService) Transition(broadcastStatus string, id string, part []string) *LiveBroadcastsTransitionCall {
12785 c := &LiveBroadcastsTransitionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12786 c.urlParams_.Set("broadcastStatus", broadcastStatus)
12787 c.urlParams_.Set("id", id)
12788 c.urlParams_.SetMulti("part", append([]string{}, part...))
12789 return c
12790 }
12791
12792 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12793 // *Note:* This parameter is intended exclusively for YouTube content partners.
12794 // The *onBehalfOfContentOwner* parameter indicates that the request's
12795 // authorization credentials identify a YouTube CMS user who is acting on
12796 // behalf of the content owner specified in the parameter value. This parameter
12797 // is intended for YouTube content partners that own and manage many different
12798 // YouTube channels. It allows content owners to authenticate once and get
12799 // access to all their video and channel data, without having to provide
12800 // authentication credentials for each individual channel. The CMS account that
12801 // the user authenticates with must be linked to the specified YouTube content
12802 // owner.
12803 func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsTransitionCall {
12804 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12805 return c
12806 }
12807
12808 // OnBehalfOfContentOwnerChannel sets the optional parameter
12809 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12810 // properly authorized request. *Note:* This parameter is intended exclusively
12811 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12812 // specifies the YouTube channel ID of the channel to which a video is being
12813 // added. This parameter is required when a request specifies a value for the
12814 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12815 // with that parameter. In addition, the request must be authorized using a CMS
12816 // account that is linked to the content owner that the onBehalfOfContentOwner
12817 // parameter specifies. Finally, the channel that the
12818 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12819 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12820 // parameter is intended for YouTube content partners that own and manage many
12821 // different YouTube channels. It allows content owners to authenticate once
12822 // and perform actions on behalf of the channel specified in the parameter
12823 // value, without having to provide authentication credentials for each
12824 // separate channel.
12825 func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsTransitionCall {
12826 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12827 return c
12828 }
12829
12830 // Fields allows partial responses to be retrieved. See
12831 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12832 // details.
12833 func (c *LiveBroadcastsTransitionCall) Fields(s ...googleapi.Field) *LiveBroadcastsTransitionCall {
12834 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12835 return c
12836 }
12837
12838 // Context sets the context to be used in this call's Do method.
12839 func (c *LiveBroadcastsTransitionCall) Context(ctx context.Context) *LiveBroadcastsTransitionCall {
12840 c.ctx_ = ctx
12841 return c
12842 }
12843
12844 // Header returns a http.Header that can be modified by the caller to add
12845 // headers to the request.
12846 func (c *LiveBroadcastsTransitionCall) Header() http.Header {
12847 if c.header_ == nil {
12848 c.header_ = make(http.Header)
12849 }
12850 return c.header_
12851 }
12852
12853 func (c *LiveBroadcastsTransitionCall) doRequest(alt string) (*http.Response, error) {
12854 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
12855 c.urlParams_.Set("alt", alt)
12856 c.urlParams_.Set("prettyPrint", "false")
12857 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts/transition")
12858 urls += "?" + c.urlParams_.Encode()
12859 req, err := http.NewRequest("POST", urls, nil)
12860 if err != nil {
12861 return nil, err
12862 }
12863 req.Header = reqHeaders
12864 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.transition", "request", internallog.HTTPRequest(req, nil))
12865 return gensupport.SendRequest(c.ctx_, c.s.client, req)
12866 }
12867
12868 // Do executes the "youtube.liveBroadcasts.transition" call.
12869 // Any non-2xx status code is an error. Response headers are in either
12870 // *LiveBroadcast.ServerResponse.Header or (if a response was returned at all)
12871 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
12872 // whether the returned error was because http.StatusNotModified was returned.
12873 func (c *LiveBroadcastsTransitionCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
12874 gensupport.SetOptions(c.urlParams_, opts...)
12875 res, err := c.doRequest("json")
12876 if res != nil && res.StatusCode == http.StatusNotModified {
12877 if res.Body != nil {
12878 res.Body.Close()
12879 }
12880 return nil, gensupport.WrapError(&googleapi.Error{
12881 Code: res.StatusCode,
12882 Header: res.Header,
12883 })
12884 }
12885 if err != nil {
12886 return nil, err
12887 }
12888 defer googleapi.CloseBody(res)
12889 if err := googleapi.CheckResponse(res); err != nil {
12890 return nil, gensupport.WrapError(err)
12891 }
12892 ret := &LiveBroadcast{
12893 ServerResponse: googleapi.ServerResponse{
12894 Header: res.Header,
12895 HTTPStatusCode: res.StatusCode,
12896 },
12897 }
12898 target := &ret
12899 b, err := gensupport.DecodeResponseBytes(target, res)
12900 if err != nil {
12901 return nil, err
12902 }
12903 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.transition", "response", internallog.HTTPResponse(res, b))
12904 return ret, nil
12905 }
12906
12907 type LiveBroadcastsUpdateCall struct {
12908 s *Service
12909 livebroadcast *LiveBroadcast
12910 urlParams_ gensupport.URLParams
12911 ctx_ context.Context
12912 header_ http.Header
12913 }
12914
12915 // Update: Updates an existing broadcast for the authenticated user.
12916 //
12917 // - part: The *part* parameter serves two purposes in this operation. It
12918 // identifies the properties that the write operation will set as well as the
12919 // properties that the API response will include. The part properties that
12920 // you can include in the parameter value are id, snippet, contentDetails,
12921 // and status. Note that this method will override the existing values for
12922 // all of the mutable properties that are contained in any parts that the
12923 // parameter value specifies. For example, a broadcast's privacy status is
12924 // defined in the status part. As such, if your request is updating a private
12925 // or unlisted broadcast, and the request's part parameter value includes the
12926 // status part, the broadcast's privacy setting will be updated to whatever
12927 // value the request body specifies. If the request body does not specify a
12928 // value, the existing privacy setting will be removed and the broadcast will
12929 // revert to the default privacy setting.
12930 func (r *LiveBroadcastsService) Update(part []string, livebroadcast *LiveBroadcast) *LiveBroadcastsUpdateCall {
12931 c := &LiveBroadcastsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12932 c.urlParams_.SetMulti("part", append([]string{}, part...))
12933 c.livebroadcast = livebroadcast
12934 return c
12935 }
12936
12937 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
12938 // *Note:* This parameter is intended exclusively for YouTube content partners.
12939 // The *onBehalfOfContentOwner* parameter indicates that the request's
12940 // authorization credentials identify a YouTube CMS user who is acting on
12941 // behalf of the content owner specified in the parameter value. This parameter
12942 // is intended for YouTube content partners that own and manage many different
12943 // YouTube channels. It allows content owners to authenticate once and get
12944 // access to all their video and channel data, without having to provide
12945 // authentication credentials for each individual channel. The CMS account that
12946 // the user authenticates with must be linked to the specified YouTube content
12947 // owner.
12948 func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsUpdateCall {
12949 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
12950 return c
12951 }
12952
12953 // OnBehalfOfContentOwnerChannel sets the optional parameter
12954 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
12955 // properly authorized request. *Note:* This parameter is intended exclusively
12956 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
12957 // specifies the YouTube channel ID of the channel to which a video is being
12958 // added. This parameter is required when a request specifies a value for the
12959 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
12960 // with that parameter. In addition, the request must be authorized using a CMS
12961 // account that is linked to the content owner that the onBehalfOfContentOwner
12962 // parameter specifies. Finally, the channel that the
12963 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
12964 // the content owner that the onBehalfOfContentOwner parameter specifies. This
12965 // parameter is intended for YouTube content partners that own and manage many
12966 // different YouTube channels. It allows content owners to authenticate once
12967 // and perform actions on behalf of the channel specified in the parameter
12968 // value, without having to provide authentication credentials for each
12969 // separate channel.
12970 func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsUpdateCall {
12971 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
12972 return c
12973 }
12974
12975 // Fields allows partial responses to be retrieved. See
12976 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
12977 // details.
12978 func (c *LiveBroadcastsUpdateCall) Fields(s ...googleapi.Field) *LiveBroadcastsUpdateCall {
12979 c.urlParams_.Set("fields", googleapi.CombineFields(s))
12980 return c
12981 }
12982
12983 // Context sets the context to be used in this call's Do method.
12984 func (c *LiveBroadcastsUpdateCall) Context(ctx context.Context) *LiveBroadcastsUpdateCall {
12985 c.ctx_ = ctx
12986 return c
12987 }
12988
12989 // Header returns a http.Header that can be modified by the caller to add
12990 // headers to the request.
12991 func (c *LiveBroadcastsUpdateCall) Header() http.Header {
12992 if c.header_ == nil {
12993 c.header_ = make(http.Header)
12994 }
12995 return c.header_
12996 }
12997
12998 func (c *LiveBroadcastsUpdateCall) doRequest(alt string) (*http.Response, error) {
12999 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13000 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livebroadcast)
13001 if err != nil {
13002 return nil, err
13003 }
13004 c.urlParams_.Set("alt", alt)
13005 c.urlParams_.Set("prettyPrint", "false")
13006 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveBroadcasts")
13007 urls += "?" + c.urlParams_.Encode()
13008 req, err := http.NewRequest("PUT", urls, body)
13009 if err != nil {
13010 return nil, err
13011 }
13012 req.Header = reqHeaders
13013 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.update", "request", internallog.HTTPRequest(req, body.Bytes()))
13014 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13015 }
13016
13017 // Do executes the "youtube.liveBroadcasts.update" call.
13018 // Any non-2xx status code is an error. Response headers are in either
13019 // *LiveBroadcast.ServerResponse.Header or (if a response was returned at all)
13020 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13021 // whether the returned error was because http.StatusNotModified was returned.
13022 func (c *LiveBroadcastsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
13023 gensupport.SetOptions(c.urlParams_, opts...)
13024 res, err := c.doRequest("json")
13025 if res != nil && res.StatusCode == http.StatusNotModified {
13026 if res.Body != nil {
13027 res.Body.Close()
13028 }
13029 return nil, gensupport.WrapError(&googleapi.Error{
13030 Code: res.StatusCode,
13031 Header: res.Header,
13032 })
13033 }
13034 if err != nil {
13035 return nil, err
13036 }
13037 defer googleapi.CloseBody(res)
13038 if err := googleapi.CheckResponse(res); err != nil {
13039 return nil, gensupport.WrapError(err)
13040 }
13041 ret := &LiveBroadcast{
13042 ServerResponse: googleapi.ServerResponse{
13043 Header: res.Header,
13044 HTTPStatusCode: res.StatusCode,
13045 },
13046 }
13047 target := &ret
13048 b, err := gensupport.DecodeResponseBytes(target, res)
13049 if err != nil {
13050 return nil, err
13051 }
13052 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveBroadcasts.update", "response", internallog.HTTPResponse(res, b))
13053 return ret, nil
13054 }
13055
13056 type LiveChatBansDeleteCall struct {
13057 s *Service
13058 urlParams_ gensupport.URLParams
13059 ctx_ context.Context
13060 header_ http.Header
13061 }
13062
13063 // Delete: Deletes a chat ban.
13064 //
13065 // - id: .
13066 func (r *LiveChatBansService) Delete(id string) *LiveChatBansDeleteCall {
13067 c := &LiveChatBansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13068 c.urlParams_.Set("id", id)
13069 return c
13070 }
13071
13072 // Fields allows partial responses to be retrieved. See
13073 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13074 // details.
13075 func (c *LiveChatBansDeleteCall) Fields(s ...googleapi.Field) *LiveChatBansDeleteCall {
13076 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13077 return c
13078 }
13079
13080 // Context sets the context to be used in this call's Do method.
13081 func (c *LiveChatBansDeleteCall) Context(ctx context.Context) *LiveChatBansDeleteCall {
13082 c.ctx_ = ctx
13083 return c
13084 }
13085
13086 // Header returns a http.Header that can be modified by the caller to add
13087 // headers to the request.
13088 func (c *LiveChatBansDeleteCall) Header() http.Header {
13089 if c.header_ == nil {
13090 c.header_ = make(http.Header)
13091 }
13092 return c.header_
13093 }
13094
13095 func (c *LiveChatBansDeleteCall) doRequest(alt string) (*http.Response, error) {
13096 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13097 c.urlParams_.Set("alt", alt)
13098 c.urlParams_.Set("prettyPrint", "false")
13099 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/bans")
13100 urls += "?" + c.urlParams_.Encode()
13101 req, err := http.NewRequest("DELETE", urls, nil)
13102 if err != nil {
13103 return nil, err
13104 }
13105 req.Header = reqHeaders
13106 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatBans.delete", "request", internallog.HTTPRequest(req, nil))
13107 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13108 }
13109
13110 // Do executes the "youtube.liveChatBans.delete" call.
13111 func (c *LiveChatBansDeleteCall) Do(opts ...googleapi.CallOption) error {
13112 gensupport.SetOptions(c.urlParams_, opts...)
13113 res, err := c.doRequest("json")
13114 if err != nil {
13115 return err
13116 }
13117 defer googleapi.CloseBody(res)
13118 if err := googleapi.CheckResponse(res); err != nil {
13119 return gensupport.WrapError(err)
13120 }
13121 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatBans.delete", "response", internallog.HTTPResponse(res, nil))
13122 return nil
13123 }
13124
13125 type LiveChatBansInsertCall struct {
13126 s *Service
13127 livechatban *LiveChatBan
13128 urlParams_ gensupport.URLParams
13129 ctx_ context.Context
13130 header_ http.Header
13131 }
13132
13133 // Insert: Inserts a new resource into this collection.
13134 //
13135 // - part: The *part* parameter serves two purposes in this operation. It
13136 // identifies the properties that the write operation will set as well as the
13137 // properties that the API response returns. Set the parameter value to
13138 // snippet.
13139 func (r *LiveChatBansService) Insert(part []string, livechatban *LiveChatBan) *LiveChatBansInsertCall {
13140 c := &LiveChatBansInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13141 c.urlParams_.SetMulti("part", append([]string{}, part...))
13142 c.livechatban = livechatban
13143 return c
13144 }
13145
13146 // Fields allows partial responses to be retrieved. See
13147 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13148 // details.
13149 func (c *LiveChatBansInsertCall) Fields(s ...googleapi.Field) *LiveChatBansInsertCall {
13150 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13151 return c
13152 }
13153
13154 // Context sets the context to be used in this call's Do method.
13155 func (c *LiveChatBansInsertCall) Context(ctx context.Context) *LiveChatBansInsertCall {
13156 c.ctx_ = ctx
13157 return c
13158 }
13159
13160 // Header returns a http.Header that can be modified by the caller to add
13161 // headers to the request.
13162 func (c *LiveChatBansInsertCall) Header() http.Header {
13163 if c.header_ == nil {
13164 c.header_ = make(http.Header)
13165 }
13166 return c.header_
13167 }
13168
13169 func (c *LiveChatBansInsertCall) doRequest(alt string) (*http.Response, error) {
13170 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13171 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livechatban)
13172 if err != nil {
13173 return nil, err
13174 }
13175 c.urlParams_.Set("alt", alt)
13176 c.urlParams_.Set("prettyPrint", "false")
13177 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/bans")
13178 urls += "?" + c.urlParams_.Encode()
13179 req, err := http.NewRequest("POST", urls, body)
13180 if err != nil {
13181 return nil, err
13182 }
13183 req.Header = reqHeaders
13184 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatBans.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
13185 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13186 }
13187
13188 // Do executes the "youtube.liveChatBans.insert" call.
13189 // Any non-2xx status code is an error. Response headers are in either
13190 // *LiveChatBan.ServerResponse.Header or (if a response was returned at all) in
13191 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
13192 // whether the returned error was because http.StatusNotModified was returned.
13193 func (c *LiveChatBansInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatBan, error) {
13194 gensupport.SetOptions(c.urlParams_, opts...)
13195 res, err := c.doRequest("json")
13196 if res != nil && res.StatusCode == http.StatusNotModified {
13197 if res.Body != nil {
13198 res.Body.Close()
13199 }
13200 return nil, gensupport.WrapError(&googleapi.Error{
13201 Code: res.StatusCode,
13202 Header: res.Header,
13203 })
13204 }
13205 if err != nil {
13206 return nil, err
13207 }
13208 defer googleapi.CloseBody(res)
13209 if err := googleapi.CheckResponse(res); err != nil {
13210 return nil, gensupport.WrapError(err)
13211 }
13212 ret := &LiveChatBan{
13213 ServerResponse: googleapi.ServerResponse{
13214 Header: res.Header,
13215 HTTPStatusCode: res.StatusCode,
13216 },
13217 }
13218 target := &ret
13219 b, err := gensupport.DecodeResponseBytes(target, res)
13220 if err != nil {
13221 return nil, err
13222 }
13223 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatBans.insert", "response", internallog.HTTPResponse(res, b))
13224 return ret, nil
13225 }
13226
13227 type LiveChatMessagesDeleteCall struct {
13228 s *Service
13229 urlParams_ gensupport.URLParams
13230 ctx_ context.Context
13231 header_ http.Header
13232 }
13233
13234 // Delete: Deletes a chat message.
13235 //
13236 // - id: .
13237 func (r *LiveChatMessagesService) Delete(id string) *LiveChatMessagesDeleteCall {
13238 c := &LiveChatMessagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13239 c.urlParams_.Set("id", id)
13240 return c
13241 }
13242
13243 // Fields allows partial responses to be retrieved. See
13244 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13245 // details.
13246 func (c *LiveChatMessagesDeleteCall) Fields(s ...googleapi.Field) *LiveChatMessagesDeleteCall {
13247 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13248 return c
13249 }
13250
13251 // Context sets the context to be used in this call's Do method.
13252 func (c *LiveChatMessagesDeleteCall) Context(ctx context.Context) *LiveChatMessagesDeleteCall {
13253 c.ctx_ = ctx
13254 return c
13255 }
13256
13257 // Header returns a http.Header that can be modified by the caller to add
13258 // headers to the request.
13259 func (c *LiveChatMessagesDeleteCall) Header() http.Header {
13260 if c.header_ == nil {
13261 c.header_ = make(http.Header)
13262 }
13263 return c.header_
13264 }
13265
13266 func (c *LiveChatMessagesDeleteCall) doRequest(alt string) (*http.Response, error) {
13267 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13268 c.urlParams_.Set("alt", alt)
13269 c.urlParams_.Set("prettyPrint", "false")
13270 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages")
13271 urls += "?" + c.urlParams_.Encode()
13272 req, err := http.NewRequest("DELETE", urls, nil)
13273 if err != nil {
13274 return nil, err
13275 }
13276 req.Header = reqHeaders
13277 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.delete", "request", internallog.HTTPRequest(req, nil))
13278 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13279 }
13280
13281 // Do executes the "youtube.liveChatMessages.delete" call.
13282 func (c *LiveChatMessagesDeleteCall) Do(opts ...googleapi.CallOption) error {
13283 gensupport.SetOptions(c.urlParams_, opts...)
13284 res, err := c.doRequest("json")
13285 if err != nil {
13286 return err
13287 }
13288 defer googleapi.CloseBody(res)
13289 if err := googleapi.CheckResponse(res); err != nil {
13290 return gensupport.WrapError(err)
13291 }
13292 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.delete", "response", internallog.HTTPResponse(res, nil))
13293 return nil
13294 }
13295
13296 type LiveChatMessagesInsertCall struct {
13297 s *Service
13298 livechatmessage *LiveChatMessage
13299 urlParams_ gensupport.URLParams
13300 ctx_ context.Context
13301 header_ http.Header
13302 }
13303
13304 // Insert: Inserts a new resource into this collection.
13305 //
13306 // - part: The *part* parameter serves two purposes. It identifies the
13307 // properties that the write operation will set as well as the properties
13308 // that the API response will include. Set the parameter value to snippet.
13309 func (r *LiveChatMessagesService) Insert(part []string, livechatmessage *LiveChatMessage) *LiveChatMessagesInsertCall {
13310 c := &LiveChatMessagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13311 c.urlParams_.SetMulti("part", append([]string{}, part...))
13312 c.livechatmessage = livechatmessage
13313 return c
13314 }
13315
13316 // Fields allows partial responses to be retrieved. See
13317 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13318 // details.
13319 func (c *LiveChatMessagesInsertCall) Fields(s ...googleapi.Field) *LiveChatMessagesInsertCall {
13320 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13321 return c
13322 }
13323
13324 // Context sets the context to be used in this call's Do method.
13325 func (c *LiveChatMessagesInsertCall) Context(ctx context.Context) *LiveChatMessagesInsertCall {
13326 c.ctx_ = ctx
13327 return c
13328 }
13329
13330 // Header returns a http.Header that can be modified by the caller to add
13331 // headers to the request.
13332 func (c *LiveChatMessagesInsertCall) Header() http.Header {
13333 if c.header_ == nil {
13334 c.header_ = make(http.Header)
13335 }
13336 return c.header_
13337 }
13338
13339 func (c *LiveChatMessagesInsertCall) doRequest(alt string) (*http.Response, error) {
13340 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13341 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livechatmessage)
13342 if err != nil {
13343 return nil, err
13344 }
13345 c.urlParams_.Set("alt", alt)
13346 c.urlParams_.Set("prettyPrint", "false")
13347 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages")
13348 urls += "?" + c.urlParams_.Encode()
13349 req, err := http.NewRequest("POST", urls, body)
13350 if err != nil {
13351 return nil, err
13352 }
13353 req.Header = reqHeaders
13354 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
13355 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13356 }
13357
13358 // Do executes the "youtube.liveChatMessages.insert" call.
13359 // Any non-2xx status code is an error. Response headers are in either
13360 // *LiveChatMessage.ServerResponse.Header or (if a response was returned at
13361 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13362 // check whether the returned error was because http.StatusNotModified was
13363 // returned.
13364 func (c *LiveChatMessagesInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatMessage, error) {
13365 gensupport.SetOptions(c.urlParams_, opts...)
13366 res, err := c.doRequest("json")
13367 if res != nil && res.StatusCode == http.StatusNotModified {
13368 if res.Body != nil {
13369 res.Body.Close()
13370 }
13371 return nil, gensupport.WrapError(&googleapi.Error{
13372 Code: res.StatusCode,
13373 Header: res.Header,
13374 })
13375 }
13376 if err != nil {
13377 return nil, err
13378 }
13379 defer googleapi.CloseBody(res)
13380 if err := googleapi.CheckResponse(res); err != nil {
13381 return nil, gensupport.WrapError(err)
13382 }
13383 ret := &LiveChatMessage{
13384 ServerResponse: googleapi.ServerResponse{
13385 Header: res.Header,
13386 HTTPStatusCode: res.StatusCode,
13387 },
13388 }
13389 target := &ret
13390 b, err := gensupport.DecodeResponseBytes(target, res)
13391 if err != nil {
13392 return nil, err
13393 }
13394 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.insert", "response", internallog.HTTPResponse(res, b))
13395 return ret, nil
13396 }
13397
13398 type LiveChatMessagesListCall struct {
13399 s *Service
13400 urlParams_ gensupport.URLParams
13401 ifNoneMatch_ string
13402 ctx_ context.Context
13403 header_ http.Header
13404 }
13405
13406 // List: Retrieves a list of resources, possibly filtered.
13407 //
13408 // - liveChatId: The id of the live chat for which comments should be returned.
13409 // - part: The *part* parameter specifies the liveChatComment resource parts
13410 // that the API response will include. Supported values are id, snippet, and
13411 // authorDetails.
13412 func (r *LiveChatMessagesService) List(liveChatId string, part []string) *LiveChatMessagesListCall {
13413 c := &LiveChatMessagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13414 c.urlParams_.Set("liveChatId", liveChatId)
13415 c.urlParams_.SetMulti("part", append([]string{}, part...))
13416 return c
13417 }
13418
13419 // Hl sets the optional parameter "hl": Specifies the localization language in
13420 // which the system messages should be returned.
13421 func (c *LiveChatMessagesListCall) Hl(hl string) *LiveChatMessagesListCall {
13422 c.urlParams_.Set("hl", hl)
13423 return c
13424 }
13425
13426 // MaxResults sets the optional parameter "maxResults": The *maxResults*
13427 // parameter specifies the maximum number of items that should be returned in
13428 // the result set. Not used in the streaming RPC.
13429 func (c *LiveChatMessagesListCall) MaxResults(maxResults int64) *LiveChatMessagesListCall {
13430 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
13431 return c
13432 }
13433
13434 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
13435 // identifies a specific page in the result set that should be returned. In an
13436 // API response, the nextPageToken property identify other pages that could be
13437 // retrieved.
13438 func (c *LiveChatMessagesListCall) PageToken(pageToken string) *LiveChatMessagesListCall {
13439 c.urlParams_.Set("pageToken", pageToken)
13440 return c
13441 }
13442
13443 // ProfileImageSize sets the optional parameter "profileImageSize": Specifies
13444 // the size of the profile image that should be returned for each user.
13445 func (c *LiveChatMessagesListCall) ProfileImageSize(profileImageSize int64) *LiveChatMessagesListCall {
13446 c.urlParams_.Set("profileImageSize", fmt.Sprint(profileImageSize))
13447 return c
13448 }
13449
13450 // Fields allows partial responses to be retrieved. See
13451 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13452 // details.
13453 func (c *LiveChatMessagesListCall) Fields(s ...googleapi.Field) *LiveChatMessagesListCall {
13454 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13455 return c
13456 }
13457
13458 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13459 // object's ETag matches the given value. This is useful for getting updates
13460 // only after the object has changed since the last request.
13461 func (c *LiveChatMessagesListCall) IfNoneMatch(entityTag string) *LiveChatMessagesListCall {
13462 c.ifNoneMatch_ = entityTag
13463 return c
13464 }
13465
13466 // Context sets the context to be used in this call's Do method.
13467 func (c *LiveChatMessagesListCall) Context(ctx context.Context) *LiveChatMessagesListCall {
13468 c.ctx_ = ctx
13469 return c
13470 }
13471
13472 // Header returns a http.Header that can be modified by the caller to add
13473 // headers to the request.
13474 func (c *LiveChatMessagesListCall) Header() http.Header {
13475 if c.header_ == nil {
13476 c.header_ = make(http.Header)
13477 }
13478 return c.header_
13479 }
13480
13481 func (c *LiveChatMessagesListCall) doRequest(alt string) (*http.Response, error) {
13482 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13483 if c.ifNoneMatch_ != "" {
13484 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13485 }
13486 c.urlParams_.Set("alt", alt)
13487 c.urlParams_.Set("prettyPrint", "false")
13488 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages")
13489 urls += "?" + c.urlParams_.Encode()
13490 req, err := http.NewRequest("GET", urls, nil)
13491 if err != nil {
13492 return nil, err
13493 }
13494 req.Header = reqHeaders
13495 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.list", "request", internallog.HTTPRequest(req, nil))
13496 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13497 }
13498
13499 // Do executes the "youtube.liveChatMessages.list" call.
13500 // Any non-2xx status code is an error. Response headers are in either
13501 // *LiveChatMessageListResponse.ServerResponse.Header or (if a response was
13502 // returned at all) in error.(*googleapi.Error).Header. Use
13503 // googleapi.IsNotModified to check whether the returned error was because
13504 // http.StatusNotModified was returned.
13505 func (c *LiveChatMessagesListCall) Do(opts ...googleapi.CallOption) (*LiveChatMessageListResponse, error) {
13506 gensupport.SetOptions(c.urlParams_, opts...)
13507 res, err := c.doRequest("json")
13508 if res != nil && res.StatusCode == http.StatusNotModified {
13509 if res.Body != nil {
13510 res.Body.Close()
13511 }
13512 return nil, gensupport.WrapError(&googleapi.Error{
13513 Code: res.StatusCode,
13514 Header: res.Header,
13515 })
13516 }
13517 if err != nil {
13518 return nil, err
13519 }
13520 defer googleapi.CloseBody(res)
13521 if err := googleapi.CheckResponse(res); err != nil {
13522 return nil, gensupport.WrapError(err)
13523 }
13524 ret := &LiveChatMessageListResponse{
13525 ServerResponse: googleapi.ServerResponse{
13526 Header: res.Header,
13527 HTTPStatusCode: res.StatusCode,
13528 },
13529 }
13530 target := &ret
13531 b, err := gensupport.DecodeResponseBytes(target, res)
13532 if err != nil {
13533 return nil, err
13534 }
13535 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.list", "response", internallog.HTTPResponse(res, b))
13536 return ret, nil
13537 }
13538
13539 // Pages invokes f for each page of results.
13540 // A non-nil error returned from f will halt the iteration.
13541 // The provided context supersedes any context provided to the Context method.
13542 func (c *LiveChatMessagesListCall) Pages(ctx context.Context, f func(*LiveChatMessageListResponse) error) error {
13543 c.ctx_ = ctx
13544 defer c.PageToken(c.urlParams_.Get("pageToken"))
13545 for {
13546 x, err := c.Do()
13547 if err != nil {
13548 return err
13549 }
13550 if err := f(x); err != nil {
13551 return err
13552 }
13553 if x.NextPageToken == "" {
13554 return nil
13555 }
13556 c.PageToken(x.NextPageToken)
13557 }
13558 }
13559
13560 type LiveChatMessagesTransitionCall struct {
13561 s *Service
13562 urlParams_ gensupport.URLParams
13563 ctx_ context.Context
13564 header_ http.Header
13565 }
13566
13567 // Transition: Transition a durable chat event.
13568 func (r *LiveChatMessagesService) Transition() *LiveChatMessagesTransitionCall {
13569 c := &LiveChatMessagesTransitionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13570 return c
13571 }
13572
13573 // Id sets the optional parameter "id": The ID that uniquely identify the chat
13574 // message event to transition.
13575 func (c *LiveChatMessagesTransitionCall) Id(id string) *LiveChatMessagesTransitionCall {
13576 c.urlParams_.Set("id", id)
13577 return c
13578 }
13579
13580 // Status sets the optional parameter "status": The status to which the chat
13581 // event is going to transition.
13582 //
13583 // Possible values:
13584 //
13585 // "statusUnspecified" - Default unknown enum value.
13586 // "closed" - The durable chat event is over.
13587 func (c *LiveChatMessagesTransitionCall) Status(status string) *LiveChatMessagesTransitionCall {
13588 c.urlParams_.Set("status", status)
13589 return c
13590 }
13591
13592 // Fields allows partial responses to be retrieved. See
13593 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13594 // details.
13595 func (c *LiveChatMessagesTransitionCall) Fields(s ...googleapi.Field) *LiveChatMessagesTransitionCall {
13596 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13597 return c
13598 }
13599
13600 // Context sets the context to be used in this call's Do method.
13601 func (c *LiveChatMessagesTransitionCall) Context(ctx context.Context) *LiveChatMessagesTransitionCall {
13602 c.ctx_ = ctx
13603 return c
13604 }
13605
13606 // Header returns a http.Header that can be modified by the caller to add
13607 // headers to the request.
13608 func (c *LiveChatMessagesTransitionCall) Header() http.Header {
13609 if c.header_ == nil {
13610 c.header_ = make(http.Header)
13611 }
13612 return c.header_
13613 }
13614
13615 func (c *LiveChatMessagesTransitionCall) doRequest(alt string) (*http.Response, error) {
13616 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13617 c.urlParams_.Set("alt", alt)
13618 c.urlParams_.Set("prettyPrint", "false")
13619 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages/transition")
13620 urls += "?" + c.urlParams_.Encode()
13621 req, err := http.NewRequest("POST", urls, nil)
13622 if err != nil {
13623 return nil, err
13624 }
13625 req.Header = reqHeaders
13626 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.transition", "request", internallog.HTTPRequest(req, nil))
13627 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13628 }
13629
13630 // Do executes the "youtube.liveChatMessages.transition" call.
13631 // Any non-2xx status code is an error. Response headers are in either
13632 // *LiveChatMessage.ServerResponse.Header or (if a response was returned at
13633 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13634 // check whether the returned error was because http.StatusNotModified was
13635 // returned.
13636 func (c *LiveChatMessagesTransitionCall) Do(opts ...googleapi.CallOption) (*LiveChatMessage, error) {
13637 gensupport.SetOptions(c.urlParams_, opts...)
13638 res, err := c.doRequest("json")
13639 if res != nil && res.StatusCode == http.StatusNotModified {
13640 if res.Body != nil {
13641 res.Body.Close()
13642 }
13643 return nil, gensupport.WrapError(&googleapi.Error{
13644 Code: res.StatusCode,
13645 Header: res.Header,
13646 })
13647 }
13648 if err != nil {
13649 return nil, err
13650 }
13651 defer googleapi.CloseBody(res)
13652 if err := googleapi.CheckResponse(res); err != nil {
13653 return nil, gensupport.WrapError(err)
13654 }
13655 ret := &LiveChatMessage{
13656 ServerResponse: googleapi.ServerResponse{
13657 Header: res.Header,
13658 HTTPStatusCode: res.StatusCode,
13659 },
13660 }
13661 target := &ret
13662 b, err := gensupport.DecodeResponseBytes(target, res)
13663 if err != nil {
13664 return nil, err
13665 }
13666 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatMessages.transition", "response", internallog.HTTPResponse(res, b))
13667 return ret, nil
13668 }
13669
13670 type LiveChatModeratorsDeleteCall struct {
13671 s *Service
13672 urlParams_ gensupport.URLParams
13673 ctx_ context.Context
13674 header_ http.Header
13675 }
13676
13677 // Delete: Deletes a chat moderator.
13678 //
13679 // - id: .
13680 func (r *LiveChatModeratorsService) Delete(id string) *LiveChatModeratorsDeleteCall {
13681 c := &LiveChatModeratorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13682 c.urlParams_.Set("id", id)
13683 return c
13684 }
13685
13686 // Fields allows partial responses to be retrieved. See
13687 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13688 // details.
13689 func (c *LiveChatModeratorsDeleteCall) Fields(s ...googleapi.Field) *LiveChatModeratorsDeleteCall {
13690 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13691 return c
13692 }
13693
13694 // Context sets the context to be used in this call's Do method.
13695 func (c *LiveChatModeratorsDeleteCall) Context(ctx context.Context) *LiveChatModeratorsDeleteCall {
13696 c.ctx_ = ctx
13697 return c
13698 }
13699
13700 // Header returns a http.Header that can be modified by the caller to add
13701 // headers to the request.
13702 func (c *LiveChatModeratorsDeleteCall) Header() http.Header {
13703 if c.header_ == nil {
13704 c.header_ = make(http.Header)
13705 }
13706 return c.header_
13707 }
13708
13709 func (c *LiveChatModeratorsDeleteCall) doRequest(alt string) (*http.Response, error) {
13710 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13711 c.urlParams_.Set("alt", alt)
13712 c.urlParams_.Set("prettyPrint", "false")
13713 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/moderators")
13714 urls += "?" + c.urlParams_.Encode()
13715 req, err := http.NewRequest("DELETE", urls, nil)
13716 if err != nil {
13717 return nil, err
13718 }
13719 req.Header = reqHeaders
13720 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatModerators.delete", "request", internallog.HTTPRequest(req, nil))
13721 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13722 }
13723
13724 // Do executes the "youtube.liveChatModerators.delete" call.
13725 func (c *LiveChatModeratorsDeleteCall) Do(opts ...googleapi.CallOption) error {
13726 gensupport.SetOptions(c.urlParams_, opts...)
13727 res, err := c.doRequest("json")
13728 if err != nil {
13729 return err
13730 }
13731 defer googleapi.CloseBody(res)
13732 if err := googleapi.CheckResponse(res); err != nil {
13733 return gensupport.WrapError(err)
13734 }
13735 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatModerators.delete", "response", internallog.HTTPResponse(res, nil))
13736 return nil
13737 }
13738
13739 type LiveChatModeratorsInsertCall struct {
13740 s *Service
13741 livechatmoderator *LiveChatModerator
13742 urlParams_ gensupport.URLParams
13743 ctx_ context.Context
13744 header_ http.Header
13745 }
13746
13747 // Insert: Inserts a new resource into this collection.
13748 //
13749 // - part: The *part* parameter serves two purposes in this operation. It
13750 // identifies the properties that the write operation will set as well as the
13751 // properties that the API response returns. Set the parameter value to
13752 // snippet.
13753 func (r *LiveChatModeratorsService) Insert(part []string, livechatmoderator *LiveChatModerator) *LiveChatModeratorsInsertCall {
13754 c := &LiveChatModeratorsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13755 c.urlParams_.SetMulti("part", append([]string{}, part...))
13756 c.livechatmoderator = livechatmoderator
13757 return c
13758 }
13759
13760 // Fields allows partial responses to be retrieved. See
13761 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13762 // details.
13763 func (c *LiveChatModeratorsInsertCall) Fields(s ...googleapi.Field) *LiveChatModeratorsInsertCall {
13764 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13765 return c
13766 }
13767
13768 // Context sets the context to be used in this call's Do method.
13769 func (c *LiveChatModeratorsInsertCall) Context(ctx context.Context) *LiveChatModeratorsInsertCall {
13770 c.ctx_ = ctx
13771 return c
13772 }
13773
13774 // Header returns a http.Header that can be modified by the caller to add
13775 // headers to the request.
13776 func (c *LiveChatModeratorsInsertCall) Header() http.Header {
13777 if c.header_ == nil {
13778 c.header_ = make(http.Header)
13779 }
13780 return c.header_
13781 }
13782
13783 func (c *LiveChatModeratorsInsertCall) doRequest(alt string) (*http.Response, error) {
13784 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
13785 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livechatmoderator)
13786 if err != nil {
13787 return nil, err
13788 }
13789 c.urlParams_.Set("alt", alt)
13790 c.urlParams_.Set("prettyPrint", "false")
13791 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/moderators")
13792 urls += "?" + c.urlParams_.Encode()
13793 req, err := http.NewRequest("POST", urls, body)
13794 if err != nil {
13795 return nil, err
13796 }
13797 req.Header = reqHeaders
13798 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatModerators.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
13799 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13800 }
13801
13802 // Do executes the "youtube.liveChatModerators.insert" call.
13803 // Any non-2xx status code is an error. Response headers are in either
13804 // *LiveChatModerator.ServerResponse.Header or (if a response was returned at
13805 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13806 // check whether the returned error was because http.StatusNotModified was
13807 // returned.
13808 func (c *LiveChatModeratorsInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatModerator, error) {
13809 gensupport.SetOptions(c.urlParams_, opts...)
13810 res, err := c.doRequest("json")
13811 if res != nil && res.StatusCode == http.StatusNotModified {
13812 if res.Body != nil {
13813 res.Body.Close()
13814 }
13815 return nil, gensupport.WrapError(&googleapi.Error{
13816 Code: res.StatusCode,
13817 Header: res.Header,
13818 })
13819 }
13820 if err != nil {
13821 return nil, err
13822 }
13823 defer googleapi.CloseBody(res)
13824 if err := googleapi.CheckResponse(res); err != nil {
13825 return nil, gensupport.WrapError(err)
13826 }
13827 ret := &LiveChatModerator{
13828 ServerResponse: googleapi.ServerResponse{
13829 Header: res.Header,
13830 HTTPStatusCode: res.StatusCode,
13831 },
13832 }
13833 target := &ret
13834 b, err := gensupport.DecodeResponseBytes(target, res)
13835 if err != nil {
13836 return nil, err
13837 }
13838 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatModerators.insert", "response", internallog.HTTPResponse(res, b))
13839 return ret, nil
13840 }
13841
13842 type LiveChatModeratorsListCall struct {
13843 s *Service
13844 urlParams_ gensupport.URLParams
13845 ifNoneMatch_ string
13846 ctx_ context.Context
13847 header_ http.Header
13848 }
13849
13850 // List: Retrieves a list of resources, possibly filtered.
13851 //
13852 // - liveChatId: The id of the live chat for which moderators should be
13853 // returned.
13854 // - part: The *part* parameter specifies the liveChatModerator resource parts
13855 // that the API response will include. Supported values are id and snippet.
13856 func (r *LiveChatModeratorsService) List(liveChatId string, part []string) *LiveChatModeratorsListCall {
13857 c := &LiveChatModeratorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13858 c.urlParams_.Set("liveChatId", liveChatId)
13859 c.urlParams_.SetMulti("part", append([]string{}, part...))
13860 return c
13861 }
13862
13863 // MaxResults sets the optional parameter "maxResults": The *maxResults*
13864 // parameter specifies the maximum number of items that should be returned in
13865 // the result set.
13866 func (c *LiveChatModeratorsListCall) MaxResults(maxResults int64) *LiveChatModeratorsListCall {
13867 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
13868 return c
13869 }
13870
13871 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
13872 // identifies a specific page in the result set that should be returned. In an
13873 // API response, the nextPageToken and prevPageToken properties identify other
13874 // pages that could be retrieved.
13875 func (c *LiveChatModeratorsListCall) PageToken(pageToken string) *LiveChatModeratorsListCall {
13876 c.urlParams_.Set("pageToken", pageToken)
13877 return c
13878 }
13879
13880 // Fields allows partial responses to be retrieved. See
13881 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
13882 // details.
13883 func (c *LiveChatModeratorsListCall) Fields(s ...googleapi.Field) *LiveChatModeratorsListCall {
13884 c.urlParams_.Set("fields", googleapi.CombineFields(s))
13885 return c
13886 }
13887
13888 // IfNoneMatch sets an optional parameter which makes the operation fail if the
13889 // object's ETag matches the given value. This is useful for getting updates
13890 // only after the object has changed since the last request.
13891 func (c *LiveChatModeratorsListCall) IfNoneMatch(entityTag string) *LiveChatModeratorsListCall {
13892 c.ifNoneMatch_ = entityTag
13893 return c
13894 }
13895
13896 // Context sets the context to be used in this call's Do method.
13897 func (c *LiveChatModeratorsListCall) Context(ctx context.Context) *LiveChatModeratorsListCall {
13898 c.ctx_ = ctx
13899 return c
13900 }
13901
13902 // Header returns a http.Header that can be modified by the caller to add
13903 // headers to the request.
13904 func (c *LiveChatModeratorsListCall) Header() http.Header {
13905 if c.header_ == nil {
13906 c.header_ = make(http.Header)
13907 }
13908 return c.header_
13909 }
13910
13911 func (c *LiveChatModeratorsListCall) doRequest(alt string) (*http.Response, error) {
13912 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
13913 if c.ifNoneMatch_ != "" {
13914 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13915 }
13916 c.urlParams_.Set("alt", alt)
13917 c.urlParams_.Set("prettyPrint", "false")
13918 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/moderators")
13919 urls += "?" + c.urlParams_.Encode()
13920 req, err := http.NewRequest("GET", urls, nil)
13921 if err != nil {
13922 return nil, err
13923 }
13924 req.Header = reqHeaders
13925 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveChatModerators.list", "request", internallog.HTTPRequest(req, nil))
13926 return gensupport.SendRequest(c.ctx_, c.s.client, req)
13927 }
13928
13929 // Do executes the "youtube.liveChatModerators.list" call.
13930 // Any non-2xx status code is an error. Response headers are in either
13931 // *LiveChatModeratorListResponse.ServerResponse.Header or (if a response was
13932 // returned at all) in error.(*googleapi.Error).Header. Use
13933 // googleapi.IsNotModified to check whether the returned error was because
13934 // http.StatusNotModified was returned.
13935 func (c *LiveChatModeratorsListCall) Do(opts ...googleapi.CallOption) (*LiveChatModeratorListResponse, error) {
13936 gensupport.SetOptions(c.urlParams_, opts...)
13937 res, err := c.doRequest("json")
13938 if res != nil && res.StatusCode == http.StatusNotModified {
13939 if res.Body != nil {
13940 res.Body.Close()
13941 }
13942 return nil, gensupport.WrapError(&googleapi.Error{
13943 Code: res.StatusCode,
13944 Header: res.Header,
13945 })
13946 }
13947 if err != nil {
13948 return nil, err
13949 }
13950 defer googleapi.CloseBody(res)
13951 if err := googleapi.CheckResponse(res); err != nil {
13952 return nil, gensupport.WrapError(err)
13953 }
13954 ret := &LiveChatModeratorListResponse{
13955 ServerResponse: googleapi.ServerResponse{
13956 Header: res.Header,
13957 HTTPStatusCode: res.StatusCode,
13958 },
13959 }
13960 target := &ret
13961 b, err := gensupport.DecodeResponseBytes(target, res)
13962 if err != nil {
13963 return nil, err
13964 }
13965 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveChatModerators.list", "response", internallog.HTTPResponse(res, b))
13966 return ret, nil
13967 }
13968
13969 // Pages invokes f for each page of results.
13970 // A non-nil error returned from f will halt the iteration.
13971 // The provided context supersedes any context provided to the Context method.
13972 func (c *LiveChatModeratorsListCall) Pages(ctx context.Context, f func(*LiveChatModeratorListResponse) error) error {
13973 c.ctx_ = ctx
13974 defer c.PageToken(c.urlParams_.Get("pageToken"))
13975 for {
13976 x, err := c.Do()
13977 if err != nil {
13978 return err
13979 }
13980 if err := f(x); err != nil {
13981 return err
13982 }
13983 if x.NextPageToken == "" {
13984 return nil
13985 }
13986 c.PageToken(x.NextPageToken)
13987 }
13988 }
13989
13990 type LiveStreamsDeleteCall struct {
13991 s *Service
13992 urlParams_ gensupport.URLParams
13993 ctx_ context.Context
13994 header_ http.Header
13995 }
13996
13997 // Delete: Deletes an existing stream for the authenticated user.
13998 //
13999 // - id: .
14000 func (r *LiveStreamsService) Delete(id string) *LiveStreamsDeleteCall {
14001 c := &LiveStreamsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14002 c.urlParams_.Set("id", id)
14003 return c
14004 }
14005
14006 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
14007 // *Note:* This parameter is intended exclusively for YouTube content partners.
14008 // The *onBehalfOfContentOwner* parameter indicates that the request's
14009 // authorization credentials identify a YouTube CMS user who is acting on
14010 // behalf of the content owner specified in the parameter value. This parameter
14011 // is intended for YouTube content partners that own and manage many different
14012 // YouTube channels. It allows content owners to authenticate once and get
14013 // access to all their video and channel data, without having to provide
14014 // authentication credentials for each individual channel. The CMS account that
14015 // the user authenticates with must be linked to the specified YouTube content
14016 // owner.
14017 func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsDeleteCall {
14018 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
14019 return c
14020 }
14021
14022 // OnBehalfOfContentOwnerChannel sets the optional parameter
14023 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
14024 // properly authorized request. *Note:* This parameter is intended exclusively
14025 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
14026 // specifies the YouTube channel ID of the channel to which a video is being
14027 // added. This parameter is required when a request specifies a value for the
14028 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
14029 // with that parameter. In addition, the request must be authorized using a CMS
14030 // account that is linked to the content owner that the onBehalfOfContentOwner
14031 // parameter specifies. Finally, the channel that the
14032 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
14033 // the content owner that the onBehalfOfContentOwner parameter specifies. This
14034 // parameter is intended for YouTube content partners that own and manage many
14035 // different YouTube channels. It allows content owners to authenticate once
14036 // and perform actions on behalf of the channel specified in the parameter
14037 // value, without having to provide authentication credentials for each
14038 // separate channel.
14039 func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsDeleteCall {
14040 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
14041 return c
14042 }
14043
14044 // Fields allows partial responses to be retrieved. See
14045 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14046 // details.
14047 func (c *LiveStreamsDeleteCall) Fields(s ...googleapi.Field) *LiveStreamsDeleteCall {
14048 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14049 return c
14050 }
14051
14052 // Context sets the context to be used in this call's Do method.
14053 func (c *LiveStreamsDeleteCall) Context(ctx context.Context) *LiveStreamsDeleteCall {
14054 c.ctx_ = ctx
14055 return c
14056 }
14057
14058 // Header returns a http.Header that can be modified by the caller to add
14059 // headers to the request.
14060 func (c *LiveStreamsDeleteCall) Header() http.Header {
14061 if c.header_ == nil {
14062 c.header_ = make(http.Header)
14063 }
14064 return c.header_
14065 }
14066
14067 func (c *LiveStreamsDeleteCall) doRequest(alt string) (*http.Response, error) {
14068 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14069 c.urlParams_.Set("alt", alt)
14070 c.urlParams_.Set("prettyPrint", "false")
14071 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveStreams")
14072 urls += "?" + c.urlParams_.Encode()
14073 req, err := http.NewRequest("DELETE", urls, nil)
14074 if err != nil {
14075 return nil, err
14076 }
14077 req.Header = reqHeaders
14078 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveStreams.delete", "request", internallog.HTTPRequest(req, nil))
14079 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14080 }
14081
14082 // Do executes the "youtube.liveStreams.delete" call.
14083 func (c *LiveStreamsDeleteCall) Do(opts ...googleapi.CallOption) error {
14084 gensupport.SetOptions(c.urlParams_, opts...)
14085 res, err := c.doRequest("json")
14086 if err != nil {
14087 return err
14088 }
14089 defer googleapi.CloseBody(res)
14090 if err := googleapi.CheckResponse(res); err != nil {
14091 return gensupport.WrapError(err)
14092 }
14093 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveStreams.delete", "response", internallog.HTTPResponse(res, nil))
14094 return nil
14095 }
14096
14097 type LiveStreamsInsertCall struct {
14098 s *Service
14099 livestream *LiveStream
14100 urlParams_ gensupport.URLParams
14101 ctx_ context.Context
14102 header_ http.Header
14103 }
14104
14105 // Insert: Inserts a new stream for the authenticated user.
14106 //
14107 // - part: The *part* parameter serves two purposes in this operation. It
14108 // identifies the properties that the write operation will set as well as the
14109 // properties that the API response will include. The part properties that
14110 // you can include in the parameter value are id, snippet, cdn,
14111 // content_details, and status.
14112 func (r *LiveStreamsService) Insert(part []string, livestream *LiveStream) *LiveStreamsInsertCall {
14113 c := &LiveStreamsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14114 c.urlParams_.SetMulti("part", append([]string{}, part...))
14115 c.livestream = livestream
14116 return c
14117 }
14118
14119 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
14120 // *Note:* This parameter is intended exclusively for YouTube content partners.
14121 // The *onBehalfOfContentOwner* parameter indicates that the request's
14122 // authorization credentials identify a YouTube CMS user who is acting on
14123 // behalf of the content owner specified in the parameter value. This parameter
14124 // is intended for YouTube content partners that own and manage many different
14125 // YouTube channels. It allows content owners to authenticate once and get
14126 // access to all their video and channel data, without having to provide
14127 // authentication credentials for each individual channel. The CMS account that
14128 // the user authenticates with must be linked to the specified YouTube content
14129 // owner.
14130 func (c *LiveStreamsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsInsertCall {
14131 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
14132 return c
14133 }
14134
14135 // OnBehalfOfContentOwnerChannel sets the optional parameter
14136 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
14137 // properly authorized request. *Note:* This parameter is intended exclusively
14138 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
14139 // specifies the YouTube channel ID of the channel to which a video is being
14140 // added. This parameter is required when a request specifies a value for the
14141 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
14142 // with that parameter. In addition, the request must be authorized using a CMS
14143 // account that is linked to the content owner that the onBehalfOfContentOwner
14144 // parameter specifies. Finally, the channel that the
14145 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
14146 // the content owner that the onBehalfOfContentOwner parameter specifies. This
14147 // parameter is intended for YouTube content partners that own and manage many
14148 // different YouTube channels. It allows content owners to authenticate once
14149 // and perform actions on behalf of the channel specified in the parameter
14150 // value, without having to provide authentication credentials for each
14151 // separate channel.
14152 func (c *LiveStreamsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsInsertCall {
14153 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
14154 return c
14155 }
14156
14157 // Fields allows partial responses to be retrieved. See
14158 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14159 // details.
14160 func (c *LiveStreamsInsertCall) Fields(s ...googleapi.Field) *LiveStreamsInsertCall {
14161 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14162 return c
14163 }
14164
14165 // Context sets the context to be used in this call's Do method.
14166 func (c *LiveStreamsInsertCall) Context(ctx context.Context) *LiveStreamsInsertCall {
14167 c.ctx_ = ctx
14168 return c
14169 }
14170
14171 // Header returns a http.Header that can be modified by the caller to add
14172 // headers to the request.
14173 func (c *LiveStreamsInsertCall) Header() http.Header {
14174 if c.header_ == nil {
14175 c.header_ = make(http.Header)
14176 }
14177 return c.header_
14178 }
14179
14180 func (c *LiveStreamsInsertCall) doRequest(alt string) (*http.Response, error) {
14181 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14182 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livestream)
14183 if err != nil {
14184 return nil, err
14185 }
14186 c.urlParams_.Set("alt", alt)
14187 c.urlParams_.Set("prettyPrint", "false")
14188 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveStreams")
14189 urls += "?" + c.urlParams_.Encode()
14190 req, err := http.NewRequest("POST", urls, body)
14191 if err != nil {
14192 return nil, err
14193 }
14194 req.Header = reqHeaders
14195 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveStreams.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
14196 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14197 }
14198
14199 // Do executes the "youtube.liveStreams.insert" call.
14200 // Any non-2xx status code is an error. Response headers are in either
14201 // *LiveStream.ServerResponse.Header or (if a response was returned at all) in
14202 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14203 // whether the returned error was because http.StatusNotModified was returned.
14204 func (c *LiveStreamsInsertCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
14205 gensupport.SetOptions(c.urlParams_, opts...)
14206 res, err := c.doRequest("json")
14207 if res != nil && res.StatusCode == http.StatusNotModified {
14208 if res.Body != nil {
14209 res.Body.Close()
14210 }
14211 return nil, gensupport.WrapError(&googleapi.Error{
14212 Code: res.StatusCode,
14213 Header: res.Header,
14214 })
14215 }
14216 if err != nil {
14217 return nil, err
14218 }
14219 defer googleapi.CloseBody(res)
14220 if err := googleapi.CheckResponse(res); err != nil {
14221 return nil, gensupport.WrapError(err)
14222 }
14223 ret := &LiveStream{
14224 ServerResponse: googleapi.ServerResponse{
14225 Header: res.Header,
14226 HTTPStatusCode: res.StatusCode,
14227 },
14228 }
14229 target := &ret
14230 b, err := gensupport.DecodeResponseBytes(target, res)
14231 if err != nil {
14232 return nil, err
14233 }
14234 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveStreams.insert", "response", internallog.HTTPResponse(res, b))
14235 return ret, nil
14236 }
14237
14238 type LiveStreamsListCall struct {
14239 s *Service
14240 urlParams_ gensupport.URLParams
14241 ifNoneMatch_ string
14242 ctx_ context.Context
14243 header_ http.Header
14244 }
14245
14246 // List: Retrieve the list of streams associated with the given channel. --
14247 //
14248 // - part: The *part* parameter specifies a comma-separated list of one or more
14249 // liveStream resource properties that the API response will include. The
14250 // part names that you can include in the parameter value are id, snippet,
14251 // cdn, and status.
14252 func (r *LiveStreamsService) List(part []string) *LiveStreamsListCall {
14253 c := &LiveStreamsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14254 c.urlParams_.SetMulti("part", append([]string{}, part...))
14255 return c
14256 }
14257
14258 // Id sets the optional parameter "id": Return LiveStreams with the given ids
14259 // from Stubby or Apiary.
14260 func (c *LiveStreamsListCall) Id(id ...string) *LiveStreamsListCall {
14261 c.urlParams_.SetMulti("id", append([]string{}, id...))
14262 return c
14263 }
14264
14265 // MaxResults sets the optional parameter "maxResults": The *maxResults*
14266 // parameter specifies the maximum number of items that should be returned in
14267 // the result set.
14268 func (c *LiveStreamsListCall) MaxResults(maxResults int64) *LiveStreamsListCall {
14269 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
14270 return c
14271 }
14272
14273 // Mine sets the optional parameter "mine":
14274 func (c *LiveStreamsListCall) Mine(mine bool) *LiveStreamsListCall {
14275 c.urlParams_.Set("mine", fmt.Sprint(mine))
14276 return c
14277 }
14278
14279 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
14280 // *Note:* This parameter is intended exclusively for YouTube content partners.
14281 // The *onBehalfOfContentOwner* parameter indicates that the request's
14282 // authorization credentials identify a YouTube CMS user who is acting on
14283 // behalf of the content owner specified in the parameter value. This parameter
14284 // is intended for YouTube content partners that own and manage many different
14285 // YouTube channels. It allows content owners to authenticate once and get
14286 // access to all their video and channel data, without having to provide
14287 // authentication credentials for each individual channel. The CMS account that
14288 // the user authenticates with must be linked to the specified YouTube content
14289 // owner.
14290 func (c *LiveStreamsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsListCall {
14291 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
14292 return c
14293 }
14294
14295 // OnBehalfOfContentOwnerChannel sets the optional parameter
14296 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
14297 // properly authorized request. *Note:* This parameter is intended exclusively
14298 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
14299 // specifies the YouTube channel ID of the channel to which a video is being
14300 // added. This parameter is required when a request specifies a value for the
14301 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
14302 // with that parameter. In addition, the request must be authorized using a CMS
14303 // account that is linked to the content owner that the onBehalfOfContentOwner
14304 // parameter specifies. Finally, the channel that the
14305 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
14306 // the content owner that the onBehalfOfContentOwner parameter specifies. This
14307 // parameter is intended for YouTube content partners that own and manage many
14308 // different YouTube channels. It allows content owners to authenticate once
14309 // and perform actions on behalf of the channel specified in the parameter
14310 // value, without having to provide authentication credentials for each
14311 // separate channel.
14312 func (c *LiveStreamsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsListCall {
14313 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
14314 return c
14315 }
14316
14317 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
14318 // identifies a specific page in the result set that should be returned. In an
14319 // API response, the nextPageToken and prevPageToken properties identify other
14320 // pages that could be retrieved.
14321 func (c *LiveStreamsListCall) PageToken(pageToken string) *LiveStreamsListCall {
14322 c.urlParams_.Set("pageToken", pageToken)
14323 return c
14324 }
14325
14326 // Fields allows partial responses to be retrieved. See
14327 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14328 // details.
14329 func (c *LiveStreamsListCall) Fields(s ...googleapi.Field) *LiveStreamsListCall {
14330 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14331 return c
14332 }
14333
14334 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14335 // object's ETag matches the given value. This is useful for getting updates
14336 // only after the object has changed since the last request.
14337 func (c *LiveStreamsListCall) IfNoneMatch(entityTag string) *LiveStreamsListCall {
14338 c.ifNoneMatch_ = entityTag
14339 return c
14340 }
14341
14342 // Context sets the context to be used in this call's Do method.
14343 func (c *LiveStreamsListCall) Context(ctx context.Context) *LiveStreamsListCall {
14344 c.ctx_ = ctx
14345 return c
14346 }
14347
14348 // Header returns a http.Header that can be modified by the caller to add
14349 // headers to the request.
14350 func (c *LiveStreamsListCall) Header() http.Header {
14351 if c.header_ == nil {
14352 c.header_ = make(http.Header)
14353 }
14354 return c.header_
14355 }
14356
14357 func (c *LiveStreamsListCall) doRequest(alt string) (*http.Response, error) {
14358 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14359 if c.ifNoneMatch_ != "" {
14360 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14361 }
14362 c.urlParams_.Set("alt", alt)
14363 c.urlParams_.Set("prettyPrint", "false")
14364 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveStreams")
14365 urls += "?" + c.urlParams_.Encode()
14366 req, err := http.NewRequest("GET", urls, nil)
14367 if err != nil {
14368 return nil, err
14369 }
14370 req.Header = reqHeaders
14371 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveStreams.list", "request", internallog.HTTPRequest(req, nil))
14372 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14373 }
14374
14375 // Do executes the "youtube.liveStreams.list" call.
14376 // Any non-2xx status code is an error. Response headers are in either
14377 // *LiveStreamListResponse.ServerResponse.Header or (if a response was returned
14378 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14379 // check whether the returned error was because http.StatusNotModified was
14380 // returned.
14381 func (c *LiveStreamsListCall) Do(opts ...googleapi.CallOption) (*LiveStreamListResponse, error) {
14382 gensupport.SetOptions(c.urlParams_, opts...)
14383 res, err := c.doRequest("json")
14384 if res != nil && res.StatusCode == http.StatusNotModified {
14385 if res.Body != nil {
14386 res.Body.Close()
14387 }
14388 return nil, gensupport.WrapError(&googleapi.Error{
14389 Code: res.StatusCode,
14390 Header: res.Header,
14391 })
14392 }
14393 if err != nil {
14394 return nil, err
14395 }
14396 defer googleapi.CloseBody(res)
14397 if err := googleapi.CheckResponse(res); err != nil {
14398 return nil, gensupport.WrapError(err)
14399 }
14400 ret := &LiveStreamListResponse{
14401 ServerResponse: googleapi.ServerResponse{
14402 Header: res.Header,
14403 HTTPStatusCode: res.StatusCode,
14404 },
14405 }
14406 target := &ret
14407 b, err := gensupport.DecodeResponseBytes(target, res)
14408 if err != nil {
14409 return nil, err
14410 }
14411 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveStreams.list", "response", internallog.HTTPResponse(res, b))
14412 return ret, nil
14413 }
14414
14415 // Pages invokes f for each page of results.
14416 // A non-nil error returned from f will halt the iteration.
14417 // The provided context supersedes any context provided to the Context method.
14418 func (c *LiveStreamsListCall) Pages(ctx context.Context, f func(*LiveStreamListResponse) error) error {
14419 c.ctx_ = ctx
14420 defer c.PageToken(c.urlParams_.Get("pageToken"))
14421 for {
14422 x, err := c.Do()
14423 if err != nil {
14424 return err
14425 }
14426 if err := f(x); err != nil {
14427 return err
14428 }
14429 if x.NextPageToken == "" {
14430 return nil
14431 }
14432 c.PageToken(x.NextPageToken)
14433 }
14434 }
14435
14436 type LiveStreamsUpdateCall struct {
14437 s *Service
14438 livestream *LiveStream
14439 urlParams_ gensupport.URLParams
14440 ctx_ context.Context
14441 header_ http.Header
14442 }
14443
14444 // Update: Updates an existing stream for the authenticated user.
14445 //
14446 // - part: The *part* parameter serves two purposes in this operation. It
14447 // identifies the properties that the write operation will set as well as the
14448 // properties that the API response will include. The part properties that
14449 // you can include in the parameter value are id, snippet, cdn, and status.
14450 // Note that this method will override the existing values for all of the
14451 // mutable properties that are contained in any parts that the parameter
14452 // value specifies. If the request body does not specify a value for a
14453 // mutable property, the existing value for that property will be removed.
14454 func (r *LiveStreamsService) Update(part []string, livestream *LiveStream) *LiveStreamsUpdateCall {
14455 c := &LiveStreamsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14456 c.urlParams_.SetMulti("part", append([]string{}, part...))
14457 c.livestream = livestream
14458 return c
14459 }
14460
14461 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
14462 // *Note:* This parameter is intended exclusively for YouTube content partners.
14463 // The *onBehalfOfContentOwner* parameter indicates that the request's
14464 // authorization credentials identify a YouTube CMS user who is acting on
14465 // behalf of the content owner specified in the parameter value. This parameter
14466 // is intended for YouTube content partners that own and manage many different
14467 // YouTube channels. It allows content owners to authenticate once and get
14468 // access to all their video and channel data, without having to provide
14469 // authentication credentials for each individual channel. The CMS account that
14470 // the user authenticates with must be linked to the specified YouTube content
14471 // owner.
14472 func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsUpdateCall {
14473 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
14474 return c
14475 }
14476
14477 // OnBehalfOfContentOwnerChannel sets the optional parameter
14478 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
14479 // properly authorized request. *Note:* This parameter is intended exclusively
14480 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
14481 // specifies the YouTube channel ID of the channel to which a video is being
14482 // added. This parameter is required when a request specifies a value for the
14483 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
14484 // with that parameter. In addition, the request must be authorized using a CMS
14485 // account that is linked to the content owner that the onBehalfOfContentOwner
14486 // parameter specifies. Finally, the channel that the
14487 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
14488 // the content owner that the onBehalfOfContentOwner parameter specifies. This
14489 // parameter is intended for YouTube content partners that own and manage many
14490 // different YouTube channels. It allows content owners to authenticate once
14491 // and perform actions on behalf of the channel specified in the parameter
14492 // value, without having to provide authentication credentials for each
14493 // separate channel.
14494 func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsUpdateCall {
14495 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
14496 return c
14497 }
14498
14499 // Fields allows partial responses to be retrieved. See
14500 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14501 // details.
14502 func (c *LiveStreamsUpdateCall) Fields(s ...googleapi.Field) *LiveStreamsUpdateCall {
14503 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14504 return c
14505 }
14506
14507 // Context sets the context to be used in this call's Do method.
14508 func (c *LiveStreamsUpdateCall) Context(ctx context.Context) *LiveStreamsUpdateCall {
14509 c.ctx_ = ctx
14510 return c
14511 }
14512
14513 // Header returns a http.Header that can be modified by the caller to add
14514 // headers to the request.
14515 func (c *LiveStreamsUpdateCall) Header() http.Header {
14516 if c.header_ == nil {
14517 c.header_ = make(http.Header)
14518 }
14519 return c.header_
14520 }
14521
14522 func (c *LiveStreamsUpdateCall) doRequest(alt string) (*http.Response, error) {
14523 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
14524 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.livestream)
14525 if err != nil {
14526 return nil, err
14527 }
14528 c.urlParams_.Set("alt", alt)
14529 c.urlParams_.Set("prettyPrint", "false")
14530 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveStreams")
14531 urls += "?" + c.urlParams_.Encode()
14532 req, err := http.NewRequest("PUT", urls, body)
14533 if err != nil {
14534 return nil, err
14535 }
14536 req.Header = reqHeaders
14537 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.liveStreams.update", "request", internallog.HTTPRequest(req, body.Bytes()))
14538 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14539 }
14540
14541 // Do executes the "youtube.liveStreams.update" call.
14542 // Any non-2xx status code is an error. Response headers are in either
14543 // *LiveStream.ServerResponse.Header or (if a response was returned at all) in
14544 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
14545 // whether the returned error was because http.StatusNotModified was returned.
14546 func (c *LiveStreamsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
14547 gensupport.SetOptions(c.urlParams_, opts...)
14548 res, err := c.doRequest("json")
14549 if res != nil && res.StatusCode == http.StatusNotModified {
14550 if res.Body != nil {
14551 res.Body.Close()
14552 }
14553 return nil, gensupport.WrapError(&googleapi.Error{
14554 Code: res.StatusCode,
14555 Header: res.Header,
14556 })
14557 }
14558 if err != nil {
14559 return nil, err
14560 }
14561 defer googleapi.CloseBody(res)
14562 if err := googleapi.CheckResponse(res); err != nil {
14563 return nil, gensupport.WrapError(err)
14564 }
14565 ret := &LiveStream{
14566 ServerResponse: googleapi.ServerResponse{
14567 Header: res.Header,
14568 HTTPStatusCode: res.StatusCode,
14569 },
14570 }
14571 target := &ret
14572 b, err := gensupport.DecodeResponseBytes(target, res)
14573 if err != nil {
14574 return nil, err
14575 }
14576 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.liveStreams.update", "response", internallog.HTTPResponse(res, b))
14577 return ret, nil
14578 }
14579
14580 type MembersListCall struct {
14581 s *Service
14582 urlParams_ gensupport.URLParams
14583 ifNoneMatch_ string
14584 ctx_ context.Context
14585 header_ http.Header
14586 }
14587
14588 // List: Retrieves a list of members that match the request criteria for a
14589 // channel.
14590 //
14591 // - part: The *part* parameter specifies the member resource parts that the
14592 // API response will include. Set the parameter value to snippet.
14593 func (r *MembersService) List(part []string) *MembersListCall {
14594 c := &MembersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14595 c.urlParams_.SetMulti("part", append([]string{}, part...))
14596 return c
14597 }
14598
14599 // FilterByMemberChannelId sets the optional parameter
14600 // "filterByMemberChannelId": Comma separated list of channel IDs. Only data
14601 // about members that are part of this list will be included in the response.
14602 func (c *MembersListCall) FilterByMemberChannelId(filterByMemberChannelId string) *MembersListCall {
14603 c.urlParams_.Set("filterByMemberChannelId", filterByMemberChannelId)
14604 return c
14605 }
14606
14607 // HasAccessToLevel sets the optional parameter "hasAccessToLevel": Filter
14608 // members in the results set to the ones that have access to a level.
14609 func (c *MembersListCall) HasAccessToLevel(hasAccessToLevel string) *MembersListCall {
14610 c.urlParams_.Set("hasAccessToLevel", hasAccessToLevel)
14611 return c
14612 }
14613
14614 // MaxResults sets the optional parameter "maxResults": The *maxResults*
14615 // parameter specifies the maximum number of items that should be returned in
14616 // the result set.
14617 func (c *MembersListCall) MaxResults(maxResults int64) *MembersListCall {
14618 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
14619 return c
14620 }
14621
14622 // Mode sets the optional parameter "mode": Parameter that specifies which
14623 // channel members to return.
14624 //
14625 // Possible values:
14626 //
14627 // "listMembersModeUnknown"
14628 // "updates" - Return only members that joined after the first call with this
14629 //
14630 // mode was made.
14631 //
14632 // "all_current" (default) - Return all current members, from newest to
14633 //
14634 // oldest.
14635 func (c *MembersListCall) Mode(mode string) *MembersListCall {
14636 c.urlParams_.Set("mode", mode)
14637 return c
14638 }
14639
14640 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
14641 // identifies a specific page in the result set that should be returned. In an
14642 // API response, the nextPageToken and prevPageToken properties identify other
14643 // pages that could be retrieved.
14644 func (c *MembersListCall) PageToken(pageToken string) *MembersListCall {
14645 c.urlParams_.Set("pageToken", pageToken)
14646 return c
14647 }
14648
14649 // Fields allows partial responses to be retrieved. See
14650 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14651 // details.
14652 func (c *MembersListCall) Fields(s ...googleapi.Field) *MembersListCall {
14653 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14654 return c
14655 }
14656
14657 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14658 // object's ETag matches the given value. This is useful for getting updates
14659 // only after the object has changed since the last request.
14660 func (c *MembersListCall) IfNoneMatch(entityTag string) *MembersListCall {
14661 c.ifNoneMatch_ = entityTag
14662 return c
14663 }
14664
14665 // Context sets the context to be used in this call's Do method.
14666 func (c *MembersListCall) Context(ctx context.Context) *MembersListCall {
14667 c.ctx_ = ctx
14668 return c
14669 }
14670
14671 // Header returns a http.Header that can be modified by the caller to add
14672 // headers to the request.
14673 func (c *MembersListCall) Header() http.Header {
14674 if c.header_ == nil {
14675 c.header_ = make(http.Header)
14676 }
14677 return c.header_
14678 }
14679
14680 func (c *MembersListCall) doRequest(alt string) (*http.Response, error) {
14681 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14682 if c.ifNoneMatch_ != "" {
14683 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14684 }
14685 c.urlParams_.Set("alt", alt)
14686 c.urlParams_.Set("prettyPrint", "false")
14687 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/members")
14688 urls += "?" + c.urlParams_.Encode()
14689 req, err := http.NewRequest("GET", urls, nil)
14690 if err != nil {
14691 return nil, err
14692 }
14693 req.Header = reqHeaders
14694 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.members.list", "request", internallog.HTTPRequest(req, nil))
14695 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14696 }
14697
14698 // Do executes the "youtube.members.list" call.
14699 // Any non-2xx status code is an error. Response headers are in either
14700 // *MemberListResponse.ServerResponse.Header or (if a response was returned at
14701 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14702 // check whether the returned error was because http.StatusNotModified was
14703 // returned.
14704 func (c *MembersListCall) Do(opts ...googleapi.CallOption) (*MemberListResponse, error) {
14705 gensupport.SetOptions(c.urlParams_, opts...)
14706 res, err := c.doRequest("json")
14707 if res != nil && res.StatusCode == http.StatusNotModified {
14708 if res.Body != nil {
14709 res.Body.Close()
14710 }
14711 return nil, gensupport.WrapError(&googleapi.Error{
14712 Code: res.StatusCode,
14713 Header: res.Header,
14714 })
14715 }
14716 if err != nil {
14717 return nil, err
14718 }
14719 defer googleapi.CloseBody(res)
14720 if err := googleapi.CheckResponse(res); err != nil {
14721 return nil, gensupport.WrapError(err)
14722 }
14723 ret := &MemberListResponse{
14724 ServerResponse: googleapi.ServerResponse{
14725 Header: res.Header,
14726 HTTPStatusCode: res.StatusCode,
14727 },
14728 }
14729 target := &ret
14730 b, err := gensupport.DecodeResponseBytes(target, res)
14731 if err != nil {
14732 return nil, err
14733 }
14734 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.members.list", "response", internallog.HTTPResponse(res, b))
14735 return ret, nil
14736 }
14737
14738 // Pages invokes f for each page of results.
14739 // A non-nil error returned from f will halt the iteration.
14740 // The provided context supersedes any context provided to the Context method.
14741 func (c *MembersListCall) Pages(ctx context.Context, f func(*MemberListResponse) error) error {
14742 c.ctx_ = ctx
14743 defer c.PageToken(c.urlParams_.Get("pageToken"))
14744 for {
14745 x, err := c.Do()
14746 if err != nil {
14747 return err
14748 }
14749 if err := f(x); err != nil {
14750 return err
14751 }
14752 if x.NextPageToken == "" {
14753 return nil
14754 }
14755 c.PageToken(x.NextPageToken)
14756 }
14757 }
14758
14759 type MembershipsLevelsListCall struct {
14760 s *Service
14761 urlParams_ gensupport.URLParams
14762 ifNoneMatch_ string
14763 ctx_ context.Context
14764 header_ http.Header
14765 }
14766
14767 // List: Retrieves a list of all pricing levels offered by a creator to the
14768 // fans.
14769 //
14770 // - part: The *part* parameter specifies the membershipsLevel resource parts
14771 // that the API response will include. Supported values are id and snippet.
14772 func (r *MembershipsLevelsService) List(part []string) *MembershipsLevelsListCall {
14773 c := &MembershipsLevelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14774 c.urlParams_.SetMulti("part", append([]string{}, part...))
14775 return c
14776 }
14777
14778 // Fields allows partial responses to be retrieved. See
14779 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14780 // details.
14781 func (c *MembershipsLevelsListCall) Fields(s ...googleapi.Field) *MembershipsLevelsListCall {
14782 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14783 return c
14784 }
14785
14786 // IfNoneMatch sets an optional parameter which makes the operation fail if the
14787 // object's ETag matches the given value. This is useful for getting updates
14788 // only after the object has changed since the last request.
14789 func (c *MembershipsLevelsListCall) IfNoneMatch(entityTag string) *MembershipsLevelsListCall {
14790 c.ifNoneMatch_ = entityTag
14791 return c
14792 }
14793
14794 // Context sets the context to be used in this call's Do method.
14795 func (c *MembershipsLevelsListCall) Context(ctx context.Context) *MembershipsLevelsListCall {
14796 c.ctx_ = ctx
14797 return c
14798 }
14799
14800 // Header returns a http.Header that can be modified by the caller to add
14801 // headers to the request.
14802 func (c *MembershipsLevelsListCall) Header() http.Header {
14803 if c.header_ == nil {
14804 c.header_ = make(http.Header)
14805 }
14806 return c.header_
14807 }
14808
14809 func (c *MembershipsLevelsListCall) doRequest(alt string) (*http.Response, error) {
14810 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14811 if c.ifNoneMatch_ != "" {
14812 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14813 }
14814 c.urlParams_.Set("alt", alt)
14815 c.urlParams_.Set("prettyPrint", "false")
14816 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/membershipsLevels")
14817 urls += "?" + c.urlParams_.Encode()
14818 req, err := http.NewRequest("GET", urls, nil)
14819 if err != nil {
14820 return nil, err
14821 }
14822 req.Header = reqHeaders
14823 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.membershipsLevels.list", "request", internallog.HTTPRequest(req, nil))
14824 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14825 }
14826
14827 // Do executes the "youtube.membershipsLevels.list" call.
14828 // Any non-2xx status code is an error. Response headers are in either
14829 // *MembershipsLevelListResponse.ServerResponse.Header or (if a response was
14830 // returned at all) in error.(*googleapi.Error).Header. Use
14831 // googleapi.IsNotModified to check whether the returned error was because
14832 // http.StatusNotModified was returned.
14833 func (c *MembershipsLevelsListCall) Do(opts ...googleapi.CallOption) (*MembershipsLevelListResponse, error) {
14834 gensupport.SetOptions(c.urlParams_, opts...)
14835 res, err := c.doRequest("json")
14836 if res != nil && res.StatusCode == http.StatusNotModified {
14837 if res.Body != nil {
14838 res.Body.Close()
14839 }
14840 return nil, gensupport.WrapError(&googleapi.Error{
14841 Code: res.StatusCode,
14842 Header: res.Header,
14843 })
14844 }
14845 if err != nil {
14846 return nil, err
14847 }
14848 defer googleapi.CloseBody(res)
14849 if err := googleapi.CheckResponse(res); err != nil {
14850 return nil, gensupport.WrapError(err)
14851 }
14852 ret := &MembershipsLevelListResponse{
14853 ServerResponse: googleapi.ServerResponse{
14854 Header: res.Header,
14855 HTTPStatusCode: res.StatusCode,
14856 },
14857 }
14858 target := &ret
14859 b, err := gensupport.DecodeResponseBytes(target, res)
14860 if err != nil {
14861 return nil, err
14862 }
14863 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.membershipsLevels.list", "response", internallog.HTTPResponse(res, b))
14864 return ret, nil
14865 }
14866
14867 type PlaylistImagesDeleteCall struct {
14868 s *Service
14869 urlParams_ gensupport.URLParams
14870 ctx_ context.Context
14871 header_ http.Header
14872 }
14873
14874 // Delete: Deletes a resource.
14875 func (r *PlaylistImagesService) Delete() *PlaylistImagesDeleteCall {
14876 c := &PlaylistImagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14877 return c
14878 }
14879
14880 // Id sets the optional parameter "id": Id to identify this image. This is
14881 // returned from by the List method.
14882 func (c *PlaylistImagesDeleteCall) Id(id string) *PlaylistImagesDeleteCall {
14883 c.urlParams_.Set("id", id)
14884 return c
14885 }
14886
14887 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
14888 // *Note:* This parameter is intended exclusively for YouTube content partners.
14889 // The *onBehalfOfContentOwner* parameter indicates that the request's
14890 // authorization credentials identify a YouTube CMS user who is acting on
14891 // behalf of the content owner specified in the parameter value. This parameter
14892 // is intended for YouTube content partners that own and manage many different
14893 // YouTube channels. It allows content owners to authenticate once and get
14894 // access to all their video and channel data, without having to provide
14895 // authentication credentials for each individual channel. The CMS account that
14896 // the user authenticates with must be linked to the specified YouTube content
14897 // owner.
14898 func (c *PlaylistImagesDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistImagesDeleteCall {
14899 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
14900 return c
14901 }
14902
14903 // Fields allows partial responses to be retrieved. See
14904 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
14905 // details.
14906 func (c *PlaylistImagesDeleteCall) Fields(s ...googleapi.Field) *PlaylistImagesDeleteCall {
14907 c.urlParams_.Set("fields", googleapi.CombineFields(s))
14908 return c
14909 }
14910
14911 // Context sets the context to be used in this call's Do method.
14912 func (c *PlaylistImagesDeleteCall) Context(ctx context.Context) *PlaylistImagesDeleteCall {
14913 c.ctx_ = ctx
14914 return c
14915 }
14916
14917 // Header returns a http.Header that can be modified by the caller to add
14918 // headers to the request.
14919 func (c *PlaylistImagesDeleteCall) Header() http.Header {
14920 if c.header_ == nil {
14921 c.header_ = make(http.Header)
14922 }
14923 return c.header_
14924 }
14925
14926 func (c *PlaylistImagesDeleteCall) doRequest(alt string) (*http.Response, error) {
14927 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
14928 c.urlParams_.Set("alt", alt)
14929 c.urlParams_.Set("prettyPrint", "false")
14930 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistImages")
14931 urls += "?" + c.urlParams_.Encode()
14932 req, err := http.NewRequest("DELETE", urls, nil)
14933 if err != nil {
14934 return nil, err
14935 }
14936 req.Header = reqHeaders
14937 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistImages.delete", "request", internallog.HTTPRequest(req, nil))
14938 return gensupport.SendRequest(c.ctx_, c.s.client, req)
14939 }
14940
14941 // Do executes the "youtube.playlistImages.delete" call.
14942 func (c *PlaylistImagesDeleteCall) Do(opts ...googleapi.CallOption) error {
14943 gensupport.SetOptions(c.urlParams_, opts...)
14944 res, err := c.doRequest("json")
14945 if err != nil {
14946 return err
14947 }
14948 defer googleapi.CloseBody(res)
14949 if err := googleapi.CheckResponse(res); err != nil {
14950 return gensupport.WrapError(err)
14951 }
14952 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistImages.delete", "response", internallog.HTTPResponse(res, nil))
14953 return nil
14954 }
14955
14956 type PlaylistImagesInsertCall struct {
14957 s *Service
14958 playlistimage *PlaylistImage
14959 urlParams_ gensupport.URLParams
14960 mediaInfo_ *gensupport.MediaInfo
14961 ctx_ context.Context
14962 header_ http.Header
14963 }
14964
14965 // Insert: Inserts a new resource into this collection.
14966 func (r *PlaylistImagesService) Insert(playlistimage *PlaylistImage) *PlaylistImagesInsertCall {
14967 c := &PlaylistImagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14968 c.playlistimage = playlistimage
14969 return c
14970 }
14971
14972 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
14973 // *Note:* This parameter is intended exclusively for YouTube content partners.
14974 // The *onBehalfOfContentOwner* parameter indicates that the request's
14975 // authorization credentials identify a YouTube CMS user who is acting on
14976 // behalf of the content owner specified in the parameter value. This parameter
14977 // is intended for YouTube content partners that own and manage many different
14978 // YouTube channels. It allows content owners to authenticate once and get
14979 // access to all their video and channel data, without having to provide
14980 // authentication credentials for each individual channel. The CMS account that
14981 // the user authenticates with must be linked to the specified YouTube content
14982 // owner.
14983 func (c *PlaylistImagesInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistImagesInsertCall {
14984 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
14985 return c
14986 }
14987
14988 // OnBehalfOfContentOwnerChannel sets the optional parameter
14989 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
14990 // properly authorized request. *Note:* This parameter is intended exclusively
14991 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
14992 // specifies the YouTube channel ID of the channel to which a video is being
14993 // added. This parameter is required when a request specifies a value for the
14994 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
14995 // with that parameter. In addition, the request must be authorized using a CMS
14996 // account that is linked to the content owner that the onBehalfOfContentOwner
14997 // parameter specifies. Finally, the channel that the
14998 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
14999 // the content owner that the onBehalfOfContentOwner parameter specifies. This
15000 // parameter is intended for YouTube content partners that own and manage many
15001 // different YouTube channels. It allows content owners to authenticate once
15002 // and perform actions on behalf of the channel specified in the parameter
15003 // value, without having to provide authentication credentials for each
15004 // separate channel.
15005 func (c *PlaylistImagesInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistImagesInsertCall {
15006 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
15007 return c
15008 }
15009
15010 // Part sets the optional parameter "part": The *part* parameter specifies the
15011 // properties that the API response will include.
15012 func (c *PlaylistImagesInsertCall) Part(part ...string) *PlaylistImagesInsertCall {
15013 c.urlParams_.SetMulti("part", append([]string{}, part...))
15014 return c
15015 }
15016
15017 // Media specifies the media to upload in one or more chunks. The chunk size
15018 // may be controlled by supplying a MediaOption generated by
15019 // googleapi.ChunkSize. The chunk size defaults to
15020 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
15021 // request will be determined by sniffing the contents of r, unless a
15022 // MediaOption generated by googleapi.ContentType is supplied.
15023 // At most one of Media and ResumableMedia may be set.
15024 func (c *PlaylistImagesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *PlaylistImagesInsertCall {
15025 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
15026 return c
15027 }
15028
15029 // ResumableMedia specifies the media to upload in chunks and can be canceled
15030 // with ctx.
15031 //
15032 // Deprecated: use Media instead.
15033 //
15034 // At most one of Media and ResumableMedia may be set. mediaType identifies the
15035 // MIME media type of the upload, such as "image/png". If mediaType is "", it
15036 // will be auto-detected. The provided ctx will supersede any context
15037 // previously provided to the Context method.
15038 func (c *PlaylistImagesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *PlaylistImagesInsertCall {
15039 c.ctx_ = ctx
15040 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
15041 return c
15042 }
15043
15044 // ProgressUpdater provides a callback function that will be called after every
15045 // chunk. It should be a low-latency function in order to not slow down the
15046 // upload operation. This should only be called when using ResumableMedia (as
15047 // opposed to Media).
15048 func (c *PlaylistImagesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *PlaylistImagesInsertCall {
15049 c.mediaInfo_.SetProgressUpdater(pu)
15050 return c
15051 }
15052
15053 // Fields allows partial responses to be retrieved. See
15054 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15055 // details.
15056 func (c *PlaylistImagesInsertCall) Fields(s ...googleapi.Field) *PlaylistImagesInsertCall {
15057 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15058 return c
15059 }
15060
15061 // Context sets the context to be used in this call's Do method.
15062 // This context will supersede any context previously provided to the
15063 // ResumableMedia method.
15064 func (c *PlaylistImagesInsertCall) Context(ctx context.Context) *PlaylistImagesInsertCall {
15065 c.ctx_ = ctx
15066 return c
15067 }
15068
15069 // Header returns a http.Header that can be modified by the caller to add
15070 // headers to the request.
15071 func (c *PlaylistImagesInsertCall) Header() http.Header {
15072 if c.header_ == nil {
15073 c.header_ = make(http.Header)
15074 }
15075 return c.header_
15076 }
15077
15078 func (c *PlaylistImagesInsertCall) doRequest(alt string) (*http.Response, error) {
15079 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15080 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistimage)
15081 if err != nil {
15082 return nil, err
15083 }
15084 c.urlParams_.Set("alt", alt)
15085 c.urlParams_.Set("prettyPrint", "false")
15086 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistImages")
15087 if c.mediaInfo_ != nil {
15088 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/playlistImages")
15089 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
15090 }
15091 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
15092 defer cleanup()
15093 urls += "?" + c.urlParams_.Encode()
15094 req, err := http.NewRequest("POST", urls, newBody)
15095 if err != nil {
15096 return nil, err
15097 }
15098 req.Header = reqHeaders
15099 req.GetBody = getBody
15100 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistImages.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
15101 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15102 }
15103
15104 // Do executes the "youtube.playlistImages.insert" call.
15105 // Any non-2xx status code is an error. Response headers are in either
15106 // *PlaylistImage.ServerResponse.Header or (if a response was returned at all)
15107 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15108 // whether the returned error was because http.StatusNotModified was returned.
15109 func (c *PlaylistImagesInsertCall) Do(opts ...googleapi.CallOption) (*PlaylistImage, error) {
15110 gensupport.SetOptions(c.urlParams_, opts...)
15111 res, err := c.doRequest("json")
15112 if res != nil && res.StatusCode == http.StatusNotModified {
15113 if res.Body != nil {
15114 res.Body.Close()
15115 }
15116 return nil, gensupport.WrapError(&googleapi.Error{
15117 Code: res.StatusCode,
15118 Header: res.Header,
15119 })
15120 }
15121 if err != nil {
15122 return nil, err
15123 }
15124 defer googleapi.CloseBody(res)
15125 if err := googleapi.CheckResponse(res); err != nil {
15126 return nil, gensupport.WrapError(err)
15127 }
15128 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
15129 if rx != nil {
15130 rx.Client = c.s.client
15131 rx.UserAgent = c.s.userAgent()
15132 ctx := c.ctx_
15133 if ctx == nil {
15134 ctx = context.TODO()
15135 }
15136 res, err = rx.Upload(ctx)
15137 if err != nil {
15138 return nil, err
15139 }
15140 defer res.Body.Close()
15141 if err := googleapi.CheckResponse(res); err != nil {
15142 return nil, gensupport.WrapError(err)
15143 }
15144 }
15145 ret := &PlaylistImage{
15146 ServerResponse: googleapi.ServerResponse{
15147 Header: res.Header,
15148 HTTPStatusCode: res.StatusCode,
15149 },
15150 }
15151 target := &ret
15152 b, err := gensupport.DecodeResponseBytes(target, res)
15153 if err != nil {
15154 return nil, err
15155 }
15156 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistImages.insert", "response", internallog.HTTPResponse(res, b))
15157 return ret, nil
15158 }
15159
15160 type PlaylistImagesListCall struct {
15161 s *Service
15162 urlParams_ gensupport.URLParams
15163 ifNoneMatch_ string
15164 ctx_ context.Context
15165 header_ http.Header
15166 }
15167
15168 // List: Retrieves a list of resources, possibly filtered.
15169 func (r *PlaylistImagesService) List() *PlaylistImagesListCall {
15170 c := &PlaylistImagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15171 return c
15172 }
15173
15174 // MaxResults sets the optional parameter "maxResults": The *maxResults*
15175 // parameter specifies the maximum number of items that should be returned in
15176 // the result set.
15177 func (c *PlaylistImagesListCall) MaxResults(maxResults int64) *PlaylistImagesListCall {
15178 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
15179 return c
15180 }
15181
15182 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
15183 // *Note:* This parameter is intended exclusively for YouTube content partners.
15184 // The *onBehalfOfContentOwner* parameter indicates that the request's
15185 // authorization credentials identify a YouTube CMS user who is acting on
15186 // behalf of the content owner specified in the parameter value. This parameter
15187 // is intended for YouTube content partners that own and manage many different
15188 // YouTube channels. It allows content owners to authenticate once and get
15189 // access to all their video and channel data, without having to provide
15190 // authentication credentials for each individual channel. The CMS account that
15191 // the user authenticates with must be linked to the specified YouTube content
15192 // owner.
15193 func (c *PlaylistImagesListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistImagesListCall {
15194 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
15195 return c
15196 }
15197
15198 // OnBehalfOfContentOwnerChannel sets the optional parameter
15199 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
15200 // properly authorized request. *Note:* This parameter is intended exclusively
15201 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
15202 // specifies the YouTube channel ID of the channel to which a video is being
15203 // added. This parameter is required when a request specifies a value for the
15204 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
15205 // with that parameter. In addition, the request must be authorized using a CMS
15206 // account that is linked to the content owner that the onBehalfOfContentOwner
15207 // parameter specifies. Finally, the channel that the
15208 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
15209 // the content owner that the onBehalfOfContentOwner parameter specifies. This
15210 // parameter is intended for YouTube content partners that own and manage many
15211 // different YouTube channels. It allows content owners to authenticate once
15212 // and perform actions on behalf of the channel specified in the parameter
15213 // value, without having to provide authentication credentials for each
15214 // separate channel.
15215 func (c *PlaylistImagesListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistImagesListCall {
15216 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
15217 return c
15218 }
15219
15220 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
15221 // identifies a specific page in the result set that should be returned. In an
15222 // API response, the nextPageToken and prevPageToken properties identify other
15223 // pages that could be retrieved.
15224 func (c *PlaylistImagesListCall) PageToken(pageToken string) *PlaylistImagesListCall {
15225 c.urlParams_.Set("pageToken", pageToken)
15226 return c
15227 }
15228
15229 // Parent sets the optional parameter "parent": Return PlaylistImages for this
15230 // playlist id.
15231 func (c *PlaylistImagesListCall) Parent(parent string) *PlaylistImagesListCall {
15232 c.urlParams_.Set("parent", parent)
15233 return c
15234 }
15235
15236 // Part sets the optional parameter "part": The *part* parameter specifies a
15237 // comma-separated list of one or more playlistImage resource properties that
15238 // the API response will include. If the parameter identifies a property that
15239 // contains child properties, the child properties will be included in the
15240 // response.
15241 func (c *PlaylistImagesListCall) Part(part ...string) *PlaylistImagesListCall {
15242 c.urlParams_.SetMulti("part", append([]string{}, part...))
15243 return c
15244 }
15245
15246 // Fields allows partial responses to be retrieved. See
15247 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15248 // details.
15249 func (c *PlaylistImagesListCall) Fields(s ...googleapi.Field) *PlaylistImagesListCall {
15250 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15251 return c
15252 }
15253
15254 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15255 // object's ETag matches the given value. This is useful for getting updates
15256 // only after the object has changed since the last request.
15257 func (c *PlaylistImagesListCall) IfNoneMatch(entityTag string) *PlaylistImagesListCall {
15258 c.ifNoneMatch_ = entityTag
15259 return c
15260 }
15261
15262 // Context sets the context to be used in this call's Do method.
15263 func (c *PlaylistImagesListCall) Context(ctx context.Context) *PlaylistImagesListCall {
15264 c.ctx_ = ctx
15265 return c
15266 }
15267
15268 // Header returns a http.Header that can be modified by the caller to add
15269 // headers to the request.
15270 func (c *PlaylistImagesListCall) Header() http.Header {
15271 if c.header_ == nil {
15272 c.header_ = make(http.Header)
15273 }
15274 return c.header_
15275 }
15276
15277 func (c *PlaylistImagesListCall) doRequest(alt string) (*http.Response, error) {
15278 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15279 if c.ifNoneMatch_ != "" {
15280 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15281 }
15282 c.urlParams_.Set("alt", alt)
15283 c.urlParams_.Set("prettyPrint", "false")
15284 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistImages")
15285 urls += "?" + c.urlParams_.Encode()
15286 req, err := http.NewRequest("GET", urls, nil)
15287 if err != nil {
15288 return nil, err
15289 }
15290 req.Header = reqHeaders
15291 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistImages.list", "request", internallog.HTTPRequest(req, nil))
15292 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15293 }
15294
15295 // Do executes the "youtube.playlistImages.list" call.
15296 // Any non-2xx status code is an error. Response headers are in either
15297 // *PlaylistImageListResponse.ServerResponse.Header or (if a response was
15298 // returned at all) in error.(*googleapi.Error).Header. Use
15299 // googleapi.IsNotModified to check whether the returned error was because
15300 // http.StatusNotModified was returned.
15301 func (c *PlaylistImagesListCall) Do(opts ...googleapi.CallOption) (*PlaylistImageListResponse, error) {
15302 gensupport.SetOptions(c.urlParams_, opts...)
15303 res, err := c.doRequest("json")
15304 if res != nil && res.StatusCode == http.StatusNotModified {
15305 if res.Body != nil {
15306 res.Body.Close()
15307 }
15308 return nil, gensupport.WrapError(&googleapi.Error{
15309 Code: res.StatusCode,
15310 Header: res.Header,
15311 })
15312 }
15313 if err != nil {
15314 return nil, err
15315 }
15316 defer googleapi.CloseBody(res)
15317 if err := googleapi.CheckResponse(res); err != nil {
15318 return nil, gensupport.WrapError(err)
15319 }
15320 ret := &PlaylistImageListResponse{
15321 ServerResponse: googleapi.ServerResponse{
15322 Header: res.Header,
15323 HTTPStatusCode: res.StatusCode,
15324 },
15325 }
15326 target := &ret
15327 b, err := gensupport.DecodeResponseBytes(target, res)
15328 if err != nil {
15329 return nil, err
15330 }
15331 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistImages.list", "response", internallog.HTTPResponse(res, b))
15332 return ret, nil
15333 }
15334
15335 // Pages invokes f for each page of results.
15336 // A non-nil error returned from f will halt the iteration.
15337 // The provided context supersedes any context provided to the Context method.
15338 func (c *PlaylistImagesListCall) Pages(ctx context.Context, f func(*PlaylistImageListResponse) error) error {
15339 c.ctx_ = ctx
15340 defer c.PageToken(c.urlParams_.Get("pageToken"))
15341 for {
15342 x, err := c.Do()
15343 if err != nil {
15344 return err
15345 }
15346 if err := f(x); err != nil {
15347 return err
15348 }
15349 if x.NextPageToken == "" {
15350 return nil
15351 }
15352 c.PageToken(x.NextPageToken)
15353 }
15354 }
15355
15356 type PlaylistImagesUpdateCall struct {
15357 s *Service
15358 playlistimage *PlaylistImage
15359 urlParams_ gensupport.URLParams
15360 mediaInfo_ *gensupport.MediaInfo
15361 ctx_ context.Context
15362 header_ http.Header
15363 }
15364
15365 // Update: Updates an existing resource.
15366 func (r *PlaylistImagesService) Update(playlistimage *PlaylistImage) *PlaylistImagesUpdateCall {
15367 c := &PlaylistImagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15368 c.playlistimage = playlistimage
15369 return c
15370 }
15371
15372 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
15373 // *Note:* This parameter is intended exclusively for YouTube content partners.
15374 // The *onBehalfOfContentOwner* parameter indicates that the request's
15375 // authorization credentials identify a YouTube CMS user who is acting on
15376 // behalf of the content owner specified in the parameter value. This parameter
15377 // is intended for YouTube content partners that own and manage many different
15378 // YouTube channels. It allows content owners to authenticate once and get
15379 // access to all their video and channel data, without having to provide
15380 // authentication credentials for each individual channel. The CMS account that
15381 // the user authenticates with must be linked to the specified YouTube content
15382 // owner.
15383 func (c *PlaylistImagesUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistImagesUpdateCall {
15384 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
15385 return c
15386 }
15387
15388 // Part sets the optional parameter "part": The *part* parameter specifies the
15389 // properties that the API response will include.
15390 func (c *PlaylistImagesUpdateCall) Part(part ...string) *PlaylistImagesUpdateCall {
15391 c.urlParams_.SetMulti("part", append([]string{}, part...))
15392 return c
15393 }
15394
15395 // Media specifies the media to upload in one or more chunks. The chunk size
15396 // may be controlled by supplying a MediaOption generated by
15397 // googleapi.ChunkSize. The chunk size defaults to
15398 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
15399 // request will be determined by sniffing the contents of r, unless a
15400 // MediaOption generated by googleapi.ContentType is supplied.
15401 // At most one of Media and ResumableMedia may be set.
15402 func (c *PlaylistImagesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *PlaylistImagesUpdateCall {
15403 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
15404 return c
15405 }
15406
15407 // ResumableMedia specifies the media to upload in chunks and can be canceled
15408 // with ctx.
15409 //
15410 // Deprecated: use Media instead.
15411 //
15412 // At most one of Media and ResumableMedia may be set. mediaType identifies the
15413 // MIME media type of the upload, such as "image/png". If mediaType is "", it
15414 // will be auto-detected. The provided ctx will supersede any context
15415 // previously provided to the Context method.
15416 func (c *PlaylistImagesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *PlaylistImagesUpdateCall {
15417 c.ctx_ = ctx
15418 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
15419 return c
15420 }
15421
15422 // ProgressUpdater provides a callback function that will be called after every
15423 // chunk. It should be a low-latency function in order to not slow down the
15424 // upload operation. This should only be called when using ResumableMedia (as
15425 // opposed to Media).
15426 func (c *PlaylistImagesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *PlaylistImagesUpdateCall {
15427 c.mediaInfo_.SetProgressUpdater(pu)
15428 return c
15429 }
15430
15431 // Fields allows partial responses to be retrieved. See
15432 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15433 // details.
15434 func (c *PlaylistImagesUpdateCall) Fields(s ...googleapi.Field) *PlaylistImagesUpdateCall {
15435 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15436 return c
15437 }
15438
15439 // Context sets the context to be used in this call's Do method.
15440 // This context will supersede any context previously provided to the
15441 // ResumableMedia method.
15442 func (c *PlaylistImagesUpdateCall) Context(ctx context.Context) *PlaylistImagesUpdateCall {
15443 c.ctx_ = ctx
15444 return c
15445 }
15446
15447 // Header returns a http.Header that can be modified by the caller to add
15448 // headers to the request.
15449 func (c *PlaylistImagesUpdateCall) Header() http.Header {
15450 if c.header_ == nil {
15451 c.header_ = make(http.Header)
15452 }
15453 return c.header_
15454 }
15455
15456 func (c *PlaylistImagesUpdateCall) doRequest(alt string) (*http.Response, error) {
15457 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15458 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistimage)
15459 if err != nil {
15460 return nil, err
15461 }
15462 c.urlParams_.Set("alt", alt)
15463 c.urlParams_.Set("prettyPrint", "false")
15464 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistImages")
15465 if c.mediaInfo_ != nil {
15466 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/playlistImages")
15467 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
15468 }
15469 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
15470 defer cleanup()
15471 urls += "?" + c.urlParams_.Encode()
15472 req, err := http.NewRequest("PUT", urls, newBody)
15473 if err != nil {
15474 return nil, err
15475 }
15476 req.Header = reqHeaders
15477 req.GetBody = getBody
15478 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistImages.update", "request", internallog.HTTPRequest(req, body.Bytes()))
15479 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15480 }
15481
15482 // Do executes the "youtube.playlistImages.update" call.
15483 // Any non-2xx status code is an error. Response headers are in either
15484 // *PlaylistImage.ServerResponse.Header or (if a response was returned at all)
15485 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15486 // whether the returned error was because http.StatusNotModified was returned.
15487 func (c *PlaylistImagesUpdateCall) Do(opts ...googleapi.CallOption) (*PlaylistImage, error) {
15488 gensupport.SetOptions(c.urlParams_, opts...)
15489 res, err := c.doRequest("json")
15490 if res != nil && res.StatusCode == http.StatusNotModified {
15491 if res.Body != nil {
15492 res.Body.Close()
15493 }
15494 return nil, gensupport.WrapError(&googleapi.Error{
15495 Code: res.StatusCode,
15496 Header: res.Header,
15497 })
15498 }
15499 if err != nil {
15500 return nil, err
15501 }
15502 defer googleapi.CloseBody(res)
15503 if err := googleapi.CheckResponse(res); err != nil {
15504 return nil, gensupport.WrapError(err)
15505 }
15506 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
15507 if rx != nil {
15508 rx.Client = c.s.client
15509 rx.UserAgent = c.s.userAgent()
15510 ctx := c.ctx_
15511 if ctx == nil {
15512 ctx = context.TODO()
15513 }
15514 res, err = rx.Upload(ctx)
15515 if err != nil {
15516 return nil, err
15517 }
15518 defer res.Body.Close()
15519 if err := googleapi.CheckResponse(res); err != nil {
15520 return nil, gensupport.WrapError(err)
15521 }
15522 }
15523 ret := &PlaylistImage{
15524 ServerResponse: googleapi.ServerResponse{
15525 Header: res.Header,
15526 HTTPStatusCode: res.StatusCode,
15527 },
15528 }
15529 target := &ret
15530 b, err := gensupport.DecodeResponseBytes(target, res)
15531 if err != nil {
15532 return nil, err
15533 }
15534 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistImages.update", "response", internallog.HTTPResponse(res, b))
15535 return ret, nil
15536 }
15537
15538 type PlaylistItemsDeleteCall struct {
15539 s *Service
15540 urlParams_ gensupport.URLParams
15541 ctx_ context.Context
15542 header_ http.Header
15543 }
15544
15545 // Delete: Deletes a resource.
15546 //
15547 // - id: .
15548 func (r *PlaylistItemsService) Delete(id string) *PlaylistItemsDeleteCall {
15549 c := &PlaylistItemsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15550 c.urlParams_.Set("id", id)
15551 return c
15552 }
15553
15554 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
15555 // *Note:* This parameter is intended exclusively for YouTube content partners.
15556 // The *onBehalfOfContentOwner* parameter indicates that the request's
15557 // authorization credentials identify a YouTube CMS user who is acting on
15558 // behalf of the content owner specified in the parameter value. This parameter
15559 // is intended for YouTube content partners that own and manage many different
15560 // YouTube channels. It allows content owners to authenticate once and get
15561 // access to all their video and channel data, without having to provide
15562 // authentication credentials for each individual channel. The CMS account that
15563 // the user authenticates with must be linked to the specified YouTube content
15564 // owner.
15565 func (c *PlaylistItemsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsDeleteCall {
15566 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
15567 return c
15568 }
15569
15570 // Fields allows partial responses to be retrieved. See
15571 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15572 // details.
15573 func (c *PlaylistItemsDeleteCall) Fields(s ...googleapi.Field) *PlaylistItemsDeleteCall {
15574 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15575 return c
15576 }
15577
15578 // Context sets the context to be used in this call's Do method.
15579 func (c *PlaylistItemsDeleteCall) Context(ctx context.Context) *PlaylistItemsDeleteCall {
15580 c.ctx_ = ctx
15581 return c
15582 }
15583
15584 // Header returns a http.Header that can be modified by the caller to add
15585 // headers to the request.
15586 func (c *PlaylistItemsDeleteCall) Header() http.Header {
15587 if c.header_ == nil {
15588 c.header_ = make(http.Header)
15589 }
15590 return c.header_
15591 }
15592
15593 func (c *PlaylistItemsDeleteCall) doRequest(alt string) (*http.Response, error) {
15594 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15595 c.urlParams_.Set("alt", alt)
15596 c.urlParams_.Set("prettyPrint", "false")
15597 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistItems")
15598 urls += "?" + c.urlParams_.Encode()
15599 req, err := http.NewRequest("DELETE", urls, nil)
15600 if err != nil {
15601 return nil, err
15602 }
15603 req.Header = reqHeaders
15604 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistItems.delete", "request", internallog.HTTPRequest(req, nil))
15605 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15606 }
15607
15608 // Do executes the "youtube.playlistItems.delete" call.
15609 func (c *PlaylistItemsDeleteCall) Do(opts ...googleapi.CallOption) error {
15610 gensupport.SetOptions(c.urlParams_, opts...)
15611 res, err := c.doRequest("json")
15612 if err != nil {
15613 return err
15614 }
15615 defer googleapi.CloseBody(res)
15616 if err := googleapi.CheckResponse(res); err != nil {
15617 return gensupport.WrapError(err)
15618 }
15619 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistItems.delete", "response", internallog.HTTPResponse(res, nil))
15620 return nil
15621 }
15622
15623 type PlaylistItemsInsertCall struct {
15624 s *Service
15625 playlistitem *PlaylistItem
15626 urlParams_ gensupport.URLParams
15627 ctx_ context.Context
15628 header_ http.Header
15629 }
15630
15631 // Insert: Inserts a new resource into this collection.
15632 //
15633 // - part: The *part* parameter serves two purposes in this operation. It
15634 // identifies the properties that the write operation will set as well as the
15635 // properties that the API response will include.
15636 func (r *PlaylistItemsService) Insert(part []string, playlistitem *PlaylistItem) *PlaylistItemsInsertCall {
15637 c := &PlaylistItemsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15638 c.urlParams_.SetMulti("part", append([]string{}, part...))
15639 c.playlistitem = playlistitem
15640 return c
15641 }
15642
15643 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
15644 // *Note:* This parameter is intended exclusively for YouTube content partners.
15645 // The *onBehalfOfContentOwner* parameter indicates that the request's
15646 // authorization credentials identify a YouTube CMS user who is acting on
15647 // behalf of the content owner specified in the parameter value. This parameter
15648 // is intended for YouTube content partners that own and manage many different
15649 // YouTube channels. It allows content owners to authenticate once and get
15650 // access to all their video and channel data, without having to provide
15651 // authentication credentials for each individual channel. The CMS account that
15652 // the user authenticates with must be linked to the specified YouTube content
15653 // owner.
15654 func (c *PlaylistItemsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsInsertCall {
15655 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
15656 return c
15657 }
15658
15659 // Fields allows partial responses to be retrieved. See
15660 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15661 // details.
15662 func (c *PlaylistItemsInsertCall) Fields(s ...googleapi.Field) *PlaylistItemsInsertCall {
15663 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15664 return c
15665 }
15666
15667 // Context sets the context to be used in this call's Do method.
15668 func (c *PlaylistItemsInsertCall) Context(ctx context.Context) *PlaylistItemsInsertCall {
15669 c.ctx_ = ctx
15670 return c
15671 }
15672
15673 // Header returns a http.Header that can be modified by the caller to add
15674 // headers to the request.
15675 func (c *PlaylistItemsInsertCall) Header() http.Header {
15676 if c.header_ == nil {
15677 c.header_ = make(http.Header)
15678 }
15679 return c.header_
15680 }
15681
15682 func (c *PlaylistItemsInsertCall) doRequest(alt string) (*http.Response, error) {
15683 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15684 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistitem)
15685 if err != nil {
15686 return nil, err
15687 }
15688 c.urlParams_.Set("alt", alt)
15689 c.urlParams_.Set("prettyPrint", "false")
15690 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistItems")
15691 urls += "?" + c.urlParams_.Encode()
15692 req, err := http.NewRequest("POST", urls, body)
15693 if err != nil {
15694 return nil, err
15695 }
15696 req.Header = reqHeaders
15697 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistItems.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
15698 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15699 }
15700
15701 // Do executes the "youtube.playlistItems.insert" call.
15702 // Any non-2xx status code is an error. Response headers are in either
15703 // *PlaylistItem.ServerResponse.Header or (if a response was returned at all)
15704 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15705 // whether the returned error was because http.StatusNotModified was returned.
15706 func (c *PlaylistItemsInsertCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
15707 gensupport.SetOptions(c.urlParams_, opts...)
15708 res, err := c.doRequest("json")
15709 if res != nil && res.StatusCode == http.StatusNotModified {
15710 if res.Body != nil {
15711 res.Body.Close()
15712 }
15713 return nil, gensupport.WrapError(&googleapi.Error{
15714 Code: res.StatusCode,
15715 Header: res.Header,
15716 })
15717 }
15718 if err != nil {
15719 return nil, err
15720 }
15721 defer googleapi.CloseBody(res)
15722 if err := googleapi.CheckResponse(res); err != nil {
15723 return nil, gensupport.WrapError(err)
15724 }
15725 ret := &PlaylistItem{
15726 ServerResponse: googleapi.ServerResponse{
15727 Header: res.Header,
15728 HTTPStatusCode: res.StatusCode,
15729 },
15730 }
15731 target := &ret
15732 b, err := gensupport.DecodeResponseBytes(target, res)
15733 if err != nil {
15734 return nil, err
15735 }
15736 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistItems.insert", "response", internallog.HTTPResponse(res, b))
15737 return ret, nil
15738 }
15739
15740 type PlaylistItemsListCall struct {
15741 s *Service
15742 urlParams_ gensupport.URLParams
15743 ifNoneMatch_ string
15744 ctx_ context.Context
15745 header_ http.Header
15746 }
15747
15748 // List: Retrieves a list of resources, possibly filtered.
15749 //
15750 // - part: The *part* parameter specifies a comma-separated list of one or more
15751 // playlistItem resource properties that the API response will include. If
15752 // the parameter identifies a property that contains child properties, the
15753 // child properties will be included in the response. For example, in a
15754 // playlistItem resource, the snippet property contains numerous fields,
15755 // including the title, description, position, and resourceId properties. As
15756 // such, if you set *part=snippet*, the API response will contain all of
15757 // those properties.
15758 func (r *PlaylistItemsService) List(part []string) *PlaylistItemsListCall {
15759 c := &PlaylistItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15760 c.urlParams_.SetMulti("part", append([]string{}, part...))
15761 return c
15762 }
15763
15764 // Id sets the optional parameter "id":
15765 func (c *PlaylistItemsListCall) Id(id ...string) *PlaylistItemsListCall {
15766 c.urlParams_.SetMulti("id", append([]string{}, id...))
15767 return c
15768 }
15769
15770 // MaxResults sets the optional parameter "maxResults": The *maxResults*
15771 // parameter specifies the maximum number of items that should be returned in
15772 // the result set.
15773 func (c *PlaylistItemsListCall) MaxResults(maxResults int64) *PlaylistItemsListCall {
15774 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
15775 return c
15776 }
15777
15778 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
15779 // *Note:* This parameter is intended exclusively for YouTube content partners.
15780 // The *onBehalfOfContentOwner* parameter indicates that the request's
15781 // authorization credentials identify a YouTube CMS user who is acting on
15782 // behalf of the content owner specified in the parameter value. This parameter
15783 // is intended for YouTube content partners that own and manage many different
15784 // YouTube channels. It allows content owners to authenticate once and get
15785 // access to all their video and channel data, without having to provide
15786 // authentication credentials for each individual channel. The CMS account that
15787 // the user authenticates with must be linked to the specified YouTube content
15788 // owner.
15789 func (c *PlaylistItemsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsListCall {
15790 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
15791 return c
15792 }
15793
15794 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
15795 // identifies a specific page in the result set that should be returned. In an
15796 // API response, the nextPageToken and prevPageToken properties identify other
15797 // pages that could be retrieved.
15798 func (c *PlaylistItemsListCall) PageToken(pageToken string) *PlaylistItemsListCall {
15799 c.urlParams_.Set("pageToken", pageToken)
15800 return c
15801 }
15802
15803 // PlaylistId sets the optional parameter "playlistId": Return the playlist
15804 // items within the given playlist.
15805 func (c *PlaylistItemsListCall) PlaylistId(playlistId string) *PlaylistItemsListCall {
15806 c.urlParams_.Set("playlistId", playlistId)
15807 return c
15808 }
15809
15810 // VideoId sets the optional parameter "videoId": Return the playlist items
15811 // associated with the given video ID.
15812 func (c *PlaylistItemsListCall) VideoId(videoId string) *PlaylistItemsListCall {
15813 c.urlParams_.Set("videoId", videoId)
15814 return c
15815 }
15816
15817 // Fields allows partial responses to be retrieved. See
15818 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15819 // details.
15820 func (c *PlaylistItemsListCall) Fields(s ...googleapi.Field) *PlaylistItemsListCall {
15821 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15822 return c
15823 }
15824
15825 // IfNoneMatch sets an optional parameter which makes the operation fail if the
15826 // object's ETag matches the given value. This is useful for getting updates
15827 // only after the object has changed since the last request.
15828 func (c *PlaylistItemsListCall) IfNoneMatch(entityTag string) *PlaylistItemsListCall {
15829 c.ifNoneMatch_ = entityTag
15830 return c
15831 }
15832
15833 // Context sets the context to be used in this call's Do method.
15834 func (c *PlaylistItemsListCall) Context(ctx context.Context) *PlaylistItemsListCall {
15835 c.ctx_ = ctx
15836 return c
15837 }
15838
15839 // Header returns a http.Header that can be modified by the caller to add
15840 // headers to the request.
15841 func (c *PlaylistItemsListCall) Header() http.Header {
15842 if c.header_ == nil {
15843 c.header_ = make(http.Header)
15844 }
15845 return c.header_
15846 }
15847
15848 func (c *PlaylistItemsListCall) doRequest(alt string) (*http.Response, error) {
15849 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
15850 if c.ifNoneMatch_ != "" {
15851 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15852 }
15853 c.urlParams_.Set("alt", alt)
15854 c.urlParams_.Set("prettyPrint", "false")
15855 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistItems")
15856 urls += "?" + c.urlParams_.Encode()
15857 req, err := http.NewRequest("GET", urls, nil)
15858 if err != nil {
15859 return nil, err
15860 }
15861 req.Header = reqHeaders
15862 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistItems.list", "request", internallog.HTTPRequest(req, nil))
15863 return gensupport.SendRequest(c.ctx_, c.s.client, req)
15864 }
15865
15866 // Do executes the "youtube.playlistItems.list" call.
15867 // Any non-2xx status code is an error. Response headers are in either
15868 // *PlaylistItemListResponse.ServerResponse.Header or (if a response was
15869 // returned at all) in error.(*googleapi.Error).Header. Use
15870 // googleapi.IsNotModified to check whether the returned error was because
15871 // http.StatusNotModified was returned.
15872 func (c *PlaylistItemsListCall) Do(opts ...googleapi.CallOption) (*PlaylistItemListResponse, error) {
15873 gensupport.SetOptions(c.urlParams_, opts...)
15874 res, err := c.doRequest("json")
15875 if res != nil && res.StatusCode == http.StatusNotModified {
15876 if res.Body != nil {
15877 res.Body.Close()
15878 }
15879 return nil, gensupport.WrapError(&googleapi.Error{
15880 Code: res.StatusCode,
15881 Header: res.Header,
15882 })
15883 }
15884 if err != nil {
15885 return nil, err
15886 }
15887 defer googleapi.CloseBody(res)
15888 if err := googleapi.CheckResponse(res); err != nil {
15889 return nil, gensupport.WrapError(err)
15890 }
15891 ret := &PlaylistItemListResponse{
15892 ServerResponse: googleapi.ServerResponse{
15893 Header: res.Header,
15894 HTTPStatusCode: res.StatusCode,
15895 },
15896 }
15897 target := &ret
15898 b, err := gensupport.DecodeResponseBytes(target, res)
15899 if err != nil {
15900 return nil, err
15901 }
15902 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistItems.list", "response", internallog.HTTPResponse(res, b))
15903 return ret, nil
15904 }
15905
15906 // Pages invokes f for each page of results.
15907 // A non-nil error returned from f will halt the iteration.
15908 // The provided context supersedes any context provided to the Context method.
15909 func (c *PlaylistItemsListCall) Pages(ctx context.Context, f func(*PlaylistItemListResponse) error) error {
15910 c.ctx_ = ctx
15911 defer c.PageToken(c.urlParams_.Get("pageToken"))
15912 for {
15913 x, err := c.Do()
15914 if err != nil {
15915 return err
15916 }
15917 if err := f(x); err != nil {
15918 return err
15919 }
15920 if x.NextPageToken == "" {
15921 return nil
15922 }
15923 c.PageToken(x.NextPageToken)
15924 }
15925 }
15926
15927 type PlaylistItemsUpdateCall struct {
15928 s *Service
15929 playlistitem *PlaylistItem
15930 urlParams_ gensupport.URLParams
15931 ctx_ context.Context
15932 header_ http.Header
15933 }
15934
15935 // Update: Updates an existing resource.
15936 //
15937 // - part: The *part* parameter serves two purposes in this operation. It
15938 // identifies the properties that the write operation will set as well as the
15939 // properties that the API response will include. Note that this method will
15940 // override the existing values for all of the mutable properties that are
15941 // contained in any parts that the parameter value specifies. For example, a
15942 // playlist item can specify a start time and end time, which identify the
15943 // times portion of the video that should play when users watch the video in
15944 // the playlist. If your request is updating a playlist item that sets these
15945 // values, and the request's part parameter value includes the contentDetails
15946 // part, the playlist item's start and end times will be updated to whatever
15947 // value the request body specifies. If the request body does not specify
15948 // values, the existing start and end times will be removed and replaced with
15949 // the default settings.
15950 func (r *PlaylistItemsService) Update(part []string, playlistitem *PlaylistItem) *PlaylistItemsUpdateCall {
15951 c := &PlaylistItemsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15952 c.urlParams_.SetMulti("part", append([]string{}, part...))
15953 c.playlistitem = playlistitem
15954 return c
15955 }
15956
15957 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
15958 // *Note:* This parameter is intended exclusively for YouTube content partners.
15959 // The *onBehalfOfContentOwner* parameter indicates that the request's
15960 // authorization credentials identify a YouTube CMS user who is acting on
15961 // behalf of the content owner specified in the parameter value. This parameter
15962 // is intended for YouTube content partners that own and manage many different
15963 // YouTube channels. It allows content owners to authenticate once and get
15964 // access to all their video and channel data, without having to provide
15965 // authentication credentials for each individual channel. The CMS account that
15966 // the user authenticates with must be linked to the specified YouTube content
15967 // owner.
15968 func (c *PlaylistItemsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsUpdateCall {
15969 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
15970 return c
15971 }
15972
15973 // Fields allows partial responses to be retrieved. See
15974 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
15975 // details.
15976 func (c *PlaylistItemsUpdateCall) Fields(s ...googleapi.Field) *PlaylistItemsUpdateCall {
15977 c.urlParams_.Set("fields", googleapi.CombineFields(s))
15978 return c
15979 }
15980
15981 // Context sets the context to be used in this call's Do method.
15982 func (c *PlaylistItemsUpdateCall) Context(ctx context.Context) *PlaylistItemsUpdateCall {
15983 c.ctx_ = ctx
15984 return c
15985 }
15986
15987 // Header returns a http.Header that can be modified by the caller to add
15988 // headers to the request.
15989 func (c *PlaylistItemsUpdateCall) Header() http.Header {
15990 if c.header_ == nil {
15991 c.header_ = make(http.Header)
15992 }
15993 return c.header_
15994 }
15995
15996 func (c *PlaylistItemsUpdateCall) doRequest(alt string) (*http.Response, error) {
15997 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
15998 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlistitem)
15999 if err != nil {
16000 return nil, err
16001 }
16002 c.urlParams_.Set("alt", alt)
16003 c.urlParams_.Set("prettyPrint", "false")
16004 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlistItems")
16005 urls += "?" + c.urlParams_.Encode()
16006 req, err := http.NewRequest("PUT", urls, body)
16007 if err != nil {
16008 return nil, err
16009 }
16010 req.Header = reqHeaders
16011 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlistItems.update", "request", internallog.HTTPRequest(req, body.Bytes()))
16012 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16013 }
16014
16015 // Do executes the "youtube.playlistItems.update" call.
16016 // Any non-2xx status code is an error. Response headers are in either
16017 // *PlaylistItem.ServerResponse.Header or (if a response was returned at all)
16018 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
16019 // whether the returned error was because http.StatusNotModified was returned.
16020 func (c *PlaylistItemsUpdateCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
16021 gensupport.SetOptions(c.urlParams_, opts...)
16022 res, err := c.doRequest("json")
16023 if res != nil && res.StatusCode == http.StatusNotModified {
16024 if res.Body != nil {
16025 res.Body.Close()
16026 }
16027 return nil, gensupport.WrapError(&googleapi.Error{
16028 Code: res.StatusCode,
16029 Header: res.Header,
16030 })
16031 }
16032 if err != nil {
16033 return nil, err
16034 }
16035 defer googleapi.CloseBody(res)
16036 if err := googleapi.CheckResponse(res); err != nil {
16037 return nil, gensupport.WrapError(err)
16038 }
16039 ret := &PlaylistItem{
16040 ServerResponse: googleapi.ServerResponse{
16041 Header: res.Header,
16042 HTTPStatusCode: res.StatusCode,
16043 },
16044 }
16045 target := &ret
16046 b, err := gensupport.DecodeResponseBytes(target, res)
16047 if err != nil {
16048 return nil, err
16049 }
16050 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlistItems.update", "response", internallog.HTTPResponse(res, b))
16051 return ret, nil
16052 }
16053
16054 type PlaylistsDeleteCall struct {
16055 s *Service
16056 urlParams_ gensupport.URLParams
16057 ctx_ context.Context
16058 header_ http.Header
16059 }
16060
16061 // Delete: Deletes a resource.
16062 //
16063 // - id: .
16064 func (r *PlaylistsService) Delete(id string) *PlaylistsDeleteCall {
16065 c := &PlaylistsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16066 c.urlParams_.Set("id", id)
16067 return c
16068 }
16069
16070 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
16071 // *Note:* This parameter is intended exclusively for YouTube content partners.
16072 // The *onBehalfOfContentOwner* parameter indicates that the request's
16073 // authorization credentials identify a YouTube CMS user who is acting on
16074 // behalf of the content owner specified in the parameter value. This parameter
16075 // is intended for YouTube content partners that own and manage many different
16076 // YouTube channels. It allows content owners to authenticate once and get
16077 // access to all their video and channel data, without having to provide
16078 // authentication credentials for each individual channel. The CMS account that
16079 // the user authenticates with must be linked to the specified YouTube content
16080 // owner.
16081 func (c *PlaylistsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsDeleteCall {
16082 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
16083 return c
16084 }
16085
16086 // Fields allows partial responses to be retrieved. See
16087 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16088 // details.
16089 func (c *PlaylistsDeleteCall) Fields(s ...googleapi.Field) *PlaylistsDeleteCall {
16090 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16091 return c
16092 }
16093
16094 // Context sets the context to be used in this call's Do method.
16095 func (c *PlaylistsDeleteCall) Context(ctx context.Context) *PlaylistsDeleteCall {
16096 c.ctx_ = ctx
16097 return c
16098 }
16099
16100 // Header returns a http.Header that can be modified by the caller to add
16101 // headers to the request.
16102 func (c *PlaylistsDeleteCall) Header() http.Header {
16103 if c.header_ == nil {
16104 c.header_ = make(http.Header)
16105 }
16106 return c.header_
16107 }
16108
16109 func (c *PlaylistsDeleteCall) doRequest(alt string) (*http.Response, error) {
16110 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
16111 c.urlParams_.Set("alt", alt)
16112 c.urlParams_.Set("prettyPrint", "false")
16113 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlists")
16114 urls += "?" + c.urlParams_.Encode()
16115 req, err := http.NewRequest("DELETE", urls, nil)
16116 if err != nil {
16117 return nil, err
16118 }
16119 req.Header = reqHeaders
16120 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlists.delete", "request", internallog.HTTPRequest(req, nil))
16121 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16122 }
16123
16124 // Do executes the "youtube.playlists.delete" call.
16125 func (c *PlaylistsDeleteCall) Do(opts ...googleapi.CallOption) error {
16126 gensupport.SetOptions(c.urlParams_, opts...)
16127 res, err := c.doRequest("json")
16128 if err != nil {
16129 return err
16130 }
16131 defer googleapi.CloseBody(res)
16132 if err := googleapi.CheckResponse(res); err != nil {
16133 return gensupport.WrapError(err)
16134 }
16135 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlists.delete", "response", internallog.HTTPResponse(res, nil))
16136 return nil
16137 }
16138
16139 type PlaylistsInsertCall struct {
16140 s *Service
16141 playlist *Playlist
16142 urlParams_ gensupport.URLParams
16143 ctx_ context.Context
16144 header_ http.Header
16145 }
16146
16147 // Insert: Inserts a new resource into this collection.
16148 //
16149 // - part: The *part* parameter serves two purposes in this operation. It
16150 // identifies the properties that the write operation will set as well as the
16151 // properties that the API response will include.
16152 func (r *PlaylistsService) Insert(part []string, playlist *Playlist) *PlaylistsInsertCall {
16153 c := &PlaylistsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16154 c.urlParams_.SetMulti("part", append([]string{}, part...))
16155 c.playlist = playlist
16156 return c
16157 }
16158
16159 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
16160 // *Note:* This parameter is intended exclusively for YouTube content partners.
16161 // The *onBehalfOfContentOwner* parameter indicates that the request's
16162 // authorization credentials identify a YouTube CMS user who is acting on
16163 // behalf of the content owner specified in the parameter value. This parameter
16164 // is intended for YouTube content partners that own and manage many different
16165 // YouTube channels. It allows content owners to authenticate once and get
16166 // access to all their video and channel data, without having to provide
16167 // authentication credentials for each individual channel. The CMS account that
16168 // the user authenticates with must be linked to the specified YouTube content
16169 // owner.
16170 func (c *PlaylistsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsInsertCall {
16171 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
16172 return c
16173 }
16174
16175 // OnBehalfOfContentOwnerChannel sets the optional parameter
16176 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
16177 // properly authorized request. *Note:* This parameter is intended exclusively
16178 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
16179 // specifies the YouTube channel ID of the channel to which a video is being
16180 // added. This parameter is required when a request specifies a value for the
16181 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
16182 // with that parameter. In addition, the request must be authorized using a CMS
16183 // account that is linked to the content owner that the onBehalfOfContentOwner
16184 // parameter specifies. Finally, the channel that the
16185 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
16186 // the content owner that the onBehalfOfContentOwner parameter specifies. This
16187 // parameter is intended for YouTube content partners that own and manage many
16188 // different YouTube channels. It allows content owners to authenticate once
16189 // and perform actions on behalf of the channel specified in the parameter
16190 // value, without having to provide authentication credentials for each
16191 // separate channel.
16192 func (c *PlaylistsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsInsertCall {
16193 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
16194 return c
16195 }
16196
16197 // Fields allows partial responses to be retrieved. See
16198 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16199 // details.
16200 func (c *PlaylistsInsertCall) Fields(s ...googleapi.Field) *PlaylistsInsertCall {
16201 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16202 return c
16203 }
16204
16205 // Context sets the context to be used in this call's Do method.
16206 func (c *PlaylistsInsertCall) Context(ctx context.Context) *PlaylistsInsertCall {
16207 c.ctx_ = ctx
16208 return c
16209 }
16210
16211 // Header returns a http.Header that can be modified by the caller to add
16212 // headers to the request.
16213 func (c *PlaylistsInsertCall) Header() http.Header {
16214 if c.header_ == nil {
16215 c.header_ = make(http.Header)
16216 }
16217 return c.header_
16218 }
16219
16220 func (c *PlaylistsInsertCall) doRequest(alt string) (*http.Response, error) {
16221 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
16222 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlist)
16223 if err != nil {
16224 return nil, err
16225 }
16226 c.urlParams_.Set("alt", alt)
16227 c.urlParams_.Set("prettyPrint", "false")
16228 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlists")
16229 urls += "?" + c.urlParams_.Encode()
16230 req, err := http.NewRequest("POST", urls, body)
16231 if err != nil {
16232 return nil, err
16233 }
16234 req.Header = reqHeaders
16235 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlists.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
16236 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16237 }
16238
16239 // Do executes the "youtube.playlists.insert" call.
16240 // Any non-2xx status code is an error. Response headers are in either
16241 // *Playlist.ServerResponse.Header or (if a response was returned at all) in
16242 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
16243 // whether the returned error was because http.StatusNotModified was returned.
16244 func (c *PlaylistsInsertCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
16245 gensupport.SetOptions(c.urlParams_, opts...)
16246 res, err := c.doRequest("json")
16247 if res != nil && res.StatusCode == http.StatusNotModified {
16248 if res.Body != nil {
16249 res.Body.Close()
16250 }
16251 return nil, gensupport.WrapError(&googleapi.Error{
16252 Code: res.StatusCode,
16253 Header: res.Header,
16254 })
16255 }
16256 if err != nil {
16257 return nil, err
16258 }
16259 defer googleapi.CloseBody(res)
16260 if err := googleapi.CheckResponse(res); err != nil {
16261 return nil, gensupport.WrapError(err)
16262 }
16263 ret := &Playlist{
16264 ServerResponse: googleapi.ServerResponse{
16265 Header: res.Header,
16266 HTTPStatusCode: res.StatusCode,
16267 },
16268 }
16269 target := &ret
16270 b, err := gensupport.DecodeResponseBytes(target, res)
16271 if err != nil {
16272 return nil, err
16273 }
16274 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlists.insert", "response", internallog.HTTPResponse(res, b))
16275 return ret, nil
16276 }
16277
16278 type PlaylistsListCall struct {
16279 s *Service
16280 urlParams_ gensupport.URLParams
16281 ifNoneMatch_ string
16282 ctx_ context.Context
16283 header_ http.Header
16284 }
16285
16286 // List: Retrieves a list of resources, possibly filtered.
16287 //
16288 // - part: The *part* parameter specifies a comma-separated list of one or more
16289 // playlist resource properties that the API response will include. If the
16290 // parameter identifies a property that contains child properties, the child
16291 // properties will be included in the response. For example, in a playlist
16292 // resource, the snippet property contains properties like author, title,
16293 // description, tags, and timeCreated. As such, if you set *part=snippet*,
16294 // the API response will contain all of those properties.
16295 func (r *PlaylistsService) List(part []string) *PlaylistsListCall {
16296 c := &PlaylistsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16297 c.urlParams_.SetMulti("part", append([]string{}, part...))
16298 return c
16299 }
16300
16301 // ChannelId sets the optional parameter "channelId": Return the playlists
16302 // owned by the specified channel ID.
16303 func (c *PlaylistsListCall) ChannelId(channelId string) *PlaylistsListCall {
16304 c.urlParams_.Set("channelId", channelId)
16305 return c
16306 }
16307
16308 // Hl sets the optional parameter "hl": Return content in specified language
16309 func (c *PlaylistsListCall) Hl(hl string) *PlaylistsListCall {
16310 c.urlParams_.Set("hl", hl)
16311 return c
16312 }
16313
16314 // Id sets the optional parameter "id": Return the playlists with the given IDs
16315 // for Stubby or Apiary.
16316 func (c *PlaylistsListCall) Id(id ...string) *PlaylistsListCall {
16317 c.urlParams_.SetMulti("id", append([]string{}, id...))
16318 return c
16319 }
16320
16321 // MaxResults sets the optional parameter "maxResults": The *maxResults*
16322 // parameter specifies the maximum number of items that should be returned in
16323 // the result set.
16324 func (c *PlaylistsListCall) MaxResults(maxResults int64) *PlaylistsListCall {
16325 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
16326 return c
16327 }
16328
16329 // Mine sets the optional parameter "mine": Return the playlists owned by the
16330 // authenticated user.
16331 func (c *PlaylistsListCall) Mine(mine bool) *PlaylistsListCall {
16332 c.urlParams_.Set("mine", fmt.Sprint(mine))
16333 return c
16334 }
16335
16336 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
16337 // *Note:* This parameter is intended exclusively for YouTube content partners.
16338 // The *onBehalfOfContentOwner* parameter indicates that the request's
16339 // authorization credentials identify a YouTube CMS user who is acting on
16340 // behalf of the content owner specified in the parameter value. This parameter
16341 // is intended for YouTube content partners that own and manage many different
16342 // YouTube channels. It allows content owners to authenticate once and get
16343 // access to all their video and channel data, without having to provide
16344 // authentication credentials for each individual channel. The CMS account that
16345 // the user authenticates with must be linked to the specified YouTube content
16346 // owner.
16347 func (c *PlaylistsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsListCall {
16348 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
16349 return c
16350 }
16351
16352 // OnBehalfOfContentOwnerChannel sets the optional parameter
16353 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
16354 // properly authorized request. *Note:* This parameter is intended exclusively
16355 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
16356 // specifies the YouTube channel ID of the channel to which a video is being
16357 // added. This parameter is required when a request specifies a value for the
16358 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
16359 // with that parameter. In addition, the request must be authorized using a CMS
16360 // account that is linked to the content owner that the onBehalfOfContentOwner
16361 // parameter specifies. Finally, the channel that the
16362 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
16363 // the content owner that the onBehalfOfContentOwner parameter specifies. This
16364 // parameter is intended for YouTube content partners that own and manage many
16365 // different YouTube channels. It allows content owners to authenticate once
16366 // and perform actions on behalf of the channel specified in the parameter
16367 // value, without having to provide authentication credentials for each
16368 // separate channel.
16369 func (c *PlaylistsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsListCall {
16370 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
16371 return c
16372 }
16373
16374 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
16375 // identifies a specific page in the result set that should be returned. In an
16376 // API response, the nextPageToken and prevPageToken properties identify other
16377 // pages that could be retrieved.
16378 func (c *PlaylistsListCall) PageToken(pageToken string) *PlaylistsListCall {
16379 c.urlParams_.Set("pageToken", pageToken)
16380 return c
16381 }
16382
16383 // Fields allows partial responses to be retrieved. See
16384 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16385 // details.
16386 func (c *PlaylistsListCall) Fields(s ...googleapi.Field) *PlaylistsListCall {
16387 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16388 return c
16389 }
16390
16391 // IfNoneMatch sets an optional parameter which makes the operation fail if the
16392 // object's ETag matches the given value. This is useful for getting updates
16393 // only after the object has changed since the last request.
16394 func (c *PlaylistsListCall) IfNoneMatch(entityTag string) *PlaylistsListCall {
16395 c.ifNoneMatch_ = entityTag
16396 return c
16397 }
16398
16399 // Context sets the context to be used in this call's Do method.
16400 func (c *PlaylistsListCall) Context(ctx context.Context) *PlaylistsListCall {
16401 c.ctx_ = ctx
16402 return c
16403 }
16404
16405 // Header returns a http.Header that can be modified by the caller to add
16406 // headers to the request.
16407 func (c *PlaylistsListCall) Header() http.Header {
16408 if c.header_ == nil {
16409 c.header_ = make(http.Header)
16410 }
16411 return c.header_
16412 }
16413
16414 func (c *PlaylistsListCall) doRequest(alt string) (*http.Response, error) {
16415 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
16416 if c.ifNoneMatch_ != "" {
16417 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16418 }
16419 c.urlParams_.Set("alt", alt)
16420 c.urlParams_.Set("prettyPrint", "false")
16421 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlists")
16422 urls += "?" + c.urlParams_.Encode()
16423 req, err := http.NewRequest("GET", urls, nil)
16424 if err != nil {
16425 return nil, err
16426 }
16427 req.Header = reqHeaders
16428 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlists.list", "request", internallog.HTTPRequest(req, nil))
16429 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16430 }
16431
16432 // Do executes the "youtube.playlists.list" call.
16433 // Any non-2xx status code is an error. Response headers are in either
16434 // *PlaylistListResponse.ServerResponse.Header or (if a response was returned
16435 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16436 // check whether the returned error was because http.StatusNotModified was
16437 // returned.
16438 func (c *PlaylistsListCall) Do(opts ...googleapi.CallOption) (*PlaylistListResponse, error) {
16439 gensupport.SetOptions(c.urlParams_, opts...)
16440 res, err := c.doRequest("json")
16441 if res != nil && res.StatusCode == http.StatusNotModified {
16442 if res.Body != nil {
16443 res.Body.Close()
16444 }
16445 return nil, gensupport.WrapError(&googleapi.Error{
16446 Code: res.StatusCode,
16447 Header: res.Header,
16448 })
16449 }
16450 if err != nil {
16451 return nil, err
16452 }
16453 defer googleapi.CloseBody(res)
16454 if err := googleapi.CheckResponse(res); err != nil {
16455 return nil, gensupport.WrapError(err)
16456 }
16457 ret := &PlaylistListResponse{
16458 ServerResponse: googleapi.ServerResponse{
16459 Header: res.Header,
16460 HTTPStatusCode: res.StatusCode,
16461 },
16462 }
16463 target := &ret
16464 b, err := gensupport.DecodeResponseBytes(target, res)
16465 if err != nil {
16466 return nil, err
16467 }
16468 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlists.list", "response", internallog.HTTPResponse(res, b))
16469 return ret, nil
16470 }
16471
16472 // Pages invokes f for each page of results.
16473 // A non-nil error returned from f will halt the iteration.
16474 // The provided context supersedes any context provided to the Context method.
16475 func (c *PlaylistsListCall) Pages(ctx context.Context, f func(*PlaylistListResponse) error) error {
16476 c.ctx_ = ctx
16477 defer c.PageToken(c.urlParams_.Get("pageToken"))
16478 for {
16479 x, err := c.Do()
16480 if err != nil {
16481 return err
16482 }
16483 if err := f(x); err != nil {
16484 return err
16485 }
16486 if x.NextPageToken == "" {
16487 return nil
16488 }
16489 c.PageToken(x.NextPageToken)
16490 }
16491 }
16492
16493 type PlaylistsUpdateCall struct {
16494 s *Service
16495 playlist *Playlist
16496 urlParams_ gensupport.URLParams
16497 ctx_ context.Context
16498 header_ http.Header
16499 }
16500
16501 // Update: Updates an existing resource.
16502 //
16503 // - part: The *part* parameter serves two purposes in this operation. It
16504 // identifies the properties that the write operation will set as well as the
16505 // properties that the API response will include. Note that this method will
16506 // override the existing values for mutable properties that are contained in
16507 // any parts that the request body specifies. For example, a playlist's
16508 // description is contained in the snippet part, which must be included in
16509 // the request body. If the request does not specify a value for the
16510 // snippet.description property, the playlist's existing description will be
16511 // deleted.
16512 func (r *PlaylistsService) Update(part []string, playlist *Playlist) *PlaylistsUpdateCall {
16513 c := &PlaylistsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16514 c.urlParams_.SetMulti("part", append([]string{}, part...))
16515 c.playlist = playlist
16516 return c
16517 }
16518
16519 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
16520 // *Note:* This parameter is intended exclusively for YouTube content partners.
16521 // The *onBehalfOfContentOwner* parameter indicates that the request's
16522 // authorization credentials identify a YouTube CMS user who is acting on
16523 // behalf of the content owner specified in the parameter value. This parameter
16524 // is intended for YouTube content partners that own and manage many different
16525 // YouTube channels. It allows content owners to authenticate once and get
16526 // access to all their video and channel data, without having to provide
16527 // authentication credentials for each individual channel. The CMS account that
16528 // the user authenticates with must be linked to the specified YouTube content
16529 // owner.
16530 func (c *PlaylistsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsUpdateCall {
16531 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
16532 return c
16533 }
16534
16535 // Fields allows partial responses to be retrieved. See
16536 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16537 // details.
16538 func (c *PlaylistsUpdateCall) Fields(s ...googleapi.Field) *PlaylistsUpdateCall {
16539 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16540 return c
16541 }
16542
16543 // Context sets the context to be used in this call's Do method.
16544 func (c *PlaylistsUpdateCall) Context(ctx context.Context) *PlaylistsUpdateCall {
16545 c.ctx_ = ctx
16546 return c
16547 }
16548
16549 // Header returns a http.Header that can be modified by the caller to add
16550 // headers to the request.
16551 func (c *PlaylistsUpdateCall) Header() http.Header {
16552 if c.header_ == nil {
16553 c.header_ = make(http.Header)
16554 }
16555 return c.header_
16556 }
16557
16558 func (c *PlaylistsUpdateCall) doRequest(alt string) (*http.Response, error) {
16559 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
16560 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.playlist)
16561 if err != nil {
16562 return nil, err
16563 }
16564 c.urlParams_.Set("alt", alt)
16565 c.urlParams_.Set("prettyPrint", "false")
16566 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/playlists")
16567 urls += "?" + c.urlParams_.Encode()
16568 req, err := http.NewRequest("PUT", urls, body)
16569 if err != nil {
16570 return nil, err
16571 }
16572 req.Header = reqHeaders
16573 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.playlists.update", "request", internallog.HTTPRequest(req, body.Bytes()))
16574 return gensupport.SendRequest(c.ctx_, c.s.client, req)
16575 }
16576
16577 // Do executes the "youtube.playlists.update" call.
16578 // Any non-2xx status code is an error. Response headers are in either
16579 // *Playlist.ServerResponse.Header or (if a response was returned at all) in
16580 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
16581 // whether the returned error was because http.StatusNotModified was returned.
16582 func (c *PlaylistsUpdateCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
16583 gensupport.SetOptions(c.urlParams_, opts...)
16584 res, err := c.doRequest("json")
16585 if res != nil && res.StatusCode == http.StatusNotModified {
16586 if res.Body != nil {
16587 res.Body.Close()
16588 }
16589 return nil, gensupport.WrapError(&googleapi.Error{
16590 Code: res.StatusCode,
16591 Header: res.Header,
16592 })
16593 }
16594 if err != nil {
16595 return nil, err
16596 }
16597 defer googleapi.CloseBody(res)
16598 if err := googleapi.CheckResponse(res); err != nil {
16599 return nil, gensupport.WrapError(err)
16600 }
16601 ret := &Playlist{
16602 ServerResponse: googleapi.ServerResponse{
16603 Header: res.Header,
16604 HTTPStatusCode: res.StatusCode,
16605 },
16606 }
16607 target := &ret
16608 b, err := gensupport.DecodeResponseBytes(target, res)
16609 if err != nil {
16610 return nil, err
16611 }
16612 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.playlists.update", "response", internallog.HTTPResponse(res, b))
16613 return ret, nil
16614 }
16615
16616 type SearchListCall struct {
16617 s *Service
16618 urlParams_ gensupport.URLParams
16619 ifNoneMatch_ string
16620 ctx_ context.Context
16621 header_ http.Header
16622 }
16623
16624 // List: Retrieves a list of search resources
16625 //
16626 // - part: The *part* parameter specifies a comma-separated list of one or more
16627 // search resource properties that the API response will include. Set the
16628 // parameter value to snippet.
16629 func (r *SearchService) List(part []string) *SearchListCall {
16630 c := &SearchListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16631 c.urlParams_.SetMulti("part", append([]string{}, part...))
16632 return c
16633 }
16634
16635 // ChannelId sets the optional parameter "channelId": Filter on resources
16636 // belonging to this channelId.
16637 func (c *SearchListCall) ChannelId(channelId string) *SearchListCall {
16638 c.urlParams_.Set("channelId", channelId)
16639 return c
16640 }
16641
16642 // ChannelType sets the optional parameter "channelType": Add a filter on the
16643 // channel search.
16644 //
16645 // Possible values:
16646 //
16647 // "channelTypeUnspecified"
16648 // "any" - Return all channels.
16649 // "show" - Only retrieve shows.
16650 func (c *SearchListCall) ChannelType(channelType string) *SearchListCall {
16651 c.urlParams_.Set("channelType", channelType)
16652 return c
16653 }
16654
16655 // EventType sets the optional parameter "eventType": Filter on the livestream
16656 // status of the videos.
16657 //
16658 // Possible values:
16659 //
16660 // "none"
16661 // "upcoming" - The live broadcast is upcoming.
16662 // "live" - The live broadcast is active.
16663 // "completed" - The live broadcast has been completed.
16664 func (c *SearchListCall) EventType(eventType string) *SearchListCall {
16665 c.urlParams_.Set("eventType", eventType)
16666 return c
16667 }
16668
16669 // ForContentOwner sets the optional parameter "forContentOwner": Search owned
16670 // by a content owner.
16671 func (c *SearchListCall) ForContentOwner(forContentOwner bool) *SearchListCall {
16672 c.urlParams_.Set("forContentOwner", fmt.Sprint(forContentOwner))
16673 return c
16674 }
16675
16676 // ForDeveloper sets the optional parameter "forDeveloper": Restrict the search
16677 // to only retrieve videos uploaded using the project id of the authenticated
16678 // user.
16679 func (c *SearchListCall) ForDeveloper(forDeveloper bool) *SearchListCall {
16680 c.urlParams_.Set("forDeveloper", fmt.Sprint(forDeveloper))
16681 return c
16682 }
16683
16684 // ForMine sets the optional parameter "forMine": Search for the private videos
16685 // of the authenticated user.
16686 func (c *SearchListCall) ForMine(forMine bool) *SearchListCall {
16687 c.urlParams_.Set("forMine", fmt.Sprint(forMine))
16688 return c
16689 }
16690
16691 // Location sets the optional parameter "location": Filter on location of the
16692 // video
16693 func (c *SearchListCall) Location(location string) *SearchListCall {
16694 c.urlParams_.Set("location", location)
16695 return c
16696 }
16697
16698 // LocationRadius sets the optional parameter "locationRadius": Filter on
16699 // distance from the location (specified above).
16700 func (c *SearchListCall) LocationRadius(locationRadius string) *SearchListCall {
16701 c.urlParams_.Set("locationRadius", locationRadius)
16702 return c
16703 }
16704
16705 // MaxResults sets the optional parameter "maxResults": The *maxResults*
16706 // parameter specifies the maximum number of items that should be returned in
16707 // the result set.
16708 func (c *SearchListCall) MaxResults(maxResults int64) *SearchListCall {
16709 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
16710 return c
16711 }
16712
16713 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
16714 // *Note:* This parameter is intended exclusively for YouTube content partners.
16715 // The *onBehalfOfContentOwner* parameter indicates that the request's
16716 // authorization credentials identify a YouTube CMS user who is acting on
16717 // behalf of the content owner specified in the parameter value. This parameter
16718 // is intended for YouTube content partners that own and manage many different
16719 // YouTube channels. It allows content owners to authenticate once and get
16720 // access to all their video and channel data, without having to provide
16721 // authentication credentials for each individual channel. The CMS account that
16722 // the user authenticates with must be linked to the specified YouTube content
16723 // owner.
16724 func (c *SearchListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SearchListCall {
16725 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
16726 return c
16727 }
16728
16729 // Order sets the optional parameter "order": Sort order of the results.
16730 //
16731 // Possible values:
16732 //
16733 // "searchSortUnspecified"
16734 // "date" - Resources are sorted in reverse chronological order based on the
16735 //
16736 // date they were created.
16737 //
16738 // "rating" - Resources are sorted from highest to lowest rating.
16739 // "viewCount" - Resources are sorted from highest to lowest number of views.
16740 // "relevance" (default) - Resources are sorted based on their relevance to
16741 //
16742 // the search query. This is the default value for this parameter.
16743 //
16744 // "title" - Resources are sorted alphabetically by title.
16745 // "videoCount" - Channels are sorted in descending order of their number of
16746 //
16747 // uploaded videos.
16748 func (c *SearchListCall) Order(order string) *SearchListCall {
16749 c.urlParams_.Set("order", order)
16750 return c
16751 }
16752
16753 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
16754 // identifies a specific page in the result set that should be returned. In an
16755 // API response, the nextPageToken and prevPageToken properties identify other
16756 // pages that could be retrieved.
16757 func (c *SearchListCall) PageToken(pageToken string) *SearchListCall {
16758 c.urlParams_.Set("pageToken", pageToken)
16759 return c
16760 }
16761
16762 // PublishedAfter sets the optional parameter "publishedAfter": Filter on
16763 // resources published after this date.
16764 func (c *SearchListCall) PublishedAfter(publishedAfter string) *SearchListCall {
16765 c.urlParams_.Set("publishedAfter", publishedAfter)
16766 return c
16767 }
16768
16769 // PublishedBefore sets the optional parameter "publishedBefore": Filter on
16770 // resources published before this date.
16771 func (c *SearchListCall) PublishedBefore(publishedBefore string) *SearchListCall {
16772 c.urlParams_.Set("publishedBefore", publishedBefore)
16773 return c
16774 }
16775
16776 // Q sets the optional parameter "q": Textual search terms to match.
16777 func (c *SearchListCall) Q(q string) *SearchListCall {
16778 c.urlParams_.Set("q", q)
16779 return c
16780 }
16781
16782 // RegionCode sets the optional parameter "regionCode": Display the content as
16783 // seen by viewers in this country.
16784 func (c *SearchListCall) RegionCode(regionCode string) *SearchListCall {
16785 c.urlParams_.Set("regionCode", regionCode)
16786 return c
16787 }
16788
16789 // RelevanceLanguage sets the optional parameter "relevanceLanguage": Return
16790 // results relevant to this language.
16791 func (c *SearchListCall) RelevanceLanguage(relevanceLanguage string) *SearchListCall {
16792 c.urlParams_.Set("relevanceLanguage", relevanceLanguage)
16793 return c
16794 }
16795
16796 // SafeSearch sets the optional parameter "safeSearch": Indicates whether the
16797 // search results should include restricted content as well as standard
16798 // content.
16799 //
16800 // Possible values:
16801 //
16802 // "safeSearchSettingUnspecified"
16803 // "none" - YouTube will not filter the search result set.
16804 // "moderate" (default) - YouTube will filter some content from search
16805 //
16806 // results and, at the least, will filter content that is restricted in your
16807 // locale. Based on their content, search results could be removed from search
16808 // results or demoted in search results. This is the default parameter value.
16809 //
16810 // "strict" - YouTube will try to exclude all restricted content from the
16811 //
16812 // search result set. Based on their content, search results could be removed
16813 // from search results or demoted in search results.
16814 func (c *SearchListCall) SafeSearch(safeSearch string) *SearchListCall {
16815 c.urlParams_.Set("safeSearch", safeSearch)
16816 return c
16817 }
16818
16819 // TopicId sets the optional parameter "topicId": Restrict results to a
16820 // particular topic.
16821 func (c *SearchListCall) TopicId(topicId string) *SearchListCall {
16822 c.urlParams_.Set("topicId", topicId)
16823 return c
16824 }
16825
16826 // Type sets the optional parameter "type": Restrict results to a particular
16827 // set of resource types from One Platform.
16828 func (c *SearchListCall) Type(type_ ...string) *SearchListCall {
16829 c.urlParams_.SetMulti("type", append([]string{}, type_...))
16830 return c
16831 }
16832
16833 // VideoCaption sets the optional parameter "videoCaption": Filter on the
16834 // presence of captions on the videos.
16835 //
16836 // Possible values:
16837 //
16838 // "videoCaptionUnspecified"
16839 // "any" - Do not filter results based on caption availability.
16840 // "closedCaption" - Only include videos that have captions.
16841 // "none" - Only include videos that do not have captions.
16842 func (c *SearchListCall) VideoCaption(videoCaption string) *SearchListCall {
16843 c.urlParams_.Set("videoCaption", videoCaption)
16844 return c
16845 }
16846
16847 // VideoCategoryId sets the optional parameter "videoCategoryId": Filter on
16848 // videos in a specific category.
16849 func (c *SearchListCall) VideoCategoryId(videoCategoryId string) *SearchListCall {
16850 c.urlParams_.Set("videoCategoryId", videoCategoryId)
16851 return c
16852 }
16853
16854 // VideoDefinition sets the optional parameter "videoDefinition": Filter on the
16855 // definition of the videos.
16856 //
16857 // Possible values:
16858 //
16859 // "any" - Return all videos, regardless of their resolution.
16860 // "standard" - Only retrieve videos in standard definition.
16861 // "high" - Only retrieve HD videos.
16862 func (c *SearchListCall) VideoDefinition(videoDefinition string) *SearchListCall {
16863 c.urlParams_.Set("videoDefinition", videoDefinition)
16864 return c
16865 }
16866
16867 // VideoDimension sets the optional parameter "videoDimension": Filter on 3d
16868 // videos.
16869 //
16870 // Possible values:
16871 //
16872 // "any" - Include both 3D and non-3D videos in returned results. This is the
16873 //
16874 // default value.
16875 //
16876 // "2d" - Restrict search results to exclude 3D videos.
16877 // "3d" - Restrict search results to only include 3D videos.
16878 func (c *SearchListCall) VideoDimension(videoDimension string) *SearchListCall {
16879 c.urlParams_.Set("videoDimension", videoDimension)
16880 return c
16881 }
16882
16883 // VideoDuration sets the optional parameter "videoDuration": Filter on the
16884 // duration of the videos.
16885 //
16886 // Possible values:
16887 //
16888 // "videoDurationUnspecified"
16889 // "any" - Do not filter video search results based on their duration. This
16890 //
16891 // is the default value.
16892 //
16893 // "short" - Only include videos that are less than four minutes long.
16894 // "medium" - Only include videos that are between four and 20 minutes long
16895 //
16896 // (inclusive).
16897 //
16898 // "long" - Only include videos longer than 20 minutes.
16899 func (c *SearchListCall) VideoDuration(videoDuration string) *SearchListCall {
16900 c.urlParams_.Set("videoDuration", videoDuration)
16901 return c
16902 }
16903
16904 // VideoEmbeddable sets the optional parameter "videoEmbeddable": Filter on
16905 // embeddable videos.
16906 //
16907 // Possible values:
16908 //
16909 // "videoEmbeddableUnspecified"
16910 // "any" - Return all videos, embeddable or not.
16911 // "true" - Only retrieve embeddable videos.
16912 func (c *SearchListCall) VideoEmbeddable(videoEmbeddable string) *SearchListCall {
16913 c.urlParams_.Set("videoEmbeddable", videoEmbeddable)
16914 return c
16915 }
16916
16917 // VideoLicense sets the optional parameter "videoLicense": Filter on the
16918 // license of the videos.
16919 //
16920 // Possible values:
16921 //
16922 // "any" - Return all videos, regardless of which license they have, that
16923 //
16924 // match the query parameters.
16925 //
16926 // "youtube" - Only return videos that have the standard YouTube license.
16927 // "creativeCommon" - Only return videos that have a Creative Commons
16928 //
16929 // license. Users can reuse videos with this license in other videos that they
16930 // create. Learn more.
16931 func (c *SearchListCall) VideoLicense(videoLicense string) *SearchListCall {
16932 c.urlParams_.Set("videoLicense", videoLicense)
16933 return c
16934 }
16935
16936 // VideoPaidProductPlacement sets the optional parameter
16937 // "videoPaidProductPlacement":
16938 //
16939 // Possible values:
16940 //
16941 // "videoPaidProductPlacementUnspecified"
16942 // "any" - Return all videos, paid product placement or not.
16943 // "true" - Restrict results to only videos with paid product placement.
16944 func (c *SearchListCall) VideoPaidProductPlacement(videoPaidProductPlacement string) *SearchListCall {
16945 c.urlParams_.Set("videoPaidProductPlacement", videoPaidProductPlacement)
16946 return c
16947 }
16948
16949 // VideoSyndicated sets the optional parameter "videoSyndicated": Filter on
16950 // syndicated videos.
16951 //
16952 // Possible values:
16953 //
16954 // "videoSyndicatedUnspecified"
16955 // "any" - Return all videos, syndicated or not.
16956 // "true" - Only retrieve syndicated videos.
16957 func (c *SearchListCall) VideoSyndicated(videoSyndicated string) *SearchListCall {
16958 c.urlParams_.Set("videoSyndicated", videoSyndicated)
16959 return c
16960 }
16961
16962 // VideoType sets the optional parameter "videoType": Filter on videos of a
16963 // specific type.
16964 //
16965 // Possible values:
16966 //
16967 // "videoTypeUnspecified"
16968 // "any" - Return all videos.
16969 // "movie" - Only retrieve movies.
16970 // "episode" - Only retrieve episodes of shows.
16971 func (c *SearchListCall) VideoType(videoType string) *SearchListCall {
16972 c.urlParams_.Set("videoType", videoType)
16973 return c
16974 }
16975
16976 // Fields allows partial responses to be retrieved. See
16977 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
16978 // details.
16979 func (c *SearchListCall) Fields(s ...googleapi.Field) *SearchListCall {
16980 c.urlParams_.Set("fields", googleapi.CombineFields(s))
16981 return c
16982 }
16983
16984 // IfNoneMatch sets an optional parameter which makes the operation fail if the
16985 // object's ETag matches the given value. This is useful for getting updates
16986 // only after the object has changed since the last request.
16987 func (c *SearchListCall) IfNoneMatch(entityTag string) *SearchListCall {
16988 c.ifNoneMatch_ = entityTag
16989 return c
16990 }
16991
16992 // Context sets the context to be used in this call's Do method.
16993 func (c *SearchListCall) Context(ctx context.Context) *SearchListCall {
16994 c.ctx_ = ctx
16995 return c
16996 }
16997
16998 // Header returns a http.Header that can be modified by the caller to add
16999 // headers to the request.
17000 func (c *SearchListCall) Header() http.Header {
17001 if c.header_ == nil {
17002 c.header_ = make(http.Header)
17003 }
17004 return c.header_
17005 }
17006
17007 func (c *SearchListCall) doRequest(alt string) (*http.Response, error) {
17008 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
17009 if c.ifNoneMatch_ != "" {
17010 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17011 }
17012 c.urlParams_.Set("alt", alt)
17013 c.urlParams_.Set("prettyPrint", "false")
17014 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/search")
17015 urls += "?" + c.urlParams_.Encode()
17016 req, err := http.NewRequest("GET", urls, nil)
17017 if err != nil {
17018 return nil, err
17019 }
17020 req.Header = reqHeaders
17021 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.search.list", "request", internallog.HTTPRequest(req, nil))
17022 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17023 }
17024
17025 // Do executes the "youtube.search.list" call.
17026 // Any non-2xx status code is an error. Response headers are in either
17027 // *SearchListResponse.ServerResponse.Header or (if a response was returned at
17028 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17029 // check whether the returned error was because http.StatusNotModified was
17030 // returned.
17031 func (c *SearchListCall) Do(opts ...googleapi.CallOption) (*SearchListResponse, error) {
17032 gensupport.SetOptions(c.urlParams_, opts...)
17033 res, err := c.doRequest("json")
17034 if res != nil && res.StatusCode == http.StatusNotModified {
17035 if res.Body != nil {
17036 res.Body.Close()
17037 }
17038 return nil, gensupport.WrapError(&googleapi.Error{
17039 Code: res.StatusCode,
17040 Header: res.Header,
17041 })
17042 }
17043 if err != nil {
17044 return nil, err
17045 }
17046 defer googleapi.CloseBody(res)
17047 if err := googleapi.CheckResponse(res); err != nil {
17048 return nil, gensupport.WrapError(err)
17049 }
17050 ret := &SearchListResponse{
17051 ServerResponse: googleapi.ServerResponse{
17052 Header: res.Header,
17053 HTTPStatusCode: res.StatusCode,
17054 },
17055 }
17056 target := &ret
17057 b, err := gensupport.DecodeResponseBytes(target, res)
17058 if err != nil {
17059 return nil, err
17060 }
17061 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.search.list", "response", internallog.HTTPResponse(res, b))
17062 return ret, nil
17063 }
17064
17065 // Pages invokes f for each page of results.
17066 // A non-nil error returned from f will halt the iteration.
17067 // The provided context supersedes any context provided to the Context method.
17068 func (c *SearchListCall) Pages(ctx context.Context, f func(*SearchListResponse) error) error {
17069 c.ctx_ = ctx
17070 defer c.PageToken(c.urlParams_.Get("pageToken"))
17071 for {
17072 x, err := c.Do()
17073 if err != nil {
17074 return err
17075 }
17076 if err := f(x); err != nil {
17077 return err
17078 }
17079 if x.NextPageToken == "" {
17080 return nil
17081 }
17082 c.PageToken(x.NextPageToken)
17083 }
17084 }
17085
17086 type SubscriptionsDeleteCall struct {
17087 s *Service
17088 urlParams_ gensupport.URLParams
17089 ctx_ context.Context
17090 header_ http.Header
17091 }
17092
17093 // Delete: Deletes a resource.
17094 //
17095 // - id: .
17096 func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
17097 c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17098 c.urlParams_.Set("id", id)
17099 return c
17100 }
17101
17102 // Fields allows partial responses to be retrieved. See
17103 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17104 // details.
17105 func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
17106 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17107 return c
17108 }
17109
17110 // Context sets the context to be used in this call's Do method.
17111 func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
17112 c.ctx_ = ctx
17113 return c
17114 }
17115
17116 // Header returns a http.Header that can be modified by the caller to add
17117 // headers to the request.
17118 func (c *SubscriptionsDeleteCall) Header() http.Header {
17119 if c.header_ == nil {
17120 c.header_ = make(http.Header)
17121 }
17122 return c.header_
17123 }
17124
17125 func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
17126 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
17127 c.urlParams_.Set("alt", alt)
17128 c.urlParams_.Set("prettyPrint", "false")
17129 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/subscriptions")
17130 urls += "?" + c.urlParams_.Encode()
17131 req, err := http.NewRequest("DELETE", urls, nil)
17132 if err != nil {
17133 return nil, err
17134 }
17135 req.Header = reqHeaders
17136 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.subscriptions.delete", "request", internallog.HTTPRequest(req, nil))
17137 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17138 }
17139
17140 // Do executes the "youtube.subscriptions.delete" call.
17141 func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
17142 gensupport.SetOptions(c.urlParams_, opts...)
17143 res, err := c.doRequest("json")
17144 if err != nil {
17145 return err
17146 }
17147 defer googleapi.CloseBody(res)
17148 if err := googleapi.CheckResponse(res); err != nil {
17149 return gensupport.WrapError(err)
17150 }
17151 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.subscriptions.delete", "response", internallog.HTTPResponse(res, nil))
17152 return nil
17153 }
17154
17155 type SubscriptionsInsertCall struct {
17156 s *Service
17157 subscription *Subscription
17158 urlParams_ gensupport.URLParams
17159 ctx_ context.Context
17160 header_ http.Header
17161 }
17162
17163 // Insert: Inserts a new resource into this collection.
17164 //
17165 // - part: The *part* parameter serves two purposes in this operation. It
17166 // identifies the properties that the write operation will set as well as the
17167 // properties that the API response will include.
17168 func (r *SubscriptionsService) Insert(part []string, subscription *Subscription) *SubscriptionsInsertCall {
17169 c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17170 c.urlParams_.SetMulti("part", append([]string{}, part...))
17171 c.subscription = subscription
17172 return c
17173 }
17174
17175 // Fields allows partial responses to be retrieved. See
17176 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17177 // details.
17178 func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
17179 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17180 return c
17181 }
17182
17183 // Context sets the context to be used in this call's Do method.
17184 func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
17185 c.ctx_ = ctx
17186 return c
17187 }
17188
17189 // Header returns a http.Header that can be modified by the caller to add
17190 // headers to the request.
17191 func (c *SubscriptionsInsertCall) Header() http.Header {
17192 if c.header_ == nil {
17193 c.header_ = make(http.Header)
17194 }
17195 return c.header_
17196 }
17197
17198 func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
17199 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
17200 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.subscription)
17201 if err != nil {
17202 return nil, err
17203 }
17204 c.urlParams_.Set("alt", alt)
17205 c.urlParams_.Set("prettyPrint", "false")
17206 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/subscriptions")
17207 urls += "?" + c.urlParams_.Encode()
17208 req, err := http.NewRequest("POST", urls, body)
17209 if err != nil {
17210 return nil, err
17211 }
17212 req.Header = reqHeaders
17213 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.subscriptions.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
17214 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17215 }
17216
17217 // Do executes the "youtube.subscriptions.insert" call.
17218 // Any non-2xx status code is an error. Response headers are in either
17219 // *Subscription.ServerResponse.Header or (if a response was returned at all)
17220 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
17221 // whether the returned error was because http.StatusNotModified was returned.
17222 func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
17223 gensupport.SetOptions(c.urlParams_, opts...)
17224 res, err := c.doRequest("json")
17225 if res != nil && res.StatusCode == http.StatusNotModified {
17226 if res.Body != nil {
17227 res.Body.Close()
17228 }
17229 return nil, gensupport.WrapError(&googleapi.Error{
17230 Code: res.StatusCode,
17231 Header: res.Header,
17232 })
17233 }
17234 if err != nil {
17235 return nil, err
17236 }
17237 defer googleapi.CloseBody(res)
17238 if err := googleapi.CheckResponse(res); err != nil {
17239 return nil, gensupport.WrapError(err)
17240 }
17241 ret := &Subscription{
17242 ServerResponse: googleapi.ServerResponse{
17243 Header: res.Header,
17244 HTTPStatusCode: res.StatusCode,
17245 },
17246 }
17247 target := &ret
17248 b, err := gensupport.DecodeResponseBytes(target, res)
17249 if err != nil {
17250 return nil, err
17251 }
17252 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.subscriptions.insert", "response", internallog.HTTPResponse(res, b))
17253 return ret, nil
17254 }
17255
17256 type SubscriptionsListCall struct {
17257 s *Service
17258 urlParams_ gensupport.URLParams
17259 ifNoneMatch_ string
17260 ctx_ context.Context
17261 header_ http.Header
17262 }
17263
17264 // List: Retrieves a list of resources, possibly filtered.
17265 //
17266 // - part: The *part* parameter specifies a comma-separated list of one or more
17267 // subscription resource properties that the API response will include. If
17268 // the parameter identifies a property that contains child properties, the
17269 // child properties will be included in the response. For example, in a
17270 // subscription resource, the snippet property contains other properties,
17271 // such as a display title for the subscription. If you set *part=snippet*,
17272 // the API response will also contain all of those nested properties.
17273 func (r *SubscriptionsService) List(part []string) *SubscriptionsListCall {
17274 c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17275 c.urlParams_.SetMulti("part", append([]string{}, part...))
17276 return c
17277 }
17278
17279 // ChannelId sets the optional parameter "channelId": Return the subscriptions
17280 // of the given channel owner.
17281 func (c *SubscriptionsListCall) ChannelId(channelId string) *SubscriptionsListCall {
17282 c.urlParams_.Set("channelId", channelId)
17283 return c
17284 }
17285
17286 // ForChannelId sets the optional parameter "forChannelId": Return the
17287 // subscriptions to the subset of these channels that the authenticated user is
17288 // subscribed to.
17289 func (c *SubscriptionsListCall) ForChannelId(forChannelId string) *SubscriptionsListCall {
17290 c.urlParams_.Set("forChannelId", forChannelId)
17291 return c
17292 }
17293
17294 // Id sets the optional parameter "id": Return the subscriptions with the given
17295 // IDs for Stubby or Apiary.
17296 func (c *SubscriptionsListCall) Id(id ...string) *SubscriptionsListCall {
17297 c.urlParams_.SetMulti("id", append([]string{}, id...))
17298 return c
17299 }
17300
17301 // MaxResults sets the optional parameter "maxResults": The *maxResults*
17302 // parameter specifies the maximum number of items that should be returned in
17303 // the result set.
17304 func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall {
17305 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
17306 return c
17307 }
17308
17309 // Mine sets the optional parameter "mine": Flag for returning the
17310 // subscriptions of the authenticated user.
17311 func (c *SubscriptionsListCall) Mine(mine bool) *SubscriptionsListCall {
17312 c.urlParams_.Set("mine", fmt.Sprint(mine))
17313 return c
17314 }
17315
17316 // MyRecentSubscribers sets the optional parameter "myRecentSubscribers":
17317 func (c *SubscriptionsListCall) MyRecentSubscribers(myRecentSubscribers bool) *SubscriptionsListCall {
17318 c.urlParams_.Set("myRecentSubscribers", fmt.Sprint(myRecentSubscribers))
17319 return c
17320 }
17321
17322 // MySubscribers sets the optional parameter "mySubscribers": Return the
17323 // subscribers of the given channel owner.
17324 func (c *SubscriptionsListCall) MySubscribers(mySubscribers bool) *SubscriptionsListCall {
17325 c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
17326 return c
17327 }
17328
17329 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
17330 // *Note:* This parameter is intended exclusively for YouTube content partners.
17331 // The *onBehalfOfContentOwner* parameter indicates that the request's
17332 // authorization credentials identify a YouTube CMS user who is acting on
17333 // behalf of the content owner specified in the parameter value. This parameter
17334 // is intended for YouTube content partners that own and manage many different
17335 // YouTube channels. It allows content owners to authenticate once and get
17336 // access to all their video and channel data, without having to provide
17337 // authentication credentials for each individual channel. The CMS account that
17338 // the user authenticates with must be linked to the specified YouTube content
17339 // owner.
17340 func (c *SubscriptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SubscriptionsListCall {
17341 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
17342 return c
17343 }
17344
17345 // OnBehalfOfContentOwnerChannel sets the optional parameter
17346 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
17347 // properly authorized request. *Note:* This parameter is intended exclusively
17348 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
17349 // specifies the YouTube channel ID of the channel to which a video is being
17350 // added. This parameter is required when a request specifies a value for the
17351 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
17352 // with that parameter. In addition, the request must be authorized using a CMS
17353 // account that is linked to the content owner that the onBehalfOfContentOwner
17354 // parameter specifies. Finally, the channel that the
17355 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
17356 // the content owner that the onBehalfOfContentOwner parameter specifies. This
17357 // parameter is intended for YouTube content partners that own and manage many
17358 // different YouTube channels. It allows content owners to authenticate once
17359 // and perform actions on behalf of the channel specified in the parameter
17360 // value, without having to provide authentication credentials for each
17361 // separate channel.
17362 func (c *SubscriptionsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *SubscriptionsListCall {
17363 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
17364 return c
17365 }
17366
17367 // Order sets the optional parameter "order": The order of the returned
17368 // subscriptions
17369 //
17370 // Possible values:
17371 //
17372 // "subscriptionOrderUnspecified"
17373 // "relevance" (default) - Sort by relevance.
17374 // "unread" - Sort by order of activity.
17375 // "alphabetical" - Sort alphabetically.
17376 func (c *SubscriptionsListCall) Order(order string) *SubscriptionsListCall {
17377 c.urlParams_.Set("order", order)
17378 return c
17379 }
17380
17381 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
17382 // identifies a specific page in the result set that should be returned. In an
17383 // API response, the nextPageToken and prevPageToken properties identify other
17384 // pages that could be retrieved.
17385 func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall {
17386 c.urlParams_.Set("pageToken", pageToken)
17387 return c
17388 }
17389
17390 // Fields allows partial responses to be retrieved. See
17391 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17392 // details.
17393 func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
17394 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17395 return c
17396 }
17397
17398 // IfNoneMatch sets an optional parameter which makes the operation fail if the
17399 // object's ETag matches the given value. This is useful for getting updates
17400 // only after the object has changed since the last request.
17401 func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
17402 c.ifNoneMatch_ = entityTag
17403 return c
17404 }
17405
17406 // Context sets the context to be used in this call's Do method.
17407 func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
17408 c.ctx_ = ctx
17409 return c
17410 }
17411
17412 // Header returns a http.Header that can be modified by the caller to add
17413 // headers to the request.
17414 func (c *SubscriptionsListCall) Header() http.Header {
17415 if c.header_ == nil {
17416 c.header_ = make(http.Header)
17417 }
17418 return c.header_
17419 }
17420
17421 func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
17422 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
17423 if c.ifNoneMatch_ != "" {
17424 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17425 }
17426 c.urlParams_.Set("alt", alt)
17427 c.urlParams_.Set("prettyPrint", "false")
17428 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/subscriptions")
17429 urls += "?" + c.urlParams_.Encode()
17430 req, err := http.NewRequest("GET", urls, nil)
17431 if err != nil {
17432 return nil, err
17433 }
17434 req.Header = reqHeaders
17435 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.subscriptions.list", "request", internallog.HTTPRequest(req, nil))
17436 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17437 }
17438
17439 // Do executes the "youtube.subscriptions.list" call.
17440 // Any non-2xx status code is an error. Response headers are in either
17441 // *SubscriptionListResponse.ServerResponse.Header or (if a response was
17442 // returned at all) in error.(*googleapi.Error).Header. Use
17443 // googleapi.IsNotModified to check whether the returned error was because
17444 // http.StatusNotModified was returned.
17445 func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*SubscriptionListResponse, error) {
17446 gensupport.SetOptions(c.urlParams_, opts...)
17447 res, err := c.doRequest("json")
17448 if res != nil && res.StatusCode == http.StatusNotModified {
17449 if res.Body != nil {
17450 res.Body.Close()
17451 }
17452 return nil, gensupport.WrapError(&googleapi.Error{
17453 Code: res.StatusCode,
17454 Header: res.Header,
17455 })
17456 }
17457 if err != nil {
17458 return nil, err
17459 }
17460 defer googleapi.CloseBody(res)
17461 if err := googleapi.CheckResponse(res); err != nil {
17462 return nil, gensupport.WrapError(err)
17463 }
17464 ret := &SubscriptionListResponse{
17465 ServerResponse: googleapi.ServerResponse{
17466 Header: res.Header,
17467 HTTPStatusCode: res.StatusCode,
17468 },
17469 }
17470 target := &ret
17471 b, err := gensupport.DecodeResponseBytes(target, res)
17472 if err != nil {
17473 return nil, err
17474 }
17475 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.subscriptions.list", "response", internallog.HTTPResponse(res, b))
17476 return ret, nil
17477 }
17478
17479 // Pages invokes f for each page of results.
17480 // A non-nil error returned from f will halt the iteration.
17481 // The provided context supersedes any context provided to the Context method.
17482 func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*SubscriptionListResponse) error) error {
17483 c.ctx_ = ctx
17484 defer c.PageToken(c.urlParams_.Get("pageToken"))
17485 for {
17486 x, err := c.Do()
17487 if err != nil {
17488 return err
17489 }
17490 if err := f(x); err != nil {
17491 return err
17492 }
17493 if x.NextPageToken == "" {
17494 return nil
17495 }
17496 c.PageToken(x.NextPageToken)
17497 }
17498 }
17499
17500 type SuperChatEventsListCall struct {
17501 s *Service
17502 urlParams_ gensupport.URLParams
17503 ifNoneMatch_ string
17504 ctx_ context.Context
17505 header_ http.Header
17506 }
17507
17508 // List: Retrieves a list of resources, possibly filtered.
17509 //
17510 // - part: The *part* parameter specifies the superChatEvent resource parts
17511 // that the API response will include. This parameter is currently not
17512 // supported.
17513 func (r *SuperChatEventsService) List(part []string) *SuperChatEventsListCall {
17514 c := &SuperChatEventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17515 c.urlParams_.SetMulti("part", append([]string{}, part...))
17516 return c
17517 }
17518
17519 // Hl sets the optional parameter "hl": Return rendered funding amounts in
17520 // specified language.
17521 func (c *SuperChatEventsListCall) Hl(hl string) *SuperChatEventsListCall {
17522 c.urlParams_.Set("hl", hl)
17523 return c
17524 }
17525
17526 // MaxResults sets the optional parameter "maxResults": The *maxResults*
17527 // parameter specifies the maximum number of items that should be returned in
17528 // the result set.
17529 func (c *SuperChatEventsListCall) MaxResults(maxResults int64) *SuperChatEventsListCall {
17530 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
17531 return c
17532 }
17533
17534 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
17535 // identifies a specific page in the result set that should be returned. In an
17536 // API response, the nextPageToken and prevPageToken properties identify other
17537 // pages that could be retrieved.
17538 func (c *SuperChatEventsListCall) PageToken(pageToken string) *SuperChatEventsListCall {
17539 c.urlParams_.Set("pageToken", pageToken)
17540 return c
17541 }
17542
17543 // Fields allows partial responses to be retrieved. See
17544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17545 // details.
17546 func (c *SuperChatEventsListCall) Fields(s ...googleapi.Field) *SuperChatEventsListCall {
17547 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17548 return c
17549 }
17550
17551 // IfNoneMatch sets an optional parameter which makes the operation fail if the
17552 // object's ETag matches the given value. This is useful for getting updates
17553 // only after the object has changed since the last request.
17554 func (c *SuperChatEventsListCall) IfNoneMatch(entityTag string) *SuperChatEventsListCall {
17555 c.ifNoneMatch_ = entityTag
17556 return c
17557 }
17558
17559 // Context sets the context to be used in this call's Do method.
17560 func (c *SuperChatEventsListCall) Context(ctx context.Context) *SuperChatEventsListCall {
17561 c.ctx_ = ctx
17562 return c
17563 }
17564
17565 // Header returns a http.Header that can be modified by the caller to add
17566 // headers to the request.
17567 func (c *SuperChatEventsListCall) Header() http.Header {
17568 if c.header_ == nil {
17569 c.header_ = make(http.Header)
17570 }
17571 return c.header_
17572 }
17573
17574 func (c *SuperChatEventsListCall) doRequest(alt string) (*http.Response, error) {
17575 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
17576 if c.ifNoneMatch_ != "" {
17577 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17578 }
17579 c.urlParams_.Set("alt", alt)
17580 c.urlParams_.Set("prettyPrint", "false")
17581 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/superChatEvents")
17582 urls += "?" + c.urlParams_.Encode()
17583 req, err := http.NewRequest("GET", urls, nil)
17584 if err != nil {
17585 return nil, err
17586 }
17587 req.Header = reqHeaders
17588 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.superChatEvents.list", "request", internallog.HTTPRequest(req, nil))
17589 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17590 }
17591
17592 // Do executes the "youtube.superChatEvents.list" call.
17593 // Any non-2xx status code is an error. Response headers are in either
17594 // *SuperChatEventListResponse.ServerResponse.Header or (if a response was
17595 // returned at all) in error.(*googleapi.Error).Header. Use
17596 // googleapi.IsNotModified to check whether the returned error was because
17597 // http.StatusNotModified was returned.
17598 func (c *SuperChatEventsListCall) Do(opts ...googleapi.CallOption) (*SuperChatEventListResponse, error) {
17599 gensupport.SetOptions(c.urlParams_, opts...)
17600 res, err := c.doRequest("json")
17601 if res != nil && res.StatusCode == http.StatusNotModified {
17602 if res.Body != nil {
17603 res.Body.Close()
17604 }
17605 return nil, gensupport.WrapError(&googleapi.Error{
17606 Code: res.StatusCode,
17607 Header: res.Header,
17608 })
17609 }
17610 if err != nil {
17611 return nil, err
17612 }
17613 defer googleapi.CloseBody(res)
17614 if err := googleapi.CheckResponse(res); err != nil {
17615 return nil, gensupport.WrapError(err)
17616 }
17617 ret := &SuperChatEventListResponse{
17618 ServerResponse: googleapi.ServerResponse{
17619 Header: res.Header,
17620 HTTPStatusCode: res.StatusCode,
17621 },
17622 }
17623 target := &ret
17624 b, err := gensupport.DecodeResponseBytes(target, res)
17625 if err != nil {
17626 return nil, err
17627 }
17628 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.superChatEvents.list", "response", internallog.HTTPResponse(res, b))
17629 return ret, nil
17630 }
17631
17632 // Pages invokes f for each page of results.
17633 // A non-nil error returned from f will halt the iteration.
17634 // The provided context supersedes any context provided to the Context method.
17635 func (c *SuperChatEventsListCall) Pages(ctx context.Context, f func(*SuperChatEventListResponse) error) error {
17636 c.ctx_ = ctx
17637 defer c.PageToken(c.urlParams_.Get("pageToken"))
17638 for {
17639 x, err := c.Do()
17640 if err != nil {
17641 return err
17642 }
17643 if err := f(x); err != nil {
17644 return err
17645 }
17646 if x.NextPageToken == "" {
17647 return nil
17648 }
17649 c.PageToken(x.NextPageToken)
17650 }
17651 }
17652
17653 type TestsInsertCall struct {
17654 s *Service
17655 testitem *TestItem
17656 urlParams_ gensupport.URLParams
17657 ctx_ context.Context
17658 header_ http.Header
17659 }
17660
17661 // Insert: POST method.
17662 //
17663 // - part: .
17664 func (r *TestsService) Insert(part []string, testitem *TestItem) *TestsInsertCall {
17665 c := &TestsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17666 c.urlParams_.SetMulti("part", append([]string{}, part...))
17667 c.testitem = testitem
17668 return c
17669 }
17670
17671 // ExternalChannelId sets the optional parameter "externalChannelId":
17672 func (c *TestsInsertCall) ExternalChannelId(externalChannelId string) *TestsInsertCall {
17673 c.urlParams_.Set("externalChannelId", externalChannelId)
17674 return c
17675 }
17676
17677 // OnBehalfOfContentOwnerChannel sets the optional parameter
17678 // "onBehalfOfContentOwnerChannel":
17679 func (c *TestsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *TestsInsertCall {
17680 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
17681 return c
17682 }
17683
17684 // Fields allows partial responses to be retrieved. See
17685 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17686 // details.
17687 func (c *TestsInsertCall) Fields(s ...googleapi.Field) *TestsInsertCall {
17688 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17689 return c
17690 }
17691
17692 // Context sets the context to be used in this call's Do method.
17693 func (c *TestsInsertCall) Context(ctx context.Context) *TestsInsertCall {
17694 c.ctx_ = ctx
17695 return c
17696 }
17697
17698 // Header returns a http.Header that can be modified by the caller to add
17699 // headers to the request.
17700 func (c *TestsInsertCall) Header() http.Header {
17701 if c.header_ == nil {
17702 c.header_ = make(http.Header)
17703 }
17704 return c.header_
17705 }
17706
17707 func (c *TestsInsertCall) doRequest(alt string) (*http.Response, error) {
17708 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
17709 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.testitem)
17710 if err != nil {
17711 return nil, err
17712 }
17713 c.urlParams_.Set("alt", alt)
17714 c.urlParams_.Set("prettyPrint", "false")
17715 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/tests")
17716 urls += "?" + c.urlParams_.Encode()
17717 req, err := http.NewRequest("POST", urls, body)
17718 if err != nil {
17719 return nil, err
17720 }
17721 req.Header = reqHeaders
17722 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.tests.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
17723 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17724 }
17725
17726 // Do executes the "youtube.tests.insert" call.
17727 // Any non-2xx status code is an error. Response headers are in either
17728 // *TestItem.ServerResponse.Header or (if a response was returned at all) in
17729 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
17730 // whether the returned error was because http.StatusNotModified was returned.
17731 func (c *TestsInsertCall) Do(opts ...googleapi.CallOption) (*TestItem, error) {
17732 gensupport.SetOptions(c.urlParams_, opts...)
17733 res, err := c.doRequest("json")
17734 if res != nil && res.StatusCode == http.StatusNotModified {
17735 if res.Body != nil {
17736 res.Body.Close()
17737 }
17738 return nil, gensupport.WrapError(&googleapi.Error{
17739 Code: res.StatusCode,
17740 Header: res.Header,
17741 })
17742 }
17743 if err != nil {
17744 return nil, err
17745 }
17746 defer googleapi.CloseBody(res)
17747 if err := googleapi.CheckResponse(res); err != nil {
17748 return nil, gensupport.WrapError(err)
17749 }
17750 ret := &TestItem{
17751 ServerResponse: googleapi.ServerResponse{
17752 Header: res.Header,
17753 HTTPStatusCode: res.StatusCode,
17754 },
17755 }
17756 target := &ret
17757 b, err := gensupport.DecodeResponseBytes(target, res)
17758 if err != nil {
17759 return nil, err
17760 }
17761 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.tests.insert", "response", internallog.HTTPResponse(res, b))
17762 return ret, nil
17763 }
17764
17765 type ThirdPartyLinksDeleteCall struct {
17766 s *Service
17767 urlParams_ gensupport.URLParams
17768 ctx_ context.Context
17769 header_ http.Header
17770 }
17771
17772 // Delete: Deletes a resource.
17773 //
17774 // - linkingToken: Delete the partner links with the given linking token.
17775 // - type: Type of the link to be deleted.
17776 func (r *ThirdPartyLinksService) Delete(linkingToken string, type_ string) *ThirdPartyLinksDeleteCall {
17777 c := &ThirdPartyLinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17778 c.urlParams_.Set("linkingToken", linkingToken)
17779 c.urlParams_.Set("type", type_)
17780 return c
17781 }
17782
17783 // ExternalChannelId sets the optional parameter "externalChannelId": Channel
17784 // ID to which changes should be applied, for delegation.
17785 func (c *ThirdPartyLinksDeleteCall) ExternalChannelId(externalChannelId string) *ThirdPartyLinksDeleteCall {
17786 c.urlParams_.Set("externalChannelId", externalChannelId)
17787 return c
17788 }
17789
17790 // Part sets the optional parameter "part": Do not use. Required for
17791 // compatibility.
17792 func (c *ThirdPartyLinksDeleteCall) Part(part ...string) *ThirdPartyLinksDeleteCall {
17793 c.urlParams_.SetMulti("part", append([]string{}, part...))
17794 return c
17795 }
17796
17797 // Fields allows partial responses to be retrieved. See
17798 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17799 // details.
17800 func (c *ThirdPartyLinksDeleteCall) Fields(s ...googleapi.Field) *ThirdPartyLinksDeleteCall {
17801 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17802 return c
17803 }
17804
17805 // Context sets the context to be used in this call's Do method.
17806 func (c *ThirdPartyLinksDeleteCall) Context(ctx context.Context) *ThirdPartyLinksDeleteCall {
17807 c.ctx_ = ctx
17808 return c
17809 }
17810
17811 // Header returns a http.Header that can be modified by the caller to add
17812 // headers to the request.
17813 func (c *ThirdPartyLinksDeleteCall) Header() http.Header {
17814 if c.header_ == nil {
17815 c.header_ = make(http.Header)
17816 }
17817 return c.header_
17818 }
17819
17820 func (c *ThirdPartyLinksDeleteCall) doRequest(alt string) (*http.Response, error) {
17821 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
17822 c.urlParams_.Set("alt", alt)
17823 c.urlParams_.Set("prettyPrint", "false")
17824 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thirdPartyLinks")
17825 urls += "?" + c.urlParams_.Encode()
17826 req, err := http.NewRequest("DELETE", urls, nil)
17827 if err != nil {
17828 return nil, err
17829 }
17830 req.Header = reqHeaders
17831 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.delete", "request", internallog.HTTPRequest(req, nil))
17832 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17833 }
17834
17835 // Do executes the "youtube.thirdPartyLinks.delete" call.
17836 func (c *ThirdPartyLinksDeleteCall) Do(opts ...googleapi.CallOption) error {
17837 gensupport.SetOptions(c.urlParams_, opts...)
17838 res, err := c.doRequest("json")
17839 if err != nil {
17840 return err
17841 }
17842 defer googleapi.CloseBody(res)
17843 if err := googleapi.CheckResponse(res); err != nil {
17844 return gensupport.WrapError(err)
17845 }
17846 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.delete", "response", internallog.HTTPResponse(res, nil))
17847 return nil
17848 }
17849
17850 type ThirdPartyLinksInsertCall struct {
17851 s *Service
17852 thirdpartylink *ThirdPartyLink
17853 urlParams_ gensupport.URLParams
17854 ctx_ context.Context
17855 header_ http.Header
17856 }
17857
17858 // Insert: Inserts a new resource into this collection.
17859 //
17860 // - part: The *part* parameter specifies the thirdPartyLink resource parts
17861 // that the API request and response will include. Supported values are
17862 // linkingToken, status, and snippet.
17863 func (r *ThirdPartyLinksService) Insert(part []string, thirdpartylink *ThirdPartyLink) *ThirdPartyLinksInsertCall {
17864 c := &ThirdPartyLinksInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17865 c.urlParams_.SetMulti("part", append([]string{}, part...))
17866 c.thirdpartylink = thirdpartylink
17867 return c
17868 }
17869
17870 // ExternalChannelId sets the optional parameter "externalChannelId": Channel
17871 // ID to which changes should be applied, for delegation.
17872 func (c *ThirdPartyLinksInsertCall) ExternalChannelId(externalChannelId string) *ThirdPartyLinksInsertCall {
17873 c.urlParams_.Set("externalChannelId", externalChannelId)
17874 return c
17875 }
17876
17877 // Fields allows partial responses to be retrieved. See
17878 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
17879 // details.
17880 func (c *ThirdPartyLinksInsertCall) Fields(s ...googleapi.Field) *ThirdPartyLinksInsertCall {
17881 c.urlParams_.Set("fields", googleapi.CombineFields(s))
17882 return c
17883 }
17884
17885 // Context sets the context to be used in this call's Do method.
17886 func (c *ThirdPartyLinksInsertCall) Context(ctx context.Context) *ThirdPartyLinksInsertCall {
17887 c.ctx_ = ctx
17888 return c
17889 }
17890
17891 // Header returns a http.Header that can be modified by the caller to add
17892 // headers to the request.
17893 func (c *ThirdPartyLinksInsertCall) Header() http.Header {
17894 if c.header_ == nil {
17895 c.header_ = make(http.Header)
17896 }
17897 return c.header_
17898 }
17899
17900 func (c *ThirdPartyLinksInsertCall) doRequest(alt string) (*http.Response, error) {
17901 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
17902 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.thirdpartylink)
17903 if err != nil {
17904 return nil, err
17905 }
17906 c.urlParams_.Set("alt", alt)
17907 c.urlParams_.Set("prettyPrint", "false")
17908 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thirdPartyLinks")
17909 urls += "?" + c.urlParams_.Encode()
17910 req, err := http.NewRequest("POST", urls, body)
17911 if err != nil {
17912 return nil, err
17913 }
17914 req.Header = reqHeaders
17915 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
17916 return gensupport.SendRequest(c.ctx_, c.s.client, req)
17917 }
17918
17919 // Do executes the "youtube.thirdPartyLinks.insert" call.
17920 // Any non-2xx status code is an error. Response headers are in either
17921 // *ThirdPartyLink.ServerResponse.Header or (if a response was returned at all)
17922 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
17923 // whether the returned error was because http.StatusNotModified was returned.
17924 func (c *ThirdPartyLinksInsertCall) Do(opts ...googleapi.CallOption) (*ThirdPartyLink, error) {
17925 gensupport.SetOptions(c.urlParams_, opts...)
17926 res, err := c.doRequest("json")
17927 if res != nil && res.StatusCode == http.StatusNotModified {
17928 if res.Body != nil {
17929 res.Body.Close()
17930 }
17931 return nil, gensupport.WrapError(&googleapi.Error{
17932 Code: res.StatusCode,
17933 Header: res.Header,
17934 })
17935 }
17936 if err != nil {
17937 return nil, err
17938 }
17939 defer googleapi.CloseBody(res)
17940 if err := googleapi.CheckResponse(res); err != nil {
17941 return nil, gensupport.WrapError(err)
17942 }
17943 ret := &ThirdPartyLink{
17944 ServerResponse: googleapi.ServerResponse{
17945 Header: res.Header,
17946 HTTPStatusCode: res.StatusCode,
17947 },
17948 }
17949 target := &ret
17950 b, err := gensupport.DecodeResponseBytes(target, res)
17951 if err != nil {
17952 return nil, err
17953 }
17954 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.insert", "response", internallog.HTTPResponse(res, b))
17955 return ret, nil
17956 }
17957
17958 type ThirdPartyLinksListCall struct {
17959 s *Service
17960 urlParams_ gensupport.URLParams
17961 ifNoneMatch_ string
17962 ctx_ context.Context
17963 header_ http.Header
17964 }
17965
17966 // List: Retrieves a list of resources, possibly filtered.
17967 //
17968 // - part: The *part* parameter specifies the thirdPartyLink resource parts
17969 // that the API response will include. Supported values are linkingToken,
17970 // status, and snippet.
17971 func (r *ThirdPartyLinksService) List(part []string) *ThirdPartyLinksListCall {
17972 c := &ThirdPartyLinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17973 c.urlParams_.SetMulti("part", append([]string{}, part...))
17974 return c
17975 }
17976
17977 // ExternalChannelId sets the optional parameter "externalChannelId": Channel
17978 // ID to which changes should be applied, for delegation.
17979 func (c *ThirdPartyLinksListCall) ExternalChannelId(externalChannelId string) *ThirdPartyLinksListCall {
17980 c.urlParams_.Set("externalChannelId", externalChannelId)
17981 return c
17982 }
17983
17984 // LinkingToken sets the optional parameter "linkingToken": Get a third party
17985 // link with the given linking token.
17986 func (c *ThirdPartyLinksListCall) LinkingToken(linkingToken string) *ThirdPartyLinksListCall {
17987 c.urlParams_.Set("linkingToken", linkingToken)
17988 return c
17989 }
17990
17991 // Type sets the optional parameter "type": Get a third party link of the given
17992 // type.
17993 //
17994 // Possible values:
17995 //
17996 // "linkUnspecified"
17997 // "channelToStoreLink" - A link that is connecting (or about to connect) a
17998 //
17999 // channel with a store on a merchandising platform in order to enable retail
18000 // commerce capabilities for that channel on YouTube.
18001 func (c *ThirdPartyLinksListCall) Type(type_ string) *ThirdPartyLinksListCall {
18002 c.urlParams_.Set("type", type_)
18003 return c
18004 }
18005
18006 // Fields allows partial responses to be retrieved. See
18007 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18008 // details.
18009 func (c *ThirdPartyLinksListCall) Fields(s ...googleapi.Field) *ThirdPartyLinksListCall {
18010 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18011 return c
18012 }
18013
18014 // IfNoneMatch sets an optional parameter which makes the operation fail if the
18015 // object's ETag matches the given value. This is useful for getting updates
18016 // only after the object has changed since the last request.
18017 func (c *ThirdPartyLinksListCall) IfNoneMatch(entityTag string) *ThirdPartyLinksListCall {
18018 c.ifNoneMatch_ = entityTag
18019 return c
18020 }
18021
18022 // Context sets the context to be used in this call's Do method.
18023 func (c *ThirdPartyLinksListCall) Context(ctx context.Context) *ThirdPartyLinksListCall {
18024 c.ctx_ = ctx
18025 return c
18026 }
18027
18028 // Header returns a http.Header that can be modified by the caller to add
18029 // headers to the request.
18030 func (c *ThirdPartyLinksListCall) Header() http.Header {
18031 if c.header_ == nil {
18032 c.header_ = make(http.Header)
18033 }
18034 return c.header_
18035 }
18036
18037 func (c *ThirdPartyLinksListCall) doRequest(alt string) (*http.Response, error) {
18038 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
18039 if c.ifNoneMatch_ != "" {
18040 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18041 }
18042 c.urlParams_.Set("alt", alt)
18043 c.urlParams_.Set("prettyPrint", "false")
18044 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thirdPartyLinks")
18045 urls += "?" + c.urlParams_.Encode()
18046 req, err := http.NewRequest("GET", urls, nil)
18047 if err != nil {
18048 return nil, err
18049 }
18050 req.Header = reqHeaders
18051 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.list", "request", internallog.HTTPRequest(req, nil))
18052 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18053 }
18054
18055 // Do executes the "youtube.thirdPartyLinks.list" call.
18056 // Any non-2xx status code is an error. Response headers are in either
18057 // *ThirdPartyLinkListResponse.ServerResponse.Header or (if a response was
18058 // returned at all) in error.(*googleapi.Error).Header. Use
18059 // googleapi.IsNotModified to check whether the returned error was because
18060 // http.StatusNotModified was returned.
18061 func (c *ThirdPartyLinksListCall) Do(opts ...googleapi.CallOption) (*ThirdPartyLinkListResponse, error) {
18062 gensupport.SetOptions(c.urlParams_, opts...)
18063 res, err := c.doRequest("json")
18064 if res != nil && res.StatusCode == http.StatusNotModified {
18065 if res.Body != nil {
18066 res.Body.Close()
18067 }
18068 return nil, gensupport.WrapError(&googleapi.Error{
18069 Code: res.StatusCode,
18070 Header: res.Header,
18071 })
18072 }
18073 if err != nil {
18074 return nil, err
18075 }
18076 defer googleapi.CloseBody(res)
18077 if err := googleapi.CheckResponse(res); err != nil {
18078 return nil, gensupport.WrapError(err)
18079 }
18080 ret := &ThirdPartyLinkListResponse{
18081 ServerResponse: googleapi.ServerResponse{
18082 Header: res.Header,
18083 HTTPStatusCode: res.StatusCode,
18084 },
18085 }
18086 target := &ret
18087 b, err := gensupport.DecodeResponseBytes(target, res)
18088 if err != nil {
18089 return nil, err
18090 }
18091 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.list", "response", internallog.HTTPResponse(res, b))
18092 return ret, nil
18093 }
18094
18095 type ThirdPartyLinksUpdateCall struct {
18096 s *Service
18097 thirdpartylink *ThirdPartyLink
18098 urlParams_ gensupport.URLParams
18099 ctx_ context.Context
18100 header_ http.Header
18101 }
18102
18103 // Update: Updates an existing resource.
18104 //
18105 // - part: The *part* parameter specifies the thirdPartyLink resource parts
18106 // that the API request and response will include. Supported values are
18107 // linkingToken, status, and snippet.
18108 func (r *ThirdPartyLinksService) Update(part []string, thirdpartylink *ThirdPartyLink) *ThirdPartyLinksUpdateCall {
18109 c := &ThirdPartyLinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18110 c.urlParams_.SetMulti("part", append([]string{}, part...))
18111 c.thirdpartylink = thirdpartylink
18112 return c
18113 }
18114
18115 // ExternalChannelId sets the optional parameter "externalChannelId": Channel
18116 // ID to which changes should be applied, for delegation.
18117 func (c *ThirdPartyLinksUpdateCall) ExternalChannelId(externalChannelId string) *ThirdPartyLinksUpdateCall {
18118 c.urlParams_.Set("externalChannelId", externalChannelId)
18119 return c
18120 }
18121
18122 // Fields allows partial responses to be retrieved. See
18123 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18124 // details.
18125 func (c *ThirdPartyLinksUpdateCall) Fields(s ...googleapi.Field) *ThirdPartyLinksUpdateCall {
18126 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18127 return c
18128 }
18129
18130 // Context sets the context to be used in this call's Do method.
18131 func (c *ThirdPartyLinksUpdateCall) Context(ctx context.Context) *ThirdPartyLinksUpdateCall {
18132 c.ctx_ = ctx
18133 return c
18134 }
18135
18136 // Header returns a http.Header that can be modified by the caller to add
18137 // headers to the request.
18138 func (c *ThirdPartyLinksUpdateCall) Header() http.Header {
18139 if c.header_ == nil {
18140 c.header_ = make(http.Header)
18141 }
18142 return c.header_
18143 }
18144
18145 func (c *ThirdPartyLinksUpdateCall) doRequest(alt string) (*http.Response, error) {
18146 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
18147 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.thirdpartylink)
18148 if err != nil {
18149 return nil, err
18150 }
18151 c.urlParams_.Set("alt", alt)
18152 c.urlParams_.Set("prettyPrint", "false")
18153 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thirdPartyLinks")
18154 urls += "?" + c.urlParams_.Encode()
18155 req, err := http.NewRequest("PUT", urls, body)
18156 if err != nil {
18157 return nil, err
18158 }
18159 req.Header = reqHeaders
18160 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.update", "request", internallog.HTTPRequest(req, body.Bytes()))
18161 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18162 }
18163
18164 // Do executes the "youtube.thirdPartyLinks.update" call.
18165 // Any non-2xx status code is an error. Response headers are in either
18166 // *ThirdPartyLink.ServerResponse.Header or (if a response was returned at all)
18167 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
18168 // whether the returned error was because http.StatusNotModified was returned.
18169 func (c *ThirdPartyLinksUpdateCall) Do(opts ...googleapi.CallOption) (*ThirdPartyLink, error) {
18170 gensupport.SetOptions(c.urlParams_, opts...)
18171 res, err := c.doRequest("json")
18172 if res != nil && res.StatusCode == http.StatusNotModified {
18173 if res.Body != nil {
18174 res.Body.Close()
18175 }
18176 return nil, gensupport.WrapError(&googleapi.Error{
18177 Code: res.StatusCode,
18178 Header: res.Header,
18179 })
18180 }
18181 if err != nil {
18182 return nil, err
18183 }
18184 defer googleapi.CloseBody(res)
18185 if err := googleapi.CheckResponse(res); err != nil {
18186 return nil, gensupport.WrapError(err)
18187 }
18188 ret := &ThirdPartyLink{
18189 ServerResponse: googleapi.ServerResponse{
18190 Header: res.Header,
18191 HTTPStatusCode: res.StatusCode,
18192 },
18193 }
18194 target := &ret
18195 b, err := gensupport.DecodeResponseBytes(target, res)
18196 if err != nil {
18197 return nil, err
18198 }
18199 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.thirdPartyLinks.update", "response", internallog.HTTPResponse(res, b))
18200 return ret, nil
18201 }
18202
18203 type ThumbnailsSetCall struct {
18204 s *Service
18205 urlParams_ gensupport.URLParams
18206 mediaInfo_ *gensupport.MediaInfo
18207 ctx_ context.Context
18208 header_ http.Header
18209 }
18210
18211 // Set: As this is not an insert in a strict sense (it supports
18212 // uploading/setting of a thumbnail for multiple videos, which doesn't result
18213 // in creation of a single resource), I use a custom verb here.
18214 //
18215 // - videoId: Returns the Thumbnail with the given video IDs for Stubby or
18216 // Apiary.
18217 func (r *ThumbnailsService) Set(videoId string) *ThumbnailsSetCall {
18218 c := &ThumbnailsSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18219 c.urlParams_.Set("videoId", videoId)
18220 return c
18221 }
18222
18223 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
18224 // *Note:* This parameter is intended exclusively for YouTube content partners.
18225 // The *onBehalfOfContentOwner* parameter indicates that the request's
18226 // authorization credentials identify a YouTube CMS user who is acting on
18227 // behalf of the content owner specified in the parameter value. This parameter
18228 // is intended for YouTube content partners that own and manage many different
18229 // YouTube channels. It allows content owners to authenticate once and get
18230 // access to all their video and channel data, without having to provide
18231 // authentication credentials for each individual channel. The actual CMS
18232 // account that the user authenticates with must be linked to the specified
18233 // YouTube content owner.
18234 func (c *ThumbnailsSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ThumbnailsSetCall {
18235 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
18236 return c
18237 }
18238
18239 // Media specifies the media to upload in one or more chunks. The chunk size
18240 // may be controlled by supplying a MediaOption generated by
18241 // googleapi.ChunkSize. The chunk size defaults to
18242 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
18243 // request will be determined by sniffing the contents of r, unless a
18244 // MediaOption generated by googleapi.ContentType is supplied.
18245 // At most one of Media and ResumableMedia may be set.
18246 func (c *ThumbnailsSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *ThumbnailsSetCall {
18247 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
18248 return c
18249 }
18250
18251 // ResumableMedia specifies the media to upload in chunks and can be canceled
18252 // with ctx.
18253 //
18254 // Deprecated: use Media instead.
18255 //
18256 // At most one of Media and ResumableMedia may be set. mediaType identifies the
18257 // MIME media type of the upload, such as "image/png". If mediaType is "", it
18258 // will be auto-detected. The provided ctx will supersede any context
18259 // previously provided to the Context method.
18260 func (c *ThumbnailsSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ThumbnailsSetCall {
18261 c.ctx_ = ctx
18262 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
18263 return c
18264 }
18265
18266 // ProgressUpdater provides a callback function that will be called after every
18267 // chunk. It should be a low-latency function in order to not slow down the
18268 // upload operation. This should only be called when using ResumableMedia (as
18269 // opposed to Media).
18270 func (c *ThumbnailsSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ThumbnailsSetCall {
18271 c.mediaInfo_.SetProgressUpdater(pu)
18272 return c
18273 }
18274
18275 // Fields allows partial responses to be retrieved. See
18276 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18277 // details.
18278 func (c *ThumbnailsSetCall) Fields(s ...googleapi.Field) *ThumbnailsSetCall {
18279 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18280 return c
18281 }
18282
18283 // Context sets the context to be used in this call's Do method.
18284 // This context will supersede any context previously provided to the
18285 // ResumableMedia method.
18286 func (c *ThumbnailsSetCall) Context(ctx context.Context) *ThumbnailsSetCall {
18287 c.ctx_ = ctx
18288 return c
18289 }
18290
18291 // Header returns a http.Header that can be modified by the caller to add
18292 // headers to the request.
18293 func (c *ThumbnailsSetCall) Header() http.Header {
18294 if c.header_ == nil {
18295 c.header_ = make(http.Header)
18296 }
18297 return c.header_
18298 }
18299
18300 func (c *ThumbnailsSetCall) doRequest(alt string) (*http.Response, error) {
18301 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
18302 c.urlParams_.Set("alt", alt)
18303 c.urlParams_.Set("prettyPrint", "false")
18304 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/thumbnails/set")
18305 if c.mediaInfo_ != nil {
18306 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/thumbnails/set")
18307 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
18308 }
18309 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, nil)
18310 defer cleanup()
18311 urls += "?" + c.urlParams_.Encode()
18312 req, err := http.NewRequest("POST", urls, newBody)
18313 if err != nil {
18314 return nil, err
18315 }
18316 req.Header = reqHeaders
18317 req.GetBody = getBody
18318 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.thumbnails.set", "request", internallog.HTTPRequest(req, nil))
18319 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18320 }
18321
18322 // Do executes the "youtube.thumbnails.set" call.
18323 // Any non-2xx status code is an error. Response headers are in either
18324 // *ThumbnailSetResponse.ServerResponse.Header or (if a response was returned
18325 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18326 // check whether the returned error was because http.StatusNotModified was
18327 // returned.
18328 func (c *ThumbnailsSetCall) Do(opts ...googleapi.CallOption) (*ThumbnailSetResponse, error) {
18329 gensupport.SetOptions(c.urlParams_, opts...)
18330 res, err := c.doRequest("json")
18331 if res != nil && res.StatusCode == http.StatusNotModified {
18332 if res.Body != nil {
18333 res.Body.Close()
18334 }
18335 return nil, gensupport.WrapError(&googleapi.Error{
18336 Code: res.StatusCode,
18337 Header: res.Header,
18338 })
18339 }
18340 if err != nil {
18341 return nil, err
18342 }
18343 defer googleapi.CloseBody(res)
18344 if err := googleapi.CheckResponse(res); err != nil {
18345 return nil, gensupport.WrapError(err)
18346 }
18347 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
18348 if rx != nil {
18349 rx.Client = c.s.client
18350 rx.UserAgent = c.s.userAgent()
18351 ctx := c.ctx_
18352 if ctx == nil {
18353 ctx = context.TODO()
18354 }
18355 res, err = rx.Upload(ctx)
18356 if err != nil {
18357 return nil, err
18358 }
18359 defer res.Body.Close()
18360 if err := googleapi.CheckResponse(res); err != nil {
18361 return nil, gensupport.WrapError(err)
18362 }
18363 }
18364 ret := &ThumbnailSetResponse{
18365 ServerResponse: googleapi.ServerResponse{
18366 Header: res.Header,
18367 HTTPStatusCode: res.StatusCode,
18368 },
18369 }
18370 target := &ret
18371 b, err := gensupport.DecodeResponseBytes(target, res)
18372 if err != nil {
18373 return nil, err
18374 }
18375 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.thumbnails.set", "response", internallog.HTTPResponse(res, b))
18376 return ret, nil
18377 }
18378
18379 type VideoAbuseReportReasonsListCall struct {
18380 s *Service
18381 urlParams_ gensupport.URLParams
18382 ifNoneMatch_ string
18383 ctx_ context.Context
18384 header_ http.Header
18385 }
18386
18387 // List: Retrieves a list of resources, possibly filtered.
18388 //
18389 // - part: The *part* parameter specifies the videoCategory resource parts that
18390 // the API response will include. Supported values are id and snippet.
18391 func (r *VideoAbuseReportReasonsService) List(part []string) *VideoAbuseReportReasonsListCall {
18392 c := &VideoAbuseReportReasonsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18393 c.urlParams_.SetMulti("part", append([]string{}, part...))
18394 return c
18395 }
18396
18397 // Hl sets the optional parameter "hl":
18398 func (c *VideoAbuseReportReasonsListCall) Hl(hl string) *VideoAbuseReportReasonsListCall {
18399 c.urlParams_.Set("hl", hl)
18400 return c
18401 }
18402
18403 // Fields allows partial responses to be retrieved. See
18404 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18405 // details.
18406 func (c *VideoAbuseReportReasonsListCall) Fields(s ...googleapi.Field) *VideoAbuseReportReasonsListCall {
18407 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18408 return c
18409 }
18410
18411 // IfNoneMatch sets an optional parameter which makes the operation fail if the
18412 // object's ETag matches the given value. This is useful for getting updates
18413 // only after the object has changed since the last request.
18414 func (c *VideoAbuseReportReasonsListCall) IfNoneMatch(entityTag string) *VideoAbuseReportReasonsListCall {
18415 c.ifNoneMatch_ = entityTag
18416 return c
18417 }
18418
18419 // Context sets the context to be used in this call's Do method.
18420 func (c *VideoAbuseReportReasonsListCall) Context(ctx context.Context) *VideoAbuseReportReasonsListCall {
18421 c.ctx_ = ctx
18422 return c
18423 }
18424
18425 // Header returns a http.Header that can be modified by the caller to add
18426 // headers to the request.
18427 func (c *VideoAbuseReportReasonsListCall) Header() http.Header {
18428 if c.header_ == nil {
18429 c.header_ = make(http.Header)
18430 }
18431 return c.header_
18432 }
18433
18434 func (c *VideoAbuseReportReasonsListCall) doRequest(alt string) (*http.Response, error) {
18435 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
18436 if c.ifNoneMatch_ != "" {
18437 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18438 }
18439 c.urlParams_.Set("alt", alt)
18440 c.urlParams_.Set("prettyPrint", "false")
18441 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videoAbuseReportReasons")
18442 urls += "?" + c.urlParams_.Encode()
18443 req, err := http.NewRequest("GET", urls, nil)
18444 if err != nil {
18445 return nil, err
18446 }
18447 req.Header = reqHeaders
18448 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videoAbuseReportReasons.list", "request", internallog.HTTPRequest(req, nil))
18449 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18450 }
18451
18452 // Do executes the "youtube.videoAbuseReportReasons.list" call.
18453 // Any non-2xx status code is an error. Response headers are in either
18454 // *VideoAbuseReportReasonListResponse.ServerResponse.Header or (if a response
18455 // was returned at all) in error.(*googleapi.Error).Header. Use
18456 // googleapi.IsNotModified to check whether the returned error was because
18457 // http.StatusNotModified was returned.
18458 func (c *VideoAbuseReportReasonsListCall) Do(opts ...googleapi.CallOption) (*VideoAbuseReportReasonListResponse, error) {
18459 gensupport.SetOptions(c.urlParams_, opts...)
18460 res, err := c.doRequest("json")
18461 if res != nil && res.StatusCode == http.StatusNotModified {
18462 if res.Body != nil {
18463 res.Body.Close()
18464 }
18465 return nil, gensupport.WrapError(&googleapi.Error{
18466 Code: res.StatusCode,
18467 Header: res.Header,
18468 })
18469 }
18470 if err != nil {
18471 return nil, err
18472 }
18473 defer googleapi.CloseBody(res)
18474 if err := googleapi.CheckResponse(res); err != nil {
18475 return nil, gensupport.WrapError(err)
18476 }
18477 ret := &VideoAbuseReportReasonListResponse{
18478 ServerResponse: googleapi.ServerResponse{
18479 Header: res.Header,
18480 HTTPStatusCode: res.StatusCode,
18481 },
18482 }
18483 target := &ret
18484 b, err := gensupport.DecodeResponseBytes(target, res)
18485 if err != nil {
18486 return nil, err
18487 }
18488 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videoAbuseReportReasons.list", "response", internallog.HTTPResponse(res, b))
18489 return ret, nil
18490 }
18491
18492 type VideoCategoriesListCall struct {
18493 s *Service
18494 urlParams_ gensupport.URLParams
18495 ifNoneMatch_ string
18496 ctx_ context.Context
18497 header_ http.Header
18498 }
18499
18500 // List: Retrieves a list of resources, possibly filtered.
18501 //
18502 // - part: The *part* parameter specifies the videoCategory resource properties
18503 // that the API response will include. Set the parameter value to snippet.
18504 func (r *VideoCategoriesService) List(part []string) *VideoCategoriesListCall {
18505 c := &VideoCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18506 c.urlParams_.SetMulti("part", append([]string{}, part...))
18507 return c
18508 }
18509
18510 // Hl sets the optional parameter "hl":
18511 func (c *VideoCategoriesListCall) Hl(hl string) *VideoCategoriesListCall {
18512 c.urlParams_.Set("hl", hl)
18513 return c
18514 }
18515
18516 // Id sets the optional parameter "id": Returns the video categories with the
18517 // given IDs for Stubby or Apiary.
18518 func (c *VideoCategoriesListCall) Id(id ...string) *VideoCategoriesListCall {
18519 c.urlParams_.SetMulti("id", append([]string{}, id...))
18520 return c
18521 }
18522
18523 // RegionCode sets the optional parameter "regionCode":
18524 func (c *VideoCategoriesListCall) RegionCode(regionCode string) *VideoCategoriesListCall {
18525 c.urlParams_.Set("regionCode", regionCode)
18526 return c
18527 }
18528
18529 // Fields allows partial responses to be retrieved. See
18530 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18531 // details.
18532 func (c *VideoCategoriesListCall) Fields(s ...googleapi.Field) *VideoCategoriesListCall {
18533 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18534 return c
18535 }
18536
18537 // IfNoneMatch sets an optional parameter which makes the operation fail if the
18538 // object's ETag matches the given value. This is useful for getting updates
18539 // only after the object has changed since the last request.
18540 func (c *VideoCategoriesListCall) IfNoneMatch(entityTag string) *VideoCategoriesListCall {
18541 c.ifNoneMatch_ = entityTag
18542 return c
18543 }
18544
18545 // Context sets the context to be used in this call's Do method.
18546 func (c *VideoCategoriesListCall) Context(ctx context.Context) *VideoCategoriesListCall {
18547 c.ctx_ = ctx
18548 return c
18549 }
18550
18551 // Header returns a http.Header that can be modified by the caller to add
18552 // headers to the request.
18553 func (c *VideoCategoriesListCall) Header() http.Header {
18554 if c.header_ == nil {
18555 c.header_ = make(http.Header)
18556 }
18557 return c.header_
18558 }
18559
18560 func (c *VideoCategoriesListCall) doRequest(alt string) (*http.Response, error) {
18561 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
18562 if c.ifNoneMatch_ != "" {
18563 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18564 }
18565 c.urlParams_.Set("alt", alt)
18566 c.urlParams_.Set("prettyPrint", "false")
18567 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videoCategories")
18568 urls += "?" + c.urlParams_.Encode()
18569 req, err := http.NewRequest("GET", urls, nil)
18570 if err != nil {
18571 return nil, err
18572 }
18573 req.Header = reqHeaders
18574 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videoCategories.list", "request", internallog.HTTPRequest(req, nil))
18575 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18576 }
18577
18578 // Do executes the "youtube.videoCategories.list" call.
18579 // Any non-2xx status code is an error. Response headers are in either
18580 // *VideoCategoryListResponse.ServerResponse.Header or (if a response was
18581 // returned at all) in error.(*googleapi.Error).Header. Use
18582 // googleapi.IsNotModified to check whether the returned error was because
18583 // http.StatusNotModified was returned.
18584 func (c *VideoCategoriesListCall) Do(opts ...googleapi.CallOption) (*VideoCategoryListResponse, error) {
18585 gensupport.SetOptions(c.urlParams_, opts...)
18586 res, err := c.doRequest("json")
18587 if res != nil && res.StatusCode == http.StatusNotModified {
18588 if res.Body != nil {
18589 res.Body.Close()
18590 }
18591 return nil, gensupport.WrapError(&googleapi.Error{
18592 Code: res.StatusCode,
18593 Header: res.Header,
18594 })
18595 }
18596 if err != nil {
18597 return nil, err
18598 }
18599 defer googleapi.CloseBody(res)
18600 if err := googleapi.CheckResponse(res); err != nil {
18601 return nil, gensupport.WrapError(err)
18602 }
18603 ret := &VideoCategoryListResponse{
18604 ServerResponse: googleapi.ServerResponse{
18605 Header: res.Header,
18606 HTTPStatusCode: res.StatusCode,
18607 },
18608 }
18609 target := &ret
18610 b, err := gensupport.DecodeResponseBytes(target, res)
18611 if err != nil {
18612 return nil, err
18613 }
18614 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videoCategories.list", "response", internallog.HTTPResponse(res, b))
18615 return ret, nil
18616 }
18617
18618 type VideoTrainabilityGetCall struct {
18619 s *Service
18620 urlParams_ gensupport.URLParams
18621 ifNoneMatch_ string
18622 ctx_ context.Context
18623 header_ http.Header
18624 }
18625
18626 // Get: Returns the trainability status of a video.
18627 func (r *VideoTrainabilityService) Get() *VideoTrainabilityGetCall {
18628 c := &VideoTrainabilityGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18629 return c
18630 }
18631
18632 // Id sets the optional parameter "id": The ID of the video to retrieve.
18633 func (c *VideoTrainabilityGetCall) Id(id string) *VideoTrainabilityGetCall {
18634 c.urlParams_.Set("id", id)
18635 return c
18636 }
18637
18638 // Fields allows partial responses to be retrieved. See
18639 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18640 // details.
18641 func (c *VideoTrainabilityGetCall) Fields(s ...googleapi.Field) *VideoTrainabilityGetCall {
18642 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18643 return c
18644 }
18645
18646 // IfNoneMatch sets an optional parameter which makes the operation fail if the
18647 // object's ETag matches the given value. This is useful for getting updates
18648 // only after the object has changed since the last request.
18649 func (c *VideoTrainabilityGetCall) IfNoneMatch(entityTag string) *VideoTrainabilityGetCall {
18650 c.ifNoneMatch_ = entityTag
18651 return c
18652 }
18653
18654 // Context sets the context to be used in this call's Do method.
18655 func (c *VideoTrainabilityGetCall) Context(ctx context.Context) *VideoTrainabilityGetCall {
18656 c.ctx_ = ctx
18657 return c
18658 }
18659
18660 // Header returns a http.Header that can be modified by the caller to add
18661 // headers to the request.
18662 func (c *VideoTrainabilityGetCall) Header() http.Header {
18663 if c.header_ == nil {
18664 c.header_ = make(http.Header)
18665 }
18666 return c.header_
18667 }
18668
18669 func (c *VideoTrainabilityGetCall) doRequest(alt string) (*http.Response, error) {
18670 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
18671 if c.ifNoneMatch_ != "" {
18672 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18673 }
18674 c.urlParams_.Set("alt", alt)
18675 c.urlParams_.Set("prettyPrint", "false")
18676 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videoTrainability")
18677 urls += "?" + c.urlParams_.Encode()
18678 req, err := http.NewRequest("GET", urls, nil)
18679 if err != nil {
18680 return nil, err
18681 }
18682 req.Header = reqHeaders
18683 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videoTrainability.get", "request", internallog.HTTPRequest(req, nil))
18684 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18685 }
18686
18687 // Do executes the "youtube.videoTrainability.get" call.
18688 // Any non-2xx status code is an error. Response headers are in either
18689 // *VideoTrainability.ServerResponse.Header or (if a response was returned at
18690 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18691 // check whether the returned error was because http.StatusNotModified was
18692 // returned.
18693 func (c *VideoTrainabilityGetCall) Do(opts ...googleapi.CallOption) (*VideoTrainability, error) {
18694 gensupport.SetOptions(c.urlParams_, opts...)
18695 res, err := c.doRequest("json")
18696 if res != nil && res.StatusCode == http.StatusNotModified {
18697 if res.Body != nil {
18698 res.Body.Close()
18699 }
18700 return nil, gensupport.WrapError(&googleapi.Error{
18701 Code: res.StatusCode,
18702 Header: res.Header,
18703 })
18704 }
18705 if err != nil {
18706 return nil, err
18707 }
18708 defer googleapi.CloseBody(res)
18709 if err := googleapi.CheckResponse(res); err != nil {
18710 return nil, gensupport.WrapError(err)
18711 }
18712 ret := &VideoTrainability{
18713 ServerResponse: googleapi.ServerResponse{
18714 Header: res.Header,
18715 HTTPStatusCode: res.StatusCode,
18716 },
18717 }
18718 target := &ret
18719 b, err := gensupport.DecodeResponseBytes(target, res)
18720 if err != nil {
18721 return nil, err
18722 }
18723 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videoTrainability.get", "response", internallog.HTTPResponse(res, b))
18724 return ret, nil
18725 }
18726
18727 type VideosDeleteCall struct {
18728 s *Service
18729 urlParams_ gensupport.URLParams
18730 ctx_ context.Context
18731 header_ http.Header
18732 }
18733
18734 // Delete: Deletes a resource.
18735 //
18736 // - id: .
18737 func (r *VideosService) Delete(id string) *VideosDeleteCall {
18738 c := &VideosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18739 c.urlParams_.Set("id", id)
18740 return c
18741 }
18742
18743 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
18744 // *Note:* This parameter is intended exclusively for YouTube content partners.
18745 // The *onBehalfOfContentOwner* parameter indicates that the request's
18746 // authorization credentials identify a YouTube CMS user who is acting on
18747 // behalf of the content owner specified in the parameter value. This parameter
18748 // is intended for YouTube content partners that own and manage many different
18749 // YouTube channels. It allows content owners to authenticate once and get
18750 // access to all their video and channel data, without having to provide
18751 // authentication credentials for each individual channel. The actual CMS
18752 // account that the user authenticates with must be linked to the specified
18753 // YouTube content owner.
18754 func (c *VideosDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosDeleteCall {
18755 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
18756 return c
18757 }
18758
18759 // Fields allows partial responses to be retrieved. See
18760 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18761 // details.
18762 func (c *VideosDeleteCall) Fields(s ...googleapi.Field) *VideosDeleteCall {
18763 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18764 return c
18765 }
18766
18767 // Context sets the context to be used in this call's Do method.
18768 func (c *VideosDeleteCall) Context(ctx context.Context) *VideosDeleteCall {
18769 c.ctx_ = ctx
18770 return c
18771 }
18772
18773 // Header returns a http.Header that can be modified by the caller to add
18774 // headers to the request.
18775 func (c *VideosDeleteCall) Header() http.Header {
18776 if c.header_ == nil {
18777 c.header_ = make(http.Header)
18778 }
18779 return c.header_
18780 }
18781
18782 func (c *VideosDeleteCall) doRequest(alt string) (*http.Response, error) {
18783 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
18784 c.urlParams_.Set("alt", alt)
18785 c.urlParams_.Set("prettyPrint", "false")
18786 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos")
18787 urls += "?" + c.urlParams_.Encode()
18788 req, err := http.NewRequest("DELETE", urls, nil)
18789 if err != nil {
18790 return nil, err
18791 }
18792 req.Header = reqHeaders
18793 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.delete", "request", internallog.HTTPRequest(req, nil))
18794 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18795 }
18796
18797 // Do executes the "youtube.videos.delete" call.
18798 func (c *VideosDeleteCall) Do(opts ...googleapi.CallOption) error {
18799 gensupport.SetOptions(c.urlParams_, opts...)
18800 res, err := c.doRequest("json")
18801 if err != nil {
18802 return err
18803 }
18804 defer googleapi.CloseBody(res)
18805 if err := googleapi.CheckResponse(res); err != nil {
18806 return gensupport.WrapError(err)
18807 }
18808 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.delete", "response", internallog.HTTPResponse(res, nil))
18809 return nil
18810 }
18811
18812 type VideosGetRatingCall struct {
18813 s *Service
18814 urlParams_ gensupport.URLParams
18815 ifNoneMatch_ string
18816 ctx_ context.Context
18817 header_ http.Header
18818 }
18819
18820 // GetRating: Retrieves the ratings that the authorized user gave to a list of
18821 // specified videos.
18822 //
18823 // - id: .
18824 func (r *VideosService) GetRating(id []string) *VideosGetRatingCall {
18825 c := &VideosGetRatingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18826 c.urlParams_.SetMulti("id", append([]string{}, id...))
18827 return c
18828 }
18829
18830 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
18831 // *Note:* This parameter is intended exclusively for YouTube content partners.
18832 // The *onBehalfOfContentOwner* parameter indicates that the request's
18833 // authorization credentials identify a YouTube CMS user who is acting on
18834 // behalf of the content owner specified in the parameter value. This parameter
18835 // is intended for YouTube content partners that own and manage many different
18836 // YouTube channels. It allows content owners to authenticate once and get
18837 // access to all their video and channel data, without having to provide
18838 // authentication credentials for each individual channel. The CMS account that
18839 // the user authenticates with must be linked to the specified YouTube content
18840 // owner.
18841 func (c *VideosGetRatingCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosGetRatingCall {
18842 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
18843 return c
18844 }
18845
18846 // Fields allows partial responses to be retrieved. See
18847 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
18848 // details.
18849 func (c *VideosGetRatingCall) Fields(s ...googleapi.Field) *VideosGetRatingCall {
18850 c.urlParams_.Set("fields", googleapi.CombineFields(s))
18851 return c
18852 }
18853
18854 // IfNoneMatch sets an optional parameter which makes the operation fail if the
18855 // object's ETag matches the given value. This is useful for getting updates
18856 // only after the object has changed since the last request.
18857 func (c *VideosGetRatingCall) IfNoneMatch(entityTag string) *VideosGetRatingCall {
18858 c.ifNoneMatch_ = entityTag
18859 return c
18860 }
18861
18862 // Context sets the context to be used in this call's Do method.
18863 func (c *VideosGetRatingCall) Context(ctx context.Context) *VideosGetRatingCall {
18864 c.ctx_ = ctx
18865 return c
18866 }
18867
18868 // Header returns a http.Header that can be modified by the caller to add
18869 // headers to the request.
18870 func (c *VideosGetRatingCall) Header() http.Header {
18871 if c.header_ == nil {
18872 c.header_ = make(http.Header)
18873 }
18874 return c.header_
18875 }
18876
18877 func (c *VideosGetRatingCall) doRequest(alt string) (*http.Response, error) {
18878 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
18879 if c.ifNoneMatch_ != "" {
18880 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18881 }
18882 c.urlParams_.Set("alt", alt)
18883 c.urlParams_.Set("prettyPrint", "false")
18884 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos/getRating")
18885 urls += "?" + c.urlParams_.Encode()
18886 req, err := http.NewRequest("GET", urls, nil)
18887 if err != nil {
18888 return nil, err
18889 }
18890 req.Header = reqHeaders
18891 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.getRating", "request", internallog.HTTPRequest(req, nil))
18892 return gensupport.SendRequest(c.ctx_, c.s.client, req)
18893 }
18894
18895 // Do executes the "youtube.videos.getRating" call.
18896 // Any non-2xx status code is an error. Response headers are in either
18897 // *VideoGetRatingResponse.ServerResponse.Header or (if a response was returned
18898 // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18899 // check whether the returned error was because http.StatusNotModified was
18900 // returned.
18901 func (c *VideosGetRatingCall) Do(opts ...googleapi.CallOption) (*VideoGetRatingResponse, error) {
18902 gensupport.SetOptions(c.urlParams_, opts...)
18903 res, err := c.doRequest("json")
18904 if res != nil && res.StatusCode == http.StatusNotModified {
18905 if res.Body != nil {
18906 res.Body.Close()
18907 }
18908 return nil, gensupport.WrapError(&googleapi.Error{
18909 Code: res.StatusCode,
18910 Header: res.Header,
18911 })
18912 }
18913 if err != nil {
18914 return nil, err
18915 }
18916 defer googleapi.CloseBody(res)
18917 if err := googleapi.CheckResponse(res); err != nil {
18918 return nil, gensupport.WrapError(err)
18919 }
18920 ret := &VideoGetRatingResponse{
18921 ServerResponse: googleapi.ServerResponse{
18922 Header: res.Header,
18923 HTTPStatusCode: res.StatusCode,
18924 },
18925 }
18926 target := &ret
18927 b, err := gensupport.DecodeResponseBytes(target, res)
18928 if err != nil {
18929 return nil, err
18930 }
18931 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.getRating", "response", internallog.HTTPResponse(res, b))
18932 return ret, nil
18933 }
18934
18935 type VideosInsertCall struct {
18936 s *Service
18937 video *Video
18938 urlParams_ gensupport.URLParams
18939 mediaInfo_ *gensupport.MediaInfo
18940 ctx_ context.Context
18941 header_ http.Header
18942 }
18943
18944 // Insert: Inserts a new resource into this collection.
18945 //
18946 // - part: The *part* parameter serves two purposes in this operation. It
18947 // identifies the properties that the write operation will set as well as the
18948 // properties that the API response will include. Note that not all parts
18949 // contain properties that can be set when inserting or updating a video. For
18950 // example, the statistics object encapsulates statistics that YouTube
18951 // calculates for a video and does not contain values that you can set or
18952 // modify. If the parameter value specifies a part that does not contain
18953 // mutable values, that part will still be included in the API response.
18954 func (r *VideosService) Insert(part []string, video *Video) *VideosInsertCall {
18955 c := &VideosInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18956 c.urlParams_.SetMulti("part", append([]string{}, part...))
18957 c.video = video
18958 return c
18959 }
18960
18961 // AutoLevels sets the optional parameter "autoLevels": Should auto-levels be
18962 // applied to the upload.
18963 func (c *VideosInsertCall) AutoLevels(autoLevels bool) *VideosInsertCall {
18964 c.urlParams_.Set("autoLevels", fmt.Sprint(autoLevels))
18965 return c
18966 }
18967
18968 // NotifySubscribers sets the optional parameter "notifySubscribers": Notify
18969 // the channel subscribers about the new video. As default, the notification is
18970 // enabled.
18971 func (c *VideosInsertCall) NotifySubscribers(notifySubscribers bool) *VideosInsertCall {
18972 c.urlParams_.Set("notifySubscribers", fmt.Sprint(notifySubscribers))
18973 return c
18974 }
18975
18976 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
18977 // *Note:* This parameter is intended exclusively for YouTube content partners.
18978 // The *onBehalfOfContentOwner* parameter indicates that the request's
18979 // authorization credentials identify a YouTube CMS user who is acting on
18980 // behalf of the content owner specified in the parameter value. This parameter
18981 // is intended for YouTube content partners that own and manage many different
18982 // YouTube channels. It allows content owners to authenticate once and get
18983 // access to all their video and channel data, without having to provide
18984 // authentication credentials for each individual channel. The CMS account that
18985 // the user authenticates with must be linked to the specified YouTube content
18986 // owner.
18987 func (c *VideosInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosInsertCall {
18988 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
18989 return c
18990 }
18991
18992 // OnBehalfOfContentOwnerChannel sets the optional parameter
18993 // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
18994 // properly authorized request. *Note:* This parameter is intended exclusively
18995 // for YouTube content partners. The *onBehalfOfContentOwnerChannel* parameter
18996 // specifies the YouTube channel ID of the channel to which a video is being
18997 // added. This parameter is required when a request specifies a value for the
18998 // onBehalfOfContentOwner parameter, and it can only be used in conjunction
18999 // with that parameter. In addition, the request must be authorized using a CMS
19000 // account that is linked to the content owner that the onBehalfOfContentOwner
19001 // parameter specifies. Finally, the channel that the
19002 // onBehalfOfContentOwnerChannel parameter value specifies must be linked to
19003 // the content owner that the onBehalfOfContentOwner parameter specifies. This
19004 // parameter is intended for YouTube content partners that own and manage many
19005 // different YouTube channels. It allows content owners to authenticate once
19006 // and perform actions on behalf of the channel specified in the parameter
19007 // value, without having to provide authentication credentials for each
19008 // separate channel.
19009 func (c *VideosInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *VideosInsertCall {
19010 c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
19011 return c
19012 }
19013
19014 // Stabilize sets the optional parameter "stabilize": Should stabilize be
19015 // applied to the upload.
19016 func (c *VideosInsertCall) Stabilize(stabilize bool) *VideosInsertCall {
19017 c.urlParams_.Set("stabilize", fmt.Sprint(stabilize))
19018 return c
19019 }
19020
19021 // Media specifies the media to upload in one or more chunks. The chunk size
19022 // may be controlled by supplying a MediaOption generated by
19023 // googleapi.ChunkSize. The chunk size defaults to
19024 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
19025 // request will be determined by sniffing the contents of r, unless a
19026 // MediaOption generated by googleapi.ContentType is supplied.
19027 // At most one of Media and ResumableMedia may be set.
19028 func (c *VideosInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *VideosInsertCall {
19029 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
19030 return c
19031 }
19032
19033 // ResumableMedia specifies the media to upload in chunks and can be canceled
19034 // with ctx.
19035 //
19036 // Deprecated: use Media instead.
19037 //
19038 // At most one of Media and ResumableMedia may be set. mediaType identifies the
19039 // MIME media type of the upload, such as "image/png". If mediaType is "", it
19040 // will be auto-detected. The provided ctx will supersede any context
19041 // previously provided to the Context method.
19042 func (c *VideosInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *VideosInsertCall {
19043 c.ctx_ = ctx
19044 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
19045 return c
19046 }
19047
19048 // ProgressUpdater provides a callback function that will be called after every
19049 // chunk. It should be a low-latency function in order to not slow down the
19050 // upload operation. This should only be called when using ResumableMedia (as
19051 // opposed to Media).
19052 func (c *VideosInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *VideosInsertCall {
19053 c.mediaInfo_.SetProgressUpdater(pu)
19054 return c
19055 }
19056
19057 // Fields allows partial responses to be retrieved. See
19058 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19059 // details.
19060 func (c *VideosInsertCall) Fields(s ...googleapi.Field) *VideosInsertCall {
19061 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19062 return c
19063 }
19064
19065 // Context sets the context to be used in this call's Do method.
19066 // This context will supersede any context previously provided to the
19067 // ResumableMedia method.
19068 func (c *VideosInsertCall) Context(ctx context.Context) *VideosInsertCall {
19069 c.ctx_ = ctx
19070 return c
19071 }
19072
19073 // Header returns a http.Header that can be modified by the caller to add
19074 // headers to the request.
19075 func (c *VideosInsertCall) Header() http.Header {
19076 if c.header_ == nil {
19077 c.header_ = make(http.Header)
19078 }
19079 return c.header_
19080 }
19081
19082 func (c *VideosInsertCall) doRequest(alt string) (*http.Response, error) {
19083 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
19084 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.video)
19085 if err != nil {
19086 return nil, err
19087 }
19088 c.urlParams_.Set("alt", alt)
19089 c.urlParams_.Set("prettyPrint", "false")
19090 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos")
19091 if c.mediaInfo_ != nil {
19092 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/videos")
19093 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
19094 }
19095 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
19096 defer cleanup()
19097 urls += "?" + c.urlParams_.Encode()
19098 req, err := http.NewRequest("POST", urls, newBody)
19099 if err != nil {
19100 return nil, err
19101 }
19102 req.Header = reqHeaders
19103 req.GetBody = getBody
19104 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.insert", "request", internallog.HTTPRequest(req, body.Bytes()))
19105 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19106 }
19107
19108 // Do executes the "youtube.videos.insert" call.
19109 // Any non-2xx status code is an error. Response headers are in either
19110 // *Video.ServerResponse.Header or (if a response was returned at all) in
19111 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
19112 // whether the returned error was because http.StatusNotModified was returned.
19113 func (c *VideosInsertCall) Do(opts ...googleapi.CallOption) (*Video, error) {
19114 gensupport.SetOptions(c.urlParams_, opts...)
19115 res, err := c.doRequest("json")
19116 if res != nil && res.StatusCode == http.StatusNotModified {
19117 if res.Body != nil {
19118 res.Body.Close()
19119 }
19120 return nil, gensupport.WrapError(&googleapi.Error{
19121 Code: res.StatusCode,
19122 Header: res.Header,
19123 })
19124 }
19125 if err != nil {
19126 return nil, err
19127 }
19128 defer googleapi.CloseBody(res)
19129 if err := googleapi.CheckResponse(res); err != nil {
19130 return nil, gensupport.WrapError(err)
19131 }
19132 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
19133 if rx != nil {
19134 rx.Client = c.s.client
19135 rx.UserAgent = c.s.userAgent()
19136 ctx := c.ctx_
19137 if ctx == nil {
19138 ctx = context.TODO()
19139 }
19140 res, err = rx.Upload(ctx)
19141 if err != nil {
19142 return nil, err
19143 }
19144 defer res.Body.Close()
19145 if err := googleapi.CheckResponse(res); err != nil {
19146 return nil, gensupport.WrapError(err)
19147 }
19148 }
19149 ret := &Video{
19150 ServerResponse: googleapi.ServerResponse{
19151 Header: res.Header,
19152 HTTPStatusCode: res.StatusCode,
19153 },
19154 }
19155 target := &ret
19156 b, err := gensupport.DecodeResponseBytes(target, res)
19157 if err != nil {
19158 return nil, err
19159 }
19160 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.insert", "response", internallog.HTTPResponse(res, b))
19161 return ret, nil
19162 }
19163
19164 type VideosListCall struct {
19165 s *Service
19166 urlParams_ gensupport.URLParams
19167 ifNoneMatch_ string
19168 ctx_ context.Context
19169 header_ http.Header
19170 }
19171
19172 // List: Retrieves a list of resources, possibly filtered.
19173 //
19174 // - part: The *part* parameter specifies a comma-separated list of one or more
19175 // video resource properties that the API response will include. If the
19176 // parameter identifies a property that contains child properties, the child
19177 // properties will be included in the response. For example, in a video
19178 // resource, the snippet property contains the channelId, title, description,
19179 // tags, and categoryId properties. As such, if you set *part=snippet*, the
19180 // API response will contain all of those properties.
19181 func (r *VideosService) List(part []string) *VideosListCall {
19182 c := &VideosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19183 c.urlParams_.SetMulti("part", append([]string{}, part...))
19184 return c
19185 }
19186
19187 // Chart sets the optional parameter "chart": Return the videos that are in the
19188 // specified chart.
19189 //
19190 // Possible values:
19191 //
19192 // "chartUnspecified"
19193 // "mostPopular" - Return the most popular videos for the specified content
19194 //
19195 // region and video category.
19196 func (c *VideosListCall) Chart(chart string) *VideosListCall {
19197 c.urlParams_.Set("chart", chart)
19198 return c
19199 }
19200
19201 // Hl sets the optional parameter "hl": Stands for "host language". Specifies
19202 // the localization language of the metadata to be filled into
19203 // snippet.localized. The field is filled with the default metadata if there is
19204 // no localization in the specified language. The parameter value must be a
19205 // language code included in the list returned by the i18nLanguages.list method
19206 // (e.g. en_US, es_MX).
19207 func (c *VideosListCall) Hl(hl string) *VideosListCall {
19208 c.urlParams_.Set("hl", hl)
19209 return c
19210 }
19211
19212 // Id sets the optional parameter "id": Return videos with the given ids.
19213 func (c *VideosListCall) Id(id ...string) *VideosListCall {
19214 c.urlParams_.SetMulti("id", append([]string{}, id...))
19215 return c
19216 }
19217
19218 // Locale sets the optional parameter "locale":
19219 func (c *VideosListCall) Locale(locale string) *VideosListCall {
19220 c.urlParams_.Set("locale", locale)
19221 return c
19222 }
19223
19224 // MaxHeight sets the optional parameter "maxHeight":
19225 func (c *VideosListCall) MaxHeight(maxHeight int64) *VideosListCall {
19226 c.urlParams_.Set("maxHeight", fmt.Sprint(maxHeight))
19227 return c
19228 }
19229
19230 // MaxResults sets the optional parameter "maxResults": The *maxResults*
19231 // parameter specifies the maximum number of items that should be returned in
19232 // the result set. *Note:* This parameter is supported for use in conjunction
19233 // with the myRating and chart parameters, but it is not supported for use in
19234 // conjunction with the id parameter.
19235 func (c *VideosListCall) MaxResults(maxResults int64) *VideosListCall {
19236 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
19237 return c
19238 }
19239
19240 // MaxWidth sets the optional parameter "maxWidth": Return the player with
19241 // maximum height specified in
19242 func (c *VideosListCall) MaxWidth(maxWidth int64) *VideosListCall {
19243 c.urlParams_.Set("maxWidth", fmt.Sprint(maxWidth))
19244 return c
19245 }
19246
19247 // MyRating sets the optional parameter "myRating": Return videos
19248 // liked/disliked by the authenticated user. Does not support
19249 // RateType.RATED_TYPE_NONE.
19250 //
19251 // Possible values:
19252 //
19253 // "none"
19254 // "like" - The entity is liked.
19255 // "dislike" - The entity is disliked.
19256 func (c *VideosListCall) MyRating(myRating string) *VideosListCall {
19257 c.urlParams_.Set("myRating", myRating)
19258 return c
19259 }
19260
19261 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
19262 // *Note:* This parameter is intended exclusively for YouTube content partners.
19263 // The *onBehalfOfContentOwner* parameter indicates that the request's
19264 // authorization credentials identify a YouTube CMS user who is acting on
19265 // behalf of the content owner specified in the parameter value. This parameter
19266 // is intended for YouTube content partners that own and manage many different
19267 // YouTube channels. It allows content owners to authenticate once and get
19268 // access to all their video and channel data, without having to provide
19269 // authentication credentials for each individual channel. The CMS account that
19270 // the user authenticates with must be linked to the specified YouTube content
19271 // owner.
19272 func (c *VideosListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosListCall {
19273 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
19274 return c
19275 }
19276
19277 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
19278 // identifies a specific page in the result set that should be returned. In an
19279 // API response, the nextPageToken and prevPageToken properties identify other
19280 // pages that could be retrieved. *Note:* This parameter is supported for use
19281 // in conjunction with the myRating and chart parameters, but it is not
19282 // supported for use in conjunction with the id parameter.
19283 func (c *VideosListCall) PageToken(pageToken string) *VideosListCall {
19284 c.urlParams_.Set("pageToken", pageToken)
19285 return c
19286 }
19287
19288 // RegionCode sets the optional parameter "regionCode": Use a chart that is
19289 // specific to the specified region
19290 func (c *VideosListCall) RegionCode(regionCode string) *VideosListCall {
19291 c.urlParams_.Set("regionCode", regionCode)
19292 return c
19293 }
19294
19295 // VideoCategoryId sets the optional parameter "videoCategoryId": Use chart
19296 // that is specific to the specified video category
19297 func (c *VideosListCall) VideoCategoryId(videoCategoryId string) *VideosListCall {
19298 c.urlParams_.Set("videoCategoryId", videoCategoryId)
19299 return c
19300 }
19301
19302 // Fields allows partial responses to be retrieved. See
19303 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19304 // details.
19305 func (c *VideosListCall) Fields(s ...googleapi.Field) *VideosListCall {
19306 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19307 return c
19308 }
19309
19310 // IfNoneMatch sets an optional parameter which makes the operation fail if the
19311 // object's ETag matches the given value. This is useful for getting updates
19312 // only after the object has changed since the last request.
19313 func (c *VideosListCall) IfNoneMatch(entityTag string) *VideosListCall {
19314 c.ifNoneMatch_ = entityTag
19315 return c
19316 }
19317
19318 // Context sets the context to be used in this call's Do method.
19319 func (c *VideosListCall) Context(ctx context.Context) *VideosListCall {
19320 c.ctx_ = ctx
19321 return c
19322 }
19323
19324 // Header returns a http.Header that can be modified by the caller to add
19325 // headers to the request.
19326 func (c *VideosListCall) Header() http.Header {
19327 if c.header_ == nil {
19328 c.header_ = make(http.Header)
19329 }
19330 return c.header_
19331 }
19332
19333 func (c *VideosListCall) doRequest(alt string) (*http.Response, error) {
19334 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
19335 if c.ifNoneMatch_ != "" {
19336 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19337 }
19338 c.urlParams_.Set("alt", alt)
19339 c.urlParams_.Set("prettyPrint", "false")
19340 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos")
19341 urls += "?" + c.urlParams_.Encode()
19342 req, err := http.NewRequest("GET", urls, nil)
19343 if err != nil {
19344 return nil, err
19345 }
19346 req.Header = reqHeaders
19347 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.list", "request", internallog.HTTPRequest(req, nil))
19348 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19349 }
19350
19351 // Do executes the "youtube.videos.list" call.
19352 // Any non-2xx status code is an error. Response headers are in either
19353 // *VideoListResponse.ServerResponse.Header or (if a response was returned at
19354 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19355 // check whether the returned error was because http.StatusNotModified was
19356 // returned.
19357 func (c *VideosListCall) Do(opts ...googleapi.CallOption) (*VideoListResponse, error) {
19358 gensupport.SetOptions(c.urlParams_, opts...)
19359 res, err := c.doRequest("json")
19360 if res != nil && res.StatusCode == http.StatusNotModified {
19361 if res.Body != nil {
19362 res.Body.Close()
19363 }
19364 return nil, gensupport.WrapError(&googleapi.Error{
19365 Code: res.StatusCode,
19366 Header: res.Header,
19367 })
19368 }
19369 if err != nil {
19370 return nil, err
19371 }
19372 defer googleapi.CloseBody(res)
19373 if err := googleapi.CheckResponse(res); err != nil {
19374 return nil, gensupport.WrapError(err)
19375 }
19376 ret := &VideoListResponse{
19377 ServerResponse: googleapi.ServerResponse{
19378 Header: res.Header,
19379 HTTPStatusCode: res.StatusCode,
19380 },
19381 }
19382 target := &ret
19383 b, err := gensupport.DecodeResponseBytes(target, res)
19384 if err != nil {
19385 return nil, err
19386 }
19387 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.list", "response", internallog.HTTPResponse(res, b))
19388 return ret, nil
19389 }
19390
19391 // Pages invokes f for each page of results.
19392 // A non-nil error returned from f will halt the iteration.
19393 // The provided context supersedes any context provided to the Context method.
19394 func (c *VideosListCall) Pages(ctx context.Context, f func(*VideoListResponse) error) error {
19395 c.ctx_ = ctx
19396 defer c.PageToken(c.urlParams_.Get("pageToken"))
19397 for {
19398 x, err := c.Do()
19399 if err != nil {
19400 return err
19401 }
19402 if err := f(x); err != nil {
19403 return err
19404 }
19405 if x.NextPageToken == "" {
19406 return nil
19407 }
19408 c.PageToken(x.NextPageToken)
19409 }
19410 }
19411
19412 type VideosRateCall struct {
19413 s *Service
19414 urlParams_ gensupport.URLParams
19415 ctx_ context.Context
19416 header_ http.Header
19417 }
19418
19419 // Rate: Adds a like or dislike rating to a video or removes a rating from a
19420 // video.
19421 //
19422 // - id: .
19423 // - rating: .
19424 func (r *VideosService) Rate(id string, rating string) *VideosRateCall {
19425 c := &VideosRateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19426 c.urlParams_.Set("id", id)
19427 c.urlParams_.Set("rating", rating)
19428 return c
19429 }
19430
19431 // Fields allows partial responses to be retrieved. See
19432 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19433 // details.
19434 func (c *VideosRateCall) Fields(s ...googleapi.Field) *VideosRateCall {
19435 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19436 return c
19437 }
19438
19439 // Context sets the context to be used in this call's Do method.
19440 func (c *VideosRateCall) Context(ctx context.Context) *VideosRateCall {
19441 c.ctx_ = ctx
19442 return c
19443 }
19444
19445 // Header returns a http.Header that can be modified by the caller to add
19446 // headers to the request.
19447 func (c *VideosRateCall) Header() http.Header {
19448 if c.header_ == nil {
19449 c.header_ = make(http.Header)
19450 }
19451 return c.header_
19452 }
19453
19454 func (c *VideosRateCall) doRequest(alt string) (*http.Response, error) {
19455 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
19456 c.urlParams_.Set("alt", alt)
19457 c.urlParams_.Set("prettyPrint", "false")
19458 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos/rate")
19459 urls += "?" + c.urlParams_.Encode()
19460 req, err := http.NewRequest("POST", urls, nil)
19461 if err != nil {
19462 return nil, err
19463 }
19464 req.Header = reqHeaders
19465 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.rate", "request", internallog.HTTPRequest(req, nil))
19466 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19467 }
19468
19469 // Do executes the "youtube.videos.rate" call.
19470 func (c *VideosRateCall) Do(opts ...googleapi.CallOption) error {
19471 gensupport.SetOptions(c.urlParams_, opts...)
19472 res, err := c.doRequest("json")
19473 if err != nil {
19474 return err
19475 }
19476 defer googleapi.CloseBody(res)
19477 if err := googleapi.CheckResponse(res); err != nil {
19478 return gensupport.WrapError(err)
19479 }
19480 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.rate", "response", internallog.HTTPResponse(res, nil))
19481 return nil
19482 }
19483
19484 type VideosReportAbuseCall struct {
19485 s *Service
19486 videoabusereport *VideoAbuseReport
19487 urlParams_ gensupport.URLParams
19488 ctx_ context.Context
19489 header_ http.Header
19490 }
19491
19492 // ReportAbuse: Report abuse for a video.
19493 func (r *VideosService) ReportAbuse(videoabusereport *VideoAbuseReport) *VideosReportAbuseCall {
19494 c := &VideosReportAbuseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19495 c.videoabusereport = videoabusereport
19496 return c
19497 }
19498
19499 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
19500 // *Note:* This parameter is intended exclusively for YouTube content partners.
19501 // The *onBehalfOfContentOwner* parameter indicates that the request's
19502 // authorization credentials identify a YouTube CMS user who is acting on
19503 // behalf of the content owner specified in the parameter value. This parameter
19504 // is intended for YouTube content partners that own and manage many different
19505 // YouTube channels. It allows content owners to authenticate once and get
19506 // access to all their video and channel data, without having to provide
19507 // authentication credentials for each individual channel. The CMS account that
19508 // the user authenticates with must be linked to the specified YouTube content
19509 // owner.
19510 func (c *VideosReportAbuseCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosReportAbuseCall {
19511 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
19512 return c
19513 }
19514
19515 // Fields allows partial responses to be retrieved. See
19516 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19517 // details.
19518 func (c *VideosReportAbuseCall) Fields(s ...googleapi.Field) *VideosReportAbuseCall {
19519 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19520 return c
19521 }
19522
19523 // Context sets the context to be used in this call's Do method.
19524 func (c *VideosReportAbuseCall) Context(ctx context.Context) *VideosReportAbuseCall {
19525 c.ctx_ = ctx
19526 return c
19527 }
19528
19529 // Header returns a http.Header that can be modified by the caller to add
19530 // headers to the request.
19531 func (c *VideosReportAbuseCall) Header() http.Header {
19532 if c.header_ == nil {
19533 c.header_ = make(http.Header)
19534 }
19535 return c.header_
19536 }
19537
19538 func (c *VideosReportAbuseCall) doRequest(alt string) (*http.Response, error) {
19539 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
19540 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.videoabusereport)
19541 if err != nil {
19542 return nil, err
19543 }
19544 c.urlParams_.Set("alt", alt)
19545 c.urlParams_.Set("prettyPrint", "false")
19546 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos/reportAbuse")
19547 urls += "?" + c.urlParams_.Encode()
19548 req, err := http.NewRequest("POST", urls, body)
19549 if err != nil {
19550 return nil, err
19551 }
19552 req.Header = reqHeaders
19553 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.reportAbuse", "request", internallog.HTTPRequest(req, body.Bytes()))
19554 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19555 }
19556
19557 // Do executes the "youtube.videos.reportAbuse" call.
19558 func (c *VideosReportAbuseCall) Do(opts ...googleapi.CallOption) error {
19559 gensupport.SetOptions(c.urlParams_, opts...)
19560 res, err := c.doRequest("json")
19561 if err != nil {
19562 return err
19563 }
19564 defer googleapi.CloseBody(res)
19565 if err := googleapi.CheckResponse(res); err != nil {
19566 return gensupport.WrapError(err)
19567 }
19568 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.reportAbuse", "response", internallog.HTTPResponse(res, nil))
19569 return nil
19570 }
19571
19572 type VideosUpdateCall struct {
19573 s *Service
19574 video *Video
19575 urlParams_ gensupport.URLParams
19576 ctx_ context.Context
19577 header_ http.Header
19578 }
19579
19580 // Update: Updates an existing resource.
19581 //
19582 // - part: The *part* parameter serves two purposes in this operation. It
19583 // identifies the properties that the write operation will set as well as the
19584 // properties that the API response will include. Note that this method will
19585 // override the existing values for all of the mutable properties that are
19586 // contained in any parts that the parameter value specifies. For example, a
19587 // video's privacy setting is contained in the status part. As such, if your
19588 // request is updating a private video, and the request's part parameter
19589 // value includes the status part, the video's privacy setting will be
19590 // updated to whatever value the request body specifies. If the request body
19591 // does not specify a value, the existing privacy setting will be removed and
19592 // the video will revert to the default privacy setting. In addition, not all
19593 // parts contain properties that can be set when inserting or updating a
19594 // video. For example, the statistics object encapsulates statistics that
19595 // YouTube calculates for a video and does not contain values that you can
19596 // set or modify. If the parameter value specifies a part that does not
19597 // contain mutable values, that part will still be included in the API
19598 // response.
19599 func (r *VideosService) Update(part []string, video *Video) *VideosUpdateCall {
19600 c := &VideosUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19601 c.urlParams_.SetMulti("part", append([]string{}, part...))
19602 c.video = video
19603 return c
19604 }
19605
19606 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
19607 // *Note:* This parameter is intended exclusively for YouTube content partners.
19608 // The *onBehalfOfContentOwner* parameter indicates that the request's
19609 // authorization credentials identify a YouTube CMS user who is acting on
19610 // behalf of the content owner specified in the parameter value. This parameter
19611 // is intended for YouTube content partners that own and manage many different
19612 // YouTube channels. It allows content owners to authenticate once and get
19613 // access to all their video and channel data, without having to provide
19614 // authentication credentials for each individual channel. The actual CMS
19615 // account that the user authenticates with must be linked to the specified
19616 // YouTube content owner.
19617 func (c *VideosUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosUpdateCall {
19618 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
19619 return c
19620 }
19621
19622 // Fields allows partial responses to be retrieved. See
19623 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19624 // details.
19625 func (c *VideosUpdateCall) Fields(s ...googleapi.Field) *VideosUpdateCall {
19626 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19627 return c
19628 }
19629
19630 // Context sets the context to be used in this call's Do method.
19631 func (c *VideosUpdateCall) Context(ctx context.Context) *VideosUpdateCall {
19632 c.ctx_ = ctx
19633 return c
19634 }
19635
19636 // Header returns a http.Header that can be modified by the caller to add
19637 // headers to the request.
19638 func (c *VideosUpdateCall) Header() http.Header {
19639 if c.header_ == nil {
19640 c.header_ = make(http.Header)
19641 }
19642 return c.header_
19643 }
19644
19645 func (c *VideosUpdateCall) doRequest(alt string) (*http.Response, error) {
19646 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
19647 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.video)
19648 if err != nil {
19649 return nil, err
19650 }
19651 c.urlParams_.Set("alt", alt)
19652 c.urlParams_.Set("prettyPrint", "false")
19653 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/videos")
19654 urls += "?" + c.urlParams_.Encode()
19655 req, err := http.NewRequest("PUT", urls, body)
19656 if err != nil {
19657 return nil, err
19658 }
19659 req.Header = reqHeaders
19660 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.videos.update", "request", internallog.HTTPRequest(req, body.Bytes()))
19661 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19662 }
19663
19664 // Do executes the "youtube.videos.update" call.
19665 // Any non-2xx status code is an error. Response headers are in either
19666 // *Video.ServerResponse.Header or (if a response was returned at all) in
19667 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
19668 // whether the returned error was because http.StatusNotModified was returned.
19669 func (c *VideosUpdateCall) Do(opts ...googleapi.CallOption) (*Video, error) {
19670 gensupport.SetOptions(c.urlParams_, opts...)
19671 res, err := c.doRequest("json")
19672 if res != nil && res.StatusCode == http.StatusNotModified {
19673 if res.Body != nil {
19674 res.Body.Close()
19675 }
19676 return nil, gensupport.WrapError(&googleapi.Error{
19677 Code: res.StatusCode,
19678 Header: res.Header,
19679 })
19680 }
19681 if err != nil {
19682 return nil, err
19683 }
19684 defer googleapi.CloseBody(res)
19685 if err := googleapi.CheckResponse(res); err != nil {
19686 return nil, gensupport.WrapError(err)
19687 }
19688 ret := &Video{
19689 ServerResponse: googleapi.ServerResponse{
19690 Header: res.Header,
19691 HTTPStatusCode: res.StatusCode,
19692 },
19693 }
19694 target := &ret
19695 b, err := gensupport.DecodeResponseBytes(target, res)
19696 if err != nil {
19697 return nil, err
19698 }
19699 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.videos.update", "response", internallog.HTTPResponse(res, b))
19700 return ret, nil
19701 }
19702
19703 type WatermarksSetCall struct {
19704 s *Service
19705 invideobranding *InvideoBranding
19706 urlParams_ gensupport.URLParams
19707 mediaInfo_ *gensupport.MediaInfo
19708 ctx_ context.Context
19709 header_ http.Header
19710 }
19711
19712 // Set: Allows upload of watermark image and setting it for a channel.
19713 //
19714 // - channelId: .
19715 func (r *WatermarksService) Set(channelId string, invideobranding *InvideoBranding) *WatermarksSetCall {
19716 c := &WatermarksSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19717 c.urlParams_.Set("channelId", channelId)
19718 c.invideobranding = invideobranding
19719 return c
19720 }
19721
19722 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
19723 // *Note:* This parameter is intended exclusively for YouTube content partners.
19724 // The *onBehalfOfContentOwner* parameter indicates that the request's
19725 // authorization credentials identify a YouTube CMS user who is acting on
19726 // behalf of the content owner specified in the parameter value. This parameter
19727 // is intended for YouTube content partners that own and manage many different
19728 // YouTube channels. It allows content owners to authenticate once and get
19729 // access to all their video and channel data, without having to provide
19730 // authentication credentials for each individual channel. The CMS account that
19731 // the user authenticates with must be linked to the specified YouTube content
19732 // owner.
19733 func (c *WatermarksSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksSetCall {
19734 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
19735 return c
19736 }
19737
19738 // Media specifies the media to upload in one or more chunks. The chunk size
19739 // may be controlled by supplying a MediaOption generated by
19740 // googleapi.ChunkSize. The chunk size defaults to
19741 // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
19742 // request will be determined by sniffing the contents of r, unless a
19743 // MediaOption generated by googleapi.ContentType is supplied.
19744 // At most one of Media and ResumableMedia may be set.
19745 func (c *WatermarksSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *WatermarksSetCall {
19746 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
19747 return c
19748 }
19749
19750 // ResumableMedia specifies the media to upload in chunks and can be canceled
19751 // with ctx.
19752 //
19753 // Deprecated: use Media instead.
19754 //
19755 // At most one of Media and ResumableMedia may be set. mediaType identifies the
19756 // MIME media type of the upload, such as "image/png". If mediaType is "", it
19757 // will be auto-detected. The provided ctx will supersede any context
19758 // previously provided to the Context method.
19759 func (c *WatermarksSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *WatermarksSetCall {
19760 c.ctx_ = ctx
19761 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
19762 return c
19763 }
19764
19765 // ProgressUpdater provides a callback function that will be called after every
19766 // chunk. It should be a low-latency function in order to not slow down the
19767 // upload operation. This should only be called when using ResumableMedia (as
19768 // opposed to Media).
19769 func (c *WatermarksSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *WatermarksSetCall {
19770 c.mediaInfo_.SetProgressUpdater(pu)
19771 return c
19772 }
19773
19774 // Fields allows partial responses to be retrieved. See
19775 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19776 // details.
19777 func (c *WatermarksSetCall) Fields(s ...googleapi.Field) *WatermarksSetCall {
19778 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19779 return c
19780 }
19781
19782 // Context sets the context to be used in this call's Do method.
19783 // This context will supersede any context previously provided to the
19784 // ResumableMedia method.
19785 func (c *WatermarksSetCall) Context(ctx context.Context) *WatermarksSetCall {
19786 c.ctx_ = ctx
19787 return c
19788 }
19789
19790 // Header returns a http.Header that can be modified by the caller to add
19791 // headers to the request.
19792 func (c *WatermarksSetCall) Header() http.Header {
19793 if c.header_ == nil {
19794 c.header_ = make(http.Header)
19795 }
19796 return c.header_
19797 }
19798
19799 func (c *WatermarksSetCall) doRequest(alt string) (*http.Response, error) {
19800 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
19801 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.invideobranding)
19802 if err != nil {
19803 return nil, err
19804 }
19805 c.urlParams_.Set("alt", alt)
19806 c.urlParams_.Set("prettyPrint", "false")
19807 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/watermarks/set")
19808 if c.mediaInfo_ != nil {
19809 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/youtube/v3/watermarks/set")
19810 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
19811 }
19812 newBody, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
19813 defer cleanup()
19814 urls += "?" + c.urlParams_.Encode()
19815 req, err := http.NewRequest("POST", urls, newBody)
19816 if err != nil {
19817 return nil, err
19818 }
19819 req.Header = reqHeaders
19820 req.GetBody = getBody
19821 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.watermarks.set", "request", internallog.HTTPRequest(req, body.Bytes()))
19822 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19823 }
19824
19825 // Do executes the "youtube.watermarks.set" call.
19826 func (c *WatermarksSetCall) Do(opts ...googleapi.CallOption) error {
19827 gensupport.SetOptions(c.urlParams_, opts...)
19828 res, err := c.doRequest("json")
19829 if err != nil {
19830 return err
19831 }
19832 defer googleapi.CloseBody(res)
19833 if err := googleapi.CheckResponse(res); err != nil {
19834 return gensupport.WrapError(err)
19835 }
19836 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
19837 if rx != nil {
19838 rx.Client = c.s.client
19839 rx.UserAgent = c.s.userAgent()
19840 ctx := c.ctx_
19841 if ctx == nil {
19842 ctx = context.TODO()
19843 }
19844 res, err = rx.Upload(ctx)
19845 if err != nil {
19846 return err
19847 }
19848 defer res.Body.Close()
19849 if err := googleapi.CheckResponse(res); err != nil {
19850 return gensupport.WrapError(err)
19851 }
19852 }
19853 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.watermarks.set", "response", internallog.HTTPResponse(res, nil))
19854 return nil
19855 }
19856
19857 type WatermarksUnsetCall struct {
19858 s *Service
19859 urlParams_ gensupport.URLParams
19860 ctx_ context.Context
19861 header_ http.Header
19862 }
19863
19864 // Unset: Allows removal of channel watermark.
19865 //
19866 // - channelId: .
19867 func (r *WatermarksService) Unset(channelId string) *WatermarksUnsetCall {
19868 c := &WatermarksUnsetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19869 c.urlParams_.Set("channelId", channelId)
19870 return c
19871 }
19872
19873 // OnBehalfOfContentOwner sets the optional parameter "onBehalfOfContentOwner":
19874 // *Note:* This parameter is intended exclusively for YouTube content partners.
19875 // The *onBehalfOfContentOwner* parameter indicates that the request's
19876 // authorization credentials identify a YouTube CMS user who is acting on
19877 // behalf of the content owner specified in the parameter value. This parameter
19878 // is intended for YouTube content partners that own and manage many different
19879 // YouTube channels. It allows content owners to authenticate once and get
19880 // access to all their video and channel data, without having to provide
19881 // authentication credentials for each individual channel. The CMS account that
19882 // the user authenticates with must be linked to the specified YouTube content
19883 // owner.
19884 func (c *WatermarksUnsetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksUnsetCall {
19885 c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
19886 return c
19887 }
19888
19889 // Fields allows partial responses to be retrieved. See
19890 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19891 // details.
19892 func (c *WatermarksUnsetCall) Fields(s ...googleapi.Field) *WatermarksUnsetCall {
19893 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19894 return c
19895 }
19896
19897 // Context sets the context to be used in this call's Do method.
19898 func (c *WatermarksUnsetCall) Context(ctx context.Context) *WatermarksUnsetCall {
19899 c.ctx_ = ctx
19900 return c
19901 }
19902
19903 // Header returns a http.Header that can be modified by the caller to add
19904 // headers to the request.
19905 func (c *WatermarksUnsetCall) Header() http.Header {
19906 if c.header_ == nil {
19907 c.header_ = make(http.Header)
19908 }
19909 return c.header_
19910 }
19911
19912 func (c *WatermarksUnsetCall) doRequest(alt string) (*http.Response, error) {
19913 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
19914 c.urlParams_.Set("alt", alt)
19915 c.urlParams_.Set("prettyPrint", "false")
19916 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/watermarks/unset")
19917 urls += "?" + c.urlParams_.Encode()
19918 req, err := http.NewRequest("POST", urls, nil)
19919 if err != nil {
19920 return nil, err
19921 }
19922 req.Header = reqHeaders
19923 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.watermarks.unset", "request", internallog.HTTPRequest(req, nil))
19924 return gensupport.SendRequest(c.ctx_, c.s.client, req)
19925 }
19926
19927 // Do executes the "youtube.watermarks.unset" call.
19928 func (c *WatermarksUnsetCall) Do(opts ...googleapi.CallOption) error {
19929 gensupport.SetOptions(c.urlParams_, opts...)
19930 res, err := c.doRequest("json")
19931 if err != nil {
19932 return err
19933 }
19934 defer googleapi.CloseBody(res)
19935 if err := googleapi.CheckResponse(res); err != nil {
19936 return gensupport.WrapError(err)
19937 }
19938 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.watermarks.unset", "response", internallog.HTTPResponse(res, nil))
19939 return nil
19940 }
19941
19942 type YoutubeV3UpdateCommentThreadsCall struct {
19943 s *Service
19944 commentthread *CommentThread
19945 urlParams_ gensupport.URLParams
19946 ctx_ context.Context
19947 header_ http.Header
19948 }
19949
19950 // UpdateCommentThreads: Updates an existing resource.
19951 func (r *YoutubeV3Service) UpdateCommentThreads(commentthread *CommentThread) *YoutubeV3UpdateCommentThreadsCall {
19952 c := &YoutubeV3UpdateCommentThreadsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19953 c.commentthread = commentthread
19954 return c
19955 }
19956
19957 // Part sets the optional parameter "part": The *part* parameter specifies a
19958 // comma-separated list of commentThread resource properties that the API
19959 // response will include. You must at least include the snippet part in the
19960 // parameter value since that part contains all of the properties that the API
19961 // request can update.
19962 func (c *YoutubeV3UpdateCommentThreadsCall) Part(part ...string) *YoutubeV3UpdateCommentThreadsCall {
19963 c.urlParams_.SetMulti("part", append([]string{}, part...))
19964 return c
19965 }
19966
19967 // Fields allows partial responses to be retrieved. See
19968 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
19969 // details.
19970 func (c *YoutubeV3UpdateCommentThreadsCall) Fields(s ...googleapi.Field) *YoutubeV3UpdateCommentThreadsCall {
19971 c.urlParams_.Set("fields", googleapi.CombineFields(s))
19972 return c
19973 }
19974
19975 // Context sets the context to be used in this call's Do method.
19976 func (c *YoutubeV3UpdateCommentThreadsCall) Context(ctx context.Context) *YoutubeV3UpdateCommentThreadsCall {
19977 c.ctx_ = ctx
19978 return c
19979 }
19980
19981 // Header returns a http.Header that can be modified by the caller to add
19982 // headers to the request.
19983 func (c *YoutubeV3UpdateCommentThreadsCall) Header() http.Header {
19984 if c.header_ == nil {
19985 c.header_ = make(http.Header)
19986 }
19987 return c.header_
19988 }
19989
19990 func (c *YoutubeV3UpdateCommentThreadsCall) doRequest(alt string) (*http.Response, error) {
19991 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
19992 body, err := googleapi.WithoutDataWrapper.JSONBuffer(c.commentthread)
19993 if err != nil {
19994 return nil, err
19995 }
19996 c.urlParams_.Set("alt", alt)
19997 c.urlParams_.Set("prettyPrint", "false")
19998 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/commentThreads")
19999 urls += "?" + c.urlParams_.Encode()
20000 req, err := http.NewRequest("PUT", urls, body)
20001 if err != nil {
20002 return nil, err
20003 }
20004 req.Header = reqHeaders
20005 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.youtube.v3.updateCommentThreads", "request", internallog.HTTPRequest(req, body.Bytes()))
20006 return gensupport.SendRequest(c.ctx_, c.s.client, req)
20007 }
20008
20009 // Do executes the "youtube.youtube.v3.updateCommentThreads" call.
20010 // Any non-2xx status code is an error. Response headers are in either
20011 // *CommentThread.ServerResponse.Header or (if a response was returned at all)
20012 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
20013 // whether the returned error was because http.StatusNotModified was returned.
20014 func (c *YoutubeV3UpdateCommentThreadsCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
20015 gensupport.SetOptions(c.urlParams_, opts...)
20016 res, err := c.doRequest("json")
20017 if res != nil && res.StatusCode == http.StatusNotModified {
20018 if res.Body != nil {
20019 res.Body.Close()
20020 }
20021 return nil, gensupport.WrapError(&googleapi.Error{
20022 Code: res.StatusCode,
20023 Header: res.Header,
20024 })
20025 }
20026 if err != nil {
20027 return nil, err
20028 }
20029 defer googleapi.CloseBody(res)
20030 if err := googleapi.CheckResponse(res); err != nil {
20031 return nil, gensupport.WrapError(err)
20032 }
20033 ret := &CommentThread{
20034 ServerResponse: googleapi.ServerResponse{
20035 Header: res.Header,
20036 HTTPStatusCode: res.StatusCode,
20037 },
20038 }
20039 target := &ret
20040 b, err := gensupport.DecodeResponseBytes(target, res)
20041 if err != nil {
20042 return nil, err
20043 }
20044 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.youtube.v3.updateCommentThreads", "response", internallog.HTTPResponse(res, b))
20045 return ret, nil
20046 }
20047
20048 type YoutubeV3LiveChatMessagesStreamCall struct {
20049 s *Service
20050 urlParams_ gensupport.URLParams
20051 ifNoneMatch_ string
20052 ctx_ context.Context
20053 header_ http.Header
20054 }
20055
20056 // Stream: Allows a user to load live chat through a server-streamed RPC.
20057 func (r *YoutubeV3LiveChatMessagesService) Stream() *YoutubeV3LiveChatMessagesStreamCall {
20058 c := &YoutubeV3LiveChatMessagesStreamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20059 return c
20060 }
20061
20062 // Hl sets the optional parameter "hl": Specifies the localization language in
20063 // which the system messages should be returned.
20064 func (c *YoutubeV3LiveChatMessagesStreamCall) Hl(hl string) *YoutubeV3LiveChatMessagesStreamCall {
20065 c.urlParams_.Set("hl", hl)
20066 return c
20067 }
20068
20069 // LiveChatId sets the optional parameter "liveChatId": The id of the live chat
20070 // for which comments should be returned.
20071 func (c *YoutubeV3LiveChatMessagesStreamCall) LiveChatId(liveChatId string) *YoutubeV3LiveChatMessagesStreamCall {
20072 c.urlParams_.Set("liveChatId", liveChatId)
20073 return c
20074 }
20075
20076 // MaxResults sets the optional parameter "maxResults": The *maxResults*
20077 // parameter specifies the maximum number of items that should be returned in
20078 // the result set. Not used in the streaming RPC.
20079 func (c *YoutubeV3LiveChatMessagesStreamCall) MaxResults(maxResults int64) *YoutubeV3LiveChatMessagesStreamCall {
20080 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
20081 return c
20082 }
20083
20084 // PageToken sets the optional parameter "pageToken": The *pageToken* parameter
20085 // identifies a specific page in the result set that should be returned. In an
20086 // API response, the nextPageToken property identify other pages that could be
20087 // retrieved.
20088 func (c *YoutubeV3LiveChatMessagesStreamCall) PageToken(pageToken string) *YoutubeV3LiveChatMessagesStreamCall {
20089 c.urlParams_.Set("pageToken", pageToken)
20090 return c
20091 }
20092
20093 // Part sets the optional parameter "part": The *part* parameter specifies the
20094 // liveChatComment resource parts that the API response will include. Supported
20095 // values are id, snippet, and authorDetails.
20096 func (c *YoutubeV3LiveChatMessagesStreamCall) Part(part ...string) *YoutubeV3LiveChatMessagesStreamCall {
20097 c.urlParams_.SetMulti("part", append([]string{}, part...))
20098 return c
20099 }
20100
20101 // ProfileImageSize sets the optional parameter "profileImageSize": Specifies
20102 // the size of the profile image that should be returned for each user.
20103 func (c *YoutubeV3LiveChatMessagesStreamCall) ProfileImageSize(profileImageSize int64) *YoutubeV3LiveChatMessagesStreamCall {
20104 c.urlParams_.Set("profileImageSize", fmt.Sprint(profileImageSize))
20105 return c
20106 }
20107
20108 // Fields allows partial responses to be retrieved. See
20109 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
20110 // details.
20111 func (c *YoutubeV3LiveChatMessagesStreamCall) Fields(s ...googleapi.Field) *YoutubeV3LiveChatMessagesStreamCall {
20112 c.urlParams_.Set("fields", googleapi.CombineFields(s))
20113 return c
20114 }
20115
20116 // IfNoneMatch sets an optional parameter which makes the operation fail if the
20117 // object's ETag matches the given value. This is useful for getting updates
20118 // only after the object has changed since the last request.
20119 func (c *YoutubeV3LiveChatMessagesStreamCall) IfNoneMatch(entityTag string) *YoutubeV3LiveChatMessagesStreamCall {
20120 c.ifNoneMatch_ = entityTag
20121 return c
20122 }
20123
20124 // Context sets the context to be used in this call's Do method.
20125 func (c *YoutubeV3LiveChatMessagesStreamCall) Context(ctx context.Context) *YoutubeV3LiveChatMessagesStreamCall {
20126 c.ctx_ = ctx
20127 return c
20128 }
20129
20130 // Header returns a http.Header that can be modified by the caller to add
20131 // headers to the request.
20132 func (c *YoutubeV3LiveChatMessagesStreamCall) Header() http.Header {
20133 if c.header_ == nil {
20134 c.header_ = make(http.Header)
20135 }
20136 return c.header_
20137 }
20138
20139 func (c *YoutubeV3LiveChatMessagesStreamCall) doRequest(alt string) (*http.Response, error) {
20140 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
20141 if c.ifNoneMatch_ != "" {
20142 reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20143 }
20144 c.urlParams_.Set("alt", alt)
20145 c.urlParams_.Set("prettyPrint", "false")
20146 urls := googleapi.ResolveRelative(c.s.BasePath, "youtube/v3/liveChat/messages/stream")
20147 urls += "?" + c.urlParams_.Encode()
20148 req, err := http.NewRequest("GET", urls, nil)
20149 if err != nil {
20150 return nil, err
20151 }
20152 req.Header = reqHeaders
20153 c.s.logger.DebugContext(c.ctx_, "api request", "serviceName", apiName, "rpcName", "youtube.youtube.v3.liveChat.messages.stream", "request", internallog.HTTPRequest(req, nil))
20154 return gensupport.SendRequest(c.ctx_, c.s.client, req)
20155 }
20156
20157 // Do executes the "youtube.youtube.v3.liveChat.messages.stream" call.
20158 // Any non-2xx status code is an error. Response headers are in either
20159 // *LiveChatMessageListResponse.ServerResponse.Header or (if a response was
20160 // returned at all) in error.(*googleapi.Error).Header. Use
20161 // googleapi.IsNotModified to check whether the returned error was because
20162 // http.StatusNotModified was returned.
20163 func (c *YoutubeV3LiveChatMessagesStreamCall) Do(opts ...googleapi.CallOption) (*LiveChatMessageListResponse, error) {
20164 gensupport.SetOptions(c.urlParams_, opts...)
20165 res, err := c.doRequest("json")
20166 if res != nil && res.StatusCode == http.StatusNotModified {
20167 if res.Body != nil {
20168 res.Body.Close()
20169 }
20170 return nil, gensupport.WrapError(&googleapi.Error{
20171 Code: res.StatusCode,
20172 Header: res.Header,
20173 })
20174 }
20175 if err != nil {
20176 return nil, err
20177 }
20178 defer googleapi.CloseBody(res)
20179 if err := googleapi.CheckResponse(res); err != nil {
20180 return nil, gensupport.WrapError(err)
20181 }
20182 ret := &LiveChatMessageListResponse{
20183 ServerResponse: googleapi.ServerResponse{
20184 Header: res.Header,
20185 HTTPStatusCode: res.StatusCode,
20186 },
20187 }
20188 target := &ret
20189 b, err := gensupport.DecodeResponseBytes(target, res)
20190 if err != nil {
20191 return nil, err
20192 }
20193 c.s.logger.DebugContext(c.ctx_, "api response", "serviceName", apiName, "rpcName", "youtube.youtube.v3.liveChat.messages.stream", "response", internallog.HTTPResponse(res, b))
20194 return ret, nil
20195 }
20196
20197 // Pages invokes f for each page of results.
20198 // A non-nil error returned from f will halt the iteration.
20199 // The provided context supersedes any context provided to the Context method.
20200 func (c *YoutubeV3LiveChatMessagesStreamCall) Pages(ctx context.Context, f func(*LiveChatMessageListResponse) error) error {
20201 c.ctx_ = ctx
20202 defer c.PageToken(c.urlParams_.Get("pageToken"))
20203 for {
20204 x, err := c.Do()
20205 if err != nil {
20206 return err
20207 }
20208 if err := f(x); err != nil {
20209 return err
20210 }
20211 if x.NextPageToken == "" {
20212 return nil
20213 }
20214 c.PageToken(x.NextPageToken)
20215 }
20216 }