You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23808 lines
934 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package youtube provides access to the YouTube Data API.
  6. //
  7. // For product documentation, see: https://developers.google.com/youtube/v3
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/youtube/v3"
  14. // ...
  15. // ctx := context.Background()
  16. // youtubeService, err := youtube.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // youtubeService, err := youtube.NewService(ctx, option.WithScopes(youtube.YoutubepartnerChannelAuditScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // youtubeService, err := youtube.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // youtubeService, err := youtube.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package youtube // import "google.golang.org/api/youtube/v3"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "youtube:v3"
  71. const apiName = "youtube"
  72. const apiVersion = "v3"
  73. const basePath = "https://www.googleapis.com/youtube/v3/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // Manage your YouTube account
  77. YoutubeScope = "https://www.googleapis.com/auth/youtube"
  78. // See, edit, and permanently delete your YouTube videos, ratings,
  79. // comments and captions
  80. YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl"
  81. // View your YouTube account
  82. YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly"
  83. // Manage your YouTube videos
  84. YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload"
  85. // View and manage your assets and associated content on YouTube
  86. YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner"
  87. // View private information of your YouTube channel relevant during the
  88. // audit process with a YouTube partner
  89. YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit"
  90. )
  91. // NewService creates a new Service.
  92. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  93. scopesOption := option.WithScopes(
  94. "https://www.googleapis.com/auth/youtube",
  95. "https://www.googleapis.com/auth/youtube.force-ssl",
  96. "https://www.googleapis.com/auth/youtube.readonly",
  97. "https://www.googleapis.com/auth/youtube.upload",
  98. "https://www.googleapis.com/auth/youtubepartner",
  99. "https://www.googleapis.com/auth/youtubepartner-channel-audit",
  100. )
  101. // NOTE: prepend, so we don't override user-specified scopes.
  102. opts = append([]option.ClientOption{scopesOption}, opts...)
  103. client, endpoint, err := htransport.NewClient(ctx, opts...)
  104. if err != nil {
  105. return nil, err
  106. }
  107. s, err := New(client)
  108. if err != nil {
  109. return nil, err
  110. }
  111. if endpoint != "" {
  112. s.BasePath = endpoint
  113. }
  114. return s, nil
  115. }
  116. // New creates a new Service. It uses the provided http.Client for requests.
  117. //
  118. // Deprecated: please use NewService instead.
  119. // To provide a custom HTTP client, use option.WithHTTPClient.
  120. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  121. func New(client *http.Client) (*Service, error) {
  122. if client == nil {
  123. return nil, errors.New("client is nil")
  124. }
  125. s := &Service{client: client, BasePath: basePath}
  126. s.Activities = NewActivitiesService(s)
  127. s.Captions = NewCaptionsService(s)
  128. s.ChannelBanners = NewChannelBannersService(s)
  129. s.ChannelSections = NewChannelSectionsService(s)
  130. s.Channels = NewChannelsService(s)
  131. s.CommentThreads = NewCommentThreadsService(s)
  132. s.Comments = NewCommentsService(s)
  133. s.GuideCategories = NewGuideCategoriesService(s)
  134. s.I18nLanguages = NewI18nLanguagesService(s)
  135. s.I18nRegions = NewI18nRegionsService(s)
  136. s.LiveBroadcasts = NewLiveBroadcastsService(s)
  137. s.LiveChatBans = NewLiveChatBansService(s)
  138. s.LiveChatMessages = NewLiveChatMessagesService(s)
  139. s.LiveChatModerators = NewLiveChatModeratorsService(s)
  140. s.LiveStreams = NewLiveStreamsService(s)
  141. s.PlaylistItems = NewPlaylistItemsService(s)
  142. s.Playlists = NewPlaylistsService(s)
  143. s.Search = NewSearchService(s)
  144. s.Sponsors = NewSponsorsService(s)
  145. s.Subscriptions = NewSubscriptionsService(s)
  146. s.SuperChatEvents = NewSuperChatEventsService(s)
  147. s.Thumbnails = NewThumbnailsService(s)
  148. s.VideoAbuseReportReasons = NewVideoAbuseReportReasonsService(s)
  149. s.VideoCategories = NewVideoCategoriesService(s)
  150. s.Videos = NewVideosService(s)
  151. s.Watermarks = NewWatermarksService(s)
  152. return s, nil
  153. }
  154. type Service struct {
  155. client *http.Client
  156. BasePath string // API endpoint base URL
  157. UserAgent string // optional additional User-Agent fragment
  158. Activities *ActivitiesService
  159. Captions *CaptionsService
  160. ChannelBanners *ChannelBannersService
  161. ChannelSections *ChannelSectionsService
  162. Channels *ChannelsService
  163. CommentThreads *CommentThreadsService
  164. Comments *CommentsService
  165. GuideCategories *GuideCategoriesService
  166. I18nLanguages *I18nLanguagesService
  167. I18nRegions *I18nRegionsService
  168. LiveBroadcasts *LiveBroadcastsService
  169. LiveChatBans *LiveChatBansService
  170. LiveChatMessages *LiveChatMessagesService
  171. LiveChatModerators *LiveChatModeratorsService
  172. LiveStreams *LiveStreamsService
  173. PlaylistItems *PlaylistItemsService
  174. Playlists *PlaylistsService
  175. Search *SearchService
  176. Sponsors *SponsorsService
  177. Subscriptions *SubscriptionsService
  178. SuperChatEvents *SuperChatEventsService
  179. Thumbnails *ThumbnailsService
  180. VideoAbuseReportReasons *VideoAbuseReportReasonsService
  181. VideoCategories *VideoCategoriesService
  182. Videos *VideosService
  183. Watermarks *WatermarksService
  184. }
  185. func (s *Service) userAgent() string {
  186. if s.UserAgent == "" {
  187. return googleapi.UserAgent
  188. }
  189. return googleapi.UserAgent + " " + s.UserAgent
  190. }
  191. func NewActivitiesService(s *Service) *ActivitiesService {
  192. rs := &ActivitiesService{s: s}
  193. return rs
  194. }
  195. type ActivitiesService struct {
  196. s *Service
  197. }
  198. func NewCaptionsService(s *Service) *CaptionsService {
  199. rs := &CaptionsService{s: s}
  200. return rs
  201. }
  202. type CaptionsService struct {
  203. s *Service
  204. }
  205. func NewChannelBannersService(s *Service) *ChannelBannersService {
  206. rs := &ChannelBannersService{s: s}
  207. return rs
  208. }
  209. type ChannelBannersService struct {
  210. s *Service
  211. }
  212. func NewChannelSectionsService(s *Service) *ChannelSectionsService {
  213. rs := &ChannelSectionsService{s: s}
  214. return rs
  215. }
  216. type ChannelSectionsService struct {
  217. s *Service
  218. }
  219. func NewChannelsService(s *Service) *ChannelsService {
  220. rs := &ChannelsService{s: s}
  221. return rs
  222. }
  223. type ChannelsService struct {
  224. s *Service
  225. }
  226. func NewCommentThreadsService(s *Service) *CommentThreadsService {
  227. rs := &CommentThreadsService{s: s}
  228. return rs
  229. }
  230. type CommentThreadsService struct {
  231. s *Service
  232. }
  233. func NewCommentsService(s *Service) *CommentsService {
  234. rs := &CommentsService{s: s}
  235. return rs
  236. }
  237. type CommentsService struct {
  238. s *Service
  239. }
  240. func NewGuideCategoriesService(s *Service) *GuideCategoriesService {
  241. rs := &GuideCategoriesService{s: s}
  242. return rs
  243. }
  244. type GuideCategoriesService struct {
  245. s *Service
  246. }
  247. func NewI18nLanguagesService(s *Service) *I18nLanguagesService {
  248. rs := &I18nLanguagesService{s: s}
  249. return rs
  250. }
  251. type I18nLanguagesService struct {
  252. s *Service
  253. }
  254. func NewI18nRegionsService(s *Service) *I18nRegionsService {
  255. rs := &I18nRegionsService{s: s}
  256. return rs
  257. }
  258. type I18nRegionsService struct {
  259. s *Service
  260. }
  261. func NewLiveBroadcastsService(s *Service) *LiveBroadcastsService {
  262. rs := &LiveBroadcastsService{s: s}
  263. return rs
  264. }
  265. type LiveBroadcastsService struct {
  266. s *Service
  267. }
  268. func NewLiveChatBansService(s *Service) *LiveChatBansService {
  269. rs := &LiveChatBansService{s: s}
  270. return rs
  271. }
  272. type LiveChatBansService struct {
  273. s *Service
  274. }
  275. func NewLiveChatMessagesService(s *Service) *LiveChatMessagesService {
  276. rs := &LiveChatMessagesService{s: s}
  277. return rs
  278. }
  279. type LiveChatMessagesService struct {
  280. s *Service
  281. }
  282. func NewLiveChatModeratorsService(s *Service) *LiveChatModeratorsService {
  283. rs := &LiveChatModeratorsService{s: s}
  284. return rs
  285. }
  286. type LiveChatModeratorsService struct {
  287. s *Service
  288. }
  289. func NewLiveStreamsService(s *Service) *LiveStreamsService {
  290. rs := &LiveStreamsService{s: s}
  291. return rs
  292. }
  293. type LiveStreamsService struct {
  294. s *Service
  295. }
  296. func NewPlaylistItemsService(s *Service) *PlaylistItemsService {
  297. rs := &PlaylistItemsService{s: s}
  298. return rs
  299. }
  300. type PlaylistItemsService struct {
  301. s *Service
  302. }
  303. func NewPlaylistsService(s *Service) *PlaylistsService {
  304. rs := &PlaylistsService{s: s}
  305. return rs
  306. }
  307. type PlaylistsService struct {
  308. s *Service
  309. }
  310. func NewSearchService(s *Service) *SearchService {
  311. rs := &SearchService{s: s}
  312. return rs
  313. }
  314. type SearchService struct {
  315. s *Service
  316. }
  317. func NewSponsorsService(s *Service) *SponsorsService {
  318. rs := &SponsorsService{s: s}
  319. return rs
  320. }
  321. type SponsorsService struct {
  322. s *Service
  323. }
  324. func NewSubscriptionsService(s *Service) *SubscriptionsService {
  325. rs := &SubscriptionsService{s: s}
  326. return rs
  327. }
  328. type SubscriptionsService struct {
  329. s *Service
  330. }
  331. func NewSuperChatEventsService(s *Service) *SuperChatEventsService {
  332. rs := &SuperChatEventsService{s: s}
  333. return rs
  334. }
  335. type SuperChatEventsService struct {
  336. s *Service
  337. }
  338. func NewThumbnailsService(s *Service) *ThumbnailsService {
  339. rs := &ThumbnailsService{s: s}
  340. return rs
  341. }
  342. type ThumbnailsService struct {
  343. s *Service
  344. }
  345. func NewVideoAbuseReportReasonsService(s *Service) *VideoAbuseReportReasonsService {
  346. rs := &VideoAbuseReportReasonsService{s: s}
  347. return rs
  348. }
  349. type VideoAbuseReportReasonsService struct {
  350. s *Service
  351. }
  352. func NewVideoCategoriesService(s *Service) *VideoCategoriesService {
  353. rs := &VideoCategoriesService{s: s}
  354. return rs
  355. }
  356. type VideoCategoriesService struct {
  357. s *Service
  358. }
  359. func NewVideosService(s *Service) *VideosService {
  360. rs := &VideosService{s: s}
  361. return rs
  362. }
  363. type VideosService struct {
  364. s *Service
  365. }
  366. func NewWatermarksService(s *Service) *WatermarksService {
  367. rs := &WatermarksService{s: s}
  368. return rs
  369. }
  370. type WatermarksService struct {
  371. s *Service
  372. }
  373. // AccessPolicy: Rights management policy for YouTube resources.
  374. type AccessPolicy struct {
  375. // Allowed: The value of allowed indicates whether the access to the
  376. // policy is allowed or denied by default.
  377. Allowed bool `json:"allowed,omitempty"`
  378. // Exception: A list of region codes that identify countries where the
  379. // default policy do not apply.
  380. Exception []string `json:"exception,omitempty"`
  381. // ForceSendFields is a list of field names (e.g. "Allowed") to
  382. // unconditionally include in API requests. By default, fields with
  383. // empty values are omitted from API requests. However, any non-pointer,
  384. // non-interface field appearing in ForceSendFields will be sent to the
  385. // server regardless of whether the field is empty or not. This may be
  386. // used to include empty fields in Patch requests.
  387. ForceSendFields []string `json:"-"`
  388. // NullFields is a list of field names (e.g. "Allowed") to include in
  389. // API requests with the JSON null value. By default, fields with empty
  390. // values are omitted from API requests. However, any field with an
  391. // empty value appearing in NullFields will be sent to the server as
  392. // null. It is an error if a field in this list has a non-empty value.
  393. // This may be used to include null fields in Patch requests.
  394. NullFields []string `json:"-"`
  395. }
  396. func (s *AccessPolicy) MarshalJSON() ([]byte, error) {
  397. type NoMethod AccessPolicy
  398. raw := NoMethod(*s)
  399. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  400. }
  401. // Activity: An activity resource contains information about an action
  402. // that a particular channel, or user, has taken on YouTube.The actions
  403. // reported in activity feeds include rating a video, sharing a video,
  404. // marking a video as a favorite, commenting on a video, uploading a
  405. // video, and so forth. Each activity resource identifies the type of
  406. // action, the channel associated with the action, and the resource(s)
  407. // associated with the action, such as the video that was rated or
  408. // uploaded.
  409. type Activity struct {
  410. // ContentDetails: The contentDetails object contains information about
  411. // the content associated with the activity. For example, if the
  412. // snippet.type value is videoRated, then the contentDetails object's
  413. // content identifies the rated video.
  414. ContentDetails *ActivityContentDetails `json:"contentDetails,omitempty"`
  415. // Etag: Etag of this resource.
  416. Etag string `json:"etag,omitempty"`
  417. // Id: The ID that YouTube uses to uniquely identify the activity.
  418. Id string `json:"id,omitempty"`
  419. // Kind: Identifies what kind of resource this is. Value: the fixed
  420. // string "youtube#activity".
  421. Kind string `json:"kind,omitempty"`
  422. // Snippet: The snippet object contains basic details about the
  423. // activity, including the activity's type and group ID.
  424. Snippet *ActivitySnippet `json:"snippet,omitempty"`
  425. // ServerResponse contains the HTTP response code and headers from the
  426. // server.
  427. googleapi.ServerResponse `json:"-"`
  428. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  429. // unconditionally include in API requests. By default, fields with
  430. // empty values are omitted from API requests. However, any non-pointer,
  431. // non-interface field appearing in ForceSendFields will be sent to the
  432. // server regardless of whether the field is empty or not. This may be
  433. // used to include empty fields in Patch requests.
  434. ForceSendFields []string `json:"-"`
  435. // NullFields is a list of field names (e.g. "ContentDetails") to
  436. // include in API requests with the JSON null value. By default, fields
  437. // with empty values are omitted from API requests. However, any field
  438. // with an empty value appearing in NullFields will be sent to the
  439. // server as null. It is an error if a field in this list has a
  440. // non-empty value. This may be used to include null fields in Patch
  441. // requests.
  442. NullFields []string `json:"-"`
  443. }
  444. func (s *Activity) MarshalJSON() ([]byte, error) {
  445. type NoMethod Activity
  446. raw := NoMethod(*s)
  447. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  448. }
  449. // ActivityContentDetails: Details about the content of an activity: the
  450. // video that was shared, the channel that was subscribed to, etc.
  451. type ActivityContentDetails struct {
  452. // Bulletin: The bulletin object contains details about a channel
  453. // bulletin post. This object is only present if the snippet.type is
  454. // bulletin.
  455. Bulletin *ActivityContentDetailsBulletin `json:"bulletin,omitempty"`
  456. // ChannelItem: The channelItem object contains details about a resource
  457. // which was added to a channel. This property is only present if the
  458. // snippet.type is channelItem.
  459. ChannelItem *ActivityContentDetailsChannelItem `json:"channelItem,omitempty"`
  460. // Comment: The comment object contains information about a resource
  461. // that received a comment. This property is only present if the
  462. // snippet.type is comment.
  463. Comment *ActivityContentDetailsComment `json:"comment,omitempty"`
  464. // Favorite: The favorite object contains information about a video that
  465. // was marked as a favorite video. This property is only present if the
  466. // snippet.type is favorite.
  467. Favorite *ActivityContentDetailsFavorite `json:"favorite,omitempty"`
  468. // Like: The like object contains information about a resource that
  469. // received a positive (like) rating. This property is only present if
  470. // the snippet.type is like.
  471. Like *ActivityContentDetailsLike `json:"like,omitempty"`
  472. // PlaylistItem: The playlistItem object contains information about a
  473. // new playlist item. This property is only present if the snippet.type
  474. // is playlistItem.
  475. PlaylistItem *ActivityContentDetailsPlaylistItem `json:"playlistItem,omitempty"`
  476. // PromotedItem: The promotedItem object contains details about a
  477. // resource which is being promoted. This property is only present if
  478. // the snippet.type is promotedItem.
  479. PromotedItem *ActivityContentDetailsPromotedItem `json:"promotedItem,omitempty"`
  480. // Recommendation: The recommendation object contains information about
  481. // a recommended resource. This property is only present if the
  482. // snippet.type is recommendation.
  483. Recommendation *ActivityContentDetailsRecommendation `json:"recommendation,omitempty"`
  484. // Social: The social object contains details about a social network
  485. // post. This property is only present if the snippet.type is social.
  486. Social *ActivityContentDetailsSocial `json:"social,omitempty"`
  487. // Subscription: The subscription object contains information about a
  488. // channel that a user subscribed to. This property is only present if
  489. // the snippet.type is subscription.
  490. Subscription *ActivityContentDetailsSubscription `json:"subscription,omitempty"`
  491. // Upload: The upload object contains information about the uploaded
  492. // video. This property is only present if the snippet.type is upload.
  493. Upload *ActivityContentDetailsUpload `json:"upload,omitempty"`
  494. // ForceSendFields is a list of field names (e.g. "Bulletin") to
  495. // unconditionally include in API requests. By default, fields with
  496. // empty values are omitted from API requests. However, any non-pointer,
  497. // non-interface field appearing in ForceSendFields will be sent to the
  498. // server regardless of whether the field is empty or not. This may be
  499. // used to include empty fields in Patch requests.
  500. ForceSendFields []string `json:"-"`
  501. // NullFields is a list of field names (e.g. "Bulletin") to include in
  502. // API requests with the JSON null value. By default, fields with empty
  503. // values are omitted from API requests. However, any field with an
  504. // empty value appearing in NullFields will be sent to the server as
  505. // null. It is an error if a field in this list has a non-empty value.
  506. // This may be used to include null fields in Patch requests.
  507. NullFields []string `json:"-"`
  508. }
  509. func (s *ActivityContentDetails) MarshalJSON() ([]byte, error) {
  510. type NoMethod ActivityContentDetails
  511. raw := NoMethod(*s)
  512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  513. }
  514. // ActivityContentDetailsBulletin: Details about a channel bulletin
  515. // post.
  516. type ActivityContentDetailsBulletin struct {
  517. // ResourceId: The resourceId object contains information that
  518. // identifies the resource associated with a bulletin post.
  519. ResourceId *ResourceId `json:"resourceId,omitempty"`
  520. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  521. // unconditionally include in API requests. By default, fields with
  522. // empty values are omitted from API requests. However, any non-pointer,
  523. // non-interface field appearing in ForceSendFields will be sent to the
  524. // server regardless of whether the field is empty or not. This may be
  525. // used to include empty fields in Patch requests.
  526. ForceSendFields []string `json:"-"`
  527. // NullFields is a list of field names (e.g. "ResourceId") to include in
  528. // API requests with the JSON null value. By default, fields with empty
  529. // values are omitted from API requests. However, any field with an
  530. // empty value appearing in NullFields will be sent to the server as
  531. // null. It is an error if a field in this list has a non-empty value.
  532. // This may be used to include null fields in Patch requests.
  533. NullFields []string `json:"-"`
  534. }
  535. func (s *ActivityContentDetailsBulletin) MarshalJSON() ([]byte, error) {
  536. type NoMethod ActivityContentDetailsBulletin
  537. raw := NoMethod(*s)
  538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  539. }
  540. // ActivityContentDetailsChannelItem: Details about a resource which was
  541. // added to a channel.
  542. type ActivityContentDetailsChannelItem struct {
  543. // ResourceId: The resourceId object contains information that
  544. // identifies the resource that was added to the channel.
  545. ResourceId *ResourceId `json:"resourceId,omitempty"`
  546. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  547. // unconditionally include in API requests. By default, fields with
  548. // empty values are omitted from API requests. However, any non-pointer,
  549. // non-interface field appearing in ForceSendFields will be sent to the
  550. // server regardless of whether the field is empty or not. This may be
  551. // used to include empty fields in Patch requests.
  552. ForceSendFields []string `json:"-"`
  553. // NullFields is a list of field names (e.g. "ResourceId") to include in
  554. // API requests with the JSON null value. By default, fields with empty
  555. // values are omitted from API requests. However, any field with an
  556. // empty value appearing in NullFields will be sent to the server as
  557. // null. It is an error if a field in this list has a non-empty value.
  558. // This may be used to include null fields in Patch requests.
  559. NullFields []string `json:"-"`
  560. }
  561. func (s *ActivityContentDetailsChannelItem) MarshalJSON() ([]byte, error) {
  562. type NoMethod ActivityContentDetailsChannelItem
  563. raw := NoMethod(*s)
  564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  565. }
  566. // ActivityContentDetailsComment: Information about a resource that
  567. // received a comment.
  568. type ActivityContentDetailsComment struct {
  569. // ResourceId: The resourceId object contains information that
  570. // identifies the resource associated with the comment.
  571. ResourceId *ResourceId `json:"resourceId,omitempty"`
  572. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  573. // unconditionally include in API requests. By default, fields with
  574. // empty values are omitted from API requests. However, any non-pointer,
  575. // non-interface field appearing in ForceSendFields will be sent to the
  576. // server regardless of whether the field is empty or not. This may be
  577. // used to include empty fields in Patch requests.
  578. ForceSendFields []string `json:"-"`
  579. // NullFields is a list of field names (e.g. "ResourceId") to include in
  580. // API requests with the JSON null value. By default, fields with empty
  581. // values are omitted from API requests. However, any field with an
  582. // empty value appearing in NullFields will be sent to the server as
  583. // null. It is an error if a field in this list has a non-empty value.
  584. // This may be used to include null fields in Patch requests.
  585. NullFields []string `json:"-"`
  586. }
  587. func (s *ActivityContentDetailsComment) MarshalJSON() ([]byte, error) {
  588. type NoMethod ActivityContentDetailsComment
  589. raw := NoMethod(*s)
  590. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  591. }
  592. // ActivityContentDetailsFavorite: Information about a video that was
  593. // marked as a favorite video.
  594. type ActivityContentDetailsFavorite struct {
  595. // ResourceId: The resourceId object contains information that
  596. // identifies the resource that was marked as a favorite.
  597. ResourceId *ResourceId `json:"resourceId,omitempty"`
  598. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  599. // unconditionally include in API requests. By default, fields with
  600. // empty values are omitted from API requests. However, any non-pointer,
  601. // non-interface field appearing in ForceSendFields will be sent to the
  602. // server regardless of whether the field is empty or not. This may be
  603. // used to include empty fields in Patch requests.
  604. ForceSendFields []string `json:"-"`
  605. // NullFields is a list of field names (e.g. "ResourceId") to include in
  606. // API requests with the JSON null value. By default, fields with empty
  607. // values are omitted from API requests. However, any field with an
  608. // empty value appearing in NullFields will be sent to the server as
  609. // null. It is an error if a field in this list has a non-empty value.
  610. // This may be used to include null fields in Patch requests.
  611. NullFields []string `json:"-"`
  612. }
  613. func (s *ActivityContentDetailsFavorite) MarshalJSON() ([]byte, error) {
  614. type NoMethod ActivityContentDetailsFavorite
  615. raw := NoMethod(*s)
  616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  617. }
  618. // ActivityContentDetailsLike: Information about a resource that
  619. // received a positive (like) rating.
  620. type ActivityContentDetailsLike struct {
  621. // ResourceId: The resourceId object contains information that
  622. // identifies the rated resource.
  623. ResourceId *ResourceId `json:"resourceId,omitempty"`
  624. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  625. // unconditionally include in API requests. By default, fields with
  626. // empty values are omitted from API requests. However, any non-pointer,
  627. // non-interface field appearing in ForceSendFields will be sent to the
  628. // server regardless of whether the field is empty or not. This may be
  629. // used to include empty fields in Patch requests.
  630. ForceSendFields []string `json:"-"`
  631. // NullFields is a list of field names (e.g. "ResourceId") to include in
  632. // API requests with the JSON null value. By default, fields with empty
  633. // values are omitted from API requests. However, any field with an
  634. // empty value appearing in NullFields will be sent to the server as
  635. // null. It is an error if a field in this list has a non-empty value.
  636. // This may be used to include null fields in Patch requests.
  637. NullFields []string `json:"-"`
  638. }
  639. func (s *ActivityContentDetailsLike) MarshalJSON() ([]byte, error) {
  640. type NoMethod ActivityContentDetailsLike
  641. raw := NoMethod(*s)
  642. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  643. }
  644. // ActivityContentDetailsPlaylistItem: Information about a new playlist
  645. // item.
  646. type ActivityContentDetailsPlaylistItem struct {
  647. // PlaylistId: The value that YouTube uses to uniquely identify the
  648. // playlist.
  649. PlaylistId string `json:"playlistId,omitempty"`
  650. // PlaylistItemId: ID of the item within the playlist.
  651. PlaylistItemId string `json:"playlistItemId,omitempty"`
  652. // ResourceId: The resourceId object contains information about the
  653. // resource that was added to the playlist.
  654. ResourceId *ResourceId `json:"resourceId,omitempty"`
  655. // ForceSendFields is a list of field names (e.g. "PlaylistId") to
  656. // unconditionally include in API requests. By default, fields with
  657. // empty values are omitted from API requests. However, any non-pointer,
  658. // non-interface field appearing in ForceSendFields will be sent to the
  659. // server regardless of whether the field is empty or not. This may be
  660. // used to include empty fields in Patch requests.
  661. ForceSendFields []string `json:"-"`
  662. // NullFields is a list of field names (e.g. "PlaylistId") to include in
  663. // API requests with the JSON null value. By default, fields with empty
  664. // values are omitted from API requests. However, any field with an
  665. // empty value appearing in NullFields will be sent to the server as
  666. // null. It is an error if a field in this list has a non-empty value.
  667. // This may be used to include null fields in Patch requests.
  668. NullFields []string `json:"-"`
  669. }
  670. func (s *ActivityContentDetailsPlaylistItem) MarshalJSON() ([]byte, error) {
  671. type NoMethod ActivityContentDetailsPlaylistItem
  672. raw := NoMethod(*s)
  673. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  674. }
  675. // ActivityContentDetailsPromotedItem: Details about a resource which is
  676. // being promoted.
  677. type ActivityContentDetailsPromotedItem struct {
  678. // AdTag: The URL the client should fetch to request a promoted item.
  679. AdTag string `json:"adTag,omitempty"`
  680. // ClickTrackingUrl: The URL the client should ping to indicate that the
  681. // user clicked through on this promoted item.
  682. ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
  683. // CreativeViewUrl: The URL the client should ping to indicate that the
  684. // user was shown this promoted item.
  685. CreativeViewUrl string `json:"creativeViewUrl,omitempty"`
  686. // CtaType: The type of call-to-action, a message to the user indicating
  687. // action that can be taken.
  688. //
  689. // Possible values:
  690. // "unspecified"
  691. // "visitAdvertiserSite"
  692. CtaType string `json:"ctaType,omitempty"`
  693. // CustomCtaButtonText: The custom call-to-action button text. If
  694. // specified, it will override the default button text for the cta_type.
  695. CustomCtaButtonText string `json:"customCtaButtonText,omitempty"`
  696. // DescriptionText: The text description to accompany the promoted item.
  697. DescriptionText string `json:"descriptionText,omitempty"`
  698. // DestinationUrl: The URL the client should direct the user to, if the
  699. // user chooses to visit the advertiser's website.
  700. DestinationUrl string `json:"destinationUrl,omitempty"`
  701. // ForecastingUrl: The list of forecasting URLs. The client should ping
  702. // all of these URLs when a promoted item is not available, to indicate
  703. // that a promoted item could have been shown.
  704. ForecastingUrl []string `json:"forecastingUrl,omitempty"`
  705. // ImpressionUrl: The list of impression URLs. The client should ping
  706. // all of these URLs to indicate that the user was shown this promoted
  707. // item.
  708. ImpressionUrl []string `json:"impressionUrl,omitempty"`
  709. // VideoId: The ID that YouTube uses to uniquely identify the promoted
  710. // video.
  711. VideoId string `json:"videoId,omitempty"`
  712. // ForceSendFields is a list of field names (e.g. "AdTag") to
  713. // unconditionally include in API requests. By default, fields with
  714. // empty values are omitted from API requests. However, any non-pointer,
  715. // non-interface field appearing in ForceSendFields will be sent to the
  716. // server regardless of whether the field is empty or not. This may be
  717. // used to include empty fields in Patch requests.
  718. ForceSendFields []string `json:"-"`
  719. // NullFields is a list of field names (e.g. "AdTag") to include in API
  720. // requests with the JSON null value. By default, fields with empty
  721. // values are omitted from API requests. However, any field with an
  722. // empty value appearing in NullFields will be sent to the server as
  723. // null. It is an error if a field in this list has a non-empty value.
  724. // This may be used to include null fields in Patch requests.
  725. NullFields []string `json:"-"`
  726. }
  727. func (s *ActivityContentDetailsPromotedItem) MarshalJSON() ([]byte, error) {
  728. type NoMethod ActivityContentDetailsPromotedItem
  729. raw := NoMethod(*s)
  730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  731. }
  732. // ActivityContentDetailsRecommendation: Information that identifies the
  733. // recommended resource.
  734. type ActivityContentDetailsRecommendation struct {
  735. // Reason: The reason that the resource is recommended to the user.
  736. //
  737. // Possible values:
  738. // "unspecified"
  739. // "videoFavorited"
  740. // "videoLiked"
  741. // "videoWatched"
  742. Reason string `json:"reason,omitempty"`
  743. // ResourceId: The resourceId object contains information that
  744. // identifies the recommended resource.
  745. ResourceId *ResourceId `json:"resourceId,omitempty"`
  746. // SeedResourceId: The seedResourceId object contains information about
  747. // the resource that caused the recommendation.
  748. SeedResourceId *ResourceId `json:"seedResourceId,omitempty"`
  749. // ForceSendFields is a list of field names (e.g. "Reason") to
  750. // unconditionally include in API requests. By default, fields with
  751. // empty values are omitted from API requests. However, any non-pointer,
  752. // non-interface field appearing in ForceSendFields will be sent to the
  753. // server regardless of whether the field is empty or not. This may be
  754. // used to include empty fields in Patch requests.
  755. ForceSendFields []string `json:"-"`
  756. // NullFields is a list of field names (e.g. "Reason") to include in API
  757. // requests with the JSON null value. By default, fields with empty
  758. // values are omitted from API requests. However, any field with an
  759. // empty value appearing in NullFields will be sent to the server as
  760. // null. It is an error if a field in this list has a non-empty value.
  761. // This may be used to include null fields in Patch requests.
  762. NullFields []string `json:"-"`
  763. }
  764. func (s *ActivityContentDetailsRecommendation) MarshalJSON() ([]byte, error) {
  765. type NoMethod ActivityContentDetailsRecommendation
  766. raw := NoMethod(*s)
  767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  768. }
  769. // ActivityContentDetailsSocial: Details about a social network post.
  770. type ActivityContentDetailsSocial struct {
  771. // Author: The author of the social network post.
  772. Author string `json:"author,omitempty"`
  773. // ImageUrl: An image of the post's author.
  774. ImageUrl string `json:"imageUrl,omitempty"`
  775. // ReferenceUrl: The URL of the social network post.
  776. ReferenceUrl string `json:"referenceUrl,omitempty"`
  777. // ResourceId: The resourceId object encapsulates information that
  778. // identifies the resource associated with a social network post.
  779. ResourceId *ResourceId `json:"resourceId,omitempty"`
  780. // Type: The name of the social network.
  781. //
  782. // Possible values:
  783. // "facebook"
  784. // "googlePlus"
  785. // "twitter"
  786. // "unspecified"
  787. Type string `json:"type,omitempty"`
  788. // ForceSendFields is a list of field names (e.g. "Author") to
  789. // unconditionally include in API requests. By default, fields with
  790. // empty values are omitted from API requests. However, any non-pointer,
  791. // non-interface field appearing in ForceSendFields will be sent to the
  792. // server regardless of whether the field is empty or not. This may be
  793. // used to include empty fields in Patch requests.
  794. ForceSendFields []string `json:"-"`
  795. // NullFields is a list of field names (e.g. "Author") to include in API
  796. // requests with the JSON null value. By default, fields with empty
  797. // values are omitted from API requests. However, any field with an
  798. // empty value appearing in NullFields will be sent to the server as
  799. // null. It is an error if a field in this list has a non-empty value.
  800. // This may be used to include null fields in Patch requests.
  801. NullFields []string `json:"-"`
  802. }
  803. func (s *ActivityContentDetailsSocial) MarshalJSON() ([]byte, error) {
  804. type NoMethod ActivityContentDetailsSocial
  805. raw := NoMethod(*s)
  806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  807. }
  808. // ActivityContentDetailsSubscription: Information about a channel that
  809. // a user subscribed to.
  810. type ActivityContentDetailsSubscription struct {
  811. // ResourceId: The resourceId object contains information that
  812. // identifies the resource that the user subscribed to.
  813. ResourceId *ResourceId `json:"resourceId,omitempty"`
  814. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  815. // unconditionally include in API requests. By default, fields with
  816. // empty values are omitted from API requests. However, any non-pointer,
  817. // non-interface field appearing in ForceSendFields will be sent to the
  818. // server regardless of whether the field is empty or not. This may be
  819. // used to include empty fields in Patch requests.
  820. ForceSendFields []string `json:"-"`
  821. // NullFields is a list of field names (e.g. "ResourceId") to include in
  822. // API requests with the JSON null value. By default, fields with empty
  823. // values are omitted from API requests. However, any field with an
  824. // empty value appearing in NullFields will be sent to the server as
  825. // null. It is an error if a field in this list has a non-empty value.
  826. // This may be used to include null fields in Patch requests.
  827. NullFields []string `json:"-"`
  828. }
  829. func (s *ActivityContentDetailsSubscription) MarshalJSON() ([]byte, error) {
  830. type NoMethod ActivityContentDetailsSubscription
  831. raw := NoMethod(*s)
  832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  833. }
  834. // ActivityContentDetailsUpload: Information about the uploaded video.
  835. type ActivityContentDetailsUpload struct {
  836. // VideoId: The ID that YouTube uses to uniquely identify the uploaded
  837. // video.
  838. VideoId string `json:"videoId,omitempty"`
  839. // ForceSendFields is a list of field names (e.g. "VideoId") to
  840. // unconditionally include in API requests. By default, fields with
  841. // empty values are omitted from API requests. However, any non-pointer,
  842. // non-interface field appearing in ForceSendFields will be sent to the
  843. // server regardless of whether the field is empty or not. This may be
  844. // used to include empty fields in Patch requests.
  845. ForceSendFields []string `json:"-"`
  846. // NullFields is a list of field names (e.g. "VideoId") to include in
  847. // API requests with the JSON null value. By default, fields with empty
  848. // values are omitted from API requests. However, any field with an
  849. // empty value appearing in NullFields will be sent to the server as
  850. // null. It is an error if a field in this list has a non-empty value.
  851. // This may be used to include null fields in Patch requests.
  852. NullFields []string `json:"-"`
  853. }
  854. func (s *ActivityContentDetailsUpload) MarshalJSON() ([]byte, error) {
  855. type NoMethod ActivityContentDetailsUpload
  856. raw := NoMethod(*s)
  857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  858. }
  859. type ActivityListResponse struct {
  860. // Etag: Etag of this resource.
  861. Etag string `json:"etag,omitempty"`
  862. // EventId: Serialized EventId of the request which produced this
  863. // response.
  864. EventId string `json:"eventId,omitempty"`
  865. // Items: A list of activities, or events, that match the request
  866. // criteria.
  867. Items []*Activity `json:"items,omitempty"`
  868. // Kind: Identifies what kind of resource this is. Value: the fixed
  869. // string "youtube#activityListResponse".
  870. Kind string `json:"kind,omitempty"`
  871. // NextPageToken: The token that can be used as the value of the
  872. // pageToken parameter to retrieve the next page in the result set.
  873. NextPageToken string `json:"nextPageToken,omitempty"`
  874. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  875. // PrevPageToken: The token that can be used as the value of the
  876. // pageToken parameter to retrieve the previous page in the result set.
  877. PrevPageToken string `json:"prevPageToken,omitempty"`
  878. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  879. // VisitorId: The visitorId identifies the visitor.
  880. VisitorId string `json:"visitorId,omitempty"`
  881. // ServerResponse contains the HTTP response code and headers from the
  882. // server.
  883. googleapi.ServerResponse `json:"-"`
  884. // ForceSendFields is a list of field names (e.g. "Etag") to
  885. // unconditionally include in API requests. By default, fields with
  886. // empty values are omitted from API requests. However, any non-pointer,
  887. // non-interface field appearing in ForceSendFields will be sent to the
  888. // server regardless of whether the field is empty or not. This may be
  889. // used to include empty fields in Patch requests.
  890. ForceSendFields []string `json:"-"`
  891. // NullFields is a list of field names (e.g. "Etag") to include in API
  892. // requests with the JSON null value. By default, fields with empty
  893. // values are omitted from API requests. However, any field with an
  894. // empty value appearing in NullFields will be sent to the server as
  895. // null. It is an error if a field in this list has a non-empty value.
  896. // This may be used to include null fields in Patch requests.
  897. NullFields []string `json:"-"`
  898. }
  899. func (s *ActivityListResponse) MarshalJSON() ([]byte, error) {
  900. type NoMethod ActivityListResponse
  901. raw := NoMethod(*s)
  902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  903. }
  904. // ActivitySnippet: Basic details about an activity, including title,
  905. // description, thumbnails, activity type and group.
  906. type ActivitySnippet struct {
  907. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  908. // associated with the activity.
  909. ChannelId string `json:"channelId,omitempty"`
  910. // ChannelTitle: Channel title for the channel responsible for this
  911. // activity
  912. ChannelTitle string `json:"channelTitle,omitempty"`
  913. // Description: The description of the resource primarily associated
  914. // with the activity.
  915. Description string `json:"description,omitempty"`
  916. // GroupId: The group ID associated with the activity. A group ID
  917. // identifies user events that are associated with the same user and
  918. // resource. For example, if a user rates a video and marks the same
  919. // video as a favorite, the entries for those events would have the same
  920. // group ID in the user's activity feed. In your user interface, you can
  921. // avoid repetition by grouping events with the same groupId value.
  922. GroupId string `json:"groupId,omitempty"`
  923. // PublishedAt: The date and time that the video was uploaded. The value
  924. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  925. PublishedAt string `json:"publishedAt,omitempty"`
  926. // Thumbnails: A map of thumbnail images associated with the resource
  927. // that is primarily associated with the activity. For each object in
  928. // the map, the key is the name of the thumbnail image, and the value is
  929. // an object that contains other information about the thumbnail.
  930. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  931. // Title: The title of the resource primarily associated with the
  932. // activity.
  933. Title string `json:"title,omitempty"`
  934. // Type: The type of activity that the resource describes.
  935. //
  936. // Possible values:
  937. // "bulletin"
  938. // "channelItem"
  939. // "comment"
  940. // "favorite"
  941. // "like"
  942. // "playlistItem"
  943. // "promotedItem"
  944. // "recommendation"
  945. // "social"
  946. // "subscription"
  947. // "upload"
  948. Type string `json:"type,omitempty"`
  949. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  950. // unconditionally include in API requests. By default, fields with
  951. // empty values are omitted from API requests. However, any non-pointer,
  952. // non-interface field appearing in ForceSendFields will be sent to the
  953. // server regardless of whether the field is empty or not. This may be
  954. // used to include empty fields in Patch requests.
  955. ForceSendFields []string `json:"-"`
  956. // NullFields is a list of field names (e.g. "ChannelId") to include in
  957. // API requests with the JSON null value. By default, fields with empty
  958. // values are omitted from API requests. However, any field with an
  959. // empty value appearing in NullFields will be sent to the server as
  960. // null. It is an error if a field in this list has a non-empty value.
  961. // This may be used to include null fields in Patch requests.
  962. NullFields []string `json:"-"`
  963. }
  964. func (s *ActivitySnippet) MarshalJSON() ([]byte, error) {
  965. type NoMethod ActivitySnippet
  966. raw := NoMethod(*s)
  967. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  968. }
  969. // Caption: A caption resource represents a YouTube caption track. A
  970. // caption track is associated with exactly one YouTube video.
  971. type Caption struct {
  972. // Etag: Etag of this resource.
  973. Etag string `json:"etag,omitempty"`
  974. // Id: The ID that YouTube uses to uniquely identify the caption track.
  975. Id string `json:"id,omitempty"`
  976. // Kind: Identifies what kind of resource this is. Value: the fixed
  977. // string "youtube#caption".
  978. Kind string `json:"kind,omitempty"`
  979. // Snippet: The snippet object contains basic details about the caption.
  980. Snippet *CaptionSnippet `json:"snippet,omitempty"`
  981. // ServerResponse contains the HTTP response code and headers from the
  982. // server.
  983. googleapi.ServerResponse `json:"-"`
  984. // ForceSendFields is a list of field names (e.g. "Etag") to
  985. // unconditionally include in API requests. By default, fields with
  986. // empty values are omitted from API requests. However, any non-pointer,
  987. // non-interface field appearing in ForceSendFields will be sent to the
  988. // server regardless of whether the field is empty or not. This may be
  989. // used to include empty fields in Patch requests.
  990. ForceSendFields []string `json:"-"`
  991. // NullFields is a list of field names (e.g. "Etag") to include in API
  992. // requests with the JSON null value. By default, fields with empty
  993. // values are omitted from API requests. However, any field with an
  994. // empty value appearing in NullFields will be sent to the server as
  995. // null. It is an error if a field in this list has a non-empty value.
  996. // This may be used to include null fields in Patch requests.
  997. NullFields []string `json:"-"`
  998. }
  999. func (s *Caption) MarshalJSON() ([]byte, error) {
  1000. type NoMethod Caption
  1001. raw := NoMethod(*s)
  1002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1003. }
  1004. type CaptionListResponse struct {
  1005. // Etag: Etag of this resource.
  1006. Etag string `json:"etag,omitempty"`
  1007. // EventId: Serialized EventId of the request which produced this
  1008. // response.
  1009. EventId string `json:"eventId,omitempty"`
  1010. // Items: A list of captions that match the request criteria.
  1011. Items []*Caption `json:"items,omitempty"`
  1012. // Kind: Identifies what kind of resource this is. Value: the fixed
  1013. // string "youtube#captionListResponse".
  1014. Kind string `json:"kind,omitempty"`
  1015. // VisitorId: The visitorId identifies the visitor.
  1016. VisitorId string `json:"visitorId,omitempty"`
  1017. // ServerResponse contains the HTTP response code and headers from the
  1018. // server.
  1019. googleapi.ServerResponse `json:"-"`
  1020. // ForceSendFields is a list of field names (e.g. "Etag") to
  1021. // unconditionally include in API requests. By default, fields with
  1022. // empty values are omitted from API requests. However, any non-pointer,
  1023. // non-interface field appearing in ForceSendFields will be sent to the
  1024. // server regardless of whether the field is empty or not. This may be
  1025. // used to include empty fields in Patch requests.
  1026. ForceSendFields []string `json:"-"`
  1027. // NullFields is a list of field names (e.g. "Etag") to include in API
  1028. // requests with the JSON null value. By default, fields with empty
  1029. // values are omitted from API requests. However, any field with an
  1030. // empty value appearing in NullFields will be sent to the server as
  1031. // null. It is an error if a field in this list has a non-empty value.
  1032. // This may be used to include null fields in Patch requests.
  1033. NullFields []string `json:"-"`
  1034. }
  1035. func (s *CaptionListResponse) MarshalJSON() ([]byte, error) {
  1036. type NoMethod CaptionListResponse
  1037. raw := NoMethod(*s)
  1038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1039. }
  1040. // CaptionSnippet: Basic details about a caption track, such as its
  1041. // language and name.
  1042. type CaptionSnippet struct {
  1043. // AudioTrackType: The type of audio track associated with the caption
  1044. // track.
  1045. //
  1046. // Possible values:
  1047. // "commentary"
  1048. // "descriptive"
  1049. // "primary"
  1050. // "unknown"
  1051. AudioTrackType string `json:"audioTrackType,omitempty"`
  1052. // FailureReason: The reason that YouTube failed to process the caption
  1053. // track. This property is only present if the state property's value is
  1054. // failed.
  1055. //
  1056. // Possible values:
  1057. // "processingFailed"
  1058. // "unknownFormat"
  1059. // "unsupportedFormat"
  1060. FailureReason string `json:"failureReason,omitempty"`
  1061. // IsAutoSynced: Indicates whether YouTube synchronized the caption
  1062. // track to the audio track in the video. The value will be true if a
  1063. // sync was explicitly requested when the caption track was uploaded.
  1064. // For example, when calling the captions.insert or captions.update
  1065. // methods, you can set the sync parameter to true to instruct YouTube
  1066. // to sync the uploaded track to the video. If the value is false,
  1067. // YouTube uses the time codes in the uploaded caption track to
  1068. // determine when to display captions.
  1069. IsAutoSynced bool `json:"isAutoSynced,omitempty"`
  1070. // IsCC: Indicates whether the track contains closed captions for the
  1071. // deaf and hard of hearing. The default value is false.
  1072. IsCC bool `json:"isCC,omitempty"`
  1073. // IsDraft: Indicates whether the caption track is a draft. If the value
  1074. // is true, then the track is not publicly visible. The default value is
  1075. // false.
  1076. IsDraft bool `json:"isDraft,omitempty"`
  1077. // IsEasyReader: Indicates whether caption track is formatted for "easy
  1078. // reader," meaning it is at a third-grade level for language learners.
  1079. // The default value is false.
  1080. IsEasyReader bool `json:"isEasyReader,omitempty"`
  1081. // IsLarge: Indicates whether the caption track uses large text for the
  1082. // vision-impaired. The default value is false.
  1083. IsLarge bool `json:"isLarge,omitempty"`
  1084. // Language: The language of the caption track. The property value is a
  1085. // BCP-47 language tag.
  1086. Language string `json:"language,omitempty"`
  1087. // LastUpdated: The date and time when the caption track was last
  1088. // updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  1089. // format.
  1090. LastUpdated string `json:"lastUpdated,omitempty"`
  1091. // Name: The name of the caption track. The name is intended to be
  1092. // visible to the user as an option during playback.
  1093. Name string `json:"name,omitempty"`
  1094. // Status: The caption track's status.
  1095. //
  1096. // Possible values:
  1097. // "failed"
  1098. // "serving"
  1099. // "syncing"
  1100. Status string `json:"status,omitempty"`
  1101. // TrackKind: The caption track's type.
  1102. //
  1103. // Possible values:
  1104. // "ASR"
  1105. // "forced"
  1106. // "standard"
  1107. TrackKind string `json:"trackKind,omitempty"`
  1108. // VideoId: The ID that YouTube uses to uniquely identify the video
  1109. // associated with the caption track.
  1110. VideoId string `json:"videoId,omitempty"`
  1111. // ForceSendFields is a list of field names (e.g. "AudioTrackType") to
  1112. // unconditionally include in API requests. By default, fields with
  1113. // empty values are omitted from API requests. However, any non-pointer,
  1114. // non-interface field appearing in ForceSendFields will be sent to the
  1115. // server regardless of whether the field is empty or not. This may be
  1116. // used to include empty fields in Patch requests.
  1117. ForceSendFields []string `json:"-"`
  1118. // NullFields is a list of field names (e.g. "AudioTrackType") to
  1119. // include in API requests with the JSON null value. By default, fields
  1120. // with empty values are omitted from API requests. However, any field
  1121. // with an empty value appearing in NullFields will be sent to the
  1122. // server as null. It is an error if a field in this list has a
  1123. // non-empty value. This may be used to include null fields in Patch
  1124. // requests.
  1125. NullFields []string `json:"-"`
  1126. }
  1127. func (s *CaptionSnippet) MarshalJSON() ([]byte, error) {
  1128. type NoMethod CaptionSnippet
  1129. raw := NoMethod(*s)
  1130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1131. }
  1132. // CdnSettings: Brief description of the live stream cdn settings.
  1133. type CdnSettings struct {
  1134. // Format: The format of the video stream that you are sending to
  1135. // Youtube.
  1136. Format string `json:"format,omitempty"`
  1137. // FrameRate: The frame rate of the inbound video data.
  1138. //
  1139. // Possible values:
  1140. // "30fps"
  1141. // "60fps"
  1142. // "variable"
  1143. FrameRate string `json:"frameRate,omitempty"`
  1144. // IngestionInfo: The ingestionInfo object contains information that
  1145. // YouTube provides that you need to transmit your RTMP or HTTP stream
  1146. // to YouTube.
  1147. IngestionInfo *IngestionInfo `json:"ingestionInfo,omitempty"`
  1148. // IngestionType: The method or protocol used to transmit the video
  1149. // stream.
  1150. //
  1151. // Possible values:
  1152. // "dash"
  1153. // "http"
  1154. // "rtmp"
  1155. // "webrtc"
  1156. IngestionType string `json:"ingestionType,omitempty"`
  1157. // Resolution: The resolution of the inbound video data.
  1158. //
  1159. // Possible values:
  1160. // "1080p"
  1161. // "1440p"
  1162. // "2160p"
  1163. // "240p"
  1164. // "360p"
  1165. // "480p"
  1166. // "720p"
  1167. // "variable"
  1168. Resolution string `json:"resolution,omitempty"`
  1169. // ForceSendFields is a list of field names (e.g. "Format") to
  1170. // unconditionally include in API requests. By default, fields with
  1171. // empty values are omitted from API requests. However, any non-pointer,
  1172. // non-interface field appearing in ForceSendFields will be sent to the
  1173. // server regardless of whether the field is empty or not. This may be
  1174. // used to include empty fields in Patch requests.
  1175. ForceSendFields []string `json:"-"`
  1176. // NullFields is a list of field names (e.g. "Format") to include in API
  1177. // requests with the JSON null value. By default, fields with empty
  1178. // values are omitted from API requests. However, any field with an
  1179. // empty value appearing in NullFields will be sent to the server as
  1180. // null. It is an error if a field in this list has a non-empty value.
  1181. // This may be used to include null fields in Patch requests.
  1182. NullFields []string `json:"-"`
  1183. }
  1184. func (s *CdnSettings) MarshalJSON() ([]byte, error) {
  1185. type NoMethod CdnSettings
  1186. raw := NoMethod(*s)
  1187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1188. }
  1189. // Channel: A channel resource contains information about a YouTube
  1190. // channel.
  1191. type Channel struct {
  1192. // AuditDetails: The auditionDetails object encapsulates channel data
  1193. // that is relevant for YouTube Partners during the audition process.
  1194. AuditDetails *ChannelAuditDetails `json:"auditDetails,omitempty"`
  1195. // BrandingSettings: The brandingSettings object encapsulates
  1196. // information about the branding of the channel.
  1197. BrandingSettings *ChannelBrandingSettings `json:"brandingSettings,omitempty"`
  1198. // ContentDetails: The contentDetails object encapsulates information
  1199. // about the channel's content.
  1200. ContentDetails *ChannelContentDetails `json:"contentDetails,omitempty"`
  1201. // ContentOwnerDetails: The contentOwnerDetails object encapsulates
  1202. // channel data that is relevant for YouTube Partners linked with the
  1203. // channel.
  1204. ContentOwnerDetails *ChannelContentOwnerDetails `json:"contentOwnerDetails,omitempty"`
  1205. // ConversionPings: The conversionPings object encapsulates information
  1206. // about conversion pings that need to be respected by the channel.
  1207. ConversionPings *ChannelConversionPings `json:"conversionPings,omitempty"`
  1208. // Etag: Etag of this resource.
  1209. Etag string `json:"etag,omitempty"`
  1210. // Id: The ID that YouTube uses to uniquely identify the channel.
  1211. Id string `json:"id,omitempty"`
  1212. // InvideoPromotion: The invideoPromotion object encapsulates
  1213. // information about promotion campaign associated with the channel.
  1214. InvideoPromotion *InvideoPromotion `json:"invideoPromotion,omitempty"`
  1215. // Kind: Identifies what kind of resource this is. Value: the fixed
  1216. // string "youtube#channel".
  1217. Kind string `json:"kind,omitempty"`
  1218. // Localizations: Localizations for different languages
  1219. Localizations map[string]ChannelLocalization `json:"localizations,omitempty"`
  1220. // Snippet: The snippet object contains basic details about the channel,
  1221. // such as its title, description, and thumbnail images.
  1222. Snippet *ChannelSnippet `json:"snippet,omitempty"`
  1223. // Statistics: The statistics object encapsulates statistics for the
  1224. // channel.
  1225. Statistics *ChannelStatistics `json:"statistics,omitempty"`
  1226. // Status: The status object encapsulates information about the privacy
  1227. // status of the channel.
  1228. Status *ChannelStatus `json:"status,omitempty"`
  1229. // TopicDetails: The topicDetails object encapsulates information about
  1230. // Freebase topics associated with the channel.
  1231. TopicDetails *ChannelTopicDetails `json:"topicDetails,omitempty"`
  1232. // ServerResponse contains the HTTP response code and headers from the
  1233. // server.
  1234. googleapi.ServerResponse `json:"-"`
  1235. // ForceSendFields is a list of field names (e.g. "AuditDetails") to
  1236. // unconditionally include in API requests. By default, fields with
  1237. // empty values are omitted from API requests. However, any non-pointer,
  1238. // non-interface field appearing in ForceSendFields will be sent to the
  1239. // server regardless of whether the field is empty or not. This may be
  1240. // used to include empty fields in Patch requests.
  1241. ForceSendFields []string `json:"-"`
  1242. // NullFields is a list of field names (e.g. "AuditDetails") to include
  1243. // in API requests with the JSON null value. By default, fields with
  1244. // empty values are omitted from API requests. However, any field with
  1245. // an empty value appearing in NullFields will be sent to the server as
  1246. // null. It is an error if a field in this list has a non-empty value.
  1247. // This may be used to include null fields in Patch requests.
  1248. NullFields []string `json:"-"`
  1249. }
  1250. func (s *Channel) MarshalJSON() ([]byte, error) {
  1251. type NoMethod Channel
  1252. raw := NoMethod(*s)
  1253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1254. }
  1255. // ChannelAuditDetails: The auditDetails object encapsulates channel
  1256. // data that is relevant for YouTube Partners during the audit process.
  1257. type ChannelAuditDetails struct {
  1258. // CommunityGuidelinesGoodStanding: Whether or not the channel respects
  1259. // the community guidelines.
  1260. CommunityGuidelinesGoodStanding bool `json:"communityGuidelinesGoodStanding,omitempty"`
  1261. // ContentIdClaimsGoodStanding: Whether or not the channel has any
  1262. // unresolved claims.
  1263. ContentIdClaimsGoodStanding bool `json:"contentIdClaimsGoodStanding,omitempty"`
  1264. // CopyrightStrikesGoodStanding: Whether or not the channel has any
  1265. // copyright strikes.
  1266. CopyrightStrikesGoodStanding bool `json:"copyrightStrikesGoodStanding,omitempty"`
  1267. // ForceSendFields is a list of field names (e.g.
  1268. // "CommunityGuidelinesGoodStanding") to unconditionally include in API
  1269. // requests. By default, fields with empty values are omitted from API
  1270. // requests. However, any non-pointer, non-interface field appearing in
  1271. // ForceSendFields will be sent to the server regardless of whether the
  1272. // field is empty or not. This may be used to include empty fields in
  1273. // Patch requests.
  1274. ForceSendFields []string `json:"-"`
  1275. // NullFields is a list of field names (e.g.
  1276. // "CommunityGuidelinesGoodStanding") to include in API requests with
  1277. // the JSON null value. By default, fields with empty values are omitted
  1278. // from API requests. However, any field with an empty value appearing
  1279. // in NullFields will be sent to the server as null. It is an error if a
  1280. // field in this list has a non-empty value. This may be used to include
  1281. // null fields in Patch requests.
  1282. NullFields []string `json:"-"`
  1283. }
  1284. func (s *ChannelAuditDetails) MarshalJSON() ([]byte, error) {
  1285. type NoMethod ChannelAuditDetails
  1286. raw := NoMethod(*s)
  1287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1288. }
  1289. // ChannelBannerResource: A channel banner returned as the response to a
  1290. // channel_banner.insert call.
  1291. type ChannelBannerResource struct {
  1292. // Etag: Etag of this resource.
  1293. Etag string `json:"etag,omitempty"`
  1294. // Kind: Identifies what kind of resource this is. Value: the fixed
  1295. // string "youtube#channelBannerResource".
  1296. Kind string `json:"kind,omitempty"`
  1297. // Url: The URL of this banner image.
  1298. Url string `json:"url,omitempty"`
  1299. // ServerResponse contains the HTTP response code and headers from the
  1300. // server.
  1301. googleapi.ServerResponse `json:"-"`
  1302. // ForceSendFields is a list of field names (e.g. "Etag") to
  1303. // unconditionally include in API requests. By default, fields with
  1304. // empty values are omitted from API requests. However, any non-pointer,
  1305. // non-interface field appearing in ForceSendFields will be sent to the
  1306. // server regardless of whether the field is empty or not. This may be
  1307. // used to include empty fields in Patch requests.
  1308. ForceSendFields []string `json:"-"`
  1309. // NullFields is a list of field names (e.g. "Etag") to include in API
  1310. // requests with the JSON null value. By default, fields with empty
  1311. // values are omitted from API requests. However, any field with an
  1312. // empty value appearing in NullFields will be sent to the server as
  1313. // null. It is an error if a field in this list has a non-empty value.
  1314. // This may be used to include null fields in Patch requests.
  1315. NullFields []string `json:"-"`
  1316. }
  1317. func (s *ChannelBannerResource) MarshalJSON() ([]byte, error) {
  1318. type NoMethod ChannelBannerResource
  1319. raw := NoMethod(*s)
  1320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1321. }
  1322. // ChannelBrandingSettings: Branding properties of a YouTube channel.
  1323. type ChannelBrandingSettings struct {
  1324. // Channel: Branding properties for the channel view.
  1325. Channel *ChannelSettings `json:"channel,omitempty"`
  1326. // Hints: Additional experimental branding properties.
  1327. Hints []*PropertyValue `json:"hints,omitempty"`
  1328. // Image: Branding properties for branding images.
  1329. Image *ImageSettings `json:"image,omitempty"`
  1330. // Watch: Branding properties for the watch page.
  1331. Watch *WatchSettings `json:"watch,omitempty"`
  1332. // ForceSendFields is a list of field names (e.g. "Channel") to
  1333. // unconditionally include in API requests. By default, fields with
  1334. // empty values are omitted from API requests. However, any non-pointer,
  1335. // non-interface field appearing in ForceSendFields will be sent to the
  1336. // server regardless of whether the field is empty or not. This may be
  1337. // used to include empty fields in Patch requests.
  1338. ForceSendFields []string `json:"-"`
  1339. // NullFields is a list of field names (e.g. "Channel") to include in
  1340. // API requests with the JSON null value. By default, fields with empty
  1341. // values are omitted from API requests. However, any field with an
  1342. // empty value appearing in NullFields will be sent to the server as
  1343. // null. It is an error if a field in this list has a non-empty value.
  1344. // This may be used to include null fields in Patch requests.
  1345. NullFields []string `json:"-"`
  1346. }
  1347. func (s *ChannelBrandingSettings) MarshalJSON() ([]byte, error) {
  1348. type NoMethod ChannelBrandingSettings
  1349. raw := NoMethod(*s)
  1350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1351. }
  1352. // ChannelContentDetails: Details about the content of a channel.
  1353. type ChannelContentDetails struct {
  1354. RelatedPlaylists *ChannelContentDetailsRelatedPlaylists `json:"relatedPlaylists,omitempty"`
  1355. // ForceSendFields is a list of field names (e.g. "RelatedPlaylists") to
  1356. // unconditionally include in API requests. By default, fields with
  1357. // empty values are omitted from API requests. However, any non-pointer,
  1358. // non-interface field appearing in ForceSendFields will be sent to the
  1359. // server regardless of whether the field is empty or not. This may be
  1360. // used to include empty fields in Patch requests.
  1361. ForceSendFields []string `json:"-"`
  1362. // NullFields is a list of field names (e.g. "RelatedPlaylists") to
  1363. // include in API requests with the JSON null value. By default, fields
  1364. // with empty values are omitted from API requests. However, any field
  1365. // with an empty value appearing in NullFields will be sent to the
  1366. // server as null. It is an error if a field in this list has a
  1367. // non-empty value. This may be used to include null fields in Patch
  1368. // requests.
  1369. NullFields []string `json:"-"`
  1370. }
  1371. func (s *ChannelContentDetails) MarshalJSON() ([]byte, error) {
  1372. type NoMethod ChannelContentDetails
  1373. raw := NoMethod(*s)
  1374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1375. }
  1376. type ChannelContentDetailsRelatedPlaylists struct {
  1377. // Favorites: The ID of the playlist that contains the channel"s
  1378. // favorite videos. Use the playlistItems.insert and
  1379. // playlistItems.delete to add or remove items from that list.
  1380. Favorites string `json:"favorites,omitempty"`
  1381. // Likes: The ID of the playlist that contains the channel"s liked
  1382. // videos. Use the playlistItems.insert and playlistItems.delete to
  1383. // add or remove items from that list.
  1384. Likes string `json:"likes,omitempty"`
  1385. // Uploads: The ID of the playlist that contains the channel"s uploaded
  1386. // videos. Use the videos.insert method to upload new videos and the
  1387. // videos.delete method to delete previously uploaded videos.
  1388. Uploads string `json:"uploads,omitempty"`
  1389. // WatchHistory: The ID of the playlist that contains the channel"s
  1390. // watch history. Use the playlistItems.insert and
  1391. // playlistItems.delete to add or remove items from that list.
  1392. WatchHistory string `json:"watchHistory,omitempty"`
  1393. // WatchLater: The ID of the playlist that contains the channel"s watch
  1394. // later playlist. Use the playlistItems.insert and
  1395. // playlistItems.delete to add or remove items from that list.
  1396. WatchLater string `json:"watchLater,omitempty"`
  1397. // ForceSendFields is a list of field names (e.g. "Favorites") to
  1398. // unconditionally include in API requests. By default, fields with
  1399. // empty values are omitted from API requests. However, any non-pointer,
  1400. // non-interface field appearing in ForceSendFields will be sent to the
  1401. // server regardless of whether the field is empty or not. This may be
  1402. // used to include empty fields in Patch requests.
  1403. ForceSendFields []string `json:"-"`
  1404. // NullFields is a list of field names (e.g. "Favorites") to include in
  1405. // API requests with the JSON null value. By default, fields with empty
  1406. // values are omitted from API requests. However, any field with an
  1407. // empty value appearing in NullFields will be sent to the server as
  1408. // null. It is an error if a field in this list has a non-empty value.
  1409. // This may be used to include null fields in Patch requests.
  1410. NullFields []string `json:"-"`
  1411. }
  1412. func (s *ChannelContentDetailsRelatedPlaylists) MarshalJSON() ([]byte, error) {
  1413. type NoMethod ChannelContentDetailsRelatedPlaylists
  1414. raw := NoMethod(*s)
  1415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1416. }
  1417. // ChannelContentOwnerDetails: The contentOwnerDetails object
  1418. // encapsulates channel data that is relevant for YouTube Partners
  1419. // linked with the channel.
  1420. type ChannelContentOwnerDetails struct {
  1421. // ContentOwner: The ID of the content owner linked to the channel.
  1422. ContentOwner string `json:"contentOwner,omitempty"`
  1423. // TimeLinked: The date and time of when the channel was linked to the
  1424. // content owner. The value is specified in ISO 8601
  1425. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  1426. TimeLinked string `json:"timeLinked,omitempty"`
  1427. // ForceSendFields is a list of field names (e.g. "ContentOwner") to
  1428. // unconditionally include in API requests. By default, fields with
  1429. // empty values are omitted from API requests. However, any non-pointer,
  1430. // non-interface field appearing in ForceSendFields will be sent to the
  1431. // server regardless of whether the field is empty or not. This may be
  1432. // used to include empty fields in Patch requests.
  1433. ForceSendFields []string `json:"-"`
  1434. // NullFields is a list of field names (e.g. "ContentOwner") to include
  1435. // in API requests with the JSON null value. By default, fields with
  1436. // empty values are omitted from API requests. However, any field with
  1437. // an empty value appearing in NullFields will be sent to the server as
  1438. // null. It is an error if a field in this list has a non-empty value.
  1439. // This may be used to include null fields in Patch requests.
  1440. NullFields []string `json:"-"`
  1441. }
  1442. func (s *ChannelContentOwnerDetails) MarshalJSON() ([]byte, error) {
  1443. type NoMethod ChannelContentOwnerDetails
  1444. raw := NoMethod(*s)
  1445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1446. }
  1447. // ChannelConversionPing: Pings that the app shall fire (authenticated
  1448. // by biscotti cookie). Each ping has a context, in which the app must
  1449. // fire the ping, and a url identifying the ping.
  1450. type ChannelConversionPing struct {
  1451. // Context: Defines the context of the ping.
  1452. //
  1453. // Possible values:
  1454. // "cview"
  1455. // "subscribe"
  1456. // "unsubscribe"
  1457. Context string `json:"context,omitempty"`
  1458. // ConversionUrl: The url (without the schema) that the player shall
  1459. // send the ping to. It's at caller's descretion to decide which schema
  1460. // to use (http vs https) Example of a returned url:
  1461. // //googleads.g.doubleclick.net/pagead/
  1462. // viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D
  1463. // cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must
  1464. // append biscotti authentication (ms param in case of mobile, for
  1465. // example) to this ping.
  1466. ConversionUrl string `json:"conversionUrl,omitempty"`
  1467. // ForceSendFields is a list of field names (e.g. "Context") to
  1468. // unconditionally include in API requests. By default, fields with
  1469. // empty values are omitted from API requests. However, any non-pointer,
  1470. // non-interface field appearing in ForceSendFields will be sent to the
  1471. // server regardless of whether the field is empty or not. This may be
  1472. // used to include empty fields in Patch requests.
  1473. ForceSendFields []string `json:"-"`
  1474. // NullFields is a list of field names (e.g. "Context") to include in
  1475. // API requests with the JSON null value. By default, fields with empty
  1476. // values are omitted from API requests. However, any field with an
  1477. // empty value appearing in NullFields will be sent to the server as
  1478. // null. It is an error if a field in this list has a non-empty value.
  1479. // This may be used to include null fields in Patch requests.
  1480. NullFields []string `json:"-"`
  1481. }
  1482. func (s *ChannelConversionPing) MarshalJSON() ([]byte, error) {
  1483. type NoMethod ChannelConversionPing
  1484. raw := NoMethod(*s)
  1485. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1486. }
  1487. // ChannelConversionPings: The conversionPings object encapsulates
  1488. // information about conversion pings that need to be respected by the
  1489. // channel.
  1490. type ChannelConversionPings struct {
  1491. // Pings: Pings that the app shall fire (authenticated by biscotti
  1492. // cookie). Each ping has a context, in which the app must fire the
  1493. // ping, and a url identifying the ping.
  1494. Pings []*ChannelConversionPing `json:"pings,omitempty"`
  1495. // ForceSendFields is a list of field names (e.g. "Pings") to
  1496. // unconditionally include in API requests. By default, fields with
  1497. // empty values are omitted from API requests. However, any non-pointer,
  1498. // non-interface field appearing in ForceSendFields will be sent to the
  1499. // server regardless of whether the field is empty or not. This may be
  1500. // used to include empty fields in Patch requests.
  1501. ForceSendFields []string `json:"-"`
  1502. // NullFields is a list of field names (e.g. "Pings") to include in API
  1503. // requests with the JSON null value. By default, fields with empty
  1504. // values are omitted from API requests. However, any field with an
  1505. // empty value appearing in NullFields will be sent to the server as
  1506. // null. It is an error if a field in this list has a non-empty value.
  1507. // This may be used to include null fields in Patch requests.
  1508. NullFields []string `json:"-"`
  1509. }
  1510. func (s *ChannelConversionPings) MarshalJSON() ([]byte, error) {
  1511. type NoMethod ChannelConversionPings
  1512. raw := NoMethod(*s)
  1513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1514. }
  1515. type ChannelListResponse struct {
  1516. // Etag: Etag of this resource.
  1517. Etag string `json:"etag,omitempty"`
  1518. // EventId: Serialized EventId of the request which produced this
  1519. // response.
  1520. EventId string `json:"eventId,omitempty"`
  1521. // Items: A list of channels that match the request criteria.
  1522. Items []*Channel `json:"items,omitempty"`
  1523. // Kind: Identifies what kind of resource this is. Value: the fixed
  1524. // string "youtube#channelListResponse".
  1525. Kind string `json:"kind,omitempty"`
  1526. // NextPageToken: The token that can be used as the value of the
  1527. // pageToken parameter to retrieve the next page in the result set.
  1528. NextPageToken string `json:"nextPageToken,omitempty"`
  1529. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1530. // PrevPageToken: The token that can be used as the value of the
  1531. // pageToken parameter to retrieve the previous page in the result set.
  1532. PrevPageToken string `json:"prevPageToken,omitempty"`
  1533. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1534. // VisitorId: The visitorId identifies the visitor.
  1535. VisitorId string `json:"visitorId,omitempty"`
  1536. // ServerResponse contains the HTTP response code and headers from the
  1537. // server.
  1538. googleapi.ServerResponse `json:"-"`
  1539. // ForceSendFields is a list of field names (e.g. "Etag") to
  1540. // unconditionally include in API requests. By default, fields with
  1541. // empty values are omitted from API requests. However, any non-pointer,
  1542. // non-interface field appearing in ForceSendFields will be sent to the
  1543. // server regardless of whether the field is empty or not. This may be
  1544. // used to include empty fields in Patch requests.
  1545. ForceSendFields []string `json:"-"`
  1546. // NullFields is a list of field names (e.g. "Etag") to include in API
  1547. // requests with the JSON null value. By default, fields with empty
  1548. // values are omitted from API requests. However, any field with an
  1549. // empty value appearing in NullFields will be sent to the server as
  1550. // null. It is an error if a field in this list has a non-empty value.
  1551. // This may be used to include null fields in Patch requests.
  1552. NullFields []string `json:"-"`
  1553. }
  1554. func (s *ChannelListResponse) MarshalJSON() ([]byte, error) {
  1555. type NoMethod ChannelListResponse
  1556. raw := NoMethod(*s)
  1557. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1558. }
  1559. // ChannelLocalization: Channel localization setting
  1560. type ChannelLocalization struct {
  1561. // Description: The localized strings for channel's description.
  1562. Description string `json:"description,omitempty"`
  1563. // Title: The localized strings for channel's title.
  1564. Title string `json:"title,omitempty"`
  1565. // ForceSendFields is a list of field names (e.g. "Description") to
  1566. // unconditionally include in API requests. By default, fields with
  1567. // empty values are omitted from API requests. However, any non-pointer,
  1568. // non-interface field appearing in ForceSendFields will be sent to the
  1569. // server regardless of whether the field is empty or not. This may be
  1570. // used to include empty fields in Patch requests.
  1571. ForceSendFields []string `json:"-"`
  1572. // NullFields is a list of field names (e.g. "Description") to include
  1573. // in API requests with the JSON null value. By default, fields with
  1574. // empty values are omitted from API requests. However, any field with
  1575. // an empty value appearing in NullFields will be sent to the server as
  1576. // null. It is an error if a field in this list has a non-empty value.
  1577. // This may be used to include null fields in Patch requests.
  1578. NullFields []string `json:"-"`
  1579. }
  1580. func (s *ChannelLocalization) MarshalJSON() ([]byte, error) {
  1581. type NoMethod ChannelLocalization
  1582. raw := NoMethod(*s)
  1583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1584. }
  1585. type ChannelProfileDetails struct {
  1586. // ChannelId: The YouTube channel ID.
  1587. ChannelId string `json:"channelId,omitempty"`
  1588. // ChannelUrl: The channel's URL.
  1589. ChannelUrl string `json:"channelUrl,omitempty"`
  1590. // DisplayName: The channel's display name.
  1591. DisplayName string `json:"displayName,omitempty"`
  1592. // ProfileImageUrl: The channels's avatar URL.
  1593. ProfileImageUrl string `json:"profileImageUrl,omitempty"`
  1594. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  1595. // unconditionally include in API requests. By default, fields with
  1596. // empty values are omitted from API requests. However, any non-pointer,
  1597. // non-interface field appearing in ForceSendFields will be sent to the
  1598. // server regardless of whether the field is empty or not. This may be
  1599. // used to include empty fields in Patch requests.
  1600. ForceSendFields []string `json:"-"`
  1601. // NullFields is a list of field names (e.g. "ChannelId") to include in
  1602. // API requests with the JSON null value. By default, fields with empty
  1603. // values are omitted from API requests. However, any field with an
  1604. // empty value appearing in NullFields will be sent to the server as
  1605. // null. It is an error if a field in this list has a non-empty value.
  1606. // This may be used to include null fields in Patch requests.
  1607. NullFields []string `json:"-"`
  1608. }
  1609. func (s *ChannelProfileDetails) MarshalJSON() ([]byte, error) {
  1610. type NoMethod ChannelProfileDetails
  1611. raw := NoMethod(*s)
  1612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1613. }
  1614. type ChannelSection struct {
  1615. // ContentDetails: The contentDetails object contains details about the
  1616. // channel section content, such as a list of playlists or channels
  1617. // featured in the section.
  1618. ContentDetails *ChannelSectionContentDetails `json:"contentDetails,omitempty"`
  1619. // Etag: Etag of this resource.
  1620. Etag string `json:"etag,omitempty"`
  1621. // Id: The ID that YouTube uses to uniquely identify the channel
  1622. // section.
  1623. Id string `json:"id,omitempty"`
  1624. // Kind: Identifies what kind of resource this is. Value: the fixed
  1625. // string "youtube#channelSection".
  1626. Kind string `json:"kind,omitempty"`
  1627. // Localizations: Localizations for different languages
  1628. Localizations map[string]ChannelSectionLocalization `json:"localizations,omitempty"`
  1629. // Snippet: The snippet object contains basic details about the channel
  1630. // section, such as its type, style and title.
  1631. Snippet *ChannelSectionSnippet `json:"snippet,omitempty"`
  1632. // Targeting: The targeting object contains basic targeting settings
  1633. // about the channel section.
  1634. Targeting *ChannelSectionTargeting `json:"targeting,omitempty"`
  1635. // ServerResponse contains the HTTP response code and headers from the
  1636. // server.
  1637. googleapi.ServerResponse `json:"-"`
  1638. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  1639. // unconditionally include in API requests. By default, fields with
  1640. // empty values are omitted from API requests. However, any non-pointer,
  1641. // non-interface field appearing in ForceSendFields will be sent to the
  1642. // server regardless of whether the field is empty or not. This may be
  1643. // used to include empty fields in Patch requests.
  1644. ForceSendFields []string `json:"-"`
  1645. // NullFields is a list of field names (e.g. "ContentDetails") to
  1646. // include in API requests with the JSON null value. By default, fields
  1647. // with empty values are omitted from API requests. However, any field
  1648. // with an empty value appearing in NullFields will be sent to the
  1649. // server as null. It is an error if a field in this list has a
  1650. // non-empty value. This may be used to include null fields in Patch
  1651. // requests.
  1652. NullFields []string `json:"-"`
  1653. }
  1654. func (s *ChannelSection) MarshalJSON() ([]byte, error) {
  1655. type NoMethod ChannelSection
  1656. raw := NoMethod(*s)
  1657. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1658. }
  1659. // ChannelSectionContentDetails: Details about a channelsection,
  1660. // including playlists and channels.
  1661. type ChannelSectionContentDetails struct {
  1662. // Channels: The channel ids for type multiple_channels.
  1663. Channels []string `json:"channels,omitempty"`
  1664. // Playlists: The playlist ids for type single_playlist and
  1665. // multiple_playlists. For singlePlaylist, only one playlistId is
  1666. // allowed.
  1667. Playlists []string `json:"playlists,omitempty"`
  1668. // ForceSendFields is a list of field names (e.g. "Channels") to
  1669. // unconditionally include in API requests. By default, fields with
  1670. // empty values are omitted from API requests. However, any non-pointer,
  1671. // non-interface field appearing in ForceSendFields will be sent to the
  1672. // server regardless of whether the field is empty or not. This may be
  1673. // used to include empty fields in Patch requests.
  1674. ForceSendFields []string `json:"-"`
  1675. // NullFields is a list of field names (e.g. "Channels") to include in
  1676. // API requests with the JSON null value. By default, fields with empty
  1677. // values are omitted from API requests. However, any field with an
  1678. // empty value appearing in NullFields will be sent to the server as
  1679. // null. It is an error if a field in this list has a non-empty value.
  1680. // This may be used to include null fields in Patch requests.
  1681. NullFields []string `json:"-"`
  1682. }
  1683. func (s *ChannelSectionContentDetails) MarshalJSON() ([]byte, error) {
  1684. type NoMethod ChannelSectionContentDetails
  1685. raw := NoMethod(*s)
  1686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1687. }
  1688. type ChannelSectionListResponse struct {
  1689. // Etag: Etag of this resource.
  1690. Etag string `json:"etag,omitempty"`
  1691. // EventId: Serialized EventId of the request which produced this
  1692. // response.
  1693. EventId string `json:"eventId,omitempty"`
  1694. // Items: A list of ChannelSections that match the request criteria.
  1695. Items []*ChannelSection `json:"items,omitempty"`
  1696. // Kind: Identifies what kind of resource this is. Value: the fixed
  1697. // string "youtube#channelSectionListResponse".
  1698. Kind string `json:"kind,omitempty"`
  1699. // VisitorId: The visitorId identifies the visitor.
  1700. VisitorId string `json:"visitorId,omitempty"`
  1701. // ServerResponse contains the HTTP response code and headers from the
  1702. // server.
  1703. googleapi.ServerResponse `json:"-"`
  1704. // ForceSendFields is a list of field names (e.g. "Etag") to
  1705. // unconditionally include in API requests. By default, fields with
  1706. // empty values are omitted from API requests. However, any non-pointer,
  1707. // non-interface field appearing in ForceSendFields will be sent to the
  1708. // server regardless of whether the field is empty or not. This may be
  1709. // used to include empty fields in Patch requests.
  1710. ForceSendFields []string `json:"-"`
  1711. // NullFields is a list of field names (e.g. "Etag") to include in API
  1712. // requests with the JSON null value. By default, fields with empty
  1713. // values are omitted from API requests. However, any field with an
  1714. // empty value appearing in NullFields will be sent to the server as
  1715. // null. It is an error if a field in this list has a non-empty value.
  1716. // This may be used to include null fields in Patch requests.
  1717. NullFields []string `json:"-"`
  1718. }
  1719. func (s *ChannelSectionListResponse) MarshalJSON() ([]byte, error) {
  1720. type NoMethod ChannelSectionListResponse
  1721. raw := NoMethod(*s)
  1722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1723. }
  1724. // ChannelSectionLocalization: ChannelSection localization setting
  1725. type ChannelSectionLocalization struct {
  1726. // Title: The localized strings for channel section's title.
  1727. Title string `json:"title,omitempty"`
  1728. // ForceSendFields is a list of field names (e.g. "Title") to
  1729. // unconditionally include in API requests. By default, fields with
  1730. // empty values are omitted from API requests. However, any non-pointer,
  1731. // non-interface field appearing in ForceSendFields will be sent to the
  1732. // server regardless of whether the field is empty or not. This may be
  1733. // used to include empty fields in Patch requests.
  1734. ForceSendFields []string `json:"-"`
  1735. // NullFields is a list of field names (e.g. "Title") to include in API
  1736. // requests with the JSON null value. By default, fields with empty
  1737. // values are omitted from API requests. However, any field with an
  1738. // empty value appearing in NullFields will be sent to the server as
  1739. // null. It is an error if a field in this list has a non-empty value.
  1740. // This may be used to include null fields in Patch requests.
  1741. NullFields []string `json:"-"`
  1742. }
  1743. func (s *ChannelSectionLocalization) MarshalJSON() ([]byte, error) {
  1744. type NoMethod ChannelSectionLocalization
  1745. raw := NoMethod(*s)
  1746. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1747. }
  1748. // ChannelSectionSnippet: Basic details about a channel section,
  1749. // including title, style and position.
  1750. type ChannelSectionSnippet struct {
  1751. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  1752. // that published the channel section.
  1753. ChannelId string `json:"channelId,omitempty"`
  1754. // DefaultLanguage: The language of the channel section's default title
  1755. // and description.
  1756. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1757. // Localized: Localized title, read-only.
  1758. Localized *ChannelSectionLocalization `json:"localized,omitempty"`
  1759. // Position: The position of the channel section in the channel.
  1760. Position *int64 `json:"position,omitempty"`
  1761. // Style: The style of the channel section.
  1762. //
  1763. // Possible values:
  1764. // "channelsectionStyleUndefined"
  1765. // "horizontalRow"
  1766. // "verticalList"
  1767. Style string `json:"style,omitempty"`
  1768. // Title: The channel section's title for multiple_playlists and
  1769. // multiple_channels.
  1770. Title string `json:"title,omitempty"`
  1771. // Type: The type of the channel section.
  1772. //
  1773. // Possible values:
  1774. // "allPlaylists"
  1775. // "channelsectionTypeUndefined"
  1776. // "completedEvents"
  1777. // "likedPlaylists"
  1778. // "likes"
  1779. // "liveEvents"
  1780. // "multipleChannels"
  1781. // "multiplePlaylists"
  1782. // "popularUploads"
  1783. // "postedPlaylists"
  1784. // "postedVideos"
  1785. // "recentActivity"
  1786. // "recentPosts"
  1787. // "recentUploads"
  1788. // "singlePlaylist"
  1789. // "subscriptions"
  1790. // "upcomingEvents"
  1791. Type string `json:"type,omitempty"`
  1792. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  1793. // unconditionally include in API requests. By default, fields with
  1794. // empty values are omitted from API requests. However, any non-pointer,
  1795. // non-interface field appearing in ForceSendFields will be sent to the
  1796. // server regardless of whether the field is empty or not. This may be
  1797. // used to include empty fields in Patch requests.
  1798. ForceSendFields []string `json:"-"`
  1799. // NullFields is a list of field names (e.g. "ChannelId") to include in
  1800. // API requests with the JSON null value. By default, fields with empty
  1801. // values are omitted from API requests. However, any field with an
  1802. // empty value appearing in NullFields will be sent to the server as
  1803. // null. It is an error if a field in this list has a non-empty value.
  1804. // This may be used to include null fields in Patch requests.
  1805. NullFields []string `json:"-"`
  1806. }
  1807. func (s *ChannelSectionSnippet) MarshalJSON() ([]byte, error) {
  1808. type NoMethod ChannelSectionSnippet
  1809. raw := NoMethod(*s)
  1810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1811. }
  1812. // ChannelSectionTargeting: ChannelSection targeting setting.
  1813. type ChannelSectionTargeting struct {
  1814. // Countries: The country the channel section is targeting.
  1815. Countries []string `json:"countries,omitempty"`
  1816. // Languages: The language the channel section is targeting.
  1817. Languages []string `json:"languages,omitempty"`
  1818. // Regions: The region the channel section is targeting.
  1819. Regions []string `json:"regions,omitempty"`
  1820. // ForceSendFields is a list of field names (e.g. "Countries") to
  1821. // unconditionally include in API requests. By default, fields with
  1822. // empty values are omitted from API requests. However, any non-pointer,
  1823. // non-interface field appearing in ForceSendFields will be sent to the
  1824. // server regardless of whether the field is empty or not. This may be
  1825. // used to include empty fields in Patch requests.
  1826. ForceSendFields []string `json:"-"`
  1827. // NullFields is a list of field names (e.g. "Countries") to include in
  1828. // API requests with the JSON null value. By default, fields with empty
  1829. // values are omitted from API requests. However, any field with an
  1830. // empty value appearing in NullFields will be sent to the server as
  1831. // null. It is an error if a field in this list has a non-empty value.
  1832. // This may be used to include null fields in Patch requests.
  1833. NullFields []string `json:"-"`
  1834. }
  1835. func (s *ChannelSectionTargeting) MarshalJSON() ([]byte, error) {
  1836. type NoMethod ChannelSectionTargeting
  1837. raw := NoMethod(*s)
  1838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1839. }
  1840. // ChannelSettings: Branding properties for the channel view.
  1841. type ChannelSettings struct {
  1842. // Country: The country of the channel.
  1843. Country string `json:"country,omitempty"`
  1844. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1845. // DefaultTab: Which content tab users should see when viewing the
  1846. // channel.
  1847. DefaultTab string `json:"defaultTab,omitempty"`
  1848. // Description: Specifies the channel description.
  1849. Description string `json:"description,omitempty"`
  1850. // FeaturedChannelsTitle: Title for the featured channels tab.
  1851. FeaturedChannelsTitle string `json:"featuredChannelsTitle,omitempty"`
  1852. // FeaturedChannelsUrls: The list of featured channels.
  1853. FeaturedChannelsUrls []string `json:"featuredChannelsUrls,omitempty"`
  1854. // Keywords: Lists keywords associated with the channel,
  1855. // comma-separated.
  1856. Keywords string `json:"keywords,omitempty"`
  1857. // ModerateComments: Whether user-submitted comments left on the channel
  1858. // page need to be approved by the channel owner to be publicly visible.
  1859. ModerateComments bool `json:"moderateComments,omitempty"`
  1860. // ProfileColor: A prominent color that can be rendered on this channel
  1861. // page.
  1862. ProfileColor string `json:"profileColor,omitempty"`
  1863. // ShowBrowseView: Whether the tab to browse the videos should be
  1864. // displayed.
  1865. ShowBrowseView bool `json:"showBrowseView,omitempty"`
  1866. // ShowRelatedChannels: Whether related channels should be proposed.
  1867. ShowRelatedChannels bool `json:"showRelatedChannels,omitempty"`
  1868. // Title: Specifies the channel title.
  1869. Title string `json:"title,omitempty"`
  1870. // TrackingAnalyticsAccountId: The ID for a Google Analytics account to
  1871. // track and measure traffic to the channels.
  1872. TrackingAnalyticsAccountId string `json:"trackingAnalyticsAccountId,omitempty"`
  1873. // UnsubscribedTrailer: The trailer of the channel, for users that are
  1874. // not subscribers.
  1875. UnsubscribedTrailer string `json:"unsubscribedTrailer,omitempty"`
  1876. // ForceSendFields is a list of field names (e.g. "Country") to
  1877. // unconditionally include in API requests. By default, fields with
  1878. // empty values are omitted from API requests. However, any non-pointer,
  1879. // non-interface field appearing in ForceSendFields will be sent to the
  1880. // server regardless of whether the field is empty or not. This may be
  1881. // used to include empty fields in Patch requests.
  1882. ForceSendFields []string `json:"-"`
  1883. // NullFields is a list of field names (e.g. "Country") to include in
  1884. // API requests with the JSON null value. By default, fields with empty
  1885. // values are omitted from API requests. However, any field with an
  1886. // empty value appearing in NullFields will be sent to the server as
  1887. // null. It is an error if a field in this list has a non-empty value.
  1888. // This may be used to include null fields in Patch requests.
  1889. NullFields []string `json:"-"`
  1890. }
  1891. func (s *ChannelSettings) MarshalJSON() ([]byte, error) {
  1892. type NoMethod ChannelSettings
  1893. raw := NoMethod(*s)
  1894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1895. }
  1896. // ChannelSnippet: Basic details about a channel, including title,
  1897. // description and thumbnails.
  1898. type ChannelSnippet struct {
  1899. // Country: The country of the channel.
  1900. Country string `json:"country,omitempty"`
  1901. // CustomUrl: The custom url of the channel.
  1902. CustomUrl string `json:"customUrl,omitempty"`
  1903. // DefaultLanguage: The language of the channel's default title and
  1904. // description.
  1905. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1906. // Description: The description of the channel.
  1907. Description string `json:"description,omitempty"`
  1908. // Localized: Localized title and description, read-only.
  1909. Localized *ChannelLocalization `json:"localized,omitempty"`
  1910. // PublishedAt: The date and time that the channel was created. The
  1911. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  1912. PublishedAt string `json:"publishedAt,omitempty"`
  1913. // Thumbnails: A map of thumbnail images associated with the channel.
  1914. // For each object in the map, the key is the name of the thumbnail
  1915. // image, and the value is an object that contains other information
  1916. // about the thumbnail.
  1917. //
  1918. // When displaying thumbnails in your application, make sure that your
  1919. // code uses the image URLs exactly as they are returned in API
  1920. // responses. For example, your application should not use the http
  1921. // domain instead of the https domain in a URL returned in an API
  1922. // response.
  1923. //
  1924. // Beginning in July 2018, channel thumbnail URLs will only be available
  1925. // in the https domain, which is how the URLs appear in API responses.
  1926. // After that time, you might see broken images in your application if
  1927. // it tries to load YouTube images from the http domain.
  1928. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  1929. // Title: The channel's title.
  1930. Title string `json:"title,omitempty"`
  1931. // ForceSendFields is a list of field names (e.g. "Country") to
  1932. // unconditionally include in API requests. By default, fields with
  1933. // empty values are omitted from API requests. However, any non-pointer,
  1934. // non-interface field appearing in ForceSendFields will be sent to the
  1935. // server regardless of whether the field is empty or not. This may be
  1936. // used to include empty fields in Patch requests.
  1937. ForceSendFields []string `json:"-"`
  1938. // NullFields is a list of field names (e.g. "Country") to include in
  1939. // API requests with the JSON null value. By default, fields with empty
  1940. // values are omitted from API requests. However, any field with an
  1941. // empty value appearing in NullFields will be sent to the server as
  1942. // null. It is an error if a field in this list has a non-empty value.
  1943. // This may be used to include null fields in Patch requests.
  1944. NullFields []string `json:"-"`
  1945. }
  1946. func (s *ChannelSnippet) MarshalJSON() ([]byte, error) {
  1947. type NoMethod ChannelSnippet
  1948. raw := NoMethod(*s)
  1949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1950. }
  1951. // ChannelStatistics: Statistics about a channel: number of subscribers,
  1952. // number of videos in the channel, etc.
  1953. type ChannelStatistics struct {
  1954. // CommentCount: The number of comments for the channel.
  1955. CommentCount uint64 `json:"commentCount,omitempty,string"`
  1956. // HiddenSubscriberCount: Whether or not the number of subscribers is
  1957. // shown for this user.
  1958. HiddenSubscriberCount bool `json:"hiddenSubscriberCount,omitempty"`
  1959. // SubscriberCount: The number of subscribers that the channel has.
  1960. SubscriberCount uint64 `json:"subscriberCount,omitempty,string"`
  1961. // VideoCount: The number of videos uploaded to the channel.
  1962. VideoCount uint64 `json:"videoCount,omitempty,string"`
  1963. // ViewCount: The number of times the channel has been viewed.
  1964. ViewCount uint64 `json:"viewCount,omitempty,string"`
  1965. // ForceSendFields is a list of field names (e.g. "CommentCount") to
  1966. // unconditionally include in API requests. By default, fields with
  1967. // empty values are omitted from API requests. However, any non-pointer,
  1968. // non-interface field appearing in ForceSendFields will be sent to the
  1969. // server regardless of whether the field is empty or not. This may be
  1970. // used to include empty fields in Patch requests.
  1971. ForceSendFields []string `json:"-"`
  1972. // NullFields is a list of field names (e.g. "CommentCount") to include
  1973. // in API requests with the JSON null value. By default, fields with
  1974. // empty values are omitted from API requests. However, any field with
  1975. // an empty value appearing in NullFields will be sent to the server as
  1976. // null. It is an error if a field in this list has a non-empty value.
  1977. // This may be used to include null fields in Patch requests.
  1978. NullFields []string `json:"-"`
  1979. }
  1980. func (s *ChannelStatistics) MarshalJSON() ([]byte, error) {
  1981. type NoMethod ChannelStatistics
  1982. raw := NoMethod(*s)
  1983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1984. }
  1985. // ChannelStatus: JSON template for the status part of a channel.
  1986. type ChannelStatus struct {
  1987. // IsLinked: If true, then the user is linked to either a YouTube
  1988. // username or G+ account. Otherwise, the user doesn't have a public
  1989. // YouTube identity.
  1990. IsLinked bool `json:"isLinked,omitempty"`
  1991. // LongUploadsStatus: The long uploads status of this channel. See
  1992. //
  1993. // Possible values:
  1994. // "allowed"
  1995. // "disallowed"
  1996. // "eligible"
  1997. // "longUploadsUnspecified"
  1998. LongUploadsStatus string `json:"longUploadsStatus,omitempty"`
  1999. // PrivacyStatus: Privacy status of the channel.
  2000. //
  2001. // Possible values:
  2002. // "private"
  2003. // "public"
  2004. // "unlisted"
  2005. // "unlisted_new"
  2006. PrivacyStatus string `json:"privacyStatus,omitempty"`
  2007. // ForceSendFields is a list of field names (e.g. "IsLinked") to
  2008. // unconditionally include in API requests. By default, fields with
  2009. // empty values are omitted from API requests. However, any non-pointer,
  2010. // non-interface field appearing in ForceSendFields will be sent to the
  2011. // server regardless of whether the field is empty or not. This may be
  2012. // used to include empty fields in Patch requests.
  2013. ForceSendFields []string `json:"-"`
  2014. // NullFields is a list of field names (e.g. "IsLinked") to include in
  2015. // API requests with the JSON null value. By default, fields with empty
  2016. // values are omitted from API requests. However, any field with an
  2017. // empty value appearing in NullFields will be sent to the server as
  2018. // null. It is an error if a field in this list has a non-empty value.
  2019. // This may be used to include null fields in Patch requests.
  2020. NullFields []string `json:"-"`
  2021. }
  2022. func (s *ChannelStatus) MarshalJSON() ([]byte, error) {
  2023. type NoMethod ChannelStatus
  2024. raw := NoMethod(*s)
  2025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2026. }
  2027. // ChannelTopicDetails: Freebase topic information related to the
  2028. // channel.
  2029. type ChannelTopicDetails struct {
  2030. // TopicCategories: A list of Wikipedia URLs that describe the channel's
  2031. // content.
  2032. TopicCategories []string `json:"topicCategories,omitempty"`
  2033. // TopicIds: A list of Freebase topic IDs associated with the channel.
  2034. // You can retrieve information about each topic using the Freebase
  2035. // Topic API.
  2036. TopicIds []string `json:"topicIds,omitempty"`
  2037. // ForceSendFields is a list of field names (e.g. "TopicCategories") to
  2038. // unconditionally include in API requests. By default, fields with
  2039. // empty values are omitted from API requests. However, any non-pointer,
  2040. // non-interface field appearing in ForceSendFields will be sent to the
  2041. // server regardless of whether the field is empty or not. This may be
  2042. // used to include empty fields in Patch requests.
  2043. ForceSendFields []string `json:"-"`
  2044. // NullFields is a list of field names (e.g. "TopicCategories") to
  2045. // include in API requests with the JSON null value. By default, fields
  2046. // with empty values are omitted from API requests. However, any field
  2047. // with an empty value appearing in NullFields will be sent to the
  2048. // server as null. It is an error if a field in this list has a
  2049. // non-empty value. This may be used to include null fields in Patch
  2050. // requests.
  2051. NullFields []string `json:"-"`
  2052. }
  2053. func (s *ChannelTopicDetails) MarshalJSON() ([]byte, error) {
  2054. type NoMethod ChannelTopicDetails
  2055. raw := NoMethod(*s)
  2056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2057. }
  2058. // Comment: A comment represents a single YouTube comment.
  2059. type Comment struct {
  2060. // Etag: Etag of this resource.
  2061. Etag string `json:"etag,omitempty"`
  2062. // Id: The ID that YouTube uses to uniquely identify the comment.
  2063. Id string `json:"id,omitempty"`
  2064. // Kind: Identifies what kind of resource this is. Value: the fixed
  2065. // string "youtube#comment".
  2066. Kind string `json:"kind,omitempty"`
  2067. // Snippet: The snippet object contains basic details about the comment.
  2068. Snippet *CommentSnippet `json:"snippet,omitempty"`
  2069. // ServerResponse contains the HTTP response code and headers from the
  2070. // server.
  2071. googleapi.ServerResponse `json:"-"`
  2072. // ForceSendFields is a list of field names (e.g. "Etag") to
  2073. // unconditionally include in API requests. By default, fields with
  2074. // empty values are omitted from API requests. However, any non-pointer,
  2075. // non-interface field appearing in ForceSendFields will be sent to the
  2076. // server regardless of whether the field is empty or not. This may be
  2077. // used to include empty fields in Patch requests.
  2078. ForceSendFields []string `json:"-"`
  2079. // NullFields is a list of field names (e.g. "Etag") to include in API
  2080. // requests with the JSON null value. By default, fields with empty
  2081. // values are omitted from API requests. However, any field with an
  2082. // empty value appearing in NullFields will be sent to the server as
  2083. // null. It is an error if a field in this list has a non-empty value.
  2084. // This may be used to include null fields in Patch requests.
  2085. NullFields []string `json:"-"`
  2086. }
  2087. func (s *Comment) MarshalJSON() ([]byte, error) {
  2088. type NoMethod Comment
  2089. raw := NoMethod(*s)
  2090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2091. }
  2092. type CommentListResponse struct {
  2093. // Etag: Etag of this resource.
  2094. Etag string `json:"etag,omitempty"`
  2095. // EventId: Serialized EventId of the request which produced this
  2096. // response.
  2097. EventId string `json:"eventId,omitempty"`
  2098. // Items: A list of comments that match the request criteria.
  2099. Items []*Comment `json:"items,omitempty"`
  2100. // Kind: Identifies what kind of resource this is. Value: the fixed
  2101. // string "youtube#commentListResponse".
  2102. Kind string `json:"kind,omitempty"`
  2103. // NextPageToken: The token that can be used as the value of the
  2104. // pageToken parameter to retrieve the next page in the result set.
  2105. NextPageToken string `json:"nextPageToken,omitempty"`
  2106. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2107. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2108. // VisitorId: The visitorId identifies the visitor.
  2109. VisitorId string `json:"visitorId,omitempty"`
  2110. // ServerResponse contains the HTTP response code and headers from the
  2111. // server.
  2112. googleapi.ServerResponse `json:"-"`
  2113. // ForceSendFields is a list of field names (e.g. "Etag") to
  2114. // unconditionally include in API requests. By default, fields with
  2115. // empty values are omitted from API requests. However, any non-pointer,
  2116. // non-interface field appearing in ForceSendFields will be sent to the
  2117. // server regardless of whether the field is empty or not. This may be
  2118. // used to include empty fields in Patch requests.
  2119. ForceSendFields []string `json:"-"`
  2120. // NullFields is a list of field names (e.g. "Etag") to include in API
  2121. // requests with the JSON null value. By default, fields with empty
  2122. // values are omitted from API requests. However, any field with an
  2123. // empty value appearing in NullFields will be sent to the server as
  2124. // null. It is an error if a field in this list has a non-empty value.
  2125. // This may be used to include null fields in Patch requests.
  2126. NullFields []string `json:"-"`
  2127. }
  2128. func (s *CommentListResponse) MarshalJSON() ([]byte, error) {
  2129. type NoMethod CommentListResponse
  2130. raw := NoMethod(*s)
  2131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2132. }
  2133. // CommentSnippet: Basic details about a comment, such as its author and
  2134. // text.
  2135. type CommentSnippet struct {
  2136. // AuthorChannelId: The id of the author's YouTube channel, if any.
  2137. AuthorChannelId interface{} `json:"authorChannelId,omitempty"`
  2138. // AuthorChannelUrl: Link to the author's YouTube channel, if any.
  2139. AuthorChannelUrl string `json:"authorChannelUrl,omitempty"`
  2140. // AuthorDisplayName: The name of the user who posted the comment.
  2141. AuthorDisplayName string `json:"authorDisplayName,omitempty"`
  2142. // AuthorProfileImageUrl: The URL for the avatar of the user who posted
  2143. // the comment.
  2144. AuthorProfileImageUrl string `json:"authorProfileImageUrl,omitempty"`
  2145. // CanRate: Whether the current viewer can rate this comment.
  2146. CanRate bool `json:"canRate,omitempty"`
  2147. // ChannelId: The id of the corresponding YouTube channel. In case of a
  2148. // channel comment this is the channel the comment refers to. In case of
  2149. // a video comment it's the video's channel.
  2150. ChannelId string `json:"channelId,omitempty"`
  2151. // LikeCount: The total number of likes this comment has received.
  2152. LikeCount int64 `json:"likeCount,omitempty"`
  2153. // ModerationStatus: The comment's moderation status. Will not be set if
  2154. // the comments were requested through the id filter.
  2155. //
  2156. // Possible values:
  2157. // "heldForReview"
  2158. // "likelySpam"
  2159. // "published"
  2160. // "rejected"
  2161. ModerationStatus string `json:"moderationStatus,omitempty"`
  2162. // ParentId: The unique id of the parent comment, only set for replies.
  2163. ParentId string `json:"parentId,omitempty"`
  2164. // PublishedAt: The date and time when the comment was orignally
  2165. // published. The value is specified in ISO 8601
  2166. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  2167. PublishedAt string `json:"publishedAt,omitempty"`
  2168. // TextDisplay: The comment's text. The format is either plain text or
  2169. // HTML dependent on what has been requested. Even the plain text
  2170. // representation may differ from the text originally posted in that it
  2171. // may replace video links with video titles etc.
  2172. TextDisplay string `json:"textDisplay,omitempty"`
  2173. // TextOriginal: The comment's original raw text as initially posted or
  2174. // last updated. The original text will only be returned if it is
  2175. // accessible to the viewer, which is only guaranteed if the viewer is
  2176. // the comment's author.
  2177. TextOriginal string `json:"textOriginal,omitempty"`
  2178. // UpdatedAt: The date and time when was last updated . The value is
  2179. // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  2180. UpdatedAt string `json:"updatedAt,omitempty"`
  2181. // VideoId: The ID of the video the comment refers to, if any.
  2182. VideoId string `json:"videoId,omitempty"`
  2183. // ViewerRating: The rating the viewer has given to this comment. For
  2184. // the time being this will never return RATE_TYPE_DISLIKE and instead
  2185. // return RATE_TYPE_NONE. This may change in the future.
  2186. //
  2187. // Possible values:
  2188. // "dislike"
  2189. // "like"
  2190. // "none"
  2191. // "unspecified"
  2192. ViewerRating string `json:"viewerRating,omitempty"`
  2193. // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
  2194. // unconditionally include in API requests. By default, fields with
  2195. // empty values are omitted from API requests. However, any non-pointer,
  2196. // non-interface field appearing in ForceSendFields will be sent to the
  2197. // server regardless of whether the field is empty or not. This may be
  2198. // used to include empty fields in Patch requests.
  2199. ForceSendFields []string `json:"-"`
  2200. // NullFields is a list of field names (e.g. "AuthorChannelId") to
  2201. // include in API requests with the JSON null value. By default, fields
  2202. // with empty values are omitted from API requests. However, any field
  2203. // with an empty value appearing in NullFields will be sent to the
  2204. // server as null. It is an error if a field in this list has a
  2205. // non-empty value. This may be used to include null fields in Patch
  2206. // requests.
  2207. NullFields []string `json:"-"`
  2208. }
  2209. func (s *CommentSnippet) MarshalJSON() ([]byte, error) {
  2210. type NoMethod CommentSnippet
  2211. raw := NoMethod(*s)
  2212. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2213. }
  2214. // CommentThread: A comment thread represents information that applies
  2215. // to a top level comment and all its replies. It can also include the
  2216. // top level comment itself and some of the replies.
  2217. type CommentThread struct {
  2218. // Etag: Etag of this resource.
  2219. Etag string `json:"etag,omitempty"`
  2220. // Id: The ID that YouTube uses to uniquely identify the comment thread.
  2221. Id string `json:"id,omitempty"`
  2222. // Kind: Identifies what kind of resource this is. Value: the fixed
  2223. // string "youtube#commentThread".
  2224. Kind string `json:"kind,omitempty"`
  2225. // Replies: The replies object contains a limited number of replies (if
  2226. // any) to the top level comment found in the snippet.
  2227. Replies *CommentThreadReplies `json:"replies,omitempty"`
  2228. // Snippet: The snippet object contains basic details about the comment
  2229. // thread and also the top level comment.
  2230. Snippet *CommentThreadSnippet `json:"snippet,omitempty"`
  2231. // ServerResponse contains the HTTP response code and headers from the
  2232. // server.
  2233. googleapi.ServerResponse `json:"-"`
  2234. // ForceSendFields is a list of field names (e.g. "Etag") to
  2235. // unconditionally include in API requests. By default, fields with
  2236. // empty values are omitted from API requests. However, any non-pointer,
  2237. // non-interface field appearing in ForceSendFields will be sent to the
  2238. // server regardless of whether the field is empty or not. This may be
  2239. // used to include empty fields in Patch requests.
  2240. ForceSendFields []string `json:"-"`
  2241. // NullFields is a list of field names (e.g. "Etag") to include in API
  2242. // requests with the JSON null value. By default, fields with empty
  2243. // values are omitted from API requests. However, any field with an
  2244. // empty value appearing in NullFields will be sent to the server as
  2245. // null. It is an error if a field in this list has a non-empty value.
  2246. // This may be used to include null fields in Patch requests.
  2247. NullFields []string `json:"-"`
  2248. }
  2249. func (s *CommentThread) MarshalJSON() ([]byte, error) {
  2250. type NoMethod CommentThread
  2251. raw := NoMethod(*s)
  2252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2253. }
  2254. type CommentThreadListResponse struct {
  2255. // Etag: Etag of this resource.
  2256. Etag string `json:"etag,omitempty"`
  2257. // EventId: Serialized EventId of the request which produced this
  2258. // response.
  2259. EventId string `json:"eventId,omitempty"`
  2260. // Items: A list of comment threads that match the request criteria.
  2261. Items []*CommentThread `json:"items,omitempty"`
  2262. // Kind: Identifies what kind of resource this is. Value: the fixed
  2263. // string "youtube#commentThreadListResponse".
  2264. Kind string `json:"kind,omitempty"`
  2265. // NextPageToken: The token that can be used as the value of the
  2266. // pageToken parameter to retrieve the next page in the result set.
  2267. NextPageToken string `json:"nextPageToken,omitempty"`
  2268. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2269. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2270. // VisitorId: The visitorId identifies the visitor.
  2271. VisitorId string `json:"visitorId,omitempty"`
  2272. // ServerResponse contains the HTTP response code and headers from the
  2273. // server.
  2274. googleapi.ServerResponse `json:"-"`
  2275. // ForceSendFields is a list of field names (e.g. "Etag") to
  2276. // unconditionally include in API requests. By default, fields with
  2277. // empty values are omitted from API requests. However, any non-pointer,
  2278. // non-interface field appearing in ForceSendFields will be sent to the
  2279. // server regardless of whether the field is empty or not. This may be
  2280. // used to include empty fields in Patch requests.
  2281. ForceSendFields []string `json:"-"`
  2282. // NullFields is a list of field names (e.g. "Etag") to include in API
  2283. // requests with the JSON null value. By default, fields with empty
  2284. // values are omitted from API requests. However, any field with an
  2285. // empty value appearing in NullFields will be sent to the server as
  2286. // null. It is an error if a field in this list has a non-empty value.
  2287. // This may be used to include null fields in Patch requests.
  2288. NullFields []string `json:"-"`
  2289. }
  2290. func (s *CommentThreadListResponse) MarshalJSON() ([]byte, error) {
  2291. type NoMethod CommentThreadListResponse
  2292. raw := NoMethod(*s)
  2293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2294. }
  2295. // CommentThreadReplies: Comments written in (direct or indirect) reply
  2296. // to the top level comment.
  2297. type CommentThreadReplies struct {
  2298. // Comments: A limited number of replies. Unless the number of replies
  2299. // returned equals total_reply_count in the snippet the returned replies
  2300. // are only a subset of the total number of replies.
  2301. Comments []*Comment `json:"comments,omitempty"`
  2302. // ForceSendFields is a list of field names (e.g. "Comments") to
  2303. // unconditionally include in API requests. By default, fields with
  2304. // empty values are omitted from API requests. However, any non-pointer,
  2305. // non-interface field appearing in ForceSendFields will be sent to the
  2306. // server regardless of whether the field is empty or not. This may be
  2307. // used to include empty fields in Patch requests.
  2308. ForceSendFields []string `json:"-"`
  2309. // NullFields is a list of field names (e.g. "Comments") to include in
  2310. // API requests with the JSON null value. By default, fields with empty
  2311. // values are omitted from API requests. However, any field with an
  2312. // empty value appearing in NullFields will be sent to the server as
  2313. // null. It is an error if a field in this list has a non-empty value.
  2314. // This may be used to include null fields in Patch requests.
  2315. NullFields []string `json:"-"`
  2316. }
  2317. func (s *CommentThreadReplies) MarshalJSON() ([]byte, error) {
  2318. type NoMethod CommentThreadReplies
  2319. raw := NoMethod(*s)
  2320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2321. }
  2322. // CommentThreadSnippet: Basic details about a comment thread.
  2323. type CommentThreadSnippet struct {
  2324. // CanReply: Whether the current viewer of the thread can reply to it.
  2325. // This is viewer specific - other viewers may see a different value for
  2326. // this field.
  2327. CanReply bool `json:"canReply,omitempty"`
  2328. // ChannelId: The YouTube channel the comments in the thread refer to or
  2329. // the channel with the video the comments refer to. If video_id isn't
  2330. // set the comments refer to the channel itself.
  2331. ChannelId string `json:"channelId,omitempty"`
  2332. // IsPublic: Whether the thread (and therefore all its comments) is
  2333. // visible to all YouTube users.
  2334. IsPublic bool `json:"isPublic,omitempty"`
  2335. // TopLevelComment: The top level comment of this thread.
  2336. TopLevelComment *Comment `json:"topLevelComment,omitempty"`
  2337. // TotalReplyCount: The total number of replies (not including the top
  2338. // level comment).
  2339. TotalReplyCount int64 `json:"totalReplyCount,omitempty"`
  2340. // VideoId: The ID of the video the comments refer to, if any. No
  2341. // video_id implies a channel discussion comment.
  2342. VideoId string `json:"videoId,omitempty"`
  2343. // ForceSendFields is a list of field names (e.g. "CanReply") to
  2344. // unconditionally include in API requests. By default, fields with
  2345. // empty values are omitted from API requests. However, any non-pointer,
  2346. // non-interface field appearing in ForceSendFields will be sent to the
  2347. // server regardless of whether the field is empty or not. This may be
  2348. // used to include empty fields in Patch requests.
  2349. ForceSendFields []string `json:"-"`
  2350. // NullFields is a list of field names (e.g. "CanReply") to include in
  2351. // API requests with the JSON null value. By default, fields with empty
  2352. // values are omitted from API requests. However, any field with an
  2353. // empty value appearing in NullFields will be sent to the server as
  2354. // null. It is an error if a field in this list has a non-empty value.
  2355. // This may be used to include null fields in Patch requests.
  2356. NullFields []string `json:"-"`
  2357. }
  2358. func (s *CommentThreadSnippet) MarshalJSON() ([]byte, error) {
  2359. type NoMethod CommentThreadSnippet
  2360. raw := NoMethod(*s)
  2361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2362. }
  2363. // ContentRating: Ratings schemes. The country-specific ratings are
  2364. // mostly for movies and shows. NEXT_ID: 71
  2365. type ContentRating struct {
  2366. // AcbRating: The video's Australian Classification Board (ACB) or
  2367. // Australian Communications and Media Authority (ACMA) rating. ACMA
  2368. // ratings are used to classify children's television programming.
  2369. //
  2370. // Possible values:
  2371. // "acbC"
  2372. // "acbE"
  2373. // "acbG"
  2374. // "acbM"
  2375. // "acbMa15plus"
  2376. // "acbP"
  2377. // "acbPg"
  2378. // "acbR18plus"
  2379. // "acbUnrated"
  2380. AcbRating string `json:"acbRating,omitempty"`
  2381. // AgcomRating: The video's rating from Italy's Autorità per le
  2382. // Garanzie nelle Comunicazioni (AGCOM).
  2383. //
  2384. // Possible values:
  2385. // "agcomT"
  2386. // "agcomUnrated"
  2387. // "agcomVm14"
  2388. // "agcomVm18"
  2389. AgcomRating string `json:"agcomRating,omitempty"`
  2390. // AnatelRating: The video's Anatel (Asociación Nacional de
  2391. // Televisión) rating for Chilean television.
  2392. //
  2393. // Possible values:
  2394. // "anatelA"
  2395. // "anatelF"
  2396. // "anatelI"
  2397. // "anatelI10"
  2398. // "anatelI12"
  2399. // "anatelI7"
  2400. // "anatelR"
  2401. // "anatelUnrated"
  2402. AnatelRating string `json:"anatelRating,omitempty"`
  2403. // BbfcRating: The video's British Board of Film Classification (BBFC)
  2404. // rating.
  2405. //
  2406. // Possible values:
  2407. // "bbfc12"
  2408. // "bbfc12a"
  2409. // "bbfc15"
  2410. // "bbfc18"
  2411. // "bbfcPg"
  2412. // "bbfcR18"
  2413. // "bbfcU"
  2414. // "bbfcUnrated"
  2415. BbfcRating string `json:"bbfcRating,omitempty"`
  2416. // BfvcRating: The video's rating from Thailand's Board of Film and
  2417. // Video Censors.
  2418. //
  2419. // Possible values:
  2420. // "bfvc13"
  2421. // "bfvc15"
  2422. // "bfvc18"
  2423. // "bfvc20"
  2424. // "bfvcB"
  2425. // "bfvcE"
  2426. // "bfvcG"
  2427. // "bfvcUnrated"
  2428. BfvcRating string `json:"bfvcRating,omitempty"`
  2429. // BmukkRating: The video's rating from the Austrian Board of Media
  2430. // Classification (Bundesministerium für Unterricht, Kunst und Kultur).
  2431. //
  2432. // Possible values:
  2433. // "bmukk10"
  2434. // "bmukk12"
  2435. // "bmukk14"
  2436. // "bmukk16"
  2437. // "bmukk6"
  2438. // "bmukk8"
  2439. // "bmukkAa"
  2440. // "bmukkUnrated"
  2441. BmukkRating string `json:"bmukkRating,omitempty"`
  2442. // CatvRating: Rating system for Canadian TV - Canadian TV
  2443. // Classification System The video's rating from the Canadian
  2444. // Radio-Television and Telecommunications Commission (CRTC) for
  2445. // Canadian English-language broadcasts. For more information, see the
  2446. // Canadian Broadcast Standards Council website.
  2447. //
  2448. // Possible values:
  2449. // "catv14plus"
  2450. // "catv18plus"
  2451. // "catvC"
  2452. // "catvC8"
  2453. // "catvG"
  2454. // "catvPg"
  2455. // "catvUnrated"
  2456. CatvRating string `json:"catvRating,omitempty"`
  2457. // CatvfrRating: The video's rating from the Canadian Radio-Television
  2458. // and Telecommunications Commission (CRTC) for Canadian French-language
  2459. // broadcasts. For more information, see the Canadian Broadcast
  2460. // Standards Council website.
  2461. //
  2462. // Possible values:
  2463. // "catvfr13plus"
  2464. // "catvfr16plus"
  2465. // "catvfr18plus"
  2466. // "catvfr8plus"
  2467. // "catvfrG"
  2468. // "catvfrUnrated"
  2469. CatvfrRating string `json:"catvfrRating,omitempty"`
  2470. // CbfcRating: The video's Central Board of Film Certification (CBFC -
  2471. // India) rating.
  2472. //
  2473. // Possible values:
  2474. // "cbfcA"
  2475. // "cbfcS"
  2476. // "cbfcU"
  2477. // "cbfcUA"
  2478. // "cbfcUnrated"
  2479. CbfcRating string `json:"cbfcRating,omitempty"`
  2480. // CccRating: The video's Consejo de Calificación Cinematográfica
  2481. // (Chile) rating.
  2482. //
  2483. // Possible values:
  2484. // "ccc14"
  2485. // "ccc18"
  2486. // "ccc18s"
  2487. // "ccc18v"
  2488. // "ccc6"
  2489. // "cccTe"
  2490. // "cccUnrated"
  2491. CccRating string `json:"cccRating,omitempty"`
  2492. // CceRating: The video's rating from Portugal's Comissão de
  2493. // Classificação de Espect´culos.
  2494. //
  2495. // Possible values:
  2496. // "cceM12"
  2497. // "cceM14"
  2498. // "cceM16"
  2499. // "cceM18"
  2500. // "cceM4"
  2501. // "cceM6"
  2502. // "cceUnrated"
  2503. CceRating string `json:"cceRating,omitempty"`
  2504. // ChfilmRating: The video's rating in Switzerland.
  2505. //
  2506. // Possible values:
  2507. // "chfilm0"
  2508. // "chfilm12"
  2509. // "chfilm16"
  2510. // "chfilm18"
  2511. // "chfilm6"
  2512. // "chfilmUnrated"
  2513. ChfilmRating string `json:"chfilmRating,omitempty"`
  2514. // ChvrsRating: The video's Canadian Home Video Rating System (CHVRS)
  2515. // rating.
  2516. //
  2517. // Possible values:
  2518. // "chvrs14a"
  2519. // "chvrs18a"
  2520. // "chvrsE"
  2521. // "chvrsG"
  2522. // "chvrsPg"
  2523. // "chvrsR"
  2524. // "chvrsUnrated"
  2525. ChvrsRating string `json:"chvrsRating,omitempty"`
  2526. // CicfRating: The video's rating from the Commission de Contrôle des
  2527. // Films (Belgium).
  2528. //
  2529. // Possible values:
  2530. // "cicfE"
  2531. // "cicfKntEna"
  2532. // "cicfKtEa"
  2533. // "cicfUnrated"
  2534. CicfRating string `json:"cicfRating,omitempty"`
  2535. // CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL
  2536. // AUDIOVIZUALULUI (CNA).
  2537. //
  2538. // Possible values:
  2539. // "cna12"
  2540. // "cna15"
  2541. // "cna18"
  2542. // "cna18plus"
  2543. // "cnaAp"
  2544. // "cnaUnrated"
  2545. CnaRating string `json:"cnaRating,omitempty"`
  2546. // CncRating: Rating system in France - Commission de classification
  2547. // cinematographique
  2548. //
  2549. // Possible values:
  2550. // "cnc10"
  2551. // "cnc12"
  2552. // "cnc16"
  2553. // "cnc18"
  2554. // "cncE"
  2555. // "cncInterdiction"
  2556. // "cncT"
  2557. // "cncUnrated"
  2558. CncRating string `json:"cncRating,omitempty"`
  2559. // CsaRating: The video's rating from France's Conseil supérieur de
  2560. // l?audiovisuel, which rates broadcast content.
  2561. //
  2562. // Possible values:
  2563. // "csa10"
  2564. // "csa12"
  2565. // "csa16"
  2566. // "csa18"
  2567. // "csaInterdiction"
  2568. // "csaT"
  2569. // "csaUnrated"
  2570. CsaRating string `json:"csaRating,omitempty"`
  2571. // CscfRating: The video's rating from Luxembourg's Commission de
  2572. // surveillance de la classification des films (CSCF).
  2573. //
  2574. // Possible values:
  2575. // "cscf12"
  2576. // "cscf16"
  2577. // "cscf18"
  2578. // "cscf6"
  2579. // "cscf9"
  2580. // "cscfA"
  2581. // "cscfAl"
  2582. // "cscfUnrated"
  2583. CscfRating string `json:"cscfRating,omitempty"`
  2584. // CzfilmRating: The video's rating in the Czech Republic.
  2585. //
  2586. // Possible values:
  2587. // "czfilm12"
  2588. // "czfilm14"
  2589. // "czfilm18"
  2590. // "czfilmU"
  2591. // "czfilmUnrated"
  2592. CzfilmRating string `json:"czfilmRating,omitempty"`
  2593. // DjctqRating: The video's Departamento de Justiça, Classificação,
  2594. // Qualificação e Títulos (DJCQT - Brazil) rating.
  2595. //
  2596. // Possible values:
  2597. // "djctq10"
  2598. // "djctq1012"
  2599. // "djctq1014"
  2600. // "djctq1016"
  2601. // "djctq1018"
  2602. // "djctq12"
  2603. // "djctq1214"
  2604. // "djctq1216"
  2605. // "djctq1218"
  2606. // "djctq14"
  2607. // "djctq1416"
  2608. // "djctq1418"
  2609. // "djctq16"
  2610. // "djctq1618"
  2611. // "djctq18"
  2612. // "djctqEr"
  2613. // "djctqL"
  2614. // "djctqL10"
  2615. // "djctqL12"
  2616. // "djctqL14"
  2617. // "djctqL16"
  2618. // "djctqL18"
  2619. // "djctqUnrated"
  2620. DjctqRating string `json:"djctqRating,omitempty"`
  2621. // DjctqRatingReasons: Reasons that explain why the video received its
  2622. // DJCQT (Brazil) rating.
  2623. //
  2624. // Possible values:
  2625. // "djctqCriminalActs"
  2626. // "djctqDrugs"
  2627. // "djctqExplicitSex"
  2628. // "djctqExtremeViolence"
  2629. // "djctqIllegalDrugs"
  2630. // "djctqImpactingContent"
  2631. // "djctqInappropriateLanguage"
  2632. // "djctqLegalDrugs"
  2633. // "djctqNudity"
  2634. // "djctqSex"
  2635. // "djctqSexualContent"
  2636. // "djctqViolence"
  2637. DjctqRatingReasons []string `json:"djctqRatingReasons,omitempty"`
  2638. // EcbmctRating: Rating system in Turkey - Evaluation and Classification
  2639. // Board of the Ministry of Culture and Tourism
  2640. //
  2641. // Possible values:
  2642. // "ecbmct13a"
  2643. // "ecbmct13plus"
  2644. // "ecbmct15a"
  2645. // "ecbmct15plus"
  2646. // "ecbmct18plus"
  2647. // "ecbmct7a"
  2648. // "ecbmct7plus"
  2649. // "ecbmctG"
  2650. // "ecbmctUnrated"
  2651. EcbmctRating string `json:"ecbmctRating,omitempty"`
  2652. // EefilmRating: The video's rating in Estonia.
  2653. //
  2654. // Possible values:
  2655. // "eefilmK12"
  2656. // "eefilmK14"
  2657. // "eefilmK16"
  2658. // "eefilmK6"
  2659. // "eefilmL"
  2660. // "eefilmMs12"
  2661. // "eefilmMs6"
  2662. // "eefilmPere"
  2663. // "eefilmUnrated"
  2664. EefilmRating string `json:"eefilmRating,omitempty"`
  2665. // EgfilmRating: The video's rating in Egypt.
  2666. //
  2667. // Possible values:
  2668. // "egfilm18"
  2669. // "egfilmBn"
  2670. // "egfilmGn"
  2671. // "egfilmUnrated"
  2672. EgfilmRating string `json:"egfilmRating,omitempty"`
  2673. // EirinRating: The video's Eirin (映倫) rating. Eirin is the Japanese
  2674. // rating system.
  2675. //
  2676. // Possible values:
  2677. // "eirinG"
  2678. // "eirinPg12"
  2679. // "eirinR15plus"
  2680. // "eirinR18plus"
  2681. // "eirinUnrated"
  2682. EirinRating string `json:"eirinRating,omitempty"`
  2683. // FcbmRating: The video's rating from Malaysia's Film Censorship Board.
  2684. //
  2685. // Possible values:
  2686. // "fcbm18"
  2687. // "fcbm18pa"
  2688. // "fcbm18pl"
  2689. // "fcbm18sg"
  2690. // "fcbm18sx"
  2691. // "fcbmP13"
  2692. // "fcbmPg13"
  2693. // "fcbmU"
  2694. // "fcbmUnrated"
  2695. FcbmRating string `json:"fcbmRating,omitempty"`
  2696. // FcoRating: The video's rating from Hong Kong's Office for Film,
  2697. // Newspaper and Article Administration.
  2698. //
  2699. // Possible values:
  2700. // "fcoI"
  2701. // "fcoIi"
  2702. // "fcoIia"
  2703. // "fcoIib"
  2704. // "fcoIii"
  2705. // "fcoUnrated"
  2706. FcoRating string `json:"fcoRating,omitempty"`
  2707. // FmocRating: This property has been deprecated. Use the
  2708. // contentDetails.contentRating.cncRating instead.
  2709. //
  2710. // Possible values:
  2711. // "fmoc10"
  2712. // "fmoc12"
  2713. // "fmoc16"
  2714. // "fmoc18"
  2715. // "fmocE"
  2716. // "fmocU"
  2717. // "fmocUnrated"
  2718. FmocRating string `json:"fmocRating,omitempty"`
  2719. // FpbRating: The video's rating from South Africa's Film and
  2720. // Publication Board.
  2721. //
  2722. // Possible values:
  2723. // "fpb10"
  2724. // "fpb1012Pg"
  2725. // "fpb13"
  2726. // "fpb16"
  2727. // "fpb18"
  2728. // "fpb79Pg"
  2729. // "fpbA"
  2730. // "fpbPg"
  2731. // "fpbUnrated"
  2732. // "fpbX18"
  2733. // "fpbXx"
  2734. FpbRating string `json:"fpbRating,omitempty"`
  2735. // FpbRatingReasons: Reasons that explain why the video received its FPB
  2736. // (South Africa) rating.
  2737. //
  2738. // Possible values:
  2739. // "fpbBlasphemy"
  2740. // "fpbCriminalTechniques"
  2741. // "fpbDrugs"
  2742. // "fpbHorror"
  2743. // "fpbImitativeActsTechniques"
  2744. // "fpbLanguage"
  2745. // "fpbNudity"
  2746. // "fpbPrejudice"
  2747. // "fpbSex"
  2748. // "fpbSexualViolence"
  2749. // "fpbViolence"
  2750. FpbRatingReasons []string `json:"fpbRatingReasons,omitempty"`
  2751. // FskRating: The video's Freiwillige Selbstkontrolle der Filmwirtschaft
  2752. // (FSK - Germany) rating.
  2753. //
  2754. // Possible values:
  2755. // "fsk0"
  2756. // "fsk12"
  2757. // "fsk16"
  2758. // "fsk18"
  2759. // "fsk6"
  2760. // "fskUnrated"
  2761. FskRating string `json:"fskRating,omitempty"`
  2762. // GrfilmRating: The video's rating in Greece.
  2763. //
  2764. // Possible values:
  2765. // "grfilmE"
  2766. // "grfilmK"
  2767. // "grfilmK12"
  2768. // "grfilmK13"
  2769. // "grfilmK15"
  2770. // "grfilmK17"
  2771. // "grfilmK18"
  2772. // "grfilmUnrated"
  2773. GrfilmRating string `json:"grfilmRating,omitempty"`
  2774. // IcaaRating: The video's Instituto de la Cinematografía y de las
  2775. // Artes Audiovisuales (ICAA - Spain) rating.
  2776. //
  2777. // Possible values:
  2778. // "icaa12"
  2779. // "icaa13"
  2780. // "icaa16"
  2781. // "icaa18"
  2782. // "icaa7"
  2783. // "icaaApta"
  2784. // "icaaUnrated"
  2785. // "icaaX"
  2786. IcaaRating string `json:"icaaRating,omitempty"`
  2787. // IfcoRating: The video's Irish Film Classification Office (IFCO -
  2788. // Ireland) rating. See the IFCO website for more information.
  2789. //
  2790. // Possible values:
  2791. // "ifco12"
  2792. // "ifco12a"
  2793. // "ifco15"
  2794. // "ifco15a"
  2795. // "ifco16"
  2796. // "ifco18"
  2797. // "ifcoG"
  2798. // "ifcoPg"
  2799. // "ifcoUnrated"
  2800. IfcoRating string `json:"ifcoRating,omitempty"`
  2801. // IlfilmRating: The video's rating in Israel.
  2802. //
  2803. // Possible values:
  2804. // "ilfilm12"
  2805. // "ilfilm14"
  2806. // "ilfilm16"
  2807. // "ilfilm18"
  2808. // "ilfilmAa"
  2809. // "ilfilmUnrated"
  2810. IlfilmRating string `json:"ilfilmRating,omitempty"`
  2811. // IncaaRating: The video's INCAA (Instituto Nacional de Cine y Artes
  2812. // Audiovisuales - Argentina) rating.
  2813. //
  2814. // Possible values:
  2815. // "incaaAtp"
  2816. // "incaaC"
  2817. // "incaaSam13"
  2818. // "incaaSam16"
  2819. // "incaaSam18"
  2820. // "incaaUnrated"
  2821. IncaaRating string `json:"incaaRating,omitempty"`
  2822. // KfcbRating: The video's rating from the Kenya Film Classification
  2823. // Board.
  2824. //
  2825. // Possible values:
  2826. // "kfcb16plus"
  2827. // "kfcbG"
  2828. // "kfcbPg"
  2829. // "kfcbR"
  2830. // "kfcbUnrated"
  2831. KfcbRating string `json:"kfcbRating,omitempty"`
  2832. // KijkwijzerRating: voor de Classificatie van Audiovisuele Media
  2833. // (Netherlands).
  2834. //
  2835. // Possible values:
  2836. // "kijkwijzer12"
  2837. // "kijkwijzer16"
  2838. // "kijkwijzer18"
  2839. // "kijkwijzer6"
  2840. // "kijkwijzer9"
  2841. // "kijkwijzerAl"
  2842. // "kijkwijzerUnrated"
  2843. KijkwijzerRating string `json:"kijkwijzerRating,omitempty"`
  2844. // KmrbRating: The video's Korea Media Rating Board
  2845. // (영상물등급위원회) rating. The KMRB rates videos in South
  2846. // Korea.
  2847. //
  2848. // Possible values:
  2849. // "kmrb12plus"
  2850. // "kmrb15plus"
  2851. // "kmrbAll"
  2852. // "kmrbR"
  2853. // "kmrbTeenr"
  2854. // "kmrbUnrated"
  2855. KmrbRating string `json:"kmrbRating,omitempty"`
  2856. // LsfRating: The video's rating from Indonesia's Lembaga Sensor Film.
  2857. //
  2858. // Possible values:
  2859. // "lsf13"
  2860. // "lsf17"
  2861. // "lsf21"
  2862. // "lsfA"
  2863. // "lsfBo"
  2864. // "lsfD"
  2865. // "lsfR"
  2866. // "lsfSu"
  2867. // "lsfUnrated"
  2868. LsfRating string `json:"lsfRating,omitempty"`
  2869. // MccaaRating: The video's rating from Malta's Film Age-Classification
  2870. // Board.
  2871. //
  2872. // Possible values:
  2873. // "mccaa12"
  2874. // "mccaa12a"
  2875. // "mccaa14"
  2876. // "mccaa15"
  2877. // "mccaa16"
  2878. // "mccaa18"
  2879. // "mccaaPg"
  2880. // "mccaaU"
  2881. // "mccaaUnrated"
  2882. MccaaRating string `json:"mccaaRating,omitempty"`
  2883. // MccypRating: The video's rating from the Danish Film Institute's (Det
  2884. // Danske Filminstitut) Media Council for Children and Young People.
  2885. //
  2886. // Possible values:
  2887. // "mccyp11"
  2888. // "mccyp15"
  2889. // "mccyp7"
  2890. // "mccypA"
  2891. // "mccypUnrated"
  2892. MccypRating string `json:"mccypRating,omitempty"`
  2893. // McstRating: The video's rating system for Vietnam - MCST
  2894. //
  2895. // Possible values:
  2896. // "mcst0"
  2897. // "mcst16plus"
  2898. // "mcstC13"
  2899. // "mcstC16"
  2900. // "mcstC18"
  2901. // "mcstGPg"
  2902. // "mcstP"
  2903. // "mcstUnrated"
  2904. McstRating string `json:"mcstRating,omitempty"`
  2905. // MdaRating: The video's rating from Singapore's Media Development
  2906. // Authority (MDA) and, specifically, it's Board of Film Censors (BFC).
  2907. //
  2908. // Possible values:
  2909. // "mdaG"
  2910. // "mdaM18"
  2911. // "mdaNc16"
  2912. // "mdaPg"
  2913. // "mdaPg13"
  2914. // "mdaR21"
  2915. // "mdaUnrated"
  2916. MdaRating string `json:"mdaRating,omitempty"`
  2917. // MedietilsynetRating: The video's rating from Medietilsynet, the
  2918. // Norwegian Media Authority.
  2919. //
  2920. // Possible values:
  2921. // "medietilsynet11"
  2922. // "medietilsynet12"
  2923. // "medietilsynet15"
  2924. // "medietilsynet18"
  2925. // "medietilsynet6"
  2926. // "medietilsynet7"
  2927. // "medietilsynet9"
  2928. // "medietilsynetA"
  2929. // "medietilsynetUnrated"
  2930. MedietilsynetRating string `json:"medietilsynetRating,omitempty"`
  2931. // MekuRating: The video's rating from Finland's Kansallinen
  2932. // Audiovisuaalinen Instituutti (National Audiovisual Institute).
  2933. //
  2934. // Possible values:
  2935. // "meku12"
  2936. // "meku16"
  2937. // "meku18"
  2938. // "meku7"
  2939. // "mekuS"
  2940. // "mekuUnrated"
  2941. MekuRating string `json:"mekuRating,omitempty"`
  2942. // MenaMpaaRating: The rating system for MENA countries, a clone of
  2943. // MPAA. It is needed to
  2944. //
  2945. // Possible values:
  2946. // "menaMpaaG"
  2947. // "menaMpaaPg"
  2948. // "menaMpaaPg13"
  2949. // "menaMpaaR"
  2950. // "menaMpaaUnrated"
  2951. MenaMpaaRating string `json:"menaMpaaRating,omitempty"`
  2952. // MibacRating: The video's rating from the Ministero dei Beni e delle
  2953. // Attività Culturali e del Turismo (Italy).
  2954. //
  2955. // Possible values:
  2956. // "mibacT"
  2957. // "mibacUnrated"
  2958. // "mibacVap"
  2959. // "mibacVm12"
  2960. // "mibacVm14"
  2961. // "mibacVm18"
  2962. MibacRating string `json:"mibacRating,omitempty"`
  2963. // MocRating: The video's Ministerio de Cultura (Colombia) rating.
  2964. //
  2965. // Possible values:
  2966. // "moc12"
  2967. // "moc15"
  2968. // "moc18"
  2969. // "moc7"
  2970. // "mocBanned"
  2971. // "mocE"
  2972. // "mocT"
  2973. // "mocUnrated"
  2974. // "mocX"
  2975. MocRating string `json:"mocRating,omitempty"`
  2976. // MoctwRating: The video's rating from Taiwan's Ministry of Culture
  2977. // (文化部).
  2978. //
  2979. // Possible values:
  2980. // "moctwG"
  2981. // "moctwP"
  2982. // "moctwPg"
  2983. // "moctwR"
  2984. // "moctwR12"
  2985. // "moctwR15"
  2986. // "moctwUnrated"
  2987. MoctwRating string `json:"moctwRating,omitempty"`
  2988. // MpaaRating: The video's Motion Picture Association of America (MPAA)
  2989. // rating.
  2990. //
  2991. // Possible values:
  2992. // "mpaaG"
  2993. // "mpaaNc17"
  2994. // "mpaaPg"
  2995. // "mpaaPg13"
  2996. // "mpaaR"
  2997. // "mpaaUnrated"
  2998. // "mpaaX"
  2999. MpaaRating string `json:"mpaaRating,omitempty"`
  3000. // MpaatRating: The rating system for trailer, DVD, and Ad in the US.
  3001. // See http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html.
  3002. //
  3003. // Possible values:
  3004. // "mpaatGb"
  3005. // "mpaatRb"
  3006. MpaatRating string `json:"mpaatRating,omitempty"`
  3007. // MtrcbRating: The video's rating from the Movie and Television Review
  3008. // and Classification Board (Philippines).
  3009. //
  3010. // Possible values:
  3011. // "mtrcbG"
  3012. // "mtrcbPg"
  3013. // "mtrcbR13"
  3014. // "mtrcbR16"
  3015. // "mtrcbR18"
  3016. // "mtrcbUnrated"
  3017. // "mtrcbX"
  3018. MtrcbRating string `json:"mtrcbRating,omitempty"`
  3019. // NbcRating: The video's rating from the Maldives National Bureau of
  3020. // Classification.
  3021. //
  3022. // Possible values:
  3023. // "nbc12plus"
  3024. // "nbc15plus"
  3025. // "nbc18plus"
  3026. // "nbc18plusr"
  3027. // "nbcG"
  3028. // "nbcPg"
  3029. // "nbcPu"
  3030. // "nbcUnrated"
  3031. NbcRating string `json:"nbcRating,omitempty"`
  3032. // NbcplRating: The video's rating in Poland.
  3033. //
  3034. // Possible values:
  3035. // "nbcpl18plus"
  3036. // "nbcplI"
  3037. // "nbcplIi"
  3038. // "nbcplIii"
  3039. // "nbcplIv"
  3040. // "nbcplUnrated"
  3041. NbcplRating string `json:"nbcplRating,omitempty"`
  3042. // NfrcRating: The video's rating from the Bulgarian National Film
  3043. // Center.
  3044. //
  3045. // Possible values:
  3046. // "nfrcA"
  3047. // "nfrcB"
  3048. // "nfrcC"
  3049. // "nfrcD"
  3050. // "nfrcUnrated"
  3051. // "nfrcX"
  3052. NfrcRating string `json:"nfrcRating,omitempty"`
  3053. // NfvcbRating: The video's rating from Nigeria's National Film and
  3054. // Video Censors Board.
  3055. //
  3056. // Possible values:
  3057. // "nfvcb12"
  3058. // "nfvcb12a"
  3059. // "nfvcb15"
  3060. // "nfvcb18"
  3061. // "nfvcbG"
  3062. // "nfvcbPg"
  3063. // "nfvcbRe"
  3064. // "nfvcbUnrated"
  3065. NfvcbRating string `json:"nfvcbRating,omitempty"`
  3066. // NkclvRating: The video's rating from the Nacionãlais Kino centrs
  3067. // (National Film Centre of Latvia).
  3068. //
  3069. // Possible values:
  3070. // "nkclv12plus"
  3071. // "nkclv18plus"
  3072. // "nkclv7plus"
  3073. // "nkclvU"
  3074. // "nkclvUnrated"
  3075. NkclvRating string `json:"nkclvRating,omitempty"`
  3076. // OflcRating: The video's Office of Film and Literature Classification
  3077. // (OFLC - New Zealand) rating.
  3078. //
  3079. // Possible values:
  3080. // "oflcG"
  3081. // "oflcM"
  3082. // "oflcPg"
  3083. // "oflcR13"
  3084. // "oflcR15"
  3085. // "oflcR16"
  3086. // "oflcR18"
  3087. // "oflcRp13"
  3088. // "oflcRp16"
  3089. // "oflcRp18"
  3090. // "oflcUnrated"
  3091. OflcRating string `json:"oflcRating,omitempty"`
  3092. // PefilmRating: The video's rating in Peru.
  3093. //
  3094. // Possible values:
  3095. // "pefilm14"
  3096. // "pefilm18"
  3097. // "pefilmPg"
  3098. // "pefilmPt"
  3099. // "pefilmUnrated"
  3100. PefilmRating string `json:"pefilmRating,omitempty"`
  3101. // RcnofRating: The video's rating from the Hungarian Nemzeti Filmiroda,
  3102. // the Rating Committee of the National Office of Film.
  3103. //
  3104. // Possible values:
  3105. // "rcnofI"
  3106. // "rcnofIi"
  3107. // "rcnofIii"
  3108. // "rcnofIv"
  3109. // "rcnofUnrated"
  3110. // "rcnofV"
  3111. // "rcnofVi"
  3112. RcnofRating string `json:"rcnofRating,omitempty"`
  3113. // ResorteviolenciaRating: The video's rating in Venezuela.
  3114. //
  3115. // Possible values:
  3116. // "resorteviolenciaA"
  3117. // "resorteviolenciaB"
  3118. // "resorteviolenciaC"
  3119. // "resorteviolenciaD"
  3120. // "resorteviolenciaE"
  3121. // "resorteviolenciaUnrated"
  3122. ResorteviolenciaRating string `json:"resorteviolenciaRating,omitempty"`
  3123. // RtcRating: The video's General Directorate of Radio, Television and
  3124. // Cinematography (Mexico) rating.
  3125. //
  3126. // Possible values:
  3127. // "rtcA"
  3128. // "rtcAa"
  3129. // "rtcB"
  3130. // "rtcB15"
  3131. // "rtcC"
  3132. // "rtcD"
  3133. // "rtcUnrated"
  3134. RtcRating string `json:"rtcRating,omitempty"`
  3135. // RteRating: The video's rating from Ireland's Raidió Teilifís
  3136. // Éireann.
  3137. //
  3138. // Possible values:
  3139. // "rteCh"
  3140. // "rteGa"
  3141. // "rteMa"
  3142. // "rtePs"
  3143. // "rteUnrated"
  3144. RteRating string `json:"rteRating,omitempty"`
  3145. // RussiaRating: The video's National Film Registry of the Russian
  3146. // Federation (MKRF - Russia) rating.
  3147. //
  3148. // Possible values:
  3149. // "russia0"
  3150. // "russia12"
  3151. // "russia16"
  3152. // "russia18"
  3153. // "russia6"
  3154. // "russiaUnrated"
  3155. RussiaRating string `json:"russiaRating,omitempty"`
  3156. // SkfilmRating: The video's rating in Slovakia.
  3157. //
  3158. // Possible values:
  3159. // "skfilmG"
  3160. // "skfilmP2"
  3161. // "skfilmP5"
  3162. // "skfilmP8"
  3163. // "skfilmUnrated"
  3164. SkfilmRating string `json:"skfilmRating,omitempty"`
  3165. // SmaisRating: The video's rating in Iceland.
  3166. //
  3167. // Possible values:
  3168. // "smais12"
  3169. // "smais14"
  3170. // "smais16"
  3171. // "smais18"
  3172. // "smais7"
  3173. // "smaisL"
  3174. // "smaisUnrated"
  3175. SmaisRating string `json:"smaisRating,omitempty"`
  3176. // SmsaRating: The video's rating from Statens medieråd (Sweden's
  3177. // National Media Council).
  3178. //
  3179. // Possible values:
  3180. // "smsa11"
  3181. // "smsa15"
  3182. // "smsa7"
  3183. // "smsaA"
  3184. // "smsaUnrated"
  3185. SmsaRating string `json:"smsaRating,omitempty"`
  3186. // TvpgRating: The video's TV Parental Guidelines (TVPG) rating.
  3187. //
  3188. // Possible values:
  3189. // "pg14"
  3190. // "tvpgG"
  3191. // "tvpgMa"
  3192. // "tvpgPg"
  3193. // "tvpgUnrated"
  3194. // "tvpgY"
  3195. // "tvpgY7"
  3196. // "tvpgY7Fv"
  3197. TvpgRating string `json:"tvpgRating,omitempty"`
  3198. // YtRating: A rating that YouTube uses to identify age-restricted
  3199. // content.
  3200. //
  3201. // Possible values:
  3202. // "ytAgeRestricted"
  3203. YtRating string `json:"ytRating,omitempty"`
  3204. // ForceSendFields is a list of field names (e.g. "AcbRating") to
  3205. // unconditionally include in API requests. By default, fields with
  3206. // empty values are omitted from API requests. However, any non-pointer,
  3207. // non-interface field appearing in ForceSendFields will be sent to the
  3208. // server regardless of whether the field is empty or not. This may be
  3209. // used to include empty fields in Patch requests.
  3210. ForceSendFields []string `json:"-"`
  3211. // NullFields is a list of field names (e.g. "AcbRating") to include in
  3212. // API requests with the JSON null value. By default, fields with empty
  3213. // values are omitted from API requests. However, any field with an
  3214. // empty value appearing in NullFields will be sent to the server as
  3215. // null. It is an error if a field in this list has a non-empty value.
  3216. // This may be used to include null fields in Patch requests.
  3217. NullFields []string `json:"-"`
  3218. }
  3219. func (s *ContentRating) MarshalJSON() ([]byte, error) {
  3220. type NoMethod ContentRating
  3221. raw := NoMethod(*s)
  3222. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3223. }
  3224. // GeoPoint: Geographical coordinates of a point, in WGS84.
  3225. type GeoPoint struct {
  3226. // Altitude: Altitude above the reference ellipsoid, in meters.
  3227. Altitude float64 `json:"altitude,omitempty"`
  3228. // Latitude: Latitude in degrees.
  3229. Latitude float64 `json:"latitude,omitempty"`
  3230. // Longitude: Longitude in degrees.
  3231. Longitude float64 `json:"longitude,omitempty"`
  3232. // ForceSendFields is a list of field names (e.g. "Altitude") to
  3233. // unconditionally include in API requests. By default, fields with
  3234. // empty values are omitted from API requests. However, any non-pointer,
  3235. // non-interface field appearing in ForceSendFields will be sent to the
  3236. // server regardless of whether the field is empty or not. This may be
  3237. // used to include empty fields in Patch requests.
  3238. ForceSendFields []string `json:"-"`
  3239. // NullFields is a list of field names (e.g. "Altitude") to include in
  3240. // API requests with the JSON null value. By default, fields with empty
  3241. // values are omitted from API requests. However, any field with an
  3242. // empty value appearing in NullFields will be sent to the server as
  3243. // null. It is an error if a field in this list has a non-empty value.
  3244. // This may be used to include null fields in Patch requests.
  3245. NullFields []string `json:"-"`
  3246. }
  3247. func (s *GeoPoint) MarshalJSON() ([]byte, error) {
  3248. type NoMethod GeoPoint
  3249. raw := NoMethod(*s)
  3250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3251. }
  3252. func (s *GeoPoint) UnmarshalJSON(data []byte) error {
  3253. type NoMethod GeoPoint
  3254. var s1 struct {
  3255. Altitude gensupport.JSONFloat64 `json:"altitude"`
  3256. Latitude gensupport.JSONFloat64 `json:"latitude"`
  3257. Longitude gensupport.JSONFloat64 `json:"longitude"`
  3258. *NoMethod
  3259. }
  3260. s1.NoMethod = (*NoMethod)(s)
  3261. if err := json.Unmarshal(data, &s1); err != nil {
  3262. return err
  3263. }
  3264. s.Altitude = float64(s1.Altitude)
  3265. s.Latitude = float64(s1.Latitude)
  3266. s.Longitude = float64(s1.Longitude)
  3267. return nil
  3268. }
  3269. // GuideCategory: A guideCategory resource identifies a category that
  3270. // YouTube algorithmically assigns based on a channel's content or other
  3271. // indicators, such as the channel's popularity. The list is similar to
  3272. // video categories, with the difference being that a video's uploader
  3273. // can assign a video category but only YouTube can assign a channel
  3274. // category.
  3275. type GuideCategory struct {
  3276. // Etag: Etag of this resource.
  3277. Etag string `json:"etag,omitempty"`
  3278. // Id: The ID that YouTube uses to uniquely identify the guide category.
  3279. Id string `json:"id,omitempty"`
  3280. // Kind: Identifies what kind of resource this is. Value: the fixed
  3281. // string "youtube#guideCategory".
  3282. Kind string `json:"kind,omitempty"`
  3283. // Snippet: The snippet object contains basic details about the
  3284. // category, such as its title.
  3285. Snippet *GuideCategorySnippet `json:"snippet,omitempty"`
  3286. // ForceSendFields is a list of field names (e.g. "Etag") to
  3287. // unconditionally include in API requests. By default, fields with
  3288. // empty values are omitted from API requests. However, any non-pointer,
  3289. // non-interface field appearing in ForceSendFields will be sent to the
  3290. // server regardless of whether the field is empty or not. This may be
  3291. // used to include empty fields in Patch requests.
  3292. ForceSendFields []string `json:"-"`
  3293. // NullFields is a list of field names (e.g. "Etag") to include in API
  3294. // requests with the JSON null value. By default, fields with empty
  3295. // values are omitted from API requests. However, any field with an
  3296. // empty value appearing in NullFields will be sent to the server as
  3297. // null. It is an error if a field in this list has a non-empty value.
  3298. // This may be used to include null fields in Patch requests.
  3299. NullFields []string `json:"-"`
  3300. }
  3301. func (s *GuideCategory) MarshalJSON() ([]byte, error) {
  3302. type NoMethod GuideCategory
  3303. raw := NoMethod(*s)
  3304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3305. }
  3306. type GuideCategoryListResponse struct {
  3307. // Etag: Etag of this resource.
  3308. Etag string `json:"etag,omitempty"`
  3309. // EventId: Serialized EventId of the request which produced this
  3310. // response.
  3311. EventId string `json:"eventId,omitempty"`
  3312. // Items: A list of categories that can be associated with YouTube
  3313. // channels. In this map, the category ID is the map key, and its value
  3314. // is the corresponding guideCategory resource.
  3315. Items []*GuideCategory `json:"items,omitempty"`
  3316. // Kind: Identifies what kind of resource this is. Value: the fixed
  3317. // string "youtube#guideCategoryListResponse".
  3318. Kind string `json:"kind,omitempty"`
  3319. // NextPageToken: The token that can be used as the value of the
  3320. // pageToken parameter to retrieve the next page in the result set.
  3321. NextPageToken string `json:"nextPageToken,omitempty"`
  3322. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  3323. // PrevPageToken: The token that can be used as the value of the
  3324. // pageToken parameter to retrieve the previous page in the result set.
  3325. PrevPageToken string `json:"prevPageToken,omitempty"`
  3326. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  3327. // VisitorId: The visitorId identifies the visitor.
  3328. VisitorId string `json:"visitorId,omitempty"`
  3329. // ServerResponse contains the HTTP response code and headers from the
  3330. // server.
  3331. googleapi.ServerResponse `json:"-"`
  3332. // ForceSendFields is a list of field names (e.g. "Etag") to
  3333. // unconditionally include in API requests. By default, fields with
  3334. // empty values are omitted from API requests. However, any non-pointer,
  3335. // non-interface field appearing in ForceSendFields will be sent to the
  3336. // server regardless of whether the field is empty or not. This may be
  3337. // used to include empty fields in Patch requests.
  3338. ForceSendFields []string `json:"-"`
  3339. // NullFields is a list of field names (e.g. "Etag") to include in API
  3340. // requests with the JSON null value. By default, fields with empty
  3341. // values are omitted from API requests. However, any field with an
  3342. // empty value appearing in NullFields will be sent to the server as
  3343. // null. It is an error if a field in this list has a non-empty value.
  3344. // This may be used to include null fields in Patch requests.
  3345. NullFields []string `json:"-"`
  3346. }
  3347. func (s *GuideCategoryListResponse) MarshalJSON() ([]byte, error) {
  3348. type NoMethod GuideCategoryListResponse
  3349. raw := NoMethod(*s)
  3350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3351. }
  3352. // GuideCategorySnippet: Basic details about a guide category.
  3353. type GuideCategorySnippet struct {
  3354. ChannelId string `json:"channelId,omitempty"`
  3355. // Title: Description of the guide category.
  3356. Title string `json:"title,omitempty"`
  3357. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  3358. // unconditionally include in API requests. By default, fields with
  3359. // empty values are omitted from API requests. However, any non-pointer,
  3360. // non-interface field appearing in ForceSendFields will be sent to the
  3361. // server regardless of whether the field is empty or not. This may be
  3362. // used to include empty fields in Patch requests.
  3363. ForceSendFields []string `json:"-"`
  3364. // NullFields is a list of field names (e.g. "ChannelId") to include in
  3365. // API requests with the JSON null value. By default, fields with empty
  3366. // values are omitted from API requests. However, any field with an
  3367. // empty value appearing in NullFields will be sent to the server as
  3368. // null. It is an error if a field in this list has a non-empty value.
  3369. // This may be used to include null fields in Patch requests.
  3370. NullFields []string `json:"-"`
  3371. }
  3372. func (s *GuideCategorySnippet) MarshalJSON() ([]byte, error) {
  3373. type NoMethod GuideCategorySnippet
  3374. raw := NoMethod(*s)
  3375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3376. }
  3377. // I18nLanguage: An i18nLanguage resource identifies a UI language
  3378. // currently supported by YouTube.
  3379. type I18nLanguage struct {
  3380. // Etag: Etag of this resource.
  3381. Etag string `json:"etag,omitempty"`
  3382. // Id: The ID that YouTube uses to uniquely identify the i18n language.
  3383. Id string `json:"id,omitempty"`
  3384. // Kind: Identifies what kind of resource this is. Value: the fixed
  3385. // string "youtube#i18nLanguage".
  3386. Kind string `json:"kind,omitempty"`
  3387. // Snippet: The snippet object contains basic details about the i18n
  3388. // language, such as language code and human-readable name.
  3389. Snippet *I18nLanguageSnippet `json:"snippet,omitempty"`
  3390. // ForceSendFields is a list of field names (e.g. "Etag") to
  3391. // unconditionally include in API requests. By default, fields with
  3392. // empty values are omitted from API requests. However, any non-pointer,
  3393. // non-interface field appearing in ForceSendFields will be sent to the
  3394. // server regardless of whether the field is empty or not. This may be
  3395. // used to include empty fields in Patch requests.
  3396. ForceSendFields []string `json:"-"`
  3397. // NullFields is a list of field names (e.g. "Etag") to include in API
  3398. // requests with the JSON null value. By default, fields with empty
  3399. // values are omitted from API requests. However, any field with an
  3400. // empty value appearing in NullFields will be sent to the server as
  3401. // null. It is an error if a field in this list has a non-empty value.
  3402. // This may be used to include null fields in Patch requests.
  3403. NullFields []string `json:"-"`
  3404. }
  3405. func (s *I18nLanguage) MarshalJSON() ([]byte, error) {
  3406. type NoMethod I18nLanguage
  3407. raw := NoMethod(*s)
  3408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3409. }
  3410. type I18nLanguageListResponse struct {
  3411. // Etag: Etag of this resource.
  3412. Etag string `json:"etag,omitempty"`
  3413. // EventId: Serialized EventId of the request which produced this
  3414. // response.
  3415. EventId string `json:"eventId,omitempty"`
  3416. // Items: A list of supported i18n languages. In this map, the i18n
  3417. // language ID is the map key, and its value is the corresponding
  3418. // i18nLanguage resource.
  3419. Items []*I18nLanguage `json:"items,omitempty"`
  3420. // Kind: Identifies what kind of resource this is. Value: the fixed
  3421. // string "youtube#i18nLanguageListResponse".
  3422. Kind string `json:"kind,omitempty"`
  3423. // VisitorId: The visitorId identifies the visitor.
  3424. VisitorId string `json:"visitorId,omitempty"`
  3425. // ServerResponse contains the HTTP response code and headers from the
  3426. // server.
  3427. googleapi.ServerResponse `json:"-"`
  3428. // ForceSendFields is a list of field names (e.g. "Etag") to
  3429. // unconditionally include in API requests. By default, fields with
  3430. // empty values are omitted from API requests. However, any non-pointer,
  3431. // non-interface field appearing in ForceSendFields will be sent to the
  3432. // server regardless of whether the field is empty or not. This may be
  3433. // used to include empty fields in Patch requests.
  3434. ForceSendFields []string `json:"-"`
  3435. // NullFields is a list of field names (e.g. "Etag") to include in API
  3436. // requests with the JSON null value. By default, fields with empty
  3437. // values are omitted from API requests. However, any field with an
  3438. // empty value appearing in NullFields will be sent to the server as
  3439. // null. It is an error if a field in this list has a non-empty value.
  3440. // This may be used to include null fields in Patch requests.
  3441. NullFields []string `json:"-"`
  3442. }
  3443. func (s *I18nLanguageListResponse) MarshalJSON() ([]byte, error) {
  3444. type NoMethod I18nLanguageListResponse
  3445. raw := NoMethod(*s)
  3446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3447. }
  3448. // I18nLanguageSnippet: Basic details about an i18n language, such as
  3449. // language code and human-readable name.
  3450. type I18nLanguageSnippet struct {
  3451. // Hl: A short BCP-47 code that uniquely identifies a language.
  3452. Hl string `json:"hl,omitempty"`
  3453. // Name: The human-readable name of the language in the language itself.
  3454. Name string `json:"name,omitempty"`
  3455. // ForceSendFields is a list of field names (e.g. "Hl") to
  3456. // unconditionally include in API requests. By default, fields with
  3457. // empty values are omitted from API requests. However, any non-pointer,
  3458. // non-interface field appearing in ForceSendFields will be sent to the
  3459. // server regardless of whether the field is empty or not. This may be
  3460. // used to include empty fields in Patch requests.
  3461. ForceSendFields []string `json:"-"`
  3462. // NullFields is a list of field names (e.g. "Hl") to include in API
  3463. // requests with the JSON null value. By default, fields with empty
  3464. // values are omitted from API requests. However, any field with an
  3465. // empty value appearing in NullFields will be sent to the server as
  3466. // null. It is an error if a field in this list has a non-empty value.
  3467. // This may be used to include null fields in Patch requests.
  3468. NullFields []string `json:"-"`
  3469. }
  3470. func (s *I18nLanguageSnippet) MarshalJSON() ([]byte, error) {
  3471. type NoMethod I18nLanguageSnippet
  3472. raw := NoMethod(*s)
  3473. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3474. }
  3475. // I18nRegion: A i18nRegion resource identifies a region where YouTube
  3476. // is available.
  3477. type I18nRegion struct {
  3478. // Etag: Etag of this resource.
  3479. Etag string `json:"etag,omitempty"`
  3480. // Id: The ID that YouTube uses to uniquely identify the i18n region.
  3481. Id string `json:"id,omitempty"`
  3482. // Kind: Identifies what kind of resource this is. Value: the fixed
  3483. // string "youtube#i18nRegion".
  3484. Kind string `json:"kind,omitempty"`
  3485. // Snippet: The snippet object contains basic details about the i18n
  3486. // region, such as region code and human-readable name.
  3487. Snippet *I18nRegionSnippet `json:"snippet,omitempty"`
  3488. // ForceSendFields is a list of field names (e.g. "Etag") to
  3489. // unconditionally include in API requests. By default, fields with
  3490. // empty values are omitted from API requests. However, any non-pointer,
  3491. // non-interface field appearing in ForceSendFields will be sent to the
  3492. // server regardless of whether the field is empty or not. This may be
  3493. // used to include empty fields in Patch requests.
  3494. ForceSendFields []string `json:"-"`
  3495. // NullFields is a list of field names (e.g. "Etag") to include in API
  3496. // requests with the JSON null value. By default, fields with empty
  3497. // values are omitted from API requests. However, any field with an
  3498. // empty value appearing in NullFields will be sent to the server as
  3499. // null. It is an error if a field in this list has a non-empty value.
  3500. // This may be used to include null fields in Patch requests.
  3501. NullFields []string `json:"-"`
  3502. }
  3503. func (s *I18nRegion) MarshalJSON() ([]byte, error) {
  3504. type NoMethod I18nRegion
  3505. raw := NoMethod(*s)
  3506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3507. }
  3508. type I18nRegionListResponse struct {
  3509. // Etag: Etag of this resource.
  3510. Etag string `json:"etag,omitempty"`
  3511. // EventId: Serialized EventId of the request which produced this
  3512. // response.
  3513. EventId string `json:"eventId,omitempty"`
  3514. // Items: A list of regions where YouTube is available. In this map, the
  3515. // i18n region ID is the map key, and its value is the corresponding
  3516. // i18nRegion resource.
  3517. Items []*I18nRegion `json:"items,omitempty"`
  3518. // Kind: Identifies what kind of resource this is. Value: the fixed
  3519. // string "youtube#i18nRegionListResponse".
  3520. Kind string `json:"kind,omitempty"`
  3521. // VisitorId: The visitorId identifies the visitor.
  3522. VisitorId string `json:"visitorId,omitempty"`
  3523. // ServerResponse contains the HTTP response code and headers from the
  3524. // server.
  3525. googleapi.ServerResponse `json:"-"`
  3526. // ForceSendFields is a list of field names (e.g. "Etag") to
  3527. // unconditionally include in API requests. By default, fields with
  3528. // empty values are omitted from API requests. However, any non-pointer,
  3529. // non-interface field appearing in ForceSendFields will be sent to the
  3530. // server regardless of whether the field is empty or not. This may be
  3531. // used to include empty fields in Patch requests.
  3532. ForceSendFields []string `json:"-"`
  3533. // NullFields is a list of field names (e.g. "Etag") to include in API
  3534. // requests with the JSON null value. By default, fields with empty
  3535. // values are omitted from API requests. However, any field with an
  3536. // empty value appearing in NullFields will be sent to the server as
  3537. // null. It is an error if a field in this list has a non-empty value.
  3538. // This may be used to include null fields in Patch requests.
  3539. NullFields []string `json:"-"`
  3540. }
  3541. func (s *I18nRegionListResponse) MarshalJSON() ([]byte, error) {
  3542. type NoMethod I18nRegionListResponse
  3543. raw := NoMethod(*s)
  3544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3545. }
  3546. // I18nRegionSnippet: Basic details about an i18n region, such as region
  3547. // code and human-readable name.
  3548. type I18nRegionSnippet struct {
  3549. // Gl: The region code as a 2-letter ISO country code.
  3550. Gl string `json:"gl,omitempty"`
  3551. // Name: The human-readable name of the region.
  3552. Name string `json:"name,omitempty"`
  3553. // ForceSendFields is a list of field names (e.g. "Gl") to
  3554. // unconditionally include in API requests. By default, fields with
  3555. // empty values are omitted from API requests. However, any non-pointer,
  3556. // non-interface field appearing in ForceSendFields will be sent to the
  3557. // server regardless of whether the field is empty or not. This may be
  3558. // used to include empty fields in Patch requests.
  3559. ForceSendFields []string `json:"-"`
  3560. // NullFields is a list of field names (e.g. "Gl") to include in API
  3561. // requests with the JSON null value. By default, fields with empty
  3562. // values are omitted from API requests. However, any field with an
  3563. // empty value appearing in NullFields will be sent to the server as
  3564. // null. It is an error if a field in this list has a non-empty value.
  3565. // This may be used to include null fields in Patch requests.
  3566. NullFields []string `json:"-"`
  3567. }
  3568. func (s *I18nRegionSnippet) MarshalJSON() ([]byte, error) {
  3569. type NoMethod I18nRegionSnippet
  3570. raw := NoMethod(*s)
  3571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3572. }
  3573. // ImageSettings: Branding properties for images associated with the
  3574. // channel.
  3575. type ImageSettings struct {
  3576. // BackgroundImageUrl: The URL for the background image shown on the
  3577. // video watch page. The image should be 1200px by 615px, with a maximum
  3578. // file size of 128k.
  3579. BackgroundImageUrl *LocalizedProperty `json:"backgroundImageUrl,omitempty"`
  3580. // BannerExternalUrl: This is used only in update requests; if it's set,
  3581. // we use this URL to generate all of the above banner URLs.
  3582. BannerExternalUrl string `json:"bannerExternalUrl,omitempty"`
  3583. // BannerImageUrl: Banner image. Desktop size (1060x175).
  3584. BannerImageUrl string `json:"bannerImageUrl,omitempty"`
  3585. // BannerMobileExtraHdImageUrl: Banner image. Mobile size high
  3586. // resolution (1440x395).
  3587. BannerMobileExtraHdImageUrl string `json:"bannerMobileExtraHdImageUrl,omitempty"`
  3588. // BannerMobileHdImageUrl: Banner image. Mobile size high resolution
  3589. // (1280x360).
  3590. BannerMobileHdImageUrl string `json:"bannerMobileHdImageUrl,omitempty"`
  3591. // BannerMobileImageUrl: Banner image. Mobile size (640x175).
  3592. BannerMobileImageUrl string `json:"bannerMobileImageUrl,omitempty"`
  3593. // BannerMobileLowImageUrl: Banner image. Mobile size low resolution
  3594. // (320x88).
  3595. BannerMobileLowImageUrl string `json:"bannerMobileLowImageUrl,omitempty"`
  3596. // BannerMobileMediumHdImageUrl: Banner image. Mobile size medium/high
  3597. // resolution (960x263).
  3598. BannerMobileMediumHdImageUrl string `json:"bannerMobileMediumHdImageUrl,omitempty"`
  3599. // BannerTabletExtraHdImageUrl: Banner image. Tablet size extra high
  3600. // resolution (2560x424).
  3601. BannerTabletExtraHdImageUrl string `json:"bannerTabletExtraHdImageUrl,omitempty"`
  3602. // BannerTabletHdImageUrl: Banner image. Tablet size high resolution
  3603. // (2276x377).
  3604. BannerTabletHdImageUrl string `json:"bannerTabletHdImageUrl,omitempty"`
  3605. // BannerTabletImageUrl: Banner image. Tablet size (1707x283).
  3606. BannerTabletImageUrl string `json:"bannerTabletImageUrl,omitempty"`
  3607. // BannerTabletLowImageUrl: Banner image. Tablet size low resolution
  3608. // (1138x188).
  3609. BannerTabletLowImageUrl string `json:"bannerTabletLowImageUrl,omitempty"`
  3610. // BannerTvHighImageUrl: Banner image. TV size high resolution
  3611. // (1920x1080).
  3612. BannerTvHighImageUrl string `json:"bannerTvHighImageUrl,omitempty"`
  3613. // BannerTvImageUrl: Banner image. TV size extra high resolution
  3614. // (2120x1192).
  3615. BannerTvImageUrl string `json:"bannerTvImageUrl,omitempty"`
  3616. // BannerTvLowImageUrl: Banner image. TV size low resolution (854x480).
  3617. BannerTvLowImageUrl string `json:"bannerTvLowImageUrl,omitempty"`
  3618. // BannerTvMediumImageUrl: Banner image. TV size medium resolution
  3619. // (1280x720).
  3620. BannerTvMediumImageUrl string `json:"bannerTvMediumImageUrl,omitempty"`
  3621. // LargeBrandedBannerImageImapScript: The image map script for the large
  3622. // banner image.
  3623. LargeBrandedBannerImageImapScript *LocalizedProperty `json:"largeBrandedBannerImageImapScript,omitempty"`
  3624. // LargeBrandedBannerImageUrl: The URL for the 854px by 70px image that
  3625. // appears below the video player in the expanded video view of the
  3626. // video watch page.
  3627. LargeBrandedBannerImageUrl *LocalizedProperty `json:"largeBrandedBannerImageUrl,omitempty"`
  3628. // SmallBrandedBannerImageImapScript: The image map script for the small
  3629. // banner image.
  3630. SmallBrandedBannerImageImapScript *LocalizedProperty `json:"smallBrandedBannerImageImapScript,omitempty"`
  3631. // SmallBrandedBannerImageUrl: The URL for the 640px by 70px banner
  3632. // image that appears below the video player in the default view of the
  3633. // video watch page.
  3634. SmallBrandedBannerImageUrl *LocalizedProperty `json:"smallBrandedBannerImageUrl,omitempty"`
  3635. // TrackingImageUrl: The URL for a 1px by 1px tracking pixel that can be
  3636. // used to collect statistics for views of the channel or video pages.
  3637. TrackingImageUrl string `json:"trackingImageUrl,omitempty"`
  3638. // WatchIconImageUrl: The URL for the image that appears above the
  3639. // top-left corner of the video player. This is a 25-pixel-high image
  3640. // with a flexible width that cannot exceed 170 pixels.
  3641. WatchIconImageUrl string `json:"watchIconImageUrl,omitempty"`
  3642. // ForceSendFields is a list of field names (e.g. "BackgroundImageUrl")
  3643. // to unconditionally include in API requests. By default, fields with
  3644. // empty values are omitted from API requests. However, any non-pointer,
  3645. // non-interface field appearing in ForceSendFields will be sent to the
  3646. // server regardless of whether the field is empty or not. This may be
  3647. // used to include empty fields in Patch requests.
  3648. ForceSendFields []string `json:"-"`
  3649. // NullFields is a list of field names (e.g. "BackgroundImageUrl") to
  3650. // include in API requests with the JSON null value. By default, fields
  3651. // with empty values are omitted from API requests. However, any field
  3652. // with an empty value appearing in NullFields will be sent to the
  3653. // server as null. It is an error if a field in this list has a
  3654. // non-empty value. This may be used to include null fields in Patch
  3655. // requests.
  3656. NullFields []string `json:"-"`
  3657. }
  3658. func (s *ImageSettings) MarshalJSON() ([]byte, error) {
  3659. type NoMethod ImageSettings
  3660. raw := NoMethod(*s)
  3661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3662. }
  3663. // IngestionInfo: Describes information necessary for ingesting an RTMP
  3664. // or an HTTP stream.
  3665. type IngestionInfo struct {
  3666. // BackupIngestionAddress: The backup ingestion URL that you should use
  3667. // to stream video to YouTube. You have the option of simultaneously
  3668. // streaming the content that you are sending to the ingestionAddress to
  3669. // this URL.
  3670. BackupIngestionAddress string `json:"backupIngestionAddress,omitempty"`
  3671. // IngestionAddress: The primary ingestion URL that you should use to
  3672. // stream video to YouTube. You must stream video to this
  3673. // URL.
  3674. //
  3675. // Depending on which application or tool you use to encode your video
  3676. // stream, you may need to enter the stream URL and stream name
  3677. // separately or you may need to concatenate them in the following
  3678. // format:
  3679. //
  3680. // STREAM_URL/STREAM_NAME
  3681. IngestionAddress string `json:"ingestionAddress,omitempty"`
  3682. // StreamName: The HTTP or RTMP stream name that YouTube assigns to the
  3683. // video stream.
  3684. StreamName string `json:"streamName,omitempty"`
  3685. // ForceSendFields is a list of field names (e.g.
  3686. // "BackupIngestionAddress") to unconditionally include in API requests.
  3687. // By default, fields with empty values are omitted from API requests.
  3688. // However, any non-pointer, non-interface field appearing in
  3689. // ForceSendFields will be sent to the server regardless of whether the
  3690. // field is empty or not. This may be used to include empty fields in
  3691. // Patch requests.
  3692. ForceSendFields []string `json:"-"`
  3693. // NullFields is a list of field names (e.g. "BackupIngestionAddress")
  3694. // to include in API requests with the JSON null value. By default,
  3695. // fields with empty values are omitted from API requests. However, any
  3696. // field with an empty value appearing in NullFields will be sent to the
  3697. // server as null. It is an error if a field in this list has a
  3698. // non-empty value. This may be used to include null fields in Patch
  3699. // requests.
  3700. NullFields []string `json:"-"`
  3701. }
  3702. func (s *IngestionInfo) MarshalJSON() ([]byte, error) {
  3703. type NoMethod IngestionInfo
  3704. raw := NoMethod(*s)
  3705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3706. }
  3707. type InvideoBranding struct {
  3708. ImageBytes string `json:"imageBytes,omitempty"`
  3709. ImageUrl string `json:"imageUrl,omitempty"`
  3710. Position *InvideoPosition `json:"position,omitempty"`
  3711. TargetChannelId string `json:"targetChannelId,omitempty"`
  3712. Timing *InvideoTiming `json:"timing,omitempty"`
  3713. // ForceSendFields is a list of field names (e.g. "ImageBytes") to
  3714. // unconditionally include in API requests. By default, fields with
  3715. // empty values are omitted from API requests. However, any non-pointer,
  3716. // non-interface field appearing in ForceSendFields will be sent to the
  3717. // server regardless of whether the field is empty or not. This may be
  3718. // used to include empty fields in Patch requests.
  3719. ForceSendFields []string `json:"-"`
  3720. // NullFields is a list of field names (e.g. "ImageBytes") to include in
  3721. // API requests with the JSON null value. By default, fields with empty
  3722. // values are omitted from API requests. However, any field with an
  3723. // empty value appearing in NullFields will be sent to the server as
  3724. // null. It is an error if a field in this list has a non-empty value.
  3725. // This may be used to include null fields in Patch requests.
  3726. NullFields []string `json:"-"`
  3727. }
  3728. func (s *InvideoBranding) MarshalJSON() ([]byte, error) {
  3729. type NoMethod InvideoBranding
  3730. raw := NoMethod(*s)
  3731. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3732. }
  3733. // InvideoPosition: Describes the spatial position of a visual widget
  3734. // inside a video. It is a union of various position types, out of which
  3735. // only will be set one.
  3736. type InvideoPosition struct {
  3737. // CornerPosition: Describes in which corner of the video the visual
  3738. // widget will appear.
  3739. //
  3740. // Possible values:
  3741. // "bottomLeft"
  3742. // "bottomRight"
  3743. // "topLeft"
  3744. // "topRight"
  3745. CornerPosition string `json:"cornerPosition,omitempty"`
  3746. // Type: Defines the position type.
  3747. //
  3748. // Possible values:
  3749. // "corner"
  3750. Type string `json:"type,omitempty"`
  3751. // ForceSendFields is a list of field names (e.g. "CornerPosition") to
  3752. // unconditionally include in API requests. By default, fields with
  3753. // empty values are omitted from API requests. However, any non-pointer,
  3754. // non-interface field appearing in ForceSendFields will be sent to the
  3755. // server regardless of whether the field is empty or not. This may be
  3756. // used to include empty fields in Patch requests.
  3757. ForceSendFields []string `json:"-"`
  3758. // NullFields is a list of field names (e.g. "CornerPosition") to
  3759. // include in API requests with the JSON null value. By default, fields
  3760. // with empty values are omitted from API requests. However, any field
  3761. // with an empty value appearing in NullFields will be sent to the
  3762. // server as null. It is an error if a field in this list has a
  3763. // non-empty value. This may be used to include null fields in Patch
  3764. // requests.
  3765. NullFields []string `json:"-"`
  3766. }
  3767. func (s *InvideoPosition) MarshalJSON() ([]byte, error) {
  3768. type NoMethod InvideoPosition
  3769. raw := NoMethod(*s)
  3770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3771. }
  3772. // InvideoPromotion: Describes an invideo promotion campaign consisting
  3773. // of multiple promoted items. A campaign belongs to a single
  3774. // channel_id.
  3775. type InvideoPromotion struct {
  3776. // DefaultTiming: The default temporal position within the video where
  3777. // the promoted item will be displayed. Can be overriden by more
  3778. // specific timing in the item.
  3779. DefaultTiming *InvideoTiming `json:"defaultTiming,omitempty"`
  3780. // Items: List of promoted items in decreasing priority.
  3781. Items []*PromotedItem `json:"items,omitempty"`
  3782. // Position: The spatial position within the video where the promoted
  3783. // item will be displayed.
  3784. Position *InvideoPosition `json:"position,omitempty"`
  3785. // UseSmartTiming: Indicates whether the channel's promotional campaign
  3786. // uses "smart timing." This feature attempts to show promotions at a
  3787. // point in the video when they are more likely to be clicked and less
  3788. // likely to disrupt the viewing experience. This feature also picks up
  3789. // a single promotion to show on each video.
  3790. UseSmartTiming bool `json:"useSmartTiming,omitempty"`
  3791. // ForceSendFields is a list of field names (e.g. "DefaultTiming") to
  3792. // unconditionally include in API requests. By default, fields with
  3793. // empty values are omitted from API requests. However, any non-pointer,
  3794. // non-interface field appearing in ForceSendFields will be sent to the
  3795. // server regardless of whether the field is empty or not. This may be
  3796. // used to include empty fields in Patch requests.
  3797. ForceSendFields []string `json:"-"`
  3798. // NullFields is a list of field names (e.g. "DefaultTiming") to include
  3799. // in API requests with the JSON null value. By default, fields with
  3800. // empty values are omitted from API requests. However, any field with
  3801. // an empty value appearing in NullFields will be sent to the server as
  3802. // null. It is an error if a field in this list has a non-empty value.
  3803. // This may be used to include null fields in Patch requests.
  3804. NullFields []string `json:"-"`
  3805. }
  3806. func (s *InvideoPromotion) MarshalJSON() ([]byte, error) {
  3807. type NoMethod InvideoPromotion
  3808. raw := NoMethod(*s)
  3809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3810. }
  3811. // InvideoTiming: Describes a temporal position of a visual widget
  3812. // inside a video.
  3813. type InvideoTiming struct {
  3814. // DurationMs: Defines the duration in milliseconds for which the
  3815. // promotion should be displayed. If missing, the client should use the
  3816. // default.
  3817. DurationMs uint64 `json:"durationMs,omitempty,string"`
  3818. // OffsetMs: Defines the time at which the promotion will appear.
  3819. // Depending on the value of type the value of the offsetMs field will
  3820. // represent a time offset from the start or from the end of the video,
  3821. // expressed in milliseconds.
  3822. OffsetMs uint64 `json:"offsetMs,omitempty,string"`
  3823. // Type: Describes a timing type. If the value is offsetFromStart, then
  3824. // the offsetMs field represents an offset from the start of the video.
  3825. // If the value is offsetFromEnd, then the offsetMs field represents an
  3826. // offset from the end of the video.
  3827. //
  3828. // Possible values:
  3829. // "offsetFromEnd"
  3830. // "offsetFromStart"
  3831. Type string `json:"type,omitempty"`
  3832. // ForceSendFields is a list of field names (e.g. "DurationMs") to
  3833. // unconditionally include in API requests. By default, fields with
  3834. // empty values are omitted from API requests. However, any non-pointer,
  3835. // non-interface field appearing in ForceSendFields will be sent to the
  3836. // server regardless of whether the field is empty or not. This may be
  3837. // used to include empty fields in Patch requests.
  3838. ForceSendFields []string `json:"-"`
  3839. // NullFields is a list of field names (e.g. "DurationMs") to include in
  3840. // API requests with the JSON null value. By default, fields with empty
  3841. // values are omitted from API requests. However, any field with an
  3842. // empty value appearing in NullFields will be sent to the server as
  3843. // null. It is an error if a field in this list has a non-empty value.
  3844. // This may be used to include null fields in Patch requests.
  3845. NullFields []string `json:"-"`
  3846. }
  3847. func (s *InvideoTiming) MarshalJSON() ([]byte, error) {
  3848. type NoMethod InvideoTiming
  3849. raw := NoMethod(*s)
  3850. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3851. }
  3852. type LanguageTag struct {
  3853. Value string `json:"value,omitempty"`
  3854. // ForceSendFields is a list of field names (e.g. "Value") to
  3855. // unconditionally include in API requests. By default, fields with
  3856. // empty values are omitted from API requests. However, any non-pointer,
  3857. // non-interface field appearing in ForceSendFields will be sent to the
  3858. // server regardless of whether the field is empty or not. This may be
  3859. // used to include empty fields in Patch requests.
  3860. ForceSendFields []string `json:"-"`
  3861. // NullFields is a list of field names (e.g. "Value") to include in API
  3862. // requests with the JSON null value. By default, fields with empty
  3863. // values are omitted from API requests. However, any field with an
  3864. // empty value appearing in NullFields will be sent to the server as
  3865. // null. It is an error if a field in this list has a non-empty value.
  3866. // This may be used to include null fields in Patch requests.
  3867. NullFields []string `json:"-"`
  3868. }
  3869. func (s *LanguageTag) MarshalJSON() ([]byte, error) {
  3870. type NoMethod LanguageTag
  3871. raw := NoMethod(*s)
  3872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3873. }
  3874. // LiveBroadcast: A liveBroadcast resource represents an event that will
  3875. // be streamed, via live video, on YouTube.
  3876. type LiveBroadcast struct {
  3877. // ContentDetails: The contentDetails object contains information about
  3878. // the event's video content, such as whether the content can be shown
  3879. // in an embedded video player or if it will be archived and therefore
  3880. // available for viewing after the event has concluded.
  3881. ContentDetails *LiveBroadcastContentDetails `json:"contentDetails,omitempty"`
  3882. // Etag: Etag of this resource.
  3883. Etag string `json:"etag,omitempty"`
  3884. // Id: The ID that YouTube assigns to uniquely identify the broadcast.
  3885. Id string `json:"id,omitempty"`
  3886. // Kind: Identifies what kind of resource this is. Value: the fixed
  3887. // string "youtube#liveBroadcast".
  3888. Kind string `json:"kind,omitempty"`
  3889. // Snippet: The snippet object contains basic details about the event,
  3890. // including its title, description, start time, and end time.
  3891. Snippet *LiveBroadcastSnippet `json:"snippet,omitempty"`
  3892. // Statistics: The statistics object contains info about the event's
  3893. // current stats. These include concurrent viewers and total chat count.
  3894. // Statistics can change (in either direction) during the lifetime of an
  3895. // event. Statistics are only returned while the event is live.
  3896. Statistics *LiveBroadcastStatistics `json:"statistics,omitempty"`
  3897. // Status: The status object contains information about the event's
  3898. // status.
  3899. Status *LiveBroadcastStatus `json:"status,omitempty"`
  3900. // ServerResponse contains the HTTP response code and headers from the
  3901. // server.
  3902. googleapi.ServerResponse `json:"-"`
  3903. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  3904. // unconditionally include in API requests. By default, fields with
  3905. // empty values are omitted from API requests. However, any non-pointer,
  3906. // non-interface field appearing in ForceSendFields will be sent to the
  3907. // server regardless of whether the field is empty or not. This may be
  3908. // used to include empty fields in Patch requests.
  3909. ForceSendFields []string `json:"-"`
  3910. // NullFields is a list of field names (e.g. "ContentDetails") to
  3911. // include in API requests with the JSON null value. By default, fields
  3912. // with empty values are omitted from API requests. However, any field
  3913. // with an empty value appearing in NullFields will be sent to the
  3914. // server as null. It is an error if a field in this list has a
  3915. // non-empty value. This may be used to include null fields in Patch
  3916. // requests.
  3917. NullFields []string `json:"-"`
  3918. }
  3919. func (s *LiveBroadcast) MarshalJSON() ([]byte, error) {
  3920. type NoMethod LiveBroadcast
  3921. raw := NoMethod(*s)
  3922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3923. }
  3924. // LiveBroadcastContentDetails: Detailed settings of a broadcast.
  3925. type LiveBroadcastContentDetails struct {
  3926. // BoundStreamId: This value uniquely identifies the live stream bound
  3927. // to the broadcast.
  3928. BoundStreamId string `json:"boundStreamId,omitempty"`
  3929. // BoundStreamLastUpdateTimeMs: The date and time that the live stream
  3930. // referenced by boundStreamId was last updated.
  3931. BoundStreamLastUpdateTimeMs string `json:"boundStreamLastUpdateTimeMs,omitempty"`
  3932. // Possible values:
  3933. // "closedCaptionsDisabled"
  3934. // "closedCaptionsEmbedded"
  3935. // "closedCaptionsHttpPost"
  3936. ClosedCaptionsType string `json:"closedCaptionsType,omitempty"`
  3937. // EnableAutoStart: This setting indicates whether auto start is enabled
  3938. // for this broadcast.
  3939. EnableAutoStart bool `json:"enableAutoStart,omitempty"`
  3940. // EnableClosedCaptions: This setting indicates whether HTTP POST closed
  3941. // captioning is enabled for this broadcast. The ingestion URL of the
  3942. // closed captions is returned through the liveStreams API. This is
  3943. // mutually exclusive with using the closed_captions_type property, and
  3944. // is equivalent to setting closed_captions_type to
  3945. // CLOSED_CAPTIONS_HTTP_POST.
  3946. EnableClosedCaptions bool `json:"enableClosedCaptions,omitempty"`
  3947. // EnableContentEncryption: This setting indicates whether YouTube
  3948. // should enable content encryption for the broadcast.
  3949. EnableContentEncryption bool `json:"enableContentEncryption,omitempty"`
  3950. // EnableDvr: This setting determines whether viewers can access DVR
  3951. // controls while watching the video. DVR controls enable the viewer to
  3952. // control the video playback experience by pausing, rewinding, or fast
  3953. // forwarding content. The default value for this property is
  3954. // true.
  3955. //
  3956. //
  3957. //
  3958. // Important: You must set the value to true and also set the
  3959. // enableArchive property's value to true if you want to make playback
  3960. // available immediately after the broadcast ends.
  3961. EnableDvr bool `json:"enableDvr,omitempty"`
  3962. // EnableEmbed: This setting indicates whether the broadcast video can
  3963. // be played in an embedded player. If you choose to archive the video
  3964. // (using the enableArchive property), this setting will also apply to
  3965. // the archived video.
  3966. EnableEmbed bool `json:"enableEmbed,omitempty"`
  3967. // EnableLowLatency: Indicates whether this broadcast has low latency
  3968. // enabled.
  3969. EnableLowLatency bool `json:"enableLowLatency,omitempty"`
  3970. // LatencyPreference: If both this and enable_low_latency are set, they
  3971. // must match. LATENCY_NORMAL should match enable_low_latency=false
  3972. // LATENCY_LOW should match enable_low_latency=true LATENCY_ULTRA_LOW
  3973. // should have enable_low_latency omitted.
  3974. //
  3975. // Possible values:
  3976. // "low"
  3977. // "normal"
  3978. // "ultraLow"
  3979. LatencyPreference string `json:"latencyPreference,omitempty"`
  3980. Mesh string `json:"mesh,omitempty"`
  3981. // MonitorStream: The monitorStream object contains information about
  3982. // the monitor stream, which the broadcaster can use to review the event
  3983. // content before the broadcast stream is shown publicly.
  3984. MonitorStream *MonitorStreamInfo `json:"monitorStream,omitempty"`
  3985. // Projection: The projection format of this broadcast. This defaults to
  3986. // rectangular.
  3987. //
  3988. // Possible values:
  3989. // "360"
  3990. // "mesh"
  3991. // "rectangular"
  3992. Projection string `json:"projection,omitempty"`
  3993. // RecordFromStart: Automatically start recording after the event goes
  3994. // live. The default value for this property is true.
  3995. //
  3996. //
  3997. //
  3998. // Important: You must also set the enableDvr property's value to true
  3999. // if you want the playback to be available immediately after the
  4000. // broadcast ends. If you set this property's value to true but do not
  4001. // also set the enableDvr property to true, there may be a delay of
  4002. // around one day before the archived video will be available for
  4003. // playback.
  4004. RecordFromStart bool `json:"recordFromStart,omitempty"`
  4005. // StartWithSlate: This setting indicates whether the broadcast should
  4006. // automatically begin with an in-stream slate when you update the
  4007. // broadcast's status to live. After updating the status, you then need
  4008. // to send a liveCuepoints.insert request that sets the cuepoint's
  4009. // eventState to end to remove the in-stream slate and make your
  4010. // broadcast stream visible to viewers.
  4011. StartWithSlate bool `json:"startWithSlate,omitempty"`
  4012. // Possible values:
  4013. // "left_right"
  4014. // "mono"
  4015. // "top_bottom"
  4016. StereoLayout string `json:"stereoLayout,omitempty"`
  4017. // ForceSendFields is a list of field names (e.g. "BoundStreamId") to
  4018. // unconditionally include in API requests. By default, fields with
  4019. // empty values are omitted from API requests. However, any non-pointer,
  4020. // non-interface field appearing in ForceSendFields will be sent to the
  4021. // server regardless of whether the field is empty or not. This may be
  4022. // used to include empty fields in Patch requests.
  4023. ForceSendFields []string `json:"-"`
  4024. // NullFields is a list of field names (e.g. "BoundStreamId") to include
  4025. // in API requests with the JSON null value. By default, fields with
  4026. // empty values are omitted from API requests. However, any field with
  4027. // an empty value appearing in NullFields will be sent to the server as
  4028. // null. It is an error if a field in this list has a non-empty value.
  4029. // This may be used to include null fields in Patch requests.
  4030. NullFields []string `json:"-"`
  4031. }
  4032. func (s *LiveBroadcastContentDetails) MarshalJSON() ([]byte, error) {
  4033. type NoMethod LiveBroadcastContentDetails
  4034. raw := NoMethod(*s)
  4035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4036. }
  4037. type LiveBroadcastListResponse struct {
  4038. // Etag: Etag of this resource.
  4039. Etag string `json:"etag,omitempty"`
  4040. // EventId: Serialized EventId of the request which produced this
  4041. // response.
  4042. EventId string `json:"eventId,omitempty"`
  4043. // Items: A list of broadcasts that match the request criteria.
  4044. Items []*LiveBroadcast `json:"items,omitempty"`
  4045. // Kind: Identifies what kind of resource this is. Value: the fixed
  4046. // string "youtube#liveBroadcastListResponse".
  4047. Kind string `json:"kind,omitempty"`
  4048. // NextPageToken: The token that can be used as the value of the
  4049. // pageToken parameter to retrieve the next page in the result set.
  4050. NextPageToken string `json:"nextPageToken,omitempty"`
  4051. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4052. // PrevPageToken: The token that can be used as the value of the
  4053. // pageToken parameter to retrieve the previous page in the result set.
  4054. PrevPageToken string `json:"prevPageToken,omitempty"`
  4055. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4056. // VisitorId: The visitorId identifies the visitor.
  4057. VisitorId string `json:"visitorId,omitempty"`
  4058. // ServerResponse contains the HTTP response code and headers from the
  4059. // server.
  4060. googleapi.ServerResponse `json:"-"`
  4061. // ForceSendFields is a list of field names (e.g. "Etag") to
  4062. // unconditionally include in API requests. By default, fields with
  4063. // empty values are omitted from API requests. However, any non-pointer,
  4064. // non-interface field appearing in ForceSendFields will be sent to the
  4065. // server regardless of whether the field is empty or not. This may be
  4066. // used to include empty fields in Patch requests.
  4067. ForceSendFields []string `json:"-"`
  4068. // NullFields is a list of field names (e.g. "Etag") to include in API
  4069. // requests with the JSON null value. By default, fields with empty
  4070. // values are omitted from API requests. However, any field with an
  4071. // empty value appearing in NullFields will be sent to the server as
  4072. // null. It is an error if a field in this list has a non-empty value.
  4073. // This may be used to include null fields in Patch requests.
  4074. NullFields []string `json:"-"`
  4075. }
  4076. func (s *LiveBroadcastListResponse) MarshalJSON() ([]byte, error) {
  4077. type NoMethod LiveBroadcastListResponse
  4078. raw := NoMethod(*s)
  4079. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4080. }
  4081. type LiveBroadcastSnippet struct {
  4082. // ActualEndTime: The date and time that the broadcast actually ended.
  4083. // This information is only available once the broadcast's state is
  4084. // complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4085. // format.
  4086. ActualEndTime string `json:"actualEndTime,omitempty"`
  4087. // ActualStartTime: The date and time that the broadcast actually
  4088. // started. This information is only available once the broadcast's
  4089. // state is live. The value is specified in ISO 8601
  4090. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4091. ActualStartTime string `json:"actualStartTime,omitempty"`
  4092. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  4093. // that is publishing the broadcast.
  4094. ChannelId string `json:"channelId,omitempty"`
  4095. // Description: The broadcast's description. As with the title, you can
  4096. // set this field by modifying the broadcast resource or by setting the
  4097. // description field of the corresponding video resource.
  4098. Description string `json:"description,omitempty"`
  4099. IsDefaultBroadcast bool `json:"isDefaultBroadcast,omitempty"`
  4100. // LiveChatId: The id of the live chat for this broadcast.
  4101. LiveChatId string `json:"liveChatId,omitempty"`
  4102. // PublishedAt: The date and time that the broadcast was added to
  4103. // YouTube's live broadcast schedule. The value is specified in ISO 8601
  4104. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4105. PublishedAt string `json:"publishedAt,omitempty"`
  4106. // ScheduledEndTime: The date and time that the broadcast is scheduled
  4107. // to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4108. // format.
  4109. ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
  4110. // ScheduledStartTime: The date and time that the broadcast is scheduled
  4111. // to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4112. // format.
  4113. ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
  4114. // Thumbnails: A map of thumbnail images associated with the broadcast.
  4115. // For each nested object in this object, the key is the name of the
  4116. // thumbnail image, and the value is an object that contains other
  4117. // information about the thumbnail.
  4118. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  4119. // Title: The broadcast's title. Note that the broadcast represents
  4120. // exactly one YouTube video. You can set this field by modifying the
  4121. // broadcast resource or by setting the title field of the corresponding
  4122. // video resource.
  4123. Title string `json:"title,omitempty"`
  4124. // ForceSendFields is a list of field names (e.g. "ActualEndTime") to
  4125. // unconditionally include in API requests. By default, fields with
  4126. // empty values are omitted from API requests. However, any non-pointer,
  4127. // non-interface field appearing in ForceSendFields will be sent to the
  4128. // server regardless of whether the field is empty or not. This may be
  4129. // used to include empty fields in Patch requests.
  4130. ForceSendFields []string `json:"-"`
  4131. // NullFields is a list of field names (e.g. "ActualEndTime") to include
  4132. // in API requests with the JSON null value. By default, fields with
  4133. // empty values are omitted from API requests. However, any field with
  4134. // an empty value appearing in NullFields will be sent to the server as
  4135. // null. It is an error if a field in this list has a non-empty value.
  4136. // This may be used to include null fields in Patch requests.
  4137. NullFields []string `json:"-"`
  4138. }
  4139. func (s *LiveBroadcastSnippet) MarshalJSON() ([]byte, error) {
  4140. type NoMethod LiveBroadcastSnippet
  4141. raw := NoMethod(*s)
  4142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4143. }
  4144. // LiveBroadcastStatistics: Statistics about the live broadcast. These
  4145. // represent a snapshot of the values at the time of the request.
  4146. // Statistics are only returned for live broadcasts.
  4147. type LiveBroadcastStatistics struct {
  4148. // ConcurrentViewers: The number of viewers currently watching the
  4149. // broadcast. The property and its value will be present if the
  4150. // broadcast has current viewers and the broadcast owner has not hidden
  4151. // the viewcount for the video. Note that YouTube stops tracking the
  4152. // number of concurrent viewers for a broadcast when the broadcast ends.
  4153. // So, this property would not identify the number of viewers watching
  4154. // an archived video of a live broadcast that already ended.
  4155. ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
  4156. // TotalChatCount: The total number of live chat messages currently on
  4157. // the broadcast. The property and its value will be present if the
  4158. // broadcast is public, has the live chat feature enabled, and has at
  4159. // least one message. Note that this field will not be filled after the
  4160. // broadcast ends. So this property would not identify the number of
  4161. // chat messages for an archived video of a completed live broadcast.
  4162. TotalChatCount uint64 `json:"totalChatCount,omitempty,string"`
  4163. // ForceSendFields is a list of field names (e.g. "ConcurrentViewers")
  4164. // to unconditionally include in API requests. By default, fields with
  4165. // empty values are omitted from API requests. However, any non-pointer,
  4166. // non-interface field appearing in ForceSendFields will be sent to the
  4167. // server regardless of whether the field is empty or not. This may be
  4168. // used to include empty fields in Patch requests.
  4169. ForceSendFields []string `json:"-"`
  4170. // NullFields is a list of field names (e.g. "ConcurrentViewers") to
  4171. // include in API requests with the JSON null value. By default, fields
  4172. // with empty values are omitted from API requests. However, any field
  4173. // with an empty value appearing in NullFields will be sent to the
  4174. // server as null. It is an error if a field in this list has a
  4175. // non-empty value. This may be used to include null fields in Patch
  4176. // requests.
  4177. NullFields []string `json:"-"`
  4178. }
  4179. func (s *LiveBroadcastStatistics) MarshalJSON() ([]byte, error) {
  4180. type NoMethod LiveBroadcastStatistics
  4181. raw := NoMethod(*s)
  4182. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4183. }
  4184. type LiveBroadcastStatus struct {
  4185. // LifeCycleStatus: The broadcast's status. The status can be updated
  4186. // using the API's liveBroadcasts.transition method.
  4187. //
  4188. // Possible values:
  4189. // "complete"
  4190. // "created"
  4191. // "live"
  4192. // "liveStarting"
  4193. // "ready"
  4194. // "revoked"
  4195. // "testStarting"
  4196. // "testing"
  4197. LifeCycleStatus string `json:"lifeCycleStatus,omitempty"`
  4198. // LiveBroadcastPriority: Priority of the live broadcast event (internal
  4199. // state).
  4200. //
  4201. // Possible values:
  4202. // "high"
  4203. // "low"
  4204. // "normal"
  4205. LiveBroadcastPriority string `json:"liveBroadcastPriority,omitempty"`
  4206. // PrivacyStatus: The broadcast's privacy status. Note that the
  4207. // broadcast represents exactly one YouTube video, so the privacy
  4208. // settings are identical to those supported for videos. In addition,
  4209. // you can set this field by modifying the broadcast resource or by
  4210. // setting the privacyStatus field of the corresponding video resource.
  4211. //
  4212. // Possible values:
  4213. // "private"
  4214. // "public"
  4215. // "unlisted"
  4216. // "unlisted_new"
  4217. PrivacyStatus string `json:"privacyStatus,omitempty"`
  4218. // RecordingStatus: The broadcast's recording status.
  4219. //
  4220. // Possible values:
  4221. // "notRecording"
  4222. // "recorded"
  4223. // "recording"
  4224. RecordingStatus string `json:"recordingStatus,omitempty"`
  4225. // ForceSendFields is a list of field names (e.g. "LifeCycleStatus") to
  4226. // unconditionally include in API requests. By default, fields with
  4227. // empty values are omitted from API requests. However, any non-pointer,
  4228. // non-interface field appearing in ForceSendFields will be sent to the
  4229. // server regardless of whether the field is empty or not. This may be
  4230. // used to include empty fields in Patch requests.
  4231. ForceSendFields []string `json:"-"`
  4232. // NullFields is a list of field names (e.g. "LifeCycleStatus") to
  4233. // include in API requests with the JSON null value. By default, fields
  4234. // with empty values are omitted from API requests. However, any field
  4235. // with an empty value appearing in NullFields will be sent to the
  4236. // server as null. It is an error if a field in this list has a
  4237. // non-empty value. This may be used to include null fields in Patch
  4238. // requests.
  4239. NullFields []string `json:"-"`
  4240. }
  4241. func (s *LiveBroadcastStatus) MarshalJSON() ([]byte, error) {
  4242. type NoMethod LiveBroadcastStatus
  4243. raw := NoMethod(*s)
  4244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4245. }
  4246. // LiveChatBan: A liveChatBan resource represents a ban for a YouTube
  4247. // live chat.
  4248. type LiveChatBan struct {
  4249. // Etag: Etag of this resource.
  4250. Etag string `json:"etag,omitempty"`
  4251. // Id: The ID that YouTube assigns to uniquely identify the ban.
  4252. Id string `json:"id,omitempty"`
  4253. // Kind: Identifies what kind of resource this is. Value: the fixed
  4254. // string "youtube#liveChatBan".
  4255. Kind string `json:"kind,omitempty"`
  4256. // Snippet: The snippet object contains basic details about the ban.
  4257. Snippet *LiveChatBanSnippet `json:"snippet,omitempty"`
  4258. // ServerResponse contains the HTTP response code and headers from the
  4259. // server.
  4260. googleapi.ServerResponse `json:"-"`
  4261. // ForceSendFields is a list of field names (e.g. "Etag") to
  4262. // unconditionally include in API requests. By default, fields with
  4263. // empty values are omitted from API requests. However, any non-pointer,
  4264. // non-interface field appearing in ForceSendFields will be sent to the
  4265. // server regardless of whether the field is empty or not. This may be
  4266. // used to include empty fields in Patch requests.
  4267. ForceSendFields []string `json:"-"`
  4268. // NullFields is a list of field names (e.g. "Etag") to include in API
  4269. // requests with the JSON null value. By default, fields with empty
  4270. // values are omitted from API requests. However, any field with an
  4271. // empty value appearing in NullFields will be sent to the server as
  4272. // null. It is an error if a field in this list has a non-empty value.
  4273. // This may be used to include null fields in Patch requests.
  4274. NullFields []string `json:"-"`
  4275. }
  4276. func (s *LiveChatBan) MarshalJSON() ([]byte, error) {
  4277. type NoMethod LiveChatBan
  4278. raw := NoMethod(*s)
  4279. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4280. }
  4281. type LiveChatBanSnippet struct {
  4282. // BanDurationSeconds: The duration of a ban, only filled if the ban has
  4283. // type TEMPORARY.
  4284. BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
  4285. BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
  4286. // LiveChatId: The chat this ban is pertinent to.
  4287. LiveChatId string `json:"liveChatId,omitempty"`
  4288. // Type: The type of ban.
  4289. //
  4290. // Possible values:
  4291. // "permanent"
  4292. // "temporary"
  4293. Type string `json:"type,omitempty"`
  4294. // ForceSendFields is a list of field names (e.g. "BanDurationSeconds")
  4295. // to unconditionally include in API requests. By default, fields with
  4296. // empty values are omitted from API requests. However, any non-pointer,
  4297. // non-interface field appearing in ForceSendFields will be sent to the
  4298. // server regardless of whether the field is empty or not. This may be
  4299. // used to include empty fields in Patch requests.
  4300. ForceSendFields []string `json:"-"`
  4301. // NullFields is a list of field names (e.g. "BanDurationSeconds") to
  4302. // include in API requests with the JSON null value. By default, fields
  4303. // with empty values are omitted from API requests. However, any field
  4304. // with an empty value appearing in NullFields will be sent to the
  4305. // server as null. It is an error if a field in this list has a
  4306. // non-empty value. This may be used to include null fields in Patch
  4307. // requests.
  4308. NullFields []string `json:"-"`
  4309. }
  4310. func (s *LiveChatBanSnippet) MarshalJSON() ([]byte, error) {
  4311. type NoMethod LiveChatBanSnippet
  4312. raw := NoMethod(*s)
  4313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4314. }
  4315. type LiveChatFanFundingEventDetails struct {
  4316. // AmountDisplayString: A rendered string that displays the fund amount
  4317. // and currency to the user.
  4318. AmountDisplayString string `json:"amountDisplayString,omitempty"`
  4319. // AmountMicros: The amount of the fund.
  4320. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  4321. // Currency: The currency in which the fund was made.
  4322. Currency string `json:"currency,omitempty"`
  4323. // UserComment: The comment added by the user to this fan funding event.
  4324. UserComment string `json:"userComment,omitempty"`
  4325. // ForceSendFields is a list of field names (e.g. "AmountDisplayString")
  4326. // to unconditionally include in API requests. By default, fields with
  4327. // empty values are omitted from API requests. However, any non-pointer,
  4328. // non-interface field appearing in ForceSendFields will be sent to the
  4329. // server regardless of whether the field is empty or not. This may be
  4330. // used to include empty fields in Patch requests.
  4331. ForceSendFields []string `json:"-"`
  4332. // NullFields is a list of field names (e.g. "AmountDisplayString") to
  4333. // include in API requests with the JSON null value. By default, fields
  4334. // with empty values are omitted from API requests. However, any field
  4335. // with an empty value appearing in NullFields will be sent to the
  4336. // server as null. It is an error if a field in this list has a
  4337. // non-empty value. This may be used to include null fields in Patch
  4338. // requests.
  4339. NullFields []string `json:"-"`
  4340. }
  4341. func (s *LiveChatFanFundingEventDetails) MarshalJSON() ([]byte, error) {
  4342. type NoMethod LiveChatFanFundingEventDetails
  4343. raw := NoMethod(*s)
  4344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4345. }
  4346. // LiveChatMessage: A liveChatMessage resource represents a chat message
  4347. // in a YouTube Live Chat.
  4348. type LiveChatMessage struct {
  4349. // AuthorDetails: The authorDetails object contains basic details about
  4350. // the user that posted this message.
  4351. AuthorDetails *LiveChatMessageAuthorDetails `json:"authorDetails,omitempty"`
  4352. // Etag: Etag of this resource.
  4353. Etag string `json:"etag,omitempty"`
  4354. // Id: The ID that YouTube assigns to uniquely identify the message.
  4355. Id string `json:"id,omitempty"`
  4356. // Kind: Identifies what kind of resource this is. Value: the fixed
  4357. // string "youtube#liveChatMessage".
  4358. Kind string `json:"kind,omitempty"`
  4359. // Snippet: The snippet object contains basic details about the message.
  4360. Snippet *LiveChatMessageSnippet `json:"snippet,omitempty"`
  4361. // ServerResponse contains the HTTP response code and headers from the
  4362. // server.
  4363. googleapi.ServerResponse `json:"-"`
  4364. // ForceSendFields is a list of field names (e.g. "AuthorDetails") to
  4365. // unconditionally include in API requests. By default, fields with
  4366. // empty values are omitted from API requests. However, any non-pointer,
  4367. // non-interface field appearing in ForceSendFields will be sent to the
  4368. // server regardless of whether the field is empty or not. This may be
  4369. // used to include empty fields in Patch requests.
  4370. ForceSendFields []string `json:"-"`
  4371. // NullFields is a list of field names (e.g. "AuthorDetails") to include
  4372. // in API requests with the JSON null value. By default, fields with
  4373. // empty values are omitted from API requests. However, any field with
  4374. // an empty value appearing in NullFields will be sent to the server as
  4375. // null. It is an error if a field in this list has a non-empty value.
  4376. // This may be used to include null fields in Patch requests.
  4377. NullFields []string `json:"-"`
  4378. }
  4379. func (s *LiveChatMessage) MarshalJSON() ([]byte, error) {
  4380. type NoMethod LiveChatMessage
  4381. raw := NoMethod(*s)
  4382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4383. }
  4384. type LiveChatMessageAuthorDetails struct {
  4385. // ChannelId: The YouTube channel ID.
  4386. ChannelId string `json:"channelId,omitempty"`
  4387. // ChannelUrl: The channel's URL.
  4388. ChannelUrl string `json:"channelUrl,omitempty"`
  4389. // DisplayName: The channel's display name.
  4390. DisplayName string `json:"displayName,omitempty"`
  4391. // IsChatModerator: Whether the author is a moderator of the live chat.
  4392. IsChatModerator bool `json:"isChatModerator,omitempty"`
  4393. // IsChatOwner: Whether the author is the owner of the live chat.
  4394. IsChatOwner bool `json:"isChatOwner,omitempty"`
  4395. // IsChatSponsor: Whether the author is a sponsor of the live chat.
  4396. IsChatSponsor bool `json:"isChatSponsor,omitempty"`
  4397. // IsVerified: Whether the author's identity has been verified by
  4398. // YouTube.
  4399. IsVerified bool `json:"isVerified,omitempty"`
  4400. // ProfileImageUrl: The channels's avatar URL.
  4401. ProfileImageUrl string `json:"profileImageUrl,omitempty"`
  4402. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4403. // unconditionally include in API requests. By default, fields with
  4404. // empty values are omitted from API requests. However, any non-pointer,
  4405. // non-interface field appearing in ForceSendFields will be sent to the
  4406. // server regardless of whether the field is empty or not. This may be
  4407. // used to include empty fields in Patch requests.
  4408. ForceSendFields []string `json:"-"`
  4409. // NullFields is a list of field names (e.g. "ChannelId") to include in
  4410. // API requests with the JSON null value. By default, fields with empty
  4411. // values are omitted from API requests. However, any field with an
  4412. // empty value appearing in NullFields will be sent to the server as
  4413. // null. It is an error if a field in this list has a non-empty value.
  4414. // This may be used to include null fields in Patch requests.
  4415. NullFields []string `json:"-"`
  4416. }
  4417. func (s *LiveChatMessageAuthorDetails) MarshalJSON() ([]byte, error) {
  4418. type NoMethod LiveChatMessageAuthorDetails
  4419. raw := NoMethod(*s)
  4420. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4421. }
  4422. type LiveChatMessageDeletedDetails struct {
  4423. DeletedMessageId string `json:"deletedMessageId,omitempty"`
  4424. // ForceSendFields is a list of field names (e.g. "DeletedMessageId") to
  4425. // unconditionally include in API requests. By default, fields with
  4426. // empty values are omitted from API requests. However, any non-pointer,
  4427. // non-interface field appearing in ForceSendFields will be sent to the
  4428. // server regardless of whether the field is empty or not. This may be
  4429. // used to include empty fields in Patch requests.
  4430. ForceSendFields []string `json:"-"`
  4431. // NullFields is a list of field names (e.g. "DeletedMessageId") to
  4432. // include in API requests with the JSON null value. By default, fields
  4433. // with empty values are omitted from API requests. However, any field
  4434. // with an empty value appearing in NullFields will be sent to the
  4435. // server as null. It is an error if a field in this list has a
  4436. // non-empty value. This may be used to include null fields in Patch
  4437. // requests.
  4438. NullFields []string `json:"-"`
  4439. }
  4440. func (s *LiveChatMessageDeletedDetails) MarshalJSON() ([]byte, error) {
  4441. type NoMethod LiveChatMessageDeletedDetails
  4442. raw := NoMethod(*s)
  4443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4444. }
  4445. type LiveChatMessageListResponse struct {
  4446. // Etag: Etag of this resource.
  4447. Etag string `json:"etag,omitempty"`
  4448. // EventId: Serialized EventId of the request which produced this
  4449. // response.
  4450. EventId string `json:"eventId,omitempty"`
  4451. // Items: A list of live chat messages.
  4452. Items []*LiveChatMessage `json:"items,omitempty"`
  4453. // Kind: Identifies what kind of resource this is. Value: the fixed
  4454. // string "youtube#liveChatMessageListResponse".
  4455. Kind string `json:"kind,omitempty"`
  4456. // NextPageToken: The token that can be used as the value of the
  4457. // pageToken parameter to retrieve the next page in the result set.
  4458. NextPageToken string `json:"nextPageToken,omitempty"`
  4459. // OfflineAt: The date and time when the underlying stream went offline.
  4460. // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  4461. OfflineAt string `json:"offlineAt,omitempty"`
  4462. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4463. // PollingIntervalMillis: The amount of time the client should wait
  4464. // before polling again.
  4465. PollingIntervalMillis int64 `json:"pollingIntervalMillis,omitempty"`
  4466. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4467. // VisitorId: The visitorId identifies the visitor.
  4468. VisitorId string `json:"visitorId,omitempty"`
  4469. // ServerResponse contains the HTTP response code and headers from the
  4470. // server.
  4471. googleapi.ServerResponse `json:"-"`
  4472. // ForceSendFields is a list of field names (e.g. "Etag") to
  4473. // unconditionally include in API requests. By default, fields with
  4474. // empty values are omitted from API requests. However, any non-pointer,
  4475. // non-interface field appearing in ForceSendFields will be sent to the
  4476. // server regardless of whether the field is empty or not. This may be
  4477. // used to include empty fields in Patch requests.
  4478. ForceSendFields []string `json:"-"`
  4479. // NullFields is a list of field names (e.g. "Etag") to include in API
  4480. // requests with the JSON null value. By default, fields with empty
  4481. // values are omitted from API requests. However, any field with an
  4482. // empty value appearing in NullFields will be sent to the server as
  4483. // null. It is an error if a field in this list has a non-empty value.
  4484. // This may be used to include null fields in Patch requests.
  4485. NullFields []string `json:"-"`
  4486. }
  4487. func (s *LiveChatMessageListResponse) MarshalJSON() ([]byte, error) {
  4488. type NoMethod LiveChatMessageListResponse
  4489. raw := NoMethod(*s)
  4490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4491. }
  4492. type LiveChatMessageRetractedDetails struct {
  4493. RetractedMessageId string `json:"retractedMessageId,omitempty"`
  4494. // ForceSendFields is a list of field names (e.g. "RetractedMessageId")
  4495. // to unconditionally include in API requests. By default, fields with
  4496. // empty values are omitted from API requests. However, any non-pointer,
  4497. // non-interface field appearing in ForceSendFields will be sent to the
  4498. // server regardless of whether the field is empty or not. This may be
  4499. // used to include empty fields in Patch requests.
  4500. ForceSendFields []string `json:"-"`
  4501. // NullFields is a list of field names (e.g. "RetractedMessageId") to
  4502. // include in API requests with the JSON null value. By default, fields
  4503. // with empty values are omitted from API requests. However, any field
  4504. // with an empty value appearing in NullFields will be sent to the
  4505. // server as null. It is an error if a field in this list has a
  4506. // non-empty value. This may be used to include null fields in Patch
  4507. // requests.
  4508. NullFields []string `json:"-"`
  4509. }
  4510. func (s *LiveChatMessageRetractedDetails) MarshalJSON() ([]byte, error) {
  4511. type NoMethod LiveChatMessageRetractedDetails
  4512. raw := NoMethod(*s)
  4513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4514. }
  4515. type LiveChatMessageSnippet struct {
  4516. // AuthorChannelId: The ID of the user that authored this message, this
  4517. // field is not always filled. textMessageEvent - the user that wrote
  4518. // the message fanFundingEvent - the user that funded the broadcast
  4519. // newSponsorEvent - the user that just became a sponsor
  4520. // messageDeletedEvent - the moderator that took the action
  4521. // messageRetractedEvent - the author that retracted their message
  4522. // userBannedEvent - the moderator that took the action superChatEvent -
  4523. // the user that made the purchase
  4524. AuthorChannelId string `json:"authorChannelId,omitempty"`
  4525. // DisplayMessage: Contains a string that can be displayed to the user.
  4526. // If this field is not present the message is silent, at the moment
  4527. // only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent.
  4528. DisplayMessage string `json:"displayMessage,omitempty"`
  4529. // FanFundingEventDetails: Details about the funding event, this is only
  4530. // set if the type is 'fanFundingEvent'.
  4531. FanFundingEventDetails *LiveChatFanFundingEventDetails `json:"fanFundingEventDetails,omitempty"`
  4532. // HasDisplayContent: Whether the message has display content that
  4533. // should be displayed to users.
  4534. HasDisplayContent bool `json:"hasDisplayContent,omitempty"`
  4535. LiveChatId string `json:"liveChatId,omitempty"`
  4536. MessageDeletedDetails *LiveChatMessageDeletedDetails `json:"messageDeletedDetails,omitempty"`
  4537. MessageRetractedDetails *LiveChatMessageRetractedDetails `json:"messageRetractedDetails,omitempty"`
  4538. PollClosedDetails *LiveChatPollClosedDetails `json:"pollClosedDetails,omitempty"`
  4539. PollEditedDetails *LiveChatPollEditedDetails `json:"pollEditedDetails,omitempty"`
  4540. PollOpenedDetails *LiveChatPollOpenedDetails `json:"pollOpenedDetails,omitempty"`
  4541. PollVotedDetails *LiveChatPollVotedDetails `json:"pollVotedDetails,omitempty"`
  4542. // PublishedAt: The date and time when the message was orignally
  4543. // published. The value is specified in ISO 8601
  4544. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4545. PublishedAt string `json:"publishedAt,omitempty"`
  4546. // SuperChatDetails: Details about the Super Chat event, this is only
  4547. // set if the type is 'superChatEvent'.
  4548. SuperChatDetails *LiveChatSuperChatDetails `json:"superChatDetails,omitempty"`
  4549. // SuperStickerDetails: Details about the Super Sticker event, this is
  4550. // only set if the type is 'superStickerEvent'.
  4551. SuperStickerDetails *LiveChatSuperStickerDetails `json:"superStickerDetails,omitempty"`
  4552. // TextMessageDetails: Details about the text message, this is only set
  4553. // if the type is 'textMessageEvent'.
  4554. TextMessageDetails *LiveChatTextMessageDetails `json:"textMessageDetails,omitempty"`
  4555. // Type: The type of message, this will always be present, it determines
  4556. // the contents of the message as well as which fields will be present.
  4557. //
  4558. // Possible values:
  4559. // "chatEndedEvent"
  4560. // "fanFundingEvent"
  4561. // "messageDeletedEvent"
  4562. // "messageRetractedEvent"
  4563. // "newSponsorEvent"
  4564. // "pollClosedEvent"
  4565. // "pollEditedEvent"
  4566. // "pollOpenedEvent"
  4567. // "pollVotedEvent"
  4568. // "sponsorOnlyModeEndedEvent"
  4569. // "sponsorOnlyModeStartedEvent"
  4570. // "superChatEvent"
  4571. // "superStickerEvent"
  4572. // "textMessageEvent"
  4573. // "tombstone"
  4574. // "userBannedEvent"
  4575. Type string `json:"type,omitempty"`
  4576. UserBannedDetails *LiveChatUserBannedMessageDetails `json:"userBannedDetails,omitempty"`
  4577. // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
  4578. // unconditionally include in API requests. By default, fields with
  4579. // empty values are omitted from API requests. However, any non-pointer,
  4580. // non-interface field appearing in ForceSendFields will be sent to the
  4581. // server regardless of whether the field is empty or not. This may be
  4582. // used to include empty fields in Patch requests.
  4583. ForceSendFields []string `json:"-"`
  4584. // NullFields is a list of field names (e.g. "AuthorChannelId") to
  4585. // include in API requests with the JSON null value. By default, fields
  4586. // with empty values are omitted from API requests. However, any field
  4587. // with an empty value appearing in NullFields will be sent to the
  4588. // server as null. It is an error if a field in this list has a
  4589. // non-empty value. This may be used to include null fields in Patch
  4590. // requests.
  4591. NullFields []string `json:"-"`
  4592. }
  4593. func (s *LiveChatMessageSnippet) MarshalJSON() ([]byte, error) {
  4594. type NoMethod LiveChatMessageSnippet
  4595. raw := NoMethod(*s)
  4596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4597. }
  4598. // LiveChatModerator: A liveChatModerator resource represents a
  4599. // moderator for a YouTube live chat. A chat moderator has the ability
  4600. // to ban/unban users from a chat, remove message, etc.
  4601. type LiveChatModerator struct {
  4602. // Etag: Etag of this resource.
  4603. Etag string `json:"etag,omitempty"`
  4604. // Id: The ID that YouTube assigns to uniquely identify the moderator.
  4605. Id string `json:"id,omitempty"`
  4606. // Kind: Identifies what kind of resource this is. Value: the fixed
  4607. // string "youtube#liveChatModerator".
  4608. Kind string `json:"kind,omitempty"`
  4609. // Snippet: The snippet object contains basic details about the
  4610. // moderator.
  4611. Snippet *LiveChatModeratorSnippet `json:"snippet,omitempty"`
  4612. // ServerResponse contains the HTTP response code and headers from the
  4613. // server.
  4614. googleapi.ServerResponse `json:"-"`
  4615. // ForceSendFields is a list of field names (e.g. "Etag") to
  4616. // unconditionally include in API requests. By default, fields with
  4617. // empty values are omitted from API requests. However, any non-pointer,
  4618. // non-interface field appearing in ForceSendFields will be sent to the
  4619. // server regardless of whether the field is empty or not. This may be
  4620. // used to include empty fields in Patch requests.
  4621. ForceSendFields []string `json:"-"`
  4622. // NullFields is a list of field names (e.g. "Etag") to include in API
  4623. // requests with the JSON null value. By default, fields with empty
  4624. // values are omitted from API requests. However, any field with an
  4625. // empty value appearing in NullFields will be sent to the server as
  4626. // null. It is an error if a field in this list has a non-empty value.
  4627. // This may be used to include null fields in Patch requests.
  4628. NullFields []string `json:"-"`
  4629. }
  4630. func (s *LiveChatModerator) MarshalJSON() ([]byte, error) {
  4631. type NoMethod LiveChatModerator
  4632. raw := NoMethod(*s)
  4633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4634. }
  4635. type LiveChatModeratorListResponse struct {
  4636. // Etag: Etag of this resource.
  4637. Etag string `json:"etag,omitempty"`
  4638. // EventId: Serialized EventId of the request which produced this
  4639. // response.
  4640. EventId string `json:"eventId,omitempty"`
  4641. // Items: A list of moderators that match the request criteria.
  4642. Items []*LiveChatModerator `json:"items,omitempty"`
  4643. // Kind: Identifies what kind of resource this is. Value: the fixed
  4644. // string "youtube#liveChatModeratorListResponse".
  4645. Kind string `json:"kind,omitempty"`
  4646. // NextPageToken: The token that can be used as the value of the
  4647. // pageToken parameter to retrieve the next page in the result set.
  4648. NextPageToken string `json:"nextPageToken,omitempty"`
  4649. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4650. // PrevPageToken: The token that can be used as the value of the
  4651. // pageToken parameter to retrieve the previous page in the result set.
  4652. PrevPageToken string `json:"prevPageToken,omitempty"`
  4653. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4654. // VisitorId: The visitorId identifies the visitor.
  4655. VisitorId string `json:"visitorId,omitempty"`
  4656. // ServerResponse contains the HTTP response code and headers from the
  4657. // server.
  4658. googleapi.ServerResponse `json:"-"`
  4659. // ForceSendFields is a list of field names (e.g. "Etag") to
  4660. // unconditionally include in API requests. By default, fields with
  4661. // empty values are omitted from API requests. However, any non-pointer,
  4662. // non-interface field appearing in ForceSendFields will be sent to the
  4663. // server regardless of whether the field is empty or not. This may be
  4664. // used to include empty fields in Patch requests.
  4665. ForceSendFields []string `json:"-"`
  4666. // NullFields is a list of field names (e.g. "Etag") to include in API
  4667. // requests with the JSON null value. By default, fields with empty
  4668. // values are omitted from API requests. However, any field with an
  4669. // empty value appearing in NullFields will be sent to the server as
  4670. // null. It is an error if a field in this list has a non-empty value.
  4671. // This may be used to include null fields in Patch requests.
  4672. NullFields []string `json:"-"`
  4673. }
  4674. func (s *LiveChatModeratorListResponse) MarshalJSON() ([]byte, error) {
  4675. type NoMethod LiveChatModeratorListResponse
  4676. raw := NoMethod(*s)
  4677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4678. }
  4679. type LiveChatModeratorSnippet struct {
  4680. // LiveChatId: The ID of the live chat this moderator can act on.
  4681. LiveChatId string `json:"liveChatId,omitempty"`
  4682. // ModeratorDetails: Details about the moderator.
  4683. ModeratorDetails *ChannelProfileDetails `json:"moderatorDetails,omitempty"`
  4684. // ForceSendFields is a list of field names (e.g. "LiveChatId") to
  4685. // unconditionally include in API requests. By default, fields with
  4686. // empty values are omitted from API requests. However, any non-pointer,
  4687. // non-interface field appearing in ForceSendFields will be sent to the
  4688. // server regardless of whether the field is empty or not. This may be
  4689. // used to include empty fields in Patch requests.
  4690. ForceSendFields []string `json:"-"`
  4691. // NullFields is a list of field names (e.g. "LiveChatId") to include in
  4692. // API requests with the JSON null value. By default, fields with empty
  4693. // values are omitted from API requests. However, any field with an
  4694. // empty value appearing in NullFields will be sent to the server as
  4695. // null. It is an error if a field in this list has a non-empty value.
  4696. // This may be used to include null fields in Patch requests.
  4697. NullFields []string `json:"-"`
  4698. }
  4699. func (s *LiveChatModeratorSnippet) MarshalJSON() ([]byte, error) {
  4700. type NoMethod LiveChatModeratorSnippet
  4701. raw := NoMethod(*s)
  4702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4703. }
  4704. type LiveChatPollClosedDetails struct {
  4705. // PollId: The id of the poll that was closed.
  4706. PollId string `json:"pollId,omitempty"`
  4707. // ForceSendFields is a list of field names (e.g. "PollId") to
  4708. // unconditionally include in API requests. By default, fields with
  4709. // empty values are omitted from API requests. However, any non-pointer,
  4710. // non-interface field appearing in ForceSendFields will be sent to the
  4711. // server regardless of whether the field is empty or not. This may be
  4712. // used to include empty fields in Patch requests.
  4713. ForceSendFields []string `json:"-"`
  4714. // NullFields is a list of field names (e.g. "PollId") to include in API
  4715. // requests with the JSON null value. By default, fields with empty
  4716. // values are omitted from API requests. However, any field with an
  4717. // empty value appearing in NullFields will be sent to the server as
  4718. // null. It is an error if a field in this list has a non-empty value.
  4719. // This may be used to include null fields in Patch requests.
  4720. NullFields []string `json:"-"`
  4721. }
  4722. func (s *LiveChatPollClosedDetails) MarshalJSON() ([]byte, error) {
  4723. type NoMethod LiveChatPollClosedDetails
  4724. raw := NoMethod(*s)
  4725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4726. }
  4727. type LiveChatPollEditedDetails struct {
  4728. Id string `json:"id,omitempty"`
  4729. Items []*LiveChatPollItem `json:"items,omitempty"`
  4730. Prompt string `json:"prompt,omitempty"`
  4731. // ForceSendFields is a list of field names (e.g. "Id") to
  4732. // unconditionally include in API requests. By default, fields with
  4733. // empty values are omitted from API requests. However, any non-pointer,
  4734. // non-interface field appearing in ForceSendFields will be sent to the
  4735. // server regardless of whether the field is empty or not. This may be
  4736. // used to include empty fields in Patch requests.
  4737. ForceSendFields []string `json:"-"`
  4738. // NullFields is a list of field names (e.g. "Id") to include in API
  4739. // requests with the JSON null value. By default, fields with empty
  4740. // values are omitted from API requests. However, any field with an
  4741. // empty value appearing in NullFields will be sent to the server as
  4742. // null. It is an error if a field in this list has a non-empty value.
  4743. // This may be used to include null fields in Patch requests.
  4744. NullFields []string `json:"-"`
  4745. }
  4746. func (s *LiveChatPollEditedDetails) MarshalJSON() ([]byte, error) {
  4747. type NoMethod LiveChatPollEditedDetails
  4748. raw := NoMethod(*s)
  4749. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4750. }
  4751. type LiveChatPollItem struct {
  4752. // Description: Plain text description of the item.
  4753. Description string `json:"description,omitempty"`
  4754. ItemId string `json:"itemId,omitempty"`
  4755. // ForceSendFields is a list of field names (e.g. "Description") to
  4756. // unconditionally include in API requests. By default, fields with
  4757. // empty values are omitted from API requests. However, any non-pointer,
  4758. // non-interface field appearing in ForceSendFields will be sent to the
  4759. // server regardless of whether the field is empty or not. This may be
  4760. // used to include empty fields in Patch requests.
  4761. ForceSendFields []string `json:"-"`
  4762. // NullFields is a list of field names (e.g. "Description") to include
  4763. // in API requests with the JSON null value. By default, fields with
  4764. // empty values are omitted from API requests. However, any field with
  4765. // an empty value appearing in NullFields will be sent to the server as
  4766. // null. It is an error if a field in this list has a non-empty value.
  4767. // This may be used to include null fields in Patch requests.
  4768. NullFields []string `json:"-"`
  4769. }
  4770. func (s *LiveChatPollItem) MarshalJSON() ([]byte, error) {
  4771. type NoMethod LiveChatPollItem
  4772. raw := NoMethod(*s)
  4773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4774. }
  4775. type LiveChatPollOpenedDetails struct {
  4776. Id string `json:"id,omitempty"`
  4777. Items []*LiveChatPollItem `json:"items,omitempty"`
  4778. Prompt string `json:"prompt,omitempty"`
  4779. // ForceSendFields is a list of field names (e.g. "Id") to
  4780. // unconditionally include in API requests. By default, fields with
  4781. // empty values are omitted from API requests. However, any non-pointer,
  4782. // non-interface field appearing in ForceSendFields will be sent to the
  4783. // server regardless of whether the field is empty or not. This may be
  4784. // used to include empty fields in Patch requests.
  4785. ForceSendFields []string `json:"-"`
  4786. // NullFields is a list of field names (e.g. "Id") to include in API
  4787. // requests with the JSON null value. By default, fields with empty
  4788. // values are omitted from API requests. However, any field with an
  4789. // empty value appearing in NullFields will be sent to the server as
  4790. // null. It is an error if a field in this list has a non-empty value.
  4791. // This may be used to include null fields in Patch requests.
  4792. NullFields []string `json:"-"`
  4793. }
  4794. func (s *LiveChatPollOpenedDetails) MarshalJSON() ([]byte, error) {
  4795. type NoMethod LiveChatPollOpenedDetails
  4796. raw := NoMethod(*s)
  4797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4798. }
  4799. type LiveChatPollVotedDetails struct {
  4800. // ItemId: The poll item the user chose.
  4801. ItemId string `json:"itemId,omitempty"`
  4802. // PollId: The poll the user voted on.
  4803. PollId string `json:"pollId,omitempty"`
  4804. // ForceSendFields is a list of field names (e.g. "ItemId") to
  4805. // unconditionally include in API requests. By default, fields with
  4806. // empty values are omitted from API requests. However, any non-pointer,
  4807. // non-interface field appearing in ForceSendFields will be sent to the
  4808. // server regardless of whether the field is empty or not. This may be
  4809. // used to include empty fields in Patch requests.
  4810. ForceSendFields []string `json:"-"`
  4811. // NullFields is a list of field names (e.g. "ItemId") to include in API
  4812. // requests with the JSON null value. By default, fields with empty
  4813. // values are omitted from API requests. However, any field with an
  4814. // empty value appearing in NullFields will be sent to the server as
  4815. // null. It is an error if a field in this list has a non-empty value.
  4816. // This may be used to include null fields in Patch requests.
  4817. NullFields []string `json:"-"`
  4818. }
  4819. func (s *LiveChatPollVotedDetails) MarshalJSON() ([]byte, error) {
  4820. type NoMethod LiveChatPollVotedDetails
  4821. raw := NoMethod(*s)
  4822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4823. }
  4824. type LiveChatSuperChatDetails struct {
  4825. // AmountDisplayString: A rendered string that displays the fund amount
  4826. // and currency to the user.
  4827. AmountDisplayString string `json:"amountDisplayString,omitempty"`
  4828. // AmountMicros: The amount purchased by the user, in micros (1,750,000
  4829. // micros = 1.75).
  4830. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  4831. // Currency: The currency in which the purchase was made.
  4832. Currency string `json:"currency,omitempty"`
  4833. // Tier: The tier in which the amount belongs. Lower amounts belong to
  4834. // lower tiers. The lowest tier is 1.
  4835. Tier int64 `json:"tier,omitempty"`
  4836. // UserComment: The comment added by the user to this Super Chat event.
  4837. UserComment string `json:"userComment,omitempty"`
  4838. // ForceSendFields is a list of field names (e.g. "AmountDisplayString")
  4839. // to unconditionally include in API requests. By default, fields with
  4840. // empty values are omitted from API requests. However, any non-pointer,
  4841. // non-interface field appearing in ForceSendFields will be sent to the
  4842. // server regardless of whether the field is empty or not. This may be
  4843. // used to include empty fields in Patch requests.
  4844. ForceSendFields []string `json:"-"`
  4845. // NullFields is a list of field names (e.g. "AmountDisplayString") to
  4846. // include in API requests with the JSON null value. By default, fields
  4847. // with empty values are omitted from API requests. However, any field
  4848. // with an empty value appearing in NullFields will be sent to the
  4849. // server as null. It is an error if a field in this list has a
  4850. // non-empty value. This may be used to include null fields in Patch
  4851. // requests.
  4852. NullFields []string `json:"-"`
  4853. }
  4854. func (s *LiveChatSuperChatDetails) MarshalJSON() ([]byte, error) {
  4855. type NoMethod LiveChatSuperChatDetails
  4856. raw := NoMethod(*s)
  4857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4858. }
  4859. type LiveChatSuperStickerDetails struct {
  4860. // AmountDisplayString: A rendered string that displays the fund amount
  4861. // and currency to the user.
  4862. AmountDisplayString string `json:"amountDisplayString,omitempty"`
  4863. // AmountMicros: The amount purchased by the user, in micros (1,750,000
  4864. // micros = 1.75).
  4865. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  4866. // Currency: The currency in which the purchase was made.
  4867. Currency string `json:"currency,omitempty"`
  4868. // SuperStickerMetadata: Information about the Super Sticker.
  4869. SuperStickerMetadata *SuperStickerMetadata `json:"superStickerMetadata,omitempty"`
  4870. // Tier: The tier in which the amount belongs. Lower amounts belong to
  4871. // lower tiers. The lowest tier is 1.
  4872. Tier int64 `json:"tier,omitempty"`
  4873. // ForceSendFields is a list of field names (e.g. "AmountDisplayString")
  4874. // to unconditionally include in API requests. By default, fields with
  4875. // empty values are omitted from API requests. However, any non-pointer,
  4876. // non-interface field appearing in ForceSendFields will be sent to the
  4877. // server regardless of whether the field is empty or not. This may be
  4878. // used to include empty fields in Patch requests.
  4879. ForceSendFields []string `json:"-"`
  4880. // NullFields is a list of field names (e.g. "AmountDisplayString") to
  4881. // include in API requests with the JSON null value. By default, fields
  4882. // with empty values are omitted from API requests. However, any field
  4883. // with an empty value appearing in NullFields will be sent to the
  4884. // server as null. It is an error if a field in this list has a
  4885. // non-empty value. This may be used to include null fields in Patch
  4886. // requests.
  4887. NullFields []string `json:"-"`
  4888. }
  4889. func (s *LiveChatSuperStickerDetails) MarshalJSON() ([]byte, error) {
  4890. type NoMethod LiveChatSuperStickerDetails
  4891. raw := NoMethod(*s)
  4892. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4893. }
  4894. type LiveChatTextMessageDetails struct {
  4895. // MessageText: The user's message.
  4896. MessageText string `json:"messageText,omitempty"`
  4897. // ForceSendFields is a list of field names (e.g. "MessageText") to
  4898. // unconditionally include in API requests. By default, fields with
  4899. // empty values are omitted from API requests. However, any non-pointer,
  4900. // non-interface field appearing in ForceSendFields will be sent to the
  4901. // server regardless of whether the field is empty or not. This may be
  4902. // used to include empty fields in Patch requests.
  4903. ForceSendFields []string `json:"-"`
  4904. // NullFields is a list of field names (e.g. "MessageText") to include
  4905. // in API requests with the JSON null value. By default, fields with
  4906. // empty values are omitted from API requests. However, any field with
  4907. // an empty value appearing in NullFields will be sent to the server as
  4908. // null. It is an error if a field in this list has a non-empty value.
  4909. // This may be used to include null fields in Patch requests.
  4910. NullFields []string `json:"-"`
  4911. }
  4912. func (s *LiveChatTextMessageDetails) MarshalJSON() ([]byte, error) {
  4913. type NoMethod LiveChatTextMessageDetails
  4914. raw := NoMethod(*s)
  4915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4916. }
  4917. type LiveChatUserBannedMessageDetails struct {
  4918. // BanDurationSeconds: The duration of the ban. This property is only
  4919. // present if the banType is temporary.
  4920. BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
  4921. // BanType: The type of ban.
  4922. //
  4923. // Possible values:
  4924. // "permanent"
  4925. // "temporary"
  4926. BanType string `json:"banType,omitempty"`
  4927. // BannedUserDetails: The details of the user that was banned.
  4928. BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
  4929. // ForceSendFields is a list of field names (e.g. "BanDurationSeconds")
  4930. // to unconditionally include in API requests. By default, fields with
  4931. // empty values are omitted from API requests. However, any non-pointer,
  4932. // non-interface field appearing in ForceSendFields will be sent to the
  4933. // server regardless of whether the field is empty or not. This may be
  4934. // used to include empty fields in Patch requests.
  4935. ForceSendFields []string `json:"-"`
  4936. // NullFields is a list of field names (e.g. "BanDurationSeconds") to
  4937. // include in API requests with the JSON null value. By default, fields
  4938. // with empty values are omitted from API requests. However, any field
  4939. // with an empty value appearing in NullFields will be sent to the
  4940. // server as null. It is an error if a field in this list has a
  4941. // non-empty value. This may be used to include null fields in Patch
  4942. // requests.
  4943. NullFields []string `json:"-"`
  4944. }
  4945. func (s *LiveChatUserBannedMessageDetails) MarshalJSON() ([]byte, error) {
  4946. type NoMethod LiveChatUserBannedMessageDetails
  4947. raw := NoMethod(*s)
  4948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4949. }
  4950. // LiveStream: A live stream describes a live ingestion point.
  4951. type LiveStream struct {
  4952. // Cdn: The cdn object defines the live stream's content delivery
  4953. // network (CDN) settings. These settings provide details about the
  4954. // manner in which you stream your content to YouTube.
  4955. Cdn *CdnSettings `json:"cdn,omitempty"`
  4956. // ContentDetails: The content_details object contains information about
  4957. // the stream, including the closed captions ingestion URL.
  4958. ContentDetails *LiveStreamContentDetails `json:"contentDetails,omitempty"`
  4959. // Etag: Etag of this resource.
  4960. Etag string `json:"etag,omitempty"`
  4961. // Id: The ID that YouTube assigns to uniquely identify the stream.
  4962. Id string `json:"id,omitempty"`
  4963. // Kind: Identifies what kind of resource this is. Value: the fixed
  4964. // string "youtube#liveStream".
  4965. Kind string `json:"kind,omitempty"`
  4966. // Snippet: The snippet object contains basic details about the stream,
  4967. // including its channel, title, and description.
  4968. Snippet *LiveStreamSnippet `json:"snippet,omitempty"`
  4969. // Status: The status object contains information about live stream's
  4970. // status.
  4971. Status *LiveStreamStatus `json:"status,omitempty"`
  4972. // ServerResponse contains the HTTP response code and headers from the
  4973. // server.
  4974. googleapi.ServerResponse `json:"-"`
  4975. // ForceSendFields is a list of field names (e.g. "Cdn") to
  4976. // unconditionally include in API requests. By default, fields with
  4977. // empty values are omitted from API requests. However, any non-pointer,
  4978. // non-interface field appearing in ForceSendFields will be sent to the
  4979. // server regardless of whether the field is empty or not. This may be
  4980. // used to include empty fields in Patch requests.
  4981. ForceSendFields []string `json:"-"`
  4982. // NullFields is a list of field names (e.g. "Cdn") to include in API
  4983. // requests with the JSON null value. By default, fields with empty
  4984. // values are omitted from API requests. However, any field with an
  4985. // empty value appearing in NullFields will be sent to the server as
  4986. // null. It is an error if a field in this list has a non-empty value.
  4987. // This may be used to include null fields in Patch requests.
  4988. NullFields []string `json:"-"`
  4989. }
  4990. func (s *LiveStream) MarshalJSON() ([]byte, error) {
  4991. type NoMethod LiveStream
  4992. raw := NoMethod(*s)
  4993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4994. }
  4995. type LiveStreamConfigurationIssue struct {
  4996. // Description: The long-form description of the issue and how to
  4997. // resolve it.
  4998. Description string `json:"description,omitempty"`
  4999. // Reason: The short-form reason for this issue.
  5000. Reason string `json:"reason,omitempty"`
  5001. // Severity: How severe this issue is to the stream.
  5002. //
  5003. // Possible values:
  5004. // "error"
  5005. // "info"
  5006. // "warning"
  5007. Severity string `json:"severity,omitempty"`
  5008. // Type: The kind of error happening.
  5009. //
  5010. // Possible values:
  5011. // "audioBitrateHigh"
  5012. // "audioBitrateLow"
  5013. // "audioBitrateMismatch"
  5014. // "audioCodec"
  5015. // "audioCodecMismatch"
  5016. // "audioSampleRate"
  5017. // "audioSampleRateMismatch"
  5018. // "audioStereoMismatch"
  5019. // "audioTooManyChannels"
  5020. // "badContainer"
  5021. // "bitrateHigh"
  5022. // "bitrateLow"
  5023. // "frameRateHigh"
  5024. // "framerateMismatch"
  5025. // "gopMismatch"
  5026. // "gopSizeLong"
  5027. // "gopSizeOver"
  5028. // "gopSizeShort"
  5029. // "interlacedVideo"
  5030. // "multipleAudioStreams"
  5031. // "multipleVideoStreams"
  5032. // "noAudioStream"
  5033. // "noVideoStream"
  5034. // "openGop"
  5035. // "resolutionMismatch"
  5036. // "videoBitrateMismatch"
  5037. // "videoCodec"
  5038. // "videoCodecMismatch"
  5039. // "videoIngestionFasterThanRealtime"
  5040. // "videoIngestionStarved"
  5041. // "videoInterlaceMismatch"
  5042. // "videoProfileMismatch"
  5043. // "videoResolutionSuboptimal"
  5044. // "videoResolutionUnsupported"
  5045. Type string `json:"type,omitempty"`
  5046. // ForceSendFields is a list of field names (e.g. "Description") to
  5047. // unconditionally include in API requests. By default, fields with
  5048. // empty values are omitted from API requests. However, any non-pointer,
  5049. // non-interface field appearing in ForceSendFields will be sent to the
  5050. // server regardless of whether the field is empty or not. This may be
  5051. // used to include empty fields in Patch requests.
  5052. ForceSendFields []string `json:"-"`
  5053. // NullFields is a list of field names (e.g. "Description") to include
  5054. // in API requests with the JSON null value. By default, fields with
  5055. // empty values are omitted from API requests. However, any field with
  5056. // an empty value appearing in NullFields will be sent to the server as
  5057. // null. It is an error if a field in this list has a non-empty value.
  5058. // This may be used to include null fields in Patch requests.
  5059. NullFields []string `json:"-"`
  5060. }
  5061. func (s *LiveStreamConfigurationIssue) MarshalJSON() ([]byte, error) {
  5062. type NoMethod LiveStreamConfigurationIssue
  5063. raw := NoMethod(*s)
  5064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5065. }
  5066. // LiveStreamContentDetails: Detailed settings of a stream.
  5067. type LiveStreamContentDetails struct {
  5068. // ClosedCaptionsIngestionUrl: The ingestion URL where the closed
  5069. // captions of this stream are sent.
  5070. ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"`
  5071. // IsReusable: Indicates whether the stream is reusable, which means
  5072. // that it can be bound to multiple broadcasts. It is common for
  5073. // broadcasters to reuse the same stream for many different broadcasts
  5074. // if those broadcasts occur at different times.
  5075. //
  5076. // If you set this value to false, then the stream will not be reusable,
  5077. // which means that it can only be bound to one broadcast. Non-reusable
  5078. // streams differ from reusable streams in the following ways:
  5079. // - A non-reusable stream can only be bound to one broadcast.
  5080. // - A non-reusable stream might be deleted by an automated process
  5081. // after the broadcast ends.
  5082. // - The liveStreams.list method does not list non-reusable streams if
  5083. // you call the method and set the mine parameter to true. The only way
  5084. // to use that method to retrieve the resource for a non-reusable stream
  5085. // is to use the id parameter to identify the stream.
  5086. IsReusable bool `json:"isReusable,omitempty"`
  5087. // ForceSendFields is a list of field names (e.g.
  5088. // "ClosedCaptionsIngestionUrl") to unconditionally include in API
  5089. // requests. By default, fields with empty values are omitted from API
  5090. // requests. However, any non-pointer, non-interface field appearing in
  5091. // ForceSendFields will be sent to the server regardless of whether the
  5092. // field is empty or not. This may be used to include empty fields in
  5093. // Patch requests.
  5094. ForceSendFields []string `json:"-"`
  5095. // NullFields is a list of field names (e.g.
  5096. // "ClosedCaptionsIngestionUrl") to include in API requests with the
  5097. // JSON null value. By default, fields with empty values are omitted
  5098. // from API requests. However, any field with an empty value appearing
  5099. // in NullFields will be sent to the server as null. It is an error if a
  5100. // field in this list has a non-empty value. This may be used to include
  5101. // null fields in Patch requests.
  5102. NullFields []string `json:"-"`
  5103. }
  5104. func (s *LiveStreamContentDetails) MarshalJSON() ([]byte, error) {
  5105. type NoMethod LiveStreamContentDetails
  5106. raw := NoMethod(*s)
  5107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5108. }
  5109. type LiveStreamHealthStatus struct {
  5110. // ConfigurationIssues: The configurations issues on this stream
  5111. ConfigurationIssues []*LiveStreamConfigurationIssue `json:"configurationIssues,omitempty"`
  5112. // LastUpdateTimeSeconds: The last time this status was updated (in
  5113. // seconds)
  5114. LastUpdateTimeSeconds uint64 `json:"lastUpdateTimeSeconds,omitempty,string"`
  5115. // Status: The status code of this stream
  5116. //
  5117. // Possible values:
  5118. // "bad"
  5119. // "good"
  5120. // "noData"
  5121. // "ok"
  5122. // "revoked"
  5123. Status string `json:"status,omitempty"`
  5124. // ForceSendFields is a list of field names (e.g. "ConfigurationIssues")
  5125. // to unconditionally include in API requests. By default, fields with
  5126. // empty values are omitted from API requests. However, any non-pointer,
  5127. // non-interface field appearing in ForceSendFields will be sent to the
  5128. // server regardless of whether the field is empty or not. This may be
  5129. // used to include empty fields in Patch requests.
  5130. ForceSendFields []string `json:"-"`
  5131. // NullFields is a list of field names (e.g. "ConfigurationIssues") to
  5132. // include in API requests with the JSON null value. By default, fields
  5133. // with empty values are omitted from API requests. However, any field
  5134. // with an empty value appearing in NullFields will be sent to the
  5135. // server as null. It is an error if a field in this list has a
  5136. // non-empty value. This may be used to include null fields in Patch
  5137. // requests.
  5138. NullFields []string `json:"-"`
  5139. }
  5140. func (s *LiveStreamHealthStatus) MarshalJSON() ([]byte, error) {
  5141. type NoMethod LiveStreamHealthStatus
  5142. raw := NoMethod(*s)
  5143. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5144. }
  5145. type LiveStreamListResponse struct {
  5146. // Etag: Etag of this resource.
  5147. Etag string `json:"etag,omitempty"`
  5148. // EventId: Serialized EventId of the request which produced this
  5149. // response.
  5150. EventId string `json:"eventId,omitempty"`
  5151. // Items: A list of live streams that match the request criteria.
  5152. Items []*LiveStream `json:"items,omitempty"`
  5153. // Kind: Identifies what kind of resource this is. Value: the fixed
  5154. // string "youtube#liveStreamListResponse".
  5155. Kind string `json:"kind,omitempty"`
  5156. // NextPageToken: The token that can be used as the value of the
  5157. // pageToken parameter to retrieve the next page in the result set.
  5158. NextPageToken string `json:"nextPageToken,omitempty"`
  5159. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5160. // PrevPageToken: The token that can be used as the value of the
  5161. // pageToken parameter to retrieve the previous page in the result set.
  5162. PrevPageToken string `json:"prevPageToken,omitempty"`
  5163. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5164. // VisitorId: The visitorId identifies the visitor.
  5165. VisitorId string `json:"visitorId,omitempty"`
  5166. // ServerResponse contains the HTTP response code and headers from the
  5167. // server.
  5168. googleapi.ServerResponse `json:"-"`
  5169. // ForceSendFields is a list of field names (e.g. "Etag") to
  5170. // unconditionally include in API requests. By default, fields with
  5171. // empty values are omitted from API requests. However, any non-pointer,
  5172. // non-interface field appearing in ForceSendFields will be sent to the
  5173. // server regardless of whether the field is empty or not. This may be
  5174. // used to include empty fields in Patch requests.
  5175. ForceSendFields []string `json:"-"`
  5176. // NullFields is a list of field names (e.g. "Etag") to include in API
  5177. // requests with the JSON null value. By default, fields with empty
  5178. // values are omitted from API requests. However, any field with an
  5179. // empty value appearing in NullFields will be sent to the server as
  5180. // null. It is an error if a field in this list has a non-empty value.
  5181. // This may be used to include null fields in Patch requests.
  5182. NullFields []string `json:"-"`
  5183. }
  5184. func (s *LiveStreamListResponse) MarshalJSON() ([]byte, error) {
  5185. type NoMethod LiveStreamListResponse
  5186. raw := NoMethod(*s)
  5187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5188. }
  5189. type LiveStreamSnippet struct {
  5190. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  5191. // that is transmitting the stream.
  5192. ChannelId string `json:"channelId,omitempty"`
  5193. // Description: The stream's description. The value cannot be longer
  5194. // than 10000 characters.
  5195. Description string `json:"description,omitempty"`
  5196. IsDefaultStream bool `json:"isDefaultStream,omitempty"`
  5197. // PublishedAt: The date and time that the stream was created. The value
  5198. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5199. PublishedAt string `json:"publishedAt,omitempty"`
  5200. // Title: The stream's title. The value must be between 1 and 128
  5201. // characters long.
  5202. Title string `json:"title,omitempty"`
  5203. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5204. // unconditionally include in API requests. By default, fields with
  5205. // empty values are omitted from API requests. However, any non-pointer,
  5206. // non-interface field appearing in ForceSendFields will be sent to the
  5207. // server regardless of whether the field is empty or not. This may be
  5208. // used to include empty fields in Patch requests.
  5209. ForceSendFields []string `json:"-"`
  5210. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5211. // API requests with the JSON null value. By default, fields with empty
  5212. // values are omitted from API requests. However, any field with an
  5213. // empty value appearing in NullFields will be sent to the server as
  5214. // null. It is an error if a field in this list has a non-empty value.
  5215. // This may be used to include null fields in Patch requests.
  5216. NullFields []string `json:"-"`
  5217. }
  5218. func (s *LiveStreamSnippet) MarshalJSON() ([]byte, error) {
  5219. type NoMethod LiveStreamSnippet
  5220. raw := NoMethod(*s)
  5221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5222. }
  5223. // LiveStreamStatus: Brief description of the live stream status.
  5224. type LiveStreamStatus struct {
  5225. // HealthStatus: The health status of the stream.
  5226. HealthStatus *LiveStreamHealthStatus `json:"healthStatus,omitempty"`
  5227. // Possible values:
  5228. // "active"
  5229. // "created"
  5230. // "error"
  5231. // "inactive"
  5232. // "ready"
  5233. StreamStatus string `json:"streamStatus,omitempty"`
  5234. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  5235. // unconditionally include in API requests. By default, fields with
  5236. // empty values are omitted from API requests. However, any non-pointer,
  5237. // non-interface field appearing in ForceSendFields will be sent to the
  5238. // server regardless of whether the field is empty or not. This may be
  5239. // used to include empty fields in Patch requests.
  5240. ForceSendFields []string `json:"-"`
  5241. // NullFields is a list of field names (e.g. "HealthStatus") to include
  5242. // in API requests with the JSON null value. By default, fields with
  5243. // empty values are omitted from API requests. However, any field with
  5244. // an empty value appearing in NullFields will be sent to the server as
  5245. // null. It is an error if a field in this list has a non-empty value.
  5246. // This may be used to include null fields in Patch requests.
  5247. NullFields []string `json:"-"`
  5248. }
  5249. func (s *LiveStreamStatus) MarshalJSON() ([]byte, error) {
  5250. type NoMethod LiveStreamStatus
  5251. raw := NoMethod(*s)
  5252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5253. }
  5254. type LocalizedProperty struct {
  5255. Default string `json:"default,omitempty"`
  5256. // DefaultLanguage: The language of the default property.
  5257. DefaultLanguage *LanguageTag `json:"defaultLanguage,omitempty"`
  5258. Localized []*LocalizedString `json:"localized,omitempty"`
  5259. // ForceSendFields is a list of field names (e.g. "Default") to
  5260. // unconditionally include in API requests. By default, fields with
  5261. // empty values are omitted from API requests. However, any non-pointer,
  5262. // non-interface field appearing in ForceSendFields will be sent to the
  5263. // server regardless of whether the field is empty or not. This may be
  5264. // used to include empty fields in Patch requests.
  5265. ForceSendFields []string `json:"-"`
  5266. // NullFields is a list of field names (e.g. "Default") to include in
  5267. // API requests with the JSON null value. By default, fields with empty
  5268. // values are omitted from API requests. However, any field with an
  5269. // empty value appearing in NullFields will be sent to the server as
  5270. // null. It is an error if a field in this list has a non-empty value.
  5271. // This may be used to include null fields in Patch requests.
  5272. NullFields []string `json:"-"`
  5273. }
  5274. func (s *LocalizedProperty) MarshalJSON() ([]byte, error) {
  5275. type NoMethod LocalizedProperty
  5276. raw := NoMethod(*s)
  5277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5278. }
  5279. type LocalizedString struct {
  5280. Language string `json:"language,omitempty"`
  5281. Value string `json:"value,omitempty"`
  5282. // ForceSendFields is a list of field names (e.g. "Language") to
  5283. // unconditionally include in API requests. By default, fields with
  5284. // empty values are omitted from API requests. However, any non-pointer,
  5285. // non-interface field appearing in ForceSendFields will be sent to the
  5286. // server regardless of whether the field is empty or not. This may be
  5287. // used to include empty fields in Patch requests.
  5288. ForceSendFields []string `json:"-"`
  5289. // NullFields is a list of field names (e.g. "Language") to include in
  5290. // API requests with the JSON null value. By default, fields with empty
  5291. // values are omitted from API requests. However, any field with an
  5292. // empty value appearing in NullFields will be sent to the server as
  5293. // null. It is an error if a field in this list has a non-empty value.
  5294. // This may be used to include null fields in Patch requests.
  5295. NullFields []string `json:"-"`
  5296. }
  5297. func (s *LocalizedString) MarshalJSON() ([]byte, error) {
  5298. type NoMethod LocalizedString
  5299. raw := NoMethod(*s)
  5300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5301. }
  5302. // MonitorStreamInfo: Settings and Info of the monitor stream
  5303. type MonitorStreamInfo struct {
  5304. // BroadcastStreamDelayMs: If you have set the enableMonitorStream
  5305. // property to true, then this property determines the length of the
  5306. // live broadcast delay.
  5307. BroadcastStreamDelayMs int64 `json:"broadcastStreamDelayMs,omitempty"`
  5308. // EmbedHtml: HTML code that embeds a player that plays the monitor
  5309. // stream.
  5310. EmbedHtml string `json:"embedHtml,omitempty"`
  5311. // EnableMonitorStream: This value determines whether the monitor stream
  5312. // is enabled for the broadcast. If the monitor stream is enabled, then
  5313. // YouTube will broadcast the event content on a special stream intended
  5314. // only for the broadcaster's consumption. The broadcaster can use the
  5315. // stream to review the event content and also to identify the optimal
  5316. // times to insert cuepoints.
  5317. //
  5318. // You need to set this value to true if you intend to have a broadcast
  5319. // delay for your event.
  5320. //
  5321. // Note: This property cannot be updated once the broadcast is in the
  5322. // testing or live state.
  5323. EnableMonitorStream bool `json:"enableMonitorStream,omitempty"`
  5324. // ForceSendFields is a list of field names (e.g.
  5325. // "BroadcastStreamDelayMs") to unconditionally include in API requests.
  5326. // By default, fields with empty values are omitted from API requests.
  5327. // However, any non-pointer, non-interface field appearing in
  5328. // ForceSendFields will be sent to the server regardless of whether the
  5329. // field is empty or not. This may be used to include empty fields in
  5330. // Patch requests.
  5331. ForceSendFields []string `json:"-"`
  5332. // NullFields is a list of field names (e.g. "BroadcastStreamDelayMs")
  5333. // to include in API requests with the JSON null value. By default,
  5334. // fields with empty values are omitted from API requests. However, any
  5335. // field with an empty value appearing in NullFields will be sent to the
  5336. // server as null. It is an error if a field in this list has a
  5337. // non-empty value. This may be used to include null fields in Patch
  5338. // requests.
  5339. NullFields []string `json:"-"`
  5340. }
  5341. func (s *MonitorStreamInfo) MarshalJSON() ([]byte, error) {
  5342. type NoMethod MonitorStreamInfo
  5343. raw := NoMethod(*s)
  5344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5345. }
  5346. // Nonprofit: Nonprofit information.
  5347. type Nonprofit struct {
  5348. // NonprofitId: Id of the nonprofit.
  5349. NonprofitId *NonprofitId `json:"nonprofitId,omitempty"`
  5350. // NonprofitLegalName: Legal name of the nonprofit.
  5351. NonprofitLegalName string `json:"nonprofitLegalName,omitempty"`
  5352. // ForceSendFields is a list of field names (e.g. "NonprofitId") to
  5353. // unconditionally include in API requests. By default, fields with
  5354. // empty values are omitted from API requests. However, any non-pointer,
  5355. // non-interface field appearing in ForceSendFields will be sent to the
  5356. // server regardless of whether the field is empty or not. This may be
  5357. // used to include empty fields in Patch requests.
  5358. ForceSendFields []string `json:"-"`
  5359. // NullFields is a list of field names (e.g. "NonprofitId") to include
  5360. // in API requests with the JSON null value. By default, fields with
  5361. // empty values are omitted from API requests. However, any field with
  5362. // an empty value appearing in NullFields will be sent to the server as
  5363. // null. It is an error if a field in this list has a non-empty value.
  5364. // This may be used to include null fields in Patch requests.
  5365. NullFields []string `json:"-"`
  5366. }
  5367. func (s *Nonprofit) MarshalJSON() ([]byte, error) {
  5368. type NoMethod Nonprofit
  5369. raw := NoMethod(*s)
  5370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5371. }
  5372. type NonprofitId struct {
  5373. Value string `json:"value,omitempty"`
  5374. // ForceSendFields is a list of field names (e.g. "Value") to
  5375. // unconditionally include in API requests. By default, fields with
  5376. // empty values are omitted from API requests. However, any non-pointer,
  5377. // non-interface field appearing in ForceSendFields will be sent to the
  5378. // server regardless of whether the field is empty or not. This may be
  5379. // used to include empty fields in Patch requests.
  5380. ForceSendFields []string `json:"-"`
  5381. // NullFields is a list of field names (e.g. "Value") to include in API
  5382. // requests with the JSON null value. By default, fields with empty
  5383. // values are omitted from API requests. However, any field with an
  5384. // empty value appearing in NullFields will be sent to the server as
  5385. // null. It is an error if a field in this list has a non-empty value.
  5386. // This may be used to include null fields in Patch requests.
  5387. NullFields []string `json:"-"`
  5388. }
  5389. func (s *NonprofitId) MarshalJSON() ([]byte, error) {
  5390. type NoMethod NonprofitId
  5391. raw := NoMethod(*s)
  5392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5393. }
  5394. // PageInfo: Paging details for lists of resources, including total
  5395. // number of items available and number of resources returned in a
  5396. // single page.
  5397. type PageInfo struct {
  5398. // ResultsPerPage: The number of results included in the API response.
  5399. ResultsPerPage int64 `json:"resultsPerPage,omitempty"`
  5400. // TotalResults: The total number of results in the result set.
  5401. TotalResults int64 `json:"totalResults,omitempty"`
  5402. // ForceSendFields is a list of field names (e.g. "ResultsPerPage") to
  5403. // unconditionally include in API requests. By default, fields with
  5404. // empty values are omitted from API requests. However, any non-pointer,
  5405. // non-interface field appearing in ForceSendFields will be sent to the
  5406. // server regardless of whether the field is empty or not. This may be
  5407. // used to include empty fields in Patch requests.
  5408. ForceSendFields []string `json:"-"`
  5409. // NullFields is a list of field names (e.g. "ResultsPerPage") to
  5410. // include in API requests with the JSON null value. By default, fields
  5411. // with empty values are omitted from API requests. However, any field
  5412. // with an empty value appearing in NullFields will be sent to the
  5413. // server as null. It is an error if a field in this list has a
  5414. // non-empty value. This may be used to include null fields in Patch
  5415. // requests.
  5416. NullFields []string `json:"-"`
  5417. }
  5418. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  5419. type NoMethod PageInfo
  5420. raw := NoMethod(*s)
  5421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5422. }
  5423. // Playlist: A playlist resource represents a YouTube playlist. A
  5424. // playlist is a collection of videos that can be viewed sequentially
  5425. // and shared with other users. A playlist can contain up to 200 videos,
  5426. // and YouTube does not limit the number of playlists that each user
  5427. // creates. By default, playlists are publicly visible to other users,
  5428. // but playlists can be public or private.
  5429. //
  5430. // YouTube also uses playlists to identify special collections of videos
  5431. // for a channel, such as:
  5432. // - uploaded videos
  5433. // - favorite videos
  5434. // - positively rated (liked) videos
  5435. // - watch history
  5436. // - watch later To be more specific, these lists are associated with a
  5437. // channel, which is a collection of a person, group, or company's
  5438. // videos, playlists, and other YouTube information. You can retrieve
  5439. // the playlist IDs for each of these lists from the channel resource
  5440. // for a given channel.
  5441. //
  5442. // You can then use the playlistItems.list method to retrieve any of
  5443. // those lists. You can also add or remove items from those lists by
  5444. // calling the playlistItems.insert and playlistItems.delete
  5445. // methods.
  5446. type Playlist struct {
  5447. // ContentDetails: The contentDetails object contains information like
  5448. // video count.
  5449. ContentDetails *PlaylistContentDetails `json:"contentDetails,omitempty"`
  5450. // Etag: Etag of this resource.
  5451. Etag string `json:"etag,omitempty"`
  5452. // Id: The ID that YouTube uses to uniquely identify the playlist.
  5453. Id string `json:"id,omitempty"`
  5454. // Kind: Identifies what kind of resource this is. Value: the fixed
  5455. // string "youtube#playlist".
  5456. Kind string `json:"kind,omitempty"`
  5457. // Localizations: Localizations for different languages
  5458. Localizations map[string]PlaylistLocalization `json:"localizations,omitempty"`
  5459. // Player: The player object contains information that you would use to
  5460. // play the playlist in an embedded player.
  5461. Player *PlaylistPlayer `json:"player,omitempty"`
  5462. // Snippet: The snippet object contains basic details about the
  5463. // playlist, such as its title and description.
  5464. Snippet *PlaylistSnippet `json:"snippet,omitempty"`
  5465. // Status: The status object contains status information for the
  5466. // playlist.
  5467. Status *PlaylistStatus `json:"status,omitempty"`
  5468. // ServerResponse contains the HTTP response code and headers from the
  5469. // server.
  5470. googleapi.ServerResponse `json:"-"`
  5471. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  5472. // unconditionally include in API requests. By default, fields with
  5473. // empty values are omitted from API requests. However, any non-pointer,
  5474. // non-interface field appearing in ForceSendFields will be sent to the
  5475. // server regardless of whether the field is empty or not. This may be
  5476. // used to include empty fields in Patch requests.
  5477. ForceSendFields []string `json:"-"`
  5478. // NullFields is a list of field names (e.g. "ContentDetails") to
  5479. // include in API requests with the JSON null value. By default, fields
  5480. // with empty values are omitted from API requests. However, any field
  5481. // with an empty value appearing in NullFields will be sent to the
  5482. // server as null. It is an error if a field in this list has a
  5483. // non-empty value. This may be used to include null fields in Patch
  5484. // requests.
  5485. NullFields []string `json:"-"`
  5486. }
  5487. func (s *Playlist) MarshalJSON() ([]byte, error) {
  5488. type NoMethod Playlist
  5489. raw := NoMethod(*s)
  5490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5491. }
  5492. type PlaylistContentDetails struct {
  5493. // ItemCount: The number of videos in the playlist.
  5494. ItemCount int64 `json:"itemCount,omitempty"`
  5495. // ForceSendFields is a list of field names (e.g. "ItemCount") to
  5496. // unconditionally include in API requests. By default, fields with
  5497. // empty values are omitted from API requests. However, any non-pointer,
  5498. // non-interface field appearing in ForceSendFields will be sent to the
  5499. // server regardless of whether the field is empty or not. This may be
  5500. // used to include empty fields in Patch requests.
  5501. ForceSendFields []string `json:"-"`
  5502. // NullFields is a list of field names (e.g. "ItemCount") to include in
  5503. // API requests with the JSON null value. By default, fields with empty
  5504. // values are omitted from API requests. However, any field with an
  5505. // empty value appearing in NullFields will be sent to the server as
  5506. // null. It is an error if a field in this list has a non-empty value.
  5507. // This may be used to include null fields in Patch requests.
  5508. NullFields []string `json:"-"`
  5509. }
  5510. func (s *PlaylistContentDetails) MarshalJSON() ([]byte, error) {
  5511. type NoMethod PlaylistContentDetails
  5512. raw := NoMethod(*s)
  5513. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5514. }
  5515. // PlaylistItem: A playlistItem resource identifies another resource,
  5516. // such as a video, that is included in a playlist. In addition, the
  5517. // playlistItem resource contains details about the included resource
  5518. // that pertain specifically to how that resource is used in that
  5519. // playlist.
  5520. //
  5521. // YouTube uses playlists to identify special collections of videos for
  5522. // a channel, such as:
  5523. // - uploaded videos
  5524. // - favorite videos
  5525. // - positively rated (liked) videos
  5526. // - watch history
  5527. // - watch later To be more specific, these lists are associated with a
  5528. // channel, which is a collection of a person, group, or company's
  5529. // videos, playlists, and other YouTube information.
  5530. //
  5531. // You can retrieve the playlist IDs for each of these lists from the
  5532. // channel resource for a given channel. You can then use the
  5533. // playlistItems.list method to retrieve any of those lists. You can
  5534. // also add or remove items from those lists by calling the
  5535. // playlistItems.insert and playlistItems.delete methods. For example,
  5536. // if a user gives a positive rating to a video, you would insert that
  5537. // video into the liked videos playlist for that user's channel.
  5538. type PlaylistItem struct {
  5539. // ContentDetails: The contentDetails object is included in the resource
  5540. // if the included item is a YouTube video. The object contains
  5541. // additional information about the video.
  5542. ContentDetails *PlaylistItemContentDetails `json:"contentDetails,omitempty"`
  5543. // Etag: Etag of this resource.
  5544. Etag string `json:"etag,omitempty"`
  5545. // Id: The ID that YouTube uses to uniquely identify the playlist item.
  5546. Id string `json:"id,omitempty"`
  5547. // Kind: Identifies what kind of resource this is. Value: the fixed
  5548. // string "youtube#playlistItem".
  5549. Kind string `json:"kind,omitempty"`
  5550. // Snippet: The snippet object contains basic details about the playlist
  5551. // item, such as its title and position in the playlist.
  5552. Snippet *PlaylistItemSnippet `json:"snippet,omitempty"`
  5553. // Status: The status object contains information about the playlist
  5554. // item's privacy status.
  5555. Status *PlaylistItemStatus `json:"status,omitempty"`
  5556. // ServerResponse contains the HTTP response code and headers from the
  5557. // server.
  5558. googleapi.ServerResponse `json:"-"`
  5559. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  5560. // unconditionally include in API requests. By default, fields with
  5561. // empty values are omitted from API requests. However, any non-pointer,
  5562. // non-interface field appearing in ForceSendFields will be sent to the
  5563. // server regardless of whether the field is empty or not. This may be
  5564. // used to include empty fields in Patch requests.
  5565. ForceSendFields []string `json:"-"`
  5566. // NullFields is a list of field names (e.g. "ContentDetails") to
  5567. // include in API requests with the JSON null value. By default, fields
  5568. // with empty values are omitted from API requests. However, any field
  5569. // with an empty value appearing in NullFields will be sent to the
  5570. // server as null. It is an error if a field in this list has a
  5571. // non-empty value. This may be used to include null fields in Patch
  5572. // requests.
  5573. NullFields []string `json:"-"`
  5574. }
  5575. func (s *PlaylistItem) MarshalJSON() ([]byte, error) {
  5576. type NoMethod PlaylistItem
  5577. raw := NoMethod(*s)
  5578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5579. }
  5580. type PlaylistItemContentDetails struct {
  5581. // EndAt: The time, measured in seconds from the start of the video,
  5582. // when the video should stop playing. (The playlist owner can specify
  5583. // the times when the video should start and stop playing when the video
  5584. // is played in the context of the playlist.) By default, assume that
  5585. // the video.endTime is the end of the video.
  5586. EndAt string `json:"endAt,omitempty"`
  5587. // Note: A user-generated note for this item.
  5588. Note string `json:"note,omitempty"`
  5589. // StartAt: The time, measured in seconds from the start of the video,
  5590. // when the video should start playing. (The playlist owner can specify
  5591. // the times when the video should start and stop playing when the video
  5592. // is played in the context of the playlist.) The default value is 0.
  5593. StartAt string `json:"startAt,omitempty"`
  5594. // VideoId: The ID that YouTube uses to uniquely identify a video. To
  5595. // retrieve the video resource, set the id query parameter to this value
  5596. // in your API request.
  5597. VideoId string `json:"videoId,omitempty"`
  5598. // VideoPublishedAt: The date and time that the video was published to
  5599. // YouTube. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  5600. // format.
  5601. VideoPublishedAt string `json:"videoPublishedAt,omitempty"`
  5602. // ForceSendFields is a list of field names (e.g. "EndAt") to
  5603. // unconditionally include in API requests. By default, fields with
  5604. // empty values are omitted from API requests. However, any non-pointer,
  5605. // non-interface field appearing in ForceSendFields will be sent to the
  5606. // server regardless of whether the field is empty or not. This may be
  5607. // used to include empty fields in Patch requests.
  5608. ForceSendFields []string `json:"-"`
  5609. // NullFields is a list of field names (e.g. "EndAt") to include in API
  5610. // requests with the JSON null value. By default, fields with empty
  5611. // values are omitted from API requests. However, any field with an
  5612. // empty value appearing in NullFields will be sent to the server as
  5613. // null. It is an error if a field in this list has a non-empty value.
  5614. // This may be used to include null fields in Patch requests.
  5615. NullFields []string `json:"-"`
  5616. }
  5617. func (s *PlaylistItemContentDetails) MarshalJSON() ([]byte, error) {
  5618. type NoMethod PlaylistItemContentDetails
  5619. raw := NoMethod(*s)
  5620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5621. }
  5622. type PlaylistItemListResponse struct {
  5623. // Etag: Etag of this resource.
  5624. Etag string `json:"etag,omitempty"`
  5625. // EventId: Serialized EventId of the request which produced this
  5626. // response.
  5627. EventId string `json:"eventId,omitempty"`
  5628. // Items: A list of playlist items that match the request criteria.
  5629. Items []*PlaylistItem `json:"items,omitempty"`
  5630. // Kind: Identifies what kind of resource this is. Value: the fixed
  5631. // string "youtube#playlistItemListResponse".
  5632. Kind string `json:"kind,omitempty"`
  5633. // NextPageToken: The token that can be used as the value of the
  5634. // pageToken parameter to retrieve the next page in the result set.
  5635. NextPageToken string `json:"nextPageToken,omitempty"`
  5636. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5637. // PrevPageToken: The token that can be used as the value of the
  5638. // pageToken parameter to retrieve the previous page in the result set.
  5639. PrevPageToken string `json:"prevPageToken,omitempty"`
  5640. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5641. // VisitorId: The visitorId identifies the visitor.
  5642. VisitorId string `json:"visitorId,omitempty"`
  5643. // ServerResponse contains the HTTP response code and headers from the
  5644. // server.
  5645. googleapi.ServerResponse `json:"-"`
  5646. // ForceSendFields is a list of field names (e.g. "Etag") to
  5647. // unconditionally include in API requests. By default, fields with
  5648. // empty values are omitted from API requests. However, any non-pointer,
  5649. // non-interface field appearing in ForceSendFields will be sent to the
  5650. // server regardless of whether the field is empty or not. This may be
  5651. // used to include empty fields in Patch requests.
  5652. ForceSendFields []string `json:"-"`
  5653. // NullFields is a list of field names (e.g. "Etag") to include in API
  5654. // requests with the JSON null value. By default, fields with empty
  5655. // values are omitted from API requests. However, any field with an
  5656. // empty value appearing in NullFields will be sent to the server as
  5657. // null. It is an error if a field in this list has a non-empty value.
  5658. // This may be used to include null fields in Patch requests.
  5659. NullFields []string `json:"-"`
  5660. }
  5661. func (s *PlaylistItemListResponse) MarshalJSON() ([]byte, error) {
  5662. type NoMethod PlaylistItemListResponse
  5663. raw := NoMethod(*s)
  5664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5665. }
  5666. // PlaylistItemSnippet: Basic details about a playlist, including title,
  5667. // description and thumbnails.
  5668. type PlaylistItemSnippet struct {
  5669. // ChannelId: The ID that YouTube uses to uniquely identify the user
  5670. // that added the item to the playlist.
  5671. ChannelId string `json:"channelId,omitempty"`
  5672. // ChannelTitle: Channel title for the channel that the playlist item
  5673. // belongs to.
  5674. ChannelTitle string `json:"channelTitle,omitempty"`
  5675. // Description: The item's description.
  5676. Description string `json:"description,omitempty"`
  5677. // PlaylistId: The ID that YouTube uses to uniquely identify the
  5678. // playlist that the playlist item is in.
  5679. PlaylistId string `json:"playlistId,omitempty"`
  5680. // Position: The order in which the item appears in the playlist. The
  5681. // value uses a zero-based index, so the first item has a position of 0,
  5682. // the second item has a position of 1, and so forth.
  5683. Position int64 `json:"position,omitempty"`
  5684. // PublishedAt: The date and time that the item was added to the
  5685. // playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  5686. // format.
  5687. PublishedAt string `json:"publishedAt,omitempty"`
  5688. // ResourceId: The id object contains information that can be used to
  5689. // uniquely identify the resource that is included in the playlist as
  5690. // the playlist item.
  5691. ResourceId *ResourceId `json:"resourceId,omitempty"`
  5692. // Thumbnails: A map of thumbnail images associated with the playlist
  5693. // item. For each object in the map, the key is the name of the
  5694. // thumbnail image, and the value is an object that contains other
  5695. // information about the thumbnail.
  5696. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  5697. // Title: The item's title.
  5698. Title string `json:"title,omitempty"`
  5699. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5700. // unconditionally include in API requests. By default, fields with
  5701. // empty values are omitted from API requests. However, any non-pointer,
  5702. // non-interface field appearing in ForceSendFields will be sent to the
  5703. // server regardless of whether the field is empty or not. This may be
  5704. // used to include empty fields in Patch requests.
  5705. ForceSendFields []string `json:"-"`
  5706. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5707. // API requests with the JSON null value. By default, fields with empty
  5708. // values are omitted from API requests. However, any field with an
  5709. // empty value appearing in NullFields will be sent to the server as
  5710. // null. It is an error if a field in this list has a non-empty value.
  5711. // This may be used to include null fields in Patch requests.
  5712. NullFields []string `json:"-"`
  5713. }
  5714. func (s *PlaylistItemSnippet) MarshalJSON() ([]byte, error) {
  5715. type NoMethod PlaylistItemSnippet
  5716. raw := NoMethod(*s)
  5717. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5718. }
  5719. // PlaylistItemStatus: Information about the playlist item's privacy
  5720. // status.
  5721. type PlaylistItemStatus struct {
  5722. // PrivacyStatus: This resource's privacy status.
  5723. //
  5724. // Possible values:
  5725. // "private"
  5726. // "public"
  5727. // "unlisted"
  5728. // "unlisted_new"
  5729. PrivacyStatus string `json:"privacyStatus,omitempty"`
  5730. // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
  5731. // unconditionally include in API requests. By default, fields with
  5732. // empty values are omitted from API requests. However, any non-pointer,
  5733. // non-interface field appearing in ForceSendFields will be sent to the
  5734. // server regardless of whether the field is empty or not. This may be
  5735. // used to include empty fields in Patch requests.
  5736. ForceSendFields []string `json:"-"`
  5737. // NullFields is a list of field names (e.g. "PrivacyStatus") to include
  5738. // in API requests with the JSON null value. By default, fields with
  5739. // empty values are omitted from API requests. However, any field with
  5740. // an empty value appearing in NullFields will be sent to the server as
  5741. // null. It is an error if a field in this list has a non-empty value.
  5742. // This may be used to include null fields in Patch requests.
  5743. NullFields []string `json:"-"`
  5744. }
  5745. func (s *PlaylistItemStatus) MarshalJSON() ([]byte, error) {
  5746. type NoMethod PlaylistItemStatus
  5747. raw := NoMethod(*s)
  5748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5749. }
  5750. type PlaylistListResponse struct {
  5751. // Etag: Etag of this resource.
  5752. Etag string `json:"etag,omitempty"`
  5753. // EventId: Serialized EventId of the request which produced this
  5754. // response.
  5755. EventId string `json:"eventId,omitempty"`
  5756. // Items: A list of playlists that match the request criteria.
  5757. Items []*Playlist `json:"items,omitempty"`
  5758. // Kind: Identifies what kind of resource this is. Value: the fixed
  5759. // string "youtube#playlistListResponse".
  5760. Kind string `json:"kind,omitempty"`
  5761. // NextPageToken: The token that can be used as the value of the
  5762. // pageToken parameter to retrieve the next page in the result set.
  5763. NextPageToken string `json:"nextPageToken,omitempty"`
  5764. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5765. // PrevPageToken: The token that can be used as the value of the
  5766. // pageToken parameter to retrieve the previous page in the result set.
  5767. PrevPageToken string `json:"prevPageToken,omitempty"`
  5768. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5769. // VisitorId: The visitorId identifies the visitor.
  5770. VisitorId string `json:"visitorId,omitempty"`
  5771. // ServerResponse contains the HTTP response code and headers from the
  5772. // server.
  5773. googleapi.ServerResponse `json:"-"`
  5774. // ForceSendFields is a list of field names (e.g. "Etag") to
  5775. // unconditionally include in API requests. By default, fields with
  5776. // empty values are omitted from API requests. However, any non-pointer,
  5777. // non-interface field appearing in ForceSendFields will be sent to the
  5778. // server regardless of whether the field is empty or not. This may be
  5779. // used to include empty fields in Patch requests.
  5780. ForceSendFields []string `json:"-"`
  5781. // NullFields is a list of field names (e.g. "Etag") to include in API
  5782. // requests with the JSON null value. By default, fields with empty
  5783. // values are omitted from API requests. However, any field with an
  5784. // empty value appearing in NullFields will be sent to the server as
  5785. // null. It is an error if a field in this list has a non-empty value.
  5786. // This may be used to include null fields in Patch requests.
  5787. NullFields []string `json:"-"`
  5788. }
  5789. func (s *PlaylistListResponse) MarshalJSON() ([]byte, error) {
  5790. type NoMethod PlaylistListResponse
  5791. raw := NoMethod(*s)
  5792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5793. }
  5794. // PlaylistLocalization: Playlist localization setting
  5795. type PlaylistLocalization struct {
  5796. // Description: The localized strings for playlist's description.
  5797. Description string `json:"description,omitempty"`
  5798. // Title: The localized strings for playlist's title.
  5799. Title string `json:"title,omitempty"`
  5800. // ForceSendFields is a list of field names (e.g. "Description") to
  5801. // unconditionally include in API requests. By default, fields with
  5802. // empty values are omitted from API requests. However, any non-pointer,
  5803. // non-interface field appearing in ForceSendFields will be sent to the
  5804. // server regardless of whether the field is empty or not. This may be
  5805. // used to include empty fields in Patch requests.
  5806. ForceSendFields []string `json:"-"`
  5807. // NullFields is a list of field names (e.g. "Description") to include
  5808. // in API requests with the JSON null value. By default, fields with
  5809. // empty values are omitted from API requests. However, any field with
  5810. // an empty value appearing in NullFields will be sent to the server as
  5811. // null. It is an error if a field in this list has a non-empty value.
  5812. // This may be used to include null fields in Patch requests.
  5813. NullFields []string `json:"-"`
  5814. }
  5815. func (s *PlaylistLocalization) MarshalJSON() ([]byte, error) {
  5816. type NoMethod PlaylistLocalization
  5817. raw := NoMethod(*s)
  5818. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5819. }
  5820. type PlaylistPlayer struct {
  5821. // EmbedHtml: An <iframe> tag that embeds a player that will play the
  5822. // playlist.
  5823. EmbedHtml string `json:"embedHtml,omitempty"`
  5824. // ForceSendFields is a list of field names (e.g. "EmbedHtml") to
  5825. // unconditionally include in API requests. By default, fields with
  5826. // empty values are omitted from API requests. However, any non-pointer,
  5827. // non-interface field appearing in ForceSendFields will be sent to the
  5828. // server regardless of whether the field is empty or not. This may be
  5829. // used to include empty fields in Patch requests.
  5830. ForceSendFields []string `json:"-"`
  5831. // NullFields is a list of field names (e.g. "EmbedHtml") to include in
  5832. // API requests with the JSON null value. By default, fields with empty
  5833. // values are omitted from API requests. However, any field with an
  5834. // empty value appearing in NullFields will be sent to the server as
  5835. // null. It is an error if a field in this list has a non-empty value.
  5836. // This may be used to include null fields in Patch requests.
  5837. NullFields []string `json:"-"`
  5838. }
  5839. func (s *PlaylistPlayer) MarshalJSON() ([]byte, error) {
  5840. type NoMethod PlaylistPlayer
  5841. raw := NoMethod(*s)
  5842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5843. }
  5844. // PlaylistSnippet: Basic details about a playlist, including title,
  5845. // description and thumbnails.
  5846. type PlaylistSnippet struct {
  5847. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  5848. // that published the playlist.
  5849. ChannelId string `json:"channelId,omitempty"`
  5850. // ChannelTitle: The channel title of the channel that the video belongs
  5851. // to.
  5852. ChannelTitle string `json:"channelTitle,omitempty"`
  5853. // DefaultLanguage: The language of the playlist's default title and
  5854. // description.
  5855. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  5856. // Description: The playlist's description.
  5857. Description string `json:"description,omitempty"`
  5858. // Localized: Localized title and description, read-only.
  5859. Localized *PlaylistLocalization `json:"localized,omitempty"`
  5860. // PublishedAt: The date and time that the playlist was created. The
  5861. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5862. PublishedAt string `json:"publishedAt,omitempty"`
  5863. // Tags: Keyword tags associated with the playlist.
  5864. Tags []string `json:"tags,omitempty"`
  5865. // Thumbnails: A map of thumbnail images associated with the playlist.
  5866. // For each object in the map, the key is the name of the thumbnail
  5867. // image, and the value is an object that contains other information
  5868. // about the thumbnail.
  5869. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  5870. // Title: The playlist's title.
  5871. Title string `json:"title,omitempty"`
  5872. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5873. // unconditionally include in API requests. By default, fields with
  5874. // empty values are omitted from API requests. However, any non-pointer,
  5875. // non-interface field appearing in ForceSendFields will be sent to the
  5876. // server regardless of whether the field is empty or not. This may be
  5877. // used to include empty fields in Patch requests.
  5878. ForceSendFields []string `json:"-"`
  5879. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5880. // API requests with the JSON null value. By default, fields with empty
  5881. // values are omitted from API requests. However, any field with an
  5882. // empty value appearing in NullFields will be sent to the server as
  5883. // null. It is an error if a field in this list has a non-empty value.
  5884. // This may be used to include null fields in Patch requests.
  5885. NullFields []string `json:"-"`
  5886. }
  5887. func (s *PlaylistSnippet) MarshalJSON() ([]byte, error) {
  5888. type NoMethod PlaylistSnippet
  5889. raw := NoMethod(*s)
  5890. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5891. }
  5892. type PlaylistStatus struct {
  5893. // PrivacyStatus: The playlist's privacy status.
  5894. //
  5895. // Possible values:
  5896. // "private"
  5897. // "public"
  5898. // "unlisted"
  5899. // "unlisted_new"
  5900. PrivacyStatus string `json:"privacyStatus,omitempty"`
  5901. // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
  5902. // unconditionally include in API requests. By default, fields with
  5903. // empty values are omitted from API requests. However, any non-pointer,
  5904. // non-interface field appearing in ForceSendFields will be sent to the
  5905. // server regardless of whether the field is empty or not. This may be
  5906. // used to include empty fields in Patch requests.
  5907. ForceSendFields []string `json:"-"`
  5908. // NullFields is a list of field names (e.g. "PrivacyStatus") to include
  5909. // in API requests with the JSON null value. By default, fields with
  5910. // empty values are omitted from API requests. However, any field with
  5911. // an empty value appearing in NullFields will be sent to the server as
  5912. // null. It is an error if a field in this list has a non-empty value.
  5913. // This may be used to include null fields in Patch requests.
  5914. NullFields []string `json:"-"`
  5915. }
  5916. func (s *PlaylistStatus) MarshalJSON() ([]byte, error) {
  5917. type NoMethod PlaylistStatus
  5918. raw := NoMethod(*s)
  5919. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5920. }
  5921. // PromotedItem: Describes a single promoted item.
  5922. type PromotedItem struct {
  5923. // CustomMessage: A custom message to display for this promotion. This
  5924. // field is currently ignored unless the promoted item is a website.
  5925. CustomMessage string `json:"customMessage,omitempty"`
  5926. // Id: Identifies the promoted item.
  5927. Id *PromotedItemId `json:"id,omitempty"`
  5928. // PromotedByContentOwner: If true, the content owner's name will be
  5929. // used when displaying the promotion. This field can only be set when
  5930. // the update is made on behalf of the content owner.
  5931. PromotedByContentOwner bool `json:"promotedByContentOwner,omitempty"`
  5932. // Timing: The temporal position within the video where the promoted
  5933. // item will be displayed. If present, it overrides the default timing.
  5934. Timing *InvideoTiming `json:"timing,omitempty"`
  5935. // ForceSendFields is a list of field names (e.g. "CustomMessage") to
  5936. // unconditionally include in API requests. By default, fields with
  5937. // empty values are omitted from API requests. However, any non-pointer,
  5938. // non-interface field appearing in ForceSendFields will be sent to the
  5939. // server regardless of whether the field is empty or not. This may be
  5940. // used to include empty fields in Patch requests.
  5941. ForceSendFields []string `json:"-"`
  5942. // NullFields is a list of field names (e.g. "CustomMessage") to include
  5943. // in API requests with the JSON null value. By default, fields with
  5944. // empty values are omitted from API requests. However, any field with
  5945. // an empty value appearing in NullFields will be sent to the server as
  5946. // null. It is an error if a field in this list has a non-empty value.
  5947. // This may be used to include null fields in Patch requests.
  5948. NullFields []string `json:"-"`
  5949. }
  5950. func (s *PromotedItem) MarshalJSON() ([]byte, error) {
  5951. type NoMethod PromotedItem
  5952. raw := NoMethod(*s)
  5953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5954. }
  5955. // PromotedItemId: Describes a single promoted item id. It is a union of
  5956. // various possible types.
  5957. type PromotedItemId struct {
  5958. // RecentlyUploadedBy: If type is recentUpload, this field identifies
  5959. // the channel from which to take the recent upload. If missing, the
  5960. // channel is assumed to be the same channel for which the
  5961. // invideoPromotion is set.
  5962. RecentlyUploadedBy string `json:"recentlyUploadedBy,omitempty"`
  5963. // Type: Describes the type of the promoted item.
  5964. //
  5965. // Possible values:
  5966. // "recentUpload"
  5967. // "video"
  5968. // "website"
  5969. Type string `json:"type,omitempty"`
  5970. // VideoId: If the promoted item represents a video, this field
  5971. // represents the unique YouTube ID identifying it. This field will be
  5972. // present only if type has the value video.
  5973. VideoId string `json:"videoId,omitempty"`
  5974. // WebsiteUrl: If the promoted item represents a website, this field
  5975. // represents the url pointing to the website. This field will be
  5976. // present only if type has the value website.
  5977. WebsiteUrl string `json:"websiteUrl,omitempty"`
  5978. // ForceSendFields is a list of field names (e.g. "RecentlyUploadedBy")
  5979. // to unconditionally include in API requests. By default, fields with
  5980. // empty values are omitted from API requests. However, any non-pointer,
  5981. // non-interface field appearing in ForceSendFields will be sent to the
  5982. // server regardless of whether the field is empty or not. This may be
  5983. // used to include empty fields in Patch requests.
  5984. ForceSendFields []string `json:"-"`
  5985. // NullFields is a list of field names (e.g. "RecentlyUploadedBy") to
  5986. // include in API requests with the JSON null value. By default, fields
  5987. // with empty values are omitted from API requests. However, any field
  5988. // with an empty value appearing in NullFields will be sent to the
  5989. // server as null. It is an error if a field in this list has a
  5990. // non-empty value. This may be used to include null fields in Patch
  5991. // requests.
  5992. NullFields []string `json:"-"`
  5993. }
  5994. func (s *PromotedItemId) MarshalJSON() ([]byte, error) {
  5995. type NoMethod PromotedItemId
  5996. raw := NoMethod(*s)
  5997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5998. }
  5999. // PropertyValue: A pair Property / Value.
  6000. type PropertyValue struct {
  6001. // Property: A property.
  6002. Property string `json:"property,omitempty"`
  6003. // Value: The property's value.
  6004. Value string `json:"value,omitempty"`
  6005. // ForceSendFields is a list of field names (e.g. "Property") to
  6006. // unconditionally include in API requests. By default, fields with
  6007. // empty values are omitted from API requests. However, any non-pointer,
  6008. // non-interface field appearing in ForceSendFields will be sent to the
  6009. // server regardless of whether the field is empty or not. This may be
  6010. // used to include empty fields in Patch requests.
  6011. ForceSendFields []string `json:"-"`
  6012. // NullFields is a list of field names (e.g. "Property") to include in
  6013. // API requests with the JSON null value. By default, fields with empty
  6014. // values are omitted from API requests. However, any field with an
  6015. // empty value appearing in NullFields will be sent to the server as
  6016. // null. It is an error if a field in this list has a non-empty value.
  6017. // This may be used to include null fields in Patch requests.
  6018. NullFields []string `json:"-"`
  6019. }
  6020. func (s *PropertyValue) MarshalJSON() ([]byte, error) {
  6021. type NoMethod PropertyValue
  6022. raw := NoMethod(*s)
  6023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6024. }
  6025. // ResourceId: A resource id is a generic reference that points to
  6026. // another YouTube resource.
  6027. type ResourceId struct {
  6028. // ChannelId: The ID that YouTube uses to uniquely identify the referred
  6029. // resource, if that resource is a channel. This property is only
  6030. // present if the resourceId.kind value is youtube#channel.
  6031. ChannelId string `json:"channelId,omitempty"`
  6032. // Kind: The type of the API resource.
  6033. Kind string `json:"kind,omitempty"`
  6034. // PlaylistId: The ID that YouTube uses to uniquely identify the
  6035. // referred resource, if that resource is a playlist. This property is
  6036. // only present if the resourceId.kind value is youtube#playlist.
  6037. PlaylistId string `json:"playlistId,omitempty"`
  6038. // VideoId: The ID that YouTube uses to uniquely identify the referred
  6039. // resource, if that resource is a video. This property is only present
  6040. // if the resourceId.kind value is youtube#video.
  6041. VideoId string `json:"videoId,omitempty"`
  6042. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6043. // unconditionally include in API requests. By default, fields with
  6044. // empty values are omitted from API requests. However, any non-pointer,
  6045. // non-interface field appearing in ForceSendFields will be sent to the
  6046. // server regardless of whether the field is empty or not. This may be
  6047. // used to include empty fields in Patch requests.
  6048. ForceSendFields []string `json:"-"`
  6049. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6050. // API requests with the JSON null value. By default, fields with empty
  6051. // values are omitted from API requests. However, any field with an
  6052. // empty value appearing in NullFields will be sent to the server as
  6053. // null. It is an error if a field in this list has a non-empty value.
  6054. // This may be used to include null fields in Patch requests.
  6055. NullFields []string `json:"-"`
  6056. }
  6057. func (s *ResourceId) MarshalJSON() ([]byte, error) {
  6058. type NoMethod ResourceId
  6059. raw := NoMethod(*s)
  6060. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6061. }
  6062. type SearchListResponse struct {
  6063. // Etag: Etag of this resource.
  6064. Etag string `json:"etag,omitempty"`
  6065. // EventId: Serialized EventId of the request which produced this
  6066. // response.
  6067. EventId string `json:"eventId,omitempty"`
  6068. // Items: A list of results that match the search criteria.
  6069. Items []*SearchResult `json:"items,omitempty"`
  6070. // Kind: Identifies what kind of resource this is. Value: the fixed
  6071. // string "youtube#searchListResponse".
  6072. Kind string `json:"kind,omitempty"`
  6073. // NextPageToken: The token that can be used as the value of the
  6074. // pageToken parameter to retrieve the next page in the result set.
  6075. NextPageToken string `json:"nextPageToken,omitempty"`
  6076. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6077. // PrevPageToken: The token that can be used as the value of the
  6078. // pageToken parameter to retrieve the previous page in the result set.
  6079. PrevPageToken string `json:"prevPageToken,omitempty"`
  6080. RegionCode string `json:"regionCode,omitempty"`
  6081. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6082. // VisitorId: The visitorId identifies the visitor.
  6083. VisitorId string `json:"visitorId,omitempty"`
  6084. // ServerResponse contains the HTTP response code and headers from the
  6085. // server.
  6086. googleapi.ServerResponse `json:"-"`
  6087. // ForceSendFields is a list of field names (e.g. "Etag") to
  6088. // unconditionally include in API requests. By default, fields with
  6089. // empty values are omitted from API requests. However, any non-pointer,
  6090. // non-interface field appearing in ForceSendFields will be sent to the
  6091. // server regardless of whether the field is empty or not. This may be
  6092. // used to include empty fields in Patch requests.
  6093. ForceSendFields []string `json:"-"`
  6094. // NullFields is a list of field names (e.g. "Etag") to include in API
  6095. // requests with the JSON null value. By default, fields with empty
  6096. // values are omitted from API requests. However, any field with an
  6097. // empty value appearing in NullFields will be sent to the server as
  6098. // null. It is an error if a field in this list has a non-empty value.
  6099. // This may be used to include null fields in Patch requests.
  6100. NullFields []string `json:"-"`
  6101. }
  6102. func (s *SearchListResponse) MarshalJSON() ([]byte, error) {
  6103. type NoMethod SearchListResponse
  6104. raw := NoMethod(*s)
  6105. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6106. }
  6107. // SearchResult: A search result contains information about a YouTube
  6108. // video, channel, or playlist that matches the search parameters
  6109. // specified in an API request. While a search result points to a
  6110. // uniquely identifiable resource, like a video, it does not have its
  6111. // own persistent data.
  6112. type SearchResult struct {
  6113. // Etag: Etag of this resource.
  6114. Etag string `json:"etag,omitempty"`
  6115. // Id: The id object contains information that can be used to uniquely
  6116. // identify the resource that matches the search request.
  6117. Id *ResourceId `json:"id,omitempty"`
  6118. // Kind: Identifies what kind of resource this is. Value: the fixed
  6119. // string "youtube#searchResult".
  6120. Kind string `json:"kind,omitempty"`
  6121. // Snippet: The snippet object contains basic details about a search
  6122. // result, such as its title or description. For example, if the search
  6123. // result is a video, then the title will be the video's title and the
  6124. // description will be the video's description.
  6125. Snippet *SearchResultSnippet `json:"snippet,omitempty"`
  6126. // ForceSendFields is a list of field names (e.g. "Etag") to
  6127. // unconditionally include in API requests. By default, fields with
  6128. // empty values are omitted from API requests. However, any non-pointer,
  6129. // non-interface field appearing in ForceSendFields will be sent to the
  6130. // server regardless of whether the field is empty or not. This may be
  6131. // used to include empty fields in Patch requests.
  6132. ForceSendFields []string `json:"-"`
  6133. // NullFields is a list of field names (e.g. "Etag") to include in API
  6134. // requests with the JSON null value. By default, fields with empty
  6135. // values are omitted from API requests. However, any field with an
  6136. // empty value appearing in NullFields will be sent to the server as
  6137. // null. It is an error if a field in this list has a non-empty value.
  6138. // This may be used to include null fields in Patch requests.
  6139. NullFields []string `json:"-"`
  6140. }
  6141. func (s *SearchResult) MarshalJSON() ([]byte, error) {
  6142. type NoMethod SearchResult
  6143. raw := NoMethod(*s)
  6144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6145. }
  6146. // SearchResultSnippet: Basic details about a search result, including
  6147. // title, description and thumbnails of the item referenced by the
  6148. // search result.
  6149. type SearchResultSnippet struct {
  6150. // ChannelId: The value that YouTube uses to uniquely identify the
  6151. // channel that published the resource that the search result
  6152. // identifies.
  6153. ChannelId string `json:"channelId,omitempty"`
  6154. // ChannelTitle: The title of the channel that published the resource
  6155. // that the search result identifies.
  6156. ChannelTitle string `json:"channelTitle,omitempty"`
  6157. // Description: A description of the search result.
  6158. Description string `json:"description,omitempty"`
  6159. // LiveBroadcastContent: It indicates if the resource (video or channel)
  6160. // has upcoming/active live broadcast content. Or it's "none" if there
  6161. // is not any upcoming/active live broadcasts.
  6162. //
  6163. // Possible values:
  6164. // "live"
  6165. // "none"
  6166. // "upcoming"
  6167. LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
  6168. // PublishedAt: The creation date and time of the resource that the
  6169. // search result identifies. The value is specified in ISO 8601
  6170. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  6171. PublishedAt string `json:"publishedAt,omitempty"`
  6172. // Thumbnails: A map of thumbnail images associated with the search
  6173. // result. For each object in the map, the key is the name of the
  6174. // thumbnail image, and the value is an object that contains other
  6175. // information about the thumbnail.
  6176. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6177. // Title: The title of the search result.
  6178. Title string `json:"title,omitempty"`
  6179. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6180. // unconditionally include in API requests. By default, fields with
  6181. // empty values are omitted from API requests. However, any non-pointer,
  6182. // non-interface field appearing in ForceSendFields will be sent to the
  6183. // server regardless of whether the field is empty or not. This may be
  6184. // used to include empty fields in Patch requests.
  6185. ForceSendFields []string `json:"-"`
  6186. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6187. // API requests with the JSON null value. By default, fields with empty
  6188. // values are omitted from API requests. However, any field with an
  6189. // empty value appearing in NullFields will be sent to the server as
  6190. // null. It is an error if a field in this list has a non-empty value.
  6191. // This may be used to include null fields in Patch requests.
  6192. NullFields []string `json:"-"`
  6193. }
  6194. func (s *SearchResultSnippet) MarshalJSON() ([]byte, error) {
  6195. type NoMethod SearchResultSnippet
  6196. raw := NoMethod(*s)
  6197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6198. }
  6199. // Sponsor: A sponsor resource represents a sponsor for a YouTube
  6200. // channel. A sponsor provides recurring monetary support to a creator
  6201. // and receives special benefits.
  6202. type Sponsor struct {
  6203. // Etag: Etag of this resource.
  6204. Etag string `json:"etag,omitempty"`
  6205. // Kind: Identifies what kind of resource this is. Value: the fixed
  6206. // string "youtube#sponsor".
  6207. Kind string `json:"kind,omitempty"`
  6208. // Snippet: The snippet object contains basic details about the sponsor.
  6209. Snippet *SponsorSnippet `json:"snippet,omitempty"`
  6210. // ForceSendFields is a list of field names (e.g. "Etag") to
  6211. // unconditionally include in API requests. By default, fields with
  6212. // empty values are omitted from API requests. However, any non-pointer,
  6213. // non-interface field appearing in ForceSendFields will be sent to the
  6214. // server regardless of whether the field is empty or not. This may be
  6215. // used to include empty fields in Patch requests.
  6216. ForceSendFields []string `json:"-"`
  6217. // NullFields is a list of field names (e.g. "Etag") to include in API
  6218. // requests with the JSON null value. By default, fields with empty
  6219. // values are omitted from API requests. However, any field with an
  6220. // empty value appearing in NullFields will be sent to the server as
  6221. // null. It is an error if a field in this list has a non-empty value.
  6222. // This may be used to include null fields in Patch requests.
  6223. NullFields []string `json:"-"`
  6224. }
  6225. func (s *Sponsor) MarshalJSON() ([]byte, error) {
  6226. type NoMethod Sponsor
  6227. raw := NoMethod(*s)
  6228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6229. }
  6230. type SponsorListResponse struct {
  6231. // Etag: Etag of this resource.
  6232. Etag string `json:"etag,omitempty"`
  6233. // EventId: Serialized EventId of the request which produced this
  6234. // response.
  6235. EventId string `json:"eventId,omitempty"`
  6236. // Items: A list of sponsors that match the request criteria.
  6237. Items []*Sponsor `json:"items,omitempty"`
  6238. // Kind: Identifies what kind of resource this is. Value: the fixed
  6239. // string "youtube#sponsorListResponse".
  6240. Kind string `json:"kind,omitempty"`
  6241. // NextPageToken: The token that can be used as the value of the
  6242. // pageToken parameter to retrieve the next page in the result set.
  6243. NextPageToken string `json:"nextPageToken,omitempty"`
  6244. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6245. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6246. // VisitorId: The visitorId identifies the visitor.
  6247. VisitorId string `json:"visitorId,omitempty"`
  6248. // ServerResponse contains the HTTP response code and headers from the
  6249. // server.
  6250. googleapi.ServerResponse `json:"-"`
  6251. // ForceSendFields is a list of field names (e.g. "Etag") to
  6252. // unconditionally include in API requests. By default, fields with
  6253. // empty values are omitted from API requests. However, any non-pointer,
  6254. // non-interface field appearing in ForceSendFields will be sent to the
  6255. // server regardless of whether the field is empty or not. This may be
  6256. // used to include empty fields in Patch requests.
  6257. ForceSendFields []string `json:"-"`
  6258. // NullFields is a list of field names (e.g. "Etag") to include in API
  6259. // requests with the JSON null value. By default, fields with empty
  6260. // values are omitted from API requests. However, any field with an
  6261. // empty value appearing in NullFields will be sent to the server as
  6262. // null. It is an error if a field in this list has a non-empty value.
  6263. // This may be used to include null fields in Patch requests.
  6264. NullFields []string `json:"-"`
  6265. }
  6266. func (s *SponsorListResponse) MarshalJSON() ([]byte, error) {
  6267. type NoMethod SponsorListResponse
  6268. raw := NoMethod(*s)
  6269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6270. }
  6271. type SponsorSnippet struct {
  6272. // ChannelId: The id of the channel being sponsored.
  6273. ChannelId string `json:"channelId,omitempty"`
  6274. // CumulativeDurationMonths: The cumulative time a user has been a
  6275. // sponsor in months.
  6276. CumulativeDurationMonths int64 `json:"cumulativeDurationMonths,omitempty"`
  6277. // SponsorDetails: Details about the sponsor.
  6278. SponsorDetails *ChannelProfileDetails `json:"sponsorDetails,omitempty"`
  6279. // SponsorSince: The date and time when the user became a sponsor. The
  6280. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6281. SponsorSince string `json:"sponsorSince,omitempty"`
  6282. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6283. // unconditionally include in API requests. By default, fields with
  6284. // empty values are omitted from API requests. However, any non-pointer,
  6285. // non-interface field appearing in ForceSendFields will be sent to the
  6286. // server regardless of whether the field is empty or not. This may be
  6287. // used to include empty fields in Patch requests.
  6288. ForceSendFields []string `json:"-"`
  6289. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6290. // API requests with the JSON null value. By default, fields with empty
  6291. // values are omitted from API requests. However, any field with an
  6292. // empty value appearing in NullFields will be sent to the server as
  6293. // null. It is an error if a field in this list has a non-empty value.
  6294. // This may be used to include null fields in Patch requests.
  6295. NullFields []string `json:"-"`
  6296. }
  6297. func (s *SponsorSnippet) MarshalJSON() ([]byte, error) {
  6298. type NoMethod SponsorSnippet
  6299. raw := NoMethod(*s)
  6300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6301. }
  6302. // Subscription: A subscription resource contains information about a
  6303. // YouTube user subscription. A subscription notifies a user when new
  6304. // videos are added to a channel or when another user takes one of
  6305. // several actions on YouTube, such as uploading a video, rating a
  6306. // video, or commenting on a video.
  6307. type Subscription struct {
  6308. // ContentDetails: The contentDetails object contains basic statistics
  6309. // about the subscription.
  6310. ContentDetails *SubscriptionContentDetails `json:"contentDetails,omitempty"`
  6311. // Etag: Etag of this resource.
  6312. Etag string `json:"etag,omitempty"`
  6313. // Id: The ID that YouTube uses to uniquely identify the subscription.
  6314. Id string `json:"id,omitempty"`
  6315. // Kind: Identifies what kind of resource this is. Value: the fixed
  6316. // string "youtube#subscription".
  6317. Kind string `json:"kind,omitempty"`
  6318. // Snippet: The snippet object contains basic details about the
  6319. // subscription, including its title and the channel that the user
  6320. // subscribed to.
  6321. Snippet *SubscriptionSnippet `json:"snippet,omitempty"`
  6322. // SubscriberSnippet: The subscriberSnippet object contains basic
  6323. // details about the sbuscriber.
  6324. SubscriberSnippet *SubscriptionSubscriberSnippet `json:"subscriberSnippet,omitempty"`
  6325. // ServerResponse contains the HTTP response code and headers from the
  6326. // server.
  6327. googleapi.ServerResponse `json:"-"`
  6328. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  6329. // unconditionally include in API requests. By default, fields with
  6330. // empty values are omitted from API requests. However, any non-pointer,
  6331. // non-interface field appearing in ForceSendFields will be sent to the
  6332. // server regardless of whether the field is empty or not. This may be
  6333. // used to include empty fields in Patch requests.
  6334. ForceSendFields []string `json:"-"`
  6335. // NullFields is a list of field names (e.g. "ContentDetails") to
  6336. // include in API requests with the JSON null value. By default, fields
  6337. // with empty values are omitted from API requests. However, any field
  6338. // with an empty value appearing in NullFields will be sent to the
  6339. // server as null. It is an error if a field in this list has a
  6340. // non-empty value. This may be used to include null fields in Patch
  6341. // requests.
  6342. NullFields []string `json:"-"`
  6343. }
  6344. func (s *Subscription) MarshalJSON() ([]byte, error) {
  6345. type NoMethod Subscription
  6346. raw := NoMethod(*s)
  6347. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6348. }
  6349. // SubscriptionContentDetails: Details about the content to witch a
  6350. // subscription refers.
  6351. type SubscriptionContentDetails struct {
  6352. // ActivityType: The type of activity this subscription is for (only
  6353. // uploads, everything).
  6354. //
  6355. // Possible values:
  6356. // "all"
  6357. // "uploads"
  6358. ActivityType string `json:"activityType,omitempty"`
  6359. // NewItemCount: The number of new items in the subscription since its
  6360. // content was last read.
  6361. NewItemCount int64 `json:"newItemCount,omitempty"`
  6362. // TotalItemCount: The approximate number of items that the subscription
  6363. // points to.
  6364. TotalItemCount int64 `json:"totalItemCount,omitempty"`
  6365. // ForceSendFields is a list of field names (e.g. "ActivityType") to
  6366. // unconditionally include in API requests. By default, fields with
  6367. // empty values are omitted from API requests. However, any non-pointer,
  6368. // non-interface field appearing in ForceSendFields will be sent to the
  6369. // server regardless of whether the field is empty or not. This may be
  6370. // used to include empty fields in Patch requests.
  6371. ForceSendFields []string `json:"-"`
  6372. // NullFields is a list of field names (e.g. "ActivityType") to include
  6373. // in API requests with the JSON null value. By default, fields with
  6374. // empty values are omitted from API requests. However, any field with
  6375. // an empty value appearing in NullFields will be sent to the server as
  6376. // null. It is an error if a field in this list has a non-empty value.
  6377. // This may be used to include null fields in Patch requests.
  6378. NullFields []string `json:"-"`
  6379. }
  6380. func (s *SubscriptionContentDetails) MarshalJSON() ([]byte, error) {
  6381. type NoMethod SubscriptionContentDetails
  6382. raw := NoMethod(*s)
  6383. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6384. }
  6385. type SubscriptionListResponse struct {
  6386. // Etag: Etag of this resource.
  6387. Etag string `json:"etag,omitempty"`
  6388. // EventId: Serialized EventId of the request which produced this
  6389. // response.
  6390. EventId string `json:"eventId,omitempty"`
  6391. // Items: A list of subscriptions that match the request criteria.
  6392. Items []*Subscription `json:"items,omitempty"`
  6393. // Kind: Identifies what kind of resource this is. Value: the fixed
  6394. // string "youtube#subscriptionListResponse".
  6395. Kind string `json:"kind,omitempty"`
  6396. // NextPageToken: The token that can be used as the value of the
  6397. // pageToken parameter to retrieve the next page in the result set.
  6398. NextPageToken string `json:"nextPageToken,omitempty"`
  6399. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6400. // PrevPageToken: The token that can be used as the value of the
  6401. // pageToken parameter to retrieve the previous page in the result set.
  6402. PrevPageToken string `json:"prevPageToken,omitempty"`
  6403. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6404. // VisitorId: The visitorId identifies the visitor.
  6405. VisitorId string `json:"visitorId,omitempty"`
  6406. // ServerResponse contains the HTTP response code and headers from the
  6407. // server.
  6408. googleapi.ServerResponse `json:"-"`
  6409. // ForceSendFields is a list of field names (e.g. "Etag") to
  6410. // unconditionally include in API requests. By default, fields with
  6411. // empty values are omitted from API requests. However, any non-pointer,
  6412. // non-interface field appearing in ForceSendFields will be sent to the
  6413. // server regardless of whether the field is empty or not. This may be
  6414. // used to include empty fields in Patch requests.
  6415. ForceSendFields []string `json:"-"`
  6416. // NullFields is a list of field names (e.g. "Etag") to include in API
  6417. // requests with the JSON null value. By default, fields with empty
  6418. // values are omitted from API requests. However, any field with an
  6419. // empty value appearing in NullFields will be sent to the server as
  6420. // null. It is an error if a field in this list has a non-empty value.
  6421. // This may be used to include null fields in Patch requests.
  6422. NullFields []string `json:"-"`
  6423. }
  6424. func (s *SubscriptionListResponse) MarshalJSON() ([]byte, error) {
  6425. type NoMethod SubscriptionListResponse
  6426. raw := NoMethod(*s)
  6427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6428. }
  6429. // SubscriptionSnippet: Basic details about a subscription, including
  6430. // title, description and thumbnails of the subscribed item.
  6431. type SubscriptionSnippet struct {
  6432. // ChannelId: The ID that YouTube uses to uniquely identify the
  6433. // subscriber's channel.
  6434. ChannelId string `json:"channelId,omitempty"`
  6435. // ChannelTitle: Channel title for the channel that the subscription
  6436. // belongs to.
  6437. ChannelTitle string `json:"channelTitle,omitempty"`
  6438. // Description: The subscription's details.
  6439. Description string `json:"description,omitempty"`
  6440. // PublishedAt: The date and time that the subscription was created. The
  6441. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6442. PublishedAt string `json:"publishedAt,omitempty"`
  6443. // ResourceId: The id object contains information about the channel that
  6444. // the user subscribed to.
  6445. ResourceId *ResourceId `json:"resourceId,omitempty"`
  6446. // Thumbnails: A map of thumbnail images associated with the video. For
  6447. // each object in the map, the key is the name of the thumbnail image,
  6448. // and the value is an object that contains other information about the
  6449. // thumbnail.
  6450. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6451. // Title: The subscription's title.
  6452. Title string `json:"title,omitempty"`
  6453. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6454. // unconditionally include in API requests. By default, fields with
  6455. // empty values are omitted from API requests. However, any non-pointer,
  6456. // non-interface field appearing in ForceSendFields will be sent to the
  6457. // server regardless of whether the field is empty or not. This may be
  6458. // used to include empty fields in Patch requests.
  6459. ForceSendFields []string `json:"-"`
  6460. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6461. // API requests with the JSON null value. By default, fields with empty
  6462. // values are omitted from API requests. However, any field with an
  6463. // empty value appearing in NullFields will be sent to the server as
  6464. // null. It is an error if a field in this list has a non-empty value.
  6465. // This may be used to include null fields in Patch requests.
  6466. NullFields []string `json:"-"`
  6467. }
  6468. func (s *SubscriptionSnippet) MarshalJSON() ([]byte, error) {
  6469. type NoMethod SubscriptionSnippet
  6470. raw := NoMethod(*s)
  6471. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6472. }
  6473. // SubscriptionSubscriberSnippet: Basic details about a subscription's
  6474. // subscriber including title, description, channel ID and thumbnails.
  6475. type SubscriptionSubscriberSnippet struct {
  6476. // ChannelId: The channel ID of the subscriber.
  6477. ChannelId string `json:"channelId,omitempty"`
  6478. // Description: The description of the subscriber.
  6479. Description string `json:"description,omitempty"`
  6480. // Thumbnails: Thumbnails for this subscriber.
  6481. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6482. // Title: The title of the subscriber.
  6483. Title string `json:"title,omitempty"`
  6484. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6485. // unconditionally include in API requests. By default, fields with
  6486. // empty values are omitted from API requests. However, any non-pointer,
  6487. // non-interface field appearing in ForceSendFields will be sent to the
  6488. // server regardless of whether the field is empty or not. This may be
  6489. // used to include empty fields in Patch requests.
  6490. ForceSendFields []string `json:"-"`
  6491. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6492. // API requests with the JSON null value. By default, fields with empty
  6493. // values are omitted from API requests. However, any field with an
  6494. // empty value appearing in NullFields will be sent to the server as
  6495. // null. It is an error if a field in this list has a non-empty value.
  6496. // This may be used to include null fields in Patch requests.
  6497. NullFields []string `json:"-"`
  6498. }
  6499. func (s *SubscriptionSubscriberSnippet) MarshalJSON() ([]byte, error) {
  6500. type NoMethod SubscriptionSubscriberSnippet
  6501. raw := NoMethod(*s)
  6502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6503. }
  6504. // SuperChatEvent: A superChatEvent resource represents a Super Chat
  6505. // purchase on a YouTube channel.
  6506. type SuperChatEvent struct {
  6507. // Etag: Etag of this resource.
  6508. Etag string `json:"etag,omitempty"`
  6509. // Id: The ID that YouTube assigns to uniquely identify the Super Chat
  6510. // event.
  6511. Id string `json:"id,omitempty"`
  6512. // Kind: Identifies what kind of resource this is. Value: the fixed
  6513. // string "youtube#superChatEvent".
  6514. Kind string `json:"kind,omitempty"`
  6515. // Snippet: The snippet object contains basic details about the Super
  6516. // Chat event.
  6517. Snippet *SuperChatEventSnippet `json:"snippet,omitempty"`
  6518. // ForceSendFields is a list of field names (e.g. "Etag") to
  6519. // unconditionally include in API requests. By default, fields with
  6520. // empty values are omitted from API requests. However, any non-pointer,
  6521. // non-interface field appearing in ForceSendFields will be sent to the
  6522. // server regardless of whether the field is empty or not. This may be
  6523. // used to include empty fields in Patch requests.
  6524. ForceSendFields []string `json:"-"`
  6525. // NullFields is a list of field names (e.g. "Etag") to include in API
  6526. // requests with the JSON null value. By default, fields with empty
  6527. // values are omitted from API requests. However, any field with an
  6528. // empty value appearing in NullFields will be sent to the server as
  6529. // null. It is an error if a field in this list has a non-empty value.
  6530. // This may be used to include null fields in Patch requests.
  6531. NullFields []string `json:"-"`
  6532. }
  6533. func (s *SuperChatEvent) MarshalJSON() ([]byte, error) {
  6534. type NoMethod SuperChatEvent
  6535. raw := NoMethod(*s)
  6536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6537. }
  6538. type SuperChatEventListResponse struct {
  6539. // Etag: Etag of this resource.
  6540. Etag string `json:"etag,omitempty"`
  6541. // EventId: Serialized EventId of the request which produced this
  6542. // response.
  6543. EventId string `json:"eventId,omitempty"`
  6544. // Items: A list of Super Chat purchases that match the request
  6545. // criteria.
  6546. Items []*SuperChatEvent `json:"items,omitempty"`
  6547. // Kind: Identifies what kind of resource this is. Value: the fixed
  6548. // string "youtube#superChatEventListResponse".
  6549. Kind string `json:"kind,omitempty"`
  6550. // NextPageToken: The token that can be used as the value of the
  6551. // pageToken parameter to retrieve the next page in the result set.
  6552. NextPageToken string `json:"nextPageToken,omitempty"`
  6553. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6554. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6555. // VisitorId: The visitorId identifies the visitor.
  6556. VisitorId string `json:"visitorId,omitempty"`
  6557. // ServerResponse contains the HTTP response code and headers from the
  6558. // server.
  6559. googleapi.ServerResponse `json:"-"`
  6560. // ForceSendFields is a list of field names (e.g. "Etag") to
  6561. // unconditionally include in API requests. By default, fields with
  6562. // empty values are omitted from API requests. However, any non-pointer,
  6563. // non-interface field appearing in ForceSendFields will be sent to the
  6564. // server regardless of whether the field is empty or not. This may be
  6565. // used to include empty fields in Patch requests.
  6566. ForceSendFields []string `json:"-"`
  6567. // NullFields is a list of field names (e.g. "Etag") to include in API
  6568. // requests with the JSON null value. By default, fields with empty
  6569. // values are omitted from API requests. However, any field with an
  6570. // empty value appearing in NullFields will be sent to the server as
  6571. // null. It is an error if a field in this list has a non-empty value.
  6572. // This may be used to include null fields in Patch requests.
  6573. NullFields []string `json:"-"`
  6574. }
  6575. func (s *SuperChatEventListResponse) MarshalJSON() ([]byte, error) {
  6576. type NoMethod SuperChatEventListResponse
  6577. raw := NoMethod(*s)
  6578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6579. }
  6580. type SuperChatEventSnippet struct {
  6581. // AmountMicros: The purchase amount, in micros of the purchase
  6582. // currency. e.g., 1 is represented as 1000000.
  6583. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  6584. // ChannelId: Channel id where the event occurred.
  6585. ChannelId string `json:"channelId,omitempty"`
  6586. // CommentText: The text contents of the comment left by the user.
  6587. CommentText string `json:"commentText,omitempty"`
  6588. // CreatedAt: The date and time when the event occurred. The value is
  6589. // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6590. CreatedAt string `json:"createdAt,omitempty"`
  6591. // Currency: The currency in which the purchase was made. ISO 4217.
  6592. Currency string `json:"currency,omitempty"`
  6593. // DisplayString: A rendered string that displays the purchase amount
  6594. // and currency (e.g., "$1.00"). The string is rendered for the given
  6595. // language.
  6596. DisplayString string `json:"displayString,omitempty"`
  6597. // IsSuperChatForGood: True if this event is a Super Chat for Good
  6598. // purchase.
  6599. IsSuperChatForGood bool `json:"isSuperChatForGood,omitempty"`
  6600. // IsSuperStickerEvent: True if this event is a Super Sticker event.
  6601. IsSuperStickerEvent bool `json:"isSuperStickerEvent,omitempty"`
  6602. // MessageType: The tier for the paid message, which is based on the
  6603. // amount of money spent to purchase the message.
  6604. MessageType int64 `json:"messageType,omitempty"`
  6605. // Nonprofit: If this event is a Super Chat for Good purchase, this
  6606. // field will contain information about the charity the purchase is
  6607. // donated to.
  6608. Nonprofit *Nonprofit `json:"nonprofit,omitempty"`
  6609. // SuperStickerMetadata: If this event is a Super Sticker event, this
  6610. // field will contain metadata about the Super Sticker.
  6611. SuperStickerMetadata *SuperStickerMetadata `json:"superStickerMetadata,omitempty"`
  6612. // SupporterDetails: Details about the supporter.
  6613. SupporterDetails *ChannelProfileDetails `json:"supporterDetails,omitempty"`
  6614. // ForceSendFields is a list of field names (e.g. "AmountMicros") to
  6615. // unconditionally include in API requests. By default, fields with
  6616. // empty values are omitted from API requests. However, any non-pointer,
  6617. // non-interface field appearing in ForceSendFields will be sent to the
  6618. // server regardless of whether the field is empty or not. This may be
  6619. // used to include empty fields in Patch requests.
  6620. ForceSendFields []string `json:"-"`
  6621. // NullFields is a list of field names (e.g. "AmountMicros") to include
  6622. // in API requests with the JSON null value. By default, fields with
  6623. // empty values are omitted from API requests. However, any field with
  6624. // an empty value appearing in NullFields will be sent to the server as
  6625. // null. It is an error if a field in this list has a non-empty value.
  6626. // This may be used to include null fields in Patch requests.
  6627. NullFields []string `json:"-"`
  6628. }
  6629. func (s *SuperChatEventSnippet) MarshalJSON() ([]byte, error) {
  6630. type NoMethod SuperChatEventSnippet
  6631. raw := NoMethod(*s)
  6632. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6633. }
  6634. type SuperStickerMetadata struct {
  6635. // AltText: Internationalized alt text that describes the sticker image
  6636. // and any animation associated with it.
  6637. AltText string `json:"altText,omitempty"`
  6638. // AltTextLanguage: Specifies the localization language in which the alt
  6639. // text is returned.
  6640. AltTextLanguage string `json:"altTextLanguage,omitempty"`
  6641. // StickerId: Unique identifier of the Super Sticker. This is a shorter
  6642. // form of the alt_text that includes pack name and a recognizable
  6643. // characteristic of the sticker.
  6644. StickerId string `json:"stickerId,omitempty"`
  6645. // ForceSendFields is a list of field names (e.g. "AltText") to
  6646. // unconditionally include in API requests. By default, fields with
  6647. // empty values are omitted from API requests. However, any non-pointer,
  6648. // non-interface field appearing in ForceSendFields will be sent to the
  6649. // server regardless of whether the field is empty or not. This may be
  6650. // used to include empty fields in Patch requests.
  6651. ForceSendFields []string `json:"-"`
  6652. // NullFields is a list of field names (e.g. "AltText") to include in
  6653. // API requests with the JSON null value. By default, fields with empty
  6654. // values are omitted from API requests. However, any field with an
  6655. // empty value appearing in NullFields will be sent to the server as
  6656. // null. It is an error if a field in this list has a non-empty value.
  6657. // This may be used to include null fields in Patch requests.
  6658. NullFields []string `json:"-"`
  6659. }
  6660. func (s *SuperStickerMetadata) MarshalJSON() ([]byte, error) {
  6661. type NoMethod SuperStickerMetadata
  6662. raw := NoMethod(*s)
  6663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6664. }
  6665. // Thumbnail: A thumbnail is an image representing a YouTube resource.
  6666. type Thumbnail struct {
  6667. // Height: (Optional) Height of the thumbnail image.
  6668. Height int64 `json:"height,omitempty"`
  6669. // Url: The thumbnail image's URL.
  6670. Url string `json:"url,omitempty"`
  6671. // Width: (Optional) Width of the thumbnail image.
  6672. Width int64 `json:"width,omitempty"`
  6673. // ForceSendFields is a list of field names (e.g. "Height") to
  6674. // unconditionally include in API requests. By default, fields with
  6675. // empty values are omitted from API requests. However, any non-pointer,
  6676. // non-interface field appearing in ForceSendFields will be sent to the
  6677. // server regardless of whether the field is empty or not. This may be
  6678. // used to include empty fields in Patch requests.
  6679. ForceSendFields []string `json:"-"`
  6680. // NullFields is a list of field names (e.g. "Height") to include in API
  6681. // requests with the JSON null value. By default, fields with empty
  6682. // values are omitted from API requests. However, any field with an
  6683. // empty value appearing in NullFields will be sent to the server as
  6684. // null. It is an error if a field in this list has a non-empty value.
  6685. // This may be used to include null fields in Patch requests.
  6686. NullFields []string `json:"-"`
  6687. }
  6688. func (s *Thumbnail) MarshalJSON() ([]byte, error) {
  6689. type NoMethod Thumbnail
  6690. raw := NoMethod(*s)
  6691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6692. }
  6693. // ThumbnailDetails: Internal representation of thumbnails for a YouTube
  6694. // resource.
  6695. type ThumbnailDetails struct {
  6696. // Default: The default image for this resource.
  6697. Default *Thumbnail `json:"default,omitempty"`
  6698. // High: The high quality image for this resource.
  6699. High *Thumbnail `json:"high,omitempty"`
  6700. // Maxres: The maximum resolution quality image for this resource.
  6701. Maxres *Thumbnail `json:"maxres,omitempty"`
  6702. // Medium: The medium quality image for this resource.
  6703. Medium *Thumbnail `json:"medium,omitempty"`
  6704. // Standard: The standard quality image for this resource.
  6705. Standard *Thumbnail `json:"standard,omitempty"`
  6706. // ForceSendFields is a list of field names (e.g. "Default") to
  6707. // unconditionally include in API requests. By default, fields with
  6708. // empty values are omitted from API requests. However, any non-pointer,
  6709. // non-interface field appearing in ForceSendFields will be sent to the
  6710. // server regardless of whether the field is empty or not. This may be
  6711. // used to include empty fields in Patch requests.
  6712. ForceSendFields []string `json:"-"`
  6713. // NullFields is a list of field names (e.g. "Default") to include in
  6714. // API requests with the JSON null value. By default, fields with empty
  6715. // values are omitted from API requests. However, any field with an
  6716. // empty value appearing in NullFields will be sent to the server as
  6717. // null. It is an error if a field in this list has a non-empty value.
  6718. // This may be used to include null fields in Patch requests.
  6719. NullFields []string `json:"-"`
  6720. }
  6721. func (s *ThumbnailDetails) MarshalJSON() ([]byte, error) {
  6722. type NoMethod ThumbnailDetails
  6723. raw := NoMethod(*s)
  6724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6725. }
  6726. type ThumbnailSetResponse struct {
  6727. // Etag: Etag of this resource.
  6728. Etag string `json:"etag,omitempty"`
  6729. // EventId: Serialized EventId of the request which produced this
  6730. // response.
  6731. EventId string `json:"eventId,omitempty"`
  6732. // Items: A list of thumbnails.
  6733. Items []*ThumbnailDetails `json:"items,omitempty"`
  6734. // Kind: Identifies what kind of resource this is. Value: the fixed
  6735. // string "youtube#thumbnailSetResponse".
  6736. Kind string `json:"kind,omitempty"`
  6737. // VisitorId: The visitorId identifies the visitor.
  6738. VisitorId string `json:"visitorId,omitempty"`
  6739. // ServerResponse contains the HTTP response code and headers from the
  6740. // server.
  6741. googleapi.ServerResponse `json:"-"`
  6742. // ForceSendFields is a list of field names (e.g. "Etag") to
  6743. // unconditionally include in API requests. By default, fields with
  6744. // empty values are omitted from API requests. However, any non-pointer,
  6745. // non-interface field appearing in ForceSendFields will be sent to the
  6746. // server regardless of whether the field is empty or not. This may be
  6747. // used to include empty fields in Patch requests.
  6748. ForceSendFields []string `json:"-"`
  6749. // NullFields is a list of field names (e.g. "Etag") to include in API
  6750. // requests with the JSON null value. By default, fields with empty
  6751. // values are omitted from API requests. However, any field with an
  6752. // empty value appearing in NullFields will be sent to the server as
  6753. // null. It is an error if a field in this list has a non-empty value.
  6754. // This may be used to include null fields in Patch requests.
  6755. NullFields []string `json:"-"`
  6756. }
  6757. func (s *ThumbnailSetResponse) MarshalJSON() ([]byte, error) {
  6758. type NoMethod ThumbnailSetResponse
  6759. raw := NoMethod(*s)
  6760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6761. }
  6762. // TokenPagination: Stub token pagination template to suppress results.
  6763. type TokenPagination struct {
  6764. }
  6765. // Video: A video resource represents a YouTube video.
  6766. type Video struct {
  6767. // AgeGating: Age restriction details related to a video. This data can
  6768. // only be retrieved by the video owner.
  6769. AgeGating *VideoAgeGating `json:"ageGating,omitempty"`
  6770. // ContentDetails: The contentDetails object contains information about
  6771. // the video content, including the length of the video and its aspect
  6772. // ratio.
  6773. ContentDetails *VideoContentDetails `json:"contentDetails,omitempty"`
  6774. // Etag: Etag of this resource.
  6775. Etag string `json:"etag,omitempty"`
  6776. // FileDetails: The fileDetails object encapsulates information about
  6777. // the video file that was uploaded to YouTube, including the file's
  6778. // resolution, duration, audio and video codecs, stream bitrates, and
  6779. // more. This data can only be retrieved by the video owner.
  6780. FileDetails *VideoFileDetails `json:"fileDetails,omitempty"`
  6781. // Id: The ID that YouTube uses to uniquely identify the video.
  6782. Id string `json:"id,omitempty"`
  6783. // Kind: Identifies what kind of resource this is. Value: the fixed
  6784. // string "youtube#video".
  6785. Kind string `json:"kind,omitempty"`
  6786. // LiveStreamingDetails: The liveStreamingDetails object contains
  6787. // metadata about a live video broadcast. The object will only be
  6788. // present in a video resource if the video is an upcoming, live, or
  6789. // completed live broadcast.
  6790. LiveStreamingDetails *VideoLiveStreamingDetails `json:"liveStreamingDetails,omitempty"`
  6791. // Localizations: List with all localizations.
  6792. Localizations map[string]VideoLocalization `json:"localizations,omitempty"`
  6793. // MonetizationDetails: The monetizationDetails object encapsulates
  6794. // information about the monetization status of the video.
  6795. MonetizationDetails *VideoMonetizationDetails `json:"monetizationDetails,omitempty"`
  6796. // Player: The player object contains information that you would use to
  6797. // play the video in an embedded player.
  6798. Player *VideoPlayer `json:"player,omitempty"`
  6799. // ProcessingDetails: The processingDetails object encapsulates
  6800. // information about YouTube's progress in processing the uploaded video
  6801. // file. The properties in the object identify the current processing
  6802. // status and an estimate of the time remaining until YouTube finishes
  6803. // processing the video. This part also indicates whether different
  6804. // types of data or content, such as file details or thumbnail images,
  6805. // are available for the video.
  6806. //
  6807. // The processingProgress object is designed to be polled so that the
  6808. // video uploaded can track the progress that YouTube has made in
  6809. // processing the uploaded video file. This data can only be retrieved
  6810. // by the video owner.
  6811. ProcessingDetails *VideoProcessingDetails `json:"processingDetails,omitempty"`
  6812. // ProjectDetails: The projectDetails object contains information about
  6813. // the project specific video metadata.
  6814. ProjectDetails *VideoProjectDetails `json:"projectDetails,omitempty"`
  6815. // RecordingDetails: The recordingDetails object encapsulates
  6816. // information about the location, date and address where the video was
  6817. // recorded.
  6818. RecordingDetails *VideoRecordingDetails `json:"recordingDetails,omitempty"`
  6819. // Snippet: The snippet object contains basic details about the video,
  6820. // such as its title, description, and category.
  6821. Snippet *VideoSnippet `json:"snippet,omitempty"`
  6822. // Statistics: The statistics object contains statistics about the
  6823. // video.
  6824. Statistics *VideoStatistics `json:"statistics,omitempty"`
  6825. // Status: The status object contains information about the video's
  6826. // uploading, processing, and privacy statuses.
  6827. Status *VideoStatus `json:"status,omitempty"`
  6828. // Suggestions: The suggestions object encapsulates suggestions that
  6829. // identify opportunities to improve the video quality or the metadata
  6830. // for the uploaded video. This data can only be retrieved by the video
  6831. // owner.
  6832. Suggestions *VideoSuggestions `json:"suggestions,omitempty"`
  6833. // TopicDetails: The topicDetails object encapsulates information about
  6834. // Freebase topics associated with the video.
  6835. TopicDetails *VideoTopicDetails `json:"topicDetails,omitempty"`
  6836. // ServerResponse contains the HTTP response code and headers from the
  6837. // server.
  6838. googleapi.ServerResponse `json:"-"`
  6839. // ForceSendFields is a list of field names (e.g. "AgeGating") to
  6840. // unconditionally include in API requests. By default, fields with
  6841. // empty values are omitted from API requests. However, any non-pointer,
  6842. // non-interface field appearing in ForceSendFields will be sent to the
  6843. // server regardless of whether the field is empty or not. This may be
  6844. // used to include empty fields in Patch requests.
  6845. ForceSendFields []string `json:"-"`
  6846. // NullFields is a list of field names (e.g. "AgeGating") to include in
  6847. // API requests with the JSON null value. By default, fields with empty
  6848. // values are omitted from API requests. However, any field with an
  6849. // empty value appearing in NullFields will be sent to the server as
  6850. // null. It is an error if a field in this list has a non-empty value.
  6851. // This may be used to include null fields in Patch requests.
  6852. NullFields []string `json:"-"`
  6853. }
  6854. func (s *Video) MarshalJSON() ([]byte, error) {
  6855. type NoMethod Video
  6856. raw := NoMethod(*s)
  6857. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6858. }
  6859. type VideoAbuseReport struct {
  6860. // Comments: Additional comments regarding the abuse report.
  6861. Comments string `json:"comments,omitempty"`
  6862. // Language: The language that the content was viewed in.
  6863. Language string `json:"language,omitempty"`
  6864. // ReasonId: The high-level, or primary, reason that the content is
  6865. // abusive. The value is an abuse report reason ID.
  6866. ReasonId string `json:"reasonId,omitempty"`
  6867. // SecondaryReasonId: The specific, or secondary, reason that this
  6868. // content is abusive (if available). The value is an abuse report
  6869. // reason ID that is a valid secondary reason for the primary reason.
  6870. SecondaryReasonId string `json:"secondaryReasonId,omitempty"`
  6871. // VideoId: The ID that YouTube uses to uniquely identify the video.
  6872. VideoId string `json:"videoId,omitempty"`
  6873. // ForceSendFields is a list of field names (e.g. "Comments") to
  6874. // unconditionally include in API requests. By default, fields with
  6875. // empty values are omitted from API requests. However, any non-pointer,
  6876. // non-interface field appearing in ForceSendFields will be sent to the
  6877. // server regardless of whether the field is empty or not. This may be
  6878. // used to include empty fields in Patch requests.
  6879. ForceSendFields []string `json:"-"`
  6880. // NullFields is a list of field names (e.g. "Comments") to include in
  6881. // API requests with the JSON null value. By default, fields with empty
  6882. // values are omitted from API requests. However, any field with an
  6883. // empty value appearing in NullFields will be sent to the server as
  6884. // null. It is an error if a field in this list has a non-empty value.
  6885. // This may be used to include null fields in Patch requests.
  6886. NullFields []string `json:"-"`
  6887. }
  6888. func (s *VideoAbuseReport) MarshalJSON() ([]byte, error) {
  6889. type NoMethod VideoAbuseReport
  6890. raw := NoMethod(*s)
  6891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6892. }
  6893. // VideoAbuseReportReason: A videoAbuseReportReason resource identifies
  6894. // a reason that a video could be reported as abusive. Video abuse
  6895. // report reasons are used with video.ReportAbuse.
  6896. type VideoAbuseReportReason struct {
  6897. // Etag: Etag of this resource.
  6898. Etag string `json:"etag,omitempty"`
  6899. // Id: The ID of this abuse report reason.
  6900. Id string `json:"id,omitempty"`
  6901. // Kind: Identifies what kind of resource this is. Value: the fixed
  6902. // string "youtube#videoAbuseReportReason".
  6903. Kind string `json:"kind,omitempty"`
  6904. // Snippet: The snippet object contains basic details about the abuse
  6905. // report reason.
  6906. Snippet *VideoAbuseReportReasonSnippet `json:"snippet,omitempty"`
  6907. // ForceSendFields is a list of field names (e.g. "Etag") to
  6908. // unconditionally include in API requests. By default, fields with
  6909. // empty values are omitted from API requests. However, any non-pointer,
  6910. // non-interface field appearing in ForceSendFields will be sent to the
  6911. // server regardless of whether the field is empty or not. This may be
  6912. // used to include empty fields in Patch requests.
  6913. ForceSendFields []string `json:"-"`
  6914. // NullFields is a list of field names (e.g. "Etag") to include in API
  6915. // requests with the JSON null value. By default, fields with empty
  6916. // values are omitted from API requests. However, any field with an
  6917. // empty value appearing in NullFields will be sent to the server as
  6918. // null. It is an error if a field in this list has a non-empty value.
  6919. // This may be used to include null fields in Patch requests.
  6920. NullFields []string `json:"-"`
  6921. }
  6922. func (s *VideoAbuseReportReason) MarshalJSON() ([]byte, error) {
  6923. type NoMethod VideoAbuseReportReason
  6924. raw := NoMethod(*s)
  6925. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6926. }
  6927. type VideoAbuseReportReasonListResponse struct {
  6928. // Etag: Etag of this resource.
  6929. Etag string `json:"etag,omitempty"`
  6930. // EventId: Serialized EventId of the request which produced this
  6931. // response.
  6932. EventId string `json:"eventId,omitempty"`
  6933. // Items: A list of valid abuse reasons that are used with
  6934. // video.ReportAbuse.
  6935. Items []*VideoAbuseReportReason `json:"items,omitempty"`
  6936. // Kind: Identifies what kind of resource this is. Value: the fixed
  6937. // string "youtube#videoAbuseReportReasonListResponse".
  6938. Kind string `json:"kind,omitempty"`
  6939. // VisitorId: The visitorId identifies the visitor.
  6940. VisitorId string `json:"visitorId,omitempty"`
  6941. // ServerResponse contains the HTTP response code and headers from the
  6942. // server.
  6943. googleapi.ServerResponse `json:"-"`
  6944. // ForceSendFields is a list of field names (e.g. "Etag") to
  6945. // unconditionally include in API requests. By default, fields with
  6946. // empty values are omitted from API requests. However, any non-pointer,
  6947. // non-interface field appearing in ForceSendFields will be sent to the
  6948. // server regardless of whether the field is empty or not. This may be
  6949. // used to include empty fields in Patch requests.
  6950. ForceSendFields []string `json:"-"`
  6951. // NullFields is a list of field names (e.g. "Etag") to include in API
  6952. // requests with the JSON null value. By default, fields with empty
  6953. // values are omitted from API requests. However, any field with an
  6954. // empty value appearing in NullFields will be sent to the server as
  6955. // null. It is an error if a field in this list has a non-empty value.
  6956. // This may be used to include null fields in Patch requests.
  6957. NullFields []string `json:"-"`
  6958. }
  6959. func (s *VideoAbuseReportReasonListResponse) MarshalJSON() ([]byte, error) {
  6960. type NoMethod VideoAbuseReportReasonListResponse
  6961. raw := NoMethod(*s)
  6962. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6963. }
  6964. // VideoAbuseReportReasonSnippet: Basic details about a video category,
  6965. // such as its localized title.
  6966. type VideoAbuseReportReasonSnippet struct {
  6967. // Label: The localized label belonging to this abuse report reason.
  6968. Label string `json:"label,omitempty"`
  6969. // SecondaryReasons: The secondary reasons associated with this reason,
  6970. // if any are available. (There might be 0 or more.)
  6971. SecondaryReasons []*VideoAbuseReportSecondaryReason `json:"secondaryReasons,omitempty"`
  6972. // ForceSendFields is a list of field names (e.g. "Label") to
  6973. // unconditionally include in API requests. By default, fields with
  6974. // empty values are omitted from API requests. However, any non-pointer,
  6975. // non-interface field appearing in ForceSendFields will be sent to the
  6976. // server regardless of whether the field is empty or not. This may be
  6977. // used to include empty fields in Patch requests.
  6978. ForceSendFields []string `json:"-"`
  6979. // NullFields is a list of field names (e.g. "Label") to include in API
  6980. // requests with the JSON null value. By default, fields with empty
  6981. // values are omitted from API requests. However, any field with an
  6982. // empty value appearing in NullFields will be sent to the server as
  6983. // null. It is an error if a field in this list has a non-empty value.
  6984. // This may be used to include null fields in Patch requests.
  6985. NullFields []string `json:"-"`
  6986. }
  6987. func (s *VideoAbuseReportReasonSnippet) MarshalJSON() ([]byte, error) {
  6988. type NoMethod VideoAbuseReportReasonSnippet
  6989. raw := NoMethod(*s)
  6990. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6991. }
  6992. type VideoAbuseReportSecondaryReason struct {
  6993. // Id: The ID of this abuse report secondary reason.
  6994. Id string `json:"id,omitempty"`
  6995. // Label: The localized label for this abuse report secondary reason.
  6996. Label string `json:"label,omitempty"`
  6997. // ForceSendFields is a list of field names (e.g. "Id") to
  6998. // unconditionally include in API requests. By default, fields with
  6999. // empty values are omitted from API requests. However, any non-pointer,
  7000. // non-interface field appearing in ForceSendFields will be sent to the
  7001. // server regardless of whether the field is empty or not. This may be
  7002. // used to include empty fields in Patch requests.
  7003. ForceSendFields []string `json:"-"`
  7004. // NullFields is a list of field names (e.g. "Id") to include in API
  7005. // requests with the JSON null value. By default, fields with empty
  7006. // values are omitted from API requests. However, any field with an
  7007. // empty value appearing in NullFields will be sent to the server as
  7008. // null. It is an error if a field in this list has a non-empty value.
  7009. // This may be used to include null fields in Patch requests.
  7010. NullFields []string `json:"-"`
  7011. }
  7012. func (s *VideoAbuseReportSecondaryReason) MarshalJSON() ([]byte, error) {
  7013. type NoMethod VideoAbuseReportSecondaryReason
  7014. raw := NoMethod(*s)
  7015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7016. }
  7017. type VideoAgeGating struct {
  7018. // AlcoholContent: Indicates whether or not the video has alcoholic
  7019. // beverage content. Only users of legal purchasing age in a particular
  7020. // country, as identified by ICAP, can view the content.
  7021. AlcoholContent bool `json:"alcoholContent,omitempty"`
  7022. // Restricted: Age-restricted trailers. For redband trailers and
  7023. // adult-rated video-games. Only users aged 18+ can view the content.
  7024. // The the field is true the content is restricted to viewers aged 18+.
  7025. // Otherwise The field won't be present.
  7026. Restricted bool `json:"restricted,omitempty"`
  7027. // VideoGameRating: Video game rating, if any.
  7028. //
  7029. // Possible values:
  7030. // "anyone"
  7031. // "m15Plus"
  7032. // "m16Plus"
  7033. // "m17Plus"
  7034. VideoGameRating string `json:"videoGameRating,omitempty"`
  7035. // ForceSendFields is a list of field names (e.g. "AlcoholContent") to
  7036. // unconditionally include in API requests. By default, fields with
  7037. // empty values are omitted from API requests. However, any non-pointer,
  7038. // non-interface field appearing in ForceSendFields will be sent to the
  7039. // server regardless of whether the field is empty or not. This may be
  7040. // used to include empty fields in Patch requests.
  7041. ForceSendFields []string `json:"-"`
  7042. // NullFields is a list of field names (e.g. "AlcoholContent") to
  7043. // include in API requests with the JSON null value. By default, fields
  7044. // with empty values are omitted from API requests. However, any field
  7045. // with an empty value appearing in NullFields will be sent to the
  7046. // server as null. It is an error if a field in this list has a
  7047. // non-empty value. This may be used to include null fields in Patch
  7048. // requests.
  7049. NullFields []string `json:"-"`
  7050. }
  7051. func (s *VideoAgeGating) MarshalJSON() ([]byte, error) {
  7052. type NoMethod VideoAgeGating
  7053. raw := NoMethod(*s)
  7054. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7055. }
  7056. // VideoCategory: A videoCategory resource identifies a category that
  7057. // has been or could be associated with uploaded videos.
  7058. type VideoCategory struct {
  7059. // Etag: Etag of this resource.
  7060. Etag string `json:"etag,omitempty"`
  7061. // Id: The ID that YouTube uses to uniquely identify the video category.
  7062. Id string `json:"id,omitempty"`
  7063. // Kind: Identifies what kind of resource this is. Value: the fixed
  7064. // string "youtube#videoCategory".
  7065. Kind string `json:"kind,omitempty"`
  7066. // Snippet: The snippet object contains basic details about the video
  7067. // category, including its title.
  7068. Snippet *VideoCategorySnippet `json:"snippet,omitempty"`
  7069. // ForceSendFields is a list of field names (e.g. "Etag") to
  7070. // unconditionally include in API requests. By default, fields with
  7071. // empty values are omitted from API requests. However, any non-pointer,
  7072. // non-interface field appearing in ForceSendFields will be sent to the
  7073. // server regardless of whether the field is empty or not. This may be
  7074. // used to include empty fields in Patch requests.
  7075. ForceSendFields []string `json:"-"`
  7076. // NullFields is a list of field names (e.g. "Etag") to include in API
  7077. // requests with the JSON null value. By default, fields with empty
  7078. // values are omitted from API requests. However, any field with an
  7079. // empty value appearing in NullFields will be sent to the server as
  7080. // null. It is an error if a field in this list has a non-empty value.
  7081. // This may be used to include null fields in Patch requests.
  7082. NullFields []string `json:"-"`
  7083. }
  7084. func (s *VideoCategory) MarshalJSON() ([]byte, error) {
  7085. type NoMethod VideoCategory
  7086. raw := NoMethod(*s)
  7087. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7088. }
  7089. type VideoCategoryListResponse struct {
  7090. // Etag: Etag of this resource.
  7091. Etag string `json:"etag,omitempty"`
  7092. // EventId: Serialized EventId of the request which produced this
  7093. // response.
  7094. EventId string `json:"eventId,omitempty"`
  7095. // Items: A list of video categories that can be associated with YouTube
  7096. // videos. In this map, the video category ID is the map key, and its
  7097. // value is the corresponding videoCategory resource.
  7098. Items []*VideoCategory `json:"items,omitempty"`
  7099. // Kind: Identifies what kind of resource this is. Value: the fixed
  7100. // string "youtube#videoCategoryListResponse".
  7101. Kind string `json:"kind,omitempty"`
  7102. // NextPageToken: The token that can be used as the value of the
  7103. // pageToken parameter to retrieve the next page in the result set.
  7104. NextPageToken string `json:"nextPageToken,omitempty"`
  7105. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  7106. // PrevPageToken: The token that can be used as the value of the
  7107. // pageToken parameter to retrieve the previous page in the result set.
  7108. PrevPageToken string `json:"prevPageToken,omitempty"`
  7109. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  7110. // VisitorId: The visitorId identifies the visitor.
  7111. VisitorId string `json:"visitorId,omitempty"`
  7112. // ServerResponse contains the HTTP response code and headers from the
  7113. // server.
  7114. googleapi.ServerResponse `json:"-"`
  7115. // ForceSendFields is a list of field names (e.g. "Etag") to
  7116. // unconditionally include in API requests. By default, fields with
  7117. // empty values are omitted from API requests. However, any non-pointer,
  7118. // non-interface field appearing in ForceSendFields will be sent to the
  7119. // server regardless of whether the field is empty or not. This may be
  7120. // used to include empty fields in Patch requests.
  7121. ForceSendFields []string `json:"-"`
  7122. // NullFields is a list of field names (e.g. "Etag") to include in API
  7123. // requests with the JSON null value. By default, fields with empty
  7124. // values are omitted from API requests. However, any field with an
  7125. // empty value appearing in NullFields will be sent to the server as
  7126. // null. It is an error if a field in this list has a non-empty value.
  7127. // This may be used to include null fields in Patch requests.
  7128. NullFields []string `json:"-"`
  7129. }
  7130. func (s *VideoCategoryListResponse) MarshalJSON() ([]byte, error) {
  7131. type NoMethod VideoCategoryListResponse
  7132. raw := NoMethod(*s)
  7133. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7134. }
  7135. // VideoCategorySnippet: Basic details about a video category, such as
  7136. // its localized title.
  7137. type VideoCategorySnippet struct {
  7138. Assignable bool `json:"assignable,omitempty"`
  7139. // ChannelId: The YouTube channel that created the video category.
  7140. ChannelId string `json:"channelId,omitempty"`
  7141. // Title: The video category's title.
  7142. Title string `json:"title,omitempty"`
  7143. // ForceSendFields is a list of field names (e.g. "Assignable") to
  7144. // unconditionally include in API requests. By default, fields with
  7145. // empty values are omitted from API requests. However, any non-pointer,
  7146. // non-interface field appearing in ForceSendFields will be sent to the
  7147. // server regardless of whether the field is empty or not. This may be
  7148. // used to include empty fields in Patch requests.
  7149. ForceSendFields []string `json:"-"`
  7150. // NullFields is a list of field names (e.g. "Assignable") to include in
  7151. // API requests with the JSON null value. By default, fields with empty
  7152. // values are omitted from API requests. However, any field with an
  7153. // empty value appearing in NullFields will be sent to the server as
  7154. // null. It is an error if a field in this list has a non-empty value.
  7155. // This may be used to include null fields in Patch requests.
  7156. NullFields []string `json:"-"`
  7157. }
  7158. func (s *VideoCategorySnippet) MarshalJSON() ([]byte, error) {
  7159. type NoMethod VideoCategorySnippet
  7160. raw := NoMethod(*s)
  7161. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7162. }
  7163. // VideoContentDetails: Details about the content of a YouTube Video.
  7164. type VideoContentDetails struct {
  7165. // Caption: The value of captions indicates whether the video has
  7166. // captions or not.
  7167. //
  7168. // Possible values:
  7169. // "false"
  7170. // "true"
  7171. Caption string `json:"caption,omitempty"`
  7172. // ContentRating: Specifies the ratings that the video received under
  7173. // various rating schemes.
  7174. ContentRating *ContentRating `json:"contentRating,omitempty"`
  7175. // CountryRestriction: The countryRestriction object contains
  7176. // information about the countries where a video is (or is not)
  7177. // viewable.
  7178. CountryRestriction *AccessPolicy `json:"countryRestriction,omitempty"`
  7179. // Definition: The value of definition indicates whether the video is
  7180. // available in high definition or only in standard definition.
  7181. //
  7182. // Possible values:
  7183. // "hd"
  7184. // "sd"
  7185. Definition string `json:"definition,omitempty"`
  7186. // Dimension: The value of dimension indicates whether the video is
  7187. // available in 3D or in 2D.
  7188. Dimension string `json:"dimension,omitempty"`
  7189. // Duration: The length of the video. The tag value is an ISO 8601
  7190. // duration in the format PT#M#S, in which the letters PT indicate that
  7191. // the value specifies a period of time, and the letters M and S refer
  7192. // to length in minutes and seconds, respectively. The # characters
  7193. // preceding the M and S letters are both integers that specify the
  7194. // number of minutes (or seconds) of the video. For example, a value of
  7195. // PT15M51S indicates that the video is 15 minutes and 51 seconds long.
  7196. Duration string `json:"duration,omitempty"`
  7197. // HasCustomThumbnail: Indicates whether the video uploader has provided
  7198. // a custom thumbnail image for the video. This property is only visible
  7199. // to the video uploader.
  7200. HasCustomThumbnail bool `json:"hasCustomThumbnail,omitempty"`
  7201. // LicensedContent: The value of is_license_content indicates whether
  7202. // the video is licensed content.
  7203. LicensedContent bool `json:"licensedContent,omitempty"`
  7204. // Projection: Specifies the projection format of the video.
  7205. //
  7206. // Possible values:
  7207. // "360"
  7208. // "rectangular"
  7209. Projection string `json:"projection,omitempty"`
  7210. // RegionRestriction: The regionRestriction object contains information
  7211. // about the countries where a video is (or is not) viewable. The object
  7212. // will contain either the contentDetails.regionRestriction.allowed
  7213. // property or the contentDetails.regionRestriction.blocked property.
  7214. RegionRestriction *VideoContentDetailsRegionRestriction `json:"regionRestriction,omitempty"`
  7215. // ForceSendFields is a list of field names (e.g. "Caption") to
  7216. // unconditionally include in API requests. By default, fields with
  7217. // empty values are omitted from API requests. However, any non-pointer,
  7218. // non-interface field appearing in ForceSendFields will be sent to the
  7219. // server regardless of whether the field is empty or not. This may be
  7220. // used to include empty fields in Patch requests.
  7221. ForceSendFields []string `json:"-"`
  7222. // NullFields is a list of field names (e.g. "Caption") to include in
  7223. // API requests with the JSON null value. By default, fields with empty
  7224. // values are omitted from API requests. However, any field with an
  7225. // empty value appearing in NullFields will be sent to the server as
  7226. // null. It is an error if a field in this list has a non-empty value.
  7227. // This may be used to include null fields in Patch requests.
  7228. NullFields []string `json:"-"`
  7229. }
  7230. func (s *VideoContentDetails) MarshalJSON() ([]byte, error) {
  7231. type NoMethod VideoContentDetails
  7232. raw := NoMethod(*s)
  7233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7234. }
  7235. // VideoContentDetailsRegionRestriction: DEPRECATED Region restriction
  7236. // of the video.
  7237. type VideoContentDetailsRegionRestriction struct {
  7238. // Allowed: A list of region codes that identify countries where the
  7239. // video is viewable. If this property is present and a country is not
  7240. // listed in its value, then the video is blocked from appearing in that
  7241. // country. If this property is present and contains an empty list, the
  7242. // video is blocked in all countries.
  7243. Allowed []string `json:"allowed,omitempty"`
  7244. // Blocked: A list of region codes that identify countries where the
  7245. // video is blocked. If this property is present and a country is not
  7246. // listed in its value, then the video is viewable in that country. If
  7247. // this property is present and contains an empty list, the video is
  7248. // viewable in all countries.
  7249. Blocked []string `json:"blocked,omitempty"`
  7250. // ForceSendFields is a list of field names (e.g. "Allowed") to
  7251. // unconditionally include in API requests. By default, fields with
  7252. // empty values are omitted from API requests. However, any non-pointer,
  7253. // non-interface field appearing in ForceSendFields will be sent to the
  7254. // server regardless of whether the field is empty or not. This may be
  7255. // used to include empty fields in Patch requests.
  7256. ForceSendFields []string `json:"-"`
  7257. // NullFields is a list of field names (e.g. "Allowed") to include in
  7258. // API requests with the JSON null value. By default, fields with empty
  7259. // values are omitted from API requests. However, any field with an
  7260. // empty value appearing in NullFields will be sent to the server as
  7261. // null. It is an error if a field in this list has a non-empty value.
  7262. // This may be used to include null fields in Patch requests.
  7263. NullFields []string `json:"-"`
  7264. }
  7265. func (s *VideoContentDetailsRegionRestriction) MarshalJSON() ([]byte, error) {
  7266. type NoMethod VideoContentDetailsRegionRestriction
  7267. raw := NoMethod(*s)
  7268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7269. }
  7270. // VideoFileDetails: Describes original video file properties, including
  7271. // technical details about audio and video streams, but also metadata
  7272. // information like content length, digitization time, or geotagging
  7273. // information.
  7274. type VideoFileDetails struct {
  7275. // AudioStreams: A list of audio streams contained in the uploaded video
  7276. // file. Each item in the list contains detailed metadata about an audio
  7277. // stream.
  7278. AudioStreams []*VideoFileDetailsAudioStream `json:"audioStreams,omitempty"`
  7279. // BitrateBps: The uploaded video file's combined (video and audio)
  7280. // bitrate in bits per second.
  7281. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  7282. // Container: The uploaded video file's container format.
  7283. Container string `json:"container,omitempty"`
  7284. // CreationTime: The date and time when the uploaded video file was
  7285. // created. The value is specified in ISO 8601 format. Currently, the
  7286. // following ISO 8601 formats are supported:
  7287. // - Date only: YYYY-MM-DD
  7288. // - Naive time: YYYY-MM-DDTHH:MM:SS
  7289. // - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM
  7290. CreationTime string `json:"creationTime,omitempty"`
  7291. // DurationMs: The length of the uploaded video in milliseconds.
  7292. DurationMs uint64 `json:"durationMs,omitempty,string"`
  7293. // FileName: The uploaded file's name. This field is present whether a
  7294. // video file or another type of file was uploaded.
  7295. FileName string `json:"fileName,omitempty"`
  7296. // FileSize: The uploaded file's size in bytes. This field is present
  7297. // whether a video file or another type of file was uploaded.
  7298. FileSize uint64 `json:"fileSize,omitempty,string"`
  7299. // FileType: The uploaded file's type as detected by YouTube's video
  7300. // processing engine. Currently, YouTube only processes video files, but
  7301. // this field is present whether a video file or another type of file
  7302. // was uploaded.
  7303. //
  7304. // Possible values:
  7305. // "archive"
  7306. // "audio"
  7307. // "document"
  7308. // "image"
  7309. // "other"
  7310. // "project"
  7311. // "video"
  7312. FileType string `json:"fileType,omitempty"`
  7313. // VideoStreams: A list of video streams contained in the uploaded video
  7314. // file. Each item in the list contains detailed metadata about a video
  7315. // stream.
  7316. VideoStreams []*VideoFileDetailsVideoStream `json:"videoStreams,omitempty"`
  7317. // ForceSendFields is a list of field names (e.g. "AudioStreams") to
  7318. // unconditionally include in API requests. By default, fields with
  7319. // empty values are omitted from API requests. However, any non-pointer,
  7320. // non-interface field appearing in ForceSendFields will be sent to the
  7321. // server regardless of whether the field is empty or not. This may be
  7322. // used to include empty fields in Patch requests.
  7323. ForceSendFields []string `json:"-"`
  7324. // NullFields is a list of field names (e.g. "AudioStreams") to include
  7325. // in API requests with the JSON null value. By default, fields with
  7326. // empty values are omitted from API requests. However, any field with
  7327. // an empty value appearing in NullFields will be sent to the server as
  7328. // null. It is an error if a field in this list has a non-empty value.
  7329. // This may be used to include null fields in Patch requests.
  7330. NullFields []string `json:"-"`
  7331. }
  7332. func (s *VideoFileDetails) MarshalJSON() ([]byte, error) {
  7333. type NoMethod VideoFileDetails
  7334. raw := NoMethod(*s)
  7335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7336. }
  7337. // VideoFileDetailsAudioStream: Information about an audio stream.
  7338. type VideoFileDetailsAudioStream struct {
  7339. // BitrateBps: The audio stream's bitrate, in bits per second.
  7340. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  7341. // ChannelCount: The number of audio channels that the stream contains.
  7342. ChannelCount int64 `json:"channelCount,omitempty"`
  7343. // Codec: The audio codec that the stream uses.
  7344. Codec string `json:"codec,omitempty"`
  7345. // Vendor: A value that uniquely identifies a video vendor. Typically,
  7346. // the value is a four-letter vendor code.
  7347. Vendor string `json:"vendor,omitempty"`
  7348. // ForceSendFields is a list of field names (e.g. "BitrateBps") to
  7349. // unconditionally include in API requests. By default, fields with
  7350. // empty values are omitted from API requests. However, any non-pointer,
  7351. // non-interface field appearing in ForceSendFields will be sent to the
  7352. // server regardless of whether the field is empty or not. This may be
  7353. // used to include empty fields in Patch requests.
  7354. ForceSendFields []string `json:"-"`
  7355. // NullFields is a list of field names (e.g. "BitrateBps") to include in
  7356. // API requests with the JSON null value. By default, fields with empty
  7357. // values are omitted from API requests. However, any field with an
  7358. // empty value appearing in NullFields will be sent to the server as
  7359. // null. It is an error if a field in this list has a non-empty value.
  7360. // This may be used to include null fields in Patch requests.
  7361. NullFields []string `json:"-"`
  7362. }
  7363. func (s *VideoFileDetailsAudioStream) MarshalJSON() ([]byte, error) {
  7364. type NoMethod VideoFileDetailsAudioStream
  7365. raw := NoMethod(*s)
  7366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7367. }
  7368. // VideoFileDetailsVideoStream: Information about a video stream.
  7369. type VideoFileDetailsVideoStream struct {
  7370. // AspectRatio: The video content's display aspect ratio, which
  7371. // specifies the aspect ratio in which the video should be displayed.
  7372. AspectRatio float64 `json:"aspectRatio,omitempty"`
  7373. // BitrateBps: The video stream's bitrate, in bits per second.
  7374. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  7375. // Codec: The video codec that the stream uses.
  7376. Codec string `json:"codec,omitempty"`
  7377. // FrameRateFps: The video stream's frame rate, in frames per second.
  7378. FrameRateFps float64 `json:"frameRateFps,omitempty"`
  7379. // HeightPixels: The encoded video content's height in pixels.
  7380. HeightPixels int64 `json:"heightPixels,omitempty"`
  7381. // Rotation: The amount that YouTube needs to rotate the original source
  7382. // content to properly display the video.
  7383. //
  7384. // Possible values:
  7385. // "clockwise"
  7386. // "counterClockwise"
  7387. // "none"
  7388. // "other"
  7389. // "upsideDown"
  7390. Rotation string `json:"rotation,omitempty"`
  7391. // Vendor: A value that uniquely identifies a video vendor. Typically,
  7392. // the value is a four-letter vendor code.
  7393. Vendor string `json:"vendor,omitempty"`
  7394. // WidthPixels: The encoded video content's width in pixels. You can
  7395. // calculate the video's encoding aspect ratio as
  7396. // width_pixels / height_pixels.
  7397. WidthPixels int64 `json:"widthPixels,omitempty"`
  7398. // ForceSendFields is a list of field names (e.g. "AspectRatio") to
  7399. // unconditionally include in API requests. By default, fields with
  7400. // empty values are omitted from API requests. However, any non-pointer,
  7401. // non-interface field appearing in ForceSendFields will be sent to the
  7402. // server regardless of whether the field is empty or not. This may be
  7403. // used to include empty fields in Patch requests.
  7404. ForceSendFields []string `json:"-"`
  7405. // NullFields is a list of field names (e.g. "AspectRatio") to include
  7406. // in API requests with the JSON null value. By default, fields with
  7407. // empty values are omitted from API requests. However, any field with
  7408. // an empty value appearing in NullFields will be sent to the server as
  7409. // null. It is an error if a field in this list has a non-empty value.
  7410. // This may be used to include null fields in Patch requests.
  7411. NullFields []string `json:"-"`
  7412. }
  7413. func (s *VideoFileDetailsVideoStream) MarshalJSON() ([]byte, error) {
  7414. type NoMethod VideoFileDetailsVideoStream
  7415. raw := NoMethod(*s)
  7416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7417. }
  7418. func (s *VideoFileDetailsVideoStream) UnmarshalJSON(data []byte) error {
  7419. type NoMethod VideoFileDetailsVideoStream
  7420. var s1 struct {
  7421. AspectRatio gensupport.JSONFloat64 `json:"aspectRatio"`
  7422. FrameRateFps gensupport.JSONFloat64 `json:"frameRateFps"`
  7423. *NoMethod
  7424. }
  7425. s1.NoMethod = (*NoMethod)(s)
  7426. if err := json.Unmarshal(data, &s1); err != nil {
  7427. return err
  7428. }
  7429. s.AspectRatio = float64(s1.AspectRatio)
  7430. s.FrameRateFps = float64(s1.FrameRateFps)
  7431. return nil
  7432. }
  7433. type VideoGetRatingResponse struct {
  7434. // Etag: Etag of this resource.
  7435. Etag string `json:"etag,omitempty"`
  7436. // EventId: Serialized EventId of the request which produced this
  7437. // response.
  7438. EventId string `json:"eventId,omitempty"`
  7439. // Items: A list of ratings that match the request criteria.
  7440. Items []*VideoRating `json:"items,omitempty"`
  7441. // Kind: Identifies what kind of resource this is. Value: the fixed
  7442. // string "youtube#videoGetRatingResponse".
  7443. Kind string `json:"kind,omitempty"`
  7444. // VisitorId: The visitorId identifies the visitor.
  7445. VisitorId string `json:"visitorId,omitempty"`
  7446. // ServerResponse contains the HTTP response code and headers from the
  7447. // server.
  7448. googleapi.ServerResponse `json:"-"`
  7449. // ForceSendFields is a list of field names (e.g. "Etag") to
  7450. // unconditionally include in API requests. By default, fields with
  7451. // empty values are omitted from API requests. However, any non-pointer,
  7452. // non-interface field appearing in ForceSendFields will be sent to the
  7453. // server regardless of whether the field is empty or not. This may be
  7454. // used to include empty fields in Patch requests.
  7455. ForceSendFields []string `json:"-"`
  7456. // NullFields is a list of field names (e.g. "Etag") to include in API
  7457. // requests with the JSON null value. By default, fields with empty
  7458. // values are omitted from API requests. However, any field with an
  7459. // empty value appearing in NullFields will be sent to the server as
  7460. // null. It is an error if a field in this list has a non-empty value.
  7461. // This may be used to include null fields in Patch requests.
  7462. NullFields []string `json:"-"`
  7463. }
  7464. func (s *VideoGetRatingResponse) MarshalJSON() ([]byte, error) {
  7465. type NoMethod VideoGetRatingResponse
  7466. raw := NoMethod(*s)
  7467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7468. }
  7469. type VideoListResponse struct {
  7470. // Etag: Etag of this resource.
  7471. Etag string `json:"etag,omitempty"`
  7472. // EventId: Serialized EventId of the request which produced this
  7473. // response.
  7474. EventId string `json:"eventId,omitempty"`
  7475. // Items: A list of videos that match the request criteria.
  7476. Items []*Video `json:"items,omitempty"`
  7477. // Kind: Identifies what kind of resource this is. Value: the fixed
  7478. // string "youtube#videoListResponse".
  7479. Kind string `json:"kind,omitempty"`
  7480. // NextPageToken: The token that can be used as the value of the
  7481. // pageToken parameter to retrieve the next page in the result set.
  7482. NextPageToken string `json:"nextPageToken,omitempty"`
  7483. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  7484. // PrevPageToken: The token that can be used as the value of the
  7485. // pageToken parameter to retrieve the previous page in the result set.
  7486. PrevPageToken string `json:"prevPageToken,omitempty"`
  7487. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  7488. // VisitorId: The visitorId identifies the visitor.
  7489. VisitorId string `json:"visitorId,omitempty"`
  7490. // ServerResponse contains the HTTP response code and headers from the
  7491. // server.
  7492. googleapi.ServerResponse `json:"-"`
  7493. // ForceSendFields is a list of field names (e.g. "Etag") to
  7494. // unconditionally include in API requests. By default, fields with
  7495. // empty values are omitted from API requests. However, any non-pointer,
  7496. // non-interface field appearing in ForceSendFields will be sent to the
  7497. // server regardless of whether the field is empty or not. This may be
  7498. // used to include empty fields in Patch requests.
  7499. ForceSendFields []string `json:"-"`
  7500. // NullFields is a list of field names (e.g. "Etag") to include in API
  7501. // requests with the JSON null value. By default, fields with empty
  7502. // values are omitted from API requests. However, any field with an
  7503. // empty value appearing in NullFields will be sent to the server as
  7504. // null. It is an error if a field in this list has a non-empty value.
  7505. // This may be used to include null fields in Patch requests.
  7506. NullFields []string `json:"-"`
  7507. }
  7508. func (s *VideoListResponse) MarshalJSON() ([]byte, error) {
  7509. type NoMethod VideoListResponse
  7510. raw := NoMethod(*s)
  7511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7512. }
  7513. // VideoLiveStreamingDetails: Details about the live streaming metadata.
  7514. type VideoLiveStreamingDetails struct {
  7515. // ActiveLiveChatId: The ID of the currently active live chat attached
  7516. // to this video. This field is filled only if the video is a currently
  7517. // live broadcast that has live chat. Once the broadcast transitions to
  7518. // complete this field will be removed and the live chat closed down.
  7519. // For persistent broadcasts that live chat id will no longer be tied to
  7520. // this video but rather to the new video being displayed at the
  7521. // persistent page.
  7522. ActiveLiveChatId string `json:"activeLiveChatId,omitempty"`
  7523. // ActualEndTime: The time that the broadcast actually ended. The value
  7524. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value
  7525. // will not be available until the broadcast is over.
  7526. ActualEndTime string `json:"actualEndTime,omitempty"`
  7527. // ActualStartTime: The time that the broadcast actually started. The
  7528. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This
  7529. // value will not be available until the broadcast begins.
  7530. ActualStartTime string `json:"actualStartTime,omitempty"`
  7531. // ConcurrentViewers: The number of viewers currently watching the
  7532. // broadcast. The property and its value will be present if the
  7533. // broadcast has current viewers and the broadcast owner has not hidden
  7534. // the viewcount for the video. Note that YouTube stops tracking the
  7535. // number of concurrent viewers for a broadcast when the broadcast ends.
  7536. // So, this property would not identify the number of viewers watching
  7537. // an archived video of a live broadcast that already ended.
  7538. ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
  7539. // ScheduledEndTime: The time that the broadcast is scheduled to end.
  7540. // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  7541. // If the value is empty or the property is not present, then the
  7542. // broadcast is scheduled to continue indefinitely.
  7543. ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
  7544. // ScheduledStartTime: The time that the broadcast is scheduled to
  7545. // begin. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  7546. // format.
  7547. ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
  7548. // ForceSendFields is a list of field names (e.g. "ActiveLiveChatId") to
  7549. // unconditionally include in API requests. By default, fields with
  7550. // empty values are omitted from API requests. However, any non-pointer,
  7551. // non-interface field appearing in ForceSendFields will be sent to the
  7552. // server regardless of whether the field is empty or not. This may be
  7553. // used to include empty fields in Patch requests.
  7554. ForceSendFields []string `json:"-"`
  7555. // NullFields is a list of field names (e.g. "ActiveLiveChatId") to
  7556. // include in API requests with the JSON null value. By default, fields
  7557. // with empty values are omitted from API requests. However, any field
  7558. // with an empty value appearing in NullFields will be sent to the
  7559. // server as null. It is an error if a field in this list has a
  7560. // non-empty value. This may be used to include null fields in Patch
  7561. // requests.
  7562. NullFields []string `json:"-"`
  7563. }
  7564. func (s *VideoLiveStreamingDetails) MarshalJSON() ([]byte, error) {
  7565. type NoMethod VideoLiveStreamingDetails
  7566. raw := NoMethod(*s)
  7567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7568. }
  7569. // VideoLocalization: Localized versions of certain video properties
  7570. // (e.g. title).
  7571. type VideoLocalization struct {
  7572. // Description: Localized version of the video's description.
  7573. Description string `json:"description,omitempty"`
  7574. // Title: Localized version of the video's title.
  7575. Title string `json:"title,omitempty"`
  7576. // ForceSendFields is a list of field names (e.g. "Description") to
  7577. // unconditionally include in API requests. By default, fields with
  7578. // empty values are omitted from API requests. However, any non-pointer,
  7579. // non-interface field appearing in ForceSendFields will be sent to the
  7580. // server regardless of whether the field is empty or not. This may be
  7581. // used to include empty fields in Patch requests.
  7582. ForceSendFields []string `json:"-"`
  7583. // NullFields is a list of field names (e.g. "Description") to include
  7584. // in API requests with the JSON null value. By default, fields with
  7585. // empty values are omitted from API requests. However, any field with
  7586. // an empty value appearing in NullFields will be sent to the server as
  7587. // null. It is an error if a field in this list has a non-empty value.
  7588. // This may be used to include null fields in Patch requests.
  7589. NullFields []string `json:"-"`
  7590. }
  7591. func (s *VideoLocalization) MarshalJSON() ([]byte, error) {
  7592. type NoMethod VideoLocalization
  7593. raw := NoMethod(*s)
  7594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7595. }
  7596. // VideoMonetizationDetails: Details about monetization of a YouTube
  7597. // Video.
  7598. type VideoMonetizationDetails struct {
  7599. // Access: The value of access indicates whether the video can be
  7600. // monetized or not.
  7601. Access *AccessPolicy `json:"access,omitempty"`
  7602. // ForceSendFields is a list of field names (e.g. "Access") to
  7603. // unconditionally include in API requests. By default, fields with
  7604. // empty values are omitted from API requests. However, any non-pointer,
  7605. // non-interface field appearing in ForceSendFields will be sent to the
  7606. // server regardless of whether the field is empty or not. This may be
  7607. // used to include empty fields in Patch requests.
  7608. ForceSendFields []string `json:"-"`
  7609. // NullFields is a list of field names (e.g. "Access") to include in API
  7610. // requests with the JSON null value. By default, fields with empty
  7611. // values are omitted from API requests. However, any field with an
  7612. // empty value appearing in NullFields will be sent to the server as
  7613. // null. It is an error if a field in this list has a non-empty value.
  7614. // This may be used to include null fields in Patch requests.
  7615. NullFields []string `json:"-"`
  7616. }
  7617. func (s *VideoMonetizationDetails) MarshalJSON() ([]byte, error) {
  7618. type NoMethod VideoMonetizationDetails
  7619. raw := NoMethod(*s)
  7620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7621. }
  7622. // VideoPlayer: Player to be used for a video playback.
  7623. type VideoPlayer struct {
  7624. EmbedHeight int64 `json:"embedHeight,omitempty,string"`
  7625. // EmbedHtml: An <iframe> tag that embeds a player that will play the
  7626. // video.
  7627. EmbedHtml string `json:"embedHtml,omitempty"`
  7628. // EmbedWidth: The embed width
  7629. EmbedWidth int64 `json:"embedWidth,omitempty,string"`
  7630. // ForceSendFields is a list of field names (e.g. "EmbedHeight") to
  7631. // unconditionally include in API requests. By default, fields with
  7632. // empty values are omitted from API requests. However, any non-pointer,
  7633. // non-interface field appearing in ForceSendFields will be sent to the
  7634. // server regardless of whether the field is empty or not. This may be
  7635. // used to include empty fields in Patch requests.
  7636. ForceSendFields []string `json:"-"`
  7637. // NullFields is a list of field names (e.g. "EmbedHeight") to include
  7638. // in API requests with the JSON null value. By default, fields with
  7639. // empty values are omitted from API requests. However, any field with
  7640. // an empty value appearing in NullFields will be sent to the server as
  7641. // null. It is an error if a field in this list has a non-empty value.
  7642. // This may be used to include null fields in Patch requests.
  7643. NullFields []string `json:"-"`
  7644. }
  7645. func (s *VideoPlayer) MarshalJSON() ([]byte, error) {
  7646. type NoMethod VideoPlayer
  7647. raw := NoMethod(*s)
  7648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7649. }
  7650. // VideoProcessingDetails: Describes processing status and progress and
  7651. // availability of some other Video resource parts.
  7652. type VideoProcessingDetails struct {
  7653. // EditorSuggestionsAvailability: This value indicates whether video
  7654. // editing suggestions, which might improve video quality or the
  7655. // playback experience, are available for the video. You can retrieve
  7656. // these suggestions by requesting the suggestions part in your
  7657. // videos.list() request.
  7658. EditorSuggestionsAvailability string `json:"editorSuggestionsAvailability,omitempty"`
  7659. // FileDetailsAvailability: This value indicates whether file details
  7660. // are available for the uploaded video. You can retrieve a video's file
  7661. // details by requesting the fileDetails part in your videos.list()
  7662. // request.
  7663. FileDetailsAvailability string `json:"fileDetailsAvailability,omitempty"`
  7664. // ProcessingFailureReason: The reason that YouTube failed to process
  7665. // the video. This property will only have a value if the
  7666. // processingStatus property's value is failed.
  7667. //
  7668. // Possible values:
  7669. // "other"
  7670. // "streamingFailed"
  7671. // "transcodeFailed"
  7672. // "uploadFailed"
  7673. ProcessingFailureReason string `json:"processingFailureReason,omitempty"`
  7674. // ProcessingIssuesAvailability: This value indicates whether the video
  7675. // processing engine has generated suggestions that might improve
  7676. // YouTube's ability to process the the video, warnings that explain
  7677. // video processing problems, or errors that cause video processing
  7678. // problems. You can retrieve these suggestions by requesting the
  7679. // suggestions part in your videos.list() request.
  7680. ProcessingIssuesAvailability string `json:"processingIssuesAvailability,omitempty"`
  7681. // ProcessingProgress: The processingProgress object contains
  7682. // information about the progress YouTube has made in processing the
  7683. // video. The values are really only relevant if the video's processing
  7684. // status is processing.
  7685. ProcessingProgress *VideoProcessingDetailsProcessingProgress `json:"processingProgress,omitempty"`
  7686. // ProcessingStatus: The video's processing status. This value indicates
  7687. // whether YouTube was able to process the video or if the video is
  7688. // still being processed.
  7689. //
  7690. // Possible values:
  7691. // "failed"
  7692. // "processing"
  7693. // "succeeded"
  7694. // "terminated"
  7695. ProcessingStatus string `json:"processingStatus,omitempty"`
  7696. // TagSuggestionsAvailability: This value indicates whether keyword
  7697. // (tag) suggestions are available for the video. Tags can be added to a
  7698. // video's metadata to make it easier for other users to find the video.
  7699. // You can retrieve these suggestions by requesting the suggestions part
  7700. // in your videos.list() request.
  7701. TagSuggestionsAvailability string `json:"tagSuggestionsAvailability,omitempty"`
  7702. // ThumbnailsAvailability: This value indicates whether thumbnail images
  7703. // have been generated for the video.
  7704. ThumbnailsAvailability string `json:"thumbnailsAvailability,omitempty"`
  7705. // ForceSendFields is a list of field names (e.g.
  7706. // "EditorSuggestionsAvailability") to unconditionally include in API
  7707. // requests. By default, fields with empty values are omitted from API
  7708. // requests. However, any non-pointer, non-interface field appearing in
  7709. // ForceSendFields will be sent to the server regardless of whether the
  7710. // field is empty or not. This may be used to include empty fields in
  7711. // Patch requests.
  7712. ForceSendFields []string `json:"-"`
  7713. // NullFields is a list of field names (e.g.
  7714. // "EditorSuggestionsAvailability") to include in API requests with the
  7715. // JSON null value. By default, fields with empty values are omitted
  7716. // from API requests. However, any field with an empty value appearing
  7717. // in NullFields will be sent to the server as null. It is an error if a
  7718. // field in this list has a non-empty value. This may be used to include
  7719. // null fields in Patch requests.
  7720. NullFields []string `json:"-"`
  7721. }
  7722. func (s *VideoProcessingDetails) MarshalJSON() ([]byte, error) {
  7723. type NoMethod VideoProcessingDetails
  7724. raw := NoMethod(*s)
  7725. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7726. }
  7727. // VideoProcessingDetailsProcessingProgress: Video processing progress
  7728. // and completion time estimate.
  7729. type VideoProcessingDetailsProcessingProgress struct {
  7730. // PartsProcessed: The number of parts of the video that YouTube has
  7731. // already processed. You can estimate the percentage of the video that
  7732. // YouTube has already processed by calculating:
  7733. // 100 * parts_processed / parts_total
  7734. //
  7735. // Note that since the estimated number of parts could increase without
  7736. // a corresponding increase in the number of parts that have already
  7737. // been processed, it is possible that the calculated progress could
  7738. // periodically decrease while YouTube processes a video.
  7739. PartsProcessed uint64 `json:"partsProcessed,omitempty,string"`
  7740. // PartsTotal: An estimate of the total number of parts that need to be
  7741. // processed for the video. The number may be updated with more precise
  7742. // estimates while YouTube processes the video.
  7743. PartsTotal uint64 `json:"partsTotal,omitempty,string"`
  7744. // TimeLeftMs: An estimate of the amount of time, in millseconds, that
  7745. // YouTube needs to finish processing the video.
  7746. TimeLeftMs uint64 `json:"timeLeftMs,omitempty,string"`
  7747. // ForceSendFields is a list of field names (e.g. "PartsProcessed") to
  7748. // unconditionally include in API requests. By default, fields with
  7749. // empty values are omitted from API requests. However, any non-pointer,
  7750. // non-interface field appearing in ForceSendFields will be sent to the
  7751. // server regardless of whether the field is empty or not. This may be
  7752. // used to include empty fields in Patch requests.
  7753. ForceSendFields []string `json:"-"`
  7754. // NullFields is a list of field names (e.g. "PartsProcessed") to
  7755. // include in API requests with the JSON null value. By default, fields
  7756. // with empty values are omitted from API requests. However, any field
  7757. // with an empty value appearing in NullFields will be sent to the
  7758. // server as null. It is an error if a field in this list has a
  7759. // non-empty value. This may be used to include null fields in Patch
  7760. // requests.
  7761. NullFields []string `json:"-"`
  7762. }
  7763. func (s *VideoProcessingDetailsProcessingProgress) MarshalJSON() ([]byte, error) {
  7764. type NoMethod VideoProcessingDetailsProcessingProgress
  7765. raw := NoMethod(*s)
  7766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7767. }
  7768. // VideoProjectDetails: Project specific details about the content of a
  7769. // YouTube Video.
  7770. type VideoProjectDetails struct {
  7771. // Tags: A list of project tags associated with the video during the
  7772. // upload.
  7773. Tags []string `json:"tags,omitempty"`
  7774. // ForceSendFields is a list of field names (e.g. "Tags") to
  7775. // unconditionally include in API requests. By default, fields with
  7776. // empty values are omitted from API requests. However, any non-pointer,
  7777. // non-interface field appearing in ForceSendFields will be sent to the
  7778. // server regardless of whether the field is empty or not. This may be
  7779. // used to include empty fields in Patch requests.
  7780. ForceSendFields []string `json:"-"`
  7781. // NullFields is a list of field names (e.g. "Tags") to include in API
  7782. // requests with the JSON null value. By default, fields with empty
  7783. // values are omitted from API requests. However, any field with an
  7784. // empty value appearing in NullFields will be sent to the server as
  7785. // null. It is an error if a field in this list has a non-empty value.
  7786. // This may be used to include null fields in Patch requests.
  7787. NullFields []string `json:"-"`
  7788. }
  7789. func (s *VideoProjectDetails) MarshalJSON() ([]byte, error) {
  7790. type NoMethod VideoProjectDetails
  7791. raw := NoMethod(*s)
  7792. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7793. }
  7794. type VideoRating struct {
  7795. // Possible values:
  7796. // "dislike"
  7797. // "like"
  7798. // "none"
  7799. // "unspecified"
  7800. Rating string `json:"rating,omitempty"`
  7801. VideoId string `json:"videoId,omitempty"`
  7802. // ForceSendFields is a list of field names (e.g. "Rating") to
  7803. // unconditionally include in API requests. By default, fields with
  7804. // empty values are omitted from API requests. However, any non-pointer,
  7805. // non-interface field appearing in ForceSendFields will be sent to the
  7806. // server regardless of whether the field is empty or not. This may be
  7807. // used to include empty fields in Patch requests.
  7808. ForceSendFields []string `json:"-"`
  7809. // NullFields is a list of field names (e.g. "Rating") to include in API
  7810. // requests with the JSON null value. By default, fields with empty
  7811. // values are omitted from API requests. However, any field with an
  7812. // empty value appearing in NullFields will be sent to the server as
  7813. // null. It is an error if a field in this list has a non-empty value.
  7814. // This may be used to include null fields in Patch requests.
  7815. NullFields []string `json:"-"`
  7816. }
  7817. func (s *VideoRating) MarshalJSON() ([]byte, error) {
  7818. type NoMethod VideoRating
  7819. raw := NoMethod(*s)
  7820. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7821. }
  7822. // VideoRecordingDetails: Recording information associated with the
  7823. // video.
  7824. type VideoRecordingDetails struct {
  7825. // Location: The geolocation information associated with the video.
  7826. Location *GeoPoint `json:"location,omitempty"`
  7827. // LocationDescription: The text description of the location where the
  7828. // video was recorded.
  7829. LocationDescription string `json:"locationDescription,omitempty"`
  7830. // RecordingDate: The date and time when the video was recorded. The
  7831. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.
  7832. RecordingDate string `json:"recordingDate,omitempty"`
  7833. // ForceSendFields is a list of field names (e.g. "Location") to
  7834. // unconditionally include in API requests. By default, fields with
  7835. // empty values are omitted from API requests. However, any non-pointer,
  7836. // non-interface field appearing in ForceSendFields will be sent to the
  7837. // server regardless of whether the field is empty or not. This may be
  7838. // used to include empty fields in Patch requests.
  7839. ForceSendFields []string `json:"-"`
  7840. // NullFields is a list of field names (e.g. "Location") to include in
  7841. // API requests with the JSON null value. By default, fields with empty
  7842. // values are omitted from API requests. However, any field with an
  7843. // empty value appearing in NullFields will be sent to the server as
  7844. // null. It is an error if a field in this list has a non-empty value.
  7845. // This may be used to include null fields in Patch requests.
  7846. NullFields []string `json:"-"`
  7847. }
  7848. func (s *VideoRecordingDetails) MarshalJSON() ([]byte, error) {
  7849. type NoMethod VideoRecordingDetails
  7850. raw := NoMethod(*s)
  7851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7852. }
  7853. // VideoSnippet: Basic details about a video, including title,
  7854. // description, uploader, thumbnails and category.
  7855. type VideoSnippet struct {
  7856. // CategoryId: The YouTube video category associated with the video.
  7857. CategoryId string `json:"categoryId,omitempty"`
  7858. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  7859. // that the video was uploaded to.
  7860. ChannelId string `json:"channelId,omitempty"`
  7861. // ChannelTitle: Channel title for the channel that the video belongs
  7862. // to.
  7863. ChannelTitle string `json:"channelTitle,omitempty"`
  7864. // DefaultAudioLanguage: The default_audio_language property specifies
  7865. // the language spoken in the video's default audio track.
  7866. DefaultAudioLanguage string `json:"defaultAudioLanguage,omitempty"`
  7867. // DefaultLanguage: The language of the videos's default snippet.
  7868. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  7869. // Description: The video's description.
  7870. Description string `json:"description,omitempty"`
  7871. // LiveBroadcastContent: Indicates if the video is an upcoming/active
  7872. // live broadcast. Or it's "none" if the video is not an upcoming/active
  7873. // live broadcast.
  7874. //
  7875. // Possible values:
  7876. // "live"
  7877. // "none"
  7878. // "upcoming"
  7879. LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
  7880. // Localized: Localized snippet selected with the hl parameter. If no
  7881. // such localization exists, this field is populated with the default
  7882. // snippet. (Read-only)
  7883. Localized *VideoLocalization `json:"localized,omitempty"`
  7884. // PublishedAt: The date and time that the video was uploaded. The value
  7885. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  7886. PublishedAt string `json:"publishedAt,omitempty"`
  7887. // Tags: A list of keyword tags associated with the video. Tags may
  7888. // contain spaces.
  7889. Tags []string `json:"tags,omitempty"`
  7890. // Thumbnails: A map of thumbnail images associated with the video. For
  7891. // each object in the map, the key is the name of the thumbnail image,
  7892. // and the value is an object that contains other information about the
  7893. // thumbnail.
  7894. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  7895. // Title: The video's title.
  7896. Title string `json:"title,omitempty"`
  7897. // ForceSendFields is a list of field names (e.g. "CategoryId") to
  7898. // unconditionally include in API requests. By default, fields with
  7899. // empty values are omitted from API requests. However, any non-pointer,
  7900. // non-interface field appearing in ForceSendFields will be sent to the
  7901. // server regardless of whether the field is empty or not. This may be
  7902. // used to include empty fields in Patch requests.
  7903. ForceSendFields []string `json:"-"`
  7904. // NullFields is a list of field names (e.g. "CategoryId") to include in
  7905. // API requests with the JSON null value. By default, fields with empty
  7906. // values are omitted from API requests. However, any field with an
  7907. // empty value appearing in NullFields will be sent to the server as
  7908. // null. It is an error if a field in this list has a non-empty value.
  7909. // This may be used to include null fields in Patch requests.
  7910. NullFields []string `json:"-"`
  7911. }
  7912. func (s *VideoSnippet) MarshalJSON() ([]byte, error) {
  7913. type NoMethod VideoSnippet
  7914. raw := NoMethod(*s)
  7915. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7916. }
  7917. // VideoStatistics: Statistics about the video, such as the number of
  7918. // times the video was viewed or liked.
  7919. type VideoStatistics struct {
  7920. // CommentCount: The number of comments for the video.
  7921. CommentCount uint64 `json:"commentCount,omitempty,string"`
  7922. // DislikeCount: The number of users who have indicated that they
  7923. // disliked the video by giving it a negative rating.
  7924. DislikeCount uint64 `json:"dislikeCount,omitempty,string"`
  7925. // FavoriteCount: The number of users who currently have the video
  7926. // marked as a favorite video.
  7927. FavoriteCount uint64 `json:"favoriteCount,omitempty,string"`
  7928. // LikeCount: The number of users who have indicated that they liked the
  7929. // video by giving it a positive rating.
  7930. LikeCount uint64 `json:"likeCount,omitempty,string"`
  7931. // ViewCount: The number of times the video has been viewed.
  7932. ViewCount uint64 `json:"viewCount,omitempty,string"`
  7933. // ForceSendFields is a list of field names (e.g. "CommentCount") to
  7934. // unconditionally include in API requests. By default, fields with
  7935. // empty values are omitted from API requests. However, any non-pointer,
  7936. // non-interface field appearing in ForceSendFields will be sent to the
  7937. // server regardless of whether the field is empty or not. This may be
  7938. // used to include empty fields in Patch requests.
  7939. ForceSendFields []string `json:"-"`
  7940. // NullFields is a list of field names (e.g. "CommentCount") to include
  7941. // in API requests with the JSON null value. By default, fields with
  7942. // empty values are omitted from API requests. However, any field with
  7943. // an empty value appearing in NullFields will be sent to the server as
  7944. // null. It is an error if a field in this list has a non-empty value.
  7945. // This may be used to include null fields in Patch requests.
  7946. NullFields []string `json:"-"`
  7947. }
  7948. func (s *VideoStatistics) MarshalJSON() ([]byte, error) {
  7949. type NoMethod VideoStatistics
  7950. raw := NoMethod(*s)
  7951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7952. }
  7953. // VideoStatus: Basic details about a video category, such as its
  7954. // localized title.
  7955. type VideoStatus struct {
  7956. // Embeddable: This value indicates if the video can be embedded on
  7957. // another website.
  7958. Embeddable bool `json:"embeddable,omitempty"`
  7959. // FailureReason: This value explains why a video failed to upload. This
  7960. // property is only present if the uploadStatus property indicates that
  7961. // the upload failed.
  7962. //
  7963. // Possible values:
  7964. // "codec"
  7965. // "conversion"
  7966. // "emptyFile"
  7967. // "invalidFile"
  7968. // "tooSmall"
  7969. // "uploadAborted"
  7970. FailureReason string `json:"failureReason,omitempty"`
  7971. // License: The video's license.
  7972. //
  7973. // Possible values:
  7974. // "creativeCommon"
  7975. // "youtube"
  7976. License string `json:"license,omitempty"`
  7977. // PrivacyStatus: The video's privacy status.
  7978. //
  7979. // Possible values:
  7980. // "private"
  7981. // "public"
  7982. // "unlisted"
  7983. // "unlisted_new"
  7984. PrivacyStatus string `json:"privacyStatus,omitempty"`
  7985. // PublicStatsViewable: This value indicates if the extended video
  7986. // statistics on the watch page can be viewed by everyone. Note that the
  7987. // view count, likes, etc will still be visible if this is disabled.
  7988. PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
  7989. // PublishAt: The date and time when the video is scheduled to publish.
  7990. // It can be set only if the privacy status of the video is private. The
  7991. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  7992. PublishAt string `json:"publishAt,omitempty"`
  7993. // RejectionReason: This value explains why YouTube rejected an uploaded
  7994. // video. This property is only present if the uploadStatus property
  7995. // indicates that the upload was rejected.
  7996. //
  7997. // Possible values:
  7998. // "claim"
  7999. // "copyright"
  8000. // "duplicate"
  8001. // "inappropriate"
  8002. // "legal"
  8003. // "length"
  8004. // "termsOfUse"
  8005. // "trademark"
  8006. // "uploaderAccountClosed"
  8007. // "uploaderAccountSuspended"
  8008. RejectionReason string `json:"rejectionReason,omitempty"`
  8009. // UploadStatus: The status of the uploaded video.
  8010. //
  8011. // Possible values:
  8012. // "deleted"
  8013. // "failed"
  8014. // "processed"
  8015. // "rejected"
  8016. // "uploaded"
  8017. UploadStatus string `json:"uploadStatus,omitempty"`
  8018. // ForceSendFields is a list of field names (e.g. "Embeddable") to
  8019. // unconditionally include in API requests. By default, fields with
  8020. // empty values are omitted from API requests. However, any non-pointer,
  8021. // non-interface field appearing in ForceSendFields will be sent to the
  8022. // server regardless of whether the field is empty or not. This may be
  8023. // used to include empty fields in Patch requests.
  8024. ForceSendFields []string `json:"-"`
  8025. // NullFields is a list of field names (e.g. "Embeddable") to include in
  8026. // API requests with the JSON null value. By default, fields with empty
  8027. // values are omitted from API requests. However, any field with an
  8028. // empty value appearing in NullFields will be sent to the server as
  8029. // null. It is an error if a field in this list has a non-empty value.
  8030. // This may be used to include null fields in Patch requests.
  8031. NullFields []string `json:"-"`
  8032. }
  8033. func (s *VideoStatus) MarshalJSON() ([]byte, error) {
  8034. type NoMethod VideoStatus
  8035. raw := NoMethod(*s)
  8036. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8037. }
  8038. // VideoSuggestions: Specifies suggestions on how to improve video
  8039. // content, including encoding hints, tag suggestions, and editor
  8040. // suggestions.
  8041. type VideoSuggestions struct {
  8042. // EditorSuggestions: A list of video editing operations that might
  8043. // improve the video quality or playback experience of the uploaded
  8044. // video.
  8045. //
  8046. // Possible values:
  8047. // "audioQuietAudioSwap"
  8048. // "videoAutoLevels"
  8049. // "videoCrop"
  8050. // "videoStabilize"
  8051. EditorSuggestions []string `json:"editorSuggestions,omitempty"`
  8052. // ProcessingErrors: A list of errors that will prevent YouTube from
  8053. // successfully processing the uploaded video video. These errors
  8054. // indicate that, regardless of the video's current processing status,
  8055. // eventually, that status will almost certainly be failed.
  8056. //
  8057. // Possible values:
  8058. // "archiveFile"
  8059. // "audioFile"
  8060. // "docFile"
  8061. // "imageFile"
  8062. // "notAVideoFile"
  8063. // "projectFile"
  8064. // "unsupportedSpatialAudioLayout"
  8065. ProcessingErrors []string `json:"processingErrors,omitempty"`
  8066. // ProcessingHints: A list of suggestions that may improve YouTube's
  8067. // ability to process the video.
  8068. //
  8069. // Possible values:
  8070. // "hdrVideo"
  8071. // "nonStreamableMov"
  8072. // "sendBestQualityVideo"
  8073. // "spatialAudio"
  8074. // "sphericalVideo"
  8075. // "vrVideo"
  8076. ProcessingHints []string `json:"processingHints,omitempty"`
  8077. // ProcessingWarnings: A list of reasons why YouTube may have difficulty
  8078. // transcoding the uploaded video or that might result in an erroneous
  8079. // transcoding. These warnings are generated before YouTube actually
  8080. // processes the uploaded video file. In addition, they identify issues
  8081. // that are unlikely to cause the video processing to fail but that
  8082. // might cause problems such as sync issues, video artifacts, or a
  8083. // missing audio track.
  8084. //
  8085. // Possible values:
  8086. // "hasEditlist"
  8087. // "inconsistentResolution"
  8088. // "problematicAudioCodec"
  8089. // "problematicHdrLookupTable"
  8090. // "problematicVideoCodec"
  8091. // "unknownAudioCodec"
  8092. // "unknownContainer"
  8093. // "unknownVideoCodec"
  8094. // "unsupportedHdrColorMetadata"
  8095. // "unsupportedHdrPixelFormat"
  8096. // "unsupportedSphericalProjectionType"
  8097. // "unsupportedVrStereoMode"
  8098. ProcessingWarnings []string `json:"processingWarnings,omitempty"`
  8099. // TagSuggestions: A list of keyword tags that could be added to the
  8100. // video's metadata to increase the likelihood that users will locate
  8101. // your video when searching or browsing on YouTube.
  8102. TagSuggestions []*VideoSuggestionsTagSuggestion `json:"tagSuggestions,omitempty"`
  8103. // ForceSendFields is a list of field names (e.g. "EditorSuggestions")
  8104. // to unconditionally include in API requests. By default, fields with
  8105. // empty values are omitted from API requests. However, any non-pointer,
  8106. // non-interface field appearing in ForceSendFields will be sent to the
  8107. // server regardless of whether the field is empty or not. This may be
  8108. // used to include empty fields in Patch requests.
  8109. ForceSendFields []string `json:"-"`
  8110. // NullFields is a list of field names (e.g. "EditorSuggestions") to
  8111. // include in API requests with the JSON null value. By default, fields
  8112. // with empty values are omitted from API requests. However, any field
  8113. // with an empty value appearing in NullFields will be sent to the
  8114. // server as null. It is an error if a field in this list has a
  8115. // non-empty value. This may be used to include null fields in Patch
  8116. // requests.
  8117. NullFields []string `json:"-"`
  8118. }
  8119. func (s *VideoSuggestions) MarshalJSON() ([]byte, error) {
  8120. type NoMethod VideoSuggestions
  8121. raw := NoMethod(*s)
  8122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8123. }
  8124. // VideoSuggestionsTagSuggestion: A single tag suggestion with it's
  8125. // relevance information.
  8126. type VideoSuggestionsTagSuggestion struct {
  8127. // CategoryRestricts: A set of video categories for which the tag is
  8128. // relevant. You can use this information to display appropriate tag
  8129. // suggestions based on the video category that the video uploader
  8130. // associates with the video. By default, tag suggestions are relevant
  8131. // for all categories if there are no restricts defined for the keyword.
  8132. CategoryRestricts []string `json:"categoryRestricts,omitempty"`
  8133. // Tag: The keyword tag suggested for the video.
  8134. Tag string `json:"tag,omitempty"`
  8135. // ForceSendFields is a list of field names (e.g. "CategoryRestricts")
  8136. // to unconditionally include in API requests. By default, fields with
  8137. // empty values are omitted from API requests. However, any non-pointer,
  8138. // non-interface field appearing in ForceSendFields will be sent to the
  8139. // server regardless of whether the field is empty or not. This may be
  8140. // used to include empty fields in Patch requests.
  8141. ForceSendFields []string `json:"-"`
  8142. // NullFields is a list of field names (e.g. "CategoryRestricts") to
  8143. // include in API requests with the JSON null value. By default, fields
  8144. // with empty values are omitted from API requests. However, any field
  8145. // with an empty value appearing in NullFields will be sent to the
  8146. // server as null. It is an error if a field in this list has a
  8147. // non-empty value. This may be used to include null fields in Patch
  8148. // requests.
  8149. NullFields []string `json:"-"`
  8150. }
  8151. func (s *VideoSuggestionsTagSuggestion) MarshalJSON() ([]byte, error) {
  8152. type NoMethod VideoSuggestionsTagSuggestion
  8153. raw := NoMethod(*s)
  8154. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8155. }
  8156. // VideoTopicDetails: Freebase topic information related to the video.
  8157. type VideoTopicDetails struct {
  8158. // RelevantTopicIds: Similar to topic_id, except that these topics are
  8159. // merely relevant to the video. These are topics that may be mentioned
  8160. // in, or appear in the video. You can retrieve information about each
  8161. // topic using Freebase Topic API.
  8162. RelevantTopicIds []string `json:"relevantTopicIds,omitempty"`
  8163. // TopicCategories: A list of Wikipedia URLs that provide a high-level
  8164. // description of the video's content.
  8165. TopicCategories []string `json:"topicCategories,omitempty"`
  8166. // TopicIds: A list of Freebase topic IDs that are centrally associated
  8167. // with the video. These are topics that are centrally featured in the
  8168. // video, and it can be said that the video is mainly about each of
  8169. // these. You can retrieve information about each topic using the
  8170. // Freebase Topic API.
  8171. TopicIds []string `json:"topicIds,omitempty"`
  8172. // ForceSendFields is a list of field names (e.g. "RelevantTopicIds") to
  8173. // unconditionally include in API requests. By default, fields with
  8174. // empty values are omitted from API requests. However, any non-pointer,
  8175. // non-interface field appearing in ForceSendFields will be sent to the
  8176. // server regardless of whether the field is empty or not. This may be
  8177. // used to include empty fields in Patch requests.
  8178. ForceSendFields []string `json:"-"`
  8179. // NullFields is a list of field names (e.g. "RelevantTopicIds") to
  8180. // include in API requests with the JSON null value. By default, fields
  8181. // with empty values are omitted from API requests. However, any field
  8182. // with an empty value appearing in NullFields will be sent to the
  8183. // server as null. It is an error if a field in this list has a
  8184. // non-empty value. This may be used to include null fields in Patch
  8185. // requests.
  8186. NullFields []string `json:"-"`
  8187. }
  8188. func (s *VideoTopicDetails) MarshalJSON() ([]byte, error) {
  8189. type NoMethod VideoTopicDetails
  8190. raw := NoMethod(*s)
  8191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8192. }
  8193. // WatchSettings: Branding properties for the watch. All deprecated.
  8194. type WatchSettings struct {
  8195. // BackgroundColor: The text color for the video watch page's branded
  8196. // area.
  8197. BackgroundColor string `json:"backgroundColor,omitempty"`
  8198. // FeaturedPlaylistId: An ID that uniquely identifies a playlist that
  8199. // displays next to the video player.
  8200. FeaturedPlaylistId string `json:"featuredPlaylistId,omitempty"`
  8201. // TextColor: The background color for the video watch page's branded
  8202. // area.
  8203. TextColor string `json:"textColor,omitempty"`
  8204. // ForceSendFields is a list of field names (e.g. "BackgroundColor") to
  8205. // unconditionally include in API requests. By default, fields with
  8206. // empty values are omitted from API requests. However, any non-pointer,
  8207. // non-interface field appearing in ForceSendFields will be sent to the
  8208. // server regardless of whether the field is empty or not. This may be
  8209. // used to include empty fields in Patch requests.
  8210. ForceSendFields []string `json:"-"`
  8211. // NullFields is a list of field names (e.g. "BackgroundColor") to
  8212. // include in API requests with the JSON null value. By default, fields
  8213. // with empty values are omitted from API requests. However, any field
  8214. // with an empty value appearing in NullFields will be sent to the
  8215. // server as null. It is an error if a field in this list has a
  8216. // non-empty value. This may be used to include null fields in Patch
  8217. // requests.
  8218. NullFields []string `json:"-"`
  8219. }
  8220. func (s *WatchSettings) MarshalJSON() ([]byte, error) {
  8221. type NoMethod WatchSettings
  8222. raw := NoMethod(*s)
  8223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8224. }
  8225. // method id "youtube.activities.insert":
  8226. type ActivitiesInsertCall struct {
  8227. s *Service
  8228. activity *Activity
  8229. urlParams_ gensupport.URLParams
  8230. ctx_ context.Context
  8231. header_ http.Header
  8232. }
  8233. // Insert: Posts a bulletin for a specific channel. (The user submitting
  8234. // the request must be authorized to act on the channel's
  8235. // behalf.)
  8236. //
  8237. // Note: Even though an activity resource can contain information about
  8238. // actions like a user rating a video or marking a video as a favorite,
  8239. // you need to use other API methods to generate those activity
  8240. // resources. For example, you would use the API's videos.rate() method
  8241. // to rate a video and the playlistItems.insert() method to mark a video
  8242. // as a favorite.
  8243. func (r *ActivitiesService) Insert(part string, activity *Activity) *ActivitiesInsertCall {
  8244. c := &ActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8245. c.urlParams_.Set("part", part)
  8246. c.activity = activity
  8247. return c
  8248. }
  8249. // Fields allows partial responses to be retrieved. See
  8250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8251. // for more information.
  8252. func (c *ActivitiesInsertCall) Fields(s ...googleapi.Field) *ActivitiesInsertCall {
  8253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8254. return c
  8255. }
  8256. // Context sets the context to be used in this call's Do method. Any
  8257. // pending HTTP request will be aborted if the provided context is
  8258. // canceled.
  8259. func (c *ActivitiesInsertCall) Context(ctx context.Context) *ActivitiesInsertCall {
  8260. c.ctx_ = ctx
  8261. return c
  8262. }
  8263. // Header returns an http.Header that can be modified by the caller to
  8264. // add HTTP headers to the request.
  8265. func (c *ActivitiesInsertCall) Header() http.Header {
  8266. if c.header_ == nil {
  8267. c.header_ = make(http.Header)
  8268. }
  8269. return c.header_
  8270. }
  8271. func (c *ActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  8272. reqHeaders := make(http.Header)
  8273. for k, v := range c.header_ {
  8274. reqHeaders[k] = v
  8275. }
  8276. reqHeaders.Set("User-Agent", c.s.userAgent())
  8277. var body io.Reader = nil
  8278. body, err := googleapi.WithoutDataWrapper.JSONReader(c.activity)
  8279. if err != nil {
  8280. return nil, err
  8281. }
  8282. reqHeaders.Set("Content-Type", "application/json")
  8283. c.urlParams_.Set("alt", alt)
  8284. c.urlParams_.Set("prettyPrint", "false")
  8285. urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
  8286. urls += "?" + c.urlParams_.Encode()
  8287. req, err := http.NewRequest("POST", urls, body)
  8288. if err != nil {
  8289. return nil, err
  8290. }
  8291. req.Header = reqHeaders
  8292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8293. }
  8294. // Do executes the "youtube.activities.insert" call.
  8295. // Exactly one of *Activity or error will be non-nil. Any non-2xx status
  8296. // code is an error. Response headers are in either
  8297. // *Activity.ServerResponse.Header or (if a response was returned at
  8298. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8299. // to check whether the returned error was because
  8300. // http.StatusNotModified was returned.
  8301. func (c *ActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*Activity, error) {
  8302. gensupport.SetOptions(c.urlParams_, opts...)
  8303. res, err := c.doRequest("json")
  8304. if res != nil && res.StatusCode == http.StatusNotModified {
  8305. if res.Body != nil {
  8306. res.Body.Close()
  8307. }
  8308. return nil, &googleapi.Error{
  8309. Code: res.StatusCode,
  8310. Header: res.Header,
  8311. }
  8312. }
  8313. if err != nil {
  8314. return nil, err
  8315. }
  8316. defer googleapi.CloseBody(res)
  8317. if err := googleapi.CheckResponse(res); err != nil {
  8318. return nil, err
  8319. }
  8320. ret := &Activity{
  8321. ServerResponse: googleapi.ServerResponse{
  8322. Header: res.Header,
  8323. HTTPStatusCode: res.StatusCode,
  8324. },
  8325. }
  8326. target := &ret
  8327. if err := gensupport.DecodeResponse(target, res); err != nil {
  8328. return nil, err
  8329. }
  8330. return ret, nil
  8331. // {
  8332. // "description": "Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.)\n\nNote: Even though an activity resource can contain information about actions like a user rating a video or marking a video as a favorite, you need to use other API methods to generate those activity resources. For example, you would use the API's videos.rate() method to rate a video and the playlistItems.insert() method to mark a video as a favorite.",
  8333. // "httpMethod": "POST",
  8334. // "id": "youtube.activities.insert",
  8335. // "parameterOrder": [
  8336. // "part"
  8337. // ],
  8338. // "parameters": {
  8339. // "part": {
  8340. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  8341. // "location": "query",
  8342. // "required": true,
  8343. // "type": "string"
  8344. // }
  8345. // },
  8346. // "path": "activities",
  8347. // "request": {
  8348. // "$ref": "Activity"
  8349. // },
  8350. // "response": {
  8351. // "$ref": "Activity"
  8352. // },
  8353. // "scopes": [
  8354. // "https://www.googleapis.com/auth/youtube",
  8355. // "https://www.googleapis.com/auth/youtube.force-ssl"
  8356. // ]
  8357. // }
  8358. }
  8359. // method id "youtube.activities.list":
  8360. type ActivitiesListCall struct {
  8361. s *Service
  8362. urlParams_ gensupport.URLParams
  8363. ifNoneMatch_ string
  8364. ctx_ context.Context
  8365. header_ http.Header
  8366. }
  8367. // List: Returns a list of channel activity events that match the
  8368. // request criteria. For example, you can retrieve events associated
  8369. // with a particular channel, events associated with the user's
  8370. // subscriptions and Google+ friends, or the YouTube home page feed,
  8371. // which is customized for each user.
  8372. func (r *ActivitiesService) List(part string) *ActivitiesListCall {
  8373. c := &ActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8374. c.urlParams_.Set("part", part)
  8375. return c
  8376. }
  8377. // ChannelId sets the optional parameter "channelId": The channelId
  8378. // parameter specifies a unique YouTube channel ID. The API will then
  8379. // return a list of that channel's activities.
  8380. func (c *ActivitiesListCall) ChannelId(channelId string) *ActivitiesListCall {
  8381. c.urlParams_.Set("channelId", channelId)
  8382. return c
  8383. }
  8384. // Home sets the optional parameter "home": Set this parameter's value
  8385. // to true to retrieve the activity feed that displays on the YouTube
  8386. // home page for the currently authenticated user.
  8387. func (c *ActivitiesListCall) Home(home bool) *ActivitiesListCall {
  8388. c.urlParams_.Set("home", fmt.Sprint(home))
  8389. return c
  8390. }
  8391. // MaxResults sets the optional parameter "maxResults": The maxResults
  8392. // parameter specifies the maximum number of items that should be
  8393. // returned in the result set.
  8394. func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall {
  8395. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8396. return c
  8397. }
  8398. // Mine sets the optional parameter "mine": Set this parameter's value
  8399. // to true to retrieve a feed of the authenticated user's activities.
  8400. func (c *ActivitiesListCall) Mine(mine bool) *ActivitiesListCall {
  8401. c.urlParams_.Set("mine", fmt.Sprint(mine))
  8402. return c
  8403. }
  8404. // PageToken sets the optional parameter "pageToken": The pageToken
  8405. // parameter identifies a specific page in the result set that should be
  8406. // returned. In an API response, the nextPageToken and prevPageToken
  8407. // properties identify other pages that could be retrieved.
  8408. func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall {
  8409. c.urlParams_.Set("pageToken", pageToken)
  8410. return c
  8411. }
  8412. // PublishedAfter sets the optional parameter "publishedAfter": The
  8413. // publishedAfter parameter specifies the earliest date and time that an
  8414. // activity could have occurred for that activity to be included in the
  8415. // API response. If the parameter value specifies a day, but not a time,
  8416. // then any activities that occurred that day will be included in the
  8417. // result set. The value is specified in ISO 8601
  8418. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  8419. func (c *ActivitiesListCall) PublishedAfter(publishedAfter string) *ActivitiesListCall {
  8420. c.urlParams_.Set("publishedAfter", publishedAfter)
  8421. return c
  8422. }
  8423. // PublishedBefore sets the optional parameter "publishedBefore": The
  8424. // publishedBefore parameter specifies the date and time before which an
  8425. // activity must have occurred for that activity to be included in the
  8426. // API response. If the parameter value specifies a day, but not a time,
  8427. // then any activities that occurred that day will be excluded from the
  8428. // result set. The value is specified in ISO 8601
  8429. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  8430. func (c *ActivitiesListCall) PublishedBefore(publishedBefore string) *ActivitiesListCall {
  8431. c.urlParams_.Set("publishedBefore", publishedBefore)
  8432. return c
  8433. }
  8434. // RegionCode sets the optional parameter "regionCode": The regionCode
  8435. // parameter instructs the API to return results for the specified
  8436. // country. The parameter value is an ISO 3166-1 alpha-2 country code.
  8437. // YouTube uses this value when the authorized user's previous activity
  8438. // on YouTube does not provide enough information to generate the
  8439. // activity feed.
  8440. func (c *ActivitiesListCall) RegionCode(regionCode string) *ActivitiesListCall {
  8441. c.urlParams_.Set("regionCode", regionCode)
  8442. return c
  8443. }
  8444. // Fields allows partial responses to be retrieved. See
  8445. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8446. // for more information.
  8447. func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall {
  8448. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8449. return c
  8450. }
  8451. // IfNoneMatch sets the optional parameter which makes the operation
  8452. // fail if the object's ETag matches the given value. This is useful for
  8453. // getting updates only after the object has changed since the last
  8454. // request. Use googleapi.IsNotModified to check whether the response
  8455. // error from Do is the result of In-None-Match.
  8456. func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall {
  8457. c.ifNoneMatch_ = entityTag
  8458. return c
  8459. }
  8460. // Context sets the context to be used in this call's Do method. Any
  8461. // pending HTTP request will be aborted if the provided context is
  8462. // canceled.
  8463. func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {
  8464. c.ctx_ = ctx
  8465. return c
  8466. }
  8467. // Header returns an http.Header that can be modified by the caller to
  8468. // add HTTP headers to the request.
  8469. func (c *ActivitiesListCall) Header() http.Header {
  8470. if c.header_ == nil {
  8471. c.header_ = make(http.Header)
  8472. }
  8473. return c.header_
  8474. }
  8475. func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  8476. reqHeaders := make(http.Header)
  8477. for k, v := range c.header_ {
  8478. reqHeaders[k] = v
  8479. }
  8480. reqHeaders.Set("User-Agent", c.s.userAgent())
  8481. if c.ifNoneMatch_ != "" {
  8482. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8483. }
  8484. var body io.Reader = nil
  8485. c.urlParams_.Set("alt", alt)
  8486. c.urlParams_.Set("prettyPrint", "false")
  8487. urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
  8488. urls += "?" + c.urlParams_.Encode()
  8489. req, err := http.NewRequest("GET", urls, body)
  8490. if err != nil {
  8491. return nil, err
  8492. }
  8493. req.Header = reqHeaders
  8494. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8495. }
  8496. // Do executes the "youtube.activities.list" call.
  8497. // Exactly one of *ActivityListResponse or error will be non-nil. Any
  8498. // non-2xx status code is an error. Response headers are in either
  8499. // *ActivityListResponse.ServerResponse.Header or (if a response was
  8500. // returned at all) in error.(*googleapi.Error).Header. Use
  8501. // googleapi.IsNotModified to check whether the returned error was
  8502. // because http.StatusNotModified was returned.
  8503. func (c *ActivitiesListCall) Do(opts ...googleapi.CallOption) (*ActivityListResponse, error) {
  8504. gensupport.SetOptions(c.urlParams_, opts...)
  8505. res, err := c.doRequest("json")
  8506. if res != nil && res.StatusCode == http.StatusNotModified {
  8507. if res.Body != nil {
  8508. res.Body.Close()
  8509. }
  8510. return nil, &googleapi.Error{
  8511. Code: res.StatusCode,
  8512. Header: res.Header,
  8513. }
  8514. }
  8515. if err != nil {
  8516. return nil, err
  8517. }
  8518. defer googleapi.CloseBody(res)
  8519. if err := googleapi.CheckResponse(res); err != nil {
  8520. return nil, err
  8521. }
  8522. ret := &ActivityListResponse{
  8523. ServerResponse: googleapi.ServerResponse{
  8524. Header: res.Header,
  8525. HTTPStatusCode: res.StatusCode,
  8526. },
  8527. }
  8528. target := &ret
  8529. if err := gensupport.DecodeResponse(target, res); err != nil {
  8530. return nil, err
  8531. }
  8532. return ret, nil
  8533. // {
  8534. // "description": "Returns a list of channel activity events that match the request criteria. For example, you can retrieve events associated with a particular channel, events associated with the user's subscriptions and Google+ friends, or the YouTube home page feed, which is customized for each user.",
  8535. // "httpMethod": "GET",
  8536. // "id": "youtube.activities.list",
  8537. // "parameterOrder": [
  8538. // "part"
  8539. // ],
  8540. // "parameters": {
  8541. // "channelId": {
  8542. // "description": "The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities.",
  8543. // "location": "query",
  8544. // "type": "string"
  8545. // },
  8546. // "home": {
  8547. // "description": "Set this parameter's value to true to retrieve the activity feed that displays on the YouTube home page for the currently authenticated user.",
  8548. // "location": "query",
  8549. // "type": "boolean"
  8550. // },
  8551. // "maxResults": {
  8552. // "default": "5",
  8553. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  8554. // "format": "uint32",
  8555. // "location": "query",
  8556. // "maximum": "50",
  8557. // "minimum": "0",
  8558. // "type": "integer"
  8559. // },
  8560. // "mine": {
  8561. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's activities.",
  8562. // "location": "query",
  8563. // "type": "boolean"
  8564. // },
  8565. // "pageToken": {
  8566. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  8567. // "location": "query",
  8568. // "type": "string"
  8569. // },
  8570. // "part": {
  8571. // "description": "The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in an activity resource, the snippet property contains other properties that identify the type of activity, a display title for the activity, and so forth. If you set part=snippet, the API response will also contain all of those nested properties.",
  8572. // "location": "query",
  8573. // "required": true,
  8574. // "type": "string"
  8575. // },
  8576. // "publishedAfter": {
  8577. // "description": "The publishedAfter parameter specifies the earliest date and time that an activity could have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be included in the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.",
  8578. // "format": "date-time",
  8579. // "location": "query",
  8580. // "type": "string"
  8581. // },
  8582. // "publishedBefore": {
  8583. // "description": "The publishedBefore parameter specifies the date and time before which an activity must have occurred for that activity to be included in the API response. If the parameter value specifies a day, but not a time, then any activities that occurred that day will be excluded from the result set. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.",
  8584. // "format": "date-time",
  8585. // "location": "query",
  8586. // "type": "string"
  8587. // },
  8588. // "regionCode": {
  8589. // "description": "The regionCode parameter instructs the API to return results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code. YouTube uses this value when the authorized user's previous activity on YouTube does not provide enough information to generate the activity feed.",
  8590. // "location": "query",
  8591. // "type": "string"
  8592. // }
  8593. // },
  8594. // "path": "activities",
  8595. // "response": {
  8596. // "$ref": "ActivityListResponse"
  8597. // },
  8598. // "scopes": [
  8599. // "https://www.googleapis.com/auth/youtube",
  8600. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8601. // "https://www.googleapis.com/auth/youtube.readonly"
  8602. // ]
  8603. // }
  8604. }
  8605. // Pages invokes f for each page of results.
  8606. // A non-nil error returned from f will halt the iteration.
  8607. // The provided context supersedes any context provided to the Context method.
  8608. func (c *ActivitiesListCall) Pages(ctx context.Context, f func(*ActivityListResponse) error) error {
  8609. c.ctx_ = ctx
  8610. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8611. for {
  8612. x, err := c.Do()
  8613. if err != nil {
  8614. return err
  8615. }
  8616. if err := f(x); err != nil {
  8617. return err
  8618. }
  8619. if x.NextPageToken == "" {
  8620. return nil
  8621. }
  8622. c.PageToken(x.NextPageToken)
  8623. }
  8624. }
  8625. // method id "youtube.captions.delete":
  8626. type CaptionsDeleteCall struct {
  8627. s *Service
  8628. urlParams_ gensupport.URLParams
  8629. ctx_ context.Context
  8630. header_ http.Header
  8631. }
  8632. // Delete: Deletes a specified caption track.
  8633. func (r *CaptionsService) Delete(id string) *CaptionsDeleteCall {
  8634. c := &CaptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8635. c.urlParams_.Set("id", id)
  8636. return c
  8637. }
  8638. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  8639. // Google+ Page for the channel that the request is be on behalf of
  8640. func (c *CaptionsDeleteCall) OnBehalfOf(onBehalfOf string) *CaptionsDeleteCall {
  8641. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  8642. return c
  8643. }
  8644. // OnBehalfOfContentOwner sets the optional parameter
  8645. // "onBehalfOfContentOwner": Note: This parameter is intended
  8646. // exclusively for YouTube content partners.
  8647. //
  8648. // The onBehalfOfContentOwner parameter indicates that the request's
  8649. // authorization credentials identify a YouTube CMS user who is acting
  8650. // on behalf of the content owner specified in the parameter value. This
  8651. // parameter is intended for YouTube content partners that own and
  8652. // manage many different YouTube channels. It allows content owners to
  8653. // authenticate once and get access to all their video and channel data,
  8654. // without having to provide authentication credentials for each
  8655. // individual channel. The actual CMS account that the user
  8656. // authenticates with must be linked to the specified YouTube content
  8657. // owner.
  8658. func (c *CaptionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDeleteCall {
  8659. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8660. return c
  8661. }
  8662. // Fields allows partial responses to be retrieved. See
  8663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8664. // for more information.
  8665. func (c *CaptionsDeleteCall) Fields(s ...googleapi.Field) *CaptionsDeleteCall {
  8666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8667. return c
  8668. }
  8669. // Context sets the context to be used in this call's Do method. Any
  8670. // pending HTTP request will be aborted if the provided context is
  8671. // canceled.
  8672. func (c *CaptionsDeleteCall) Context(ctx context.Context) *CaptionsDeleteCall {
  8673. c.ctx_ = ctx
  8674. return c
  8675. }
  8676. // Header returns an http.Header that can be modified by the caller to
  8677. // add HTTP headers to the request.
  8678. func (c *CaptionsDeleteCall) Header() http.Header {
  8679. if c.header_ == nil {
  8680. c.header_ = make(http.Header)
  8681. }
  8682. return c.header_
  8683. }
  8684. func (c *CaptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8685. reqHeaders := make(http.Header)
  8686. for k, v := range c.header_ {
  8687. reqHeaders[k] = v
  8688. }
  8689. reqHeaders.Set("User-Agent", c.s.userAgent())
  8690. var body io.Reader = nil
  8691. c.urlParams_.Set("alt", alt)
  8692. c.urlParams_.Set("prettyPrint", "false")
  8693. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  8694. urls += "?" + c.urlParams_.Encode()
  8695. req, err := http.NewRequest("DELETE", urls, body)
  8696. if err != nil {
  8697. return nil, err
  8698. }
  8699. req.Header = reqHeaders
  8700. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8701. }
  8702. // Do executes the "youtube.captions.delete" call.
  8703. func (c *CaptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8704. gensupport.SetOptions(c.urlParams_, opts...)
  8705. res, err := c.doRequest("json")
  8706. if err != nil {
  8707. return err
  8708. }
  8709. defer googleapi.CloseBody(res)
  8710. if err := googleapi.CheckResponse(res); err != nil {
  8711. return err
  8712. }
  8713. return nil
  8714. // {
  8715. // "description": "Deletes a specified caption track.",
  8716. // "httpMethod": "DELETE",
  8717. // "id": "youtube.captions.delete",
  8718. // "parameterOrder": [
  8719. // "id"
  8720. // ],
  8721. // "parameters": {
  8722. // "id": {
  8723. // "description": "The id parameter identifies the caption track that is being deleted. The value is a caption track ID as identified by the id property in a caption resource.",
  8724. // "location": "query",
  8725. // "required": true,
  8726. // "type": "string"
  8727. // },
  8728. // "onBehalfOf": {
  8729. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  8730. // "location": "query",
  8731. // "type": "string"
  8732. // },
  8733. // "onBehalfOfContentOwner": {
  8734. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8735. // "location": "query",
  8736. // "type": "string"
  8737. // }
  8738. // },
  8739. // "path": "captions",
  8740. // "scopes": [
  8741. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8742. // "https://www.googleapis.com/auth/youtubepartner"
  8743. // ]
  8744. // }
  8745. }
  8746. // method id "youtube.captions.download":
  8747. type CaptionsDownloadCall struct {
  8748. s *Service
  8749. id string
  8750. urlParams_ gensupport.URLParams
  8751. ifNoneMatch_ string
  8752. ctx_ context.Context
  8753. header_ http.Header
  8754. }
  8755. // Download: Downloads a caption track. The caption track is returned in
  8756. // its original format unless the request specifies a value for the tfmt
  8757. // parameter and in its original language unless the request specifies a
  8758. // value for the tlang parameter.
  8759. func (r *CaptionsService) Download(id string) *CaptionsDownloadCall {
  8760. c := &CaptionsDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8761. c.id = id
  8762. return c
  8763. }
  8764. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  8765. // Google+ Page for the channel that the request is be on behalf of
  8766. func (c *CaptionsDownloadCall) OnBehalfOf(onBehalfOf string) *CaptionsDownloadCall {
  8767. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  8768. return c
  8769. }
  8770. // OnBehalfOfContentOwner sets the optional parameter
  8771. // "onBehalfOfContentOwner": Note: This parameter is intended
  8772. // exclusively for YouTube content partners.
  8773. //
  8774. // The onBehalfOfContentOwner parameter indicates that the request's
  8775. // authorization credentials identify a YouTube CMS user who is acting
  8776. // on behalf of the content owner specified in the parameter value. This
  8777. // parameter is intended for YouTube content partners that own and
  8778. // manage many different YouTube channels. It allows content owners to
  8779. // authenticate once and get access to all their video and channel data,
  8780. // without having to provide authentication credentials for each
  8781. // individual channel. The actual CMS account that the user
  8782. // authenticates with must be linked to the specified YouTube content
  8783. // owner.
  8784. func (c *CaptionsDownloadCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDownloadCall {
  8785. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8786. return c
  8787. }
  8788. // Tfmt sets the optional parameter "tfmt": The tfmt parameter specifies
  8789. // that the caption track should be returned in a specific format. If
  8790. // the parameter is not included in the request, the track is returned
  8791. // in its original format.
  8792. //
  8793. // Possible values:
  8794. // "sbv" - SubViewer subtitle.
  8795. // "scc" - Scenarist Closed Caption format.
  8796. // "srt" - SubRip subtitle.
  8797. // "ttml" - Timed Text Markup Language caption.
  8798. // "vtt" - Web Video Text Tracks caption.
  8799. func (c *CaptionsDownloadCall) Tfmt(tfmt string) *CaptionsDownloadCall {
  8800. c.urlParams_.Set("tfmt", tfmt)
  8801. return c
  8802. }
  8803. // Tlang sets the optional parameter "tlang": The tlang parameter
  8804. // specifies that the API response should return a translation of the
  8805. // specified caption track. The parameter value is an ISO 639-1
  8806. // two-letter language code that identifies the desired caption
  8807. // language. The translation is generated by using machine translation,
  8808. // such as Google Translate.
  8809. func (c *CaptionsDownloadCall) Tlang(tlang string) *CaptionsDownloadCall {
  8810. c.urlParams_.Set("tlang", tlang)
  8811. return c
  8812. }
  8813. // Fields allows partial responses to be retrieved. See
  8814. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8815. // for more information.
  8816. func (c *CaptionsDownloadCall) Fields(s ...googleapi.Field) *CaptionsDownloadCall {
  8817. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8818. return c
  8819. }
  8820. // IfNoneMatch sets the optional parameter which makes the operation
  8821. // fail if the object's ETag matches the given value. This is useful for
  8822. // getting updates only after the object has changed since the last
  8823. // request. Use googleapi.IsNotModified to check whether the response
  8824. // error from Do is the result of In-None-Match.
  8825. func (c *CaptionsDownloadCall) IfNoneMatch(entityTag string) *CaptionsDownloadCall {
  8826. c.ifNoneMatch_ = entityTag
  8827. return c
  8828. }
  8829. // Context sets the context to be used in this call's Do and Download
  8830. // methods. Any pending HTTP request will be aborted if the provided
  8831. // context is canceled.
  8832. func (c *CaptionsDownloadCall) Context(ctx context.Context) *CaptionsDownloadCall {
  8833. c.ctx_ = ctx
  8834. return c
  8835. }
  8836. // Header returns an http.Header that can be modified by the caller to
  8837. // add HTTP headers to the request.
  8838. func (c *CaptionsDownloadCall) Header() http.Header {
  8839. if c.header_ == nil {
  8840. c.header_ = make(http.Header)
  8841. }
  8842. return c.header_
  8843. }
  8844. func (c *CaptionsDownloadCall) doRequest(alt string) (*http.Response, error) {
  8845. reqHeaders := make(http.Header)
  8846. for k, v := range c.header_ {
  8847. reqHeaders[k] = v
  8848. }
  8849. reqHeaders.Set("User-Agent", c.s.userAgent())
  8850. if c.ifNoneMatch_ != "" {
  8851. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8852. }
  8853. var body io.Reader = nil
  8854. c.urlParams_.Set("alt", alt)
  8855. c.urlParams_.Set("prettyPrint", "false")
  8856. urls := googleapi.ResolveRelative(c.s.BasePath, "captions/{id}")
  8857. urls += "?" + c.urlParams_.Encode()
  8858. req, err := http.NewRequest("GET", urls, body)
  8859. if err != nil {
  8860. return nil, err
  8861. }
  8862. req.Header = reqHeaders
  8863. googleapi.Expand(req.URL, map[string]string{
  8864. "id": c.id,
  8865. })
  8866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8867. }
  8868. // Download fetches the API endpoint's "media" value, instead of the normal
  8869. // API response value. If the returned error is nil, the Response is guaranteed to
  8870. // have a 2xx status code. Callers must close the Response.Body as usual.
  8871. func (c *CaptionsDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  8872. gensupport.SetOptions(c.urlParams_, opts...)
  8873. res, err := c.doRequest("media")
  8874. if err != nil {
  8875. return nil, err
  8876. }
  8877. if err := googleapi.CheckMediaResponse(res); err != nil {
  8878. res.Body.Close()
  8879. return nil, err
  8880. }
  8881. return res, nil
  8882. }
  8883. // Do executes the "youtube.captions.download" call.
  8884. func (c *CaptionsDownloadCall) Do(opts ...googleapi.CallOption) error {
  8885. gensupport.SetOptions(c.urlParams_, opts...)
  8886. res, err := c.doRequest("json")
  8887. if err != nil {
  8888. return err
  8889. }
  8890. defer googleapi.CloseBody(res)
  8891. if err := googleapi.CheckResponse(res); err != nil {
  8892. return err
  8893. }
  8894. return nil
  8895. // {
  8896. // "description": "Downloads a caption track. The caption track is returned in its original format unless the request specifies a value for the tfmt parameter and in its original language unless the request specifies a value for the tlang parameter.",
  8897. // "httpMethod": "GET",
  8898. // "id": "youtube.captions.download",
  8899. // "parameterOrder": [
  8900. // "id"
  8901. // ],
  8902. // "parameters": {
  8903. // "id": {
  8904. // "description": "The id parameter identifies the caption track that is being retrieved. The value is a caption track ID as identified by the id property in a caption resource.",
  8905. // "location": "path",
  8906. // "required": true,
  8907. // "type": "string"
  8908. // },
  8909. // "onBehalfOf": {
  8910. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  8911. // "location": "query",
  8912. // "type": "string"
  8913. // },
  8914. // "onBehalfOfContentOwner": {
  8915. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  8916. // "location": "query",
  8917. // "type": "string"
  8918. // },
  8919. // "tfmt": {
  8920. // "description": "The tfmt parameter specifies that the caption track should be returned in a specific format. If the parameter is not included in the request, the track is returned in its original format.",
  8921. // "enum": [
  8922. // "sbv",
  8923. // "scc",
  8924. // "srt",
  8925. // "ttml",
  8926. // "vtt"
  8927. // ],
  8928. // "enumDescriptions": [
  8929. // "SubViewer subtitle.",
  8930. // "Scenarist Closed Caption format.",
  8931. // "SubRip subtitle.",
  8932. // "Timed Text Markup Language caption.",
  8933. // "Web Video Text Tracks caption."
  8934. // ],
  8935. // "location": "query",
  8936. // "type": "string"
  8937. // },
  8938. // "tlang": {
  8939. // "description": "The tlang parameter specifies that the API response should return a translation of the specified caption track. The parameter value is an ISO 639-1 two-letter language code that identifies the desired caption language. The translation is generated by using machine translation, such as Google Translate.",
  8940. // "location": "query",
  8941. // "type": "string"
  8942. // }
  8943. // },
  8944. // "path": "captions/{id}",
  8945. // "scopes": [
  8946. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8947. // "https://www.googleapis.com/auth/youtubepartner"
  8948. // ],
  8949. // "supportsMediaDownload": true
  8950. // }
  8951. }
  8952. // method id "youtube.captions.insert":
  8953. type CaptionsInsertCall struct {
  8954. s *Service
  8955. caption *Caption
  8956. urlParams_ gensupport.URLParams
  8957. mediaInfo_ *gensupport.MediaInfo
  8958. ctx_ context.Context
  8959. header_ http.Header
  8960. }
  8961. // Insert: Uploads a caption track.
  8962. func (r *CaptionsService) Insert(part string, caption *Caption) *CaptionsInsertCall {
  8963. c := &CaptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8964. c.urlParams_.Set("part", part)
  8965. c.caption = caption
  8966. return c
  8967. }
  8968. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  8969. // Google+ Page for the channel that the request is be on behalf of
  8970. func (c *CaptionsInsertCall) OnBehalfOf(onBehalfOf string) *CaptionsInsertCall {
  8971. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  8972. return c
  8973. }
  8974. // OnBehalfOfContentOwner sets the optional parameter
  8975. // "onBehalfOfContentOwner": Note: This parameter is intended
  8976. // exclusively for YouTube content partners.
  8977. //
  8978. // The onBehalfOfContentOwner parameter indicates that the request's
  8979. // authorization credentials identify a YouTube CMS user who is acting
  8980. // on behalf of the content owner specified in the parameter value. This
  8981. // parameter is intended for YouTube content partners that own and
  8982. // manage many different YouTube channels. It allows content owners to
  8983. // authenticate once and get access to all their video and channel data,
  8984. // without having to provide authentication credentials for each
  8985. // individual channel. The actual CMS account that the user
  8986. // authenticates with must be linked to the specified YouTube content
  8987. // owner.
  8988. func (c *CaptionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsInsertCall {
  8989. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8990. return c
  8991. }
  8992. // Sync sets the optional parameter "sync": The sync parameter indicates
  8993. // whether YouTube should automatically synchronize the caption file
  8994. // with the audio track of the video. If you set the value to true,
  8995. // YouTube will disregard any time codes that are in the uploaded
  8996. // caption file and generate new time codes for the captions.
  8997. //
  8998. // You should set the sync parameter to true if you are uploading a
  8999. // transcript, which has no time codes, or if you suspect the time codes
  9000. // in your file are incorrect and want YouTube to try to fix them.
  9001. func (c *CaptionsInsertCall) Sync(sync bool) *CaptionsInsertCall {
  9002. c.urlParams_.Set("sync", fmt.Sprint(sync))
  9003. return c
  9004. }
  9005. // Media specifies the media to upload in one or more chunks. The chunk
  9006. // size may be controlled by supplying a MediaOption generated by
  9007. // googleapi.ChunkSize. The chunk size defaults to
  9008. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  9009. // upload request will be determined by sniffing the contents of r,
  9010. // unless a MediaOption generated by googleapi.ContentType is
  9011. // supplied.
  9012. // At most one of Media and ResumableMedia may be set.
  9013. func (c *CaptionsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsInsertCall {
  9014. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  9015. return c
  9016. }
  9017. // ResumableMedia specifies the media to upload in chunks and can be
  9018. // canceled with ctx.
  9019. //
  9020. // Deprecated: use Media instead.
  9021. //
  9022. // At most one of Media and ResumableMedia may be set. mediaType
  9023. // identifies the MIME media type of the upload, such as "image/png". If
  9024. // mediaType is "", it will be auto-detected. The provided ctx will
  9025. // supersede any context previously provided to the Context method.
  9026. func (c *CaptionsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsInsertCall {
  9027. c.ctx_ = ctx
  9028. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  9029. return c
  9030. }
  9031. // ProgressUpdater provides a callback function that will be called
  9032. // after every chunk. It should be a low-latency function in order to
  9033. // not slow down the upload operation. This should only be called when
  9034. // using ResumableMedia (as opposed to Media).
  9035. func (c *CaptionsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsInsertCall {
  9036. c.mediaInfo_.SetProgressUpdater(pu)
  9037. return c
  9038. }
  9039. // Fields allows partial responses to be retrieved. See
  9040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9041. // for more information.
  9042. func (c *CaptionsInsertCall) Fields(s ...googleapi.Field) *CaptionsInsertCall {
  9043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9044. return c
  9045. }
  9046. // Context sets the context to be used in this call's Do method. Any
  9047. // pending HTTP request will be aborted if the provided context is
  9048. // canceled.
  9049. // This context will supersede any context previously provided to the
  9050. // ResumableMedia method.
  9051. func (c *CaptionsInsertCall) Context(ctx context.Context) *CaptionsInsertCall {
  9052. c.ctx_ = ctx
  9053. return c
  9054. }
  9055. // Header returns an http.Header that can be modified by the caller to
  9056. // add HTTP headers to the request.
  9057. func (c *CaptionsInsertCall) Header() http.Header {
  9058. if c.header_ == nil {
  9059. c.header_ = make(http.Header)
  9060. }
  9061. return c.header_
  9062. }
  9063. func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  9064. reqHeaders := make(http.Header)
  9065. for k, v := range c.header_ {
  9066. reqHeaders[k] = v
  9067. }
  9068. reqHeaders.Set("User-Agent", c.s.userAgent())
  9069. var body io.Reader = nil
  9070. body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption)
  9071. if err != nil {
  9072. return nil, err
  9073. }
  9074. reqHeaders.Set("Content-Type", "application/json")
  9075. c.urlParams_.Set("alt", alt)
  9076. c.urlParams_.Set("prettyPrint", "false")
  9077. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  9078. if c.mediaInfo_ != nil {
  9079. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  9080. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  9081. }
  9082. if body == nil {
  9083. body = new(bytes.Buffer)
  9084. reqHeaders.Set("Content-Type", "application/json")
  9085. }
  9086. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  9087. defer cleanup()
  9088. urls += "?" + c.urlParams_.Encode()
  9089. req, err := http.NewRequest("POST", urls, body)
  9090. if err != nil {
  9091. return nil, err
  9092. }
  9093. req.Header = reqHeaders
  9094. req.GetBody = getBody
  9095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9096. }
  9097. // Do executes the "youtube.captions.insert" call.
  9098. // Exactly one of *Caption or error will be non-nil. Any non-2xx status
  9099. // code is an error. Response headers are in either
  9100. // *Caption.ServerResponse.Header or (if a response was returned at all)
  9101. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9102. // check whether the returned error was because http.StatusNotModified
  9103. // was returned.
  9104. func (c *CaptionsInsertCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
  9105. gensupport.SetOptions(c.urlParams_, opts...)
  9106. res, err := c.doRequest("json")
  9107. if res != nil && res.StatusCode == http.StatusNotModified {
  9108. if res.Body != nil {
  9109. res.Body.Close()
  9110. }
  9111. return nil, &googleapi.Error{
  9112. Code: res.StatusCode,
  9113. Header: res.Header,
  9114. }
  9115. }
  9116. if err != nil {
  9117. return nil, err
  9118. }
  9119. defer googleapi.CloseBody(res)
  9120. if err := googleapi.CheckResponse(res); err != nil {
  9121. return nil, err
  9122. }
  9123. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  9124. if rx != nil {
  9125. rx.Client = c.s.client
  9126. rx.UserAgent = c.s.userAgent()
  9127. ctx := c.ctx_
  9128. if ctx == nil {
  9129. ctx = context.TODO()
  9130. }
  9131. res, err = rx.Upload(ctx)
  9132. if err != nil {
  9133. return nil, err
  9134. }
  9135. defer res.Body.Close()
  9136. if err := googleapi.CheckResponse(res); err != nil {
  9137. return nil, err
  9138. }
  9139. }
  9140. ret := &Caption{
  9141. ServerResponse: googleapi.ServerResponse{
  9142. Header: res.Header,
  9143. HTTPStatusCode: res.StatusCode,
  9144. },
  9145. }
  9146. target := &ret
  9147. if err := gensupport.DecodeResponse(target, res); err != nil {
  9148. return nil, err
  9149. }
  9150. return ret, nil
  9151. // {
  9152. // "description": "Uploads a caption track.",
  9153. // "httpMethod": "POST",
  9154. // "id": "youtube.captions.insert",
  9155. // "mediaUpload": {
  9156. // "accept": [
  9157. // "*/*",
  9158. // "application/octet-stream",
  9159. // "text/xml"
  9160. // ],
  9161. // "maxSize": "100MB",
  9162. // "protocols": {
  9163. // "resumable": {
  9164. // "multipart": true,
  9165. // "path": "/resumable/upload/youtube/v3/captions"
  9166. // },
  9167. // "simple": {
  9168. // "multipart": true,
  9169. // "path": "/upload/youtube/v3/captions"
  9170. // }
  9171. // }
  9172. // },
  9173. // "parameterOrder": [
  9174. // "part"
  9175. // ],
  9176. // "parameters": {
  9177. // "onBehalfOf": {
  9178. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  9179. // "location": "query",
  9180. // "type": "string"
  9181. // },
  9182. // "onBehalfOfContentOwner": {
  9183. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  9184. // "location": "query",
  9185. // "type": "string"
  9186. // },
  9187. // "part": {
  9188. // "description": "The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.",
  9189. // "location": "query",
  9190. // "required": true,
  9191. // "type": "string"
  9192. // },
  9193. // "sync": {
  9194. // "description": "The sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will disregard any time codes that are in the uploaded caption file and generate new time codes for the captions.\n\nYou should set the sync parameter to true if you are uploading a transcript, which has no time codes, or if you suspect the time codes in your file are incorrect and want YouTube to try to fix them.",
  9195. // "location": "query",
  9196. // "type": "boolean"
  9197. // }
  9198. // },
  9199. // "path": "captions",
  9200. // "request": {
  9201. // "$ref": "Caption"
  9202. // },
  9203. // "response": {
  9204. // "$ref": "Caption"
  9205. // },
  9206. // "scopes": [
  9207. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9208. // "https://www.googleapis.com/auth/youtubepartner"
  9209. // ],
  9210. // "supportsMediaUpload": true
  9211. // }
  9212. }
  9213. // method id "youtube.captions.list":
  9214. type CaptionsListCall struct {
  9215. s *Service
  9216. urlParams_ gensupport.URLParams
  9217. ifNoneMatch_ string
  9218. ctx_ context.Context
  9219. header_ http.Header
  9220. }
  9221. // List: Returns a list of caption tracks that are associated with a
  9222. // specified video. Note that the API response does not contain the
  9223. // actual captions and that the captions.download method provides the
  9224. // ability to retrieve a caption track.
  9225. func (r *CaptionsService) List(part string, videoId string) *CaptionsListCall {
  9226. c := &CaptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9227. c.urlParams_.Set("part", part)
  9228. c.urlParams_.Set("videoId", videoId)
  9229. return c
  9230. }
  9231. // Id sets the optional parameter "id": The id parameter specifies a
  9232. // comma-separated list of IDs that identify the caption resources that
  9233. // should be retrieved. Each ID must identify a caption track associated
  9234. // with the specified video.
  9235. func (c *CaptionsListCall) Id(id string) *CaptionsListCall {
  9236. c.urlParams_.Set("id", id)
  9237. return c
  9238. }
  9239. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  9240. // Google+ Page for the channel that the request is on behalf of.
  9241. func (c *CaptionsListCall) OnBehalfOf(onBehalfOf string) *CaptionsListCall {
  9242. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  9243. return c
  9244. }
  9245. // OnBehalfOfContentOwner sets the optional parameter
  9246. // "onBehalfOfContentOwner": Note: This parameter is intended
  9247. // exclusively for YouTube content partners.
  9248. //
  9249. // The onBehalfOfContentOwner parameter indicates that the request's
  9250. // authorization credentials identify a YouTube CMS user who is acting
  9251. // on behalf of the content owner specified in the parameter value. This
  9252. // parameter is intended for YouTube content partners that own and
  9253. // manage many different YouTube channels. It allows content owners to
  9254. // authenticate once and get access to all their video and channel data,
  9255. // without having to provide authentication credentials for each
  9256. // individual channel. The actual CMS account that the user
  9257. // authenticates with must be linked to the specified YouTube content
  9258. // owner.
  9259. func (c *CaptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsListCall {
  9260. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9261. return c
  9262. }
  9263. // Fields allows partial responses to be retrieved. See
  9264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9265. // for more information.
  9266. func (c *CaptionsListCall) Fields(s ...googleapi.Field) *CaptionsListCall {
  9267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9268. return c
  9269. }
  9270. // IfNoneMatch sets the optional parameter which makes the operation
  9271. // fail if the object's ETag matches the given value. This is useful for
  9272. // getting updates only after the object has changed since the last
  9273. // request. Use googleapi.IsNotModified to check whether the response
  9274. // error from Do is the result of In-None-Match.
  9275. func (c *CaptionsListCall) IfNoneMatch(entityTag string) *CaptionsListCall {
  9276. c.ifNoneMatch_ = entityTag
  9277. return c
  9278. }
  9279. // Context sets the context to be used in this call's Do method. Any
  9280. // pending HTTP request will be aborted if the provided context is
  9281. // canceled.
  9282. func (c *CaptionsListCall) Context(ctx context.Context) *CaptionsListCall {
  9283. c.ctx_ = ctx
  9284. return c
  9285. }
  9286. // Header returns an http.Header that can be modified by the caller to
  9287. // add HTTP headers to the request.
  9288. func (c *CaptionsListCall) Header() http.Header {
  9289. if c.header_ == nil {
  9290. c.header_ = make(http.Header)
  9291. }
  9292. return c.header_
  9293. }
  9294. func (c *CaptionsListCall) doRequest(alt string) (*http.Response, error) {
  9295. reqHeaders := make(http.Header)
  9296. for k, v := range c.header_ {
  9297. reqHeaders[k] = v
  9298. }
  9299. reqHeaders.Set("User-Agent", c.s.userAgent())
  9300. if c.ifNoneMatch_ != "" {
  9301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9302. }
  9303. var body io.Reader = nil
  9304. c.urlParams_.Set("alt", alt)
  9305. c.urlParams_.Set("prettyPrint", "false")
  9306. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  9307. urls += "?" + c.urlParams_.Encode()
  9308. req, err := http.NewRequest("GET", urls, body)
  9309. if err != nil {
  9310. return nil, err
  9311. }
  9312. req.Header = reqHeaders
  9313. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9314. }
  9315. // Do executes the "youtube.captions.list" call.
  9316. // Exactly one of *CaptionListResponse or error will be non-nil. Any
  9317. // non-2xx status code is an error. Response headers are in either
  9318. // *CaptionListResponse.ServerResponse.Header or (if a response was
  9319. // returned at all) in error.(*googleapi.Error).Header. Use
  9320. // googleapi.IsNotModified to check whether the returned error was
  9321. // because http.StatusNotModified was returned.
  9322. func (c *CaptionsListCall) Do(opts ...googleapi.CallOption) (*CaptionListResponse, error) {
  9323. gensupport.SetOptions(c.urlParams_, opts...)
  9324. res, err := c.doRequest("json")
  9325. if res != nil && res.StatusCode == http.StatusNotModified {
  9326. if res.Body != nil {
  9327. res.Body.Close()
  9328. }
  9329. return nil, &googleapi.Error{
  9330. Code: res.StatusCode,
  9331. Header: res.Header,
  9332. }
  9333. }
  9334. if err != nil {
  9335. return nil, err
  9336. }
  9337. defer googleapi.CloseBody(res)
  9338. if err := googleapi.CheckResponse(res); err != nil {
  9339. return nil, err
  9340. }
  9341. ret := &CaptionListResponse{
  9342. ServerResponse: googleapi.ServerResponse{
  9343. Header: res.Header,
  9344. HTTPStatusCode: res.StatusCode,
  9345. },
  9346. }
  9347. target := &ret
  9348. if err := gensupport.DecodeResponse(target, res); err != nil {
  9349. return nil, err
  9350. }
  9351. return ret, nil
  9352. // {
  9353. // "description": "Returns a list of caption tracks that are associated with a specified video. Note that the API response does not contain the actual captions and that the captions.download method provides the ability to retrieve a caption track.",
  9354. // "httpMethod": "GET",
  9355. // "id": "youtube.captions.list",
  9356. // "parameterOrder": [
  9357. // "part",
  9358. // "videoId"
  9359. // ],
  9360. // "parameters": {
  9361. // "id": {
  9362. // "description": "The id parameter specifies a comma-separated list of IDs that identify the caption resources that should be retrieved. Each ID must identify a caption track associated with the specified video.",
  9363. // "location": "query",
  9364. // "type": "string"
  9365. // },
  9366. // "onBehalfOf": {
  9367. // "description": "ID of the Google+ Page for the channel that the request is on behalf of.",
  9368. // "location": "query",
  9369. // "type": "string"
  9370. // },
  9371. // "onBehalfOfContentOwner": {
  9372. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  9373. // "location": "query",
  9374. // "type": "string"
  9375. // },
  9376. // "part": {
  9377. // "description": "The part parameter specifies a comma-separated list of one or more caption resource parts that the API response will include. The part names that you can include in the parameter value are id and snippet.",
  9378. // "location": "query",
  9379. // "required": true,
  9380. // "type": "string"
  9381. // },
  9382. // "videoId": {
  9383. // "description": "The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.",
  9384. // "location": "query",
  9385. // "required": true,
  9386. // "type": "string"
  9387. // }
  9388. // },
  9389. // "path": "captions",
  9390. // "response": {
  9391. // "$ref": "CaptionListResponse"
  9392. // },
  9393. // "scopes": [
  9394. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9395. // "https://www.googleapis.com/auth/youtubepartner"
  9396. // ]
  9397. // }
  9398. }
  9399. // method id "youtube.captions.update":
  9400. type CaptionsUpdateCall struct {
  9401. s *Service
  9402. caption *Caption
  9403. urlParams_ gensupport.URLParams
  9404. mediaInfo_ *gensupport.MediaInfo
  9405. ctx_ context.Context
  9406. header_ http.Header
  9407. }
  9408. // Update: Updates a caption track. When updating a caption track, you
  9409. // can change the track's draft status, upload a new caption file for
  9410. // the track, or both.
  9411. func (r *CaptionsService) Update(part string, caption *Caption) *CaptionsUpdateCall {
  9412. c := &CaptionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9413. c.urlParams_.Set("part", part)
  9414. c.caption = caption
  9415. return c
  9416. }
  9417. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  9418. // Google+ Page for the channel that the request is be on behalf of
  9419. func (c *CaptionsUpdateCall) OnBehalfOf(onBehalfOf string) *CaptionsUpdateCall {
  9420. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  9421. return c
  9422. }
  9423. // OnBehalfOfContentOwner sets the optional parameter
  9424. // "onBehalfOfContentOwner": Note: This parameter is intended
  9425. // exclusively for YouTube content partners.
  9426. //
  9427. // The onBehalfOfContentOwner parameter indicates that the request's
  9428. // authorization credentials identify a YouTube CMS user who is acting
  9429. // on behalf of the content owner specified in the parameter value. This
  9430. // parameter is intended for YouTube content partners that own and
  9431. // manage many different YouTube channels. It allows content owners to
  9432. // authenticate once and get access to all their video and channel data,
  9433. // without having to provide authentication credentials for each
  9434. // individual channel. The actual CMS account that the user
  9435. // authenticates with must be linked to the specified YouTube content
  9436. // owner.
  9437. func (c *CaptionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsUpdateCall {
  9438. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9439. return c
  9440. }
  9441. // Sync sets the optional parameter "sync": Note: The API server only
  9442. // processes the parameter value if the request contains an updated
  9443. // caption file.
  9444. //
  9445. // The sync parameter indicates whether YouTube should automatically
  9446. // synchronize the caption file with the audio track of the video. If
  9447. // you set the value to true, YouTube will automatically synchronize the
  9448. // caption track with the audio track.
  9449. func (c *CaptionsUpdateCall) Sync(sync bool) *CaptionsUpdateCall {
  9450. c.urlParams_.Set("sync", fmt.Sprint(sync))
  9451. return c
  9452. }
  9453. // Media specifies the media to upload in one or more chunks. The chunk
  9454. // size may be controlled by supplying a MediaOption generated by
  9455. // googleapi.ChunkSize. The chunk size defaults to
  9456. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  9457. // upload request will be determined by sniffing the contents of r,
  9458. // unless a MediaOption generated by googleapi.ContentType is
  9459. // supplied.
  9460. // At most one of Media and ResumableMedia may be set.
  9461. func (c *CaptionsUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsUpdateCall {
  9462. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  9463. return c
  9464. }
  9465. // ResumableMedia specifies the media to upload in chunks and can be
  9466. // canceled with ctx.
  9467. //
  9468. // Deprecated: use Media instead.
  9469. //
  9470. // At most one of Media and ResumableMedia may be set. mediaType
  9471. // identifies the MIME media type of the upload, such as "image/png". If
  9472. // mediaType is "", it will be auto-detected. The provided ctx will
  9473. // supersede any context previously provided to the Context method.
  9474. func (c *CaptionsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsUpdateCall {
  9475. c.ctx_ = ctx
  9476. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  9477. return c
  9478. }
  9479. // ProgressUpdater provides a callback function that will be called
  9480. // after every chunk. It should be a low-latency function in order to
  9481. // not slow down the upload operation. This should only be called when
  9482. // using ResumableMedia (as opposed to Media).
  9483. func (c *CaptionsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsUpdateCall {
  9484. c.mediaInfo_.SetProgressUpdater(pu)
  9485. return c
  9486. }
  9487. // Fields allows partial responses to be retrieved. See
  9488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9489. // for more information.
  9490. func (c *CaptionsUpdateCall) Fields(s ...googleapi.Field) *CaptionsUpdateCall {
  9491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9492. return c
  9493. }
  9494. // Context sets the context to be used in this call's Do method. Any
  9495. // pending HTTP request will be aborted if the provided context is
  9496. // canceled.
  9497. // This context will supersede any context previously provided to the
  9498. // ResumableMedia method.
  9499. func (c *CaptionsUpdateCall) Context(ctx context.Context) *CaptionsUpdateCall {
  9500. c.ctx_ = ctx
  9501. return c
  9502. }
  9503. // Header returns an http.Header that can be modified by the caller to
  9504. // add HTTP headers to the request.
  9505. func (c *CaptionsUpdateCall) Header() http.Header {
  9506. if c.header_ == nil {
  9507. c.header_ = make(http.Header)
  9508. }
  9509. return c.header_
  9510. }
  9511. func (c *CaptionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  9512. reqHeaders := make(http.Header)
  9513. for k, v := range c.header_ {
  9514. reqHeaders[k] = v
  9515. }
  9516. reqHeaders.Set("User-Agent", c.s.userAgent())
  9517. var body io.Reader = nil
  9518. body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption)
  9519. if err != nil {
  9520. return nil, err
  9521. }
  9522. reqHeaders.Set("Content-Type", "application/json")
  9523. c.urlParams_.Set("alt", alt)
  9524. c.urlParams_.Set("prettyPrint", "false")
  9525. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  9526. if c.mediaInfo_ != nil {
  9527. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  9528. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  9529. }
  9530. if body == nil {
  9531. body = new(bytes.Buffer)
  9532. reqHeaders.Set("Content-Type", "application/json")
  9533. }
  9534. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  9535. defer cleanup()
  9536. urls += "?" + c.urlParams_.Encode()
  9537. req, err := http.NewRequest("PUT", urls, body)
  9538. if err != nil {
  9539. return nil, err
  9540. }
  9541. req.Header = reqHeaders
  9542. req.GetBody = getBody
  9543. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9544. }
  9545. // Do executes the "youtube.captions.update" call.
  9546. // Exactly one of *Caption or error will be non-nil. Any non-2xx status
  9547. // code is an error. Response headers are in either
  9548. // *Caption.ServerResponse.Header or (if a response was returned at all)
  9549. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9550. // check whether the returned error was because http.StatusNotModified
  9551. // was returned.
  9552. func (c *CaptionsUpdateCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
  9553. gensupport.SetOptions(c.urlParams_, opts...)
  9554. res, err := c.doRequest("json")
  9555. if res != nil && res.StatusCode == http.StatusNotModified {
  9556. if res.Body != nil {
  9557. res.Body.Close()
  9558. }
  9559. return nil, &googleapi.Error{
  9560. Code: res.StatusCode,
  9561. Header: res.Header,
  9562. }
  9563. }
  9564. if err != nil {
  9565. return nil, err
  9566. }
  9567. defer googleapi.CloseBody(res)
  9568. if err := googleapi.CheckResponse(res); err != nil {
  9569. return nil, err
  9570. }
  9571. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  9572. if rx != nil {
  9573. rx.Client = c.s.client
  9574. rx.UserAgent = c.s.userAgent()
  9575. ctx := c.ctx_
  9576. if ctx == nil {
  9577. ctx = context.TODO()
  9578. }
  9579. res, err = rx.Upload(ctx)
  9580. if err != nil {
  9581. return nil, err
  9582. }
  9583. defer res.Body.Close()
  9584. if err := googleapi.CheckResponse(res); err != nil {
  9585. return nil, err
  9586. }
  9587. }
  9588. ret := &Caption{
  9589. ServerResponse: googleapi.ServerResponse{
  9590. Header: res.Header,
  9591. HTTPStatusCode: res.StatusCode,
  9592. },
  9593. }
  9594. target := &ret
  9595. if err := gensupport.DecodeResponse(target, res); err != nil {
  9596. return nil, err
  9597. }
  9598. return ret, nil
  9599. // {
  9600. // "description": "Updates a caption track. When updating a caption track, you can change the track's draft status, upload a new caption file for the track, or both.",
  9601. // "httpMethod": "PUT",
  9602. // "id": "youtube.captions.update",
  9603. // "mediaUpload": {
  9604. // "accept": [
  9605. // "*/*",
  9606. // "application/octet-stream",
  9607. // "text/xml"
  9608. // ],
  9609. // "maxSize": "100MB",
  9610. // "protocols": {
  9611. // "resumable": {
  9612. // "multipart": true,
  9613. // "path": "/resumable/upload/youtube/v3/captions"
  9614. // },
  9615. // "simple": {
  9616. // "multipart": true,
  9617. // "path": "/upload/youtube/v3/captions"
  9618. // }
  9619. // }
  9620. // },
  9621. // "parameterOrder": [
  9622. // "part"
  9623. // ],
  9624. // "parameters": {
  9625. // "onBehalfOf": {
  9626. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  9627. // "location": "query",
  9628. // "type": "string"
  9629. // },
  9630. // "onBehalfOfContentOwner": {
  9631. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  9632. // "location": "query",
  9633. // "type": "string"
  9634. // },
  9635. // "part": {
  9636. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the property value to snippet if you are updating the track's draft status. Otherwise, set the property value to id.",
  9637. // "location": "query",
  9638. // "required": true,
  9639. // "type": "string"
  9640. // },
  9641. // "sync": {
  9642. // "description": "Note: The API server only processes the parameter value if the request contains an updated caption file.\n\nThe sync parameter indicates whether YouTube should automatically synchronize the caption file with the audio track of the video. If you set the value to true, YouTube will automatically synchronize the caption track with the audio track.",
  9643. // "location": "query",
  9644. // "type": "boolean"
  9645. // }
  9646. // },
  9647. // "path": "captions",
  9648. // "request": {
  9649. // "$ref": "Caption"
  9650. // },
  9651. // "response": {
  9652. // "$ref": "Caption"
  9653. // },
  9654. // "scopes": [
  9655. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9656. // "https://www.googleapis.com/auth/youtubepartner"
  9657. // ],
  9658. // "supportsMediaUpload": true
  9659. // }
  9660. }
  9661. // method id "youtube.channelBanners.insert":
  9662. type ChannelBannersInsertCall struct {
  9663. s *Service
  9664. channelbannerresource *ChannelBannerResource
  9665. urlParams_ gensupport.URLParams
  9666. mediaInfo_ *gensupport.MediaInfo
  9667. ctx_ context.Context
  9668. header_ http.Header
  9669. }
  9670. // Insert: Uploads a channel banner image to YouTube. This method
  9671. // represents the first two steps in a three-step process to update the
  9672. // banner image for a channel:
  9673. //
  9674. // - Call the channelBanners.insert method to upload the binary image
  9675. // data to YouTube. The image must have a 16:9 aspect ratio and be at
  9676. // least 2120x1192 pixels.
  9677. // - Extract the url property's value from the response that the API
  9678. // returns for step 1.
  9679. // - Call the channels.update method to update the channel's branding
  9680. // settings. Set the brandingSettings.image.bannerExternalUrl property's
  9681. // value to the URL obtained in step 2.
  9682. func (r *ChannelBannersService) Insert(channelbannerresource *ChannelBannerResource) *ChannelBannersInsertCall {
  9683. c := &ChannelBannersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9684. c.channelbannerresource = channelbannerresource
  9685. return c
  9686. }
  9687. // ChannelId sets the optional parameter "channelId": The channelId
  9688. // parameter identifies the YouTube channel to which the banner is
  9689. // uploaded. The channelId parameter was introduced as a required
  9690. // parameter in May 2017. As this was a backward-incompatible change,
  9691. // channelBanners.insert requests that do not specify this parameter
  9692. // will not return an error until six months have passed from the time
  9693. // that the parameter was introduced. Please see the API Terms of
  9694. // Service for the official policy regarding backward incompatible
  9695. // changes and the API revision history for the exact date that the
  9696. // parameter was introduced.
  9697. func (c *ChannelBannersInsertCall) ChannelId(channelId string) *ChannelBannersInsertCall {
  9698. c.urlParams_.Set("channelId", channelId)
  9699. return c
  9700. }
  9701. // OnBehalfOfContentOwner sets the optional parameter
  9702. // "onBehalfOfContentOwner": Note: This parameter is intended
  9703. // exclusively for YouTube content partners.
  9704. //
  9705. // The onBehalfOfContentOwner parameter indicates that the request's
  9706. // authorization credentials identify a YouTube CMS user who is acting
  9707. // on behalf of the content owner specified in the parameter value. This
  9708. // parameter is intended for YouTube content partners that own and
  9709. // manage many different YouTube channels. It allows content owners to
  9710. // authenticate once and get access to all their video and channel data,
  9711. // without having to provide authentication credentials for each
  9712. // individual channel. The CMS account that the user authenticates with
  9713. // must be linked to the specified YouTube content owner.
  9714. func (c *ChannelBannersInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelBannersInsertCall {
  9715. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9716. return c
  9717. }
  9718. // Media specifies the media to upload in one or more chunks. The chunk
  9719. // size may be controlled by supplying a MediaOption generated by
  9720. // googleapi.ChunkSize. The chunk size defaults to
  9721. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  9722. // upload request will be determined by sniffing the contents of r,
  9723. // unless a MediaOption generated by googleapi.ContentType is
  9724. // supplied.
  9725. // At most one of Media and ResumableMedia may be set.
  9726. func (c *ChannelBannersInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ChannelBannersInsertCall {
  9727. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  9728. return c
  9729. }
  9730. // ResumableMedia specifies the media to upload in chunks and can be
  9731. // canceled with ctx.
  9732. //
  9733. // Deprecated: use Media instead.
  9734. //
  9735. // At most one of Media and ResumableMedia may be set. mediaType
  9736. // identifies the MIME media type of the upload, such as "image/png". If
  9737. // mediaType is "", it will be auto-detected. The provided ctx will
  9738. // supersede any context previously provided to the Context method.
  9739. func (c *ChannelBannersInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ChannelBannersInsertCall {
  9740. c.ctx_ = ctx
  9741. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  9742. return c
  9743. }
  9744. // ProgressUpdater provides a callback function that will be called
  9745. // after every chunk. It should be a low-latency function in order to
  9746. // not slow down the upload operation. This should only be called when
  9747. // using ResumableMedia (as opposed to Media).
  9748. func (c *ChannelBannersInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ChannelBannersInsertCall {
  9749. c.mediaInfo_.SetProgressUpdater(pu)
  9750. return c
  9751. }
  9752. // Fields allows partial responses to be retrieved. See
  9753. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9754. // for more information.
  9755. func (c *ChannelBannersInsertCall) Fields(s ...googleapi.Field) *ChannelBannersInsertCall {
  9756. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9757. return c
  9758. }
  9759. // Context sets the context to be used in this call's Do method. Any
  9760. // pending HTTP request will be aborted if the provided context is
  9761. // canceled.
  9762. // This context will supersede any context previously provided to the
  9763. // ResumableMedia method.
  9764. func (c *ChannelBannersInsertCall) Context(ctx context.Context) *ChannelBannersInsertCall {
  9765. c.ctx_ = ctx
  9766. return c
  9767. }
  9768. // Header returns an http.Header that can be modified by the caller to
  9769. // add HTTP headers to the request.
  9770. func (c *ChannelBannersInsertCall) Header() http.Header {
  9771. if c.header_ == nil {
  9772. c.header_ = make(http.Header)
  9773. }
  9774. return c.header_
  9775. }
  9776. func (c *ChannelBannersInsertCall) doRequest(alt string) (*http.Response, error) {
  9777. reqHeaders := make(http.Header)
  9778. for k, v := range c.header_ {
  9779. reqHeaders[k] = v
  9780. }
  9781. reqHeaders.Set("User-Agent", c.s.userAgent())
  9782. var body io.Reader = nil
  9783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelbannerresource)
  9784. if err != nil {
  9785. return nil, err
  9786. }
  9787. reqHeaders.Set("Content-Type", "application/json")
  9788. c.urlParams_.Set("alt", alt)
  9789. c.urlParams_.Set("prettyPrint", "false")
  9790. urls := googleapi.ResolveRelative(c.s.BasePath, "channelBanners/insert")
  9791. if c.mediaInfo_ != nil {
  9792. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  9793. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  9794. }
  9795. if body == nil {
  9796. body = new(bytes.Buffer)
  9797. reqHeaders.Set("Content-Type", "application/json")
  9798. }
  9799. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  9800. defer cleanup()
  9801. urls += "?" + c.urlParams_.Encode()
  9802. req, err := http.NewRequest("POST", urls, body)
  9803. if err != nil {
  9804. return nil, err
  9805. }
  9806. req.Header = reqHeaders
  9807. req.GetBody = getBody
  9808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9809. }
  9810. // Do executes the "youtube.channelBanners.insert" call.
  9811. // Exactly one of *ChannelBannerResource or error will be non-nil. Any
  9812. // non-2xx status code is an error. Response headers are in either
  9813. // *ChannelBannerResource.ServerResponse.Header or (if a response was
  9814. // returned at all) in error.(*googleapi.Error).Header. Use
  9815. // googleapi.IsNotModified to check whether the returned error was
  9816. // because http.StatusNotModified was returned.
  9817. func (c *ChannelBannersInsertCall) Do(opts ...googleapi.CallOption) (*ChannelBannerResource, error) {
  9818. gensupport.SetOptions(c.urlParams_, opts...)
  9819. res, err := c.doRequest("json")
  9820. if res != nil && res.StatusCode == http.StatusNotModified {
  9821. if res.Body != nil {
  9822. res.Body.Close()
  9823. }
  9824. return nil, &googleapi.Error{
  9825. Code: res.StatusCode,
  9826. Header: res.Header,
  9827. }
  9828. }
  9829. if err != nil {
  9830. return nil, err
  9831. }
  9832. defer googleapi.CloseBody(res)
  9833. if err := googleapi.CheckResponse(res); err != nil {
  9834. return nil, err
  9835. }
  9836. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  9837. if rx != nil {
  9838. rx.Client = c.s.client
  9839. rx.UserAgent = c.s.userAgent()
  9840. ctx := c.ctx_
  9841. if ctx == nil {
  9842. ctx = context.TODO()
  9843. }
  9844. res, err = rx.Upload(ctx)
  9845. if err != nil {
  9846. return nil, err
  9847. }
  9848. defer res.Body.Close()
  9849. if err := googleapi.CheckResponse(res); err != nil {
  9850. return nil, err
  9851. }
  9852. }
  9853. ret := &ChannelBannerResource{
  9854. ServerResponse: googleapi.ServerResponse{
  9855. Header: res.Header,
  9856. HTTPStatusCode: res.StatusCode,
  9857. },
  9858. }
  9859. target := &ret
  9860. if err := gensupport.DecodeResponse(target, res); err != nil {
  9861. return nil, err
  9862. }
  9863. return ret, nil
  9864. // {
  9865. // "description": "Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel:\n\n- Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels.\n- Extract the url property's value from the response that the API returns for step 1.\n- Call the channels.update method to update the channel's branding settings. Set the brandingSettings.image.bannerExternalUrl property's value to the URL obtained in step 2.",
  9866. // "httpMethod": "POST",
  9867. // "id": "youtube.channelBanners.insert",
  9868. // "mediaUpload": {
  9869. // "accept": [
  9870. // "application/octet-stream",
  9871. // "image/jpeg",
  9872. // "image/png"
  9873. // ],
  9874. // "maxSize": "6MB",
  9875. // "protocols": {
  9876. // "resumable": {
  9877. // "multipart": true,
  9878. // "path": "/resumable/upload/youtube/v3/channelBanners/insert"
  9879. // },
  9880. // "simple": {
  9881. // "multipart": true,
  9882. // "path": "/upload/youtube/v3/channelBanners/insert"
  9883. // }
  9884. // }
  9885. // },
  9886. // "parameters": {
  9887. // "channelId": {
  9888. // "description": "The channelId parameter identifies the YouTube channel to which the banner is uploaded. The channelId parameter was introduced as a required parameter in May 2017. As this was a backward-incompatible change, channelBanners.insert requests that do not specify this parameter will not return an error until six months have passed from the time that the parameter was introduced. Please see the API Terms of Service for the official policy regarding backward incompatible changes and the API revision history for the exact date that the parameter was introduced.",
  9889. // "location": "query",
  9890. // "type": "string"
  9891. // },
  9892. // "onBehalfOfContentOwner": {
  9893. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  9894. // "location": "query",
  9895. // "type": "string"
  9896. // }
  9897. // },
  9898. // "path": "channelBanners/insert",
  9899. // "request": {
  9900. // "$ref": "ChannelBannerResource"
  9901. // },
  9902. // "response": {
  9903. // "$ref": "ChannelBannerResource"
  9904. // },
  9905. // "scopes": [
  9906. // "https://www.googleapis.com/auth/youtube",
  9907. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9908. // "https://www.googleapis.com/auth/youtube.upload"
  9909. // ],
  9910. // "supportsMediaUpload": true
  9911. // }
  9912. }
  9913. // method id "youtube.channelSections.delete":
  9914. type ChannelSectionsDeleteCall struct {
  9915. s *Service
  9916. urlParams_ gensupport.URLParams
  9917. ctx_ context.Context
  9918. header_ http.Header
  9919. }
  9920. // Delete: Deletes a channelSection.
  9921. func (r *ChannelSectionsService) Delete(id string) *ChannelSectionsDeleteCall {
  9922. c := &ChannelSectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9923. c.urlParams_.Set("id", id)
  9924. return c
  9925. }
  9926. // OnBehalfOfContentOwner sets the optional parameter
  9927. // "onBehalfOfContentOwner": Note: This parameter is intended
  9928. // exclusively for YouTube content partners.
  9929. //
  9930. // The onBehalfOfContentOwner parameter indicates that the request's
  9931. // authorization credentials identify a YouTube CMS user who is acting
  9932. // on behalf of the content owner specified in the parameter value. This
  9933. // parameter is intended for YouTube content partners that own and
  9934. // manage many different YouTube channels. It allows content owners to
  9935. // authenticate once and get access to all their video and channel data,
  9936. // without having to provide authentication credentials for each
  9937. // individual channel. The CMS account that the user authenticates with
  9938. // must be linked to the specified YouTube content owner.
  9939. func (c *ChannelSectionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsDeleteCall {
  9940. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9941. return c
  9942. }
  9943. // Fields allows partial responses to be retrieved. See
  9944. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9945. // for more information.
  9946. func (c *ChannelSectionsDeleteCall) Fields(s ...googleapi.Field) *ChannelSectionsDeleteCall {
  9947. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9948. return c
  9949. }
  9950. // Context sets the context to be used in this call's Do method. Any
  9951. // pending HTTP request will be aborted if the provided context is
  9952. // canceled.
  9953. func (c *ChannelSectionsDeleteCall) Context(ctx context.Context) *ChannelSectionsDeleteCall {
  9954. c.ctx_ = ctx
  9955. return c
  9956. }
  9957. // Header returns an http.Header that can be modified by the caller to
  9958. // add HTTP headers to the request.
  9959. func (c *ChannelSectionsDeleteCall) Header() http.Header {
  9960. if c.header_ == nil {
  9961. c.header_ = make(http.Header)
  9962. }
  9963. return c.header_
  9964. }
  9965. func (c *ChannelSectionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9966. reqHeaders := make(http.Header)
  9967. for k, v := range c.header_ {
  9968. reqHeaders[k] = v
  9969. }
  9970. reqHeaders.Set("User-Agent", c.s.userAgent())
  9971. var body io.Reader = nil
  9972. c.urlParams_.Set("alt", alt)
  9973. c.urlParams_.Set("prettyPrint", "false")
  9974. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  9975. urls += "?" + c.urlParams_.Encode()
  9976. req, err := http.NewRequest("DELETE", urls, body)
  9977. if err != nil {
  9978. return nil, err
  9979. }
  9980. req.Header = reqHeaders
  9981. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9982. }
  9983. // Do executes the "youtube.channelSections.delete" call.
  9984. func (c *ChannelSectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  9985. gensupport.SetOptions(c.urlParams_, opts...)
  9986. res, err := c.doRequest("json")
  9987. if err != nil {
  9988. return err
  9989. }
  9990. defer googleapi.CloseBody(res)
  9991. if err := googleapi.CheckResponse(res); err != nil {
  9992. return err
  9993. }
  9994. return nil
  9995. // {
  9996. // "description": "Deletes a channelSection.",
  9997. // "httpMethod": "DELETE",
  9998. // "id": "youtube.channelSections.delete",
  9999. // "parameterOrder": [
  10000. // "id"
  10001. // ],
  10002. // "parameters": {
  10003. // "id": {
  10004. // "description": "The id parameter specifies the YouTube channelSection ID for the resource that is being deleted. In a channelSection resource, the id property specifies the YouTube channelSection ID.",
  10005. // "location": "query",
  10006. // "required": true,
  10007. // "type": "string"
  10008. // },
  10009. // "onBehalfOfContentOwner": {
  10010. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  10011. // "location": "query",
  10012. // "type": "string"
  10013. // }
  10014. // },
  10015. // "path": "channelSections",
  10016. // "scopes": [
  10017. // "https://www.googleapis.com/auth/youtube",
  10018. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10019. // "https://www.googleapis.com/auth/youtubepartner"
  10020. // ]
  10021. // }
  10022. }
  10023. // method id "youtube.channelSections.insert":
  10024. type ChannelSectionsInsertCall struct {
  10025. s *Service
  10026. channelsection *ChannelSection
  10027. urlParams_ gensupport.URLParams
  10028. ctx_ context.Context
  10029. header_ http.Header
  10030. }
  10031. // Insert: Adds a channelSection for the authenticated user's channel.
  10032. func (r *ChannelSectionsService) Insert(part string, channelsection *ChannelSection) *ChannelSectionsInsertCall {
  10033. c := &ChannelSectionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10034. c.urlParams_.Set("part", part)
  10035. c.channelsection = channelsection
  10036. return c
  10037. }
  10038. // OnBehalfOfContentOwner sets the optional parameter
  10039. // "onBehalfOfContentOwner": Note: This parameter is intended
  10040. // exclusively for YouTube content partners.
  10041. //
  10042. // The onBehalfOfContentOwner parameter indicates that the request's
  10043. // authorization credentials identify a YouTube CMS user who is acting
  10044. // on behalf of the content owner specified in the parameter value. This
  10045. // parameter is intended for YouTube content partners that own and
  10046. // manage many different YouTube channels. It allows content owners to
  10047. // authenticate once and get access to all their video and channel data,
  10048. // without having to provide authentication credentials for each
  10049. // individual channel. The CMS account that the user authenticates with
  10050. // must be linked to the specified YouTube content owner.
  10051. func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsInsertCall {
  10052. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10053. return c
  10054. }
  10055. // OnBehalfOfContentOwnerChannel sets the optional parameter
  10056. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  10057. // properly authorized request. Note: This parameter is intended
  10058. // exclusively for YouTube content partners.
  10059. //
  10060. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  10061. // channel ID of the channel to which a video is being added. This
  10062. // parameter is required when a request specifies a value for the
  10063. // onBehalfOfContentOwner parameter, and it can only be used in
  10064. // conjunction with that parameter. In addition, the request must be
  10065. // authorized using a CMS account that is linked to the content owner
  10066. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  10067. // channel that the onBehalfOfContentOwnerChannel parameter value
  10068. // specifies must be linked to the content owner that the
  10069. // onBehalfOfContentOwner parameter specifies.
  10070. //
  10071. // This parameter is intended for YouTube content partners that own and
  10072. // manage many different YouTube channels. It allows content owners to
  10073. // authenticate once and perform actions on behalf of the channel
  10074. // specified in the parameter value, without having to provide
  10075. // authentication credentials for each separate channel.
  10076. func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *ChannelSectionsInsertCall {
  10077. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  10078. return c
  10079. }
  10080. // Fields allows partial responses to be retrieved. See
  10081. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10082. // for more information.
  10083. func (c *ChannelSectionsInsertCall) Fields(s ...googleapi.Field) *ChannelSectionsInsertCall {
  10084. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10085. return c
  10086. }
  10087. // Context sets the context to be used in this call's Do method. Any
  10088. // pending HTTP request will be aborted if the provided context is
  10089. // canceled.
  10090. func (c *ChannelSectionsInsertCall) Context(ctx context.Context) *ChannelSectionsInsertCall {
  10091. c.ctx_ = ctx
  10092. return c
  10093. }
  10094. // Header returns an http.Header that can be modified by the caller to
  10095. // add HTTP headers to the request.
  10096. func (c *ChannelSectionsInsertCall) Header() http.Header {
  10097. if c.header_ == nil {
  10098. c.header_ = make(http.Header)
  10099. }
  10100. return c.header_
  10101. }
  10102. func (c *ChannelSectionsInsertCall) doRequest(alt string) (*http.Response, error) {
  10103. reqHeaders := make(http.Header)
  10104. for k, v := range c.header_ {
  10105. reqHeaders[k] = v
  10106. }
  10107. reqHeaders.Set("User-Agent", c.s.userAgent())
  10108. var body io.Reader = nil
  10109. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection)
  10110. if err != nil {
  10111. return nil, err
  10112. }
  10113. reqHeaders.Set("Content-Type", "application/json")
  10114. c.urlParams_.Set("alt", alt)
  10115. c.urlParams_.Set("prettyPrint", "false")
  10116. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  10117. urls += "?" + c.urlParams_.Encode()
  10118. req, err := http.NewRequest("POST", urls, body)
  10119. if err != nil {
  10120. return nil, err
  10121. }
  10122. req.Header = reqHeaders
  10123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10124. }
  10125. // Do executes the "youtube.channelSections.insert" call.
  10126. // Exactly one of *ChannelSection or error will be non-nil. Any non-2xx
  10127. // status code is an error. Response headers are in either
  10128. // *ChannelSection.ServerResponse.Header or (if a response was returned
  10129. // at all) in error.(*googleapi.Error).Header. Use
  10130. // googleapi.IsNotModified to check whether the returned error was
  10131. // because http.StatusNotModified was returned.
  10132. func (c *ChannelSectionsInsertCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
  10133. gensupport.SetOptions(c.urlParams_, opts...)
  10134. res, err := c.doRequest("json")
  10135. if res != nil && res.StatusCode == http.StatusNotModified {
  10136. if res.Body != nil {
  10137. res.Body.Close()
  10138. }
  10139. return nil, &googleapi.Error{
  10140. Code: res.StatusCode,
  10141. Header: res.Header,
  10142. }
  10143. }
  10144. if err != nil {
  10145. return nil, err
  10146. }
  10147. defer googleapi.CloseBody(res)
  10148. if err := googleapi.CheckResponse(res); err != nil {
  10149. return nil, err
  10150. }
  10151. ret := &ChannelSection{
  10152. ServerResponse: googleapi.ServerResponse{
  10153. Header: res.Header,
  10154. HTTPStatusCode: res.StatusCode,
  10155. },
  10156. }
  10157. target := &ret
  10158. if err := gensupport.DecodeResponse(target, res); err != nil {
  10159. return nil, err
  10160. }
  10161. return ret, nil
  10162. // {
  10163. // "description": "Adds a channelSection for the authenticated user's channel.",
  10164. // "httpMethod": "POST",
  10165. // "id": "youtube.channelSections.insert",
  10166. // "parameterOrder": [
  10167. // "part"
  10168. // ],
  10169. // "parameters": {
  10170. // "onBehalfOfContentOwner": {
  10171. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  10172. // "location": "query",
  10173. // "type": "string"
  10174. // },
  10175. // "onBehalfOfContentOwnerChannel": {
  10176. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  10177. // "location": "query",
  10178. // "type": "string"
  10179. // },
  10180. // "part": {
  10181. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.",
  10182. // "location": "query",
  10183. // "required": true,
  10184. // "type": "string"
  10185. // }
  10186. // },
  10187. // "path": "channelSections",
  10188. // "request": {
  10189. // "$ref": "ChannelSection"
  10190. // },
  10191. // "response": {
  10192. // "$ref": "ChannelSection"
  10193. // },
  10194. // "scopes": [
  10195. // "https://www.googleapis.com/auth/youtube",
  10196. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10197. // "https://www.googleapis.com/auth/youtubepartner"
  10198. // ]
  10199. // }
  10200. }
  10201. // method id "youtube.channelSections.list":
  10202. type ChannelSectionsListCall struct {
  10203. s *Service
  10204. urlParams_ gensupport.URLParams
  10205. ifNoneMatch_ string
  10206. ctx_ context.Context
  10207. header_ http.Header
  10208. }
  10209. // List: Returns channelSection resources that match the API request
  10210. // criteria.
  10211. func (r *ChannelSectionsService) List(part string) *ChannelSectionsListCall {
  10212. c := &ChannelSectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10213. c.urlParams_.Set("part", part)
  10214. return c
  10215. }
  10216. // ChannelId sets the optional parameter "channelId": The channelId
  10217. // parameter specifies a YouTube channel ID. The API will only return
  10218. // that channel's channelSections.
  10219. func (c *ChannelSectionsListCall) ChannelId(channelId string) *ChannelSectionsListCall {
  10220. c.urlParams_.Set("channelId", channelId)
  10221. return c
  10222. }
  10223. // Hl sets the optional parameter "hl": The hl parameter indicates that
  10224. // the snippet.localized property values in the returned channelSection
  10225. // resources should be in the specified language if localized values for
  10226. // that language are available. For example, if the API request
  10227. // specifies hl=de, the snippet.localized properties in the API response
  10228. // will contain German titles if German titles are available. Channel
  10229. // owners can provide localized channel section titles using either the
  10230. // channelSections.insert or channelSections.update method.
  10231. func (c *ChannelSectionsListCall) Hl(hl string) *ChannelSectionsListCall {
  10232. c.urlParams_.Set("hl", hl)
  10233. return c
  10234. }
  10235. // Id sets the optional parameter "id": The id parameter specifies a
  10236. // comma-separated list of the YouTube channelSection ID(s) for the
  10237. // resource(s) that are being retrieved. In a channelSection resource,
  10238. // the id property specifies the YouTube channelSection ID.
  10239. func (c *ChannelSectionsListCall) Id(id string) *ChannelSectionsListCall {
  10240. c.urlParams_.Set("id", id)
  10241. return c
  10242. }
  10243. // Mine sets the optional parameter "mine": Set this parameter's value
  10244. // to true to retrieve a feed of the authenticated user's
  10245. // channelSections.
  10246. func (c *ChannelSectionsListCall) Mine(mine bool) *ChannelSectionsListCall {
  10247. c.urlParams_.Set("mine", fmt.Sprint(mine))
  10248. return c
  10249. }
  10250. // OnBehalfOfContentOwner sets the optional parameter
  10251. // "onBehalfOfContentOwner": Note: This parameter is intended
  10252. // exclusively for YouTube content partners.
  10253. //
  10254. // The onBehalfOfContentOwner parameter indicates that the request's
  10255. // authorization credentials identify a YouTube CMS user who is acting
  10256. // on behalf of the content owner specified in the parameter value. This
  10257. // parameter is intended for YouTube content partners that own and
  10258. // manage many different YouTube channels. It allows content owners to
  10259. // authenticate once and get access to all their video and channel data,
  10260. // without having to provide authentication credentials for each
  10261. // individual channel. The CMS account that the user authenticates with
  10262. // must be linked to the specified YouTube content owner.
  10263. func (c *ChannelSectionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsListCall {
  10264. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10265. return c
  10266. }
  10267. // Fields allows partial responses to be retrieved. See
  10268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10269. // for more information.
  10270. func (c *ChannelSectionsListCall) Fields(s ...googleapi.Field) *ChannelSectionsListCall {
  10271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10272. return c
  10273. }
  10274. // IfNoneMatch sets the optional parameter which makes the operation
  10275. // fail if the object's ETag matches the given value. This is useful for
  10276. // getting updates only after the object has changed since the last
  10277. // request. Use googleapi.IsNotModified to check whether the response
  10278. // error from Do is the result of In-None-Match.
  10279. func (c *ChannelSectionsListCall) IfNoneMatch(entityTag string) *ChannelSectionsListCall {
  10280. c.ifNoneMatch_ = entityTag
  10281. return c
  10282. }
  10283. // Context sets the context to be used in this call's Do method. Any
  10284. // pending HTTP request will be aborted if the provided context is
  10285. // canceled.
  10286. func (c *ChannelSectionsListCall) Context(ctx context.Context) *ChannelSectionsListCall {
  10287. c.ctx_ = ctx
  10288. return c
  10289. }
  10290. // Header returns an http.Header that can be modified by the caller to
  10291. // add HTTP headers to the request.
  10292. func (c *ChannelSectionsListCall) Header() http.Header {
  10293. if c.header_ == nil {
  10294. c.header_ = make(http.Header)
  10295. }
  10296. return c.header_
  10297. }
  10298. func (c *ChannelSectionsListCall) doRequest(alt string) (*http.Response, error) {
  10299. reqHeaders := make(http.Header)
  10300. for k, v := range c.header_ {
  10301. reqHeaders[k] = v
  10302. }
  10303. reqHeaders.Set("User-Agent", c.s.userAgent())
  10304. if c.ifNoneMatch_ != "" {
  10305. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10306. }
  10307. var body io.Reader = nil
  10308. c.urlParams_.Set("alt", alt)
  10309. c.urlParams_.Set("prettyPrint", "false")
  10310. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  10311. urls += "?" + c.urlParams_.Encode()
  10312. req, err := http.NewRequest("GET", urls, body)
  10313. if err != nil {
  10314. return nil, err
  10315. }
  10316. req.Header = reqHeaders
  10317. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10318. }
  10319. // Do executes the "youtube.channelSections.list" call.
  10320. // Exactly one of *ChannelSectionListResponse or error will be non-nil.
  10321. // Any non-2xx status code is an error. Response headers are in either
  10322. // *ChannelSectionListResponse.ServerResponse.Header or (if a response
  10323. // was returned at all) in error.(*googleapi.Error).Header. Use
  10324. // googleapi.IsNotModified to check whether the returned error was
  10325. // because http.StatusNotModified was returned.
  10326. func (c *ChannelSectionsListCall) Do(opts ...googleapi.CallOption) (*ChannelSectionListResponse, error) {
  10327. gensupport.SetOptions(c.urlParams_, opts...)
  10328. res, err := c.doRequest("json")
  10329. if res != nil && res.StatusCode == http.StatusNotModified {
  10330. if res.Body != nil {
  10331. res.Body.Close()
  10332. }
  10333. return nil, &googleapi.Error{
  10334. Code: res.StatusCode,
  10335. Header: res.Header,
  10336. }
  10337. }
  10338. if err != nil {
  10339. return nil, err
  10340. }
  10341. defer googleapi.CloseBody(res)
  10342. if err := googleapi.CheckResponse(res); err != nil {
  10343. return nil, err
  10344. }
  10345. ret := &ChannelSectionListResponse{
  10346. ServerResponse: googleapi.ServerResponse{
  10347. Header: res.Header,
  10348. HTTPStatusCode: res.StatusCode,
  10349. },
  10350. }
  10351. target := &ret
  10352. if err := gensupport.DecodeResponse(target, res); err != nil {
  10353. return nil, err
  10354. }
  10355. return ret, nil
  10356. // {
  10357. // "description": "Returns channelSection resources that match the API request criteria.",
  10358. // "httpMethod": "GET",
  10359. // "id": "youtube.channelSections.list",
  10360. // "parameterOrder": [
  10361. // "part"
  10362. // ],
  10363. // "parameters": {
  10364. // "channelId": {
  10365. // "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections.",
  10366. // "location": "query",
  10367. // "type": "string"
  10368. // },
  10369. // "hl": {
  10370. // "description": "The hl parameter indicates that the snippet.localized property values in the returned channelSection resources should be in the specified language if localized values for that language are available. For example, if the API request specifies hl=de, the snippet.localized properties in the API response will contain German titles if German titles are available. Channel owners can provide localized channel section titles using either the channelSections.insert or channelSections.update method.",
  10371. // "location": "query",
  10372. // "type": "string"
  10373. // },
  10374. // "id": {
  10375. // "description": "The id parameter specifies a comma-separated list of the YouTube channelSection ID(s) for the resource(s) that are being retrieved. In a channelSection resource, the id property specifies the YouTube channelSection ID.",
  10376. // "location": "query",
  10377. // "type": "string"
  10378. // },
  10379. // "mine": {
  10380. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections.",
  10381. // "location": "query",
  10382. // "type": "boolean"
  10383. // },
  10384. // "onBehalfOfContentOwner": {
  10385. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  10386. // "location": "query",
  10387. // "type": "string"
  10388. // },
  10389. // "part": {
  10390. // "description": "The part parameter specifies a comma-separated list of one or more channelSection resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, and contentDetails.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channelSection resource, the snippet property contains other properties, such as a display title for the channelSection. If you set part=snippet, the API response will also contain all of those nested properties.",
  10391. // "location": "query",
  10392. // "required": true,
  10393. // "type": "string"
  10394. // }
  10395. // },
  10396. // "path": "channelSections",
  10397. // "response": {
  10398. // "$ref": "ChannelSectionListResponse"
  10399. // },
  10400. // "scopes": [
  10401. // "https://www.googleapis.com/auth/youtube",
  10402. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10403. // "https://www.googleapis.com/auth/youtube.readonly",
  10404. // "https://www.googleapis.com/auth/youtubepartner"
  10405. // ]
  10406. // }
  10407. }
  10408. // method id "youtube.channelSections.update":
  10409. type ChannelSectionsUpdateCall struct {
  10410. s *Service
  10411. channelsection *ChannelSection
  10412. urlParams_ gensupport.URLParams
  10413. ctx_ context.Context
  10414. header_ http.Header
  10415. }
  10416. // Update: Update a channelSection.
  10417. func (r *ChannelSectionsService) Update(part string, channelsection *ChannelSection) *ChannelSectionsUpdateCall {
  10418. c := &ChannelSectionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10419. c.urlParams_.Set("part", part)
  10420. c.channelsection = channelsection
  10421. return c
  10422. }
  10423. // OnBehalfOfContentOwner sets the optional parameter
  10424. // "onBehalfOfContentOwner": Note: This parameter is intended
  10425. // exclusively for YouTube content partners.
  10426. //
  10427. // The onBehalfOfContentOwner parameter indicates that the request's
  10428. // authorization credentials identify a YouTube CMS user who is acting
  10429. // on behalf of the content owner specified in the parameter value. This
  10430. // parameter is intended for YouTube content partners that own and
  10431. // manage many different YouTube channels. It allows content owners to
  10432. // authenticate once and get access to all their video and channel data,
  10433. // without having to provide authentication credentials for each
  10434. // individual channel. The CMS account that the user authenticates with
  10435. // must be linked to the specified YouTube content owner.
  10436. func (c *ChannelSectionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsUpdateCall {
  10437. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10438. return c
  10439. }
  10440. // Fields allows partial responses to be retrieved. See
  10441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10442. // for more information.
  10443. func (c *ChannelSectionsUpdateCall) Fields(s ...googleapi.Field) *ChannelSectionsUpdateCall {
  10444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10445. return c
  10446. }
  10447. // Context sets the context to be used in this call's Do method. Any
  10448. // pending HTTP request will be aborted if the provided context is
  10449. // canceled.
  10450. func (c *ChannelSectionsUpdateCall) Context(ctx context.Context) *ChannelSectionsUpdateCall {
  10451. c.ctx_ = ctx
  10452. return c
  10453. }
  10454. // Header returns an http.Header that can be modified by the caller to
  10455. // add HTTP headers to the request.
  10456. func (c *ChannelSectionsUpdateCall) Header() http.Header {
  10457. if c.header_ == nil {
  10458. c.header_ = make(http.Header)
  10459. }
  10460. return c.header_
  10461. }
  10462. func (c *ChannelSectionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10463. reqHeaders := make(http.Header)
  10464. for k, v := range c.header_ {
  10465. reqHeaders[k] = v
  10466. }
  10467. reqHeaders.Set("User-Agent", c.s.userAgent())
  10468. var body io.Reader = nil
  10469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection)
  10470. if err != nil {
  10471. return nil, err
  10472. }
  10473. reqHeaders.Set("Content-Type", "application/json")
  10474. c.urlParams_.Set("alt", alt)
  10475. c.urlParams_.Set("prettyPrint", "false")
  10476. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  10477. urls += "?" + c.urlParams_.Encode()
  10478. req, err := http.NewRequest("PUT", urls, body)
  10479. if err != nil {
  10480. return nil, err
  10481. }
  10482. req.Header = reqHeaders
  10483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10484. }
  10485. // Do executes the "youtube.channelSections.update" call.
  10486. // Exactly one of *ChannelSection or error will be non-nil. Any non-2xx
  10487. // status code is an error. Response headers are in either
  10488. // *ChannelSection.ServerResponse.Header or (if a response was returned
  10489. // at all) in error.(*googleapi.Error).Header. Use
  10490. // googleapi.IsNotModified to check whether the returned error was
  10491. // because http.StatusNotModified was returned.
  10492. func (c *ChannelSectionsUpdateCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
  10493. gensupport.SetOptions(c.urlParams_, opts...)
  10494. res, err := c.doRequest("json")
  10495. if res != nil && res.StatusCode == http.StatusNotModified {
  10496. if res.Body != nil {
  10497. res.Body.Close()
  10498. }
  10499. return nil, &googleapi.Error{
  10500. Code: res.StatusCode,
  10501. Header: res.Header,
  10502. }
  10503. }
  10504. if err != nil {
  10505. return nil, err
  10506. }
  10507. defer googleapi.CloseBody(res)
  10508. if err := googleapi.CheckResponse(res); err != nil {
  10509. return nil, err
  10510. }
  10511. ret := &ChannelSection{
  10512. ServerResponse: googleapi.ServerResponse{
  10513. Header: res.Header,
  10514. HTTPStatusCode: res.StatusCode,
  10515. },
  10516. }
  10517. target := &ret
  10518. if err := gensupport.DecodeResponse(target, res); err != nil {
  10519. return nil, err
  10520. }
  10521. return ret, nil
  10522. // {
  10523. // "description": "Update a channelSection.",
  10524. // "httpMethod": "PUT",
  10525. // "id": "youtube.channelSections.update",
  10526. // "parameterOrder": [
  10527. // "part"
  10528. // ],
  10529. // "parameters": {
  10530. // "onBehalfOfContentOwner": {
  10531. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  10532. // "location": "query",
  10533. // "type": "string"
  10534. // },
  10535. // "part": {
  10536. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part names that you can include in the parameter value are snippet and contentDetails.",
  10537. // "location": "query",
  10538. // "required": true,
  10539. // "type": "string"
  10540. // }
  10541. // },
  10542. // "path": "channelSections",
  10543. // "request": {
  10544. // "$ref": "ChannelSection"
  10545. // },
  10546. // "response": {
  10547. // "$ref": "ChannelSection"
  10548. // },
  10549. // "scopes": [
  10550. // "https://www.googleapis.com/auth/youtube",
  10551. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10552. // "https://www.googleapis.com/auth/youtubepartner"
  10553. // ]
  10554. // }
  10555. }
  10556. // method id "youtube.channels.list":
  10557. type ChannelsListCall struct {
  10558. s *Service
  10559. urlParams_ gensupport.URLParams
  10560. ifNoneMatch_ string
  10561. ctx_ context.Context
  10562. header_ http.Header
  10563. }
  10564. // List: Returns a collection of zero or more channel resources that
  10565. // match the request criteria.
  10566. func (r *ChannelsService) List(part string) *ChannelsListCall {
  10567. c := &ChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10568. c.urlParams_.Set("part", part)
  10569. return c
  10570. }
  10571. // CategoryId sets the optional parameter "categoryId": The categoryId
  10572. // parameter specifies a YouTube guide category, thereby requesting
  10573. // YouTube channels associated with that category.
  10574. func (c *ChannelsListCall) CategoryId(categoryId string) *ChannelsListCall {
  10575. c.urlParams_.Set("categoryId", categoryId)
  10576. return c
  10577. }
  10578. // ForUsername sets the optional parameter "forUsername": The
  10579. // forUsername parameter specifies a YouTube username, thereby
  10580. // requesting the channel associated with that username.
  10581. func (c *ChannelsListCall) ForUsername(forUsername string) *ChannelsListCall {
  10582. c.urlParams_.Set("forUsername", forUsername)
  10583. return c
  10584. }
  10585. // Hl sets the optional parameter "hl": The hl parameter should be used
  10586. // for filter out the properties that are not in the given language.
  10587. // Used for the brandingSettings part.
  10588. func (c *ChannelsListCall) Hl(hl string) *ChannelsListCall {
  10589. c.urlParams_.Set("hl", hl)
  10590. return c
  10591. }
  10592. // Id sets the optional parameter "id": The id parameter specifies a
  10593. // comma-separated list of the YouTube channel ID(s) for the resource(s)
  10594. // that are being retrieved. In a channel resource, the id property
  10595. // specifies the channel's YouTube channel ID.
  10596. func (c *ChannelsListCall) Id(id string) *ChannelsListCall {
  10597. c.urlParams_.Set("id", id)
  10598. return c
  10599. }
  10600. // ManagedByMe sets the optional parameter "managedByMe": Note: This
  10601. // parameter is intended exclusively for YouTube content partners.
  10602. //
  10603. // Set this parameter's value to true to instruct the API to only return
  10604. // channels managed by the content owner that the onBehalfOfContentOwner
  10605. // parameter specifies. The user must be authenticated as a CMS account
  10606. // linked to the specified content owner and onBehalfOfContentOwner must
  10607. // be provided.
  10608. func (c *ChannelsListCall) ManagedByMe(managedByMe bool) *ChannelsListCall {
  10609. c.urlParams_.Set("managedByMe", fmt.Sprint(managedByMe))
  10610. return c
  10611. }
  10612. // MaxResults sets the optional parameter "maxResults": The maxResults
  10613. // parameter specifies the maximum number of items that should be
  10614. // returned in the result set.
  10615. func (c *ChannelsListCall) MaxResults(maxResults int64) *ChannelsListCall {
  10616. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10617. return c
  10618. }
  10619. // Mine sets the optional parameter "mine": Set this parameter's value
  10620. // to true to instruct the API to only return channels owned by the
  10621. // authenticated user.
  10622. func (c *ChannelsListCall) Mine(mine bool) *ChannelsListCall {
  10623. c.urlParams_.Set("mine", fmt.Sprint(mine))
  10624. return c
  10625. }
  10626. // MySubscribers sets the optional parameter "mySubscribers": Use the
  10627. // subscriptions.list method and its mySubscribers parameter to retrieve
  10628. // a list of subscribers to the authenticated user's channel.
  10629. func (c *ChannelsListCall) MySubscribers(mySubscribers bool) *ChannelsListCall {
  10630. c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
  10631. return c
  10632. }
  10633. // OnBehalfOfContentOwner sets the optional parameter
  10634. // "onBehalfOfContentOwner": Note: This parameter is intended
  10635. // exclusively for YouTube content partners.
  10636. //
  10637. // The onBehalfOfContentOwner parameter indicates that the request's
  10638. // authorization credentials identify a YouTube CMS user who is acting
  10639. // on behalf of the content owner specified in the parameter value. This
  10640. // parameter is intended for YouTube content partners that own and
  10641. // manage many different YouTube channels. It allows content owners to
  10642. // authenticate once and get access to all their video and channel data,
  10643. // without having to provide authentication credentials for each
  10644. // individual channel. The CMS account that the user authenticates with
  10645. // must be linked to the specified YouTube content owner.
  10646. func (c *ChannelsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsListCall {
  10647. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10648. return c
  10649. }
  10650. // PageToken sets the optional parameter "pageToken": The pageToken
  10651. // parameter identifies a specific page in the result set that should be
  10652. // returned. In an API response, the nextPageToken and prevPageToken
  10653. // properties identify other pages that could be retrieved.
  10654. func (c *ChannelsListCall) PageToken(pageToken string) *ChannelsListCall {
  10655. c.urlParams_.Set("pageToken", pageToken)
  10656. return c
  10657. }
  10658. // Fields allows partial responses to be retrieved. See
  10659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10660. // for more information.
  10661. func (c *ChannelsListCall) Fields(s ...googleapi.Field) *ChannelsListCall {
  10662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10663. return c
  10664. }
  10665. // IfNoneMatch sets the optional parameter which makes the operation
  10666. // fail if the object's ETag matches the given value. This is useful for
  10667. // getting updates only after the object has changed since the last
  10668. // request. Use googleapi.IsNotModified to check whether the response
  10669. // error from Do is the result of In-None-Match.
  10670. func (c *ChannelsListCall) IfNoneMatch(entityTag string) *ChannelsListCall {
  10671. c.ifNoneMatch_ = entityTag
  10672. return c
  10673. }
  10674. // Context sets the context to be used in this call's Do method. Any
  10675. // pending HTTP request will be aborted if the provided context is
  10676. // canceled.
  10677. func (c *ChannelsListCall) Context(ctx context.Context) *ChannelsListCall {
  10678. c.ctx_ = ctx
  10679. return c
  10680. }
  10681. // Header returns an http.Header that can be modified by the caller to
  10682. // add HTTP headers to the request.
  10683. func (c *ChannelsListCall) Header() http.Header {
  10684. if c.header_ == nil {
  10685. c.header_ = make(http.Header)
  10686. }
  10687. return c.header_
  10688. }
  10689. func (c *ChannelsListCall) doRequest(alt string) (*http.Response, error) {
  10690. reqHeaders := make(http.Header)
  10691. for k, v := range c.header_ {
  10692. reqHeaders[k] = v
  10693. }
  10694. reqHeaders.Set("User-Agent", c.s.userAgent())
  10695. if c.ifNoneMatch_ != "" {
  10696. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10697. }
  10698. var body io.Reader = nil
  10699. c.urlParams_.Set("alt", alt)
  10700. c.urlParams_.Set("prettyPrint", "false")
  10701. urls := googleapi.ResolveRelative(c.s.BasePath, "channels")
  10702. urls += "?" + c.urlParams_.Encode()
  10703. req, err := http.NewRequest("GET", urls, body)
  10704. if err != nil {
  10705. return nil, err
  10706. }
  10707. req.Header = reqHeaders
  10708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10709. }
  10710. // Do executes the "youtube.channels.list" call.
  10711. // Exactly one of *ChannelListResponse or error will be non-nil. Any
  10712. // non-2xx status code is an error. Response headers are in either
  10713. // *ChannelListResponse.ServerResponse.Header or (if a response was
  10714. // returned at all) in error.(*googleapi.Error).Header. Use
  10715. // googleapi.IsNotModified to check whether the returned error was
  10716. // because http.StatusNotModified was returned.
  10717. func (c *ChannelsListCall) Do(opts ...googleapi.CallOption) (*ChannelListResponse, error) {
  10718. gensupport.SetOptions(c.urlParams_, opts...)
  10719. res, err := c.doRequest("json")
  10720. if res != nil && res.StatusCode == http.StatusNotModified {
  10721. if res.Body != nil {
  10722. res.Body.Close()
  10723. }
  10724. return nil, &googleapi.Error{
  10725. Code: res.StatusCode,
  10726. Header: res.Header,
  10727. }
  10728. }
  10729. if err != nil {
  10730. return nil, err
  10731. }
  10732. defer googleapi.CloseBody(res)
  10733. if err := googleapi.CheckResponse(res); err != nil {
  10734. return nil, err
  10735. }
  10736. ret := &ChannelListResponse{
  10737. ServerResponse: googleapi.ServerResponse{
  10738. Header: res.Header,
  10739. HTTPStatusCode: res.StatusCode,
  10740. },
  10741. }
  10742. target := &ret
  10743. if err := gensupport.DecodeResponse(target, res); err != nil {
  10744. return nil, err
  10745. }
  10746. return ret, nil
  10747. // {
  10748. // "description": "Returns a collection of zero or more channel resources that match the request criteria.",
  10749. // "httpMethod": "GET",
  10750. // "id": "youtube.channels.list",
  10751. // "parameterOrder": [
  10752. // "part"
  10753. // ],
  10754. // "parameters": {
  10755. // "categoryId": {
  10756. // "description": "The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category.",
  10757. // "location": "query",
  10758. // "type": "string"
  10759. // },
  10760. // "forUsername": {
  10761. // "description": "The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username.",
  10762. // "location": "query",
  10763. // "type": "string"
  10764. // },
  10765. // "hl": {
  10766. // "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part.",
  10767. // "location": "query",
  10768. // "type": "string"
  10769. // },
  10770. // "id": {
  10771. // "description": "The id parameter specifies a comma-separated list of the YouTube channel ID(s) for the resource(s) that are being retrieved. In a channel resource, the id property specifies the channel's YouTube channel ID.",
  10772. // "location": "query",
  10773. // "type": "string"
  10774. // },
  10775. // "managedByMe": {
  10776. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nSet this parameter's value to true to instruct the API to only return channels managed by the content owner that the onBehalfOfContentOwner parameter specifies. The user must be authenticated as a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.",
  10777. // "location": "query",
  10778. // "type": "boolean"
  10779. // },
  10780. // "maxResults": {
  10781. // "default": "5",
  10782. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  10783. // "format": "uint32",
  10784. // "location": "query",
  10785. // "maximum": "50",
  10786. // "minimum": "0",
  10787. // "type": "integer"
  10788. // },
  10789. // "mine": {
  10790. // "description": "Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user.",
  10791. // "location": "query",
  10792. // "type": "boolean"
  10793. // },
  10794. // "mySubscribers": {
  10795. // "description": "Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel.",
  10796. // "location": "query",
  10797. // "type": "boolean"
  10798. // },
  10799. // "onBehalfOfContentOwner": {
  10800. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  10801. // "location": "query",
  10802. // "type": "string"
  10803. // },
  10804. // "pageToken": {
  10805. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  10806. // "location": "query",
  10807. // "type": "string"
  10808. // },
  10809. // "part": {
  10810. // "description": "The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a channel resource, the contentDetails property contains other properties, such as the uploads properties. As such, if you set part=contentDetails, the API response will also contain all of those nested properties.",
  10811. // "location": "query",
  10812. // "required": true,
  10813. // "type": "string"
  10814. // }
  10815. // },
  10816. // "path": "channels",
  10817. // "response": {
  10818. // "$ref": "ChannelListResponse"
  10819. // },
  10820. // "scopes": [
  10821. // "https://www.googleapis.com/auth/youtube",
  10822. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10823. // "https://www.googleapis.com/auth/youtube.readonly",
  10824. // "https://www.googleapis.com/auth/youtubepartner",
  10825. // "https://www.googleapis.com/auth/youtubepartner-channel-audit"
  10826. // ]
  10827. // }
  10828. }
  10829. // Pages invokes f for each page of results.
  10830. // A non-nil error returned from f will halt the iteration.
  10831. // The provided context supersedes any context provided to the Context method.
  10832. func (c *ChannelsListCall) Pages(ctx context.Context, f func(*ChannelListResponse) error) error {
  10833. c.ctx_ = ctx
  10834. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10835. for {
  10836. x, err := c.Do()
  10837. if err != nil {
  10838. return err
  10839. }
  10840. if err := f(x); err != nil {
  10841. return err
  10842. }
  10843. if x.NextPageToken == "" {
  10844. return nil
  10845. }
  10846. c.PageToken(x.NextPageToken)
  10847. }
  10848. }
  10849. // method id "youtube.channels.update":
  10850. type ChannelsUpdateCall struct {
  10851. s *Service
  10852. channel *Channel
  10853. urlParams_ gensupport.URLParams
  10854. ctx_ context.Context
  10855. header_ http.Header
  10856. }
  10857. // Update: Updates a channel's metadata. Note that this method currently
  10858. // only supports updates to the channel resource's brandingSettings and
  10859. // invideoPromotion objects and their child properties.
  10860. func (r *ChannelsService) Update(part string, channel *Channel) *ChannelsUpdateCall {
  10861. c := &ChannelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10862. c.urlParams_.Set("part", part)
  10863. c.channel = channel
  10864. return c
  10865. }
  10866. // OnBehalfOfContentOwner sets the optional parameter
  10867. // "onBehalfOfContentOwner": The onBehalfOfContentOwner parameter
  10868. // indicates that the authenticated user is acting on behalf of the
  10869. // content owner specified in the parameter value. This parameter is
  10870. // intended for YouTube content partners that own and manage many
  10871. // different YouTube channels. It allows content owners to authenticate
  10872. // once and get access to all their video and channel data, without
  10873. // having to provide authentication credentials for each individual
  10874. // channel. The actual CMS account that the user authenticates with
  10875. // needs to be linked to the specified YouTube content owner.
  10876. func (c *ChannelsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsUpdateCall {
  10877. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10878. return c
  10879. }
  10880. // Fields allows partial responses to be retrieved. See
  10881. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10882. // for more information.
  10883. func (c *ChannelsUpdateCall) Fields(s ...googleapi.Field) *ChannelsUpdateCall {
  10884. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10885. return c
  10886. }
  10887. // Context sets the context to be used in this call's Do method. Any
  10888. // pending HTTP request will be aborted if the provided context is
  10889. // canceled.
  10890. func (c *ChannelsUpdateCall) Context(ctx context.Context) *ChannelsUpdateCall {
  10891. c.ctx_ = ctx
  10892. return c
  10893. }
  10894. // Header returns an http.Header that can be modified by the caller to
  10895. // add HTTP headers to the request.
  10896. func (c *ChannelsUpdateCall) Header() http.Header {
  10897. if c.header_ == nil {
  10898. c.header_ = make(http.Header)
  10899. }
  10900. return c.header_
  10901. }
  10902. func (c *ChannelsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10903. reqHeaders := make(http.Header)
  10904. for k, v := range c.header_ {
  10905. reqHeaders[k] = v
  10906. }
  10907. reqHeaders.Set("User-Agent", c.s.userAgent())
  10908. var body io.Reader = nil
  10909. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  10910. if err != nil {
  10911. return nil, err
  10912. }
  10913. reqHeaders.Set("Content-Type", "application/json")
  10914. c.urlParams_.Set("alt", alt)
  10915. c.urlParams_.Set("prettyPrint", "false")
  10916. urls := googleapi.ResolveRelative(c.s.BasePath, "channels")
  10917. urls += "?" + c.urlParams_.Encode()
  10918. req, err := http.NewRequest("PUT", urls, body)
  10919. if err != nil {
  10920. return nil, err
  10921. }
  10922. req.Header = reqHeaders
  10923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10924. }
  10925. // Do executes the "youtube.channels.update" call.
  10926. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  10927. // code is an error. Response headers are in either
  10928. // *Channel.ServerResponse.Header or (if a response was returned at all)
  10929. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10930. // check whether the returned error was because http.StatusNotModified
  10931. // was returned.
  10932. func (c *ChannelsUpdateCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  10933. gensupport.SetOptions(c.urlParams_, opts...)
  10934. res, err := c.doRequest("json")
  10935. if res != nil && res.StatusCode == http.StatusNotModified {
  10936. if res.Body != nil {
  10937. res.Body.Close()
  10938. }
  10939. return nil, &googleapi.Error{
  10940. Code: res.StatusCode,
  10941. Header: res.Header,
  10942. }
  10943. }
  10944. if err != nil {
  10945. return nil, err
  10946. }
  10947. defer googleapi.CloseBody(res)
  10948. if err := googleapi.CheckResponse(res); err != nil {
  10949. return nil, err
  10950. }
  10951. ret := &Channel{
  10952. ServerResponse: googleapi.ServerResponse{
  10953. Header: res.Header,
  10954. HTTPStatusCode: res.StatusCode,
  10955. },
  10956. }
  10957. target := &ret
  10958. if err := gensupport.DecodeResponse(target, res); err != nil {
  10959. return nil, err
  10960. }
  10961. return ret, nil
  10962. // {
  10963. // "description": "Updates a channel's metadata. Note that this method currently only supports updates to the channel resource's brandingSettings and invideoPromotion objects and their child properties.",
  10964. // "httpMethod": "PUT",
  10965. // "id": "youtube.channels.update",
  10966. // "parameterOrder": [
  10967. // "part"
  10968. // ],
  10969. // "parameters": {
  10970. // "onBehalfOfContentOwner": {
  10971. // "description": "The onBehalfOfContentOwner parameter indicates that the authenticated user is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with needs to be linked to the specified YouTube content owner.",
  10972. // "location": "query",
  10973. // "type": "string"
  10974. // },
  10975. // "part": {
  10976. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe API currently only allows the parameter value to be set to either brandingSettings or invideoPromotion. (You cannot update both of those parts with a single request.)\n\nNote that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.",
  10977. // "location": "query",
  10978. // "required": true,
  10979. // "type": "string"
  10980. // }
  10981. // },
  10982. // "path": "channels",
  10983. // "request": {
  10984. // "$ref": "Channel"
  10985. // },
  10986. // "response": {
  10987. // "$ref": "Channel"
  10988. // },
  10989. // "scopes": [
  10990. // "https://www.googleapis.com/auth/youtube",
  10991. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10992. // "https://www.googleapis.com/auth/youtubepartner"
  10993. // ]
  10994. // }
  10995. }
  10996. // method id "youtube.commentThreads.insert":
  10997. type CommentThreadsInsertCall struct {
  10998. s *Service
  10999. commentthread *CommentThread
  11000. urlParams_ gensupport.URLParams
  11001. ctx_ context.Context
  11002. header_ http.Header
  11003. }
  11004. // Insert: Creates a new top-level comment. To add a reply to an
  11005. // existing comment, use the comments.insert method instead.
  11006. func (r *CommentThreadsService) Insert(part string, commentthread *CommentThread) *CommentThreadsInsertCall {
  11007. c := &CommentThreadsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11008. c.urlParams_.Set("part", part)
  11009. c.commentthread = commentthread
  11010. return c
  11011. }
  11012. // Fields allows partial responses to be retrieved. See
  11013. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11014. // for more information.
  11015. func (c *CommentThreadsInsertCall) Fields(s ...googleapi.Field) *CommentThreadsInsertCall {
  11016. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11017. return c
  11018. }
  11019. // Context sets the context to be used in this call's Do method. Any
  11020. // pending HTTP request will be aborted if the provided context is
  11021. // canceled.
  11022. func (c *CommentThreadsInsertCall) Context(ctx context.Context) *CommentThreadsInsertCall {
  11023. c.ctx_ = ctx
  11024. return c
  11025. }
  11026. // Header returns an http.Header that can be modified by the caller to
  11027. // add HTTP headers to the request.
  11028. func (c *CommentThreadsInsertCall) Header() http.Header {
  11029. if c.header_ == nil {
  11030. c.header_ = make(http.Header)
  11031. }
  11032. return c.header_
  11033. }
  11034. func (c *CommentThreadsInsertCall) doRequest(alt string) (*http.Response, error) {
  11035. reqHeaders := make(http.Header)
  11036. for k, v := range c.header_ {
  11037. reqHeaders[k] = v
  11038. }
  11039. reqHeaders.Set("User-Agent", c.s.userAgent())
  11040. var body io.Reader = nil
  11041. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread)
  11042. if err != nil {
  11043. return nil, err
  11044. }
  11045. reqHeaders.Set("Content-Type", "application/json")
  11046. c.urlParams_.Set("alt", alt)
  11047. c.urlParams_.Set("prettyPrint", "false")
  11048. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  11049. urls += "?" + c.urlParams_.Encode()
  11050. req, err := http.NewRequest("POST", urls, body)
  11051. if err != nil {
  11052. return nil, err
  11053. }
  11054. req.Header = reqHeaders
  11055. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11056. }
  11057. // Do executes the "youtube.commentThreads.insert" call.
  11058. // Exactly one of *CommentThread or error will be non-nil. Any non-2xx
  11059. // status code is an error. Response headers are in either
  11060. // *CommentThread.ServerResponse.Header or (if a response was returned
  11061. // at all) in error.(*googleapi.Error).Header. Use
  11062. // googleapi.IsNotModified to check whether the returned error was
  11063. // because http.StatusNotModified was returned.
  11064. func (c *CommentThreadsInsertCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
  11065. gensupport.SetOptions(c.urlParams_, opts...)
  11066. res, err := c.doRequest("json")
  11067. if res != nil && res.StatusCode == http.StatusNotModified {
  11068. if res.Body != nil {
  11069. res.Body.Close()
  11070. }
  11071. return nil, &googleapi.Error{
  11072. Code: res.StatusCode,
  11073. Header: res.Header,
  11074. }
  11075. }
  11076. if err != nil {
  11077. return nil, err
  11078. }
  11079. defer googleapi.CloseBody(res)
  11080. if err := googleapi.CheckResponse(res); err != nil {
  11081. return nil, err
  11082. }
  11083. ret := &CommentThread{
  11084. ServerResponse: googleapi.ServerResponse{
  11085. Header: res.Header,
  11086. HTTPStatusCode: res.StatusCode,
  11087. },
  11088. }
  11089. target := &ret
  11090. if err := gensupport.DecodeResponse(target, res); err != nil {
  11091. return nil, err
  11092. }
  11093. return ret, nil
  11094. // {
  11095. // "description": "Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.",
  11096. // "httpMethod": "POST",
  11097. // "id": "youtube.commentThreads.insert",
  11098. // "parameterOrder": [
  11099. // "part"
  11100. // ],
  11101. // "parameters": {
  11102. // "part": {
  11103. // "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.",
  11104. // "location": "query",
  11105. // "required": true,
  11106. // "type": "string"
  11107. // }
  11108. // },
  11109. // "path": "commentThreads",
  11110. // "request": {
  11111. // "$ref": "CommentThread"
  11112. // },
  11113. // "response": {
  11114. // "$ref": "CommentThread"
  11115. // },
  11116. // "scopes": [
  11117. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11118. // ]
  11119. // }
  11120. }
  11121. // method id "youtube.commentThreads.list":
  11122. type CommentThreadsListCall struct {
  11123. s *Service
  11124. urlParams_ gensupport.URLParams
  11125. ifNoneMatch_ string
  11126. ctx_ context.Context
  11127. header_ http.Header
  11128. }
  11129. // List: Returns a list of comment threads that match the API request
  11130. // parameters.
  11131. func (r *CommentThreadsService) List(part string) *CommentThreadsListCall {
  11132. c := &CommentThreadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11133. c.urlParams_.Set("part", part)
  11134. return c
  11135. }
  11136. // AllThreadsRelatedToChannelId sets the optional parameter
  11137. // "allThreadsRelatedToChannelId": The allThreadsRelatedToChannelId
  11138. // parameter instructs the API to return all comment threads associated
  11139. // with the specified channel. The response can include comments about
  11140. // the channel or about the channel's videos.
  11141. func (c *CommentThreadsListCall) AllThreadsRelatedToChannelId(allThreadsRelatedToChannelId string) *CommentThreadsListCall {
  11142. c.urlParams_.Set("allThreadsRelatedToChannelId", allThreadsRelatedToChannelId)
  11143. return c
  11144. }
  11145. // ChannelId sets the optional parameter "channelId": The channelId
  11146. // parameter instructs the API to return comment threads containing
  11147. // comments about the specified channel. (The response will not include
  11148. // comments left on videos that the channel uploaded.)
  11149. func (c *CommentThreadsListCall) ChannelId(channelId string) *CommentThreadsListCall {
  11150. c.urlParams_.Set("channelId", channelId)
  11151. return c
  11152. }
  11153. // Id sets the optional parameter "id": The id parameter specifies a
  11154. // comma-separated list of comment thread IDs for the resources that
  11155. // should be retrieved.
  11156. func (c *CommentThreadsListCall) Id(id string) *CommentThreadsListCall {
  11157. c.urlParams_.Set("id", id)
  11158. return c
  11159. }
  11160. // MaxResults sets the optional parameter "maxResults": The maxResults
  11161. // parameter specifies the maximum number of items that should be
  11162. // returned in the result set.
  11163. //
  11164. // Note: This parameter is not supported for use in conjunction with the
  11165. // id parameter.
  11166. func (c *CommentThreadsListCall) MaxResults(maxResults int64) *CommentThreadsListCall {
  11167. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11168. return c
  11169. }
  11170. // ModerationStatus sets the optional parameter "moderationStatus": Set
  11171. // this parameter to limit the returned comment threads to a particular
  11172. // moderation state.
  11173. //
  11174. // Note: This parameter is not supported for use in conjunction with the
  11175. // id parameter.
  11176. //
  11177. // Possible values:
  11178. // "heldForReview" - Retrieve comment threads that are awaiting review
  11179. // by a moderator. A comment thread can be included in the response if
  11180. // the top-level comment or at least one of the replies to that comment
  11181. // are awaiting review.
  11182. // "likelySpam" - Retrieve comment threads classified as likely to be
  11183. // spam. A comment thread can be included in the response if the
  11184. // top-level comment or at least one of the replies to that comment is
  11185. // considered likely to be spam.
  11186. // "published" - Retrieve threads of published comments. This is the
  11187. // default value. A comment thread can be included in the response if
  11188. // its top-level comment has been published.
  11189. func (c *CommentThreadsListCall) ModerationStatus(moderationStatus string) *CommentThreadsListCall {
  11190. c.urlParams_.Set("moderationStatus", moderationStatus)
  11191. return c
  11192. }
  11193. // Order sets the optional parameter "order": The order parameter
  11194. // specifies the order in which the API response should list comment
  11195. // threads. Valid values are:
  11196. // - time - Comment threads are ordered by time. This is the default
  11197. // behavior.
  11198. // - relevance - Comment threads are ordered by relevance.Note: This
  11199. // parameter is not supported for use in conjunction with the id
  11200. // parameter.
  11201. //
  11202. // Possible values:
  11203. // "relevance" - Order by relevance.
  11204. // "time" - Order by time.
  11205. func (c *CommentThreadsListCall) Order(order string) *CommentThreadsListCall {
  11206. c.urlParams_.Set("order", order)
  11207. return c
  11208. }
  11209. // PageToken sets the optional parameter "pageToken": The pageToken
  11210. // parameter identifies a specific page in the result set that should be
  11211. // returned. In an API response, the nextPageToken property identifies
  11212. // the next page of the result that can be retrieved.
  11213. //
  11214. // Note: This parameter is not supported for use in conjunction with the
  11215. // id parameter.
  11216. func (c *CommentThreadsListCall) PageToken(pageToken string) *CommentThreadsListCall {
  11217. c.urlParams_.Set("pageToken", pageToken)
  11218. return c
  11219. }
  11220. // SearchTerms sets the optional parameter "searchTerms": The
  11221. // searchTerms parameter instructs the API to limit the API response to
  11222. // only contain comments that contain the specified search terms.
  11223. //
  11224. // Note: This parameter is not supported for use in conjunction with the
  11225. // id parameter.
  11226. func (c *CommentThreadsListCall) SearchTerms(searchTerms string) *CommentThreadsListCall {
  11227. c.urlParams_.Set("searchTerms", searchTerms)
  11228. return c
  11229. }
  11230. // TextFormat sets the optional parameter "textFormat": Set this
  11231. // parameter's value to html or plainText to instruct the API to return
  11232. // the comments left by users in html formatted or in plain text.
  11233. //
  11234. // Possible values:
  11235. // "html" - Returns the comments in HTML format. This is the default
  11236. // value.
  11237. // "plainText" - Returns the comments in plain text format.
  11238. func (c *CommentThreadsListCall) TextFormat(textFormat string) *CommentThreadsListCall {
  11239. c.urlParams_.Set("textFormat", textFormat)
  11240. return c
  11241. }
  11242. // VideoId sets the optional parameter "videoId": The videoId parameter
  11243. // instructs the API to return comment threads associated with the
  11244. // specified video ID.
  11245. func (c *CommentThreadsListCall) VideoId(videoId string) *CommentThreadsListCall {
  11246. c.urlParams_.Set("videoId", videoId)
  11247. return c
  11248. }
  11249. // Fields allows partial responses to be retrieved. See
  11250. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11251. // for more information.
  11252. func (c *CommentThreadsListCall) Fields(s ...googleapi.Field) *CommentThreadsListCall {
  11253. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11254. return c
  11255. }
  11256. // IfNoneMatch sets the optional parameter which makes the operation
  11257. // fail if the object's ETag matches the given value. This is useful for
  11258. // getting updates only after the object has changed since the last
  11259. // request. Use googleapi.IsNotModified to check whether the response
  11260. // error from Do is the result of In-None-Match.
  11261. func (c *CommentThreadsListCall) IfNoneMatch(entityTag string) *CommentThreadsListCall {
  11262. c.ifNoneMatch_ = entityTag
  11263. return c
  11264. }
  11265. // Context sets the context to be used in this call's Do method. Any
  11266. // pending HTTP request will be aborted if the provided context is
  11267. // canceled.
  11268. func (c *CommentThreadsListCall) Context(ctx context.Context) *CommentThreadsListCall {
  11269. c.ctx_ = ctx
  11270. return c
  11271. }
  11272. // Header returns an http.Header that can be modified by the caller to
  11273. // add HTTP headers to the request.
  11274. func (c *CommentThreadsListCall) Header() http.Header {
  11275. if c.header_ == nil {
  11276. c.header_ = make(http.Header)
  11277. }
  11278. return c.header_
  11279. }
  11280. func (c *CommentThreadsListCall) doRequest(alt string) (*http.Response, error) {
  11281. reqHeaders := make(http.Header)
  11282. for k, v := range c.header_ {
  11283. reqHeaders[k] = v
  11284. }
  11285. reqHeaders.Set("User-Agent", c.s.userAgent())
  11286. if c.ifNoneMatch_ != "" {
  11287. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11288. }
  11289. var body io.Reader = nil
  11290. c.urlParams_.Set("alt", alt)
  11291. c.urlParams_.Set("prettyPrint", "false")
  11292. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  11293. urls += "?" + c.urlParams_.Encode()
  11294. req, err := http.NewRequest("GET", urls, body)
  11295. if err != nil {
  11296. return nil, err
  11297. }
  11298. req.Header = reqHeaders
  11299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11300. }
  11301. // Do executes the "youtube.commentThreads.list" call.
  11302. // Exactly one of *CommentThreadListResponse or error will be non-nil.
  11303. // Any non-2xx status code is an error. Response headers are in either
  11304. // *CommentThreadListResponse.ServerResponse.Header or (if a response
  11305. // was returned at all) in error.(*googleapi.Error).Header. Use
  11306. // googleapi.IsNotModified to check whether the returned error was
  11307. // because http.StatusNotModified was returned.
  11308. func (c *CommentThreadsListCall) Do(opts ...googleapi.CallOption) (*CommentThreadListResponse, error) {
  11309. gensupport.SetOptions(c.urlParams_, opts...)
  11310. res, err := c.doRequest("json")
  11311. if res != nil && res.StatusCode == http.StatusNotModified {
  11312. if res.Body != nil {
  11313. res.Body.Close()
  11314. }
  11315. return nil, &googleapi.Error{
  11316. Code: res.StatusCode,
  11317. Header: res.Header,
  11318. }
  11319. }
  11320. if err != nil {
  11321. return nil, err
  11322. }
  11323. defer googleapi.CloseBody(res)
  11324. if err := googleapi.CheckResponse(res); err != nil {
  11325. return nil, err
  11326. }
  11327. ret := &CommentThreadListResponse{
  11328. ServerResponse: googleapi.ServerResponse{
  11329. Header: res.Header,
  11330. HTTPStatusCode: res.StatusCode,
  11331. },
  11332. }
  11333. target := &ret
  11334. if err := gensupport.DecodeResponse(target, res); err != nil {
  11335. return nil, err
  11336. }
  11337. return ret, nil
  11338. // {
  11339. // "description": "Returns a list of comment threads that match the API request parameters.",
  11340. // "httpMethod": "GET",
  11341. // "id": "youtube.commentThreads.list",
  11342. // "parameterOrder": [
  11343. // "part"
  11344. // ],
  11345. // "parameters": {
  11346. // "allThreadsRelatedToChannelId": {
  11347. // "description": "The allThreadsRelatedToChannelId parameter instructs the API to return all comment threads associated with the specified channel. The response can include comments about the channel or about the channel's videos.",
  11348. // "location": "query",
  11349. // "type": "string"
  11350. // },
  11351. // "channelId": {
  11352. // "description": "The channelId parameter instructs the API to return comment threads containing comments about the specified channel. (The response will not include comments left on videos that the channel uploaded.)",
  11353. // "location": "query",
  11354. // "type": "string"
  11355. // },
  11356. // "id": {
  11357. // "description": "The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved.",
  11358. // "location": "query",
  11359. // "type": "string"
  11360. // },
  11361. // "maxResults": {
  11362. // "default": "20",
  11363. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  11364. // "format": "uint32",
  11365. // "location": "query",
  11366. // "maximum": "100",
  11367. // "minimum": "1",
  11368. // "type": "integer"
  11369. // },
  11370. // "moderationStatus": {
  11371. // "default": "MODERATION_STATUS_PUBLISHED",
  11372. // "description": "Set this parameter to limit the returned comment threads to a particular moderation state.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  11373. // "enum": [
  11374. // "heldForReview",
  11375. // "likelySpam",
  11376. // "published"
  11377. // ],
  11378. // "enumDescriptions": [
  11379. // "Retrieve comment threads that are awaiting review by a moderator. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment are awaiting review.",
  11380. // "Retrieve comment threads classified as likely to be spam. A comment thread can be included in the response if the top-level comment or at least one of the replies to that comment is considered likely to be spam.",
  11381. // "Retrieve threads of published comments. This is the default value. A comment thread can be included in the response if its top-level comment has been published."
  11382. // ],
  11383. // "location": "query",
  11384. // "type": "string"
  11385. // },
  11386. // "order": {
  11387. // "default": "true",
  11388. // "description": "The order parameter specifies the order in which the API response should list comment threads. Valid values are: \n- time - Comment threads are ordered by time. This is the default behavior.\n- relevance - Comment threads are ordered by relevance.Note: This parameter is not supported for use in conjunction with the id parameter.",
  11389. // "enum": [
  11390. // "relevance",
  11391. // "time"
  11392. // ],
  11393. // "enumDescriptions": [
  11394. // "Order by relevance.",
  11395. // "Order by time."
  11396. // ],
  11397. // "location": "query",
  11398. // "type": "string"
  11399. // },
  11400. // "pageToken": {
  11401. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  11402. // "location": "query",
  11403. // "type": "string"
  11404. // },
  11405. // "part": {
  11406. // "description": "The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.",
  11407. // "location": "query",
  11408. // "required": true,
  11409. // "type": "string"
  11410. // },
  11411. // "searchTerms": {
  11412. // "description": "The searchTerms parameter instructs the API to limit the API response to only contain comments that contain the specified search terms.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  11413. // "location": "query",
  11414. // "type": "string"
  11415. // },
  11416. // "textFormat": {
  11417. // "default": "FORMAT_HTML",
  11418. // "description": "Set this parameter's value to html or plainText to instruct the API to return the comments left by users in html formatted or in plain text.",
  11419. // "enum": [
  11420. // "html",
  11421. // "plainText"
  11422. // ],
  11423. // "enumDescriptions": [
  11424. // "Returns the comments in HTML format. This is the default value.",
  11425. // "Returns the comments in plain text format."
  11426. // ],
  11427. // "location": "query",
  11428. // "type": "string"
  11429. // },
  11430. // "videoId": {
  11431. // "description": "The videoId parameter instructs the API to return comment threads associated with the specified video ID.",
  11432. // "location": "query",
  11433. // "type": "string"
  11434. // }
  11435. // },
  11436. // "path": "commentThreads",
  11437. // "response": {
  11438. // "$ref": "CommentThreadListResponse"
  11439. // },
  11440. // "scopes": [
  11441. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11442. // ]
  11443. // }
  11444. }
  11445. // Pages invokes f for each page of results.
  11446. // A non-nil error returned from f will halt the iteration.
  11447. // The provided context supersedes any context provided to the Context method.
  11448. func (c *CommentThreadsListCall) Pages(ctx context.Context, f func(*CommentThreadListResponse) error) error {
  11449. c.ctx_ = ctx
  11450. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11451. for {
  11452. x, err := c.Do()
  11453. if err != nil {
  11454. return err
  11455. }
  11456. if err := f(x); err != nil {
  11457. return err
  11458. }
  11459. if x.NextPageToken == "" {
  11460. return nil
  11461. }
  11462. c.PageToken(x.NextPageToken)
  11463. }
  11464. }
  11465. // method id "youtube.commentThreads.update":
  11466. type CommentThreadsUpdateCall struct {
  11467. s *Service
  11468. commentthread *CommentThread
  11469. urlParams_ gensupport.URLParams
  11470. ctx_ context.Context
  11471. header_ http.Header
  11472. }
  11473. // Update: Modifies the top-level comment in a comment thread.
  11474. func (r *CommentThreadsService) Update(part string, commentthread *CommentThread) *CommentThreadsUpdateCall {
  11475. c := &CommentThreadsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11476. c.urlParams_.Set("part", part)
  11477. c.commentthread = commentthread
  11478. return c
  11479. }
  11480. // Fields allows partial responses to be retrieved. See
  11481. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11482. // for more information.
  11483. func (c *CommentThreadsUpdateCall) Fields(s ...googleapi.Field) *CommentThreadsUpdateCall {
  11484. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11485. return c
  11486. }
  11487. // Context sets the context to be used in this call's Do method. Any
  11488. // pending HTTP request will be aborted if the provided context is
  11489. // canceled.
  11490. func (c *CommentThreadsUpdateCall) Context(ctx context.Context) *CommentThreadsUpdateCall {
  11491. c.ctx_ = ctx
  11492. return c
  11493. }
  11494. // Header returns an http.Header that can be modified by the caller to
  11495. // add HTTP headers to the request.
  11496. func (c *CommentThreadsUpdateCall) Header() http.Header {
  11497. if c.header_ == nil {
  11498. c.header_ = make(http.Header)
  11499. }
  11500. return c.header_
  11501. }
  11502. func (c *CommentThreadsUpdateCall) doRequest(alt string) (*http.Response, error) {
  11503. reqHeaders := make(http.Header)
  11504. for k, v := range c.header_ {
  11505. reqHeaders[k] = v
  11506. }
  11507. reqHeaders.Set("User-Agent", c.s.userAgent())
  11508. var body io.Reader = nil
  11509. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread)
  11510. if err != nil {
  11511. return nil, err
  11512. }
  11513. reqHeaders.Set("Content-Type", "application/json")
  11514. c.urlParams_.Set("alt", alt)
  11515. c.urlParams_.Set("prettyPrint", "false")
  11516. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  11517. urls += "?" + c.urlParams_.Encode()
  11518. req, err := http.NewRequest("PUT", urls, body)
  11519. if err != nil {
  11520. return nil, err
  11521. }
  11522. req.Header = reqHeaders
  11523. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11524. }
  11525. // Do executes the "youtube.commentThreads.update" call.
  11526. // Exactly one of *CommentThread or error will be non-nil. Any non-2xx
  11527. // status code is an error. Response headers are in either
  11528. // *CommentThread.ServerResponse.Header or (if a response was returned
  11529. // at all) in error.(*googleapi.Error).Header. Use
  11530. // googleapi.IsNotModified to check whether the returned error was
  11531. // because http.StatusNotModified was returned.
  11532. func (c *CommentThreadsUpdateCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
  11533. gensupport.SetOptions(c.urlParams_, opts...)
  11534. res, err := c.doRequest("json")
  11535. if res != nil && res.StatusCode == http.StatusNotModified {
  11536. if res.Body != nil {
  11537. res.Body.Close()
  11538. }
  11539. return nil, &googleapi.Error{
  11540. Code: res.StatusCode,
  11541. Header: res.Header,
  11542. }
  11543. }
  11544. if err != nil {
  11545. return nil, err
  11546. }
  11547. defer googleapi.CloseBody(res)
  11548. if err := googleapi.CheckResponse(res); err != nil {
  11549. return nil, err
  11550. }
  11551. ret := &CommentThread{
  11552. ServerResponse: googleapi.ServerResponse{
  11553. Header: res.Header,
  11554. HTTPStatusCode: res.StatusCode,
  11555. },
  11556. }
  11557. target := &ret
  11558. if err := gensupport.DecodeResponse(target, res); err != nil {
  11559. return nil, err
  11560. }
  11561. return ret, nil
  11562. // {
  11563. // "description": "Modifies the top-level comment in a comment thread.",
  11564. // "httpMethod": "PUT",
  11565. // "id": "youtube.commentThreads.update",
  11566. // "parameterOrder": [
  11567. // "part"
  11568. // ],
  11569. // "parameters": {
  11570. // "part": {
  11571. // "description": "The part parameter specifies a comma-separated list of commentThread resource properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.",
  11572. // "location": "query",
  11573. // "required": true,
  11574. // "type": "string"
  11575. // }
  11576. // },
  11577. // "path": "commentThreads",
  11578. // "request": {
  11579. // "$ref": "CommentThread"
  11580. // },
  11581. // "response": {
  11582. // "$ref": "CommentThread"
  11583. // },
  11584. // "scopes": [
  11585. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11586. // ]
  11587. // }
  11588. }
  11589. // method id "youtube.comments.delete":
  11590. type CommentsDeleteCall struct {
  11591. s *Service
  11592. urlParams_ gensupport.URLParams
  11593. ctx_ context.Context
  11594. header_ http.Header
  11595. }
  11596. // Delete: Deletes a comment.
  11597. func (r *CommentsService) Delete(id string) *CommentsDeleteCall {
  11598. c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11599. c.urlParams_.Set("id", id)
  11600. return c
  11601. }
  11602. // Fields allows partial responses to be retrieved. See
  11603. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11604. // for more information.
  11605. func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
  11606. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11607. return c
  11608. }
  11609. // Context sets the context to be used in this call's Do method. Any
  11610. // pending HTTP request will be aborted if the provided context is
  11611. // canceled.
  11612. func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
  11613. c.ctx_ = ctx
  11614. return c
  11615. }
  11616. // Header returns an http.Header that can be modified by the caller to
  11617. // add HTTP headers to the request.
  11618. func (c *CommentsDeleteCall) Header() http.Header {
  11619. if c.header_ == nil {
  11620. c.header_ = make(http.Header)
  11621. }
  11622. return c.header_
  11623. }
  11624. func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11625. reqHeaders := make(http.Header)
  11626. for k, v := range c.header_ {
  11627. reqHeaders[k] = v
  11628. }
  11629. reqHeaders.Set("User-Agent", c.s.userAgent())
  11630. var body io.Reader = nil
  11631. c.urlParams_.Set("alt", alt)
  11632. c.urlParams_.Set("prettyPrint", "false")
  11633. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  11634. urls += "?" + c.urlParams_.Encode()
  11635. req, err := http.NewRequest("DELETE", urls, body)
  11636. if err != nil {
  11637. return nil, err
  11638. }
  11639. req.Header = reqHeaders
  11640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11641. }
  11642. // Do executes the "youtube.comments.delete" call.
  11643. func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  11644. gensupport.SetOptions(c.urlParams_, opts...)
  11645. res, err := c.doRequest("json")
  11646. if err != nil {
  11647. return err
  11648. }
  11649. defer googleapi.CloseBody(res)
  11650. if err := googleapi.CheckResponse(res); err != nil {
  11651. return err
  11652. }
  11653. return nil
  11654. // {
  11655. // "description": "Deletes a comment.",
  11656. // "httpMethod": "DELETE",
  11657. // "id": "youtube.comments.delete",
  11658. // "parameterOrder": [
  11659. // "id"
  11660. // ],
  11661. // "parameters": {
  11662. // "id": {
  11663. // "description": "The id parameter specifies the comment ID for the resource that is being deleted.",
  11664. // "location": "query",
  11665. // "required": true,
  11666. // "type": "string"
  11667. // }
  11668. // },
  11669. // "path": "comments",
  11670. // "scopes": [
  11671. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11672. // ]
  11673. // }
  11674. }
  11675. // method id "youtube.comments.insert":
  11676. type CommentsInsertCall struct {
  11677. s *Service
  11678. comment *Comment
  11679. urlParams_ gensupport.URLParams
  11680. ctx_ context.Context
  11681. header_ http.Header
  11682. }
  11683. // Insert: Creates a reply to an existing comment. Note: To create a
  11684. // top-level comment, use the commentThreads.insert method.
  11685. func (r *CommentsService) Insert(part string, comment *Comment) *CommentsInsertCall {
  11686. c := &CommentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11687. c.urlParams_.Set("part", part)
  11688. c.comment = comment
  11689. return c
  11690. }
  11691. // Fields allows partial responses to be retrieved. See
  11692. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11693. // for more information.
  11694. func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall {
  11695. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11696. return c
  11697. }
  11698. // Context sets the context to be used in this call's Do method. Any
  11699. // pending HTTP request will be aborted if the provided context is
  11700. // canceled.
  11701. func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall {
  11702. c.ctx_ = ctx
  11703. return c
  11704. }
  11705. // Header returns an http.Header that can be modified by the caller to
  11706. // add HTTP headers to the request.
  11707. func (c *CommentsInsertCall) Header() http.Header {
  11708. if c.header_ == nil {
  11709. c.header_ = make(http.Header)
  11710. }
  11711. return c.header_
  11712. }
  11713. func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) {
  11714. reqHeaders := make(http.Header)
  11715. for k, v := range c.header_ {
  11716. reqHeaders[k] = v
  11717. }
  11718. reqHeaders.Set("User-Agent", c.s.userAgent())
  11719. var body io.Reader = nil
  11720. body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  11721. if err != nil {
  11722. return nil, err
  11723. }
  11724. reqHeaders.Set("Content-Type", "application/json")
  11725. c.urlParams_.Set("alt", alt)
  11726. c.urlParams_.Set("prettyPrint", "false")
  11727. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  11728. urls += "?" + c.urlParams_.Encode()
  11729. req, err := http.NewRequest("POST", urls, body)
  11730. if err != nil {
  11731. return nil, err
  11732. }
  11733. req.Header = reqHeaders
  11734. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11735. }
  11736. // Do executes the "youtube.comments.insert" call.
  11737. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  11738. // code is an error. Response headers are in either
  11739. // *Comment.ServerResponse.Header or (if a response was returned at all)
  11740. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11741. // check whether the returned error was because http.StatusNotModified
  11742. // was returned.
  11743. func (c *CommentsInsertCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  11744. gensupport.SetOptions(c.urlParams_, opts...)
  11745. res, err := c.doRequest("json")
  11746. if res != nil && res.StatusCode == http.StatusNotModified {
  11747. if res.Body != nil {
  11748. res.Body.Close()
  11749. }
  11750. return nil, &googleapi.Error{
  11751. Code: res.StatusCode,
  11752. Header: res.Header,
  11753. }
  11754. }
  11755. if err != nil {
  11756. return nil, err
  11757. }
  11758. defer googleapi.CloseBody(res)
  11759. if err := googleapi.CheckResponse(res); err != nil {
  11760. return nil, err
  11761. }
  11762. ret := &Comment{
  11763. ServerResponse: googleapi.ServerResponse{
  11764. Header: res.Header,
  11765. HTTPStatusCode: res.StatusCode,
  11766. },
  11767. }
  11768. target := &ret
  11769. if err := gensupport.DecodeResponse(target, res); err != nil {
  11770. return nil, err
  11771. }
  11772. return ret, nil
  11773. // {
  11774. // "description": "Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.",
  11775. // "httpMethod": "POST",
  11776. // "id": "youtube.comments.insert",
  11777. // "parameterOrder": [
  11778. // "part"
  11779. // ],
  11780. // "parameters": {
  11781. // "part": {
  11782. // "description": "The part parameter identifies the properties that the API response will include. Set the parameter value to snippet. The snippet part has a quota cost of 2 units.",
  11783. // "location": "query",
  11784. // "required": true,
  11785. // "type": "string"
  11786. // }
  11787. // },
  11788. // "path": "comments",
  11789. // "request": {
  11790. // "$ref": "Comment"
  11791. // },
  11792. // "response": {
  11793. // "$ref": "Comment"
  11794. // },
  11795. // "scopes": [
  11796. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11797. // ]
  11798. // }
  11799. }
  11800. // method id "youtube.comments.list":
  11801. type CommentsListCall struct {
  11802. s *Service
  11803. urlParams_ gensupport.URLParams
  11804. ifNoneMatch_ string
  11805. ctx_ context.Context
  11806. header_ http.Header
  11807. }
  11808. // List: Returns a list of comments that match the API request
  11809. // parameters.
  11810. func (r *CommentsService) List(part string) *CommentsListCall {
  11811. c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11812. c.urlParams_.Set("part", part)
  11813. return c
  11814. }
  11815. // Id sets the optional parameter "id": The id parameter specifies a
  11816. // comma-separated list of comment IDs for the resources that are being
  11817. // retrieved. In a comment resource, the id property specifies the
  11818. // comment's ID.
  11819. func (c *CommentsListCall) Id(id string) *CommentsListCall {
  11820. c.urlParams_.Set("id", id)
  11821. return c
  11822. }
  11823. // MaxResults sets the optional parameter "maxResults": The maxResults
  11824. // parameter specifies the maximum number of items that should be
  11825. // returned in the result set.
  11826. //
  11827. // Note: This parameter is not supported for use in conjunction with the
  11828. // id parameter.
  11829. func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
  11830. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11831. return c
  11832. }
  11833. // PageToken sets the optional parameter "pageToken": The pageToken
  11834. // parameter identifies a specific page in the result set that should be
  11835. // returned. In an API response, the nextPageToken property identifies
  11836. // the next page of the result that can be retrieved.
  11837. //
  11838. // Note: This parameter is not supported for use in conjunction with the
  11839. // id parameter.
  11840. func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
  11841. c.urlParams_.Set("pageToken", pageToken)
  11842. return c
  11843. }
  11844. // ParentId sets the optional parameter "parentId": The parentId
  11845. // parameter specifies the ID of the comment for which replies should be
  11846. // retrieved.
  11847. //
  11848. // Note: YouTube currently supports replies only for top-level comments.
  11849. // However, replies to replies may be supported in the future.
  11850. func (c *CommentsListCall) ParentId(parentId string) *CommentsListCall {
  11851. c.urlParams_.Set("parentId", parentId)
  11852. return c
  11853. }
  11854. // TextFormat sets the optional parameter "textFormat": This parameter
  11855. // indicates whether the API should return comments formatted as HTML or
  11856. // as plain text.
  11857. //
  11858. // Possible values:
  11859. // "html" - Returns the comments in HTML format. This is the default
  11860. // value.
  11861. // "plainText" - Returns the comments in plain text format.
  11862. func (c *CommentsListCall) TextFormat(textFormat string) *CommentsListCall {
  11863. c.urlParams_.Set("textFormat", textFormat)
  11864. return c
  11865. }
  11866. // Fields allows partial responses to be retrieved. See
  11867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11868. // for more information.
  11869. func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
  11870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11871. return c
  11872. }
  11873. // IfNoneMatch sets the optional parameter which makes the operation
  11874. // fail if the object's ETag matches the given value. This is useful for
  11875. // getting updates only after the object has changed since the last
  11876. // request. Use googleapi.IsNotModified to check whether the response
  11877. // error from Do is the result of In-None-Match.
  11878. func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
  11879. c.ifNoneMatch_ = entityTag
  11880. return c
  11881. }
  11882. // Context sets the context to be used in this call's Do method. Any
  11883. // pending HTTP request will be aborted if the provided context is
  11884. // canceled.
  11885. func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
  11886. c.ctx_ = ctx
  11887. return c
  11888. }
  11889. // Header returns an http.Header that can be modified by the caller to
  11890. // add HTTP headers to the request.
  11891. func (c *CommentsListCall) Header() http.Header {
  11892. if c.header_ == nil {
  11893. c.header_ = make(http.Header)
  11894. }
  11895. return c.header_
  11896. }
  11897. func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
  11898. reqHeaders := make(http.Header)
  11899. for k, v := range c.header_ {
  11900. reqHeaders[k] = v
  11901. }
  11902. reqHeaders.Set("User-Agent", c.s.userAgent())
  11903. if c.ifNoneMatch_ != "" {
  11904. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11905. }
  11906. var body io.Reader = nil
  11907. c.urlParams_.Set("alt", alt)
  11908. c.urlParams_.Set("prettyPrint", "false")
  11909. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  11910. urls += "?" + c.urlParams_.Encode()
  11911. req, err := http.NewRequest("GET", urls, body)
  11912. if err != nil {
  11913. return nil, err
  11914. }
  11915. req.Header = reqHeaders
  11916. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11917. }
  11918. // Do executes the "youtube.comments.list" call.
  11919. // Exactly one of *CommentListResponse or error will be non-nil. Any
  11920. // non-2xx status code is an error. Response headers are in either
  11921. // *CommentListResponse.ServerResponse.Header or (if a response was
  11922. // returned at all) in error.(*googleapi.Error).Header. Use
  11923. // googleapi.IsNotModified to check whether the returned error was
  11924. // because http.StatusNotModified was returned.
  11925. func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentListResponse, error) {
  11926. gensupport.SetOptions(c.urlParams_, opts...)
  11927. res, err := c.doRequest("json")
  11928. if res != nil && res.StatusCode == http.StatusNotModified {
  11929. if res.Body != nil {
  11930. res.Body.Close()
  11931. }
  11932. return nil, &googleapi.Error{
  11933. Code: res.StatusCode,
  11934. Header: res.Header,
  11935. }
  11936. }
  11937. if err != nil {
  11938. return nil, err
  11939. }
  11940. defer googleapi.CloseBody(res)
  11941. if err := googleapi.CheckResponse(res); err != nil {
  11942. return nil, err
  11943. }
  11944. ret := &CommentListResponse{
  11945. ServerResponse: googleapi.ServerResponse{
  11946. Header: res.Header,
  11947. HTTPStatusCode: res.StatusCode,
  11948. },
  11949. }
  11950. target := &ret
  11951. if err := gensupport.DecodeResponse(target, res); err != nil {
  11952. return nil, err
  11953. }
  11954. return ret, nil
  11955. // {
  11956. // "description": "Returns a list of comments that match the API request parameters.",
  11957. // "httpMethod": "GET",
  11958. // "id": "youtube.comments.list",
  11959. // "parameterOrder": [
  11960. // "part"
  11961. // ],
  11962. // "parameters": {
  11963. // "id": {
  11964. // "description": "The id parameter specifies a comma-separated list of comment IDs for the resources that are being retrieved. In a comment resource, the id property specifies the comment's ID.",
  11965. // "location": "query",
  11966. // "type": "string"
  11967. // },
  11968. // "maxResults": {
  11969. // "default": "20",
  11970. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  11971. // "format": "uint32",
  11972. // "location": "query",
  11973. // "maximum": "100",
  11974. // "minimum": "1",
  11975. // "type": "integer"
  11976. // },
  11977. // "pageToken": {
  11978. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identifies the next page of the result that can be retrieved.\n\nNote: This parameter is not supported for use in conjunction with the id parameter.",
  11979. // "location": "query",
  11980. // "type": "string"
  11981. // },
  11982. // "parentId": {
  11983. // "description": "The parentId parameter specifies the ID of the comment for which replies should be retrieved.\n\nNote: YouTube currently supports replies only for top-level comments. However, replies to replies may be supported in the future.",
  11984. // "location": "query",
  11985. // "type": "string"
  11986. // },
  11987. // "part": {
  11988. // "description": "The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.",
  11989. // "location": "query",
  11990. // "required": true,
  11991. // "type": "string"
  11992. // },
  11993. // "textFormat": {
  11994. // "default": "FORMAT_HTML",
  11995. // "description": "This parameter indicates whether the API should return comments formatted as HTML or as plain text.",
  11996. // "enum": [
  11997. // "html",
  11998. // "plainText"
  11999. // ],
  12000. // "enumDescriptions": [
  12001. // "Returns the comments in HTML format. This is the default value.",
  12002. // "Returns the comments in plain text format."
  12003. // ],
  12004. // "location": "query",
  12005. // "type": "string"
  12006. // }
  12007. // },
  12008. // "path": "comments",
  12009. // "response": {
  12010. // "$ref": "CommentListResponse"
  12011. // },
  12012. // "scopes": [
  12013. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12014. // ]
  12015. // }
  12016. }
  12017. // Pages invokes f for each page of results.
  12018. // A non-nil error returned from f will halt the iteration.
  12019. // The provided context supersedes any context provided to the Context method.
  12020. func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentListResponse) error) error {
  12021. c.ctx_ = ctx
  12022. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12023. for {
  12024. x, err := c.Do()
  12025. if err != nil {
  12026. return err
  12027. }
  12028. if err := f(x); err != nil {
  12029. return err
  12030. }
  12031. if x.NextPageToken == "" {
  12032. return nil
  12033. }
  12034. c.PageToken(x.NextPageToken)
  12035. }
  12036. }
  12037. // method id "youtube.comments.markAsSpam":
  12038. type CommentsMarkAsSpamCall struct {
  12039. s *Service
  12040. urlParams_ gensupport.URLParams
  12041. ctx_ context.Context
  12042. header_ http.Header
  12043. }
  12044. // MarkAsSpam: Expresses the caller's opinion that one or more comments
  12045. // should be flagged as spam.
  12046. func (r *CommentsService) MarkAsSpam(id string) *CommentsMarkAsSpamCall {
  12047. c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12048. c.urlParams_.Set("id", id)
  12049. return c
  12050. }
  12051. // Fields allows partial responses to be retrieved. See
  12052. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12053. // for more information.
  12054. func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
  12055. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12056. return c
  12057. }
  12058. // Context sets the context to be used in this call's Do method. Any
  12059. // pending HTTP request will be aborted if the provided context is
  12060. // canceled.
  12061. func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall {
  12062. c.ctx_ = ctx
  12063. return c
  12064. }
  12065. // Header returns an http.Header that can be modified by the caller to
  12066. // add HTTP headers to the request.
  12067. func (c *CommentsMarkAsSpamCall) Header() http.Header {
  12068. if c.header_ == nil {
  12069. c.header_ = make(http.Header)
  12070. }
  12071. return c.header_
  12072. }
  12073. func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) {
  12074. reqHeaders := make(http.Header)
  12075. for k, v := range c.header_ {
  12076. reqHeaders[k] = v
  12077. }
  12078. reqHeaders.Set("User-Agent", c.s.userAgent())
  12079. var body io.Reader = nil
  12080. c.urlParams_.Set("alt", alt)
  12081. c.urlParams_.Set("prettyPrint", "false")
  12082. urls := googleapi.ResolveRelative(c.s.BasePath, "comments/markAsSpam")
  12083. urls += "?" + c.urlParams_.Encode()
  12084. req, err := http.NewRequest("POST", urls, body)
  12085. if err != nil {
  12086. return nil, err
  12087. }
  12088. req.Header = reqHeaders
  12089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12090. }
  12091. // Do executes the "youtube.comments.markAsSpam" call.
  12092. func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) error {
  12093. gensupport.SetOptions(c.urlParams_, opts...)
  12094. res, err := c.doRequest("json")
  12095. if err != nil {
  12096. return err
  12097. }
  12098. defer googleapi.CloseBody(res)
  12099. if err := googleapi.CheckResponse(res); err != nil {
  12100. return err
  12101. }
  12102. return nil
  12103. // {
  12104. // "description": "Expresses the caller's opinion that one or more comments should be flagged as spam.",
  12105. // "httpMethod": "POST",
  12106. // "id": "youtube.comments.markAsSpam",
  12107. // "parameterOrder": [
  12108. // "id"
  12109. // ],
  12110. // "parameters": {
  12111. // "id": {
  12112. // "description": "The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.",
  12113. // "location": "query",
  12114. // "required": true,
  12115. // "type": "string"
  12116. // }
  12117. // },
  12118. // "path": "comments/markAsSpam",
  12119. // "scopes": [
  12120. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12121. // ]
  12122. // }
  12123. }
  12124. // method id "youtube.comments.setModerationStatus":
  12125. type CommentsSetModerationStatusCall struct {
  12126. s *Service
  12127. urlParams_ gensupport.URLParams
  12128. ctx_ context.Context
  12129. header_ http.Header
  12130. }
  12131. // SetModerationStatus: Sets the moderation status of one or more
  12132. // comments. The API request must be authorized by the owner of the
  12133. // channel or video associated with the comments.
  12134. func (r *CommentsService) SetModerationStatus(id string, moderationStatus string) *CommentsSetModerationStatusCall {
  12135. c := &CommentsSetModerationStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12136. c.urlParams_.Set("id", id)
  12137. c.urlParams_.Set("moderationStatus", moderationStatus)
  12138. return c
  12139. }
  12140. // BanAuthor sets the optional parameter "banAuthor": The banAuthor
  12141. // parameter lets you indicate that you want to automatically reject any
  12142. // additional comments written by the comment's author. Set the
  12143. // parameter value to true to ban the author.
  12144. //
  12145. // Note: This parameter is only valid if the moderationStatus parameter
  12146. // is also set to rejected.
  12147. func (c *CommentsSetModerationStatusCall) BanAuthor(banAuthor bool) *CommentsSetModerationStatusCall {
  12148. c.urlParams_.Set("banAuthor", fmt.Sprint(banAuthor))
  12149. return c
  12150. }
  12151. // Fields allows partial responses to be retrieved. See
  12152. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12153. // for more information.
  12154. func (c *CommentsSetModerationStatusCall) Fields(s ...googleapi.Field) *CommentsSetModerationStatusCall {
  12155. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12156. return c
  12157. }
  12158. // Context sets the context to be used in this call's Do method. Any
  12159. // pending HTTP request will be aborted if the provided context is
  12160. // canceled.
  12161. func (c *CommentsSetModerationStatusCall) Context(ctx context.Context) *CommentsSetModerationStatusCall {
  12162. c.ctx_ = ctx
  12163. return c
  12164. }
  12165. // Header returns an http.Header that can be modified by the caller to
  12166. // add HTTP headers to the request.
  12167. func (c *CommentsSetModerationStatusCall) Header() http.Header {
  12168. if c.header_ == nil {
  12169. c.header_ = make(http.Header)
  12170. }
  12171. return c.header_
  12172. }
  12173. func (c *CommentsSetModerationStatusCall) doRequest(alt string) (*http.Response, error) {
  12174. reqHeaders := make(http.Header)
  12175. for k, v := range c.header_ {
  12176. reqHeaders[k] = v
  12177. }
  12178. reqHeaders.Set("User-Agent", c.s.userAgent())
  12179. var body io.Reader = nil
  12180. c.urlParams_.Set("alt", alt)
  12181. c.urlParams_.Set("prettyPrint", "false")
  12182. urls := googleapi.ResolveRelative(c.s.BasePath, "comments/setModerationStatus")
  12183. urls += "?" + c.urlParams_.Encode()
  12184. req, err := http.NewRequest("POST", urls, body)
  12185. if err != nil {
  12186. return nil, err
  12187. }
  12188. req.Header = reqHeaders
  12189. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12190. }
  12191. // Do executes the "youtube.comments.setModerationStatus" call.
  12192. func (c *CommentsSetModerationStatusCall) Do(opts ...googleapi.CallOption) error {
  12193. gensupport.SetOptions(c.urlParams_, opts...)
  12194. res, err := c.doRequest("json")
  12195. if err != nil {
  12196. return err
  12197. }
  12198. defer googleapi.CloseBody(res)
  12199. if err := googleapi.CheckResponse(res); err != nil {
  12200. return err
  12201. }
  12202. return nil
  12203. // {
  12204. // "description": "Sets the moderation status of one or more comments. The API request must be authorized by the owner of the channel or video associated with the comments.",
  12205. // "httpMethod": "POST",
  12206. // "id": "youtube.comments.setModerationStatus",
  12207. // "parameterOrder": [
  12208. // "id",
  12209. // "moderationStatus"
  12210. // ],
  12211. // "parameters": {
  12212. // "banAuthor": {
  12213. // "default": "false",
  12214. // "description": "The banAuthor parameter lets you indicate that you want to automatically reject any additional comments written by the comment's author. Set the parameter value to true to ban the author.\n\nNote: This parameter is only valid if the moderationStatus parameter is also set to rejected.",
  12215. // "location": "query",
  12216. // "type": "boolean"
  12217. // },
  12218. // "id": {
  12219. // "description": "The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.",
  12220. // "location": "query",
  12221. // "required": true,
  12222. // "type": "string"
  12223. // },
  12224. // "moderationStatus": {
  12225. // "description": "Identifies the new moderation status of the specified comments.",
  12226. // "enum": [
  12227. // "heldForReview",
  12228. // "published",
  12229. // "rejected"
  12230. // ],
  12231. // "enumDescriptions": [
  12232. // "Marks a comment as awaiting review by a moderator.",
  12233. // "Clears a comment for public display.",
  12234. // "Rejects a comment as being unfit for display. This action also effectively hides all replies to the rejected comment.\n\nNote: The API does not currently provide a way to list or otherwise discover rejected comments. However, you can change the moderation status of a rejected comment if you still know its ID. If you were to change the moderation status of a rejected comment, the comment replies would subsequently be discoverable again as well."
  12235. // ],
  12236. // "location": "query",
  12237. // "required": true,
  12238. // "type": "string"
  12239. // }
  12240. // },
  12241. // "path": "comments/setModerationStatus",
  12242. // "scopes": [
  12243. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12244. // ]
  12245. // }
  12246. }
  12247. // method id "youtube.comments.update":
  12248. type CommentsUpdateCall struct {
  12249. s *Service
  12250. comment *Comment
  12251. urlParams_ gensupport.URLParams
  12252. ctx_ context.Context
  12253. header_ http.Header
  12254. }
  12255. // Update: Modifies a comment.
  12256. func (r *CommentsService) Update(part string, comment *Comment) *CommentsUpdateCall {
  12257. c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12258. c.urlParams_.Set("part", part)
  12259. c.comment = comment
  12260. return c
  12261. }
  12262. // Fields allows partial responses to be retrieved. See
  12263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12264. // for more information.
  12265. func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
  12266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12267. return c
  12268. }
  12269. // Context sets the context to be used in this call's Do method. Any
  12270. // pending HTTP request will be aborted if the provided context is
  12271. // canceled.
  12272. func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
  12273. c.ctx_ = ctx
  12274. return c
  12275. }
  12276. // Header returns an http.Header that can be modified by the caller to
  12277. // add HTTP headers to the request.
  12278. func (c *CommentsUpdateCall) Header() http.Header {
  12279. if c.header_ == nil {
  12280. c.header_ = make(http.Header)
  12281. }
  12282. return c.header_
  12283. }
  12284. func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12285. reqHeaders := make(http.Header)
  12286. for k, v := range c.header_ {
  12287. reqHeaders[k] = v
  12288. }
  12289. reqHeaders.Set("User-Agent", c.s.userAgent())
  12290. var body io.Reader = nil
  12291. body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  12292. if err != nil {
  12293. return nil, err
  12294. }
  12295. reqHeaders.Set("Content-Type", "application/json")
  12296. c.urlParams_.Set("alt", alt)
  12297. c.urlParams_.Set("prettyPrint", "false")
  12298. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  12299. urls += "?" + c.urlParams_.Encode()
  12300. req, err := http.NewRequest("PUT", urls, body)
  12301. if err != nil {
  12302. return nil, err
  12303. }
  12304. req.Header = reqHeaders
  12305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12306. }
  12307. // Do executes the "youtube.comments.update" call.
  12308. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  12309. // code is an error. Response headers are in either
  12310. // *Comment.ServerResponse.Header or (if a response was returned at all)
  12311. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12312. // check whether the returned error was because http.StatusNotModified
  12313. // was returned.
  12314. func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  12315. gensupport.SetOptions(c.urlParams_, opts...)
  12316. res, err := c.doRequest("json")
  12317. if res != nil && res.StatusCode == http.StatusNotModified {
  12318. if res.Body != nil {
  12319. res.Body.Close()
  12320. }
  12321. return nil, &googleapi.Error{
  12322. Code: res.StatusCode,
  12323. Header: res.Header,
  12324. }
  12325. }
  12326. if err != nil {
  12327. return nil, err
  12328. }
  12329. defer googleapi.CloseBody(res)
  12330. if err := googleapi.CheckResponse(res); err != nil {
  12331. return nil, err
  12332. }
  12333. ret := &Comment{
  12334. ServerResponse: googleapi.ServerResponse{
  12335. Header: res.Header,
  12336. HTTPStatusCode: res.StatusCode,
  12337. },
  12338. }
  12339. target := &ret
  12340. if err := gensupport.DecodeResponse(target, res); err != nil {
  12341. return nil, err
  12342. }
  12343. return ret, nil
  12344. // {
  12345. // "description": "Modifies a comment.",
  12346. // "httpMethod": "PUT",
  12347. // "id": "youtube.comments.update",
  12348. // "parameterOrder": [
  12349. // "part"
  12350. // ],
  12351. // "parameters": {
  12352. // "part": {
  12353. // "description": "The part parameter identifies the properties that the API response will include. You must at least include the snippet part in the parameter value since that part contains all of the properties that the API request can update.",
  12354. // "location": "query",
  12355. // "required": true,
  12356. // "type": "string"
  12357. // }
  12358. // },
  12359. // "path": "comments",
  12360. // "request": {
  12361. // "$ref": "Comment"
  12362. // },
  12363. // "response": {
  12364. // "$ref": "Comment"
  12365. // },
  12366. // "scopes": [
  12367. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12368. // ]
  12369. // }
  12370. }
  12371. // method id "youtube.guideCategories.list":
  12372. type GuideCategoriesListCall struct {
  12373. s *Service
  12374. urlParams_ gensupport.URLParams
  12375. ifNoneMatch_ string
  12376. ctx_ context.Context
  12377. header_ http.Header
  12378. }
  12379. // List: Returns a list of categories that can be associated with
  12380. // YouTube channels.
  12381. func (r *GuideCategoriesService) List(part string) *GuideCategoriesListCall {
  12382. c := &GuideCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12383. c.urlParams_.Set("part", part)
  12384. return c
  12385. }
  12386. // Hl sets the optional parameter "hl": The hl parameter specifies the
  12387. // language that will be used for text values in the API response.
  12388. func (c *GuideCategoriesListCall) Hl(hl string) *GuideCategoriesListCall {
  12389. c.urlParams_.Set("hl", hl)
  12390. return c
  12391. }
  12392. // Id sets the optional parameter "id": The id parameter specifies a
  12393. // comma-separated list of the YouTube channel category ID(s) for the
  12394. // resource(s) that are being retrieved. In a guideCategory resource,
  12395. // the id property specifies the YouTube channel category ID.
  12396. func (c *GuideCategoriesListCall) Id(id string) *GuideCategoriesListCall {
  12397. c.urlParams_.Set("id", id)
  12398. return c
  12399. }
  12400. // RegionCode sets the optional parameter "regionCode": The regionCode
  12401. // parameter instructs the API to return the list of guide categories
  12402. // available in the specified country. The parameter value is an ISO
  12403. // 3166-1 alpha-2 country code.
  12404. func (c *GuideCategoriesListCall) RegionCode(regionCode string) *GuideCategoriesListCall {
  12405. c.urlParams_.Set("regionCode", regionCode)
  12406. return c
  12407. }
  12408. // Fields allows partial responses to be retrieved. See
  12409. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12410. // for more information.
  12411. func (c *GuideCategoriesListCall) Fields(s ...googleapi.Field) *GuideCategoriesListCall {
  12412. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12413. return c
  12414. }
  12415. // IfNoneMatch sets the optional parameter which makes the operation
  12416. // fail if the object's ETag matches the given value. This is useful for
  12417. // getting updates only after the object has changed since the last
  12418. // request. Use googleapi.IsNotModified to check whether the response
  12419. // error from Do is the result of In-None-Match.
  12420. func (c *GuideCategoriesListCall) IfNoneMatch(entityTag string) *GuideCategoriesListCall {
  12421. c.ifNoneMatch_ = entityTag
  12422. return c
  12423. }
  12424. // Context sets the context to be used in this call's Do method. Any
  12425. // pending HTTP request will be aborted if the provided context is
  12426. // canceled.
  12427. func (c *GuideCategoriesListCall) Context(ctx context.Context) *GuideCategoriesListCall {
  12428. c.ctx_ = ctx
  12429. return c
  12430. }
  12431. // Header returns an http.Header that can be modified by the caller to
  12432. // add HTTP headers to the request.
  12433. func (c *GuideCategoriesListCall) Header() http.Header {
  12434. if c.header_ == nil {
  12435. c.header_ = make(http.Header)
  12436. }
  12437. return c.header_
  12438. }
  12439. func (c *GuideCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  12440. reqHeaders := make(http.Header)
  12441. for k, v := range c.header_ {
  12442. reqHeaders[k] = v
  12443. }
  12444. reqHeaders.Set("User-Agent", c.s.userAgent())
  12445. if c.ifNoneMatch_ != "" {
  12446. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12447. }
  12448. var body io.Reader = nil
  12449. c.urlParams_.Set("alt", alt)
  12450. c.urlParams_.Set("prettyPrint", "false")
  12451. urls := googleapi.ResolveRelative(c.s.BasePath, "guideCategories")
  12452. urls += "?" + c.urlParams_.Encode()
  12453. req, err := http.NewRequest("GET", urls, body)
  12454. if err != nil {
  12455. return nil, err
  12456. }
  12457. req.Header = reqHeaders
  12458. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12459. }
  12460. // Do executes the "youtube.guideCategories.list" call.
  12461. // Exactly one of *GuideCategoryListResponse or error will be non-nil.
  12462. // Any non-2xx status code is an error. Response headers are in either
  12463. // *GuideCategoryListResponse.ServerResponse.Header or (if a response
  12464. // was returned at all) in error.(*googleapi.Error).Header. Use
  12465. // googleapi.IsNotModified to check whether the returned error was
  12466. // because http.StatusNotModified was returned.
  12467. func (c *GuideCategoriesListCall) Do(opts ...googleapi.CallOption) (*GuideCategoryListResponse, error) {
  12468. gensupport.SetOptions(c.urlParams_, opts...)
  12469. res, err := c.doRequest("json")
  12470. if res != nil && res.StatusCode == http.StatusNotModified {
  12471. if res.Body != nil {
  12472. res.Body.Close()
  12473. }
  12474. return nil, &googleapi.Error{
  12475. Code: res.StatusCode,
  12476. Header: res.Header,
  12477. }
  12478. }
  12479. if err != nil {
  12480. return nil, err
  12481. }
  12482. defer googleapi.CloseBody(res)
  12483. if err := googleapi.CheckResponse(res); err != nil {
  12484. return nil, err
  12485. }
  12486. ret := &GuideCategoryListResponse{
  12487. ServerResponse: googleapi.ServerResponse{
  12488. Header: res.Header,
  12489. HTTPStatusCode: res.StatusCode,
  12490. },
  12491. }
  12492. target := &ret
  12493. if err := gensupport.DecodeResponse(target, res); err != nil {
  12494. return nil, err
  12495. }
  12496. return ret, nil
  12497. // {
  12498. // "description": "Returns a list of categories that can be associated with YouTube channels.",
  12499. // "httpMethod": "GET",
  12500. // "id": "youtube.guideCategories.list",
  12501. // "parameterOrder": [
  12502. // "part"
  12503. // ],
  12504. // "parameters": {
  12505. // "hl": {
  12506. // "default": "en-US",
  12507. // "description": "The hl parameter specifies the language that will be used for text values in the API response.",
  12508. // "location": "query",
  12509. // "type": "string"
  12510. // },
  12511. // "id": {
  12512. // "description": "The id parameter specifies a comma-separated list of the YouTube channel category ID(s) for the resource(s) that are being retrieved. In a guideCategory resource, the id property specifies the YouTube channel category ID.",
  12513. // "location": "query",
  12514. // "type": "string"
  12515. // },
  12516. // "part": {
  12517. // "description": "The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet.",
  12518. // "location": "query",
  12519. // "required": true,
  12520. // "type": "string"
  12521. // },
  12522. // "regionCode": {
  12523. // "description": "The regionCode parameter instructs the API to return the list of guide categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.",
  12524. // "location": "query",
  12525. // "type": "string"
  12526. // }
  12527. // },
  12528. // "path": "guideCategories",
  12529. // "response": {
  12530. // "$ref": "GuideCategoryListResponse"
  12531. // },
  12532. // "scopes": [
  12533. // "https://www.googleapis.com/auth/youtube",
  12534. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12535. // "https://www.googleapis.com/auth/youtube.readonly",
  12536. // "https://www.googleapis.com/auth/youtubepartner"
  12537. // ]
  12538. // }
  12539. }
  12540. // method id "youtube.i18nLanguages.list":
  12541. type I18nLanguagesListCall struct {
  12542. s *Service
  12543. urlParams_ gensupport.URLParams
  12544. ifNoneMatch_ string
  12545. ctx_ context.Context
  12546. header_ http.Header
  12547. }
  12548. // List: Returns a list of application languages that the YouTube
  12549. // website supports.
  12550. func (r *I18nLanguagesService) List(part string) *I18nLanguagesListCall {
  12551. c := &I18nLanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12552. c.urlParams_.Set("part", part)
  12553. return c
  12554. }
  12555. // Hl sets the optional parameter "hl": The hl parameter specifies the
  12556. // language that should be used for text values in the API response.
  12557. func (c *I18nLanguagesListCall) Hl(hl string) *I18nLanguagesListCall {
  12558. c.urlParams_.Set("hl", hl)
  12559. return c
  12560. }
  12561. // Fields allows partial responses to be retrieved. See
  12562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12563. // for more information.
  12564. func (c *I18nLanguagesListCall) Fields(s ...googleapi.Field) *I18nLanguagesListCall {
  12565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12566. return c
  12567. }
  12568. // IfNoneMatch sets the optional parameter which makes the operation
  12569. // fail if the object's ETag matches the given value. This is useful for
  12570. // getting updates only after the object has changed since the last
  12571. // request. Use googleapi.IsNotModified to check whether the response
  12572. // error from Do is the result of In-None-Match.
  12573. func (c *I18nLanguagesListCall) IfNoneMatch(entityTag string) *I18nLanguagesListCall {
  12574. c.ifNoneMatch_ = entityTag
  12575. return c
  12576. }
  12577. // Context sets the context to be used in this call's Do method. Any
  12578. // pending HTTP request will be aborted if the provided context is
  12579. // canceled.
  12580. func (c *I18nLanguagesListCall) Context(ctx context.Context) *I18nLanguagesListCall {
  12581. c.ctx_ = ctx
  12582. return c
  12583. }
  12584. // Header returns an http.Header that can be modified by the caller to
  12585. // add HTTP headers to the request.
  12586. func (c *I18nLanguagesListCall) Header() http.Header {
  12587. if c.header_ == nil {
  12588. c.header_ = make(http.Header)
  12589. }
  12590. return c.header_
  12591. }
  12592. func (c *I18nLanguagesListCall) doRequest(alt string) (*http.Response, error) {
  12593. reqHeaders := make(http.Header)
  12594. for k, v := range c.header_ {
  12595. reqHeaders[k] = v
  12596. }
  12597. reqHeaders.Set("User-Agent", c.s.userAgent())
  12598. if c.ifNoneMatch_ != "" {
  12599. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12600. }
  12601. var body io.Reader = nil
  12602. c.urlParams_.Set("alt", alt)
  12603. c.urlParams_.Set("prettyPrint", "false")
  12604. urls := googleapi.ResolveRelative(c.s.BasePath, "i18nLanguages")
  12605. urls += "?" + c.urlParams_.Encode()
  12606. req, err := http.NewRequest("GET", urls, body)
  12607. if err != nil {
  12608. return nil, err
  12609. }
  12610. req.Header = reqHeaders
  12611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12612. }
  12613. // Do executes the "youtube.i18nLanguages.list" call.
  12614. // Exactly one of *I18nLanguageListResponse or error will be non-nil.
  12615. // Any non-2xx status code is an error. Response headers are in either
  12616. // *I18nLanguageListResponse.ServerResponse.Header or (if a response was
  12617. // returned at all) in error.(*googleapi.Error).Header. Use
  12618. // googleapi.IsNotModified to check whether the returned error was
  12619. // because http.StatusNotModified was returned.
  12620. func (c *I18nLanguagesListCall) Do(opts ...googleapi.CallOption) (*I18nLanguageListResponse, error) {
  12621. gensupport.SetOptions(c.urlParams_, opts...)
  12622. res, err := c.doRequest("json")
  12623. if res != nil && res.StatusCode == http.StatusNotModified {
  12624. if res.Body != nil {
  12625. res.Body.Close()
  12626. }
  12627. return nil, &googleapi.Error{
  12628. Code: res.StatusCode,
  12629. Header: res.Header,
  12630. }
  12631. }
  12632. if err != nil {
  12633. return nil, err
  12634. }
  12635. defer googleapi.CloseBody(res)
  12636. if err := googleapi.CheckResponse(res); err != nil {
  12637. return nil, err
  12638. }
  12639. ret := &I18nLanguageListResponse{
  12640. ServerResponse: googleapi.ServerResponse{
  12641. Header: res.Header,
  12642. HTTPStatusCode: res.StatusCode,
  12643. },
  12644. }
  12645. target := &ret
  12646. if err := gensupport.DecodeResponse(target, res); err != nil {
  12647. return nil, err
  12648. }
  12649. return ret, nil
  12650. // {
  12651. // "description": "Returns a list of application languages that the YouTube website supports.",
  12652. // "httpMethod": "GET",
  12653. // "id": "youtube.i18nLanguages.list",
  12654. // "parameterOrder": [
  12655. // "part"
  12656. // ],
  12657. // "parameters": {
  12658. // "hl": {
  12659. // "default": "en_US",
  12660. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  12661. // "location": "query",
  12662. // "type": "string"
  12663. // },
  12664. // "part": {
  12665. // "description": "The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.",
  12666. // "location": "query",
  12667. // "required": true,
  12668. // "type": "string"
  12669. // }
  12670. // },
  12671. // "path": "i18nLanguages",
  12672. // "response": {
  12673. // "$ref": "I18nLanguageListResponse"
  12674. // },
  12675. // "scopes": [
  12676. // "https://www.googleapis.com/auth/youtube",
  12677. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12678. // "https://www.googleapis.com/auth/youtube.readonly",
  12679. // "https://www.googleapis.com/auth/youtubepartner"
  12680. // ]
  12681. // }
  12682. }
  12683. // method id "youtube.i18nRegions.list":
  12684. type I18nRegionsListCall struct {
  12685. s *Service
  12686. urlParams_ gensupport.URLParams
  12687. ifNoneMatch_ string
  12688. ctx_ context.Context
  12689. header_ http.Header
  12690. }
  12691. // List: Returns a list of content regions that the YouTube website
  12692. // supports.
  12693. func (r *I18nRegionsService) List(part string) *I18nRegionsListCall {
  12694. c := &I18nRegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12695. c.urlParams_.Set("part", part)
  12696. return c
  12697. }
  12698. // Hl sets the optional parameter "hl": The hl parameter specifies the
  12699. // language that should be used for text values in the API response.
  12700. func (c *I18nRegionsListCall) Hl(hl string) *I18nRegionsListCall {
  12701. c.urlParams_.Set("hl", hl)
  12702. return c
  12703. }
  12704. // Fields allows partial responses to be retrieved. See
  12705. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12706. // for more information.
  12707. func (c *I18nRegionsListCall) Fields(s ...googleapi.Field) *I18nRegionsListCall {
  12708. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12709. return c
  12710. }
  12711. // IfNoneMatch sets the optional parameter which makes the operation
  12712. // fail if the object's ETag matches the given value. This is useful for
  12713. // getting updates only after the object has changed since the last
  12714. // request. Use googleapi.IsNotModified to check whether the response
  12715. // error from Do is the result of In-None-Match.
  12716. func (c *I18nRegionsListCall) IfNoneMatch(entityTag string) *I18nRegionsListCall {
  12717. c.ifNoneMatch_ = entityTag
  12718. return c
  12719. }
  12720. // Context sets the context to be used in this call's Do method. Any
  12721. // pending HTTP request will be aborted if the provided context is
  12722. // canceled.
  12723. func (c *I18nRegionsListCall) Context(ctx context.Context) *I18nRegionsListCall {
  12724. c.ctx_ = ctx
  12725. return c
  12726. }
  12727. // Header returns an http.Header that can be modified by the caller to
  12728. // add HTTP headers to the request.
  12729. func (c *I18nRegionsListCall) Header() http.Header {
  12730. if c.header_ == nil {
  12731. c.header_ = make(http.Header)
  12732. }
  12733. return c.header_
  12734. }
  12735. func (c *I18nRegionsListCall) doRequest(alt string) (*http.Response, error) {
  12736. reqHeaders := make(http.Header)
  12737. for k, v := range c.header_ {
  12738. reqHeaders[k] = v
  12739. }
  12740. reqHeaders.Set("User-Agent", c.s.userAgent())
  12741. if c.ifNoneMatch_ != "" {
  12742. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12743. }
  12744. var body io.Reader = nil
  12745. c.urlParams_.Set("alt", alt)
  12746. c.urlParams_.Set("prettyPrint", "false")
  12747. urls := googleapi.ResolveRelative(c.s.BasePath, "i18nRegions")
  12748. urls += "?" + c.urlParams_.Encode()
  12749. req, err := http.NewRequest("GET", urls, body)
  12750. if err != nil {
  12751. return nil, err
  12752. }
  12753. req.Header = reqHeaders
  12754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12755. }
  12756. // Do executes the "youtube.i18nRegions.list" call.
  12757. // Exactly one of *I18nRegionListResponse or error will be non-nil. Any
  12758. // non-2xx status code is an error. Response headers are in either
  12759. // *I18nRegionListResponse.ServerResponse.Header or (if a response was
  12760. // returned at all) in error.(*googleapi.Error).Header. Use
  12761. // googleapi.IsNotModified to check whether the returned error was
  12762. // because http.StatusNotModified was returned.
  12763. func (c *I18nRegionsListCall) Do(opts ...googleapi.CallOption) (*I18nRegionListResponse, error) {
  12764. gensupport.SetOptions(c.urlParams_, opts...)
  12765. res, err := c.doRequest("json")
  12766. if res != nil && res.StatusCode == http.StatusNotModified {
  12767. if res.Body != nil {
  12768. res.Body.Close()
  12769. }
  12770. return nil, &googleapi.Error{
  12771. Code: res.StatusCode,
  12772. Header: res.Header,
  12773. }
  12774. }
  12775. if err != nil {
  12776. return nil, err
  12777. }
  12778. defer googleapi.CloseBody(res)
  12779. if err := googleapi.CheckResponse(res); err != nil {
  12780. return nil, err
  12781. }
  12782. ret := &I18nRegionListResponse{
  12783. ServerResponse: googleapi.ServerResponse{
  12784. Header: res.Header,
  12785. HTTPStatusCode: res.StatusCode,
  12786. },
  12787. }
  12788. target := &ret
  12789. if err := gensupport.DecodeResponse(target, res); err != nil {
  12790. return nil, err
  12791. }
  12792. return ret, nil
  12793. // {
  12794. // "description": "Returns a list of content regions that the YouTube website supports.",
  12795. // "httpMethod": "GET",
  12796. // "id": "youtube.i18nRegions.list",
  12797. // "parameterOrder": [
  12798. // "part"
  12799. // ],
  12800. // "parameters": {
  12801. // "hl": {
  12802. // "default": "en_US",
  12803. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  12804. // "location": "query",
  12805. // "type": "string"
  12806. // },
  12807. // "part": {
  12808. // "description": "The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.",
  12809. // "location": "query",
  12810. // "required": true,
  12811. // "type": "string"
  12812. // }
  12813. // },
  12814. // "path": "i18nRegions",
  12815. // "response": {
  12816. // "$ref": "I18nRegionListResponse"
  12817. // },
  12818. // "scopes": [
  12819. // "https://www.googleapis.com/auth/youtube",
  12820. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12821. // "https://www.googleapis.com/auth/youtube.readonly",
  12822. // "https://www.googleapis.com/auth/youtubepartner"
  12823. // ]
  12824. // }
  12825. }
  12826. // method id "youtube.liveBroadcasts.bind":
  12827. type LiveBroadcastsBindCall struct {
  12828. s *Service
  12829. urlParams_ gensupport.URLParams
  12830. ctx_ context.Context
  12831. header_ http.Header
  12832. }
  12833. // Bind: Binds a YouTube broadcast to a stream or removes an existing
  12834. // binding between a broadcast and a stream. A broadcast can only be
  12835. // bound to one video stream, though a video stream may be bound to more
  12836. // than one broadcast.
  12837. func (r *LiveBroadcastsService) Bind(id string, part string) *LiveBroadcastsBindCall {
  12838. c := &LiveBroadcastsBindCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12839. c.urlParams_.Set("id", id)
  12840. c.urlParams_.Set("part", part)
  12841. return c
  12842. }
  12843. // OnBehalfOfContentOwner sets the optional parameter
  12844. // "onBehalfOfContentOwner": Note: This parameter is intended
  12845. // exclusively for YouTube content partners.
  12846. //
  12847. // The onBehalfOfContentOwner parameter indicates that the request's
  12848. // authorization credentials identify a YouTube CMS user who is acting
  12849. // on behalf of the content owner specified in the parameter value. This
  12850. // parameter is intended for YouTube content partners that own and
  12851. // manage many different YouTube channels. It allows content owners to
  12852. // authenticate once and get access to all their video and channel data,
  12853. // without having to provide authentication credentials for each
  12854. // individual channel. The CMS account that the user authenticates with
  12855. // must be linked to the specified YouTube content owner.
  12856. func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsBindCall {
  12857. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  12858. return c
  12859. }
  12860. // OnBehalfOfContentOwnerChannel sets the optional parameter
  12861. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  12862. // properly authorized request. Note: This parameter is intended
  12863. // exclusively for YouTube content partners.
  12864. //
  12865. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  12866. // channel ID of the channel to which a video is being added. This
  12867. // parameter is required when a request specifies a value for the
  12868. // onBehalfOfContentOwner parameter, and it can only be used in
  12869. // conjunction with that parameter. In addition, the request must be
  12870. // authorized using a CMS account that is linked to the content owner
  12871. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  12872. // channel that the onBehalfOfContentOwnerChannel parameter value
  12873. // specifies must be linked to the content owner that the
  12874. // onBehalfOfContentOwner parameter specifies.
  12875. //
  12876. // This parameter is intended for YouTube content partners that own and
  12877. // manage many different YouTube channels. It allows content owners to
  12878. // authenticate once and perform actions on behalf of the channel
  12879. // specified in the parameter value, without having to provide
  12880. // authentication credentials for each separate channel.
  12881. func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsBindCall {
  12882. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  12883. return c
  12884. }
  12885. // StreamId sets the optional parameter "streamId": The streamId
  12886. // parameter specifies the unique ID of the video stream that is being
  12887. // bound to a broadcast. If this parameter is omitted, the API will
  12888. // remove any existing binding between the broadcast and a video stream.
  12889. func (c *LiveBroadcastsBindCall) StreamId(streamId string) *LiveBroadcastsBindCall {
  12890. c.urlParams_.Set("streamId", streamId)
  12891. return c
  12892. }
  12893. // Fields allows partial responses to be retrieved. See
  12894. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12895. // for more information.
  12896. func (c *LiveBroadcastsBindCall) Fields(s ...googleapi.Field) *LiveBroadcastsBindCall {
  12897. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12898. return c
  12899. }
  12900. // Context sets the context to be used in this call's Do method. Any
  12901. // pending HTTP request will be aborted if the provided context is
  12902. // canceled.
  12903. func (c *LiveBroadcastsBindCall) Context(ctx context.Context) *LiveBroadcastsBindCall {
  12904. c.ctx_ = ctx
  12905. return c
  12906. }
  12907. // Header returns an http.Header that can be modified by the caller to
  12908. // add HTTP headers to the request.
  12909. func (c *LiveBroadcastsBindCall) Header() http.Header {
  12910. if c.header_ == nil {
  12911. c.header_ = make(http.Header)
  12912. }
  12913. return c.header_
  12914. }
  12915. func (c *LiveBroadcastsBindCall) doRequest(alt string) (*http.Response, error) {
  12916. reqHeaders := make(http.Header)
  12917. for k, v := range c.header_ {
  12918. reqHeaders[k] = v
  12919. }
  12920. reqHeaders.Set("User-Agent", c.s.userAgent())
  12921. var body io.Reader = nil
  12922. c.urlParams_.Set("alt", alt)
  12923. c.urlParams_.Set("prettyPrint", "false")
  12924. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/bind")
  12925. urls += "?" + c.urlParams_.Encode()
  12926. req, err := http.NewRequest("POST", urls, body)
  12927. if err != nil {
  12928. return nil, err
  12929. }
  12930. req.Header = reqHeaders
  12931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12932. }
  12933. // Do executes the "youtube.liveBroadcasts.bind" call.
  12934. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  12935. // status code is an error. Response headers are in either
  12936. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  12937. // at all) in error.(*googleapi.Error).Header. Use
  12938. // googleapi.IsNotModified to check whether the returned error was
  12939. // because http.StatusNotModified was returned.
  12940. func (c *LiveBroadcastsBindCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  12941. gensupport.SetOptions(c.urlParams_, opts...)
  12942. res, err := c.doRequest("json")
  12943. if res != nil && res.StatusCode == http.StatusNotModified {
  12944. if res.Body != nil {
  12945. res.Body.Close()
  12946. }
  12947. return nil, &googleapi.Error{
  12948. Code: res.StatusCode,
  12949. Header: res.Header,
  12950. }
  12951. }
  12952. if err != nil {
  12953. return nil, err
  12954. }
  12955. defer googleapi.CloseBody(res)
  12956. if err := googleapi.CheckResponse(res); err != nil {
  12957. return nil, err
  12958. }
  12959. ret := &LiveBroadcast{
  12960. ServerResponse: googleapi.ServerResponse{
  12961. Header: res.Header,
  12962. HTTPStatusCode: res.StatusCode,
  12963. },
  12964. }
  12965. target := &ret
  12966. if err := gensupport.DecodeResponse(target, res); err != nil {
  12967. return nil, err
  12968. }
  12969. return ret, nil
  12970. // {
  12971. // "description": "Binds a YouTube broadcast to a stream or removes an existing binding between a broadcast and a stream. A broadcast can only be bound to one video stream, though a video stream may be bound to more than one broadcast.",
  12972. // "httpMethod": "POST",
  12973. // "id": "youtube.liveBroadcasts.bind",
  12974. // "parameterOrder": [
  12975. // "id",
  12976. // "part"
  12977. // ],
  12978. // "parameters": {
  12979. // "id": {
  12980. // "description": "The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.",
  12981. // "location": "query",
  12982. // "required": true,
  12983. // "type": "string"
  12984. // },
  12985. // "onBehalfOfContentOwner": {
  12986. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  12987. // "location": "query",
  12988. // "type": "string"
  12989. // },
  12990. // "onBehalfOfContentOwnerChannel": {
  12991. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  12992. // "location": "query",
  12993. // "type": "string"
  12994. // },
  12995. // "part": {
  12996. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  12997. // "location": "query",
  12998. // "required": true,
  12999. // "type": "string"
  13000. // },
  13001. // "streamId": {
  13002. // "description": "The streamId parameter specifies the unique ID of the video stream that is being bound to a broadcast. If this parameter is omitted, the API will remove any existing binding between the broadcast and a video stream.",
  13003. // "location": "query",
  13004. // "type": "string"
  13005. // }
  13006. // },
  13007. // "path": "liveBroadcasts/bind",
  13008. // "response": {
  13009. // "$ref": "LiveBroadcast"
  13010. // },
  13011. // "scopes": [
  13012. // "https://www.googleapis.com/auth/youtube",
  13013. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13014. // ]
  13015. // }
  13016. }
  13017. // method id "youtube.liveBroadcasts.control":
  13018. type LiveBroadcastsControlCall struct {
  13019. s *Service
  13020. urlParams_ gensupport.URLParams
  13021. ctx_ context.Context
  13022. header_ http.Header
  13023. }
  13024. // Control: Controls the settings for a slate that can be displayed in
  13025. // the broadcast stream.
  13026. func (r *LiveBroadcastsService) Control(id string, part string) *LiveBroadcastsControlCall {
  13027. c := &LiveBroadcastsControlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13028. c.urlParams_.Set("id", id)
  13029. c.urlParams_.Set("part", part)
  13030. return c
  13031. }
  13032. // DisplaySlate sets the optional parameter "displaySlate": The
  13033. // displaySlate parameter specifies whether the slate is being enabled
  13034. // or disabled.
  13035. func (c *LiveBroadcastsControlCall) DisplaySlate(displaySlate bool) *LiveBroadcastsControlCall {
  13036. c.urlParams_.Set("displaySlate", fmt.Sprint(displaySlate))
  13037. return c
  13038. }
  13039. // OffsetTimeMs sets the optional parameter "offsetTimeMs": The
  13040. // offsetTimeMs parameter specifies a positive time offset when the
  13041. // specified slate change will occur. The value is measured in
  13042. // milliseconds from the beginning of the broadcast's monitor stream,
  13043. // which is the time that the testing phase for the broadcast began.
  13044. // Even though it is specified in milliseconds, the value is actually an
  13045. // approximation, and YouTube completes the requested action as closely
  13046. // as possible to that time.
  13047. //
  13048. // If you do not specify a value for this parameter, then YouTube
  13049. // performs the action as soon as possible. See the Getting started
  13050. // guide for more details.
  13051. //
  13052. // Important: You should only specify a value for this parameter if your
  13053. // broadcast stream is delayed.
  13054. func (c *LiveBroadcastsControlCall) OffsetTimeMs(offsetTimeMs uint64) *LiveBroadcastsControlCall {
  13055. c.urlParams_.Set("offsetTimeMs", fmt.Sprint(offsetTimeMs))
  13056. return c
  13057. }
  13058. // OnBehalfOfContentOwner sets the optional parameter
  13059. // "onBehalfOfContentOwner": Note: This parameter is intended
  13060. // exclusively for YouTube content partners.
  13061. //
  13062. // The onBehalfOfContentOwner parameter indicates that the request's
  13063. // authorization credentials identify a YouTube CMS user who is acting
  13064. // on behalf of the content owner specified in the parameter value. This
  13065. // parameter is intended for YouTube content partners that own and
  13066. // manage many different YouTube channels. It allows content owners to
  13067. // authenticate once and get access to all their video and channel data,
  13068. // without having to provide authentication credentials for each
  13069. // individual channel. The CMS account that the user authenticates with
  13070. // must be linked to the specified YouTube content owner.
  13071. func (c *LiveBroadcastsControlCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsControlCall {
  13072. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13073. return c
  13074. }
  13075. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13076. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13077. // properly authorized request. Note: This parameter is intended
  13078. // exclusively for YouTube content partners.
  13079. //
  13080. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13081. // channel ID of the channel to which a video is being added. This
  13082. // parameter is required when a request specifies a value for the
  13083. // onBehalfOfContentOwner parameter, and it can only be used in
  13084. // conjunction with that parameter. In addition, the request must be
  13085. // authorized using a CMS account that is linked to the content owner
  13086. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13087. // channel that the onBehalfOfContentOwnerChannel parameter value
  13088. // specifies must be linked to the content owner that the
  13089. // onBehalfOfContentOwner parameter specifies.
  13090. //
  13091. // This parameter is intended for YouTube content partners that own and
  13092. // manage many different YouTube channels. It allows content owners to
  13093. // authenticate once and perform actions on behalf of the channel
  13094. // specified in the parameter value, without having to provide
  13095. // authentication credentials for each separate channel.
  13096. func (c *LiveBroadcastsControlCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsControlCall {
  13097. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13098. return c
  13099. }
  13100. // Walltime sets the optional parameter "walltime": The walltime
  13101. // parameter specifies the wall clock time at which the specified slate
  13102. // change will occur. The value is specified in ISO 8601
  13103. // (YYYY-MM-DDThh:mm:ss.sssZ) format.
  13104. func (c *LiveBroadcastsControlCall) Walltime(walltime string) *LiveBroadcastsControlCall {
  13105. c.urlParams_.Set("walltime", walltime)
  13106. return c
  13107. }
  13108. // Fields allows partial responses to be retrieved. See
  13109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13110. // for more information.
  13111. func (c *LiveBroadcastsControlCall) Fields(s ...googleapi.Field) *LiveBroadcastsControlCall {
  13112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13113. return c
  13114. }
  13115. // Context sets the context to be used in this call's Do method. Any
  13116. // pending HTTP request will be aborted if the provided context is
  13117. // canceled.
  13118. func (c *LiveBroadcastsControlCall) Context(ctx context.Context) *LiveBroadcastsControlCall {
  13119. c.ctx_ = ctx
  13120. return c
  13121. }
  13122. // Header returns an http.Header that can be modified by the caller to
  13123. // add HTTP headers to the request.
  13124. func (c *LiveBroadcastsControlCall) Header() http.Header {
  13125. if c.header_ == nil {
  13126. c.header_ = make(http.Header)
  13127. }
  13128. return c.header_
  13129. }
  13130. func (c *LiveBroadcastsControlCall) doRequest(alt string) (*http.Response, error) {
  13131. reqHeaders := make(http.Header)
  13132. for k, v := range c.header_ {
  13133. reqHeaders[k] = v
  13134. }
  13135. reqHeaders.Set("User-Agent", c.s.userAgent())
  13136. var body io.Reader = nil
  13137. c.urlParams_.Set("alt", alt)
  13138. c.urlParams_.Set("prettyPrint", "false")
  13139. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/control")
  13140. urls += "?" + c.urlParams_.Encode()
  13141. req, err := http.NewRequest("POST", urls, body)
  13142. if err != nil {
  13143. return nil, err
  13144. }
  13145. req.Header = reqHeaders
  13146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13147. }
  13148. // Do executes the "youtube.liveBroadcasts.control" call.
  13149. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  13150. // status code is an error. Response headers are in either
  13151. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  13152. // at all) in error.(*googleapi.Error).Header. Use
  13153. // googleapi.IsNotModified to check whether the returned error was
  13154. // because http.StatusNotModified was returned.
  13155. func (c *LiveBroadcastsControlCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  13156. gensupport.SetOptions(c.urlParams_, opts...)
  13157. res, err := c.doRequest("json")
  13158. if res != nil && res.StatusCode == http.StatusNotModified {
  13159. if res.Body != nil {
  13160. res.Body.Close()
  13161. }
  13162. return nil, &googleapi.Error{
  13163. Code: res.StatusCode,
  13164. Header: res.Header,
  13165. }
  13166. }
  13167. if err != nil {
  13168. return nil, err
  13169. }
  13170. defer googleapi.CloseBody(res)
  13171. if err := googleapi.CheckResponse(res); err != nil {
  13172. return nil, err
  13173. }
  13174. ret := &LiveBroadcast{
  13175. ServerResponse: googleapi.ServerResponse{
  13176. Header: res.Header,
  13177. HTTPStatusCode: res.StatusCode,
  13178. },
  13179. }
  13180. target := &ret
  13181. if err := gensupport.DecodeResponse(target, res); err != nil {
  13182. return nil, err
  13183. }
  13184. return ret, nil
  13185. // {
  13186. // "description": "Controls the settings for a slate that can be displayed in the broadcast stream.",
  13187. // "httpMethod": "POST",
  13188. // "id": "youtube.liveBroadcasts.control",
  13189. // "parameterOrder": [
  13190. // "id",
  13191. // "part"
  13192. // ],
  13193. // "parameters": {
  13194. // "displaySlate": {
  13195. // "description": "The displaySlate parameter specifies whether the slate is being enabled or disabled.",
  13196. // "location": "query",
  13197. // "type": "boolean"
  13198. // },
  13199. // "id": {
  13200. // "description": "The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated.",
  13201. // "location": "query",
  13202. // "required": true,
  13203. // "type": "string"
  13204. // },
  13205. // "offsetTimeMs": {
  13206. // "description": "The offsetTimeMs parameter specifies a positive time offset when the specified slate change will occur. The value is measured in milliseconds from the beginning of the broadcast's monitor stream, which is the time that the testing phase for the broadcast began. Even though it is specified in milliseconds, the value is actually an approximation, and YouTube completes the requested action as closely as possible to that time.\n\nIf you do not specify a value for this parameter, then YouTube performs the action as soon as possible. See the Getting started guide for more details.\n\nImportant: You should only specify a value for this parameter if your broadcast stream is delayed.",
  13207. // "format": "uint64",
  13208. // "location": "query",
  13209. // "type": "string"
  13210. // },
  13211. // "onBehalfOfContentOwner": {
  13212. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13213. // "location": "query",
  13214. // "type": "string"
  13215. // },
  13216. // "onBehalfOfContentOwnerChannel": {
  13217. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13218. // "location": "query",
  13219. // "type": "string"
  13220. // },
  13221. // "part": {
  13222. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  13223. // "location": "query",
  13224. // "required": true,
  13225. // "type": "string"
  13226. // },
  13227. // "walltime": {
  13228. // "description": "The walltime parameter specifies the wall clock time at which the specified slate change will occur. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.",
  13229. // "format": "date-time",
  13230. // "location": "query",
  13231. // "type": "string"
  13232. // }
  13233. // },
  13234. // "path": "liveBroadcasts/control",
  13235. // "response": {
  13236. // "$ref": "LiveBroadcast"
  13237. // },
  13238. // "scopes": [
  13239. // "https://www.googleapis.com/auth/youtube",
  13240. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13241. // ]
  13242. // }
  13243. }
  13244. // method id "youtube.liveBroadcasts.delete":
  13245. type LiveBroadcastsDeleteCall struct {
  13246. s *Service
  13247. urlParams_ gensupport.URLParams
  13248. ctx_ context.Context
  13249. header_ http.Header
  13250. }
  13251. // Delete: Deletes a broadcast.
  13252. func (r *LiveBroadcastsService) Delete(id string) *LiveBroadcastsDeleteCall {
  13253. c := &LiveBroadcastsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13254. c.urlParams_.Set("id", id)
  13255. return c
  13256. }
  13257. // OnBehalfOfContentOwner sets the optional parameter
  13258. // "onBehalfOfContentOwner": Note: This parameter is intended
  13259. // exclusively for YouTube content partners.
  13260. //
  13261. // The onBehalfOfContentOwner parameter indicates that the request's
  13262. // authorization credentials identify a YouTube CMS user who is acting
  13263. // on behalf of the content owner specified in the parameter value. This
  13264. // parameter is intended for YouTube content partners that own and
  13265. // manage many different YouTube channels. It allows content owners to
  13266. // authenticate once and get access to all their video and channel data,
  13267. // without having to provide authentication credentials for each
  13268. // individual channel. The CMS account that the user authenticates with
  13269. // must be linked to the specified YouTube content owner.
  13270. func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsDeleteCall {
  13271. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13272. return c
  13273. }
  13274. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13275. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13276. // properly authorized request. Note: This parameter is intended
  13277. // exclusively for YouTube content partners.
  13278. //
  13279. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13280. // channel ID of the channel to which a video is being added. This
  13281. // parameter is required when a request specifies a value for the
  13282. // onBehalfOfContentOwner parameter, and it can only be used in
  13283. // conjunction with that parameter. In addition, the request must be
  13284. // authorized using a CMS account that is linked to the content owner
  13285. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13286. // channel that the onBehalfOfContentOwnerChannel parameter value
  13287. // specifies must be linked to the content owner that the
  13288. // onBehalfOfContentOwner parameter specifies.
  13289. //
  13290. // This parameter is intended for YouTube content partners that own and
  13291. // manage many different YouTube channels. It allows content owners to
  13292. // authenticate once and perform actions on behalf of the channel
  13293. // specified in the parameter value, without having to provide
  13294. // authentication credentials for each separate channel.
  13295. func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsDeleteCall {
  13296. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13297. return c
  13298. }
  13299. // Fields allows partial responses to be retrieved. See
  13300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13301. // for more information.
  13302. func (c *LiveBroadcastsDeleteCall) Fields(s ...googleapi.Field) *LiveBroadcastsDeleteCall {
  13303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13304. return c
  13305. }
  13306. // Context sets the context to be used in this call's Do method. Any
  13307. // pending HTTP request will be aborted if the provided context is
  13308. // canceled.
  13309. func (c *LiveBroadcastsDeleteCall) Context(ctx context.Context) *LiveBroadcastsDeleteCall {
  13310. c.ctx_ = ctx
  13311. return c
  13312. }
  13313. // Header returns an http.Header that can be modified by the caller to
  13314. // add HTTP headers to the request.
  13315. func (c *LiveBroadcastsDeleteCall) Header() http.Header {
  13316. if c.header_ == nil {
  13317. c.header_ = make(http.Header)
  13318. }
  13319. return c.header_
  13320. }
  13321. func (c *LiveBroadcastsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13322. reqHeaders := make(http.Header)
  13323. for k, v := range c.header_ {
  13324. reqHeaders[k] = v
  13325. }
  13326. reqHeaders.Set("User-Agent", c.s.userAgent())
  13327. var body io.Reader = nil
  13328. c.urlParams_.Set("alt", alt)
  13329. c.urlParams_.Set("prettyPrint", "false")
  13330. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13331. urls += "?" + c.urlParams_.Encode()
  13332. req, err := http.NewRequest("DELETE", urls, body)
  13333. if err != nil {
  13334. return nil, err
  13335. }
  13336. req.Header = reqHeaders
  13337. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13338. }
  13339. // Do executes the "youtube.liveBroadcasts.delete" call.
  13340. func (c *LiveBroadcastsDeleteCall) Do(opts ...googleapi.CallOption) error {
  13341. gensupport.SetOptions(c.urlParams_, opts...)
  13342. res, err := c.doRequest("json")
  13343. if err != nil {
  13344. return err
  13345. }
  13346. defer googleapi.CloseBody(res)
  13347. if err := googleapi.CheckResponse(res); err != nil {
  13348. return err
  13349. }
  13350. return nil
  13351. // {
  13352. // "description": "Deletes a broadcast.",
  13353. // "httpMethod": "DELETE",
  13354. // "id": "youtube.liveBroadcasts.delete",
  13355. // "parameterOrder": [
  13356. // "id"
  13357. // ],
  13358. // "parameters": {
  13359. // "id": {
  13360. // "description": "The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.",
  13361. // "location": "query",
  13362. // "required": true,
  13363. // "type": "string"
  13364. // },
  13365. // "onBehalfOfContentOwner": {
  13366. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13367. // "location": "query",
  13368. // "type": "string"
  13369. // },
  13370. // "onBehalfOfContentOwnerChannel": {
  13371. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13372. // "location": "query",
  13373. // "type": "string"
  13374. // }
  13375. // },
  13376. // "path": "liveBroadcasts",
  13377. // "scopes": [
  13378. // "https://www.googleapis.com/auth/youtube",
  13379. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13380. // ]
  13381. // }
  13382. }
  13383. // method id "youtube.liveBroadcasts.insert":
  13384. type LiveBroadcastsInsertCall struct {
  13385. s *Service
  13386. livebroadcast *LiveBroadcast
  13387. urlParams_ gensupport.URLParams
  13388. ctx_ context.Context
  13389. header_ http.Header
  13390. }
  13391. // Insert: Creates a broadcast.
  13392. func (r *LiveBroadcastsService) Insert(part string, livebroadcast *LiveBroadcast) *LiveBroadcastsInsertCall {
  13393. c := &LiveBroadcastsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13394. c.urlParams_.Set("part", part)
  13395. c.livebroadcast = livebroadcast
  13396. return c
  13397. }
  13398. // OnBehalfOfContentOwner sets the optional parameter
  13399. // "onBehalfOfContentOwner": Note: This parameter is intended
  13400. // exclusively for YouTube content partners.
  13401. //
  13402. // The onBehalfOfContentOwner parameter indicates that the request's
  13403. // authorization credentials identify a YouTube CMS user who is acting
  13404. // on behalf of the content owner specified in the parameter value. This
  13405. // parameter is intended for YouTube content partners that own and
  13406. // manage many different YouTube channels. It allows content owners to
  13407. // authenticate once and get access to all their video and channel data,
  13408. // without having to provide authentication credentials for each
  13409. // individual channel. The CMS account that the user authenticates with
  13410. // must be linked to the specified YouTube content owner.
  13411. func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsInsertCall {
  13412. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13413. return c
  13414. }
  13415. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13416. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13417. // properly authorized request. Note: This parameter is intended
  13418. // exclusively for YouTube content partners.
  13419. //
  13420. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13421. // channel ID of the channel to which a video is being added. This
  13422. // parameter is required when a request specifies a value for the
  13423. // onBehalfOfContentOwner parameter, and it can only be used in
  13424. // conjunction with that parameter. In addition, the request must be
  13425. // authorized using a CMS account that is linked to the content owner
  13426. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13427. // channel that the onBehalfOfContentOwnerChannel parameter value
  13428. // specifies must be linked to the content owner that the
  13429. // onBehalfOfContentOwner parameter specifies.
  13430. //
  13431. // This parameter is intended for YouTube content partners that own and
  13432. // manage many different YouTube channels. It allows content owners to
  13433. // authenticate once and perform actions on behalf of the channel
  13434. // specified in the parameter value, without having to provide
  13435. // authentication credentials for each separate channel.
  13436. func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsInsertCall {
  13437. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13438. return c
  13439. }
  13440. // Fields allows partial responses to be retrieved. See
  13441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13442. // for more information.
  13443. func (c *LiveBroadcastsInsertCall) Fields(s ...googleapi.Field) *LiveBroadcastsInsertCall {
  13444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13445. return c
  13446. }
  13447. // Context sets the context to be used in this call's Do method. Any
  13448. // pending HTTP request will be aborted if the provided context is
  13449. // canceled.
  13450. func (c *LiveBroadcastsInsertCall) Context(ctx context.Context) *LiveBroadcastsInsertCall {
  13451. c.ctx_ = ctx
  13452. return c
  13453. }
  13454. // Header returns an http.Header that can be modified by the caller to
  13455. // add HTTP headers to the request.
  13456. func (c *LiveBroadcastsInsertCall) Header() http.Header {
  13457. if c.header_ == nil {
  13458. c.header_ = make(http.Header)
  13459. }
  13460. return c.header_
  13461. }
  13462. func (c *LiveBroadcastsInsertCall) doRequest(alt string) (*http.Response, error) {
  13463. reqHeaders := make(http.Header)
  13464. for k, v := range c.header_ {
  13465. reqHeaders[k] = v
  13466. }
  13467. reqHeaders.Set("User-Agent", c.s.userAgent())
  13468. var body io.Reader = nil
  13469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast)
  13470. if err != nil {
  13471. return nil, err
  13472. }
  13473. reqHeaders.Set("Content-Type", "application/json")
  13474. c.urlParams_.Set("alt", alt)
  13475. c.urlParams_.Set("prettyPrint", "false")
  13476. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13477. urls += "?" + c.urlParams_.Encode()
  13478. req, err := http.NewRequest("POST", urls, body)
  13479. if err != nil {
  13480. return nil, err
  13481. }
  13482. req.Header = reqHeaders
  13483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13484. }
  13485. // Do executes the "youtube.liveBroadcasts.insert" call.
  13486. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  13487. // status code is an error. Response headers are in either
  13488. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  13489. // at all) in error.(*googleapi.Error).Header. Use
  13490. // googleapi.IsNotModified to check whether the returned error was
  13491. // because http.StatusNotModified was returned.
  13492. func (c *LiveBroadcastsInsertCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  13493. gensupport.SetOptions(c.urlParams_, opts...)
  13494. res, err := c.doRequest("json")
  13495. if res != nil && res.StatusCode == http.StatusNotModified {
  13496. if res.Body != nil {
  13497. res.Body.Close()
  13498. }
  13499. return nil, &googleapi.Error{
  13500. Code: res.StatusCode,
  13501. Header: res.Header,
  13502. }
  13503. }
  13504. if err != nil {
  13505. return nil, err
  13506. }
  13507. defer googleapi.CloseBody(res)
  13508. if err := googleapi.CheckResponse(res); err != nil {
  13509. return nil, err
  13510. }
  13511. ret := &LiveBroadcast{
  13512. ServerResponse: googleapi.ServerResponse{
  13513. Header: res.Header,
  13514. HTTPStatusCode: res.StatusCode,
  13515. },
  13516. }
  13517. target := &ret
  13518. if err := gensupport.DecodeResponse(target, res); err != nil {
  13519. return nil, err
  13520. }
  13521. return ret, nil
  13522. // {
  13523. // "description": "Creates a broadcast.",
  13524. // "httpMethod": "POST",
  13525. // "id": "youtube.liveBroadcasts.insert",
  13526. // "parameterOrder": [
  13527. // "part"
  13528. // ],
  13529. // "parameters": {
  13530. // "onBehalfOfContentOwner": {
  13531. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13532. // "location": "query",
  13533. // "type": "string"
  13534. // },
  13535. // "onBehalfOfContentOwnerChannel": {
  13536. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13537. // "location": "query",
  13538. // "type": "string"
  13539. // },
  13540. // "part": {
  13541. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.",
  13542. // "location": "query",
  13543. // "required": true,
  13544. // "type": "string"
  13545. // }
  13546. // },
  13547. // "path": "liveBroadcasts",
  13548. // "request": {
  13549. // "$ref": "LiveBroadcast"
  13550. // },
  13551. // "response": {
  13552. // "$ref": "LiveBroadcast"
  13553. // },
  13554. // "scopes": [
  13555. // "https://www.googleapis.com/auth/youtube",
  13556. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13557. // ]
  13558. // }
  13559. }
  13560. // method id "youtube.liveBroadcasts.list":
  13561. type LiveBroadcastsListCall struct {
  13562. s *Service
  13563. urlParams_ gensupport.URLParams
  13564. ifNoneMatch_ string
  13565. ctx_ context.Context
  13566. header_ http.Header
  13567. }
  13568. // List: Returns a list of YouTube broadcasts that match the API request
  13569. // parameters.
  13570. func (r *LiveBroadcastsService) List(part string) *LiveBroadcastsListCall {
  13571. c := &LiveBroadcastsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13572. c.urlParams_.Set("part", part)
  13573. return c
  13574. }
  13575. // BroadcastStatus sets the optional parameter "broadcastStatus": The
  13576. // broadcastStatus parameter filters the API response to only include
  13577. // broadcasts with the specified status.
  13578. //
  13579. // Possible values:
  13580. // "active" - Return current live broadcasts.
  13581. // "all" - Return all broadcasts.
  13582. // "completed" - Return broadcasts that have already ended.
  13583. // "upcoming" - Return broadcasts that have not yet started.
  13584. func (c *LiveBroadcastsListCall) BroadcastStatus(broadcastStatus string) *LiveBroadcastsListCall {
  13585. c.urlParams_.Set("broadcastStatus", broadcastStatus)
  13586. return c
  13587. }
  13588. // BroadcastType sets the optional parameter "broadcastType": The
  13589. // broadcastType parameter filters the API response to only include
  13590. // broadcasts with the specified type. This is only compatible with the
  13591. // mine filter for now.
  13592. //
  13593. // Possible values:
  13594. // "all" - Return all broadcasts.
  13595. // "event" - Return only scheduled event broadcasts.
  13596. // "persistent" - Return only persistent broadcasts.
  13597. func (c *LiveBroadcastsListCall) BroadcastType(broadcastType string) *LiveBroadcastsListCall {
  13598. c.urlParams_.Set("broadcastType", broadcastType)
  13599. return c
  13600. }
  13601. // Id sets the optional parameter "id": The id parameter specifies a
  13602. // comma-separated list of YouTube broadcast IDs that identify the
  13603. // broadcasts being retrieved. In a liveBroadcast resource, the id
  13604. // property specifies the broadcast's ID.
  13605. func (c *LiveBroadcastsListCall) Id(id string) *LiveBroadcastsListCall {
  13606. c.urlParams_.Set("id", id)
  13607. return c
  13608. }
  13609. // MaxResults sets the optional parameter "maxResults": The maxResults
  13610. // parameter specifies the maximum number of items that should be
  13611. // returned in the result set.
  13612. func (c *LiveBroadcastsListCall) MaxResults(maxResults int64) *LiveBroadcastsListCall {
  13613. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13614. return c
  13615. }
  13616. // Mine sets the optional parameter "mine": The mine parameter can be
  13617. // used to instruct the API to only return broadcasts owned by the
  13618. // authenticated user. Set the parameter value to true to only retrieve
  13619. // your own broadcasts.
  13620. func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall {
  13621. c.urlParams_.Set("mine", fmt.Sprint(mine))
  13622. return c
  13623. }
  13624. // OnBehalfOfContentOwner sets the optional parameter
  13625. // "onBehalfOfContentOwner": Note: This parameter is intended
  13626. // exclusively for YouTube content partners.
  13627. //
  13628. // The onBehalfOfContentOwner parameter indicates that the request's
  13629. // authorization credentials identify a YouTube CMS user who is acting
  13630. // on behalf of the content owner specified in the parameter value. This
  13631. // parameter is intended for YouTube content partners that own and
  13632. // manage many different YouTube channels. It allows content owners to
  13633. // authenticate once and get access to all their video and channel data,
  13634. // without having to provide authentication credentials for each
  13635. // individual channel. The CMS account that the user authenticates with
  13636. // must be linked to the specified YouTube content owner.
  13637. func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsListCall {
  13638. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13639. return c
  13640. }
  13641. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13642. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13643. // properly authorized request. Note: This parameter is intended
  13644. // exclusively for YouTube content partners.
  13645. //
  13646. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13647. // channel ID of the channel to which a video is being added. This
  13648. // parameter is required when a request specifies a value for the
  13649. // onBehalfOfContentOwner parameter, and it can only be used in
  13650. // conjunction with that parameter. In addition, the request must be
  13651. // authorized using a CMS account that is linked to the content owner
  13652. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13653. // channel that the onBehalfOfContentOwnerChannel parameter value
  13654. // specifies must be linked to the content owner that the
  13655. // onBehalfOfContentOwner parameter specifies.
  13656. //
  13657. // This parameter is intended for YouTube content partners that own and
  13658. // manage many different YouTube channels. It allows content owners to
  13659. // authenticate once and perform actions on behalf of the channel
  13660. // specified in the parameter value, without having to provide
  13661. // authentication credentials for each separate channel.
  13662. func (c *LiveBroadcastsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsListCall {
  13663. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13664. return c
  13665. }
  13666. // PageToken sets the optional parameter "pageToken": The pageToken
  13667. // parameter identifies a specific page in the result set that should be
  13668. // returned. In an API response, the nextPageToken and prevPageToken
  13669. // properties identify other pages that could be retrieved.
  13670. func (c *LiveBroadcastsListCall) PageToken(pageToken string) *LiveBroadcastsListCall {
  13671. c.urlParams_.Set("pageToken", pageToken)
  13672. return c
  13673. }
  13674. // Fields allows partial responses to be retrieved. See
  13675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13676. // for more information.
  13677. func (c *LiveBroadcastsListCall) Fields(s ...googleapi.Field) *LiveBroadcastsListCall {
  13678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13679. return c
  13680. }
  13681. // IfNoneMatch sets the optional parameter which makes the operation
  13682. // fail if the object's ETag matches the given value. This is useful for
  13683. // getting updates only after the object has changed since the last
  13684. // request. Use googleapi.IsNotModified to check whether the response
  13685. // error from Do is the result of In-None-Match.
  13686. func (c *LiveBroadcastsListCall) IfNoneMatch(entityTag string) *LiveBroadcastsListCall {
  13687. c.ifNoneMatch_ = entityTag
  13688. return c
  13689. }
  13690. // Context sets the context to be used in this call's Do method. Any
  13691. // pending HTTP request will be aborted if the provided context is
  13692. // canceled.
  13693. func (c *LiveBroadcastsListCall) Context(ctx context.Context) *LiveBroadcastsListCall {
  13694. c.ctx_ = ctx
  13695. return c
  13696. }
  13697. // Header returns an http.Header that can be modified by the caller to
  13698. // add HTTP headers to the request.
  13699. func (c *LiveBroadcastsListCall) Header() http.Header {
  13700. if c.header_ == nil {
  13701. c.header_ = make(http.Header)
  13702. }
  13703. return c.header_
  13704. }
  13705. func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) {
  13706. reqHeaders := make(http.Header)
  13707. for k, v := range c.header_ {
  13708. reqHeaders[k] = v
  13709. }
  13710. reqHeaders.Set("User-Agent", c.s.userAgent())
  13711. if c.ifNoneMatch_ != "" {
  13712. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13713. }
  13714. var body io.Reader = nil
  13715. c.urlParams_.Set("alt", alt)
  13716. c.urlParams_.Set("prettyPrint", "false")
  13717. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13718. urls += "?" + c.urlParams_.Encode()
  13719. req, err := http.NewRequest("GET", urls, body)
  13720. if err != nil {
  13721. return nil, err
  13722. }
  13723. req.Header = reqHeaders
  13724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13725. }
  13726. // Do executes the "youtube.liveBroadcasts.list" call.
  13727. // Exactly one of *LiveBroadcastListResponse or error will be non-nil.
  13728. // Any non-2xx status code is an error. Response headers are in either
  13729. // *LiveBroadcastListResponse.ServerResponse.Header or (if a response
  13730. // was returned at all) in error.(*googleapi.Error).Header. Use
  13731. // googleapi.IsNotModified to check whether the returned error was
  13732. // because http.StatusNotModified was returned.
  13733. func (c *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcastListResponse, error) {
  13734. gensupport.SetOptions(c.urlParams_, opts...)
  13735. res, err := c.doRequest("json")
  13736. if res != nil && res.StatusCode == http.StatusNotModified {
  13737. if res.Body != nil {
  13738. res.Body.Close()
  13739. }
  13740. return nil, &googleapi.Error{
  13741. Code: res.StatusCode,
  13742. Header: res.Header,
  13743. }
  13744. }
  13745. if err != nil {
  13746. return nil, err
  13747. }
  13748. defer googleapi.CloseBody(res)
  13749. if err := googleapi.CheckResponse(res); err != nil {
  13750. return nil, err
  13751. }
  13752. ret := &LiveBroadcastListResponse{
  13753. ServerResponse: googleapi.ServerResponse{
  13754. Header: res.Header,
  13755. HTTPStatusCode: res.StatusCode,
  13756. },
  13757. }
  13758. target := &ret
  13759. if err := gensupport.DecodeResponse(target, res); err != nil {
  13760. return nil, err
  13761. }
  13762. return ret, nil
  13763. // {
  13764. // "description": "Returns a list of YouTube broadcasts that match the API request parameters.",
  13765. // "httpMethod": "GET",
  13766. // "id": "youtube.liveBroadcasts.list",
  13767. // "parameterOrder": [
  13768. // "part"
  13769. // ],
  13770. // "parameters": {
  13771. // "broadcastStatus": {
  13772. // "description": "The broadcastStatus parameter filters the API response to only include broadcasts with the specified status.",
  13773. // "enum": [
  13774. // "active",
  13775. // "all",
  13776. // "completed",
  13777. // "upcoming"
  13778. // ],
  13779. // "enumDescriptions": [
  13780. // "Return current live broadcasts.",
  13781. // "Return all broadcasts.",
  13782. // "Return broadcasts that have already ended.",
  13783. // "Return broadcasts that have not yet started."
  13784. // ],
  13785. // "location": "query",
  13786. // "type": "string"
  13787. // },
  13788. // "broadcastType": {
  13789. // "default": "BROADCAST_TYPE_FILTER_EVENT",
  13790. // "description": "The broadcastType parameter filters the API response to only include broadcasts with the specified type. This is only compatible with the mine filter for now.",
  13791. // "enum": [
  13792. // "all",
  13793. // "event",
  13794. // "persistent"
  13795. // ],
  13796. // "enumDescriptions": [
  13797. // "Return all broadcasts.",
  13798. // "Return only scheduled event broadcasts.",
  13799. // "Return only persistent broadcasts."
  13800. // ],
  13801. // "location": "query",
  13802. // "type": "string"
  13803. // },
  13804. // "id": {
  13805. // "description": "The id parameter specifies a comma-separated list of YouTube broadcast IDs that identify the broadcasts being retrieved. In a liveBroadcast resource, the id property specifies the broadcast's ID.",
  13806. // "location": "query",
  13807. // "type": "string"
  13808. // },
  13809. // "maxResults": {
  13810. // "default": "5",
  13811. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  13812. // "format": "uint32",
  13813. // "location": "query",
  13814. // "maximum": "50",
  13815. // "minimum": "0",
  13816. // "type": "integer"
  13817. // },
  13818. // "mine": {
  13819. // "description": "The mine parameter can be used to instruct the API to only return broadcasts owned by the authenticated user. Set the parameter value to true to only retrieve your own broadcasts.",
  13820. // "location": "query",
  13821. // "type": "boolean"
  13822. // },
  13823. // "onBehalfOfContentOwner": {
  13824. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  13825. // "location": "query",
  13826. // "type": "string"
  13827. // },
  13828. // "onBehalfOfContentOwnerChannel": {
  13829. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  13830. // "location": "query",
  13831. // "type": "string"
  13832. // },
  13833. // "pageToken": {
  13834. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  13835. // "location": "query",
  13836. // "type": "string"
  13837. // },
  13838. // "part": {
  13839. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  13840. // "location": "query",
  13841. // "required": true,
  13842. // "type": "string"
  13843. // }
  13844. // },
  13845. // "path": "liveBroadcasts",
  13846. // "response": {
  13847. // "$ref": "LiveBroadcastListResponse"
  13848. // },
  13849. // "scopes": [
  13850. // "https://www.googleapis.com/auth/youtube",
  13851. // "https://www.googleapis.com/auth/youtube.force-ssl",
  13852. // "https://www.googleapis.com/auth/youtube.readonly"
  13853. // ]
  13854. // }
  13855. }
  13856. // Pages invokes f for each page of results.
  13857. // A non-nil error returned from f will halt the iteration.
  13858. // The provided context supersedes any context provided to the Context method.
  13859. func (c *LiveBroadcastsListCall) Pages(ctx context.Context, f func(*LiveBroadcastListResponse) error) error {
  13860. c.ctx_ = ctx
  13861. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13862. for {
  13863. x, err := c.Do()
  13864. if err != nil {
  13865. return err
  13866. }
  13867. if err := f(x); err != nil {
  13868. return err
  13869. }
  13870. if x.NextPageToken == "" {
  13871. return nil
  13872. }
  13873. c.PageToken(x.NextPageToken)
  13874. }
  13875. }
  13876. // method id "youtube.liveBroadcasts.transition":
  13877. type LiveBroadcastsTransitionCall struct {
  13878. s *Service
  13879. urlParams_ gensupport.URLParams
  13880. ctx_ context.Context
  13881. header_ http.Header
  13882. }
  13883. // Transition: Changes the status of a YouTube live broadcast and
  13884. // initiates any processes associated with the new status. For example,
  13885. // when you transition a broadcast's status to testing, YouTube starts
  13886. // to transmit video to that broadcast's monitor stream. Before calling
  13887. // this method, you should confirm that the value of the
  13888. // status.streamStatus property for the stream bound to your broadcast
  13889. // is active.
  13890. func (r *LiveBroadcastsService) Transition(broadcastStatus string, id string, part string) *LiveBroadcastsTransitionCall {
  13891. c := &LiveBroadcastsTransitionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13892. c.urlParams_.Set("broadcastStatus", broadcastStatus)
  13893. c.urlParams_.Set("id", id)
  13894. c.urlParams_.Set("part", part)
  13895. return c
  13896. }
  13897. // OnBehalfOfContentOwner sets the optional parameter
  13898. // "onBehalfOfContentOwner": Note: This parameter is intended
  13899. // exclusively for YouTube content partners.
  13900. //
  13901. // The onBehalfOfContentOwner parameter indicates that the request's
  13902. // authorization credentials identify a YouTube CMS user who is acting
  13903. // on behalf of the content owner specified in the parameter value. This
  13904. // parameter is intended for YouTube content partners that own and
  13905. // manage many different YouTube channels. It allows content owners to
  13906. // authenticate once and get access to all their video and channel data,
  13907. // without having to provide authentication credentials for each
  13908. // individual channel. The CMS account that the user authenticates with
  13909. // must be linked to the specified YouTube content owner.
  13910. func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsTransitionCall {
  13911. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13912. return c
  13913. }
  13914. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13915. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13916. // properly authorized request. Note: This parameter is intended
  13917. // exclusively for YouTube content partners.
  13918. //
  13919. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13920. // channel ID of the channel to which a video is being added. This
  13921. // parameter is required when a request specifies a value for the
  13922. // onBehalfOfContentOwner parameter, and it can only be used in
  13923. // conjunction with that parameter. In addition, the request must be
  13924. // authorized using a CMS account that is linked to the content owner
  13925. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13926. // channel that the onBehalfOfContentOwnerChannel parameter value
  13927. // specifies must be linked to the content owner that the
  13928. // onBehalfOfContentOwner parameter specifies.
  13929. //
  13930. // This parameter is intended for YouTube content partners that own and
  13931. // manage many different YouTube channels. It allows content owners to
  13932. // authenticate once and perform actions on behalf of the channel
  13933. // specified in the parameter value, without having to provide
  13934. // authentication credentials for each separate channel.
  13935. func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsTransitionCall {
  13936. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13937. return c
  13938. }
  13939. // Fields allows partial responses to be retrieved. See
  13940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13941. // for more information.
  13942. func (c *LiveBroadcastsTransitionCall) Fields(s ...googleapi.Field) *LiveBroadcastsTransitionCall {
  13943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13944. return c
  13945. }
  13946. // Context sets the context to be used in this call's Do method. Any
  13947. // pending HTTP request will be aborted if the provided context is
  13948. // canceled.
  13949. func (c *LiveBroadcastsTransitionCall) Context(ctx context.Context) *LiveBroadcastsTransitionCall {
  13950. c.ctx_ = ctx
  13951. return c
  13952. }
  13953. // Header returns an http.Header that can be modified by the caller to
  13954. // add HTTP headers to the request.
  13955. func (c *LiveBroadcastsTransitionCall) Header() http.Header {
  13956. if c.header_ == nil {
  13957. c.header_ = make(http.Header)
  13958. }
  13959. return c.header_
  13960. }
  13961. func (c *LiveBroadcastsTransitionCall) doRequest(alt string) (*http.Response, error) {
  13962. reqHeaders := make(http.Header)
  13963. for k, v := range c.header_ {
  13964. reqHeaders[k] = v
  13965. }
  13966. reqHeaders.Set("User-Agent", c.s.userAgent())
  13967. var body io.Reader = nil
  13968. c.urlParams_.Set("alt", alt)
  13969. c.urlParams_.Set("prettyPrint", "false")
  13970. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/transition")
  13971. urls += "?" + c.urlParams_.Encode()
  13972. req, err := http.NewRequest("POST", urls, body)
  13973. if err != nil {
  13974. return nil, err
  13975. }
  13976. req.Header = reqHeaders
  13977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13978. }
  13979. // Do executes the "youtube.liveBroadcasts.transition" call.
  13980. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  13981. // status code is an error. Response headers are in either
  13982. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  13983. // at all) in error.(*googleapi.Error).Header. Use
  13984. // googleapi.IsNotModified to check whether the returned error was
  13985. // because http.StatusNotModified was returned.
  13986. func (c *LiveBroadcastsTransitionCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  13987. gensupport.SetOptions(c.urlParams_, opts...)
  13988. res, err := c.doRequest("json")
  13989. if res != nil && res.StatusCode == http.StatusNotModified {
  13990. if res.Body != nil {
  13991. res.Body.Close()
  13992. }
  13993. return nil, &googleapi.Error{
  13994. Code: res.StatusCode,
  13995. Header: res.Header,
  13996. }
  13997. }
  13998. if err != nil {
  13999. return nil, err
  14000. }
  14001. defer googleapi.CloseBody(res)
  14002. if err := googleapi.CheckResponse(res); err != nil {
  14003. return nil, err
  14004. }
  14005. ret := &LiveBroadcast{
  14006. ServerResponse: googleapi.ServerResponse{
  14007. Header: res.Header,
  14008. HTTPStatusCode: res.StatusCode,
  14009. },
  14010. }
  14011. target := &ret
  14012. if err := gensupport.DecodeResponse(target, res); err != nil {
  14013. return nil, err
  14014. }
  14015. return ret, nil
  14016. // {
  14017. // "description": "Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active.",
  14018. // "httpMethod": "POST",
  14019. // "id": "youtube.liveBroadcasts.transition",
  14020. // "parameterOrder": [
  14021. // "broadcastStatus",
  14022. // "id",
  14023. // "part"
  14024. // ],
  14025. // "parameters": {
  14026. // "broadcastStatus": {
  14027. // "description": "The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to.",
  14028. // "enum": [
  14029. // "complete",
  14030. // "live",
  14031. // "testing"
  14032. // ],
  14033. // "enumDescriptions": [
  14034. // "The broadcast is over. YouTube stops transmitting video.",
  14035. // "The broadcast is visible to its audience. YouTube transmits video to the broadcast's monitor stream and its broadcast stream.",
  14036. // "Start testing the broadcast. YouTube transmits video to the broadcast's monitor stream. Note that you can only transition a broadcast to the testing state if its contentDetails.monitorStream.enableMonitorStream property is set to true."
  14037. // ],
  14038. // "location": "query",
  14039. // "required": true,
  14040. // "type": "string"
  14041. // },
  14042. // "id": {
  14043. // "description": "The id parameter specifies the unique ID of the broadcast that is transitioning to another status.",
  14044. // "location": "query",
  14045. // "required": true,
  14046. // "type": "string"
  14047. // },
  14048. // "onBehalfOfContentOwner": {
  14049. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14050. // "location": "query",
  14051. // "type": "string"
  14052. // },
  14053. // "onBehalfOfContentOwnerChannel": {
  14054. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  14055. // "location": "query",
  14056. // "type": "string"
  14057. // },
  14058. // "part": {
  14059. // "description": "The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status.",
  14060. // "location": "query",
  14061. // "required": true,
  14062. // "type": "string"
  14063. // }
  14064. // },
  14065. // "path": "liveBroadcasts/transition",
  14066. // "response": {
  14067. // "$ref": "LiveBroadcast"
  14068. // },
  14069. // "scopes": [
  14070. // "https://www.googleapis.com/auth/youtube",
  14071. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14072. // ]
  14073. // }
  14074. }
  14075. // method id "youtube.liveBroadcasts.update":
  14076. type LiveBroadcastsUpdateCall struct {
  14077. s *Service
  14078. livebroadcast *LiveBroadcast
  14079. urlParams_ gensupport.URLParams
  14080. ctx_ context.Context
  14081. header_ http.Header
  14082. }
  14083. // Update: Updates a broadcast. For example, you could modify the
  14084. // broadcast settings defined in the liveBroadcast resource's
  14085. // contentDetails object.
  14086. func (r *LiveBroadcastsService) Update(part string, livebroadcast *LiveBroadcast) *LiveBroadcastsUpdateCall {
  14087. c := &LiveBroadcastsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14088. c.urlParams_.Set("part", part)
  14089. c.livebroadcast = livebroadcast
  14090. return c
  14091. }
  14092. // OnBehalfOfContentOwner sets the optional parameter
  14093. // "onBehalfOfContentOwner": Note: This parameter is intended
  14094. // exclusively for YouTube content partners.
  14095. //
  14096. // The onBehalfOfContentOwner parameter indicates that the request's
  14097. // authorization credentials identify a YouTube CMS user who is acting
  14098. // on behalf of the content owner specified in the parameter value. This
  14099. // parameter is intended for YouTube content partners that own and
  14100. // manage many different YouTube channels. It allows content owners to
  14101. // authenticate once and get access to all their video and channel data,
  14102. // without having to provide authentication credentials for each
  14103. // individual channel. The CMS account that the user authenticates with
  14104. // must be linked to the specified YouTube content owner.
  14105. func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsUpdateCall {
  14106. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  14107. return c
  14108. }
  14109. // OnBehalfOfContentOwnerChannel sets the optional parameter
  14110. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  14111. // properly authorized request. Note: This parameter is intended
  14112. // exclusively for YouTube content partners.
  14113. //
  14114. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  14115. // channel ID of the channel to which a video is being added. This
  14116. // parameter is required when a request specifies a value for the
  14117. // onBehalfOfContentOwner parameter, and it can only be used in
  14118. // conjunction with that parameter. In addition, the request must be
  14119. // authorized using a CMS account that is linked to the content owner
  14120. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  14121. // channel that the onBehalfOfContentOwnerChannel parameter value
  14122. // specifies must be linked to the content owner that the
  14123. // onBehalfOfContentOwner parameter specifies.
  14124. //
  14125. // This parameter is intended for YouTube content partners that own and
  14126. // manage many different YouTube channels. It allows content owners to
  14127. // authenticate once and perform actions on behalf of the channel
  14128. // specified in the parameter value, without having to provide
  14129. // authentication credentials for each separate channel.
  14130. func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsUpdateCall {
  14131. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  14132. return c
  14133. }
  14134. // Fields allows partial responses to be retrieved. See
  14135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14136. // for more information.
  14137. func (c *LiveBroadcastsUpdateCall) Fields(s ...googleapi.Field) *LiveBroadcastsUpdateCall {
  14138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14139. return c
  14140. }
  14141. // Context sets the context to be used in this call's Do method. Any
  14142. // pending HTTP request will be aborted if the provided context is
  14143. // canceled.
  14144. func (c *LiveBroadcastsUpdateCall) Context(ctx context.Context) *LiveBroadcastsUpdateCall {
  14145. c.ctx_ = ctx
  14146. return c
  14147. }
  14148. // Header returns an http.Header that can be modified by the caller to
  14149. // add HTTP headers to the request.
  14150. func (c *LiveBroadcastsUpdateCall) Header() http.Header {
  14151. if c.header_ == nil {
  14152. c.header_ = make(http.Header)
  14153. }
  14154. return c.header_
  14155. }
  14156. func (c *LiveBroadcastsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14157. reqHeaders := make(http.Header)
  14158. for k, v := range c.header_ {
  14159. reqHeaders[k] = v
  14160. }
  14161. reqHeaders.Set("User-Agent", c.s.userAgent())
  14162. var body io.Reader = nil
  14163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast)
  14164. if err != nil {
  14165. return nil, err
  14166. }
  14167. reqHeaders.Set("Content-Type", "application/json")
  14168. c.urlParams_.Set("alt", alt)
  14169. c.urlParams_.Set("prettyPrint", "false")
  14170. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  14171. urls += "?" + c.urlParams_.Encode()
  14172. req, err := http.NewRequest("PUT", urls, body)
  14173. if err != nil {
  14174. return nil, err
  14175. }
  14176. req.Header = reqHeaders
  14177. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14178. }
  14179. // Do executes the "youtube.liveBroadcasts.update" call.
  14180. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  14181. // status code is an error. Response headers are in either
  14182. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  14183. // at all) in error.(*googleapi.Error).Header. Use
  14184. // googleapi.IsNotModified to check whether the returned error was
  14185. // because http.StatusNotModified was returned.
  14186. func (c *LiveBroadcastsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  14187. gensupport.SetOptions(c.urlParams_, opts...)
  14188. res, err := c.doRequest("json")
  14189. if res != nil && res.StatusCode == http.StatusNotModified {
  14190. if res.Body != nil {
  14191. res.Body.Close()
  14192. }
  14193. return nil, &googleapi.Error{
  14194. Code: res.StatusCode,
  14195. Header: res.Header,
  14196. }
  14197. }
  14198. if err != nil {
  14199. return nil, err
  14200. }
  14201. defer googleapi.CloseBody(res)
  14202. if err := googleapi.CheckResponse(res); err != nil {
  14203. return nil, err
  14204. }
  14205. ret := &LiveBroadcast{
  14206. ServerResponse: googleapi.ServerResponse{
  14207. Header: res.Header,
  14208. HTTPStatusCode: res.StatusCode,
  14209. },
  14210. }
  14211. target := &ret
  14212. if err := gensupport.DecodeResponse(target, res); err != nil {
  14213. return nil, err
  14214. }
  14215. return ret, nil
  14216. // {
  14217. // "description": "Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object.",
  14218. // "httpMethod": "PUT",
  14219. // "id": "youtube.liveBroadcasts.update",
  14220. // "parameterOrder": [
  14221. // "part"
  14222. // ],
  14223. // "parameters": {
  14224. // "onBehalfOfContentOwner": {
  14225. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  14226. // "location": "query",
  14227. // "type": "string"
  14228. // },
  14229. // "onBehalfOfContentOwnerChannel": {
  14230. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  14231. // "location": "query",
  14232. // "type": "string"
  14233. // },
  14234. // "part": {
  14235. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, contentDetails, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a broadcast's privacy status is defined in the status part. As such, if your request is updating a private or unlisted broadcast, and the request's part parameter value includes the status part, the broadcast's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the broadcast will revert to the default privacy setting.",
  14236. // "location": "query",
  14237. // "required": true,
  14238. // "type": "string"
  14239. // }
  14240. // },
  14241. // "path": "liveBroadcasts",
  14242. // "request": {
  14243. // "$ref": "LiveBroadcast"
  14244. // },
  14245. // "response": {
  14246. // "$ref": "LiveBroadcast"
  14247. // },
  14248. // "scopes": [
  14249. // "https://www.googleapis.com/auth/youtube",
  14250. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14251. // ]
  14252. // }
  14253. }
  14254. // method id "youtube.liveChatBans.delete":
  14255. type LiveChatBansDeleteCall struct {
  14256. s *Service
  14257. urlParams_ gensupport.URLParams
  14258. ctx_ context.Context
  14259. header_ http.Header
  14260. }
  14261. // Delete: Removes a chat ban.
  14262. func (r *LiveChatBansService) Delete(id string) *LiveChatBansDeleteCall {
  14263. c := &LiveChatBansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14264. c.urlParams_.Set("id", id)
  14265. return c
  14266. }
  14267. // Fields allows partial responses to be retrieved. See
  14268. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14269. // for more information.
  14270. func (c *LiveChatBansDeleteCall) Fields(s ...googleapi.Field) *LiveChatBansDeleteCall {
  14271. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14272. return c
  14273. }
  14274. // Context sets the context to be used in this call's Do method. Any
  14275. // pending HTTP request will be aborted if the provided context is
  14276. // canceled.
  14277. func (c *LiveChatBansDeleteCall) Context(ctx context.Context) *LiveChatBansDeleteCall {
  14278. c.ctx_ = ctx
  14279. return c
  14280. }
  14281. // Header returns an http.Header that can be modified by the caller to
  14282. // add HTTP headers to the request.
  14283. func (c *LiveChatBansDeleteCall) Header() http.Header {
  14284. if c.header_ == nil {
  14285. c.header_ = make(http.Header)
  14286. }
  14287. return c.header_
  14288. }
  14289. func (c *LiveChatBansDeleteCall) doRequest(alt string) (*http.Response, error) {
  14290. reqHeaders := make(http.Header)
  14291. for k, v := range c.header_ {
  14292. reqHeaders[k] = v
  14293. }
  14294. reqHeaders.Set("User-Agent", c.s.userAgent())
  14295. var body io.Reader = nil
  14296. c.urlParams_.Set("alt", alt)
  14297. c.urlParams_.Set("prettyPrint", "false")
  14298. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/bans")
  14299. urls += "?" + c.urlParams_.Encode()
  14300. req, err := http.NewRequest("DELETE", urls, body)
  14301. if err != nil {
  14302. return nil, err
  14303. }
  14304. req.Header = reqHeaders
  14305. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14306. }
  14307. // Do executes the "youtube.liveChatBans.delete" call.
  14308. func (c *LiveChatBansDeleteCall) Do(opts ...googleapi.CallOption) error {
  14309. gensupport.SetOptions(c.urlParams_, opts...)
  14310. res, err := c.doRequest("json")
  14311. if err != nil {
  14312. return err
  14313. }
  14314. defer googleapi.CloseBody(res)
  14315. if err := googleapi.CheckResponse(res); err != nil {
  14316. return err
  14317. }
  14318. return nil
  14319. // {
  14320. // "description": "Removes a chat ban.",
  14321. // "httpMethod": "DELETE",
  14322. // "id": "youtube.liveChatBans.delete",
  14323. // "parameterOrder": [
  14324. // "id"
  14325. // ],
  14326. // "parameters": {
  14327. // "id": {
  14328. // "description": "The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat.",
  14329. // "location": "query",
  14330. // "required": true,
  14331. // "type": "string"
  14332. // }
  14333. // },
  14334. // "path": "liveChat/bans",
  14335. // "scopes": [
  14336. // "https://www.googleapis.com/auth/youtube",
  14337. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14338. // ]
  14339. // }
  14340. }
  14341. // method id "youtube.liveChatBans.insert":
  14342. type LiveChatBansInsertCall struct {
  14343. s *Service
  14344. livechatban *LiveChatBan
  14345. urlParams_ gensupport.URLParams
  14346. ctx_ context.Context
  14347. header_ http.Header
  14348. }
  14349. // Insert: Adds a new ban to the chat.
  14350. func (r *LiveChatBansService) Insert(part string, livechatban *LiveChatBan) *LiveChatBansInsertCall {
  14351. c := &LiveChatBansInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14352. c.urlParams_.Set("part", part)
  14353. c.livechatban = livechatban
  14354. return c
  14355. }
  14356. // Fields allows partial responses to be retrieved. See
  14357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14358. // for more information.
  14359. func (c *LiveChatBansInsertCall) Fields(s ...googleapi.Field) *LiveChatBansInsertCall {
  14360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14361. return c
  14362. }
  14363. // Context sets the context to be used in this call's Do method. Any
  14364. // pending HTTP request will be aborted if the provided context is
  14365. // canceled.
  14366. func (c *LiveChatBansInsertCall) Context(ctx context.Context) *LiveChatBansInsertCall {
  14367. c.ctx_ = ctx
  14368. return c
  14369. }
  14370. // Header returns an http.Header that can be modified by the caller to
  14371. // add HTTP headers to the request.
  14372. func (c *LiveChatBansInsertCall) Header() http.Header {
  14373. if c.header_ == nil {
  14374. c.header_ = make(http.Header)
  14375. }
  14376. return c.header_
  14377. }
  14378. func (c *LiveChatBansInsertCall) doRequest(alt string) (*http.Response, error) {
  14379. reqHeaders := make(http.Header)
  14380. for k, v := range c.header_ {
  14381. reqHeaders[k] = v
  14382. }
  14383. reqHeaders.Set("User-Agent", c.s.userAgent())
  14384. var body io.Reader = nil
  14385. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatban)
  14386. if err != nil {
  14387. return nil, err
  14388. }
  14389. reqHeaders.Set("Content-Type", "application/json")
  14390. c.urlParams_.Set("alt", alt)
  14391. c.urlParams_.Set("prettyPrint", "false")
  14392. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/bans")
  14393. urls += "?" + c.urlParams_.Encode()
  14394. req, err := http.NewRequest("POST", urls, body)
  14395. if err != nil {
  14396. return nil, err
  14397. }
  14398. req.Header = reqHeaders
  14399. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14400. }
  14401. // Do executes the "youtube.liveChatBans.insert" call.
  14402. // Exactly one of *LiveChatBan or error will be non-nil. Any non-2xx
  14403. // status code is an error. Response headers are in either
  14404. // *LiveChatBan.ServerResponse.Header or (if a response was returned at
  14405. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14406. // to check whether the returned error was because
  14407. // http.StatusNotModified was returned.
  14408. func (c *LiveChatBansInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatBan, error) {
  14409. gensupport.SetOptions(c.urlParams_, opts...)
  14410. res, err := c.doRequest("json")
  14411. if res != nil && res.StatusCode == http.StatusNotModified {
  14412. if res.Body != nil {
  14413. res.Body.Close()
  14414. }
  14415. return nil, &googleapi.Error{
  14416. Code: res.StatusCode,
  14417. Header: res.Header,
  14418. }
  14419. }
  14420. if err != nil {
  14421. return nil, err
  14422. }
  14423. defer googleapi.CloseBody(res)
  14424. if err := googleapi.CheckResponse(res); err != nil {
  14425. return nil, err
  14426. }
  14427. ret := &LiveChatBan{
  14428. ServerResponse: googleapi.ServerResponse{
  14429. Header: res.Header,
  14430. HTTPStatusCode: res.StatusCode,
  14431. },
  14432. }
  14433. target := &ret
  14434. if err := gensupport.DecodeResponse(target, res); err != nil {
  14435. return nil, err
  14436. }
  14437. return ret, nil
  14438. // {
  14439. // "description": "Adds a new ban to the chat.",
  14440. // "httpMethod": "POST",
  14441. // "id": "youtube.liveChatBans.insert",
  14442. // "parameterOrder": [
  14443. // "part"
  14444. // ],
  14445. // "parameters": {
  14446. // "part": {
  14447. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet.",
  14448. // "location": "query",
  14449. // "required": true,
  14450. // "type": "string"
  14451. // }
  14452. // },
  14453. // "path": "liveChat/bans",
  14454. // "request": {
  14455. // "$ref": "LiveChatBan"
  14456. // },
  14457. // "response": {
  14458. // "$ref": "LiveChatBan"
  14459. // },
  14460. // "scopes": [
  14461. // "https://www.googleapis.com/auth/youtube",
  14462. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14463. // ]
  14464. // }
  14465. }
  14466. // method id "youtube.liveChatMessages.delete":
  14467. type LiveChatMessagesDeleteCall struct {
  14468. s *Service
  14469. urlParams_ gensupport.URLParams
  14470. ctx_ context.Context
  14471. header_ http.Header
  14472. }
  14473. // Delete: Deletes a chat message.
  14474. func (r *LiveChatMessagesService) Delete(id string) *LiveChatMessagesDeleteCall {
  14475. c := &LiveChatMessagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14476. c.urlParams_.Set("id", id)
  14477. return c
  14478. }
  14479. // Fields allows partial responses to be retrieved. See
  14480. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14481. // for more information.
  14482. func (c *LiveChatMessagesDeleteCall) Fields(s ...googleapi.Field) *LiveChatMessagesDeleteCall {
  14483. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14484. return c
  14485. }
  14486. // Context sets the context to be used in this call's Do method. Any
  14487. // pending HTTP request will be aborted if the provided context is
  14488. // canceled.
  14489. func (c *LiveChatMessagesDeleteCall) Context(ctx context.Context) *LiveChatMessagesDeleteCall {
  14490. c.ctx_ = ctx
  14491. return c
  14492. }
  14493. // Header returns an http.Header that can be modified by the caller to
  14494. // add HTTP headers to the request.
  14495. func (c *LiveChatMessagesDeleteCall) Header() http.Header {
  14496. if c.header_ == nil {
  14497. c.header_ = make(http.Header)
  14498. }
  14499. return c.header_
  14500. }
  14501. func (c *LiveChatMessagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  14502. reqHeaders := make(http.Header)
  14503. for k, v := range c.header_ {
  14504. reqHeaders[k] = v
  14505. }
  14506. reqHeaders.Set("User-Agent", c.s.userAgent())
  14507. var body io.Reader = nil
  14508. c.urlParams_.Set("alt", alt)
  14509. c.urlParams_.Set("prettyPrint", "false")
  14510. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  14511. urls += "?" + c.urlParams_.Encode()
  14512. req, err := http.NewRequest("DELETE", urls, body)
  14513. if err != nil {
  14514. return nil, err
  14515. }
  14516. req.Header = reqHeaders
  14517. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14518. }
  14519. // Do executes the "youtube.liveChatMessages.delete" call.
  14520. func (c *LiveChatMessagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  14521. gensupport.SetOptions(c.urlParams_, opts...)
  14522. res, err := c.doRequest("json")
  14523. if err != nil {
  14524. return err
  14525. }
  14526. defer googleapi.CloseBody(res)
  14527. if err := googleapi.CheckResponse(res); err != nil {
  14528. return err
  14529. }
  14530. return nil
  14531. // {
  14532. // "description": "Deletes a chat message.",
  14533. // "httpMethod": "DELETE",
  14534. // "id": "youtube.liveChatMessages.delete",
  14535. // "parameterOrder": [
  14536. // "id"
  14537. // ],
  14538. // "parameters": {
  14539. // "id": {
  14540. // "description": "The id parameter specifies the YouTube chat message ID of the resource that is being deleted.",
  14541. // "location": "query",
  14542. // "required": true,
  14543. // "type": "string"
  14544. // }
  14545. // },
  14546. // "path": "liveChat/messages",
  14547. // "scopes": [
  14548. // "https://www.googleapis.com/auth/youtube",
  14549. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14550. // ]
  14551. // }
  14552. }
  14553. // method id "youtube.liveChatMessages.insert":
  14554. type LiveChatMessagesInsertCall struct {
  14555. s *Service
  14556. livechatmessage *LiveChatMessage
  14557. urlParams_ gensupport.URLParams
  14558. ctx_ context.Context
  14559. header_ http.Header
  14560. }
  14561. // Insert: Adds a message to a live chat.
  14562. func (r *LiveChatMessagesService) Insert(part string, livechatmessage *LiveChatMessage) *LiveChatMessagesInsertCall {
  14563. c := &LiveChatMessagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14564. c.urlParams_.Set("part", part)
  14565. c.livechatmessage = livechatmessage
  14566. return c
  14567. }
  14568. // Fields allows partial responses to be retrieved. See
  14569. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14570. // for more information.
  14571. func (c *LiveChatMessagesInsertCall) Fields(s ...googleapi.Field) *LiveChatMessagesInsertCall {
  14572. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14573. return c
  14574. }
  14575. // Context sets the context to be used in this call's Do method. Any
  14576. // pending HTTP request will be aborted if the provided context is
  14577. // canceled.
  14578. func (c *LiveChatMessagesInsertCall) Context(ctx context.Context) *LiveChatMessagesInsertCall {
  14579. c.ctx_ = ctx
  14580. return c
  14581. }
  14582. // Header returns an http.Header that can be modified by the caller to
  14583. // add HTTP headers to the request.
  14584. func (c *LiveChatMessagesInsertCall) Header() http.Header {
  14585. if c.header_ == nil {
  14586. c.header_ = make(http.Header)
  14587. }
  14588. return c.header_
  14589. }
  14590. func (c *LiveChatMessagesInsertCall) doRequest(alt string) (*http.Response, error) {
  14591. reqHeaders := make(http.Header)
  14592. for k, v := range c.header_ {
  14593. reqHeaders[k] = v
  14594. }
  14595. reqHeaders.Set("User-Agent", c.s.userAgent())
  14596. var body io.Reader = nil
  14597. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmessage)
  14598. if err != nil {
  14599. return nil, err
  14600. }
  14601. reqHeaders.Set("Content-Type", "application/json")
  14602. c.urlParams_.Set("alt", alt)
  14603. c.urlParams_.Set("prettyPrint", "false")
  14604. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  14605. urls += "?" + c.urlParams_.Encode()
  14606. req, err := http.NewRequest("POST", urls, body)
  14607. if err != nil {
  14608. return nil, err
  14609. }
  14610. req.Header = reqHeaders
  14611. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14612. }
  14613. // Do executes the "youtube.liveChatMessages.insert" call.
  14614. // Exactly one of *LiveChatMessage or error will be non-nil. Any non-2xx
  14615. // status code is an error. Response headers are in either
  14616. // *LiveChatMessage.ServerResponse.Header or (if a response was returned
  14617. // at all) in error.(*googleapi.Error).Header. Use
  14618. // googleapi.IsNotModified to check whether the returned error was
  14619. // because http.StatusNotModified was returned.
  14620. func (c *LiveChatMessagesInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatMessage, error) {
  14621. gensupport.SetOptions(c.urlParams_, opts...)
  14622. res, err := c.doRequest("json")
  14623. if res != nil && res.StatusCode == http.StatusNotModified {
  14624. if res.Body != nil {
  14625. res.Body.Close()
  14626. }
  14627. return nil, &googleapi.Error{
  14628. Code: res.StatusCode,
  14629. Header: res.Header,
  14630. }
  14631. }
  14632. if err != nil {
  14633. return nil, err
  14634. }
  14635. defer googleapi.CloseBody(res)
  14636. if err := googleapi.CheckResponse(res); err != nil {
  14637. return nil, err
  14638. }
  14639. ret := &LiveChatMessage{
  14640. ServerResponse: googleapi.ServerResponse{
  14641. Header: res.Header,
  14642. HTTPStatusCode: res.StatusCode,
  14643. },
  14644. }
  14645. target := &ret
  14646. if err := gensupport.DecodeResponse(target, res); err != nil {
  14647. return nil, err
  14648. }
  14649. return ret, nil
  14650. // {
  14651. // "description": "Adds a message to a live chat.",
  14652. // "httpMethod": "POST",
  14653. // "id": "youtube.liveChatMessages.insert",
  14654. // "parameterOrder": [
  14655. // "part"
  14656. // ],
  14657. // "parameters": {
  14658. // "part": {
  14659. // "description": "The part parameter serves two purposes. It identifies the properties that the write operation will set as well as the properties that the API response will include. Set the parameter value to snippet.",
  14660. // "location": "query",
  14661. // "required": true,
  14662. // "type": "string"
  14663. // }
  14664. // },
  14665. // "path": "liveChat/messages",
  14666. // "request": {
  14667. // "$ref": "LiveChatMessage"
  14668. // },
  14669. // "response": {
  14670. // "$ref": "LiveChatMessage"
  14671. // },
  14672. // "scopes": [
  14673. // "https://www.googleapis.com/auth/youtube",
  14674. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14675. // ]
  14676. // }
  14677. }
  14678. // method id "youtube.liveChatMessages.list":
  14679. type LiveChatMessagesListCall struct {
  14680. s *Service
  14681. urlParams_ gensupport.URLParams
  14682. ifNoneMatch_ string
  14683. ctx_ context.Context
  14684. header_ http.Header
  14685. }
  14686. // List: Lists live chat messages for a specific chat.
  14687. func (r *LiveChatMessagesService) List(liveChatId string, part string) *LiveChatMessagesListCall {
  14688. c := &LiveChatMessagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14689. c.urlParams_.Set("liveChatId", liveChatId)
  14690. c.urlParams_.Set("part", part)
  14691. return c
  14692. }
  14693. // Hl sets the optional parameter "hl": The hl parameter instructs the
  14694. // API to retrieve localized resource metadata for a specific
  14695. // application language that the YouTube website supports. The parameter
  14696. // value must be a language code included in the list returned by the
  14697. // i18nLanguages.list method.
  14698. //
  14699. // If localized resource details are available in that language, the
  14700. // resource's snippet.localized object will contain the localized
  14701. // values. However, if localized details are not available, the
  14702. // snippet.localized object will contain resource details in the
  14703. // resource's default language.
  14704. func (c *LiveChatMessagesListCall) Hl(hl string) *LiveChatMessagesListCall {
  14705. c.urlParams_.Set("hl", hl)
  14706. return c
  14707. }
  14708. // MaxResults sets the optional parameter "maxResults": The maxResults
  14709. // parameter specifies the maximum number of messages that should be
  14710. // returned in the result set.
  14711. func (c *LiveChatMessagesListCall) MaxResults(maxResults int64) *LiveChatMessagesListCall {
  14712. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14713. return c
  14714. }
  14715. // PageToken sets the optional parameter "pageToken": The pageToken
  14716. // parameter identifies a specific page in the result set that should be
  14717. // returned. In an API response, the nextPageToken property identify
  14718. // other pages that could be retrieved.
  14719. func (c *LiveChatMessagesListCall) PageToken(pageToken string) *LiveChatMessagesListCall {
  14720. c.urlParams_.Set("pageToken", pageToken)
  14721. return c
  14722. }
  14723. // ProfileImageSize sets the optional parameter "profileImageSize": The
  14724. // profileImageSize parameter specifies the size of the user profile
  14725. // pictures that should be returned in the result set. Default: 88.
  14726. func (c *LiveChatMessagesListCall) ProfileImageSize(profileImageSize int64) *LiveChatMessagesListCall {
  14727. c.urlParams_.Set("profileImageSize", fmt.Sprint(profileImageSize))
  14728. return c
  14729. }
  14730. // Fields allows partial responses to be retrieved. See
  14731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14732. // for more information.
  14733. func (c *LiveChatMessagesListCall) Fields(s ...googleapi.Field) *LiveChatMessagesListCall {
  14734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14735. return c
  14736. }
  14737. // IfNoneMatch sets the optional parameter which makes the operation
  14738. // fail if the object's ETag matches the given value. This is useful for
  14739. // getting updates only after the object has changed since the last
  14740. // request. Use googleapi.IsNotModified to check whether the response
  14741. // error from Do is the result of In-None-Match.
  14742. func (c *LiveChatMessagesListCall) IfNoneMatch(entityTag string) *LiveChatMessagesListCall {
  14743. c.ifNoneMatch_ = entityTag
  14744. return c
  14745. }
  14746. // Context sets the context to be used in this call's Do method. Any
  14747. // pending HTTP request will be aborted if the provided context is
  14748. // canceled.
  14749. func (c *LiveChatMessagesListCall) Context(ctx context.Context) *LiveChatMessagesListCall {
  14750. c.ctx_ = ctx
  14751. return c
  14752. }
  14753. // Header returns an http.Header that can be modified by the caller to
  14754. // add HTTP headers to the request.
  14755. func (c *LiveChatMessagesListCall) Header() http.Header {
  14756. if c.header_ == nil {
  14757. c.header_ = make(http.Header)
  14758. }
  14759. return c.header_
  14760. }
  14761. func (c *LiveChatMessagesListCall) doRequest(alt string) (*http.Response, error) {
  14762. reqHeaders := make(http.Header)
  14763. for k, v := range c.header_ {
  14764. reqHeaders[k] = v
  14765. }
  14766. reqHeaders.Set("User-Agent", c.s.userAgent())
  14767. if c.ifNoneMatch_ != "" {
  14768. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14769. }
  14770. var body io.Reader = nil
  14771. c.urlParams_.Set("alt", alt)
  14772. c.urlParams_.Set("prettyPrint", "false")
  14773. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  14774. urls += "?" + c.urlParams_.Encode()
  14775. req, err := http.NewRequest("GET", urls, body)
  14776. if err != nil {
  14777. return nil, err
  14778. }
  14779. req.Header = reqHeaders
  14780. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14781. }
  14782. // Do executes the "youtube.liveChatMessages.list" call.
  14783. // Exactly one of *LiveChatMessageListResponse or error will be non-nil.
  14784. // Any non-2xx status code is an error. Response headers are in either
  14785. // *LiveChatMessageListResponse.ServerResponse.Header or (if a response
  14786. // was returned at all) in error.(*googleapi.Error).Header. Use
  14787. // googleapi.IsNotModified to check whether the returned error was
  14788. // because http.StatusNotModified was returned.
  14789. func (c *LiveChatMessagesListCall) Do(opts ...googleapi.CallOption) (*LiveChatMessageListResponse, error) {
  14790. gensupport.SetOptions(c.urlParams_, opts...)
  14791. res, err := c.doRequest("json")
  14792. if res != nil && res.StatusCode == http.StatusNotModified {
  14793. if res.Body != nil {
  14794. res.Body.Close()
  14795. }
  14796. return nil, &googleapi.Error{
  14797. Code: res.StatusCode,
  14798. Header: res.Header,
  14799. }
  14800. }
  14801. if err != nil {
  14802. return nil, err
  14803. }
  14804. defer googleapi.CloseBody(res)
  14805. if err := googleapi.CheckResponse(res); err != nil {
  14806. return nil, err
  14807. }
  14808. ret := &LiveChatMessageListResponse{
  14809. ServerResponse: googleapi.ServerResponse{
  14810. Header: res.Header,
  14811. HTTPStatusCode: res.StatusCode,
  14812. },
  14813. }
  14814. target := &ret
  14815. if err := gensupport.DecodeResponse(target, res); err != nil {
  14816. return nil, err
  14817. }
  14818. return ret, nil
  14819. // {
  14820. // "description": "Lists live chat messages for a specific chat.",
  14821. // "httpMethod": "GET",
  14822. // "id": "youtube.liveChatMessages.list",
  14823. // "parameterOrder": [
  14824. // "liveChatId",
  14825. // "part"
  14826. // ],
  14827. // "parameters": {
  14828. // "hl": {
  14829. // "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.",
  14830. // "location": "query",
  14831. // "type": "string"
  14832. // },
  14833. // "liveChatId": {
  14834. // "description": "The liveChatId parameter specifies the ID of the chat whose messages will be returned.",
  14835. // "location": "query",
  14836. // "required": true,
  14837. // "type": "string"
  14838. // },
  14839. // "maxResults": {
  14840. // "default": "500",
  14841. // "description": "The maxResults parameter specifies the maximum number of messages that should be returned in the result set.",
  14842. // "format": "uint32",
  14843. // "location": "query",
  14844. // "maximum": "2000",
  14845. // "minimum": "200",
  14846. // "type": "integer"
  14847. // },
  14848. // "pageToken": {
  14849. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken property identify other pages that could be retrieved.",
  14850. // "location": "query",
  14851. // "type": "string"
  14852. // },
  14853. // "part": {
  14854. // "description": "The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet.",
  14855. // "location": "query",
  14856. // "required": true,
  14857. // "type": "string"
  14858. // },
  14859. // "profileImageSize": {
  14860. // "description": "The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88.",
  14861. // "format": "uint32",
  14862. // "location": "query",
  14863. // "maximum": "720",
  14864. // "minimum": "16",
  14865. // "type": "integer"
  14866. // }
  14867. // },
  14868. // "path": "liveChat/messages",
  14869. // "response": {
  14870. // "$ref": "LiveChatMessageListResponse"
  14871. // },
  14872. // "scopes": [
  14873. // "https://www.googleapis.com/auth/youtube",
  14874. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14875. // "https://www.googleapis.com/auth/youtube.readonly"
  14876. // ]
  14877. // }
  14878. }
  14879. // Pages invokes f for each page of results.
  14880. // A non-nil error returned from f will halt the iteration.
  14881. // The provided context supersedes any context provided to the Context method.
  14882. func (c *LiveChatMessagesListCall) Pages(ctx context.Context, f func(*LiveChatMessageListResponse) error) error {
  14883. c.ctx_ = ctx
  14884. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14885. for {
  14886. x, err := c.Do()
  14887. if err != nil {
  14888. return err
  14889. }
  14890. if err := f(x); err != nil {
  14891. return err
  14892. }
  14893. if x.NextPageToken == "" {
  14894. return nil
  14895. }
  14896. c.PageToken(x.NextPageToken)
  14897. }
  14898. }
  14899. // method id "youtube.liveChatModerators.delete":
  14900. type LiveChatModeratorsDeleteCall struct {
  14901. s *Service
  14902. urlParams_ gensupport.URLParams
  14903. ctx_ context.Context
  14904. header_ http.Header
  14905. }
  14906. // Delete: Removes a chat moderator.
  14907. func (r *LiveChatModeratorsService) Delete(id string) *LiveChatModeratorsDeleteCall {
  14908. c := &LiveChatModeratorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14909. c.urlParams_.Set("id", id)
  14910. return c
  14911. }
  14912. // Fields allows partial responses to be retrieved. See
  14913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14914. // for more information.
  14915. func (c *LiveChatModeratorsDeleteCall) Fields(s ...googleapi.Field) *LiveChatModeratorsDeleteCall {
  14916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14917. return c
  14918. }
  14919. // Context sets the context to be used in this call's Do method. Any
  14920. // pending HTTP request will be aborted if the provided context is
  14921. // canceled.
  14922. func (c *LiveChatModeratorsDeleteCall) Context(ctx context.Context) *LiveChatModeratorsDeleteCall {
  14923. c.ctx_ = ctx
  14924. return c
  14925. }
  14926. // Header returns an http.Header that can be modified by the caller to
  14927. // add HTTP headers to the request.
  14928. func (c *LiveChatModeratorsDeleteCall) Header() http.Header {
  14929. if c.header_ == nil {
  14930. c.header_ = make(http.Header)
  14931. }
  14932. return c.header_
  14933. }
  14934. func (c *LiveChatModeratorsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14935. reqHeaders := make(http.Header)
  14936. for k, v := range c.header_ {
  14937. reqHeaders[k] = v
  14938. }
  14939. reqHeaders.Set("User-Agent", c.s.userAgent())
  14940. var body io.Reader = nil
  14941. c.urlParams_.Set("alt", alt)
  14942. c.urlParams_.Set("prettyPrint", "false")
  14943. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  14944. urls += "?" + c.urlParams_.Encode()
  14945. req, err := http.NewRequest("DELETE", urls, body)
  14946. if err != nil {
  14947. return nil, err
  14948. }
  14949. req.Header = reqHeaders
  14950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14951. }
  14952. // Do executes the "youtube.liveChatModerators.delete" call.
  14953. func (c *LiveChatModeratorsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14954. gensupport.SetOptions(c.urlParams_, opts...)
  14955. res, err := c.doRequest("json")
  14956. if err != nil {
  14957. return err
  14958. }
  14959. defer googleapi.CloseBody(res)
  14960. if err := googleapi.CheckResponse(res); err != nil {
  14961. return err
  14962. }
  14963. return nil
  14964. // {
  14965. // "description": "Removes a chat moderator.",
  14966. // "httpMethod": "DELETE",
  14967. // "id": "youtube.liveChatModerators.delete",
  14968. // "parameterOrder": [
  14969. // "id"
  14970. // ],
  14971. // "parameters": {
  14972. // "id": {
  14973. // "description": "The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat.",
  14974. // "location": "query",
  14975. // "required": true,
  14976. // "type": "string"
  14977. // }
  14978. // },
  14979. // "path": "liveChat/moderators",
  14980. // "scopes": [
  14981. // "https://www.googleapis.com/auth/youtube",
  14982. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14983. // ]
  14984. // }
  14985. }
  14986. // method id "youtube.liveChatModerators.insert":
  14987. type LiveChatModeratorsInsertCall struct {
  14988. s *Service
  14989. livechatmoderator *LiveChatModerator
  14990. urlParams_ gensupport.URLParams
  14991. ctx_ context.Context
  14992. header_ http.Header
  14993. }
  14994. // Insert: Adds a new moderator for the chat.
  14995. func (r *LiveChatModeratorsService) Insert(part string, livechatmoderator *LiveChatModerator) *LiveChatModeratorsInsertCall {
  14996. c := &LiveChatModeratorsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14997. c.urlParams_.Set("part", part)
  14998. c.livechatmoderator = livechatmoderator
  14999. return c
  15000. }
  15001. // Fields allows partial responses to be retrieved. See
  15002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15003. // for more information.
  15004. func (c *LiveChatModeratorsInsertCall) Fields(s ...googleapi.Field) *LiveChatModeratorsInsertCall {
  15005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15006. return c
  15007. }
  15008. // Context sets the context to be used in this call's Do method. Any
  15009. // pending HTTP request will be aborted if the provided context is
  15010. // canceled.
  15011. func (c *LiveChatModeratorsInsertCall) Context(ctx context.Context) *LiveChatModeratorsInsertCall {
  15012. c.ctx_ = ctx
  15013. return c
  15014. }
  15015. // Header returns an http.Header that can be modified by the caller to
  15016. // add HTTP headers to the request.
  15017. func (c *LiveChatModeratorsInsertCall) Header() http.Header {
  15018. if c.header_ == nil {
  15019. c.header_ = make(http.Header)
  15020. }
  15021. return c.header_
  15022. }
  15023. func (c *LiveChatModeratorsInsertCall) doRequest(alt string) (*http.Response, error) {
  15024. reqHeaders := make(http.Header)
  15025. for k, v := range c.header_ {
  15026. reqHeaders[k] = v
  15027. }
  15028. reqHeaders.Set("User-Agent", c.s.userAgent())
  15029. var body io.Reader = nil
  15030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmoderator)
  15031. if err != nil {
  15032. return nil, err
  15033. }
  15034. reqHeaders.Set("Content-Type", "application/json")
  15035. c.urlParams_.Set("alt", alt)
  15036. c.urlParams_.Set("prettyPrint", "false")
  15037. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  15038. urls += "?" + c.urlParams_.Encode()
  15039. req, err := http.NewRequest("POST", urls, body)
  15040. if err != nil {
  15041. return nil, err
  15042. }
  15043. req.Header = reqHeaders
  15044. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15045. }
  15046. // Do executes the "youtube.liveChatModerators.insert" call.
  15047. // Exactly one of *LiveChatModerator or error will be non-nil. Any
  15048. // non-2xx status code is an error. Response headers are in either
  15049. // *LiveChatModerator.ServerResponse.Header or (if a response was
  15050. // returned at all) in error.(*googleapi.Error).Header. Use
  15051. // googleapi.IsNotModified to check whether the returned error was
  15052. // because http.StatusNotModified was returned.
  15053. func (c *LiveChatModeratorsInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatModerator, error) {
  15054. gensupport.SetOptions(c.urlParams_, opts...)
  15055. res, err := c.doRequest("json")
  15056. if res != nil && res.StatusCode == http.StatusNotModified {
  15057. if res.Body != nil {
  15058. res.Body.Close()
  15059. }
  15060. return nil, &googleapi.Error{
  15061. Code: res.StatusCode,
  15062. Header: res.Header,
  15063. }
  15064. }
  15065. if err != nil {
  15066. return nil, err
  15067. }
  15068. defer googleapi.CloseBody(res)
  15069. if err := googleapi.CheckResponse(res); err != nil {
  15070. return nil, err
  15071. }
  15072. ret := &LiveChatModerator{
  15073. ServerResponse: googleapi.ServerResponse{
  15074. Header: res.Header,
  15075. HTTPStatusCode: res.StatusCode,
  15076. },
  15077. }
  15078. target := &ret
  15079. if err := gensupport.DecodeResponse(target, res); err != nil {
  15080. return nil, err
  15081. }
  15082. return ret, nil
  15083. // {
  15084. // "description": "Adds a new moderator for the chat.",
  15085. // "httpMethod": "POST",
  15086. // "id": "youtube.liveChatModerators.insert",
  15087. // "parameterOrder": [
  15088. // "part"
  15089. // ],
  15090. // "parameters": {
  15091. // "part": {
  15092. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response returns. Set the parameter value to snippet.",
  15093. // "location": "query",
  15094. // "required": true,
  15095. // "type": "string"
  15096. // }
  15097. // },
  15098. // "path": "liveChat/moderators",
  15099. // "request": {
  15100. // "$ref": "LiveChatModerator"
  15101. // },
  15102. // "response": {
  15103. // "$ref": "LiveChatModerator"
  15104. // },
  15105. // "scopes": [
  15106. // "https://www.googleapis.com/auth/youtube",
  15107. // "https://www.googleapis.com/auth/youtube.force-ssl"
  15108. // ]
  15109. // }
  15110. }
  15111. // method id "youtube.liveChatModerators.list":
  15112. type LiveChatModeratorsListCall struct {
  15113. s *Service
  15114. urlParams_ gensupport.URLParams
  15115. ifNoneMatch_ string
  15116. ctx_ context.Context
  15117. header_ http.Header
  15118. }
  15119. // List: Lists moderators for a live chat.
  15120. func (r *LiveChatModeratorsService) List(liveChatId string, part string) *LiveChatModeratorsListCall {
  15121. c := &LiveChatModeratorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15122. c.urlParams_.Set("liveChatId", liveChatId)
  15123. c.urlParams_.Set("part", part)
  15124. return c
  15125. }
  15126. // MaxResults sets the optional parameter "maxResults": The maxResults
  15127. // parameter specifies the maximum number of items that should be
  15128. // returned in the result set.
  15129. func (c *LiveChatModeratorsListCall) MaxResults(maxResults int64) *LiveChatModeratorsListCall {
  15130. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15131. return c
  15132. }
  15133. // PageToken sets the optional parameter "pageToken": The pageToken
  15134. // parameter identifies a specific page in the result set that should be
  15135. // returned. In an API response, the nextPageToken and prevPageToken
  15136. // properties identify other pages that could be retrieved.
  15137. func (c *LiveChatModeratorsListCall) PageToken(pageToken string) *LiveChatModeratorsListCall {
  15138. c.urlParams_.Set("pageToken", pageToken)
  15139. return c
  15140. }
  15141. // Fields allows partial responses to be retrieved. See
  15142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15143. // for more information.
  15144. func (c *LiveChatModeratorsListCall) Fields(s ...googleapi.Field) *LiveChatModeratorsListCall {
  15145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15146. return c
  15147. }
  15148. // IfNoneMatch sets the optional parameter which makes the operation
  15149. // fail if the object's ETag matches the given value. This is useful for
  15150. // getting updates only after the object has changed since the last
  15151. // request. Use googleapi.IsNotModified to check whether the response
  15152. // error from Do is the result of In-None-Match.
  15153. func (c *LiveChatModeratorsListCall) IfNoneMatch(entityTag string) *LiveChatModeratorsListCall {
  15154. c.ifNoneMatch_ = entityTag
  15155. return c
  15156. }
  15157. // Context sets the context to be used in this call's Do method. Any
  15158. // pending HTTP request will be aborted if the provided context is
  15159. // canceled.
  15160. func (c *LiveChatModeratorsListCall) Context(ctx context.Context) *LiveChatModeratorsListCall {
  15161. c.ctx_ = ctx
  15162. return c
  15163. }
  15164. // Header returns an http.Header that can be modified by the caller to
  15165. // add HTTP headers to the request.
  15166. func (c *LiveChatModeratorsListCall) Header() http.Header {
  15167. if c.header_ == nil {
  15168. c.header_ = make(http.Header)
  15169. }
  15170. return c.header_
  15171. }
  15172. func (c *LiveChatModeratorsListCall) doRequest(alt string) (*http.Response, error) {
  15173. reqHeaders := make(http.Header)
  15174. for k, v := range c.header_ {
  15175. reqHeaders[k] = v
  15176. }
  15177. reqHeaders.Set("User-Agent", c.s.userAgent())
  15178. if c.ifNoneMatch_ != "" {
  15179. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15180. }
  15181. var body io.Reader = nil
  15182. c.urlParams_.Set("alt", alt)
  15183. c.urlParams_.Set("prettyPrint", "false")
  15184. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  15185. urls += "?" + c.urlParams_.Encode()
  15186. req, err := http.NewRequest("GET", urls, body)
  15187. if err != nil {
  15188. return nil, err
  15189. }
  15190. req.Header = reqHeaders
  15191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15192. }
  15193. // Do executes the "youtube.liveChatModerators.list" call.
  15194. // Exactly one of *LiveChatModeratorListResponse or error will be
  15195. // non-nil. Any non-2xx status code is an error. Response headers are in
  15196. // either *LiveChatModeratorListResponse.ServerResponse.Header or (if a
  15197. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15198. // googleapi.IsNotModified to check whether the returned error was
  15199. // because http.StatusNotModified was returned.
  15200. func (c *LiveChatModeratorsListCall) Do(opts ...googleapi.CallOption) (*LiveChatModeratorListResponse, error) {
  15201. gensupport.SetOptions(c.urlParams_, opts...)
  15202. res, err := c.doRequest("json")
  15203. if res != nil && res.StatusCode == http.StatusNotModified {
  15204. if res.Body != nil {
  15205. res.Body.Close()
  15206. }
  15207. return nil, &googleapi.Error{
  15208. Code: res.StatusCode,
  15209. Header: res.Header,
  15210. }
  15211. }
  15212. if err != nil {
  15213. return nil, err
  15214. }
  15215. defer googleapi.CloseBody(res)
  15216. if err := googleapi.CheckResponse(res); err != nil {
  15217. return nil, err
  15218. }
  15219. ret := &LiveChatModeratorListResponse{
  15220. ServerResponse: googleapi.ServerResponse{
  15221. Header: res.Header,
  15222. HTTPStatusCode: res.StatusCode,
  15223. },
  15224. }
  15225. target := &ret
  15226. if err := gensupport.DecodeResponse(target, res); err != nil {
  15227. return nil, err
  15228. }
  15229. return ret, nil
  15230. // {
  15231. // "description": "Lists moderators for a live chat.",
  15232. // "httpMethod": "GET",
  15233. // "id": "youtube.liveChatModerators.list",
  15234. // "parameterOrder": [
  15235. // "liveChatId",
  15236. // "part"
  15237. // ],
  15238. // "parameters": {
  15239. // "liveChatId": {
  15240. // "description": "The liveChatId parameter specifies the YouTube live chat for which the API should return moderators.",
  15241. // "location": "query",
  15242. // "required": true,
  15243. // "type": "string"
  15244. // },
  15245. // "maxResults": {
  15246. // "default": "5",
  15247. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  15248. // "format": "uint32",
  15249. // "location": "query",
  15250. // "maximum": "50",
  15251. // "minimum": "0",
  15252. // "type": "integer"
  15253. // },
  15254. // "pageToken": {
  15255. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  15256. // "location": "query",
  15257. // "type": "string"
  15258. // },
  15259. // "part": {
  15260. // "description": "The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet.",
  15261. // "location": "query",
  15262. // "required": true,
  15263. // "type": "string"
  15264. // }
  15265. // },
  15266. // "path": "liveChat/moderators",
  15267. // "response": {
  15268. // "$ref": "LiveChatModeratorListResponse"
  15269. // },
  15270. // "scopes": [
  15271. // "https://www.googleapis.com/auth/youtube",
  15272. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15273. // "https://www.googleapis.com/auth/youtube.readonly"
  15274. // ]
  15275. // }
  15276. }
  15277. // Pages invokes f for each page of results.
  15278. // A non-nil error returned from f will halt the iteration.
  15279. // The provided context supersedes any context provided to the Context method.
  15280. func (c *LiveChatModeratorsListCall) Pages(ctx context.Context, f func(*LiveChatModeratorListResponse) error) error {
  15281. c.ctx_ = ctx
  15282. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15283. for {
  15284. x, err := c.Do()
  15285. if err != nil {
  15286. return err
  15287. }
  15288. if err := f(x); err != nil {
  15289. return err
  15290. }
  15291. if x.NextPageToken == "" {
  15292. return nil
  15293. }
  15294. c.PageToken(x.NextPageToken)
  15295. }
  15296. }
  15297. // method id "youtube.liveStreams.delete":
  15298. type LiveStreamsDeleteCall struct {
  15299. s *Service
  15300. urlParams_ gensupport.URLParams
  15301. ctx_ context.Context
  15302. header_ http.Header
  15303. }
  15304. // Delete: Deletes a video stream.
  15305. func (r *LiveStreamsService) Delete(id string) *LiveStreamsDeleteCall {
  15306. c := &LiveStreamsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15307. c.urlParams_.Set("id", id)
  15308. return c
  15309. }
  15310. // OnBehalfOfContentOwner sets the optional parameter
  15311. // "onBehalfOfContentOwner": Note: This parameter is intended
  15312. // exclusively for YouTube content partners.
  15313. //
  15314. // The onBehalfOfContentOwner parameter indicates that the request's
  15315. // authorization credentials identify a YouTube CMS user who is acting
  15316. // on behalf of the content owner specified in the parameter value. This
  15317. // parameter is intended for YouTube content partners that own and
  15318. // manage many different YouTube channels. It allows content owners to
  15319. // authenticate once and get access to all their video and channel data,
  15320. // without having to provide authentication credentials for each
  15321. // individual channel. The CMS account that the user authenticates with
  15322. // must be linked to the specified YouTube content owner.
  15323. func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsDeleteCall {
  15324. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15325. return c
  15326. }
  15327. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15328. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15329. // properly authorized request. Note: This parameter is intended
  15330. // exclusively for YouTube content partners.
  15331. //
  15332. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15333. // channel ID of the channel to which a video is being added. This
  15334. // parameter is required when a request specifies a value for the
  15335. // onBehalfOfContentOwner parameter, and it can only be used in
  15336. // conjunction with that parameter. In addition, the request must be
  15337. // authorized using a CMS account that is linked to the content owner
  15338. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15339. // channel that the onBehalfOfContentOwnerChannel parameter value
  15340. // specifies must be linked to the content owner that the
  15341. // onBehalfOfContentOwner parameter specifies.
  15342. //
  15343. // This parameter is intended for YouTube content partners that own and
  15344. // manage many different YouTube channels. It allows content owners to
  15345. // authenticate once and perform actions on behalf of the channel
  15346. // specified in the parameter value, without having to provide
  15347. // authentication credentials for each separate channel.
  15348. func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsDeleteCall {
  15349. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15350. return c
  15351. }
  15352. // Fields allows partial responses to be retrieved. See
  15353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15354. // for more information.
  15355. func (c *LiveStreamsDeleteCall) Fields(s ...googleapi.Field) *LiveStreamsDeleteCall {
  15356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15357. return c
  15358. }
  15359. // Context sets the context to be used in this call's Do method. Any
  15360. // pending HTTP request will be aborted if the provided context is
  15361. // canceled.
  15362. func (c *LiveStreamsDeleteCall) Context(ctx context.Context) *LiveStreamsDeleteCall {
  15363. c.ctx_ = ctx
  15364. return c
  15365. }
  15366. // Header returns an http.Header that can be modified by the caller to
  15367. // add HTTP headers to the request.
  15368. func (c *LiveStreamsDeleteCall) Header() http.Header {
  15369. if c.header_ == nil {
  15370. c.header_ = make(http.Header)
  15371. }
  15372. return c.header_
  15373. }
  15374. func (c *LiveStreamsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15375. reqHeaders := make(http.Header)
  15376. for k, v := range c.header_ {
  15377. reqHeaders[k] = v
  15378. }
  15379. reqHeaders.Set("User-Agent", c.s.userAgent())
  15380. var body io.Reader = nil
  15381. c.urlParams_.Set("alt", alt)
  15382. c.urlParams_.Set("prettyPrint", "false")
  15383. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15384. urls += "?" + c.urlParams_.Encode()
  15385. req, err := http.NewRequest("DELETE", urls, body)
  15386. if err != nil {
  15387. return nil, err
  15388. }
  15389. req.Header = reqHeaders
  15390. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15391. }
  15392. // Do executes the "youtube.liveStreams.delete" call.
  15393. func (c *LiveStreamsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15394. gensupport.SetOptions(c.urlParams_, opts...)
  15395. res, err := c.doRequest("json")
  15396. if err != nil {
  15397. return err
  15398. }
  15399. defer googleapi.CloseBody(res)
  15400. if err := googleapi.CheckResponse(res); err != nil {
  15401. return err
  15402. }
  15403. return nil
  15404. // {
  15405. // "description": "Deletes a video stream.",
  15406. // "httpMethod": "DELETE",
  15407. // "id": "youtube.liveStreams.delete",
  15408. // "parameterOrder": [
  15409. // "id"
  15410. // ],
  15411. // "parameters": {
  15412. // "id": {
  15413. // "description": "The id parameter specifies the YouTube live stream ID for the resource that is being deleted.",
  15414. // "location": "query",
  15415. // "required": true,
  15416. // "type": "string"
  15417. // },
  15418. // "onBehalfOfContentOwner": {
  15419. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  15420. // "location": "query",
  15421. // "type": "string"
  15422. // },
  15423. // "onBehalfOfContentOwnerChannel": {
  15424. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  15425. // "location": "query",
  15426. // "type": "string"
  15427. // }
  15428. // },
  15429. // "path": "liveStreams",
  15430. // "scopes": [
  15431. // "https://www.googleapis.com/auth/youtube",
  15432. // "https://www.googleapis.com/auth/youtube.force-ssl"
  15433. // ]
  15434. // }
  15435. }
  15436. // method id "youtube.liveStreams.insert":
  15437. type LiveStreamsInsertCall struct {
  15438. s *Service
  15439. livestream *LiveStream
  15440. urlParams_ gensupport.URLParams
  15441. ctx_ context.Context
  15442. header_ http.Header
  15443. }
  15444. // Insert: Creates a video stream. The stream enables you to send your
  15445. // video to YouTube, which can then broadcast the video to your
  15446. // audience.
  15447. func (r *LiveStreamsService) Insert(part string, livestream *LiveStream) *LiveStreamsInsertCall {
  15448. c := &LiveStreamsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15449. c.urlParams_.Set("part", part)
  15450. c.livestream = livestream
  15451. return c
  15452. }
  15453. // OnBehalfOfContentOwner sets the optional parameter
  15454. // "onBehalfOfContentOwner": Note: This parameter is intended
  15455. // exclusively for YouTube content partners.
  15456. //
  15457. // The onBehalfOfContentOwner parameter indicates that the request's
  15458. // authorization credentials identify a YouTube CMS user who is acting
  15459. // on behalf of the content owner specified in the parameter value. This
  15460. // parameter is intended for YouTube content partners that own and
  15461. // manage many different YouTube channels. It allows content owners to
  15462. // authenticate once and get access to all their video and channel data,
  15463. // without having to provide authentication credentials for each
  15464. // individual channel. The CMS account that the user authenticates with
  15465. // must be linked to the specified YouTube content owner.
  15466. func (c *LiveStreamsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsInsertCall {
  15467. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15468. return c
  15469. }
  15470. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15471. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15472. // properly authorized request. Note: This parameter is intended
  15473. // exclusively for YouTube content partners.
  15474. //
  15475. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15476. // channel ID of the channel to which a video is being added. This
  15477. // parameter is required when a request specifies a value for the
  15478. // onBehalfOfContentOwner parameter, and it can only be used in
  15479. // conjunction with that parameter. In addition, the request must be
  15480. // authorized using a CMS account that is linked to the content owner
  15481. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15482. // channel that the onBehalfOfContentOwnerChannel parameter value
  15483. // specifies must be linked to the content owner that the
  15484. // onBehalfOfContentOwner parameter specifies.
  15485. //
  15486. // This parameter is intended for YouTube content partners that own and
  15487. // manage many different YouTube channels. It allows content owners to
  15488. // authenticate once and perform actions on behalf of the channel
  15489. // specified in the parameter value, without having to provide
  15490. // authentication credentials for each separate channel.
  15491. func (c *LiveStreamsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsInsertCall {
  15492. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15493. return c
  15494. }
  15495. // Fields allows partial responses to be retrieved. See
  15496. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15497. // for more information.
  15498. func (c *LiveStreamsInsertCall) Fields(s ...googleapi.Field) *LiveStreamsInsertCall {
  15499. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15500. return c
  15501. }
  15502. // Context sets the context to be used in this call's Do method. Any
  15503. // pending HTTP request will be aborted if the provided context is
  15504. // canceled.
  15505. func (c *LiveStreamsInsertCall) Context(ctx context.Context) *LiveStreamsInsertCall {
  15506. c.ctx_ = ctx
  15507. return c
  15508. }
  15509. // Header returns an http.Header that can be modified by the caller to
  15510. // add HTTP headers to the request.
  15511. func (c *LiveStreamsInsertCall) Header() http.Header {
  15512. if c.header_ == nil {
  15513. c.header_ = make(http.Header)
  15514. }
  15515. return c.header_
  15516. }
  15517. func (c *LiveStreamsInsertCall) doRequest(alt string) (*http.Response, error) {
  15518. reqHeaders := make(http.Header)
  15519. for k, v := range c.header_ {
  15520. reqHeaders[k] = v
  15521. }
  15522. reqHeaders.Set("User-Agent", c.s.userAgent())
  15523. var body io.Reader = nil
  15524. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream)
  15525. if err != nil {
  15526. return nil, err
  15527. }
  15528. reqHeaders.Set("Content-Type", "application/json")
  15529. c.urlParams_.Set("alt", alt)
  15530. c.urlParams_.Set("prettyPrint", "false")
  15531. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15532. urls += "?" + c.urlParams_.Encode()
  15533. req, err := http.NewRequest("POST", urls, body)
  15534. if err != nil {
  15535. return nil, err
  15536. }
  15537. req.Header = reqHeaders
  15538. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15539. }
  15540. // Do executes the "youtube.liveStreams.insert" call.
  15541. // Exactly one of *LiveStream or error will be non-nil. Any non-2xx
  15542. // status code is an error. Response headers are in either
  15543. // *LiveStream.ServerResponse.Header or (if a response was returned at
  15544. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15545. // to check whether the returned error was because
  15546. // http.StatusNotModified was returned.
  15547. func (c *LiveStreamsInsertCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
  15548. gensupport.SetOptions(c.urlParams_, opts...)
  15549. res, err := c.doRequest("json")
  15550. if res != nil && res.StatusCode == http.StatusNotModified {
  15551. if res.Body != nil {
  15552. res.Body.Close()
  15553. }
  15554. return nil, &googleapi.Error{
  15555. Code: res.StatusCode,
  15556. Header: res.Header,
  15557. }
  15558. }
  15559. if err != nil {
  15560. return nil, err
  15561. }
  15562. defer googleapi.CloseBody(res)
  15563. if err := googleapi.CheckResponse(res); err != nil {
  15564. return nil, err
  15565. }
  15566. ret := &LiveStream{
  15567. ServerResponse: googleapi.ServerResponse{
  15568. Header: res.Header,
  15569. HTTPStatusCode: res.StatusCode,
  15570. },
  15571. }
  15572. target := &ret
  15573. if err := gensupport.DecodeResponse(target, res); err != nil {
  15574. return nil, err
  15575. }
  15576. return ret, nil
  15577. // {
  15578. // "description": "Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience.",
  15579. // "httpMethod": "POST",
  15580. // "id": "youtube.liveStreams.insert",
  15581. // "parameterOrder": [
  15582. // "part"
  15583. // ],
  15584. // "parameters": {
  15585. // "onBehalfOfContentOwner": {
  15586. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  15587. // "location": "query",
  15588. // "type": "string"
  15589. // },
  15590. // "onBehalfOfContentOwnerChannel": {
  15591. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  15592. // "location": "query",
  15593. // "type": "string"
  15594. // },
  15595. // "part": {
  15596. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.",
  15597. // "location": "query",
  15598. // "required": true,
  15599. // "type": "string"
  15600. // }
  15601. // },
  15602. // "path": "liveStreams",
  15603. // "request": {
  15604. // "$ref": "LiveStream"
  15605. // },
  15606. // "response": {
  15607. // "$ref": "LiveStream"
  15608. // },
  15609. // "scopes": [
  15610. // "https://www.googleapis.com/auth/youtube",
  15611. // "https://www.googleapis.com/auth/youtube.force-ssl"
  15612. // ]
  15613. // }
  15614. }
  15615. // method id "youtube.liveStreams.list":
  15616. type LiveStreamsListCall struct {
  15617. s *Service
  15618. urlParams_ gensupport.URLParams
  15619. ifNoneMatch_ string
  15620. ctx_ context.Context
  15621. header_ http.Header
  15622. }
  15623. // List: Returns a list of video streams that match the API request
  15624. // parameters.
  15625. func (r *LiveStreamsService) List(part string) *LiveStreamsListCall {
  15626. c := &LiveStreamsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15627. c.urlParams_.Set("part", part)
  15628. return c
  15629. }
  15630. // Id sets the optional parameter "id": The id parameter specifies a
  15631. // comma-separated list of YouTube stream IDs that identify the streams
  15632. // being retrieved. In a liveStream resource, the id property specifies
  15633. // the stream's ID.
  15634. func (c *LiveStreamsListCall) Id(id string) *LiveStreamsListCall {
  15635. c.urlParams_.Set("id", id)
  15636. return c
  15637. }
  15638. // MaxResults sets the optional parameter "maxResults": The maxResults
  15639. // parameter specifies the maximum number of items that should be
  15640. // returned in the result set.
  15641. func (c *LiveStreamsListCall) MaxResults(maxResults int64) *LiveStreamsListCall {
  15642. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15643. return c
  15644. }
  15645. // Mine sets the optional parameter "mine": The mine parameter can be
  15646. // used to instruct the API to only return streams owned by the
  15647. // authenticated user. Set the parameter value to true to only retrieve
  15648. // your own streams.
  15649. func (c *LiveStreamsListCall) Mine(mine bool) *LiveStreamsListCall {
  15650. c.urlParams_.Set("mine", fmt.Sprint(mine))
  15651. return c
  15652. }
  15653. // OnBehalfOfContentOwner sets the optional parameter
  15654. // "onBehalfOfContentOwner": Note: This parameter is intended
  15655. // exclusively for YouTube content partners.
  15656. //
  15657. // The onBehalfOfContentOwner parameter indicates that the request's
  15658. // authorization credentials identify a YouTube CMS user who is acting
  15659. // on behalf of the content owner specified in the parameter value. This
  15660. // parameter is intended for YouTube content partners that own and
  15661. // manage many different YouTube channels. It allows content owners to
  15662. // authenticate once and get access to all their video and channel data,
  15663. // without having to provide authentication credentials for each
  15664. // individual channel. The CMS account that the user authenticates with
  15665. // must be linked to the specified YouTube content owner.
  15666. func (c *LiveStreamsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsListCall {
  15667. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15668. return c
  15669. }
  15670. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15671. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15672. // properly authorized request. Note: This parameter is intended
  15673. // exclusively for YouTube content partners.
  15674. //
  15675. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15676. // channel ID of the channel to which a video is being added. This
  15677. // parameter is required when a request specifies a value for the
  15678. // onBehalfOfContentOwner parameter, and it can only be used in
  15679. // conjunction with that parameter. In addition, the request must be
  15680. // authorized using a CMS account that is linked to the content owner
  15681. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15682. // channel that the onBehalfOfContentOwnerChannel parameter value
  15683. // specifies must be linked to the content owner that the
  15684. // onBehalfOfContentOwner parameter specifies.
  15685. //
  15686. // This parameter is intended for YouTube content partners that own and
  15687. // manage many different YouTube channels. It allows content owners to
  15688. // authenticate once and perform actions on behalf of the channel
  15689. // specified in the parameter value, without having to provide
  15690. // authentication credentials for each separate channel.
  15691. func (c *LiveStreamsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsListCall {
  15692. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15693. return c
  15694. }
  15695. // PageToken sets the optional parameter "pageToken": The pageToken
  15696. // parameter identifies a specific page in the result set that should be
  15697. // returned. In an API response, the nextPageToken and prevPageToken
  15698. // properties identify other pages that could be retrieved.
  15699. func (c *LiveStreamsListCall) PageToken(pageToken string) *LiveStreamsListCall {
  15700. c.urlParams_.Set("pageToken", pageToken)
  15701. return c
  15702. }
  15703. // Fields allows partial responses to be retrieved. See
  15704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15705. // for more information.
  15706. func (c *LiveStreamsListCall) Fields(s ...googleapi.Field) *LiveStreamsListCall {
  15707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15708. return c
  15709. }
  15710. // IfNoneMatch sets the optional parameter which makes the operation
  15711. // fail if the object's ETag matches the given value. This is useful for
  15712. // getting updates only after the object has changed since the last
  15713. // request. Use googleapi.IsNotModified to check whether the response
  15714. // error from Do is the result of In-None-Match.
  15715. func (c *LiveStreamsListCall) IfNoneMatch(entityTag string) *LiveStreamsListCall {
  15716. c.ifNoneMatch_ = entityTag
  15717. return c
  15718. }
  15719. // Context sets the context to be used in this call's Do method. Any
  15720. // pending HTTP request will be aborted if the provided context is
  15721. // canceled.
  15722. func (c *LiveStreamsListCall) Context(ctx context.Context) *LiveStreamsListCall {
  15723. c.ctx_ = ctx
  15724. return c
  15725. }
  15726. // Header returns an http.Header that can be modified by the caller to
  15727. // add HTTP headers to the request.
  15728. func (c *LiveStreamsListCall) Header() http.Header {
  15729. if c.header_ == nil {
  15730. c.header_ = make(http.Header)
  15731. }
  15732. return c.header_
  15733. }
  15734. func (c *LiveStreamsListCall) doRequest(alt string) (*http.Response, error) {
  15735. reqHeaders := make(http.Header)
  15736. for k, v := range c.header_ {
  15737. reqHeaders[k] = v
  15738. }
  15739. reqHeaders.Set("User-Agent", c.s.userAgent())
  15740. if c.ifNoneMatch_ != "" {
  15741. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15742. }
  15743. var body io.Reader = nil
  15744. c.urlParams_.Set("alt", alt)
  15745. c.urlParams_.Set("prettyPrint", "false")
  15746. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15747. urls += "?" + c.urlParams_.Encode()
  15748. req, err := http.NewRequest("GET", urls, body)
  15749. if err != nil {
  15750. return nil, err
  15751. }
  15752. req.Header = reqHeaders
  15753. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15754. }
  15755. // Do executes the "youtube.liveStreams.list" call.
  15756. // Exactly one of *LiveStreamListResponse or error will be non-nil. Any
  15757. // non-2xx status code is an error. Response headers are in either
  15758. // *LiveStreamListResponse.ServerResponse.Header or (if a response was
  15759. // returned at all) in error.(*googleapi.Error).Header. Use
  15760. // googleapi.IsNotModified to check whether the returned error was
  15761. // because http.StatusNotModified was returned.
  15762. func (c *LiveStreamsListCall) Do(opts ...googleapi.CallOption) (*LiveStreamListResponse, error) {
  15763. gensupport.SetOptions(c.urlParams_, opts...)
  15764. res, err := c.doRequest("json")
  15765. if res != nil && res.StatusCode == http.StatusNotModified {
  15766. if res.Body != nil {
  15767. res.Body.Close()
  15768. }
  15769. return nil, &googleapi.Error{
  15770. Code: res.StatusCode,
  15771. Header: res.Header,
  15772. }
  15773. }
  15774. if err != nil {
  15775. return nil, err
  15776. }
  15777. defer googleapi.CloseBody(res)
  15778. if err := googleapi.CheckResponse(res); err != nil {
  15779. return nil, err
  15780. }
  15781. ret := &LiveStreamListResponse{
  15782. ServerResponse: googleapi.ServerResponse{
  15783. Header: res.Header,
  15784. HTTPStatusCode: res.StatusCode,
  15785. },
  15786. }
  15787. target := &ret
  15788. if err := gensupport.DecodeResponse(target, res); err != nil {
  15789. return nil, err
  15790. }
  15791. return ret, nil
  15792. // {
  15793. // "description": "Returns a list of video streams that match the API request parameters.",
  15794. // "httpMethod": "GET",
  15795. // "id": "youtube.liveStreams.list",
  15796. // "parameterOrder": [
  15797. // "part"
  15798. // ],
  15799. // "parameters": {
  15800. // "id": {
  15801. // "description": "The id parameter specifies a comma-separated list of YouTube stream IDs that identify the streams being retrieved. In a liveStream resource, the id property specifies the stream's ID.",
  15802. // "location": "query",
  15803. // "type": "string"
  15804. // },
  15805. // "maxResults": {
  15806. // "default": "5",
  15807. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  15808. // "format": "uint32",
  15809. // "location": "query",
  15810. // "maximum": "50",
  15811. // "minimum": "0",
  15812. // "type": "integer"
  15813. // },
  15814. // "mine": {
  15815. // "description": "The mine parameter can be used to instruct the API to only return streams owned by the authenticated user. Set the parameter value to true to only retrieve your own streams.",
  15816. // "location": "query",
  15817. // "type": "boolean"
  15818. // },
  15819. // "onBehalfOfContentOwner": {
  15820. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  15821. // "location": "query",
  15822. // "type": "string"
  15823. // },
  15824. // "onBehalfOfContentOwnerChannel": {
  15825. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  15826. // "location": "query",
  15827. // "type": "string"
  15828. // },
  15829. // "pageToken": {
  15830. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  15831. // "location": "query",
  15832. // "type": "string"
  15833. // },
  15834. // "part": {
  15835. // "description": "The part parameter specifies a comma-separated list of one or more liveStream resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, cdn, and status.",
  15836. // "location": "query",
  15837. // "required": true,
  15838. // "type": "string"
  15839. // }
  15840. // },
  15841. // "path": "liveStreams",
  15842. // "response": {
  15843. // "$ref": "LiveStreamListResponse"
  15844. // },
  15845. // "scopes": [
  15846. // "https://www.googleapis.com/auth/youtube",
  15847. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15848. // "https://www.googleapis.com/auth/youtube.readonly"
  15849. // ]
  15850. // }
  15851. }
  15852. // Pages invokes f for each page of results.
  15853. // A non-nil error returned from f will halt the iteration.
  15854. // The provided context supersedes any context provided to the Context method.
  15855. func (c *LiveStreamsListCall) Pages(ctx context.Context, f func(*LiveStreamListResponse) error) error {
  15856. c.ctx_ = ctx
  15857. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15858. for {
  15859. x, err := c.Do()
  15860. if err != nil {
  15861. return err
  15862. }
  15863. if err := f(x); err != nil {
  15864. return err
  15865. }
  15866. if x.NextPageToken == "" {
  15867. return nil
  15868. }
  15869. c.PageToken(x.NextPageToken)
  15870. }
  15871. }
  15872. // method id "youtube.liveStreams.update":
  15873. type LiveStreamsUpdateCall struct {
  15874. s *Service
  15875. livestream *LiveStream
  15876. urlParams_ gensupport.URLParams
  15877. ctx_ context.Context
  15878. header_ http.Header
  15879. }
  15880. // Update: Updates a video stream. If the properties that you want to
  15881. // change cannot be updated, then you need to create a new stream with
  15882. // the proper settings.
  15883. func (r *LiveStreamsService) Update(part string, livestream *LiveStream) *LiveStreamsUpdateCall {
  15884. c := &LiveStreamsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15885. c.urlParams_.Set("part", part)
  15886. c.livestream = livestream
  15887. return c
  15888. }
  15889. // OnBehalfOfContentOwner sets the optional parameter
  15890. // "onBehalfOfContentOwner": Note: This parameter is intended
  15891. // exclusively for YouTube content partners.
  15892. //
  15893. // The onBehalfOfContentOwner parameter indicates that the request's
  15894. // authorization credentials identify a YouTube CMS user who is acting
  15895. // on behalf of the content owner specified in the parameter value. This
  15896. // parameter is intended for YouTube content partners that own and
  15897. // manage many different YouTube channels. It allows content owners to
  15898. // authenticate once and get access to all their video and channel data,
  15899. // without having to provide authentication credentials for each
  15900. // individual channel. The CMS account that the user authenticates with
  15901. // must be linked to the specified YouTube content owner.
  15902. func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsUpdateCall {
  15903. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15904. return c
  15905. }
  15906. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15907. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15908. // properly authorized request. Note: This parameter is intended
  15909. // exclusively for YouTube content partners.
  15910. //
  15911. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15912. // channel ID of the channel to which a video is being added. This
  15913. // parameter is required when a request specifies a value for the
  15914. // onBehalfOfContentOwner parameter, and it can only be used in
  15915. // conjunction with that parameter. In addition, the request must be
  15916. // authorized using a CMS account that is linked to the content owner
  15917. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15918. // channel that the onBehalfOfContentOwnerChannel parameter value
  15919. // specifies must be linked to the content owner that the
  15920. // onBehalfOfContentOwner parameter specifies.
  15921. //
  15922. // This parameter is intended for YouTube content partners that own and
  15923. // manage many different YouTube channels. It allows content owners to
  15924. // authenticate once and perform actions on behalf of the channel
  15925. // specified in the parameter value, without having to provide
  15926. // authentication credentials for each separate channel.
  15927. func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsUpdateCall {
  15928. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15929. return c
  15930. }
  15931. // Fields allows partial responses to be retrieved. See
  15932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15933. // for more information.
  15934. func (c *LiveStreamsUpdateCall) Fields(s ...googleapi.Field) *LiveStreamsUpdateCall {
  15935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15936. return c
  15937. }
  15938. // Context sets the context to be used in this call's Do method. Any
  15939. // pending HTTP request will be aborted if the provided context is
  15940. // canceled.
  15941. func (c *LiveStreamsUpdateCall) Context(ctx context.Context) *LiveStreamsUpdateCall {
  15942. c.ctx_ = ctx
  15943. return c
  15944. }
  15945. // Header returns an http.Header that can be modified by the caller to
  15946. // add HTTP headers to the request.
  15947. func (c *LiveStreamsUpdateCall) Header() http.Header {
  15948. if c.header_ == nil {
  15949. c.header_ = make(http.Header)
  15950. }
  15951. return c.header_
  15952. }
  15953. func (c *LiveStreamsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15954. reqHeaders := make(http.Header)
  15955. for k, v := range c.header_ {
  15956. reqHeaders[k] = v
  15957. }
  15958. reqHeaders.Set("User-Agent", c.s.userAgent())
  15959. var body io.Reader = nil
  15960. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream)
  15961. if err != nil {
  15962. return nil, err
  15963. }
  15964. reqHeaders.Set("Content-Type", "application/json")
  15965. c.urlParams_.Set("alt", alt)
  15966. c.urlParams_.Set("prettyPrint", "false")
  15967. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15968. urls += "?" + c.urlParams_.Encode()
  15969. req, err := http.NewRequest("PUT", urls, body)
  15970. if err != nil {
  15971. return nil, err
  15972. }
  15973. req.Header = reqHeaders
  15974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15975. }
  15976. // Do executes the "youtube.liveStreams.update" call.
  15977. // Exactly one of *LiveStream or error will be non-nil. Any non-2xx
  15978. // status code is an error. Response headers are in either
  15979. // *LiveStream.ServerResponse.Header or (if a response was returned at
  15980. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15981. // to check whether the returned error was because
  15982. // http.StatusNotModified was returned.
  15983. func (c *LiveStreamsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
  15984. gensupport.SetOptions(c.urlParams_, opts...)
  15985. res, err := c.doRequest("json")
  15986. if res != nil && res.StatusCode == http.StatusNotModified {
  15987. if res.Body != nil {
  15988. res.Body.Close()
  15989. }
  15990. return nil, &googleapi.Error{
  15991. Code: res.StatusCode,
  15992. Header: res.Header,
  15993. }
  15994. }
  15995. if err != nil {
  15996. return nil, err
  15997. }
  15998. defer googleapi.CloseBody(res)
  15999. if err := googleapi.CheckResponse(res); err != nil {
  16000. return nil, err
  16001. }
  16002. ret := &LiveStream{
  16003. ServerResponse: googleapi.ServerResponse{
  16004. Header: res.Header,
  16005. HTTPStatusCode: res.StatusCode,
  16006. },
  16007. }
  16008. target := &ret
  16009. if err := gensupport.DecodeResponse(target, res); err != nil {
  16010. return nil, err
  16011. }
  16012. return ret, nil
  16013. // {
  16014. // "description": "Updates a video stream. If the properties that you want to change cannot be updated, then you need to create a new stream with the proper settings.",
  16015. // "httpMethod": "PUT",
  16016. // "id": "youtube.liveStreams.update",
  16017. // "parameterOrder": [
  16018. // "part"
  16019. // ],
  16020. // "parameters": {
  16021. // "onBehalfOfContentOwner": {
  16022. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16023. // "location": "query",
  16024. // "type": "string"
  16025. // },
  16026. // "onBehalfOfContentOwnerChannel": {
  16027. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  16028. // "location": "query",
  16029. // "type": "string"
  16030. // },
  16031. // "part": {
  16032. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nThe part properties that you can include in the parameter value are id, snippet, cdn, and status.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. If the request body does not specify a value for a mutable property, the existing value for that property will be removed.",
  16033. // "location": "query",
  16034. // "required": true,
  16035. // "type": "string"
  16036. // }
  16037. // },
  16038. // "path": "liveStreams",
  16039. // "request": {
  16040. // "$ref": "LiveStream"
  16041. // },
  16042. // "response": {
  16043. // "$ref": "LiveStream"
  16044. // },
  16045. // "scopes": [
  16046. // "https://www.googleapis.com/auth/youtube",
  16047. // "https://www.googleapis.com/auth/youtube.force-ssl"
  16048. // ]
  16049. // }
  16050. }
  16051. // method id "youtube.playlistItems.delete":
  16052. type PlaylistItemsDeleteCall struct {
  16053. s *Service
  16054. urlParams_ gensupport.URLParams
  16055. ctx_ context.Context
  16056. header_ http.Header
  16057. }
  16058. // Delete: Deletes a playlist item.
  16059. func (r *PlaylistItemsService) Delete(id string) *PlaylistItemsDeleteCall {
  16060. c := &PlaylistItemsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16061. c.urlParams_.Set("id", id)
  16062. return c
  16063. }
  16064. // OnBehalfOfContentOwner sets the optional parameter
  16065. // "onBehalfOfContentOwner": Note: This parameter is intended
  16066. // exclusively for YouTube content partners.
  16067. //
  16068. // The onBehalfOfContentOwner parameter indicates that the request's
  16069. // authorization credentials identify a YouTube CMS user who is acting
  16070. // on behalf of the content owner specified in the parameter value. This
  16071. // parameter is intended for YouTube content partners that own and
  16072. // manage many different YouTube channels. It allows content owners to
  16073. // authenticate once and get access to all their video and channel data,
  16074. // without having to provide authentication credentials for each
  16075. // individual channel. The CMS account that the user authenticates with
  16076. // must be linked to the specified YouTube content owner.
  16077. func (c *PlaylistItemsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsDeleteCall {
  16078. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16079. return c
  16080. }
  16081. // Fields allows partial responses to be retrieved. See
  16082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16083. // for more information.
  16084. func (c *PlaylistItemsDeleteCall) Fields(s ...googleapi.Field) *PlaylistItemsDeleteCall {
  16085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16086. return c
  16087. }
  16088. // Context sets the context to be used in this call's Do method. Any
  16089. // pending HTTP request will be aborted if the provided context is
  16090. // canceled.
  16091. func (c *PlaylistItemsDeleteCall) Context(ctx context.Context) *PlaylistItemsDeleteCall {
  16092. c.ctx_ = ctx
  16093. return c
  16094. }
  16095. // Header returns an http.Header that can be modified by the caller to
  16096. // add HTTP headers to the request.
  16097. func (c *PlaylistItemsDeleteCall) Header() http.Header {
  16098. if c.header_ == nil {
  16099. c.header_ = make(http.Header)
  16100. }
  16101. return c.header_
  16102. }
  16103. func (c *PlaylistItemsDeleteCall) doRequest(alt string) (*http.Response, error) {
  16104. reqHeaders := make(http.Header)
  16105. for k, v := range c.header_ {
  16106. reqHeaders[k] = v
  16107. }
  16108. reqHeaders.Set("User-Agent", c.s.userAgent())
  16109. var body io.Reader = nil
  16110. c.urlParams_.Set("alt", alt)
  16111. c.urlParams_.Set("prettyPrint", "false")
  16112. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  16113. urls += "?" + c.urlParams_.Encode()
  16114. req, err := http.NewRequest("DELETE", urls, body)
  16115. if err != nil {
  16116. return nil, err
  16117. }
  16118. req.Header = reqHeaders
  16119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16120. }
  16121. // Do executes the "youtube.playlistItems.delete" call.
  16122. func (c *PlaylistItemsDeleteCall) Do(opts ...googleapi.CallOption) error {
  16123. gensupport.SetOptions(c.urlParams_, opts...)
  16124. res, err := c.doRequest("json")
  16125. if err != nil {
  16126. return err
  16127. }
  16128. defer googleapi.CloseBody(res)
  16129. if err := googleapi.CheckResponse(res); err != nil {
  16130. return err
  16131. }
  16132. return nil
  16133. // {
  16134. // "description": "Deletes a playlist item.",
  16135. // "httpMethod": "DELETE",
  16136. // "id": "youtube.playlistItems.delete",
  16137. // "parameterOrder": [
  16138. // "id"
  16139. // ],
  16140. // "parameters": {
  16141. // "id": {
  16142. // "description": "The id parameter specifies the YouTube playlist item ID for the playlist item that is being deleted. In a playlistItem resource, the id property specifies the playlist item's ID.",
  16143. // "location": "query",
  16144. // "required": true,
  16145. // "type": "string"
  16146. // },
  16147. // "onBehalfOfContentOwner": {
  16148. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16149. // "location": "query",
  16150. // "type": "string"
  16151. // }
  16152. // },
  16153. // "path": "playlistItems",
  16154. // "scopes": [
  16155. // "https://www.googleapis.com/auth/youtube",
  16156. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16157. // "https://www.googleapis.com/auth/youtubepartner"
  16158. // ]
  16159. // }
  16160. }
  16161. // method id "youtube.playlistItems.insert":
  16162. type PlaylistItemsInsertCall struct {
  16163. s *Service
  16164. playlistitem *PlaylistItem
  16165. urlParams_ gensupport.URLParams
  16166. ctx_ context.Context
  16167. header_ http.Header
  16168. }
  16169. // Insert: Adds a resource to a playlist.
  16170. func (r *PlaylistItemsService) Insert(part string, playlistitem *PlaylistItem) *PlaylistItemsInsertCall {
  16171. c := &PlaylistItemsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16172. c.urlParams_.Set("part", part)
  16173. c.playlistitem = playlistitem
  16174. return c
  16175. }
  16176. // OnBehalfOfContentOwner sets the optional parameter
  16177. // "onBehalfOfContentOwner": Note: This parameter is intended
  16178. // exclusively for YouTube content partners.
  16179. //
  16180. // The onBehalfOfContentOwner parameter indicates that the request's
  16181. // authorization credentials identify a YouTube CMS user who is acting
  16182. // on behalf of the content owner specified in the parameter value. This
  16183. // parameter is intended for YouTube content partners that own and
  16184. // manage many different YouTube channels. It allows content owners to
  16185. // authenticate once and get access to all their video and channel data,
  16186. // without having to provide authentication credentials for each
  16187. // individual channel. The CMS account that the user authenticates with
  16188. // must be linked to the specified YouTube content owner.
  16189. func (c *PlaylistItemsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsInsertCall {
  16190. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16191. return c
  16192. }
  16193. // Fields allows partial responses to be retrieved. See
  16194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16195. // for more information.
  16196. func (c *PlaylistItemsInsertCall) Fields(s ...googleapi.Field) *PlaylistItemsInsertCall {
  16197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16198. return c
  16199. }
  16200. // Context sets the context to be used in this call's Do method. Any
  16201. // pending HTTP request will be aborted if the provided context is
  16202. // canceled.
  16203. func (c *PlaylistItemsInsertCall) Context(ctx context.Context) *PlaylistItemsInsertCall {
  16204. c.ctx_ = ctx
  16205. return c
  16206. }
  16207. // Header returns an http.Header that can be modified by the caller to
  16208. // add HTTP headers to the request.
  16209. func (c *PlaylistItemsInsertCall) Header() http.Header {
  16210. if c.header_ == nil {
  16211. c.header_ = make(http.Header)
  16212. }
  16213. return c.header_
  16214. }
  16215. func (c *PlaylistItemsInsertCall) doRequest(alt string) (*http.Response, error) {
  16216. reqHeaders := make(http.Header)
  16217. for k, v := range c.header_ {
  16218. reqHeaders[k] = v
  16219. }
  16220. reqHeaders.Set("User-Agent", c.s.userAgent())
  16221. var body io.Reader = nil
  16222. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem)
  16223. if err != nil {
  16224. return nil, err
  16225. }
  16226. reqHeaders.Set("Content-Type", "application/json")
  16227. c.urlParams_.Set("alt", alt)
  16228. c.urlParams_.Set("prettyPrint", "false")
  16229. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  16230. urls += "?" + c.urlParams_.Encode()
  16231. req, err := http.NewRequest("POST", urls, body)
  16232. if err != nil {
  16233. return nil, err
  16234. }
  16235. req.Header = reqHeaders
  16236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16237. }
  16238. // Do executes the "youtube.playlistItems.insert" call.
  16239. // Exactly one of *PlaylistItem or error will be non-nil. Any non-2xx
  16240. // status code is an error. Response headers are in either
  16241. // *PlaylistItem.ServerResponse.Header or (if a response was returned at
  16242. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16243. // to check whether the returned error was because
  16244. // http.StatusNotModified was returned.
  16245. func (c *PlaylistItemsInsertCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
  16246. gensupport.SetOptions(c.urlParams_, opts...)
  16247. res, err := c.doRequest("json")
  16248. if res != nil && res.StatusCode == http.StatusNotModified {
  16249. if res.Body != nil {
  16250. res.Body.Close()
  16251. }
  16252. return nil, &googleapi.Error{
  16253. Code: res.StatusCode,
  16254. Header: res.Header,
  16255. }
  16256. }
  16257. if err != nil {
  16258. return nil, err
  16259. }
  16260. defer googleapi.CloseBody(res)
  16261. if err := googleapi.CheckResponse(res); err != nil {
  16262. return nil, err
  16263. }
  16264. ret := &PlaylistItem{
  16265. ServerResponse: googleapi.ServerResponse{
  16266. Header: res.Header,
  16267. HTTPStatusCode: res.StatusCode,
  16268. },
  16269. }
  16270. target := &ret
  16271. if err := gensupport.DecodeResponse(target, res); err != nil {
  16272. return nil, err
  16273. }
  16274. return ret, nil
  16275. // {
  16276. // "description": "Adds a resource to a playlist.",
  16277. // "httpMethod": "POST",
  16278. // "id": "youtube.playlistItems.insert",
  16279. // "parameterOrder": [
  16280. // "part"
  16281. // ],
  16282. // "parameters": {
  16283. // "onBehalfOfContentOwner": {
  16284. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16285. // "location": "query",
  16286. // "type": "string"
  16287. // },
  16288. // "part": {
  16289. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  16290. // "location": "query",
  16291. // "required": true,
  16292. // "type": "string"
  16293. // }
  16294. // },
  16295. // "path": "playlistItems",
  16296. // "request": {
  16297. // "$ref": "PlaylistItem"
  16298. // },
  16299. // "response": {
  16300. // "$ref": "PlaylistItem"
  16301. // },
  16302. // "scopes": [
  16303. // "https://www.googleapis.com/auth/youtube",
  16304. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16305. // "https://www.googleapis.com/auth/youtubepartner"
  16306. // ]
  16307. // }
  16308. }
  16309. // method id "youtube.playlistItems.list":
  16310. type PlaylistItemsListCall struct {
  16311. s *Service
  16312. urlParams_ gensupport.URLParams
  16313. ifNoneMatch_ string
  16314. ctx_ context.Context
  16315. header_ http.Header
  16316. }
  16317. // List: Returns a collection of playlist items that match the API
  16318. // request parameters. You can retrieve all of the playlist items in a
  16319. // specified playlist or retrieve one or more playlist items by their
  16320. // unique IDs.
  16321. func (r *PlaylistItemsService) List(part string) *PlaylistItemsListCall {
  16322. c := &PlaylistItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16323. c.urlParams_.Set("part", part)
  16324. return c
  16325. }
  16326. // Id sets the optional parameter "id": The id parameter specifies a
  16327. // comma-separated list of one or more unique playlist item IDs.
  16328. func (c *PlaylistItemsListCall) Id(id string) *PlaylistItemsListCall {
  16329. c.urlParams_.Set("id", id)
  16330. return c
  16331. }
  16332. // MaxResults sets the optional parameter "maxResults": The maxResults
  16333. // parameter specifies the maximum number of items that should be
  16334. // returned in the result set.
  16335. func (c *PlaylistItemsListCall) MaxResults(maxResults int64) *PlaylistItemsListCall {
  16336. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16337. return c
  16338. }
  16339. // OnBehalfOfContentOwner sets the optional parameter
  16340. // "onBehalfOfContentOwner": Note: This parameter is intended
  16341. // exclusively for YouTube content partners.
  16342. //
  16343. // The onBehalfOfContentOwner parameter indicates that the request's
  16344. // authorization credentials identify a YouTube CMS user who is acting
  16345. // on behalf of the content owner specified in the parameter value. This
  16346. // parameter is intended for YouTube content partners that own and
  16347. // manage many different YouTube channels. It allows content owners to
  16348. // authenticate once and get access to all their video and channel data,
  16349. // without having to provide authentication credentials for each
  16350. // individual channel. The CMS account that the user authenticates with
  16351. // must be linked to the specified YouTube content owner.
  16352. func (c *PlaylistItemsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsListCall {
  16353. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16354. return c
  16355. }
  16356. // PageToken sets the optional parameter "pageToken": The pageToken
  16357. // parameter identifies a specific page in the result set that should be
  16358. // returned. In an API response, the nextPageToken and prevPageToken
  16359. // properties identify other pages that could be retrieved.
  16360. func (c *PlaylistItemsListCall) PageToken(pageToken string) *PlaylistItemsListCall {
  16361. c.urlParams_.Set("pageToken", pageToken)
  16362. return c
  16363. }
  16364. // PlaylistId sets the optional parameter "playlistId": The playlistId
  16365. // parameter specifies the unique ID of the playlist for which you want
  16366. // to retrieve playlist items. Note that even though this is an optional
  16367. // parameter, every request to retrieve playlist items must specify a
  16368. // value for either the id parameter or the playlistId parameter.
  16369. func (c *PlaylistItemsListCall) PlaylistId(playlistId string) *PlaylistItemsListCall {
  16370. c.urlParams_.Set("playlistId", playlistId)
  16371. return c
  16372. }
  16373. // VideoId sets the optional parameter "videoId": The videoId parameter
  16374. // specifies that the request should return only the playlist items that
  16375. // contain the specified video.
  16376. func (c *PlaylistItemsListCall) VideoId(videoId string) *PlaylistItemsListCall {
  16377. c.urlParams_.Set("videoId", videoId)
  16378. return c
  16379. }
  16380. // Fields allows partial responses to be retrieved. See
  16381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16382. // for more information.
  16383. func (c *PlaylistItemsListCall) Fields(s ...googleapi.Field) *PlaylistItemsListCall {
  16384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16385. return c
  16386. }
  16387. // IfNoneMatch sets the optional parameter which makes the operation
  16388. // fail if the object's ETag matches the given value. This is useful for
  16389. // getting updates only after the object has changed since the last
  16390. // request. Use googleapi.IsNotModified to check whether the response
  16391. // error from Do is the result of In-None-Match.
  16392. func (c *PlaylistItemsListCall) IfNoneMatch(entityTag string) *PlaylistItemsListCall {
  16393. c.ifNoneMatch_ = entityTag
  16394. return c
  16395. }
  16396. // Context sets the context to be used in this call's Do method. Any
  16397. // pending HTTP request will be aborted if the provided context is
  16398. // canceled.
  16399. func (c *PlaylistItemsListCall) Context(ctx context.Context) *PlaylistItemsListCall {
  16400. c.ctx_ = ctx
  16401. return c
  16402. }
  16403. // Header returns an http.Header that can be modified by the caller to
  16404. // add HTTP headers to the request.
  16405. func (c *PlaylistItemsListCall) Header() http.Header {
  16406. if c.header_ == nil {
  16407. c.header_ = make(http.Header)
  16408. }
  16409. return c.header_
  16410. }
  16411. func (c *PlaylistItemsListCall) doRequest(alt string) (*http.Response, error) {
  16412. reqHeaders := make(http.Header)
  16413. for k, v := range c.header_ {
  16414. reqHeaders[k] = v
  16415. }
  16416. reqHeaders.Set("User-Agent", c.s.userAgent())
  16417. if c.ifNoneMatch_ != "" {
  16418. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16419. }
  16420. var body io.Reader = nil
  16421. c.urlParams_.Set("alt", alt)
  16422. c.urlParams_.Set("prettyPrint", "false")
  16423. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  16424. urls += "?" + c.urlParams_.Encode()
  16425. req, err := http.NewRequest("GET", urls, body)
  16426. if err != nil {
  16427. return nil, err
  16428. }
  16429. req.Header = reqHeaders
  16430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16431. }
  16432. // Do executes the "youtube.playlistItems.list" call.
  16433. // Exactly one of *PlaylistItemListResponse or error will be non-nil.
  16434. // Any non-2xx status code is an error. Response headers are in either
  16435. // *PlaylistItemListResponse.ServerResponse.Header or (if a response was
  16436. // returned at all) in error.(*googleapi.Error).Header. Use
  16437. // googleapi.IsNotModified to check whether the returned error was
  16438. // because http.StatusNotModified was returned.
  16439. func (c *PlaylistItemsListCall) Do(opts ...googleapi.CallOption) (*PlaylistItemListResponse, error) {
  16440. gensupport.SetOptions(c.urlParams_, opts...)
  16441. res, err := c.doRequest("json")
  16442. if res != nil && res.StatusCode == http.StatusNotModified {
  16443. if res.Body != nil {
  16444. res.Body.Close()
  16445. }
  16446. return nil, &googleapi.Error{
  16447. Code: res.StatusCode,
  16448. Header: res.Header,
  16449. }
  16450. }
  16451. if err != nil {
  16452. return nil, err
  16453. }
  16454. defer googleapi.CloseBody(res)
  16455. if err := googleapi.CheckResponse(res); err != nil {
  16456. return nil, err
  16457. }
  16458. ret := &PlaylistItemListResponse{
  16459. ServerResponse: googleapi.ServerResponse{
  16460. Header: res.Header,
  16461. HTTPStatusCode: res.StatusCode,
  16462. },
  16463. }
  16464. target := &ret
  16465. if err := gensupport.DecodeResponse(target, res); err != nil {
  16466. return nil, err
  16467. }
  16468. return ret, nil
  16469. // {
  16470. // "description": "Returns a collection of playlist items that match the API request parameters. You can retrieve all of the playlist items in a specified playlist or retrieve one or more playlist items by their unique IDs.",
  16471. // "httpMethod": "GET",
  16472. // "id": "youtube.playlistItems.list",
  16473. // "parameterOrder": [
  16474. // "part"
  16475. // ],
  16476. // "parameters": {
  16477. // "id": {
  16478. // "description": "The id parameter specifies a comma-separated list of one or more unique playlist item IDs.",
  16479. // "location": "query",
  16480. // "type": "string"
  16481. // },
  16482. // "maxResults": {
  16483. // "default": "5",
  16484. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  16485. // "format": "uint32",
  16486. // "location": "query",
  16487. // "maximum": "50",
  16488. // "minimum": "0",
  16489. // "type": "integer"
  16490. // },
  16491. // "onBehalfOfContentOwner": {
  16492. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16493. // "location": "query",
  16494. // "type": "string"
  16495. // },
  16496. // "pageToken": {
  16497. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  16498. // "location": "query",
  16499. // "type": "string"
  16500. // },
  16501. // "part": {
  16502. // "description": "The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlistItem resource, the snippet property contains numerous fields, including the title, description, position, and resourceId properties. As such, if you set part=snippet, the API response will contain all of those properties.",
  16503. // "location": "query",
  16504. // "required": true,
  16505. // "type": "string"
  16506. // },
  16507. // "playlistId": {
  16508. // "description": "The playlistId parameter specifies the unique ID of the playlist for which you want to retrieve playlist items. Note that even though this is an optional parameter, every request to retrieve playlist items must specify a value for either the id parameter or the playlistId parameter.",
  16509. // "location": "query",
  16510. // "type": "string"
  16511. // },
  16512. // "videoId": {
  16513. // "description": "The videoId parameter specifies that the request should return only the playlist items that contain the specified video.",
  16514. // "location": "query",
  16515. // "type": "string"
  16516. // }
  16517. // },
  16518. // "path": "playlistItems",
  16519. // "response": {
  16520. // "$ref": "PlaylistItemListResponse"
  16521. // },
  16522. // "scopes": [
  16523. // "https://www.googleapis.com/auth/youtube",
  16524. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16525. // "https://www.googleapis.com/auth/youtube.readonly",
  16526. // "https://www.googleapis.com/auth/youtubepartner"
  16527. // ],
  16528. // "supportsSubscription": true
  16529. // }
  16530. }
  16531. // Pages invokes f for each page of results.
  16532. // A non-nil error returned from f will halt the iteration.
  16533. // The provided context supersedes any context provided to the Context method.
  16534. func (c *PlaylistItemsListCall) Pages(ctx context.Context, f func(*PlaylistItemListResponse) error) error {
  16535. c.ctx_ = ctx
  16536. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16537. for {
  16538. x, err := c.Do()
  16539. if err != nil {
  16540. return err
  16541. }
  16542. if err := f(x); err != nil {
  16543. return err
  16544. }
  16545. if x.NextPageToken == "" {
  16546. return nil
  16547. }
  16548. c.PageToken(x.NextPageToken)
  16549. }
  16550. }
  16551. // method id "youtube.playlistItems.update":
  16552. type PlaylistItemsUpdateCall struct {
  16553. s *Service
  16554. playlistitem *PlaylistItem
  16555. urlParams_ gensupport.URLParams
  16556. ctx_ context.Context
  16557. header_ http.Header
  16558. }
  16559. // Update: Modifies a playlist item. For example, you could update the
  16560. // item's position in the playlist.
  16561. func (r *PlaylistItemsService) Update(part string, playlistitem *PlaylistItem) *PlaylistItemsUpdateCall {
  16562. c := &PlaylistItemsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16563. c.urlParams_.Set("part", part)
  16564. c.playlistitem = playlistitem
  16565. return c
  16566. }
  16567. // OnBehalfOfContentOwner sets the optional parameter
  16568. // "onBehalfOfContentOwner": Note: This parameter is intended
  16569. // exclusively for YouTube content partners.
  16570. //
  16571. // The onBehalfOfContentOwner parameter indicates that the request's
  16572. // authorization credentials identify a YouTube CMS user who is acting
  16573. // on behalf of the content owner specified in the parameter value. This
  16574. // parameter is intended for YouTube content partners that own and
  16575. // manage many different YouTube channels. It allows content owners to
  16576. // authenticate once and get access to all their video and channel data,
  16577. // without having to provide authentication credentials for each
  16578. // individual channel. The CMS account that the user authenticates with
  16579. // must be linked to the specified YouTube content owner.
  16580. func (c *PlaylistItemsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsUpdateCall {
  16581. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16582. return c
  16583. }
  16584. // Fields allows partial responses to be retrieved. See
  16585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16586. // for more information.
  16587. func (c *PlaylistItemsUpdateCall) Fields(s ...googleapi.Field) *PlaylistItemsUpdateCall {
  16588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16589. return c
  16590. }
  16591. // Context sets the context to be used in this call's Do method. Any
  16592. // pending HTTP request will be aborted if the provided context is
  16593. // canceled.
  16594. func (c *PlaylistItemsUpdateCall) Context(ctx context.Context) *PlaylistItemsUpdateCall {
  16595. c.ctx_ = ctx
  16596. return c
  16597. }
  16598. // Header returns an http.Header that can be modified by the caller to
  16599. // add HTTP headers to the request.
  16600. func (c *PlaylistItemsUpdateCall) Header() http.Header {
  16601. if c.header_ == nil {
  16602. c.header_ = make(http.Header)
  16603. }
  16604. return c.header_
  16605. }
  16606. func (c *PlaylistItemsUpdateCall) doRequest(alt string) (*http.Response, error) {
  16607. reqHeaders := make(http.Header)
  16608. for k, v := range c.header_ {
  16609. reqHeaders[k] = v
  16610. }
  16611. reqHeaders.Set("User-Agent", c.s.userAgent())
  16612. var body io.Reader = nil
  16613. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem)
  16614. if err != nil {
  16615. return nil, err
  16616. }
  16617. reqHeaders.Set("Content-Type", "application/json")
  16618. c.urlParams_.Set("alt", alt)
  16619. c.urlParams_.Set("prettyPrint", "false")
  16620. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  16621. urls += "?" + c.urlParams_.Encode()
  16622. req, err := http.NewRequest("PUT", urls, body)
  16623. if err != nil {
  16624. return nil, err
  16625. }
  16626. req.Header = reqHeaders
  16627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16628. }
  16629. // Do executes the "youtube.playlistItems.update" call.
  16630. // Exactly one of *PlaylistItem or error will be non-nil. Any non-2xx
  16631. // status code is an error. Response headers are in either
  16632. // *PlaylistItem.ServerResponse.Header or (if a response was returned at
  16633. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16634. // to check whether the returned error was because
  16635. // http.StatusNotModified was returned.
  16636. func (c *PlaylistItemsUpdateCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
  16637. gensupport.SetOptions(c.urlParams_, opts...)
  16638. res, err := c.doRequest("json")
  16639. if res != nil && res.StatusCode == http.StatusNotModified {
  16640. if res.Body != nil {
  16641. res.Body.Close()
  16642. }
  16643. return nil, &googleapi.Error{
  16644. Code: res.StatusCode,
  16645. Header: res.Header,
  16646. }
  16647. }
  16648. if err != nil {
  16649. return nil, err
  16650. }
  16651. defer googleapi.CloseBody(res)
  16652. if err := googleapi.CheckResponse(res); err != nil {
  16653. return nil, err
  16654. }
  16655. ret := &PlaylistItem{
  16656. ServerResponse: googleapi.ServerResponse{
  16657. Header: res.Header,
  16658. HTTPStatusCode: res.StatusCode,
  16659. },
  16660. }
  16661. target := &ret
  16662. if err := gensupport.DecodeResponse(target, res); err != nil {
  16663. return nil, err
  16664. }
  16665. return ret, nil
  16666. // {
  16667. // "description": "Modifies a playlist item. For example, you could update the item's position in the playlist.",
  16668. // "httpMethod": "PUT",
  16669. // "id": "youtube.playlistItems.update",
  16670. // "parameterOrder": [
  16671. // "part"
  16672. // ],
  16673. // "parameters": {
  16674. // "onBehalfOfContentOwner": {
  16675. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16676. // "location": "query",
  16677. // "type": "string"
  16678. // },
  16679. // "part": {
  16680. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a playlist item can specify a start time and end time, which identify the times portion of the video that should play when users watch the video in the playlist. If your request is updating a playlist item that sets these values, and the request's part parameter value includes the contentDetails part, the playlist item's start and end times will be updated to whatever value the request body specifies. If the request body does not specify values, the existing start and end times will be removed and replaced with the default settings.",
  16681. // "location": "query",
  16682. // "required": true,
  16683. // "type": "string"
  16684. // }
  16685. // },
  16686. // "path": "playlistItems",
  16687. // "request": {
  16688. // "$ref": "PlaylistItem"
  16689. // },
  16690. // "response": {
  16691. // "$ref": "PlaylistItem"
  16692. // },
  16693. // "scopes": [
  16694. // "https://www.googleapis.com/auth/youtube",
  16695. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16696. // "https://www.googleapis.com/auth/youtubepartner"
  16697. // ]
  16698. // }
  16699. }
  16700. // method id "youtube.playlists.delete":
  16701. type PlaylistsDeleteCall struct {
  16702. s *Service
  16703. urlParams_ gensupport.URLParams
  16704. ctx_ context.Context
  16705. header_ http.Header
  16706. }
  16707. // Delete: Deletes a playlist.
  16708. func (r *PlaylistsService) Delete(id string) *PlaylistsDeleteCall {
  16709. c := &PlaylistsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16710. c.urlParams_.Set("id", id)
  16711. return c
  16712. }
  16713. // OnBehalfOfContentOwner sets the optional parameter
  16714. // "onBehalfOfContentOwner": Note: This parameter is intended
  16715. // exclusively for YouTube content partners.
  16716. //
  16717. // The onBehalfOfContentOwner parameter indicates that the request's
  16718. // authorization credentials identify a YouTube CMS user who is acting
  16719. // on behalf of the content owner specified in the parameter value. This
  16720. // parameter is intended for YouTube content partners that own and
  16721. // manage many different YouTube channels. It allows content owners to
  16722. // authenticate once and get access to all their video and channel data,
  16723. // without having to provide authentication credentials for each
  16724. // individual channel. The CMS account that the user authenticates with
  16725. // must be linked to the specified YouTube content owner.
  16726. func (c *PlaylistsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsDeleteCall {
  16727. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16728. return c
  16729. }
  16730. // Fields allows partial responses to be retrieved. See
  16731. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16732. // for more information.
  16733. func (c *PlaylistsDeleteCall) Fields(s ...googleapi.Field) *PlaylistsDeleteCall {
  16734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16735. return c
  16736. }
  16737. // Context sets the context to be used in this call's Do method. Any
  16738. // pending HTTP request will be aborted if the provided context is
  16739. // canceled.
  16740. func (c *PlaylistsDeleteCall) Context(ctx context.Context) *PlaylistsDeleteCall {
  16741. c.ctx_ = ctx
  16742. return c
  16743. }
  16744. // Header returns an http.Header that can be modified by the caller to
  16745. // add HTTP headers to the request.
  16746. func (c *PlaylistsDeleteCall) Header() http.Header {
  16747. if c.header_ == nil {
  16748. c.header_ = make(http.Header)
  16749. }
  16750. return c.header_
  16751. }
  16752. func (c *PlaylistsDeleteCall) doRequest(alt string) (*http.Response, error) {
  16753. reqHeaders := make(http.Header)
  16754. for k, v := range c.header_ {
  16755. reqHeaders[k] = v
  16756. }
  16757. reqHeaders.Set("User-Agent", c.s.userAgent())
  16758. var body io.Reader = nil
  16759. c.urlParams_.Set("alt", alt)
  16760. c.urlParams_.Set("prettyPrint", "false")
  16761. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  16762. urls += "?" + c.urlParams_.Encode()
  16763. req, err := http.NewRequest("DELETE", urls, body)
  16764. if err != nil {
  16765. return nil, err
  16766. }
  16767. req.Header = reqHeaders
  16768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16769. }
  16770. // Do executes the "youtube.playlists.delete" call.
  16771. func (c *PlaylistsDeleteCall) Do(opts ...googleapi.CallOption) error {
  16772. gensupport.SetOptions(c.urlParams_, opts...)
  16773. res, err := c.doRequest("json")
  16774. if err != nil {
  16775. return err
  16776. }
  16777. defer googleapi.CloseBody(res)
  16778. if err := googleapi.CheckResponse(res); err != nil {
  16779. return err
  16780. }
  16781. return nil
  16782. // {
  16783. // "description": "Deletes a playlist.",
  16784. // "httpMethod": "DELETE",
  16785. // "id": "youtube.playlists.delete",
  16786. // "parameterOrder": [
  16787. // "id"
  16788. // ],
  16789. // "parameters": {
  16790. // "id": {
  16791. // "description": "The id parameter specifies the YouTube playlist ID for the playlist that is being deleted. In a playlist resource, the id property specifies the playlist's ID.",
  16792. // "location": "query",
  16793. // "required": true,
  16794. // "type": "string"
  16795. // },
  16796. // "onBehalfOfContentOwner": {
  16797. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16798. // "location": "query",
  16799. // "type": "string"
  16800. // }
  16801. // },
  16802. // "path": "playlists",
  16803. // "scopes": [
  16804. // "https://www.googleapis.com/auth/youtube",
  16805. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16806. // "https://www.googleapis.com/auth/youtubepartner"
  16807. // ]
  16808. // }
  16809. }
  16810. // method id "youtube.playlists.insert":
  16811. type PlaylistsInsertCall struct {
  16812. s *Service
  16813. playlist *Playlist
  16814. urlParams_ gensupport.URLParams
  16815. ctx_ context.Context
  16816. header_ http.Header
  16817. }
  16818. // Insert: Creates a playlist.
  16819. func (r *PlaylistsService) Insert(part string, playlist *Playlist) *PlaylistsInsertCall {
  16820. c := &PlaylistsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16821. c.urlParams_.Set("part", part)
  16822. c.playlist = playlist
  16823. return c
  16824. }
  16825. // OnBehalfOfContentOwner sets the optional parameter
  16826. // "onBehalfOfContentOwner": Note: This parameter is intended
  16827. // exclusively for YouTube content partners.
  16828. //
  16829. // The onBehalfOfContentOwner parameter indicates that the request's
  16830. // authorization credentials identify a YouTube CMS user who is acting
  16831. // on behalf of the content owner specified in the parameter value. This
  16832. // parameter is intended for YouTube content partners that own and
  16833. // manage many different YouTube channels. It allows content owners to
  16834. // authenticate once and get access to all their video and channel data,
  16835. // without having to provide authentication credentials for each
  16836. // individual channel. The CMS account that the user authenticates with
  16837. // must be linked to the specified YouTube content owner.
  16838. func (c *PlaylistsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsInsertCall {
  16839. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16840. return c
  16841. }
  16842. // OnBehalfOfContentOwnerChannel sets the optional parameter
  16843. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  16844. // properly authorized request. Note: This parameter is intended
  16845. // exclusively for YouTube content partners.
  16846. //
  16847. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  16848. // channel ID of the channel to which a video is being added. This
  16849. // parameter is required when a request specifies a value for the
  16850. // onBehalfOfContentOwner parameter, and it can only be used in
  16851. // conjunction with that parameter. In addition, the request must be
  16852. // authorized using a CMS account that is linked to the content owner
  16853. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  16854. // channel that the onBehalfOfContentOwnerChannel parameter value
  16855. // specifies must be linked to the content owner that the
  16856. // onBehalfOfContentOwner parameter specifies.
  16857. //
  16858. // This parameter is intended for YouTube content partners that own and
  16859. // manage many different YouTube channels. It allows content owners to
  16860. // authenticate once and perform actions on behalf of the channel
  16861. // specified in the parameter value, without having to provide
  16862. // authentication credentials for each separate channel.
  16863. func (c *PlaylistsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsInsertCall {
  16864. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  16865. return c
  16866. }
  16867. // Fields allows partial responses to be retrieved. See
  16868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16869. // for more information.
  16870. func (c *PlaylistsInsertCall) Fields(s ...googleapi.Field) *PlaylistsInsertCall {
  16871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16872. return c
  16873. }
  16874. // Context sets the context to be used in this call's Do method. Any
  16875. // pending HTTP request will be aborted if the provided context is
  16876. // canceled.
  16877. func (c *PlaylistsInsertCall) Context(ctx context.Context) *PlaylistsInsertCall {
  16878. c.ctx_ = ctx
  16879. return c
  16880. }
  16881. // Header returns an http.Header that can be modified by the caller to
  16882. // add HTTP headers to the request.
  16883. func (c *PlaylistsInsertCall) Header() http.Header {
  16884. if c.header_ == nil {
  16885. c.header_ = make(http.Header)
  16886. }
  16887. return c.header_
  16888. }
  16889. func (c *PlaylistsInsertCall) doRequest(alt string) (*http.Response, error) {
  16890. reqHeaders := make(http.Header)
  16891. for k, v := range c.header_ {
  16892. reqHeaders[k] = v
  16893. }
  16894. reqHeaders.Set("User-Agent", c.s.userAgent())
  16895. var body io.Reader = nil
  16896. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist)
  16897. if err != nil {
  16898. return nil, err
  16899. }
  16900. reqHeaders.Set("Content-Type", "application/json")
  16901. c.urlParams_.Set("alt", alt)
  16902. c.urlParams_.Set("prettyPrint", "false")
  16903. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  16904. urls += "?" + c.urlParams_.Encode()
  16905. req, err := http.NewRequest("POST", urls, body)
  16906. if err != nil {
  16907. return nil, err
  16908. }
  16909. req.Header = reqHeaders
  16910. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16911. }
  16912. // Do executes the "youtube.playlists.insert" call.
  16913. // Exactly one of *Playlist or error will be non-nil. Any non-2xx status
  16914. // code is an error. Response headers are in either
  16915. // *Playlist.ServerResponse.Header or (if a response was returned at
  16916. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16917. // to check whether the returned error was because
  16918. // http.StatusNotModified was returned.
  16919. func (c *PlaylistsInsertCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
  16920. gensupport.SetOptions(c.urlParams_, opts...)
  16921. res, err := c.doRequest("json")
  16922. if res != nil && res.StatusCode == http.StatusNotModified {
  16923. if res.Body != nil {
  16924. res.Body.Close()
  16925. }
  16926. return nil, &googleapi.Error{
  16927. Code: res.StatusCode,
  16928. Header: res.Header,
  16929. }
  16930. }
  16931. if err != nil {
  16932. return nil, err
  16933. }
  16934. defer googleapi.CloseBody(res)
  16935. if err := googleapi.CheckResponse(res); err != nil {
  16936. return nil, err
  16937. }
  16938. ret := &Playlist{
  16939. ServerResponse: googleapi.ServerResponse{
  16940. Header: res.Header,
  16941. HTTPStatusCode: res.StatusCode,
  16942. },
  16943. }
  16944. target := &ret
  16945. if err := gensupport.DecodeResponse(target, res); err != nil {
  16946. return nil, err
  16947. }
  16948. return ret, nil
  16949. // {
  16950. // "description": "Creates a playlist.",
  16951. // "httpMethod": "POST",
  16952. // "id": "youtube.playlists.insert",
  16953. // "parameterOrder": [
  16954. // "part"
  16955. // ],
  16956. // "parameters": {
  16957. // "onBehalfOfContentOwner": {
  16958. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  16959. // "location": "query",
  16960. // "type": "string"
  16961. // },
  16962. // "onBehalfOfContentOwnerChannel": {
  16963. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  16964. // "location": "query",
  16965. // "type": "string"
  16966. // },
  16967. // "part": {
  16968. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  16969. // "location": "query",
  16970. // "required": true,
  16971. // "type": "string"
  16972. // }
  16973. // },
  16974. // "path": "playlists",
  16975. // "request": {
  16976. // "$ref": "Playlist"
  16977. // },
  16978. // "response": {
  16979. // "$ref": "Playlist"
  16980. // },
  16981. // "scopes": [
  16982. // "https://www.googleapis.com/auth/youtube",
  16983. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16984. // "https://www.googleapis.com/auth/youtubepartner"
  16985. // ]
  16986. // }
  16987. }
  16988. // method id "youtube.playlists.list":
  16989. type PlaylistsListCall struct {
  16990. s *Service
  16991. urlParams_ gensupport.URLParams
  16992. ifNoneMatch_ string
  16993. ctx_ context.Context
  16994. header_ http.Header
  16995. }
  16996. // List: Returns a collection of playlists that match the API request
  16997. // parameters. For example, you can retrieve all playlists that the
  16998. // authenticated user owns, or you can retrieve one or more playlists by
  16999. // their unique IDs.
  17000. func (r *PlaylistsService) List(part string) *PlaylistsListCall {
  17001. c := &PlaylistsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17002. c.urlParams_.Set("part", part)
  17003. return c
  17004. }
  17005. // ChannelId sets the optional parameter "channelId": This value
  17006. // indicates that the API should only return the specified channel's
  17007. // playlists.
  17008. func (c *PlaylistsListCall) ChannelId(channelId string) *PlaylistsListCall {
  17009. c.urlParams_.Set("channelId", channelId)
  17010. return c
  17011. }
  17012. // Hl sets the optional parameter "hl": The hl parameter should be used
  17013. // for filter out the properties that are not in the given language.
  17014. // Used for the snippet part.
  17015. func (c *PlaylistsListCall) Hl(hl string) *PlaylistsListCall {
  17016. c.urlParams_.Set("hl", hl)
  17017. return c
  17018. }
  17019. // Id sets the optional parameter "id": The id parameter specifies a
  17020. // comma-separated list of the YouTube playlist ID(s) for the
  17021. // resource(s) that are being retrieved. In a playlist resource, the id
  17022. // property specifies the playlist's YouTube playlist ID.
  17023. func (c *PlaylistsListCall) Id(id string) *PlaylistsListCall {
  17024. c.urlParams_.Set("id", id)
  17025. return c
  17026. }
  17027. // MaxResults sets the optional parameter "maxResults": The maxResults
  17028. // parameter specifies the maximum number of items that should be
  17029. // returned in the result set.
  17030. func (c *PlaylistsListCall) MaxResults(maxResults int64) *PlaylistsListCall {
  17031. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17032. return c
  17033. }
  17034. // Mine sets the optional parameter "mine": Set this parameter's value
  17035. // to true to instruct the API to only return playlists owned by the
  17036. // authenticated user.
  17037. func (c *PlaylistsListCall) Mine(mine bool) *PlaylistsListCall {
  17038. c.urlParams_.Set("mine", fmt.Sprint(mine))
  17039. return c
  17040. }
  17041. // OnBehalfOfContentOwner sets the optional parameter
  17042. // "onBehalfOfContentOwner": Note: This parameter is intended
  17043. // exclusively for YouTube content partners.
  17044. //
  17045. // The onBehalfOfContentOwner parameter indicates that the request's
  17046. // authorization credentials identify a YouTube CMS user who is acting
  17047. // on behalf of the content owner specified in the parameter value. This
  17048. // parameter is intended for YouTube content partners that own and
  17049. // manage many different YouTube channels. It allows content owners to
  17050. // authenticate once and get access to all their video and channel data,
  17051. // without having to provide authentication credentials for each
  17052. // individual channel. The CMS account that the user authenticates with
  17053. // must be linked to the specified YouTube content owner.
  17054. func (c *PlaylistsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsListCall {
  17055. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17056. return c
  17057. }
  17058. // OnBehalfOfContentOwnerChannel sets the optional parameter
  17059. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  17060. // properly authorized request. Note: This parameter is intended
  17061. // exclusively for YouTube content partners.
  17062. //
  17063. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  17064. // channel ID of the channel to which a video is being added. This
  17065. // parameter is required when a request specifies a value for the
  17066. // onBehalfOfContentOwner parameter, and it can only be used in
  17067. // conjunction with that parameter. In addition, the request must be
  17068. // authorized using a CMS account that is linked to the content owner
  17069. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  17070. // channel that the onBehalfOfContentOwnerChannel parameter value
  17071. // specifies must be linked to the content owner that the
  17072. // onBehalfOfContentOwner parameter specifies.
  17073. //
  17074. // This parameter is intended for YouTube content partners that own and
  17075. // manage many different YouTube channels. It allows content owners to
  17076. // authenticate once and perform actions on behalf of the channel
  17077. // specified in the parameter value, without having to provide
  17078. // authentication credentials for each separate channel.
  17079. func (c *PlaylistsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsListCall {
  17080. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  17081. return c
  17082. }
  17083. // PageToken sets the optional parameter "pageToken": The pageToken
  17084. // parameter identifies a specific page in the result set that should be
  17085. // returned. In an API response, the nextPageToken and prevPageToken
  17086. // properties identify other pages that could be retrieved.
  17087. func (c *PlaylistsListCall) PageToken(pageToken string) *PlaylistsListCall {
  17088. c.urlParams_.Set("pageToken", pageToken)
  17089. return c
  17090. }
  17091. // Fields allows partial responses to be retrieved. See
  17092. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17093. // for more information.
  17094. func (c *PlaylistsListCall) Fields(s ...googleapi.Field) *PlaylistsListCall {
  17095. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17096. return c
  17097. }
  17098. // IfNoneMatch sets the optional parameter which makes the operation
  17099. // fail if the object's ETag matches the given value. This is useful for
  17100. // getting updates only after the object has changed since the last
  17101. // request. Use googleapi.IsNotModified to check whether the response
  17102. // error from Do is the result of In-None-Match.
  17103. func (c *PlaylistsListCall) IfNoneMatch(entityTag string) *PlaylistsListCall {
  17104. c.ifNoneMatch_ = entityTag
  17105. return c
  17106. }
  17107. // Context sets the context to be used in this call's Do method. Any
  17108. // pending HTTP request will be aborted if the provided context is
  17109. // canceled.
  17110. func (c *PlaylistsListCall) Context(ctx context.Context) *PlaylistsListCall {
  17111. c.ctx_ = ctx
  17112. return c
  17113. }
  17114. // Header returns an http.Header that can be modified by the caller to
  17115. // add HTTP headers to the request.
  17116. func (c *PlaylistsListCall) Header() http.Header {
  17117. if c.header_ == nil {
  17118. c.header_ = make(http.Header)
  17119. }
  17120. return c.header_
  17121. }
  17122. func (c *PlaylistsListCall) doRequest(alt string) (*http.Response, error) {
  17123. reqHeaders := make(http.Header)
  17124. for k, v := range c.header_ {
  17125. reqHeaders[k] = v
  17126. }
  17127. reqHeaders.Set("User-Agent", c.s.userAgent())
  17128. if c.ifNoneMatch_ != "" {
  17129. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17130. }
  17131. var body io.Reader = nil
  17132. c.urlParams_.Set("alt", alt)
  17133. c.urlParams_.Set("prettyPrint", "false")
  17134. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  17135. urls += "?" + c.urlParams_.Encode()
  17136. req, err := http.NewRequest("GET", urls, body)
  17137. if err != nil {
  17138. return nil, err
  17139. }
  17140. req.Header = reqHeaders
  17141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17142. }
  17143. // Do executes the "youtube.playlists.list" call.
  17144. // Exactly one of *PlaylistListResponse or error will be non-nil. Any
  17145. // non-2xx status code is an error. Response headers are in either
  17146. // *PlaylistListResponse.ServerResponse.Header or (if a response was
  17147. // returned at all) in error.(*googleapi.Error).Header. Use
  17148. // googleapi.IsNotModified to check whether the returned error was
  17149. // because http.StatusNotModified was returned.
  17150. func (c *PlaylistsListCall) Do(opts ...googleapi.CallOption) (*PlaylistListResponse, error) {
  17151. gensupport.SetOptions(c.urlParams_, opts...)
  17152. res, err := c.doRequest("json")
  17153. if res != nil && res.StatusCode == http.StatusNotModified {
  17154. if res.Body != nil {
  17155. res.Body.Close()
  17156. }
  17157. return nil, &googleapi.Error{
  17158. Code: res.StatusCode,
  17159. Header: res.Header,
  17160. }
  17161. }
  17162. if err != nil {
  17163. return nil, err
  17164. }
  17165. defer googleapi.CloseBody(res)
  17166. if err := googleapi.CheckResponse(res); err != nil {
  17167. return nil, err
  17168. }
  17169. ret := &PlaylistListResponse{
  17170. ServerResponse: googleapi.ServerResponse{
  17171. Header: res.Header,
  17172. HTTPStatusCode: res.StatusCode,
  17173. },
  17174. }
  17175. target := &ret
  17176. if err := gensupport.DecodeResponse(target, res); err != nil {
  17177. return nil, err
  17178. }
  17179. return ret, nil
  17180. // {
  17181. // "description": "Returns a collection of playlists that match the API request parameters. For example, you can retrieve all playlists that the authenticated user owns, or you can retrieve one or more playlists by their unique IDs.",
  17182. // "httpMethod": "GET",
  17183. // "id": "youtube.playlists.list",
  17184. // "parameterOrder": [
  17185. // "part"
  17186. // ],
  17187. // "parameters": {
  17188. // "channelId": {
  17189. // "description": "This value indicates that the API should only return the specified channel's playlists.",
  17190. // "location": "query",
  17191. // "type": "string"
  17192. // },
  17193. // "hl": {
  17194. // "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part.",
  17195. // "location": "query",
  17196. // "type": "string"
  17197. // },
  17198. // "id": {
  17199. // "description": "The id parameter specifies a comma-separated list of the YouTube playlist ID(s) for the resource(s) that are being retrieved. In a playlist resource, the id property specifies the playlist's YouTube playlist ID.",
  17200. // "location": "query",
  17201. // "type": "string"
  17202. // },
  17203. // "maxResults": {
  17204. // "default": "5",
  17205. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  17206. // "format": "uint32",
  17207. // "location": "query",
  17208. // "maximum": "50",
  17209. // "minimum": "0",
  17210. // "type": "integer"
  17211. // },
  17212. // "mine": {
  17213. // "description": "Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user.",
  17214. // "location": "query",
  17215. // "type": "boolean"
  17216. // },
  17217. // "onBehalfOfContentOwner": {
  17218. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17219. // "location": "query",
  17220. // "type": "string"
  17221. // },
  17222. // "onBehalfOfContentOwnerChannel": {
  17223. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  17224. // "location": "query",
  17225. // "type": "string"
  17226. // },
  17227. // "pageToken": {
  17228. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  17229. // "location": "query",
  17230. // "type": "string"
  17231. // },
  17232. // "part": {
  17233. // "description": "The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a playlist resource, the snippet property contains properties like author, title, description, tags, and timeCreated. As such, if you set part=snippet, the API response will contain all of those properties.",
  17234. // "location": "query",
  17235. // "required": true,
  17236. // "type": "string"
  17237. // }
  17238. // },
  17239. // "path": "playlists",
  17240. // "response": {
  17241. // "$ref": "PlaylistListResponse"
  17242. // },
  17243. // "scopes": [
  17244. // "https://www.googleapis.com/auth/youtube",
  17245. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17246. // "https://www.googleapis.com/auth/youtube.readonly",
  17247. // "https://www.googleapis.com/auth/youtubepartner"
  17248. // ]
  17249. // }
  17250. }
  17251. // Pages invokes f for each page of results.
  17252. // A non-nil error returned from f will halt the iteration.
  17253. // The provided context supersedes any context provided to the Context method.
  17254. func (c *PlaylistsListCall) Pages(ctx context.Context, f func(*PlaylistListResponse) error) error {
  17255. c.ctx_ = ctx
  17256. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17257. for {
  17258. x, err := c.Do()
  17259. if err != nil {
  17260. return err
  17261. }
  17262. if err := f(x); err != nil {
  17263. return err
  17264. }
  17265. if x.NextPageToken == "" {
  17266. return nil
  17267. }
  17268. c.PageToken(x.NextPageToken)
  17269. }
  17270. }
  17271. // method id "youtube.playlists.update":
  17272. type PlaylistsUpdateCall struct {
  17273. s *Service
  17274. playlist *Playlist
  17275. urlParams_ gensupport.URLParams
  17276. ctx_ context.Context
  17277. header_ http.Header
  17278. }
  17279. // Update: Modifies a playlist. For example, you could change a
  17280. // playlist's title, description, or privacy status.
  17281. func (r *PlaylistsService) Update(part string, playlist *Playlist) *PlaylistsUpdateCall {
  17282. c := &PlaylistsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17283. c.urlParams_.Set("part", part)
  17284. c.playlist = playlist
  17285. return c
  17286. }
  17287. // OnBehalfOfContentOwner sets the optional parameter
  17288. // "onBehalfOfContentOwner": Note: This parameter is intended
  17289. // exclusively for YouTube content partners.
  17290. //
  17291. // The onBehalfOfContentOwner parameter indicates that the request's
  17292. // authorization credentials identify a YouTube CMS user who is acting
  17293. // on behalf of the content owner specified in the parameter value. This
  17294. // parameter is intended for YouTube content partners that own and
  17295. // manage many different YouTube channels. It allows content owners to
  17296. // authenticate once and get access to all their video and channel data,
  17297. // without having to provide authentication credentials for each
  17298. // individual channel. The CMS account that the user authenticates with
  17299. // must be linked to the specified YouTube content owner.
  17300. func (c *PlaylistsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsUpdateCall {
  17301. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17302. return c
  17303. }
  17304. // Fields allows partial responses to be retrieved. See
  17305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17306. // for more information.
  17307. func (c *PlaylistsUpdateCall) Fields(s ...googleapi.Field) *PlaylistsUpdateCall {
  17308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17309. return c
  17310. }
  17311. // Context sets the context to be used in this call's Do method. Any
  17312. // pending HTTP request will be aborted if the provided context is
  17313. // canceled.
  17314. func (c *PlaylistsUpdateCall) Context(ctx context.Context) *PlaylistsUpdateCall {
  17315. c.ctx_ = ctx
  17316. return c
  17317. }
  17318. // Header returns an http.Header that can be modified by the caller to
  17319. // add HTTP headers to the request.
  17320. func (c *PlaylistsUpdateCall) Header() http.Header {
  17321. if c.header_ == nil {
  17322. c.header_ = make(http.Header)
  17323. }
  17324. return c.header_
  17325. }
  17326. func (c *PlaylistsUpdateCall) doRequest(alt string) (*http.Response, error) {
  17327. reqHeaders := make(http.Header)
  17328. for k, v := range c.header_ {
  17329. reqHeaders[k] = v
  17330. }
  17331. reqHeaders.Set("User-Agent", c.s.userAgent())
  17332. var body io.Reader = nil
  17333. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist)
  17334. if err != nil {
  17335. return nil, err
  17336. }
  17337. reqHeaders.Set("Content-Type", "application/json")
  17338. c.urlParams_.Set("alt", alt)
  17339. c.urlParams_.Set("prettyPrint", "false")
  17340. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  17341. urls += "?" + c.urlParams_.Encode()
  17342. req, err := http.NewRequest("PUT", urls, body)
  17343. if err != nil {
  17344. return nil, err
  17345. }
  17346. req.Header = reqHeaders
  17347. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17348. }
  17349. // Do executes the "youtube.playlists.update" call.
  17350. // Exactly one of *Playlist or error will be non-nil. Any non-2xx status
  17351. // code is an error. Response headers are in either
  17352. // *Playlist.ServerResponse.Header or (if a response was returned at
  17353. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17354. // to check whether the returned error was because
  17355. // http.StatusNotModified was returned.
  17356. func (c *PlaylistsUpdateCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
  17357. gensupport.SetOptions(c.urlParams_, opts...)
  17358. res, err := c.doRequest("json")
  17359. if res != nil && res.StatusCode == http.StatusNotModified {
  17360. if res.Body != nil {
  17361. res.Body.Close()
  17362. }
  17363. return nil, &googleapi.Error{
  17364. Code: res.StatusCode,
  17365. Header: res.Header,
  17366. }
  17367. }
  17368. if err != nil {
  17369. return nil, err
  17370. }
  17371. defer googleapi.CloseBody(res)
  17372. if err := googleapi.CheckResponse(res); err != nil {
  17373. return nil, err
  17374. }
  17375. ret := &Playlist{
  17376. ServerResponse: googleapi.ServerResponse{
  17377. Header: res.Header,
  17378. HTTPStatusCode: res.StatusCode,
  17379. },
  17380. }
  17381. target := &ret
  17382. if err := gensupport.DecodeResponse(target, res); err != nil {
  17383. return nil, err
  17384. }
  17385. return ret, nil
  17386. // {
  17387. // "description": "Modifies a playlist. For example, you could change a playlist's title, description, or privacy status.",
  17388. // "httpMethod": "PUT",
  17389. // "id": "youtube.playlists.update",
  17390. // "parameterOrder": [
  17391. // "part"
  17392. // ],
  17393. // "parameters": {
  17394. // "onBehalfOfContentOwner": {
  17395. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17396. // "location": "query",
  17397. // "type": "string"
  17398. // },
  17399. // "part": {
  17400. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for mutable properties that are contained in any parts that the request body specifies. For example, a playlist's description is contained in the snippet part, which must be included in the request body. If the request does not specify a value for the snippet.description property, the playlist's existing description will be deleted.",
  17401. // "location": "query",
  17402. // "required": true,
  17403. // "type": "string"
  17404. // }
  17405. // },
  17406. // "path": "playlists",
  17407. // "request": {
  17408. // "$ref": "Playlist"
  17409. // },
  17410. // "response": {
  17411. // "$ref": "Playlist"
  17412. // },
  17413. // "scopes": [
  17414. // "https://www.googleapis.com/auth/youtube",
  17415. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17416. // "https://www.googleapis.com/auth/youtubepartner"
  17417. // ]
  17418. // }
  17419. }
  17420. // method id "youtube.search.list":
  17421. type SearchListCall struct {
  17422. s *Service
  17423. urlParams_ gensupport.URLParams
  17424. ifNoneMatch_ string
  17425. ctx_ context.Context
  17426. header_ http.Header
  17427. }
  17428. // List: Returns a collection of search results that match the query
  17429. // parameters specified in the API request. By default, a search result
  17430. // set identifies matching video, channel, and playlist resources, but
  17431. // you can also configure queries to only retrieve a specific type of
  17432. // resource.
  17433. func (r *SearchService) List(part string) *SearchListCall {
  17434. c := &SearchListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17435. c.urlParams_.Set("part", part)
  17436. return c
  17437. }
  17438. // ChannelId sets the optional parameter "channelId": The channelId
  17439. // parameter indicates that the API response should only contain
  17440. // resources created by the channel
  17441. func (c *SearchListCall) ChannelId(channelId string) *SearchListCall {
  17442. c.urlParams_.Set("channelId", channelId)
  17443. return c
  17444. }
  17445. // ChannelType sets the optional parameter "channelType": The
  17446. // channelType parameter lets you restrict a search to a particular type
  17447. // of channel.
  17448. //
  17449. // Possible values:
  17450. // "any" - Return all channels.
  17451. // "show" - Only retrieve shows.
  17452. func (c *SearchListCall) ChannelType(channelType string) *SearchListCall {
  17453. c.urlParams_.Set("channelType", channelType)
  17454. return c
  17455. }
  17456. // EventType sets the optional parameter "eventType": The eventType
  17457. // parameter restricts a search to broadcast events. If you specify a
  17458. // value for this parameter, you must also set the type parameter's
  17459. // value to video.
  17460. //
  17461. // Possible values:
  17462. // "completed" - Only include completed broadcasts.
  17463. // "live" - Only include active broadcasts.
  17464. // "upcoming" - Only include upcoming broadcasts.
  17465. func (c *SearchListCall) EventType(eventType string) *SearchListCall {
  17466. c.urlParams_.Set("eventType", eventType)
  17467. return c
  17468. }
  17469. // ForContentOwner sets the optional parameter "forContentOwner": Note:
  17470. // This parameter is intended exclusively for YouTube content
  17471. // partners.
  17472. //
  17473. // The forContentOwner parameter restricts the search to only retrieve
  17474. // resources owned by the content owner specified by the
  17475. // onBehalfOfContentOwner parameter. The user must be authenticated
  17476. // using a CMS account linked to the specified content owner and
  17477. // onBehalfOfContentOwner must be provided.
  17478. func (c *SearchListCall) ForContentOwner(forContentOwner bool) *SearchListCall {
  17479. c.urlParams_.Set("forContentOwner", fmt.Sprint(forContentOwner))
  17480. return c
  17481. }
  17482. // ForDeveloper sets the optional parameter "forDeveloper": The
  17483. // forDeveloper parameter restricts the search to only retrieve videos
  17484. // uploaded via the developer's application or website. The API server
  17485. // uses the request's authorization credentials to identify the
  17486. // developer. Therefore, a developer can restrict results to videos
  17487. // uploaded through the developer's own app or website but not to videos
  17488. // uploaded through other apps or sites.
  17489. func (c *SearchListCall) ForDeveloper(forDeveloper bool) *SearchListCall {
  17490. c.urlParams_.Set("forDeveloper", fmt.Sprint(forDeveloper))
  17491. return c
  17492. }
  17493. // ForMine sets the optional parameter "forMine": The forMine parameter
  17494. // restricts the search to only retrieve videos owned by the
  17495. // authenticated user. If you set this parameter to true, then the type
  17496. // parameter's value must also be set to video.
  17497. func (c *SearchListCall) ForMine(forMine bool) *SearchListCall {
  17498. c.urlParams_.Set("forMine", fmt.Sprint(forMine))
  17499. return c
  17500. }
  17501. // Location sets the optional parameter "location": The location
  17502. // parameter, in conjunction with the locationRadius parameter, defines
  17503. // a circular geographic area and also restricts a search to videos that
  17504. // specify, in their metadata, a geographic location that falls within
  17505. // that area. The parameter value is a string that specifies
  17506. // latitude/longitude coordinates e.g. (37.42307,-122.08427).
  17507. //
  17508. //
  17509. // - The location parameter value identifies the point at the center of
  17510. // the area.
  17511. // - The locationRadius parameter specifies the maximum distance that
  17512. // the location associated with a video can be from that point for the
  17513. // video to still be included in the search results.The API returns an
  17514. // error if your request specifies a value for the location parameter
  17515. // but does not also specify a value for the locationRadius parameter.
  17516. func (c *SearchListCall) Location(location string) *SearchListCall {
  17517. c.urlParams_.Set("location", location)
  17518. return c
  17519. }
  17520. // LocationRadius sets the optional parameter "locationRadius": The
  17521. // locationRadius parameter, in conjunction with the location parameter,
  17522. // defines a circular geographic area.
  17523. //
  17524. // The parameter value must be a floating point number followed by a
  17525. // measurement unit. Valid measurement units are m, km, ft, and mi. For
  17526. // example, valid parameter values include 1500m, 5km, 10000ft, and
  17527. // 0.75mi. The API does not support locationRadius parameter values
  17528. // larger than 1000 kilometers.
  17529. //
  17530. // Note: See the definition of the location parameter for more
  17531. // information.
  17532. func (c *SearchListCall) LocationRadius(locationRadius string) *SearchListCall {
  17533. c.urlParams_.Set("locationRadius", locationRadius)
  17534. return c
  17535. }
  17536. // MaxResults sets the optional parameter "maxResults": The maxResults
  17537. // parameter specifies the maximum number of items that should be
  17538. // returned in the result set.
  17539. func (c *SearchListCall) MaxResults(maxResults int64) *SearchListCall {
  17540. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17541. return c
  17542. }
  17543. // OnBehalfOfContentOwner sets the optional parameter
  17544. // "onBehalfOfContentOwner": Note: This parameter is intended
  17545. // exclusively for YouTube content partners.
  17546. //
  17547. // The onBehalfOfContentOwner parameter indicates that the request's
  17548. // authorization credentials identify a YouTube CMS user who is acting
  17549. // on behalf of the content owner specified in the parameter value. This
  17550. // parameter is intended for YouTube content partners that own and
  17551. // manage many different YouTube channels. It allows content owners to
  17552. // authenticate once and get access to all their video and channel data,
  17553. // without having to provide authentication credentials for each
  17554. // individual channel. The CMS account that the user authenticates with
  17555. // must be linked to the specified YouTube content owner.
  17556. func (c *SearchListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SearchListCall {
  17557. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17558. return c
  17559. }
  17560. // Order sets the optional parameter "order": The order parameter
  17561. // specifies the method that will be used to order resources in the API
  17562. // response.
  17563. //
  17564. // Possible values:
  17565. // "date" - Resources are sorted in reverse chronological order based
  17566. // on the date they were created.
  17567. // "rating" - Resources are sorted from highest to lowest rating.
  17568. // "relevance" - Resources are sorted based on their relevance to the
  17569. // search query. This is the default value for this parameter.
  17570. // "title" - Resources are sorted alphabetically by title.
  17571. // "videoCount" - Channels are sorted in descending order of their
  17572. // number of uploaded videos.
  17573. // "viewCount" - Resources are sorted from highest to lowest number of
  17574. // views.
  17575. func (c *SearchListCall) Order(order string) *SearchListCall {
  17576. c.urlParams_.Set("order", order)
  17577. return c
  17578. }
  17579. // PageToken sets the optional parameter "pageToken": The pageToken
  17580. // parameter identifies a specific page in the result set that should be
  17581. // returned. In an API response, the nextPageToken and prevPageToken
  17582. // properties identify other pages that could be retrieved.
  17583. func (c *SearchListCall) PageToken(pageToken string) *SearchListCall {
  17584. c.urlParams_.Set("pageToken", pageToken)
  17585. return c
  17586. }
  17587. // PublishedAfter sets the optional parameter "publishedAfter": The
  17588. // publishedAfter parameter indicates that the API response should only
  17589. // contain resources created after the specified time. The value is an
  17590. // RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  17591. func (c *SearchListCall) PublishedAfter(publishedAfter string) *SearchListCall {
  17592. c.urlParams_.Set("publishedAfter", publishedAfter)
  17593. return c
  17594. }
  17595. // PublishedBefore sets the optional parameter "publishedBefore": The
  17596. // publishedBefore parameter indicates that the API response should only
  17597. // contain resources created before the specified time. The value is an
  17598. // RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  17599. func (c *SearchListCall) PublishedBefore(publishedBefore string) *SearchListCall {
  17600. c.urlParams_.Set("publishedBefore", publishedBefore)
  17601. return c
  17602. }
  17603. // Q sets the optional parameter "q": The q parameter specifies the
  17604. // query term to search for.
  17605. //
  17606. // Your request can also use the Boolean NOT (-) and OR (|) operators to
  17607. // exclude videos or to find videos that are associated with one of
  17608. // several search terms. For example, to search for videos matching
  17609. // either "boating" or "sailing", set the q parameter value to
  17610. // boating|sailing. Similarly, to search for videos matching either
  17611. // "boating" or "sailing" but not "fishing", set the q parameter value
  17612. // to boating|sailing -fishing. Note that the pipe character must be
  17613. // URL-escaped when it is sent in your API request. The URL-escaped
  17614. // value for the pipe character is %7C.
  17615. func (c *SearchListCall) Q(q string) *SearchListCall {
  17616. c.urlParams_.Set("q", q)
  17617. return c
  17618. }
  17619. // RegionCode sets the optional parameter "regionCode": The regionCode
  17620. // parameter instructs the API to return search results for the
  17621. // specified country. The parameter value is an ISO 3166-1 alpha-2
  17622. // country code.
  17623. func (c *SearchListCall) RegionCode(regionCode string) *SearchListCall {
  17624. c.urlParams_.Set("regionCode", regionCode)
  17625. return c
  17626. }
  17627. // RelatedToVideoId sets the optional parameter "relatedToVideoId": The
  17628. // relatedToVideoId parameter retrieves a list of videos that are
  17629. // related to the video that the parameter value identifies. The
  17630. // parameter value must be set to a YouTube video ID and, if you are
  17631. // using this parameter, the type parameter must be set to video.
  17632. func (c *SearchListCall) RelatedToVideoId(relatedToVideoId string) *SearchListCall {
  17633. c.urlParams_.Set("relatedToVideoId", relatedToVideoId)
  17634. return c
  17635. }
  17636. // RelevanceLanguage sets the optional parameter "relevanceLanguage":
  17637. // The relevanceLanguage parameter instructs the API to return search
  17638. // results that are most relevant to the specified language. The
  17639. // parameter value is typically an ISO 639-1 two-letter language code.
  17640. // However, you should use the values zh-Hans for simplified Chinese and
  17641. // zh-Hant for traditional Chinese. Please note that results in other
  17642. // languages will still be returned if they are highly relevant to the
  17643. // search query term.
  17644. func (c *SearchListCall) RelevanceLanguage(relevanceLanguage string) *SearchListCall {
  17645. c.urlParams_.Set("relevanceLanguage", relevanceLanguage)
  17646. return c
  17647. }
  17648. // SafeSearch sets the optional parameter "safeSearch": The safeSearch
  17649. // parameter indicates whether the search results should include
  17650. // restricted content as well as standard content.
  17651. //
  17652. // Possible values:
  17653. // "moderate" - YouTube will filter some content from search results
  17654. // and, at the least, will filter content that is restricted in your
  17655. // locale. Based on their content, search results could be removed from
  17656. // search results or demoted in search results. This is the default
  17657. // parameter value.
  17658. // "none" - YouTube will not filter the search result set.
  17659. // "strict" - YouTube will try to exclude all restricted content from
  17660. // the search result set. Based on their content, search results could
  17661. // be removed from search results or demoted in search results.
  17662. func (c *SearchListCall) SafeSearch(safeSearch string) *SearchListCall {
  17663. c.urlParams_.Set("safeSearch", safeSearch)
  17664. return c
  17665. }
  17666. // TopicId sets the optional parameter "topicId": The topicId parameter
  17667. // indicates that the API response should only contain resources
  17668. // associated with the specified topic. The value identifies a Freebase
  17669. // topic ID.
  17670. func (c *SearchListCall) TopicId(topicId string) *SearchListCall {
  17671. c.urlParams_.Set("topicId", topicId)
  17672. return c
  17673. }
  17674. // Type sets the optional parameter "type": The type parameter restricts
  17675. // a search query to only retrieve a particular type of resource. The
  17676. // value is a comma-separated list of resource types.
  17677. func (c *SearchListCall) Type(type_ string) *SearchListCall {
  17678. c.urlParams_.Set("type", type_)
  17679. return c
  17680. }
  17681. // VideoCaption sets the optional parameter "videoCaption": The
  17682. // videoCaption parameter indicates whether the API should filter video
  17683. // search results based on whether they have captions. If you specify a
  17684. // value for this parameter, you must also set the type parameter's
  17685. // value to video.
  17686. //
  17687. // Possible values:
  17688. // "any" - Do not filter results based on caption availability.
  17689. // "closedCaption" - Only include videos that have captions.
  17690. // "none" - Only include videos that do not have captions.
  17691. func (c *SearchListCall) VideoCaption(videoCaption string) *SearchListCall {
  17692. c.urlParams_.Set("videoCaption", videoCaption)
  17693. return c
  17694. }
  17695. // VideoCategoryId sets the optional parameter "videoCategoryId": The
  17696. // videoCategoryId parameter filters video search results based on their
  17697. // category. If you specify a value for this parameter, you must also
  17698. // set the type parameter's value to video.
  17699. func (c *SearchListCall) VideoCategoryId(videoCategoryId string) *SearchListCall {
  17700. c.urlParams_.Set("videoCategoryId", videoCategoryId)
  17701. return c
  17702. }
  17703. // VideoDefinition sets the optional parameter "videoDefinition": The
  17704. // videoDefinition parameter lets you restrict a search to only include
  17705. // either high definition (HD) or standard definition (SD) videos. HD
  17706. // videos are available for playback in at least 720p, though higher
  17707. // resolutions, like 1080p, might also be available. If you specify a
  17708. // value for this parameter, you must also set the type parameter's
  17709. // value to video.
  17710. //
  17711. // Possible values:
  17712. // "any" - Return all videos, regardless of their resolution.
  17713. // "high" - Only retrieve HD videos.
  17714. // "standard" - Only retrieve videos in standard definition.
  17715. func (c *SearchListCall) VideoDefinition(videoDefinition string) *SearchListCall {
  17716. c.urlParams_.Set("videoDefinition", videoDefinition)
  17717. return c
  17718. }
  17719. // VideoDimension sets the optional parameter "videoDimension": The
  17720. // videoDimension parameter lets you restrict a search to only retrieve
  17721. // 2D or 3D videos. If you specify a value for this parameter, you must
  17722. // also set the type parameter's value to video.
  17723. //
  17724. // Possible values:
  17725. // "2d" - Restrict search results to exclude 3D videos.
  17726. // "3d" - Restrict search results to only include 3D videos.
  17727. // "any" - Include both 3D and non-3D videos in returned results. This
  17728. // is the default value.
  17729. func (c *SearchListCall) VideoDimension(videoDimension string) *SearchListCall {
  17730. c.urlParams_.Set("videoDimension", videoDimension)
  17731. return c
  17732. }
  17733. // VideoDuration sets the optional parameter "videoDuration": The
  17734. // videoDuration parameter filters video search results based on their
  17735. // duration. If you specify a value for this parameter, you must also
  17736. // set the type parameter's value to video.
  17737. //
  17738. // Possible values:
  17739. // "any" - Do not filter video search results based on their duration.
  17740. // This is the default value.
  17741. // "long" - Only include videos longer than 20 minutes.
  17742. // "medium" - Only include videos that are between four and 20 minutes
  17743. // long (inclusive).
  17744. // "short" - Only include videos that are less than four minutes long.
  17745. func (c *SearchListCall) VideoDuration(videoDuration string) *SearchListCall {
  17746. c.urlParams_.Set("videoDuration", videoDuration)
  17747. return c
  17748. }
  17749. // VideoEmbeddable sets the optional parameter "videoEmbeddable": The
  17750. // videoEmbeddable parameter lets you to restrict a search to only
  17751. // videos that can be embedded into a webpage. If you specify a value
  17752. // for this parameter, you must also set the type parameter's value to
  17753. // video.
  17754. //
  17755. // Possible values:
  17756. // "any" - Return all videos, embeddable or not.
  17757. // "true" - Only retrieve embeddable videos.
  17758. func (c *SearchListCall) VideoEmbeddable(videoEmbeddable string) *SearchListCall {
  17759. c.urlParams_.Set("videoEmbeddable", videoEmbeddable)
  17760. return c
  17761. }
  17762. // VideoLicense sets the optional parameter "videoLicense": The
  17763. // videoLicense parameter filters search results to only include videos
  17764. // with a particular license. YouTube lets video uploaders choose to
  17765. // attach either the Creative Commons license or the standard YouTube
  17766. // license to each of their videos. If you specify a value for this
  17767. // parameter, you must also set the type parameter's value to video.
  17768. //
  17769. // Possible values:
  17770. // "any" - Return all videos, regardless of which license they have,
  17771. // that match the query parameters.
  17772. // "creativeCommon" - Only return videos that have a Creative Commons
  17773. // license. Users can reuse videos with this license in other videos
  17774. // that they create. Learn more.
  17775. // "youtube" - Only return videos that have the standard YouTube
  17776. // license.
  17777. func (c *SearchListCall) VideoLicense(videoLicense string) *SearchListCall {
  17778. c.urlParams_.Set("videoLicense", videoLicense)
  17779. return c
  17780. }
  17781. // VideoSyndicated sets the optional parameter "videoSyndicated": The
  17782. // videoSyndicated parameter lets you to restrict a search to only
  17783. // videos that can be played outside youtube.com. If you specify a value
  17784. // for this parameter, you must also set the type parameter's value to
  17785. // video.
  17786. //
  17787. // Possible values:
  17788. // "any" - Return all videos, syndicated or not.
  17789. // "true" - Only retrieve syndicated videos.
  17790. func (c *SearchListCall) VideoSyndicated(videoSyndicated string) *SearchListCall {
  17791. c.urlParams_.Set("videoSyndicated", videoSyndicated)
  17792. return c
  17793. }
  17794. // VideoType sets the optional parameter "videoType": The videoType
  17795. // parameter lets you restrict a search to a particular type of videos.
  17796. // If you specify a value for this parameter, you must also set the type
  17797. // parameter's value to video.
  17798. //
  17799. // Possible values:
  17800. // "any" - Return all videos.
  17801. // "episode" - Only retrieve episodes of shows.
  17802. // "movie" - Only retrieve movies.
  17803. func (c *SearchListCall) VideoType(videoType string) *SearchListCall {
  17804. c.urlParams_.Set("videoType", videoType)
  17805. return c
  17806. }
  17807. // Fields allows partial responses to be retrieved. See
  17808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17809. // for more information.
  17810. func (c *SearchListCall) Fields(s ...googleapi.Field) *SearchListCall {
  17811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17812. return c
  17813. }
  17814. // IfNoneMatch sets the optional parameter which makes the operation
  17815. // fail if the object's ETag matches the given value. This is useful for
  17816. // getting updates only after the object has changed since the last
  17817. // request. Use googleapi.IsNotModified to check whether the response
  17818. // error from Do is the result of In-None-Match.
  17819. func (c *SearchListCall) IfNoneMatch(entityTag string) *SearchListCall {
  17820. c.ifNoneMatch_ = entityTag
  17821. return c
  17822. }
  17823. // Context sets the context to be used in this call's Do method. Any
  17824. // pending HTTP request will be aborted if the provided context is
  17825. // canceled.
  17826. func (c *SearchListCall) Context(ctx context.Context) *SearchListCall {
  17827. c.ctx_ = ctx
  17828. return c
  17829. }
  17830. // Header returns an http.Header that can be modified by the caller to
  17831. // add HTTP headers to the request.
  17832. func (c *SearchListCall) Header() http.Header {
  17833. if c.header_ == nil {
  17834. c.header_ = make(http.Header)
  17835. }
  17836. return c.header_
  17837. }
  17838. func (c *SearchListCall) doRequest(alt string) (*http.Response, error) {
  17839. reqHeaders := make(http.Header)
  17840. for k, v := range c.header_ {
  17841. reqHeaders[k] = v
  17842. }
  17843. reqHeaders.Set("User-Agent", c.s.userAgent())
  17844. if c.ifNoneMatch_ != "" {
  17845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17846. }
  17847. var body io.Reader = nil
  17848. c.urlParams_.Set("alt", alt)
  17849. c.urlParams_.Set("prettyPrint", "false")
  17850. urls := googleapi.ResolveRelative(c.s.BasePath, "search")
  17851. urls += "?" + c.urlParams_.Encode()
  17852. req, err := http.NewRequest("GET", urls, body)
  17853. if err != nil {
  17854. return nil, err
  17855. }
  17856. req.Header = reqHeaders
  17857. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17858. }
  17859. // Do executes the "youtube.search.list" call.
  17860. // Exactly one of *SearchListResponse or error will be non-nil. Any
  17861. // non-2xx status code is an error. Response headers are in either
  17862. // *SearchListResponse.ServerResponse.Header or (if a response was
  17863. // returned at all) in error.(*googleapi.Error).Header. Use
  17864. // googleapi.IsNotModified to check whether the returned error was
  17865. // because http.StatusNotModified was returned.
  17866. func (c *SearchListCall) Do(opts ...googleapi.CallOption) (*SearchListResponse, error) {
  17867. gensupport.SetOptions(c.urlParams_, opts...)
  17868. res, err := c.doRequest("json")
  17869. if res != nil && res.StatusCode == http.StatusNotModified {
  17870. if res.Body != nil {
  17871. res.Body.Close()
  17872. }
  17873. return nil, &googleapi.Error{
  17874. Code: res.StatusCode,
  17875. Header: res.Header,
  17876. }
  17877. }
  17878. if err != nil {
  17879. return nil, err
  17880. }
  17881. defer googleapi.CloseBody(res)
  17882. if err := googleapi.CheckResponse(res); err != nil {
  17883. return nil, err
  17884. }
  17885. ret := &SearchListResponse{
  17886. ServerResponse: googleapi.ServerResponse{
  17887. Header: res.Header,
  17888. HTTPStatusCode: res.StatusCode,
  17889. },
  17890. }
  17891. target := &ret
  17892. if err := gensupport.DecodeResponse(target, res); err != nil {
  17893. return nil, err
  17894. }
  17895. return ret, nil
  17896. // {
  17897. // "description": "Returns a collection of search results that match the query parameters specified in the API request. By default, a search result set identifies matching video, channel, and playlist resources, but you can also configure queries to only retrieve a specific type of resource.",
  17898. // "httpMethod": "GET",
  17899. // "id": "youtube.search.list",
  17900. // "parameterOrder": [
  17901. // "part"
  17902. // ],
  17903. // "parameters": {
  17904. // "channelId": {
  17905. // "description": "The channelId parameter indicates that the API response should only contain resources created by the channel",
  17906. // "location": "query",
  17907. // "type": "string"
  17908. // },
  17909. // "channelType": {
  17910. // "description": "The channelType parameter lets you restrict a search to a particular type of channel.",
  17911. // "enum": [
  17912. // "any",
  17913. // "show"
  17914. // ],
  17915. // "enumDescriptions": [
  17916. // "Return all channels.",
  17917. // "Only retrieve shows."
  17918. // ],
  17919. // "location": "query",
  17920. // "type": "string"
  17921. // },
  17922. // "eventType": {
  17923. // "description": "The eventType parameter restricts a search to broadcast events. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  17924. // "enum": [
  17925. // "completed",
  17926. // "live",
  17927. // "upcoming"
  17928. // ],
  17929. // "enumDescriptions": [
  17930. // "Only include completed broadcasts.",
  17931. // "Only include active broadcasts.",
  17932. // "Only include upcoming broadcasts."
  17933. // ],
  17934. // "location": "query",
  17935. // "type": "string"
  17936. // },
  17937. // "forContentOwner": {
  17938. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe forContentOwner parameter restricts the search to only retrieve resources owned by the content owner specified by the onBehalfOfContentOwner parameter. The user must be authenticated using a CMS account linked to the specified content owner and onBehalfOfContentOwner must be provided.",
  17939. // "location": "query",
  17940. // "type": "boolean"
  17941. // },
  17942. // "forDeveloper": {
  17943. // "description": "The forDeveloper parameter restricts the search to only retrieve videos uploaded via the developer's application or website. The API server uses the request's authorization credentials to identify the developer. Therefore, a developer can restrict results to videos uploaded through the developer's own app or website but not to videos uploaded through other apps or sites.",
  17944. // "location": "query",
  17945. // "type": "boolean"
  17946. // },
  17947. // "forMine": {
  17948. // "description": "The forMine parameter restricts the search to only retrieve videos owned by the authenticated user. If you set this parameter to true, then the type parameter's value must also be set to video.",
  17949. // "location": "query",
  17950. // "type": "boolean"
  17951. // },
  17952. // "location": {
  17953. // "description": "The location parameter, in conjunction with the locationRadius parameter, defines a circular geographic area and also restricts a search to videos that specify, in their metadata, a geographic location that falls within that area. The parameter value is a string that specifies latitude/longitude coordinates e.g. (37.42307,-122.08427).\n\n\n- The location parameter value identifies the point at the center of the area.\n- The locationRadius parameter specifies the maximum distance that the location associated with a video can be from that point for the video to still be included in the search results.The API returns an error if your request specifies a value for the location parameter but does not also specify a value for the locationRadius parameter.",
  17954. // "location": "query",
  17955. // "type": "string"
  17956. // },
  17957. // "locationRadius": {
  17958. // "description": "The locationRadius parameter, in conjunction with the location parameter, defines a circular geographic area.\n\nThe parameter value must be a floating point number followed by a measurement unit. Valid measurement units are m, km, ft, and mi. For example, valid parameter values include 1500m, 5km, 10000ft, and 0.75mi. The API does not support locationRadius parameter values larger than 1000 kilometers.\n\nNote: See the definition of the location parameter for more information.",
  17959. // "location": "query",
  17960. // "type": "string"
  17961. // },
  17962. // "maxResults": {
  17963. // "default": "5",
  17964. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  17965. // "format": "uint32",
  17966. // "location": "query",
  17967. // "maximum": "50",
  17968. // "minimum": "0",
  17969. // "type": "integer"
  17970. // },
  17971. // "onBehalfOfContentOwner": {
  17972. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  17973. // "location": "query",
  17974. // "type": "string"
  17975. // },
  17976. // "order": {
  17977. // "default": "SEARCH_SORT_RELEVANCE",
  17978. // "description": "The order parameter specifies the method that will be used to order resources in the API response.",
  17979. // "enum": [
  17980. // "date",
  17981. // "rating",
  17982. // "relevance",
  17983. // "title",
  17984. // "videoCount",
  17985. // "viewCount"
  17986. // ],
  17987. // "enumDescriptions": [
  17988. // "Resources are sorted in reverse chronological order based on the date they were created.",
  17989. // "Resources are sorted from highest to lowest rating.",
  17990. // "Resources are sorted based on their relevance to the search query. This is the default value for this parameter.",
  17991. // "Resources are sorted alphabetically by title.",
  17992. // "Channels are sorted in descending order of their number of uploaded videos.",
  17993. // "Resources are sorted from highest to lowest number of views."
  17994. // ],
  17995. // "location": "query",
  17996. // "type": "string"
  17997. // },
  17998. // "pageToken": {
  17999. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  18000. // "location": "query",
  18001. // "type": "string"
  18002. // },
  18003. // "part": {
  18004. // "description": "The part parameter specifies a comma-separated list of one or more search resource properties that the API response will include. Set the parameter value to snippet.",
  18005. // "location": "query",
  18006. // "required": true,
  18007. // "type": "string"
  18008. // },
  18009. // "publishedAfter": {
  18010. // "description": "The publishedAfter parameter indicates that the API response should only contain resources created after the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).",
  18011. // "format": "date-time",
  18012. // "location": "query",
  18013. // "type": "string"
  18014. // },
  18015. // "publishedBefore": {
  18016. // "description": "The publishedBefore parameter indicates that the API response should only contain resources created before the specified time. The value is an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).",
  18017. // "format": "date-time",
  18018. // "location": "query",
  18019. // "type": "string"
  18020. // },
  18021. // "q": {
  18022. // "description": "The q parameter specifies the query term to search for.\n\nYour request can also use the Boolean NOT (-) and OR (|) operators to exclude videos or to find videos that are associated with one of several search terms. For example, to search for videos matching either \"boating\" or \"sailing\", set the q parameter value to boating|sailing. Similarly, to search for videos matching either \"boating\" or \"sailing\" but not \"fishing\", set the q parameter value to boating|sailing -fishing. Note that the pipe character must be URL-escaped when it is sent in your API request. The URL-escaped value for the pipe character is %7C.",
  18023. // "location": "query",
  18024. // "type": "string"
  18025. // },
  18026. // "regionCode": {
  18027. // "description": "The regionCode parameter instructs the API to return search results for the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.",
  18028. // "location": "query",
  18029. // "type": "string"
  18030. // },
  18031. // "relatedToVideoId": {
  18032. // "description": "The relatedToVideoId parameter retrieves a list of videos that are related to the video that the parameter value identifies. The parameter value must be set to a YouTube video ID and, if you are using this parameter, the type parameter must be set to video.",
  18033. // "location": "query",
  18034. // "type": "string"
  18035. // },
  18036. // "relevanceLanguage": {
  18037. // "description": "The relevanceLanguage parameter instructs the API to return search results that are most relevant to the specified language. The parameter value is typically an ISO 639-1 two-letter language code. However, you should use the values zh-Hans for simplified Chinese and zh-Hant for traditional Chinese. Please note that results in other languages will still be returned if they are highly relevant to the search query term.",
  18038. // "location": "query",
  18039. // "type": "string"
  18040. // },
  18041. // "safeSearch": {
  18042. // "description": "The safeSearch parameter indicates whether the search results should include restricted content as well as standard content.",
  18043. // "enum": [
  18044. // "moderate",
  18045. // "none",
  18046. // "strict"
  18047. // ],
  18048. // "enumDescriptions": [
  18049. // "YouTube will filter some content from search results and, at the least, will filter content that is restricted in your locale. Based on their content, search results could be removed from search results or demoted in search results. This is the default parameter value.",
  18050. // "YouTube will not filter the search result set.",
  18051. // "YouTube will try to exclude all restricted content from the search result set. Based on their content, search results could be removed from search results or demoted in search results."
  18052. // ],
  18053. // "location": "query",
  18054. // "type": "string"
  18055. // },
  18056. // "topicId": {
  18057. // "description": "The topicId parameter indicates that the API response should only contain resources associated with the specified topic. The value identifies a Freebase topic ID.",
  18058. // "location": "query",
  18059. // "type": "string"
  18060. // },
  18061. // "type": {
  18062. // "default": "video,channel,playlist",
  18063. // "description": "The type parameter restricts a search query to only retrieve a particular type of resource. The value is a comma-separated list of resource types.",
  18064. // "location": "query",
  18065. // "type": "string"
  18066. // },
  18067. // "videoCaption": {
  18068. // "description": "The videoCaption parameter indicates whether the API should filter video search results based on whether they have captions. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18069. // "enum": [
  18070. // "any",
  18071. // "closedCaption",
  18072. // "none"
  18073. // ],
  18074. // "enumDescriptions": [
  18075. // "Do not filter results based on caption availability.",
  18076. // "Only include videos that have captions.",
  18077. // "Only include videos that do not have captions."
  18078. // ],
  18079. // "location": "query",
  18080. // "type": "string"
  18081. // },
  18082. // "videoCategoryId": {
  18083. // "description": "The videoCategoryId parameter filters video search results based on their category. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18084. // "location": "query",
  18085. // "type": "string"
  18086. // },
  18087. // "videoDefinition": {
  18088. // "description": "The videoDefinition parameter lets you restrict a search to only include either high definition (HD) or standard definition (SD) videos. HD videos are available for playback in at least 720p, though higher resolutions, like 1080p, might also be available. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18089. // "enum": [
  18090. // "any",
  18091. // "high",
  18092. // "standard"
  18093. // ],
  18094. // "enumDescriptions": [
  18095. // "Return all videos, regardless of their resolution.",
  18096. // "Only retrieve HD videos.",
  18097. // "Only retrieve videos in standard definition."
  18098. // ],
  18099. // "location": "query",
  18100. // "type": "string"
  18101. // },
  18102. // "videoDimension": {
  18103. // "description": "The videoDimension parameter lets you restrict a search to only retrieve 2D or 3D videos. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18104. // "enum": [
  18105. // "2d",
  18106. // "3d",
  18107. // "any"
  18108. // ],
  18109. // "enumDescriptions": [
  18110. // "Restrict search results to exclude 3D videos.",
  18111. // "Restrict search results to only include 3D videos.",
  18112. // "Include both 3D and non-3D videos in returned results. This is the default value."
  18113. // ],
  18114. // "location": "query",
  18115. // "type": "string"
  18116. // },
  18117. // "videoDuration": {
  18118. // "description": "The videoDuration parameter filters video search results based on their duration. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18119. // "enum": [
  18120. // "any",
  18121. // "long",
  18122. // "medium",
  18123. // "short"
  18124. // ],
  18125. // "enumDescriptions": [
  18126. // "Do not filter video search results based on their duration. This is the default value.",
  18127. // "Only include videos longer than 20 minutes.",
  18128. // "Only include videos that are between four and 20 minutes long (inclusive).",
  18129. // "Only include videos that are less than four minutes long."
  18130. // ],
  18131. // "location": "query",
  18132. // "type": "string"
  18133. // },
  18134. // "videoEmbeddable": {
  18135. // "description": "The videoEmbeddable parameter lets you to restrict a search to only videos that can be embedded into a webpage. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18136. // "enum": [
  18137. // "any",
  18138. // "true"
  18139. // ],
  18140. // "enumDescriptions": [
  18141. // "Return all videos, embeddable or not.",
  18142. // "Only retrieve embeddable videos."
  18143. // ],
  18144. // "location": "query",
  18145. // "type": "string"
  18146. // },
  18147. // "videoLicense": {
  18148. // "description": "The videoLicense parameter filters search results to only include videos with a particular license. YouTube lets video uploaders choose to attach either the Creative Commons license or the standard YouTube license to each of their videos. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18149. // "enum": [
  18150. // "any",
  18151. // "creativeCommon",
  18152. // "youtube"
  18153. // ],
  18154. // "enumDescriptions": [
  18155. // "Return all videos, regardless of which license they have, that match the query parameters.",
  18156. // "Only return videos that have a Creative Commons license. Users can reuse videos with this license in other videos that they create. Learn more.",
  18157. // "Only return videos that have the standard YouTube license."
  18158. // ],
  18159. // "location": "query",
  18160. // "type": "string"
  18161. // },
  18162. // "videoSyndicated": {
  18163. // "description": "The videoSyndicated parameter lets you to restrict a search to only videos that can be played outside youtube.com. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18164. // "enum": [
  18165. // "any",
  18166. // "true"
  18167. // ],
  18168. // "enumDescriptions": [
  18169. // "Return all videos, syndicated or not.",
  18170. // "Only retrieve syndicated videos."
  18171. // ],
  18172. // "location": "query",
  18173. // "type": "string"
  18174. // },
  18175. // "videoType": {
  18176. // "description": "The videoType parameter lets you restrict a search to a particular type of videos. If you specify a value for this parameter, you must also set the type parameter's value to video.",
  18177. // "enum": [
  18178. // "any",
  18179. // "episode",
  18180. // "movie"
  18181. // ],
  18182. // "enumDescriptions": [
  18183. // "Return all videos.",
  18184. // "Only retrieve episodes of shows.",
  18185. // "Only retrieve movies."
  18186. // ],
  18187. // "location": "query",
  18188. // "type": "string"
  18189. // }
  18190. // },
  18191. // "path": "search",
  18192. // "response": {
  18193. // "$ref": "SearchListResponse"
  18194. // },
  18195. // "scopes": [
  18196. // "https://www.googleapis.com/auth/youtube",
  18197. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18198. // "https://www.googleapis.com/auth/youtube.readonly",
  18199. // "https://www.googleapis.com/auth/youtubepartner"
  18200. // ]
  18201. // }
  18202. }
  18203. // Pages invokes f for each page of results.
  18204. // A non-nil error returned from f will halt the iteration.
  18205. // The provided context supersedes any context provided to the Context method.
  18206. func (c *SearchListCall) Pages(ctx context.Context, f func(*SearchListResponse) error) error {
  18207. c.ctx_ = ctx
  18208. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18209. for {
  18210. x, err := c.Do()
  18211. if err != nil {
  18212. return err
  18213. }
  18214. if err := f(x); err != nil {
  18215. return err
  18216. }
  18217. if x.NextPageToken == "" {
  18218. return nil
  18219. }
  18220. c.PageToken(x.NextPageToken)
  18221. }
  18222. }
  18223. // method id "youtube.sponsors.list":
  18224. type SponsorsListCall struct {
  18225. s *Service
  18226. urlParams_ gensupport.URLParams
  18227. ifNoneMatch_ string
  18228. ctx_ context.Context
  18229. header_ http.Header
  18230. }
  18231. // List: Lists sponsors for a channel.
  18232. func (r *SponsorsService) List(part string) *SponsorsListCall {
  18233. c := &SponsorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18234. c.urlParams_.Set("part", part)
  18235. return c
  18236. }
  18237. // Filter sets the optional parameter "filter": The filter parameter
  18238. // specifies which channel sponsors to return.
  18239. //
  18240. // Possible values:
  18241. // "all" - Return all sponsors, from newest to oldest.
  18242. // "newest" - Return the most recent sponsors, from newest to oldest.
  18243. func (c *SponsorsListCall) Filter(filter string) *SponsorsListCall {
  18244. c.urlParams_.Set("filter", filter)
  18245. return c
  18246. }
  18247. // MaxResults sets the optional parameter "maxResults": The maxResults
  18248. // parameter specifies the maximum number of items that should be
  18249. // returned in the result set.
  18250. func (c *SponsorsListCall) MaxResults(maxResults int64) *SponsorsListCall {
  18251. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18252. return c
  18253. }
  18254. // PageToken sets the optional parameter "pageToken": The pageToken
  18255. // parameter identifies a specific page in the result set that should be
  18256. // returned. In an API response, the nextPageToken and prevPageToken
  18257. // properties identify other pages that could be retrieved.
  18258. func (c *SponsorsListCall) PageToken(pageToken string) *SponsorsListCall {
  18259. c.urlParams_.Set("pageToken", pageToken)
  18260. return c
  18261. }
  18262. // Fields allows partial responses to be retrieved. See
  18263. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18264. // for more information.
  18265. func (c *SponsorsListCall) Fields(s ...googleapi.Field) *SponsorsListCall {
  18266. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18267. return c
  18268. }
  18269. // IfNoneMatch sets the optional parameter which makes the operation
  18270. // fail if the object's ETag matches the given value. This is useful for
  18271. // getting updates only after the object has changed since the last
  18272. // request. Use googleapi.IsNotModified to check whether the response
  18273. // error from Do is the result of In-None-Match.
  18274. func (c *SponsorsListCall) IfNoneMatch(entityTag string) *SponsorsListCall {
  18275. c.ifNoneMatch_ = entityTag
  18276. return c
  18277. }
  18278. // Context sets the context to be used in this call's Do method. Any
  18279. // pending HTTP request will be aborted if the provided context is
  18280. // canceled.
  18281. func (c *SponsorsListCall) Context(ctx context.Context) *SponsorsListCall {
  18282. c.ctx_ = ctx
  18283. return c
  18284. }
  18285. // Header returns an http.Header that can be modified by the caller to
  18286. // add HTTP headers to the request.
  18287. func (c *SponsorsListCall) Header() http.Header {
  18288. if c.header_ == nil {
  18289. c.header_ = make(http.Header)
  18290. }
  18291. return c.header_
  18292. }
  18293. func (c *SponsorsListCall) doRequest(alt string) (*http.Response, error) {
  18294. reqHeaders := make(http.Header)
  18295. for k, v := range c.header_ {
  18296. reqHeaders[k] = v
  18297. }
  18298. reqHeaders.Set("User-Agent", c.s.userAgent())
  18299. if c.ifNoneMatch_ != "" {
  18300. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18301. }
  18302. var body io.Reader = nil
  18303. c.urlParams_.Set("alt", alt)
  18304. c.urlParams_.Set("prettyPrint", "false")
  18305. urls := googleapi.ResolveRelative(c.s.BasePath, "sponsors")
  18306. urls += "?" + c.urlParams_.Encode()
  18307. req, err := http.NewRequest("GET", urls, body)
  18308. if err != nil {
  18309. return nil, err
  18310. }
  18311. req.Header = reqHeaders
  18312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18313. }
  18314. // Do executes the "youtube.sponsors.list" call.
  18315. // Exactly one of *SponsorListResponse or error will be non-nil. Any
  18316. // non-2xx status code is an error. Response headers are in either
  18317. // *SponsorListResponse.ServerResponse.Header or (if a response was
  18318. // returned at all) in error.(*googleapi.Error).Header. Use
  18319. // googleapi.IsNotModified to check whether the returned error was
  18320. // because http.StatusNotModified was returned.
  18321. func (c *SponsorsListCall) Do(opts ...googleapi.CallOption) (*SponsorListResponse, error) {
  18322. gensupport.SetOptions(c.urlParams_, opts...)
  18323. res, err := c.doRequest("json")
  18324. if res != nil && res.StatusCode == http.StatusNotModified {
  18325. if res.Body != nil {
  18326. res.Body.Close()
  18327. }
  18328. return nil, &googleapi.Error{
  18329. Code: res.StatusCode,
  18330. Header: res.Header,
  18331. }
  18332. }
  18333. if err != nil {
  18334. return nil, err
  18335. }
  18336. defer googleapi.CloseBody(res)
  18337. if err := googleapi.CheckResponse(res); err != nil {
  18338. return nil, err
  18339. }
  18340. ret := &SponsorListResponse{
  18341. ServerResponse: googleapi.ServerResponse{
  18342. Header: res.Header,
  18343. HTTPStatusCode: res.StatusCode,
  18344. },
  18345. }
  18346. target := &ret
  18347. if err := gensupport.DecodeResponse(target, res); err != nil {
  18348. return nil, err
  18349. }
  18350. return ret, nil
  18351. // {
  18352. // "description": "Lists sponsors for a channel.",
  18353. // "httpMethod": "GET",
  18354. // "id": "youtube.sponsors.list",
  18355. // "parameterOrder": [
  18356. // "part"
  18357. // ],
  18358. // "parameters": {
  18359. // "filter": {
  18360. // "default": "POLL_NEWEST",
  18361. // "description": "The filter parameter specifies which channel sponsors to return.",
  18362. // "enum": [
  18363. // "all",
  18364. // "newest"
  18365. // ],
  18366. // "enumDescriptions": [
  18367. // "Return all sponsors, from newest to oldest.",
  18368. // "Return the most recent sponsors, from newest to oldest."
  18369. // ],
  18370. // "location": "query",
  18371. // "type": "string"
  18372. // },
  18373. // "maxResults": {
  18374. // "default": "5",
  18375. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  18376. // "format": "uint32",
  18377. // "location": "query",
  18378. // "maximum": "50",
  18379. // "minimum": "0",
  18380. // "type": "integer"
  18381. // },
  18382. // "pageToken": {
  18383. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  18384. // "location": "query",
  18385. // "type": "string"
  18386. // },
  18387. // "part": {
  18388. // "description": "The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet.",
  18389. // "location": "query",
  18390. // "required": true,
  18391. // "type": "string"
  18392. // }
  18393. // },
  18394. // "path": "sponsors",
  18395. // "response": {
  18396. // "$ref": "SponsorListResponse"
  18397. // },
  18398. // "scopes": [
  18399. // "https://www.googleapis.com/auth/youtube",
  18400. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18401. // "https://www.googleapis.com/auth/youtube.readonly"
  18402. // ]
  18403. // }
  18404. }
  18405. // Pages invokes f for each page of results.
  18406. // A non-nil error returned from f will halt the iteration.
  18407. // The provided context supersedes any context provided to the Context method.
  18408. func (c *SponsorsListCall) Pages(ctx context.Context, f func(*SponsorListResponse) error) error {
  18409. c.ctx_ = ctx
  18410. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18411. for {
  18412. x, err := c.Do()
  18413. if err != nil {
  18414. return err
  18415. }
  18416. if err := f(x); err != nil {
  18417. return err
  18418. }
  18419. if x.NextPageToken == "" {
  18420. return nil
  18421. }
  18422. c.PageToken(x.NextPageToken)
  18423. }
  18424. }
  18425. // method id "youtube.subscriptions.delete":
  18426. type SubscriptionsDeleteCall struct {
  18427. s *Service
  18428. urlParams_ gensupport.URLParams
  18429. ctx_ context.Context
  18430. header_ http.Header
  18431. }
  18432. // Delete: Deletes a subscription.
  18433. func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
  18434. c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18435. c.urlParams_.Set("id", id)
  18436. return c
  18437. }
  18438. // Fields allows partial responses to be retrieved. See
  18439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18440. // for more information.
  18441. func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
  18442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18443. return c
  18444. }
  18445. // Context sets the context to be used in this call's Do method. Any
  18446. // pending HTTP request will be aborted if the provided context is
  18447. // canceled.
  18448. func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
  18449. c.ctx_ = ctx
  18450. return c
  18451. }
  18452. // Header returns an http.Header that can be modified by the caller to
  18453. // add HTTP headers to the request.
  18454. func (c *SubscriptionsDeleteCall) Header() http.Header {
  18455. if c.header_ == nil {
  18456. c.header_ = make(http.Header)
  18457. }
  18458. return c.header_
  18459. }
  18460. func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  18461. reqHeaders := make(http.Header)
  18462. for k, v := range c.header_ {
  18463. reqHeaders[k] = v
  18464. }
  18465. reqHeaders.Set("User-Agent", c.s.userAgent())
  18466. var body io.Reader = nil
  18467. c.urlParams_.Set("alt", alt)
  18468. c.urlParams_.Set("prettyPrint", "false")
  18469. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  18470. urls += "?" + c.urlParams_.Encode()
  18471. req, err := http.NewRequest("DELETE", urls, body)
  18472. if err != nil {
  18473. return nil, err
  18474. }
  18475. req.Header = reqHeaders
  18476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18477. }
  18478. // Do executes the "youtube.subscriptions.delete" call.
  18479. func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  18480. gensupport.SetOptions(c.urlParams_, opts...)
  18481. res, err := c.doRequest("json")
  18482. if err != nil {
  18483. return err
  18484. }
  18485. defer googleapi.CloseBody(res)
  18486. if err := googleapi.CheckResponse(res); err != nil {
  18487. return err
  18488. }
  18489. return nil
  18490. // {
  18491. // "description": "Deletes a subscription.",
  18492. // "httpMethod": "DELETE",
  18493. // "id": "youtube.subscriptions.delete",
  18494. // "parameterOrder": [
  18495. // "id"
  18496. // ],
  18497. // "parameters": {
  18498. // "id": {
  18499. // "description": "The id parameter specifies the YouTube subscription ID for the resource that is being deleted. In a subscription resource, the id property specifies the YouTube subscription ID.",
  18500. // "location": "query",
  18501. // "required": true,
  18502. // "type": "string"
  18503. // }
  18504. // },
  18505. // "path": "subscriptions",
  18506. // "scopes": [
  18507. // "https://www.googleapis.com/auth/youtube",
  18508. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18509. // "https://www.googleapis.com/auth/youtubepartner"
  18510. // ]
  18511. // }
  18512. }
  18513. // method id "youtube.subscriptions.insert":
  18514. type SubscriptionsInsertCall struct {
  18515. s *Service
  18516. subscription *Subscription
  18517. urlParams_ gensupport.URLParams
  18518. ctx_ context.Context
  18519. header_ http.Header
  18520. }
  18521. // Insert: Adds a subscription for the authenticated user's channel.
  18522. func (r *SubscriptionsService) Insert(part string, subscription *Subscription) *SubscriptionsInsertCall {
  18523. c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18524. c.urlParams_.Set("part", part)
  18525. c.subscription = subscription
  18526. return c
  18527. }
  18528. // Fields allows partial responses to be retrieved. See
  18529. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18530. // for more information.
  18531. func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
  18532. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18533. return c
  18534. }
  18535. // Context sets the context to be used in this call's Do method. Any
  18536. // pending HTTP request will be aborted if the provided context is
  18537. // canceled.
  18538. func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
  18539. c.ctx_ = ctx
  18540. return c
  18541. }
  18542. // Header returns an http.Header that can be modified by the caller to
  18543. // add HTTP headers to the request.
  18544. func (c *SubscriptionsInsertCall) Header() http.Header {
  18545. if c.header_ == nil {
  18546. c.header_ = make(http.Header)
  18547. }
  18548. return c.header_
  18549. }
  18550. func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  18551. reqHeaders := make(http.Header)
  18552. for k, v := range c.header_ {
  18553. reqHeaders[k] = v
  18554. }
  18555. reqHeaders.Set("User-Agent", c.s.userAgent())
  18556. var body io.Reader = nil
  18557. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  18558. if err != nil {
  18559. return nil, err
  18560. }
  18561. reqHeaders.Set("Content-Type", "application/json")
  18562. c.urlParams_.Set("alt", alt)
  18563. c.urlParams_.Set("prettyPrint", "false")
  18564. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  18565. urls += "?" + c.urlParams_.Encode()
  18566. req, err := http.NewRequest("POST", urls, body)
  18567. if err != nil {
  18568. return nil, err
  18569. }
  18570. req.Header = reqHeaders
  18571. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18572. }
  18573. // Do executes the "youtube.subscriptions.insert" call.
  18574. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  18575. // status code is an error. Response headers are in either
  18576. // *Subscription.ServerResponse.Header or (if a response was returned at
  18577. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18578. // to check whether the returned error was because
  18579. // http.StatusNotModified was returned.
  18580. func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  18581. gensupport.SetOptions(c.urlParams_, opts...)
  18582. res, err := c.doRequest("json")
  18583. if res != nil && res.StatusCode == http.StatusNotModified {
  18584. if res.Body != nil {
  18585. res.Body.Close()
  18586. }
  18587. return nil, &googleapi.Error{
  18588. Code: res.StatusCode,
  18589. Header: res.Header,
  18590. }
  18591. }
  18592. if err != nil {
  18593. return nil, err
  18594. }
  18595. defer googleapi.CloseBody(res)
  18596. if err := googleapi.CheckResponse(res); err != nil {
  18597. return nil, err
  18598. }
  18599. ret := &Subscription{
  18600. ServerResponse: googleapi.ServerResponse{
  18601. Header: res.Header,
  18602. HTTPStatusCode: res.StatusCode,
  18603. },
  18604. }
  18605. target := &ret
  18606. if err := gensupport.DecodeResponse(target, res); err != nil {
  18607. return nil, err
  18608. }
  18609. return ret, nil
  18610. // {
  18611. // "description": "Adds a subscription for the authenticated user's channel.",
  18612. // "httpMethod": "POST",
  18613. // "id": "youtube.subscriptions.insert",
  18614. // "parameterOrder": [
  18615. // "part"
  18616. // ],
  18617. // "parameters": {
  18618. // "part": {
  18619. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.",
  18620. // "location": "query",
  18621. // "required": true,
  18622. // "type": "string"
  18623. // }
  18624. // },
  18625. // "path": "subscriptions",
  18626. // "request": {
  18627. // "$ref": "Subscription"
  18628. // },
  18629. // "response": {
  18630. // "$ref": "Subscription"
  18631. // },
  18632. // "scopes": [
  18633. // "https://www.googleapis.com/auth/youtube",
  18634. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18635. // "https://www.googleapis.com/auth/youtubepartner"
  18636. // ]
  18637. // }
  18638. }
  18639. // method id "youtube.subscriptions.list":
  18640. type SubscriptionsListCall struct {
  18641. s *Service
  18642. urlParams_ gensupport.URLParams
  18643. ifNoneMatch_ string
  18644. ctx_ context.Context
  18645. header_ http.Header
  18646. }
  18647. // List: Returns subscription resources that match the API request
  18648. // criteria.
  18649. func (r *SubscriptionsService) List(part string) *SubscriptionsListCall {
  18650. c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18651. c.urlParams_.Set("part", part)
  18652. return c
  18653. }
  18654. // ChannelId sets the optional parameter "channelId": The channelId
  18655. // parameter specifies a YouTube channel ID. The API will only return
  18656. // that channel's subscriptions.
  18657. func (c *SubscriptionsListCall) ChannelId(channelId string) *SubscriptionsListCall {
  18658. c.urlParams_.Set("channelId", channelId)
  18659. return c
  18660. }
  18661. // ForChannelId sets the optional parameter "forChannelId": The
  18662. // forChannelId parameter specifies a comma-separated list of channel
  18663. // IDs. The API response will then only contain subscriptions matching
  18664. // those channels.
  18665. func (c *SubscriptionsListCall) ForChannelId(forChannelId string) *SubscriptionsListCall {
  18666. c.urlParams_.Set("forChannelId", forChannelId)
  18667. return c
  18668. }
  18669. // Id sets the optional parameter "id": The id parameter specifies a
  18670. // comma-separated list of the YouTube subscription ID(s) for the
  18671. // resource(s) that are being retrieved. In a subscription resource, the
  18672. // id property specifies the YouTube subscription ID.
  18673. func (c *SubscriptionsListCall) Id(id string) *SubscriptionsListCall {
  18674. c.urlParams_.Set("id", id)
  18675. return c
  18676. }
  18677. // MaxResults sets the optional parameter "maxResults": The maxResults
  18678. // parameter specifies the maximum number of items that should be
  18679. // returned in the result set.
  18680. func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall {
  18681. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18682. return c
  18683. }
  18684. // Mine sets the optional parameter "mine": Set this parameter's value
  18685. // to true to retrieve a feed of the authenticated user's subscriptions.
  18686. func (c *SubscriptionsListCall) Mine(mine bool) *SubscriptionsListCall {
  18687. c.urlParams_.Set("mine", fmt.Sprint(mine))
  18688. return c
  18689. }
  18690. // MyRecentSubscribers sets the optional parameter
  18691. // "myRecentSubscribers": Set this parameter's value to true to retrieve
  18692. // a feed of the subscribers of the authenticated user in reverse
  18693. // chronological order (newest first).
  18694. func (c *SubscriptionsListCall) MyRecentSubscribers(myRecentSubscribers bool) *SubscriptionsListCall {
  18695. c.urlParams_.Set("myRecentSubscribers", fmt.Sprint(myRecentSubscribers))
  18696. return c
  18697. }
  18698. // MySubscribers sets the optional parameter "mySubscribers": Set this
  18699. // parameter's value to true to retrieve a feed of the subscribers of
  18700. // the authenticated user in no particular order.
  18701. func (c *SubscriptionsListCall) MySubscribers(mySubscribers bool) *SubscriptionsListCall {
  18702. c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
  18703. return c
  18704. }
  18705. // OnBehalfOfContentOwner sets the optional parameter
  18706. // "onBehalfOfContentOwner": Note: This parameter is intended
  18707. // exclusively for YouTube content partners.
  18708. //
  18709. // The onBehalfOfContentOwner parameter indicates that the request's
  18710. // authorization credentials identify a YouTube CMS user who is acting
  18711. // on behalf of the content owner specified in the parameter value. This
  18712. // parameter is intended for YouTube content partners that own and
  18713. // manage many different YouTube channels. It allows content owners to
  18714. // authenticate once and get access to all their video and channel data,
  18715. // without having to provide authentication credentials for each
  18716. // individual channel. The CMS account that the user authenticates with
  18717. // must be linked to the specified YouTube content owner.
  18718. func (c *SubscriptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SubscriptionsListCall {
  18719. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18720. return c
  18721. }
  18722. // OnBehalfOfContentOwnerChannel sets the optional parameter
  18723. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  18724. // properly authorized request. Note: This parameter is intended
  18725. // exclusively for YouTube content partners.
  18726. //
  18727. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  18728. // channel ID of the channel to which a video is being added. This
  18729. // parameter is required when a request specifies a value for the
  18730. // onBehalfOfContentOwner parameter, and it can only be used in
  18731. // conjunction with that parameter. In addition, the request must be
  18732. // authorized using a CMS account that is linked to the content owner
  18733. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  18734. // channel that the onBehalfOfContentOwnerChannel parameter value
  18735. // specifies must be linked to the content owner that the
  18736. // onBehalfOfContentOwner parameter specifies.
  18737. //
  18738. // This parameter is intended for YouTube content partners that own and
  18739. // manage many different YouTube channels. It allows content owners to
  18740. // authenticate once and perform actions on behalf of the channel
  18741. // specified in the parameter value, without having to provide
  18742. // authentication credentials for each separate channel.
  18743. func (c *SubscriptionsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *SubscriptionsListCall {
  18744. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  18745. return c
  18746. }
  18747. // Order sets the optional parameter "order": The order parameter
  18748. // specifies the method that will be used to sort resources in the API
  18749. // response.
  18750. //
  18751. // Possible values:
  18752. // "alphabetical" - Sort alphabetically.
  18753. // "relevance" - Sort by relevance.
  18754. // "unread" - Sort by order of activity.
  18755. func (c *SubscriptionsListCall) Order(order string) *SubscriptionsListCall {
  18756. c.urlParams_.Set("order", order)
  18757. return c
  18758. }
  18759. // PageToken sets the optional parameter "pageToken": The pageToken
  18760. // parameter identifies a specific page in the result set that should be
  18761. // returned. In an API response, the nextPageToken and prevPageToken
  18762. // properties identify other pages that could be retrieved.
  18763. func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall {
  18764. c.urlParams_.Set("pageToken", pageToken)
  18765. return c
  18766. }
  18767. // Fields allows partial responses to be retrieved. See
  18768. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18769. // for more information.
  18770. func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
  18771. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18772. return c
  18773. }
  18774. // IfNoneMatch sets the optional parameter which makes the operation
  18775. // fail if the object's ETag matches the given value. This is useful for
  18776. // getting updates only after the object has changed since the last
  18777. // request. Use googleapi.IsNotModified to check whether the response
  18778. // error from Do is the result of In-None-Match.
  18779. func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
  18780. c.ifNoneMatch_ = entityTag
  18781. return c
  18782. }
  18783. // Context sets the context to be used in this call's Do method. Any
  18784. // pending HTTP request will be aborted if the provided context is
  18785. // canceled.
  18786. func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
  18787. c.ctx_ = ctx
  18788. return c
  18789. }
  18790. // Header returns an http.Header that can be modified by the caller to
  18791. // add HTTP headers to the request.
  18792. func (c *SubscriptionsListCall) Header() http.Header {
  18793. if c.header_ == nil {
  18794. c.header_ = make(http.Header)
  18795. }
  18796. return c.header_
  18797. }
  18798. func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  18799. reqHeaders := make(http.Header)
  18800. for k, v := range c.header_ {
  18801. reqHeaders[k] = v
  18802. }
  18803. reqHeaders.Set("User-Agent", c.s.userAgent())
  18804. if c.ifNoneMatch_ != "" {
  18805. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18806. }
  18807. var body io.Reader = nil
  18808. c.urlParams_.Set("alt", alt)
  18809. c.urlParams_.Set("prettyPrint", "false")
  18810. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  18811. urls += "?" + c.urlParams_.Encode()
  18812. req, err := http.NewRequest("GET", urls, body)
  18813. if err != nil {
  18814. return nil, err
  18815. }
  18816. req.Header = reqHeaders
  18817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18818. }
  18819. // Do executes the "youtube.subscriptions.list" call.
  18820. // Exactly one of *SubscriptionListResponse or error will be non-nil.
  18821. // Any non-2xx status code is an error. Response headers are in either
  18822. // *SubscriptionListResponse.ServerResponse.Header or (if a response was
  18823. // returned at all) in error.(*googleapi.Error).Header. Use
  18824. // googleapi.IsNotModified to check whether the returned error was
  18825. // because http.StatusNotModified was returned.
  18826. func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*SubscriptionListResponse, error) {
  18827. gensupport.SetOptions(c.urlParams_, opts...)
  18828. res, err := c.doRequest("json")
  18829. if res != nil && res.StatusCode == http.StatusNotModified {
  18830. if res.Body != nil {
  18831. res.Body.Close()
  18832. }
  18833. return nil, &googleapi.Error{
  18834. Code: res.StatusCode,
  18835. Header: res.Header,
  18836. }
  18837. }
  18838. if err != nil {
  18839. return nil, err
  18840. }
  18841. defer googleapi.CloseBody(res)
  18842. if err := googleapi.CheckResponse(res); err != nil {
  18843. return nil, err
  18844. }
  18845. ret := &SubscriptionListResponse{
  18846. ServerResponse: googleapi.ServerResponse{
  18847. Header: res.Header,
  18848. HTTPStatusCode: res.StatusCode,
  18849. },
  18850. }
  18851. target := &ret
  18852. if err := gensupport.DecodeResponse(target, res); err != nil {
  18853. return nil, err
  18854. }
  18855. return ret, nil
  18856. // {
  18857. // "description": "Returns subscription resources that match the API request criteria.",
  18858. // "httpMethod": "GET",
  18859. // "id": "youtube.subscriptions.list",
  18860. // "parameterOrder": [
  18861. // "part"
  18862. // ],
  18863. // "parameters": {
  18864. // "channelId": {
  18865. // "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.",
  18866. // "location": "query",
  18867. // "type": "string"
  18868. // },
  18869. // "forChannelId": {
  18870. // "description": "The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.",
  18871. // "location": "query",
  18872. // "type": "string"
  18873. // },
  18874. // "id": {
  18875. // "description": "The id parameter specifies a comma-separated list of the YouTube subscription ID(s) for the resource(s) that are being retrieved. In a subscription resource, the id property specifies the YouTube subscription ID.",
  18876. // "location": "query",
  18877. // "type": "string"
  18878. // },
  18879. // "maxResults": {
  18880. // "default": "5",
  18881. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  18882. // "format": "uint32",
  18883. // "location": "query",
  18884. // "maximum": "50",
  18885. // "minimum": "0",
  18886. // "type": "integer"
  18887. // },
  18888. // "mine": {
  18889. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.",
  18890. // "location": "query",
  18891. // "type": "boolean"
  18892. // },
  18893. // "myRecentSubscribers": {
  18894. // "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in reverse chronological order (newest first).",
  18895. // "location": "query",
  18896. // "type": "boolean"
  18897. // },
  18898. // "mySubscribers": {
  18899. // "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in no particular order.",
  18900. // "location": "query",
  18901. // "type": "boolean"
  18902. // },
  18903. // "onBehalfOfContentOwner": {
  18904. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  18905. // "location": "query",
  18906. // "type": "string"
  18907. // },
  18908. // "onBehalfOfContentOwnerChannel": {
  18909. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  18910. // "location": "query",
  18911. // "type": "string"
  18912. // },
  18913. // "order": {
  18914. // "default": "SUBSCRIPTION_ORDER_RELEVANCE",
  18915. // "description": "The order parameter specifies the method that will be used to sort resources in the API response.",
  18916. // "enum": [
  18917. // "alphabetical",
  18918. // "relevance",
  18919. // "unread"
  18920. // ],
  18921. // "enumDescriptions": [
  18922. // "Sort alphabetically.",
  18923. // "Sort by relevance.",
  18924. // "Sort by order of activity."
  18925. // ],
  18926. // "location": "query",
  18927. // "type": "string"
  18928. // },
  18929. // "pageToken": {
  18930. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  18931. // "location": "query",
  18932. // "type": "string"
  18933. // },
  18934. // "part": {
  18935. // "description": "The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a subscription resource, the snippet property contains other properties, such as a display title for the subscription. If you set part=snippet, the API response will also contain all of those nested properties.",
  18936. // "location": "query",
  18937. // "required": true,
  18938. // "type": "string"
  18939. // }
  18940. // },
  18941. // "path": "subscriptions",
  18942. // "response": {
  18943. // "$ref": "SubscriptionListResponse"
  18944. // },
  18945. // "scopes": [
  18946. // "https://www.googleapis.com/auth/youtube",
  18947. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18948. // "https://www.googleapis.com/auth/youtube.readonly",
  18949. // "https://www.googleapis.com/auth/youtubepartner"
  18950. // ]
  18951. // }
  18952. }
  18953. // Pages invokes f for each page of results.
  18954. // A non-nil error returned from f will halt the iteration.
  18955. // The provided context supersedes any context provided to the Context method.
  18956. func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*SubscriptionListResponse) error) error {
  18957. c.ctx_ = ctx
  18958. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18959. for {
  18960. x, err := c.Do()
  18961. if err != nil {
  18962. return err
  18963. }
  18964. if err := f(x); err != nil {
  18965. return err
  18966. }
  18967. if x.NextPageToken == "" {
  18968. return nil
  18969. }
  18970. c.PageToken(x.NextPageToken)
  18971. }
  18972. }
  18973. // method id "youtube.superChatEvents.list":
  18974. type SuperChatEventsListCall struct {
  18975. s *Service
  18976. urlParams_ gensupport.URLParams
  18977. ifNoneMatch_ string
  18978. ctx_ context.Context
  18979. header_ http.Header
  18980. }
  18981. // List: Lists Super Chat events for a channel.
  18982. func (r *SuperChatEventsService) List(part string) *SuperChatEventsListCall {
  18983. c := &SuperChatEventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18984. c.urlParams_.Set("part", part)
  18985. return c
  18986. }
  18987. // Hl sets the optional parameter "hl": The hl parameter instructs the
  18988. // API to retrieve localized resource metadata for a specific
  18989. // application language that the YouTube website supports. The parameter
  18990. // value must be a language code included in the list returned by the
  18991. // i18nLanguages.list method.
  18992. //
  18993. // If localized resource details are available in that language, the
  18994. // resource's snippet.localized object will contain the localized
  18995. // values. However, if localized details are not available, the
  18996. // snippet.localized object will contain resource details in the
  18997. // resource's default language.
  18998. func (c *SuperChatEventsListCall) Hl(hl string) *SuperChatEventsListCall {
  18999. c.urlParams_.Set("hl", hl)
  19000. return c
  19001. }
  19002. // MaxResults sets the optional parameter "maxResults": The maxResults
  19003. // parameter specifies the maximum number of items that should be
  19004. // returned in the result set.
  19005. func (c *SuperChatEventsListCall) MaxResults(maxResults int64) *SuperChatEventsListCall {
  19006. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19007. return c
  19008. }
  19009. // PageToken sets the optional parameter "pageToken": The pageToken
  19010. // parameter identifies a specific page in the result set that should be
  19011. // returned. In an API response, the nextPageToken and prevPageToken
  19012. // properties identify other pages that could be retrieved.
  19013. func (c *SuperChatEventsListCall) PageToken(pageToken string) *SuperChatEventsListCall {
  19014. c.urlParams_.Set("pageToken", pageToken)
  19015. return c
  19016. }
  19017. // Fields allows partial responses to be retrieved. See
  19018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19019. // for more information.
  19020. func (c *SuperChatEventsListCall) Fields(s ...googleapi.Field) *SuperChatEventsListCall {
  19021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19022. return c
  19023. }
  19024. // IfNoneMatch sets the optional parameter which makes the operation
  19025. // fail if the object's ETag matches the given value. This is useful for
  19026. // getting updates only after the object has changed since the last
  19027. // request. Use googleapi.IsNotModified to check whether the response
  19028. // error from Do is the result of In-None-Match.
  19029. func (c *SuperChatEventsListCall) IfNoneMatch(entityTag string) *SuperChatEventsListCall {
  19030. c.ifNoneMatch_ = entityTag
  19031. return c
  19032. }
  19033. // Context sets the context to be used in this call's Do method. Any
  19034. // pending HTTP request will be aborted if the provided context is
  19035. // canceled.
  19036. func (c *SuperChatEventsListCall) Context(ctx context.Context) *SuperChatEventsListCall {
  19037. c.ctx_ = ctx
  19038. return c
  19039. }
  19040. // Header returns an http.Header that can be modified by the caller to
  19041. // add HTTP headers to the request.
  19042. func (c *SuperChatEventsListCall) Header() http.Header {
  19043. if c.header_ == nil {
  19044. c.header_ = make(http.Header)
  19045. }
  19046. return c.header_
  19047. }
  19048. func (c *SuperChatEventsListCall) doRequest(alt string) (*http.Response, error) {
  19049. reqHeaders := make(http.Header)
  19050. for k, v := range c.header_ {
  19051. reqHeaders[k] = v
  19052. }
  19053. reqHeaders.Set("User-Agent", c.s.userAgent())
  19054. if c.ifNoneMatch_ != "" {
  19055. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19056. }
  19057. var body io.Reader = nil
  19058. c.urlParams_.Set("alt", alt)
  19059. c.urlParams_.Set("prettyPrint", "false")
  19060. urls := googleapi.ResolveRelative(c.s.BasePath, "superChatEvents")
  19061. urls += "?" + c.urlParams_.Encode()
  19062. req, err := http.NewRequest("GET", urls, body)
  19063. if err != nil {
  19064. return nil, err
  19065. }
  19066. req.Header = reqHeaders
  19067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19068. }
  19069. // Do executes the "youtube.superChatEvents.list" call.
  19070. // Exactly one of *SuperChatEventListResponse or error will be non-nil.
  19071. // Any non-2xx status code is an error. Response headers are in either
  19072. // *SuperChatEventListResponse.ServerResponse.Header or (if a response
  19073. // was returned at all) in error.(*googleapi.Error).Header. Use
  19074. // googleapi.IsNotModified to check whether the returned error was
  19075. // because http.StatusNotModified was returned.
  19076. func (c *SuperChatEventsListCall) Do(opts ...googleapi.CallOption) (*SuperChatEventListResponse, error) {
  19077. gensupport.SetOptions(c.urlParams_, opts...)
  19078. res, err := c.doRequest("json")
  19079. if res != nil && res.StatusCode == http.StatusNotModified {
  19080. if res.Body != nil {
  19081. res.Body.Close()
  19082. }
  19083. return nil, &googleapi.Error{
  19084. Code: res.StatusCode,
  19085. Header: res.Header,
  19086. }
  19087. }
  19088. if err != nil {
  19089. return nil, err
  19090. }
  19091. defer googleapi.CloseBody(res)
  19092. if err := googleapi.CheckResponse(res); err != nil {
  19093. return nil, err
  19094. }
  19095. ret := &SuperChatEventListResponse{
  19096. ServerResponse: googleapi.ServerResponse{
  19097. Header: res.Header,
  19098. HTTPStatusCode: res.StatusCode,
  19099. },
  19100. }
  19101. target := &ret
  19102. if err := gensupport.DecodeResponse(target, res); err != nil {
  19103. return nil, err
  19104. }
  19105. return ret, nil
  19106. // {
  19107. // "description": "Lists Super Chat events for a channel.",
  19108. // "httpMethod": "GET",
  19109. // "id": "youtube.superChatEvents.list",
  19110. // "parameterOrder": [
  19111. // "part"
  19112. // ],
  19113. // "parameters": {
  19114. // "hl": {
  19115. // "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.",
  19116. // "location": "query",
  19117. // "type": "string"
  19118. // },
  19119. // "maxResults": {
  19120. // "default": "5",
  19121. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  19122. // "format": "uint32",
  19123. // "location": "query",
  19124. // "maximum": "50",
  19125. // "minimum": "1",
  19126. // "type": "integer"
  19127. // },
  19128. // "pageToken": {
  19129. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.",
  19130. // "location": "query",
  19131. // "type": "string"
  19132. // },
  19133. // "part": {
  19134. // "description": "The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet.",
  19135. // "location": "query",
  19136. // "required": true,
  19137. // "type": "string"
  19138. // }
  19139. // },
  19140. // "path": "superChatEvents",
  19141. // "response": {
  19142. // "$ref": "SuperChatEventListResponse"
  19143. // },
  19144. // "scopes": [
  19145. // "https://www.googleapis.com/auth/youtube",
  19146. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19147. // "https://www.googleapis.com/auth/youtube.readonly"
  19148. // ]
  19149. // }
  19150. }
  19151. // Pages invokes f for each page of results.
  19152. // A non-nil error returned from f will halt the iteration.
  19153. // The provided context supersedes any context provided to the Context method.
  19154. func (c *SuperChatEventsListCall) Pages(ctx context.Context, f func(*SuperChatEventListResponse) error) error {
  19155. c.ctx_ = ctx
  19156. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19157. for {
  19158. x, err := c.Do()
  19159. if err != nil {
  19160. return err
  19161. }
  19162. if err := f(x); err != nil {
  19163. return err
  19164. }
  19165. if x.NextPageToken == "" {
  19166. return nil
  19167. }
  19168. c.PageToken(x.NextPageToken)
  19169. }
  19170. }
  19171. // method id "youtube.thumbnails.set":
  19172. type ThumbnailsSetCall struct {
  19173. s *Service
  19174. urlParams_ gensupport.URLParams
  19175. mediaInfo_ *gensupport.MediaInfo
  19176. ctx_ context.Context
  19177. header_ http.Header
  19178. }
  19179. // Set: Uploads a custom video thumbnail to YouTube and sets it for a
  19180. // video.
  19181. func (r *ThumbnailsService) Set(videoId string) *ThumbnailsSetCall {
  19182. c := &ThumbnailsSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19183. c.urlParams_.Set("videoId", videoId)
  19184. return c
  19185. }
  19186. // OnBehalfOfContentOwner sets the optional parameter
  19187. // "onBehalfOfContentOwner": Note: This parameter is intended
  19188. // exclusively for YouTube content partners.
  19189. //
  19190. // The onBehalfOfContentOwner parameter indicates that the request's
  19191. // authorization credentials identify a YouTube CMS user who is acting
  19192. // on behalf of the content owner specified in the parameter value. This
  19193. // parameter is intended for YouTube content partners that own and
  19194. // manage many different YouTube channels. It allows content owners to
  19195. // authenticate once and get access to all their video and channel data,
  19196. // without having to provide authentication credentials for each
  19197. // individual channel. The actual CMS account that the user
  19198. // authenticates with must be linked to the specified YouTube content
  19199. // owner.
  19200. func (c *ThumbnailsSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ThumbnailsSetCall {
  19201. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19202. return c
  19203. }
  19204. // Media specifies the media to upload in one or more chunks. The chunk
  19205. // size may be controlled by supplying a MediaOption generated by
  19206. // googleapi.ChunkSize. The chunk size defaults to
  19207. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  19208. // upload request will be determined by sniffing the contents of r,
  19209. // unless a MediaOption generated by googleapi.ContentType is
  19210. // supplied.
  19211. // At most one of Media and ResumableMedia may be set.
  19212. func (c *ThumbnailsSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *ThumbnailsSetCall {
  19213. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  19214. return c
  19215. }
  19216. // ResumableMedia specifies the media to upload in chunks and can be
  19217. // canceled with ctx.
  19218. //
  19219. // Deprecated: use Media instead.
  19220. //
  19221. // At most one of Media and ResumableMedia may be set. mediaType
  19222. // identifies the MIME media type of the upload, such as "image/png". If
  19223. // mediaType is "", it will be auto-detected. The provided ctx will
  19224. // supersede any context previously provided to the Context method.
  19225. func (c *ThumbnailsSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ThumbnailsSetCall {
  19226. c.ctx_ = ctx
  19227. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  19228. return c
  19229. }
  19230. // ProgressUpdater provides a callback function that will be called
  19231. // after every chunk. It should be a low-latency function in order to
  19232. // not slow down the upload operation. This should only be called when
  19233. // using ResumableMedia (as opposed to Media).
  19234. func (c *ThumbnailsSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ThumbnailsSetCall {
  19235. c.mediaInfo_.SetProgressUpdater(pu)
  19236. return c
  19237. }
  19238. // Fields allows partial responses to be retrieved. See
  19239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19240. // for more information.
  19241. func (c *ThumbnailsSetCall) Fields(s ...googleapi.Field) *ThumbnailsSetCall {
  19242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19243. return c
  19244. }
  19245. // Context sets the context to be used in this call's Do method. Any
  19246. // pending HTTP request will be aborted if the provided context is
  19247. // canceled.
  19248. // This context will supersede any context previously provided to the
  19249. // ResumableMedia method.
  19250. func (c *ThumbnailsSetCall) Context(ctx context.Context) *ThumbnailsSetCall {
  19251. c.ctx_ = ctx
  19252. return c
  19253. }
  19254. // Header returns an http.Header that can be modified by the caller to
  19255. // add HTTP headers to the request.
  19256. func (c *ThumbnailsSetCall) Header() http.Header {
  19257. if c.header_ == nil {
  19258. c.header_ = make(http.Header)
  19259. }
  19260. return c.header_
  19261. }
  19262. func (c *ThumbnailsSetCall) doRequest(alt string) (*http.Response, error) {
  19263. reqHeaders := make(http.Header)
  19264. for k, v := range c.header_ {
  19265. reqHeaders[k] = v
  19266. }
  19267. reqHeaders.Set("User-Agent", c.s.userAgent())
  19268. var body io.Reader = nil
  19269. c.urlParams_.Set("alt", alt)
  19270. c.urlParams_.Set("prettyPrint", "false")
  19271. urls := googleapi.ResolveRelative(c.s.BasePath, "thumbnails/set")
  19272. if c.mediaInfo_ != nil {
  19273. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  19274. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  19275. }
  19276. if body == nil {
  19277. body = new(bytes.Buffer)
  19278. reqHeaders.Set("Content-Type", "application/json")
  19279. }
  19280. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  19281. defer cleanup()
  19282. urls += "?" + c.urlParams_.Encode()
  19283. req, err := http.NewRequest("POST", urls, body)
  19284. if err != nil {
  19285. return nil, err
  19286. }
  19287. req.Header = reqHeaders
  19288. req.GetBody = getBody
  19289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19290. }
  19291. // Do executes the "youtube.thumbnails.set" call.
  19292. // Exactly one of *ThumbnailSetResponse or error will be non-nil. Any
  19293. // non-2xx status code is an error. Response headers are in either
  19294. // *ThumbnailSetResponse.ServerResponse.Header or (if a response was
  19295. // returned at all) in error.(*googleapi.Error).Header. Use
  19296. // googleapi.IsNotModified to check whether the returned error was
  19297. // because http.StatusNotModified was returned.
  19298. func (c *ThumbnailsSetCall) Do(opts ...googleapi.CallOption) (*ThumbnailSetResponse, error) {
  19299. gensupport.SetOptions(c.urlParams_, opts...)
  19300. res, err := c.doRequest("json")
  19301. if res != nil && res.StatusCode == http.StatusNotModified {
  19302. if res.Body != nil {
  19303. res.Body.Close()
  19304. }
  19305. return nil, &googleapi.Error{
  19306. Code: res.StatusCode,
  19307. Header: res.Header,
  19308. }
  19309. }
  19310. if err != nil {
  19311. return nil, err
  19312. }
  19313. defer googleapi.CloseBody(res)
  19314. if err := googleapi.CheckResponse(res); err != nil {
  19315. return nil, err
  19316. }
  19317. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  19318. if rx != nil {
  19319. rx.Client = c.s.client
  19320. rx.UserAgent = c.s.userAgent()
  19321. ctx := c.ctx_
  19322. if ctx == nil {
  19323. ctx = context.TODO()
  19324. }
  19325. res, err = rx.Upload(ctx)
  19326. if err != nil {
  19327. return nil, err
  19328. }
  19329. defer res.Body.Close()
  19330. if err := googleapi.CheckResponse(res); err != nil {
  19331. return nil, err
  19332. }
  19333. }
  19334. ret := &ThumbnailSetResponse{
  19335. ServerResponse: googleapi.ServerResponse{
  19336. Header: res.Header,
  19337. HTTPStatusCode: res.StatusCode,
  19338. },
  19339. }
  19340. target := &ret
  19341. if err := gensupport.DecodeResponse(target, res); err != nil {
  19342. return nil, err
  19343. }
  19344. return ret, nil
  19345. // {
  19346. // "description": "Uploads a custom video thumbnail to YouTube and sets it for a video.",
  19347. // "httpMethod": "POST",
  19348. // "id": "youtube.thumbnails.set",
  19349. // "mediaUpload": {
  19350. // "accept": [
  19351. // "application/octet-stream",
  19352. // "image/jpeg",
  19353. // "image/png"
  19354. // ],
  19355. // "maxSize": "2MB",
  19356. // "protocols": {
  19357. // "resumable": {
  19358. // "multipart": true,
  19359. // "path": "/resumable/upload/youtube/v3/thumbnails/set"
  19360. // },
  19361. // "simple": {
  19362. // "multipart": true,
  19363. // "path": "/upload/youtube/v3/thumbnails/set"
  19364. // }
  19365. // }
  19366. // },
  19367. // "parameterOrder": [
  19368. // "videoId"
  19369. // ],
  19370. // "parameters": {
  19371. // "onBehalfOfContentOwner": {
  19372. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  19373. // "location": "query",
  19374. // "type": "string"
  19375. // },
  19376. // "videoId": {
  19377. // "description": "The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.",
  19378. // "location": "query",
  19379. // "required": true,
  19380. // "type": "string"
  19381. // }
  19382. // },
  19383. // "path": "thumbnails/set",
  19384. // "response": {
  19385. // "$ref": "ThumbnailSetResponse"
  19386. // },
  19387. // "scopes": [
  19388. // "https://www.googleapis.com/auth/youtube",
  19389. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19390. // "https://www.googleapis.com/auth/youtube.upload",
  19391. // "https://www.googleapis.com/auth/youtubepartner"
  19392. // ],
  19393. // "supportsMediaUpload": true
  19394. // }
  19395. }
  19396. // method id "youtube.videoAbuseReportReasons.list":
  19397. type VideoAbuseReportReasonsListCall struct {
  19398. s *Service
  19399. urlParams_ gensupport.URLParams
  19400. ifNoneMatch_ string
  19401. ctx_ context.Context
  19402. header_ http.Header
  19403. }
  19404. // List: Returns a list of abuse reasons that can be used for reporting
  19405. // abusive videos.
  19406. func (r *VideoAbuseReportReasonsService) List(part string) *VideoAbuseReportReasonsListCall {
  19407. c := &VideoAbuseReportReasonsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19408. c.urlParams_.Set("part", part)
  19409. return c
  19410. }
  19411. // Hl sets the optional parameter "hl": The hl parameter specifies the
  19412. // language that should be used for text values in the API response.
  19413. func (c *VideoAbuseReportReasonsListCall) Hl(hl string) *VideoAbuseReportReasonsListCall {
  19414. c.urlParams_.Set("hl", hl)
  19415. return c
  19416. }
  19417. // Fields allows partial responses to be retrieved. See
  19418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19419. // for more information.
  19420. func (c *VideoAbuseReportReasonsListCall) Fields(s ...googleapi.Field) *VideoAbuseReportReasonsListCall {
  19421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19422. return c
  19423. }
  19424. // IfNoneMatch sets the optional parameter which makes the operation
  19425. // fail if the object's ETag matches the given value. This is useful for
  19426. // getting updates only after the object has changed since the last
  19427. // request. Use googleapi.IsNotModified to check whether the response
  19428. // error from Do is the result of In-None-Match.
  19429. func (c *VideoAbuseReportReasonsListCall) IfNoneMatch(entityTag string) *VideoAbuseReportReasonsListCall {
  19430. c.ifNoneMatch_ = entityTag
  19431. return c
  19432. }
  19433. // Context sets the context to be used in this call's Do method. Any
  19434. // pending HTTP request will be aborted if the provided context is
  19435. // canceled.
  19436. func (c *VideoAbuseReportReasonsListCall) Context(ctx context.Context) *VideoAbuseReportReasonsListCall {
  19437. c.ctx_ = ctx
  19438. return c
  19439. }
  19440. // Header returns an http.Header that can be modified by the caller to
  19441. // add HTTP headers to the request.
  19442. func (c *VideoAbuseReportReasonsListCall) Header() http.Header {
  19443. if c.header_ == nil {
  19444. c.header_ = make(http.Header)
  19445. }
  19446. return c.header_
  19447. }
  19448. func (c *VideoAbuseReportReasonsListCall) doRequest(alt string) (*http.Response, error) {
  19449. reqHeaders := make(http.Header)
  19450. for k, v := range c.header_ {
  19451. reqHeaders[k] = v
  19452. }
  19453. reqHeaders.Set("User-Agent", c.s.userAgent())
  19454. if c.ifNoneMatch_ != "" {
  19455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19456. }
  19457. var body io.Reader = nil
  19458. c.urlParams_.Set("alt", alt)
  19459. c.urlParams_.Set("prettyPrint", "false")
  19460. urls := googleapi.ResolveRelative(c.s.BasePath, "videoAbuseReportReasons")
  19461. urls += "?" + c.urlParams_.Encode()
  19462. req, err := http.NewRequest("GET", urls, body)
  19463. if err != nil {
  19464. return nil, err
  19465. }
  19466. req.Header = reqHeaders
  19467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19468. }
  19469. // Do executes the "youtube.videoAbuseReportReasons.list" call.
  19470. // Exactly one of *VideoAbuseReportReasonListResponse or error will be
  19471. // non-nil. Any non-2xx status code is an error. Response headers are in
  19472. // either *VideoAbuseReportReasonListResponse.ServerResponse.Header or
  19473. // (if a response was returned at all) in
  19474. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  19475. // whether the returned error was because http.StatusNotModified was
  19476. // returned.
  19477. func (c *VideoAbuseReportReasonsListCall) Do(opts ...googleapi.CallOption) (*VideoAbuseReportReasonListResponse, error) {
  19478. gensupport.SetOptions(c.urlParams_, opts...)
  19479. res, err := c.doRequest("json")
  19480. if res != nil && res.StatusCode == http.StatusNotModified {
  19481. if res.Body != nil {
  19482. res.Body.Close()
  19483. }
  19484. return nil, &googleapi.Error{
  19485. Code: res.StatusCode,
  19486. Header: res.Header,
  19487. }
  19488. }
  19489. if err != nil {
  19490. return nil, err
  19491. }
  19492. defer googleapi.CloseBody(res)
  19493. if err := googleapi.CheckResponse(res); err != nil {
  19494. return nil, err
  19495. }
  19496. ret := &VideoAbuseReportReasonListResponse{
  19497. ServerResponse: googleapi.ServerResponse{
  19498. Header: res.Header,
  19499. HTTPStatusCode: res.StatusCode,
  19500. },
  19501. }
  19502. target := &ret
  19503. if err := gensupport.DecodeResponse(target, res); err != nil {
  19504. return nil, err
  19505. }
  19506. return ret, nil
  19507. // {
  19508. // "description": "Returns a list of abuse reasons that can be used for reporting abusive videos.",
  19509. // "httpMethod": "GET",
  19510. // "id": "youtube.videoAbuseReportReasons.list",
  19511. // "parameterOrder": [
  19512. // "part"
  19513. // ],
  19514. // "parameters": {
  19515. // "hl": {
  19516. // "default": "en_US",
  19517. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  19518. // "location": "query",
  19519. // "type": "string"
  19520. // },
  19521. // "part": {
  19522. // "description": "The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.",
  19523. // "location": "query",
  19524. // "required": true,
  19525. // "type": "string"
  19526. // }
  19527. // },
  19528. // "path": "videoAbuseReportReasons",
  19529. // "response": {
  19530. // "$ref": "VideoAbuseReportReasonListResponse"
  19531. // },
  19532. // "scopes": [
  19533. // "https://www.googleapis.com/auth/youtube",
  19534. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19535. // "https://www.googleapis.com/auth/youtube.readonly"
  19536. // ]
  19537. // }
  19538. }
  19539. // method id "youtube.videoCategories.list":
  19540. type VideoCategoriesListCall struct {
  19541. s *Service
  19542. urlParams_ gensupport.URLParams
  19543. ifNoneMatch_ string
  19544. ctx_ context.Context
  19545. header_ http.Header
  19546. }
  19547. // List: Returns a list of categories that can be associated with
  19548. // YouTube videos.
  19549. func (r *VideoCategoriesService) List(part string) *VideoCategoriesListCall {
  19550. c := &VideoCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19551. c.urlParams_.Set("part", part)
  19552. return c
  19553. }
  19554. // Hl sets the optional parameter "hl": The hl parameter specifies the
  19555. // language that should be used for text values in the API response.
  19556. func (c *VideoCategoriesListCall) Hl(hl string) *VideoCategoriesListCall {
  19557. c.urlParams_.Set("hl", hl)
  19558. return c
  19559. }
  19560. // Id sets the optional parameter "id": The id parameter specifies a
  19561. // comma-separated list of video category IDs for the resources that you
  19562. // are retrieving.
  19563. func (c *VideoCategoriesListCall) Id(id string) *VideoCategoriesListCall {
  19564. c.urlParams_.Set("id", id)
  19565. return c
  19566. }
  19567. // RegionCode sets the optional parameter "regionCode": The regionCode
  19568. // parameter instructs the API to return the list of video categories
  19569. // available in the specified country. The parameter value is an ISO
  19570. // 3166-1 alpha-2 country code.
  19571. func (c *VideoCategoriesListCall) RegionCode(regionCode string) *VideoCategoriesListCall {
  19572. c.urlParams_.Set("regionCode", regionCode)
  19573. return c
  19574. }
  19575. // Fields allows partial responses to be retrieved. See
  19576. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19577. // for more information.
  19578. func (c *VideoCategoriesListCall) Fields(s ...googleapi.Field) *VideoCategoriesListCall {
  19579. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19580. return c
  19581. }
  19582. // IfNoneMatch sets the optional parameter which makes the operation
  19583. // fail if the object's ETag matches the given value. This is useful for
  19584. // getting updates only after the object has changed since the last
  19585. // request. Use googleapi.IsNotModified to check whether the response
  19586. // error from Do is the result of In-None-Match.
  19587. func (c *VideoCategoriesListCall) IfNoneMatch(entityTag string) *VideoCategoriesListCall {
  19588. c.ifNoneMatch_ = entityTag
  19589. return c
  19590. }
  19591. // Context sets the context to be used in this call's Do method. Any
  19592. // pending HTTP request will be aborted if the provided context is
  19593. // canceled.
  19594. func (c *VideoCategoriesListCall) Context(ctx context.Context) *VideoCategoriesListCall {
  19595. c.ctx_ = ctx
  19596. return c
  19597. }
  19598. // Header returns an http.Header that can be modified by the caller to
  19599. // add HTTP headers to the request.
  19600. func (c *VideoCategoriesListCall) Header() http.Header {
  19601. if c.header_ == nil {
  19602. c.header_ = make(http.Header)
  19603. }
  19604. return c.header_
  19605. }
  19606. func (c *VideoCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  19607. reqHeaders := make(http.Header)
  19608. for k, v := range c.header_ {
  19609. reqHeaders[k] = v
  19610. }
  19611. reqHeaders.Set("User-Agent", c.s.userAgent())
  19612. if c.ifNoneMatch_ != "" {
  19613. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19614. }
  19615. var body io.Reader = nil
  19616. c.urlParams_.Set("alt", alt)
  19617. c.urlParams_.Set("prettyPrint", "false")
  19618. urls := googleapi.ResolveRelative(c.s.BasePath, "videoCategories")
  19619. urls += "?" + c.urlParams_.Encode()
  19620. req, err := http.NewRequest("GET", urls, body)
  19621. if err != nil {
  19622. return nil, err
  19623. }
  19624. req.Header = reqHeaders
  19625. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19626. }
  19627. // Do executes the "youtube.videoCategories.list" call.
  19628. // Exactly one of *VideoCategoryListResponse or error will be non-nil.
  19629. // Any non-2xx status code is an error. Response headers are in either
  19630. // *VideoCategoryListResponse.ServerResponse.Header or (if a response
  19631. // was returned at all) in error.(*googleapi.Error).Header. Use
  19632. // googleapi.IsNotModified to check whether the returned error was
  19633. // because http.StatusNotModified was returned.
  19634. func (c *VideoCategoriesListCall) Do(opts ...googleapi.CallOption) (*VideoCategoryListResponse, error) {
  19635. gensupport.SetOptions(c.urlParams_, opts...)
  19636. res, err := c.doRequest("json")
  19637. if res != nil && res.StatusCode == http.StatusNotModified {
  19638. if res.Body != nil {
  19639. res.Body.Close()
  19640. }
  19641. return nil, &googleapi.Error{
  19642. Code: res.StatusCode,
  19643. Header: res.Header,
  19644. }
  19645. }
  19646. if err != nil {
  19647. return nil, err
  19648. }
  19649. defer googleapi.CloseBody(res)
  19650. if err := googleapi.CheckResponse(res); err != nil {
  19651. return nil, err
  19652. }
  19653. ret := &VideoCategoryListResponse{
  19654. ServerResponse: googleapi.ServerResponse{
  19655. Header: res.Header,
  19656. HTTPStatusCode: res.StatusCode,
  19657. },
  19658. }
  19659. target := &ret
  19660. if err := gensupport.DecodeResponse(target, res); err != nil {
  19661. return nil, err
  19662. }
  19663. return ret, nil
  19664. // {
  19665. // "description": "Returns a list of categories that can be associated with YouTube videos.",
  19666. // "httpMethod": "GET",
  19667. // "id": "youtube.videoCategories.list",
  19668. // "parameterOrder": [
  19669. // "part"
  19670. // ],
  19671. // "parameters": {
  19672. // "hl": {
  19673. // "default": "en_US",
  19674. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  19675. // "location": "query",
  19676. // "type": "string"
  19677. // },
  19678. // "id": {
  19679. // "description": "The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving.",
  19680. // "location": "query",
  19681. // "type": "string"
  19682. // },
  19683. // "part": {
  19684. // "description": "The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.",
  19685. // "location": "query",
  19686. // "required": true,
  19687. // "type": "string"
  19688. // },
  19689. // "regionCode": {
  19690. // "description": "The regionCode parameter instructs the API to return the list of video categories available in the specified country. The parameter value is an ISO 3166-1 alpha-2 country code.",
  19691. // "location": "query",
  19692. // "type": "string"
  19693. // }
  19694. // },
  19695. // "path": "videoCategories",
  19696. // "response": {
  19697. // "$ref": "VideoCategoryListResponse"
  19698. // },
  19699. // "scopes": [
  19700. // "https://www.googleapis.com/auth/youtube",
  19701. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19702. // "https://www.googleapis.com/auth/youtube.readonly",
  19703. // "https://www.googleapis.com/auth/youtubepartner"
  19704. // ]
  19705. // }
  19706. }
  19707. // method id "youtube.videos.delete":
  19708. type VideosDeleteCall struct {
  19709. s *Service
  19710. urlParams_ gensupport.URLParams
  19711. ctx_ context.Context
  19712. header_ http.Header
  19713. }
  19714. // Delete: Deletes a YouTube video.
  19715. func (r *VideosService) Delete(id string) *VideosDeleteCall {
  19716. c := &VideosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19717. c.urlParams_.Set("id", id)
  19718. return c
  19719. }
  19720. // OnBehalfOfContentOwner sets the optional parameter
  19721. // "onBehalfOfContentOwner": Note: This parameter is intended
  19722. // exclusively for YouTube content partners.
  19723. //
  19724. // The onBehalfOfContentOwner parameter indicates that the request's
  19725. // authorization credentials identify a YouTube CMS user who is acting
  19726. // on behalf of the content owner specified in the parameter value. This
  19727. // parameter is intended for YouTube content partners that own and
  19728. // manage many different YouTube channels. It allows content owners to
  19729. // authenticate once and get access to all their video and channel data,
  19730. // without having to provide authentication credentials for each
  19731. // individual channel. The actual CMS account that the user
  19732. // authenticates with must be linked to the specified YouTube content
  19733. // owner.
  19734. func (c *VideosDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosDeleteCall {
  19735. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19736. return c
  19737. }
  19738. // Fields allows partial responses to be retrieved. See
  19739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19740. // for more information.
  19741. func (c *VideosDeleteCall) Fields(s ...googleapi.Field) *VideosDeleteCall {
  19742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19743. return c
  19744. }
  19745. // Context sets the context to be used in this call's Do method. Any
  19746. // pending HTTP request will be aborted if the provided context is
  19747. // canceled.
  19748. func (c *VideosDeleteCall) Context(ctx context.Context) *VideosDeleteCall {
  19749. c.ctx_ = ctx
  19750. return c
  19751. }
  19752. // Header returns an http.Header that can be modified by the caller to
  19753. // add HTTP headers to the request.
  19754. func (c *VideosDeleteCall) Header() http.Header {
  19755. if c.header_ == nil {
  19756. c.header_ = make(http.Header)
  19757. }
  19758. return c.header_
  19759. }
  19760. func (c *VideosDeleteCall) doRequest(alt string) (*http.Response, error) {
  19761. reqHeaders := make(http.Header)
  19762. for k, v := range c.header_ {
  19763. reqHeaders[k] = v
  19764. }
  19765. reqHeaders.Set("User-Agent", c.s.userAgent())
  19766. var body io.Reader = nil
  19767. c.urlParams_.Set("alt", alt)
  19768. c.urlParams_.Set("prettyPrint", "false")
  19769. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  19770. urls += "?" + c.urlParams_.Encode()
  19771. req, err := http.NewRequest("DELETE", urls, body)
  19772. if err != nil {
  19773. return nil, err
  19774. }
  19775. req.Header = reqHeaders
  19776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19777. }
  19778. // Do executes the "youtube.videos.delete" call.
  19779. func (c *VideosDeleteCall) Do(opts ...googleapi.CallOption) error {
  19780. gensupport.SetOptions(c.urlParams_, opts...)
  19781. res, err := c.doRequest("json")
  19782. if err != nil {
  19783. return err
  19784. }
  19785. defer googleapi.CloseBody(res)
  19786. if err := googleapi.CheckResponse(res); err != nil {
  19787. return err
  19788. }
  19789. return nil
  19790. // {
  19791. // "description": "Deletes a YouTube video.",
  19792. // "httpMethod": "DELETE",
  19793. // "id": "youtube.videos.delete",
  19794. // "parameterOrder": [
  19795. // "id"
  19796. // ],
  19797. // "parameters": {
  19798. // "id": {
  19799. // "description": "The id parameter specifies the YouTube video ID for the resource that is being deleted. In a video resource, the id property specifies the video's ID.",
  19800. // "location": "query",
  19801. // "required": true,
  19802. // "type": "string"
  19803. // },
  19804. // "onBehalfOfContentOwner": {
  19805. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  19806. // "location": "query",
  19807. // "type": "string"
  19808. // }
  19809. // },
  19810. // "path": "videos",
  19811. // "scopes": [
  19812. // "https://www.googleapis.com/auth/youtube",
  19813. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19814. // "https://www.googleapis.com/auth/youtubepartner"
  19815. // ]
  19816. // }
  19817. }
  19818. // method id "youtube.videos.getRating":
  19819. type VideosGetRatingCall struct {
  19820. s *Service
  19821. urlParams_ gensupport.URLParams
  19822. ifNoneMatch_ string
  19823. ctx_ context.Context
  19824. header_ http.Header
  19825. }
  19826. // GetRating: Retrieves the ratings that the authorized user gave to a
  19827. // list of specified videos.
  19828. func (r *VideosService) GetRating(id string) *VideosGetRatingCall {
  19829. c := &VideosGetRatingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19830. c.urlParams_.Set("id", id)
  19831. return c
  19832. }
  19833. // OnBehalfOfContentOwner sets the optional parameter
  19834. // "onBehalfOfContentOwner": Note: This parameter is intended
  19835. // exclusively for YouTube content partners.
  19836. //
  19837. // The onBehalfOfContentOwner parameter indicates that the request's
  19838. // authorization credentials identify a YouTube CMS user who is acting
  19839. // on behalf of the content owner specified in the parameter value. This
  19840. // parameter is intended for YouTube content partners that own and
  19841. // manage many different YouTube channels. It allows content owners to
  19842. // authenticate once and get access to all their video and channel data,
  19843. // without having to provide authentication credentials for each
  19844. // individual channel. The CMS account that the user authenticates with
  19845. // must be linked to the specified YouTube content owner.
  19846. func (c *VideosGetRatingCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosGetRatingCall {
  19847. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19848. return c
  19849. }
  19850. // Fields allows partial responses to be retrieved. See
  19851. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19852. // for more information.
  19853. func (c *VideosGetRatingCall) Fields(s ...googleapi.Field) *VideosGetRatingCall {
  19854. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19855. return c
  19856. }
  19857. // IfNoneMatch sets the optional parameter which makes the operation
  19858. // fail if the object's ETag matches the given value. This is useful for
  19859. // getting updates only after the object has changed since the last
  19860. // request. Use googleapi.IsNotModified to check whether the response
  19861. // error from Do is the result of In-None-Match.
  19862. func (c *VideosGetRatingCall) IfNoneMatch(entityTag string) *VideosGetRatingCall {
  19863. c.ifNoneMatch_ = entityTag
  19864. return c
  19865. }
  19866. // Context sets the context to be used in this call's Do method. Any
  19867. // pending HTTP request will be aborted if the provided context is
  19868. // canceled.
  19869. func (c *VideosGetRatingCall) Context(ctx context.Context) *VideosGetRatingCall {
  19870. c.ctx_ = ctx
  19871. return c
  19872. }
  19873. // Header returns an http.Header that can be modified by the caller to
  19874. // add HTTP headers to the request.
  19875. func (c *VideosGetRatingCall) Header() http.Header {
  19876. if c.header_ == nil {
  19877. c.header_ = make(http.Header)
  19878. }
  19879. return c.header_
  19880. }
  19881. func (c *VideosGetRatingCall) doRequest(alt string) (*http.Response, error) {
  19882. reqHeaders := make(http.Header)
  19883. for k, v := range c.header_ {
  19884. reqHeaders[k] = v
  19885. }
  19886. reqHeaders.Set("User-Agent", c.s.userAgent())
  19887. if c.ifNoneMatch_ != "" {
  19888. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19889. }
  19890. var body io.Reader = nil
  19891. c.urlParams_.Set("alt", alt)
  19892. c.urlParams_.Set("prettyPrint", "false")
  19893. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/getRating")
  19894. urls += "?" + c.urlParams_.Encode()
  19895. req, err := http.NewRequest("GET", urls, body)
  19896. if err != nil {
  19897. return nil, err
  19898. }
  19899. req.Header = reqHeaders
  19900. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19901. }
  19902. // Do executes the "youtube.videos.getRating" call.
  19903. // Exactly one of *VideoGetRatingResponse or error will be non-nil. Any
  19904. // non-2xx status code is an error. Response headers are in either
  19905. // *VideoGetRatingResponse.ServerResponse.Header or (if a response was
  19906. // returned at all) in error.(*googleapi.Error).Header. Use
  19907. // googleapi.IsNotModified to check whether the returned error was
  19908. // because http.StatusNotModified was returned.
  19909. func (c *VideosGetRatingCall) Do(opts ...googleapi.CallOption) (*VideoGetRatingResponse, error) {
  19910. gensupport.SetOptions(c.urlParams_, opts...)
  19911. res, err := c.doRequest("json")
  19912. if res != nil && res.StatusCode == http.StatusNotModified {
  19913. if res.Body != nil {
  19914. res.Body.Close()
  19915. }
  19916. return nil, &googleapi.Error{
  19917. Code: res.StatusCode,
  19918. Header: res.Header,
  19919. }
  19920. }
  19921. if err != nil {
  19922. return nil, err
  19923. }
  19924. defer googleapi.CloseBody(res)
  19925. if err := googleapi.CheckResponse(res); err != nil {
  19926. return nil, err
  19927. }
  19928. ret := &VideoGetRatingResponse{
  19929. ServerResponse: googleapi.ServerResponse{
  19930. Header: res.Header,
  19931. HTTPStatusCode: res.StatusCode,
  19932. },
  19933. }
  19934. target := &ret
  19935. if err := gensupport.DecodeResponse(target, res); err != nil {
  19936. return nil, err
  19937. }
  19938. return ret, nil
  19939. // {
  19940. // "description": "Retrieves the ratings that the authorized user gave to a list of specified videos.",
  19941. // "httpMethod": "GET",
  19942. // "id": "youtube.videos.getRating",
  19943. // "parameterOrder": [
  19944. // "id"
  19945. // ],
  19946. // "parameters": {
  19947. // "id": {
  19948. // "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) for which you are retrieving rating data. In a video resource, the id property specifies the video's ID.",
  19949. // "location": "query",
  19950. // "required": true,
  19951. // "type": "string"
  19952. // },
  19953. // "onBehalfOfContentOwner": {
  19954. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  19955. // "location": "query",
  19956. // "type": "string"
  19957. // }
  19958. // },
  19959. // "path": "videos/getRating",
  19960. // "response": {
  19961. // "$ref": "VideoGetRatingResponse"
  19962. // },
  19963. // "scopes": [
  19964. // "https://www.googleapis.com/auth/youtube",
  19965. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19966. // "https://www.googleapis.com/auth/youtubepartner"
  19967. // ]
  19968. // }
  19969. }
  19970. // method id "youtube.videos.insert":
  19971. type VideosInsertCall struct {
  19972. s *Service
  19973. video *Video
  19974. urlParams_ gensupport.URLParams
  19975. mediaInfo_ *gensupport.MediaInfo
  19976. ctx_ context.Context
  19977. header_ http.Header
  19978. }
  19979. // Insert: Uploads a video to YouTube and optionally sets the video's
  19980. // metadata.
  19981. func (r *VideosService) Insert(part string, video *Video) *VideosInsertCall {
  19982. c := &VideosInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19983. c.urlParams_.Set("part", part)
  19984. c.video = video
  19985. return c
  19986. }
  19987. // AutoLevels sets the optional parameter "autoLevels": The autoLevels
  19988. // parameter indicates whether YouTube should automatically enhance the
  19989. // video's lighting and color.
  19990. func (c *VideosInsertCall) AutoLevels(autoLevels bool) *VideosInsertCall {
  19991. c.urlParams_.Set("autoLevels", fmt.Sprint(autoLevels))
  19992. return c
  19993. }
  19994. // NotifySubscribers sets the optional parameter "notifySubscribers":
  19995. // The notifySubscribers parameter indicates whether YouTube should send
  19996. // a notification about the new video to users who subscribe to the
  19997. // video's channel. A parameter value of True indicates that subscribers
  19998. // will be notified of newly uploaded videos. However, a channel owner
  19999. // who is uploading many videos might prefer to set the value to False
  20000. // to avoid sending a notification about each new video to the channel's
  20001. // subscribers.
  20002. func (c *VideosInsertCall) NotifySubscribers(notifySubscribers bool) *VideosInsertCall {
  20003. c.urlParams_.Set("notifySubscribers", fmt.Sprint(notifySubscribers))
  20004. return c
  20005. }
  20006. // OnBehalfOfContentOwner sets the optional parameter
  20007. // "onBehalfOfContentOwner": Note: This parameter is intended
  20008. // exclusively for YouTube content partners.
  20009. //
  20010. // The onBehalfOfContentOwner parameter indicates that the request's
  20011. // authorization credentials identify a YouTube CMS user who is acting
  20012. // on behalf of the content owner specified in the parameter value. This
  20013. // parameter is intended for YouTube content partners that own and
  20014. // manage many different YouTube channels. It allows content owners to
  20015. // authenticate once and get access to all their video and channel data,
  20016. // without having to provide authentication credentials for each
  20017. // individual channel. The CMS account that the user authenticates with
  20018. // must be linked to the specified YouTube content owner.
  20019. func (c *VideosInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosInsertCall {
  20020. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20021. return c
  20022. }
  20023. // OnBehalfOfContentOwnerChannel sets the optional parameter
  20024. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  20025. // properly authorized request. Note: This parameter is intended
  20026. // exclusively for YouTube content partners.
  20027. //
  20028. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  20029. // channel ID of the channel to which a video is being added. This
  20030. // parameter is required when a request specifies a value for the
  20031. // onBehalfOfContentOwner parameter, and it can only be used in
  20032. // conjunction with that parameter. In addition, the request must be
  20033. // authorized using a CMS account that is linked to the content owner
  20034. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  20035. // channel that the onBehalfOfContentOwnerChannel parameter value
  20036. // specifies must be linked to the content owner that the
  20037. // onBehalfOfContentOwner parameter specifies.
  20038. //
  20039. // This parameter is intended for YouTube content partners that own and
  20040. // manage many different YouTube channels. It allows content owners to
  20041. // authenticate once and perform actions on behalf of the channel
  20042. // specified in the parameter value, without having to provide
  20043. // authentication credentials for each separate channel.
  20044. func (c *VideosInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *VideosInsertCall {
  20045. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  20046. return c
  20047. }
  20048. // Stabilize sets the optional parameter "stabilize": The stabilize
  20049. // parameter indicates whether YouTube should adjust the video to remove
  20050. // shaky camera motions.
  20051. func (c *VideosInsertCall) Stabilize(stabilize bool) *VideosInsertCall {
  20052. c.urlParams_.Set("stabilize", fmt.Sprint(stabilize))
  20053. return c
  20054. }
  20055. // Media specifies the media to upload in one or more chunks. The chunk
  20056. // size may be controlled by supplying a MediaOption generated by
  20057. // googleapi.ChunkSize. The chunk size defaults to
  20058. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  20059. // upload request will be determined by sniffing the contents of r,
  20060. // unless a MediaOption generated by googleapi.ContentType is
  20061. // supplied.
  20062. // At most one of Media and ResumableMedia may be set.
  20063. func (c *VideosInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *VideosInsertCall {
  20064. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  20065. return c
  20066. }
  20067. // ResumableMedia specifies the media to upload in chunks and can be
  20068. // canceled with ctx.
  20069. //
  20070. // Deprecated: use Media instead.
  20071. //
  20072. // At most one of Media and ResumableMedia may be set. mediaType
  20073. // identifies the MIME media type of the upload, such as "image/png". If
  20074. // mediaType is "", it will be auto-detected. The provided ctx will
  20075. // supersede any context previously provided to the Context method.
  20076. func (c *VideosInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *VideosInsertCall {
  20077. c.ctx_ = ctx
  20078. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  20079. return c
  20080. }
  20081. // ProgressUpdater provides a callback function that will be called
  20082. // after every chunk. It should be a low-latency function in order to
  20083. // not slow down the upload operation. This should only be called when
  20084. // using ResumableMedia (as opposed to Media).
  20085. func (c *VideosInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *VideosInsertCall {
  20086. c.mediaInfo_.SetProgressUpdater(pu)
  20087. return c
  20088. }
  20089. // Fields allows partial responses to be retrieved. See
  20090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20091. // for more information.
  20092. func (c *VideosInsertCall) Fields(s ...googleapi.Field) *VideosInsertCall {
  20093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20094. return c
  20095. }
  20096. // Context sets the context to be used in this call's Do method. Any
  20097. // pending HTTP request will be aborted if the provided context is
  20098. // canceled.
  20099. // This context will supersede any context previously provided to the
  20100. // ResumableMedia method.
  20101. func (c *VideosInsertCall) Context(ctx context.Context) *VideosInsertCall {
  20102. c.ctx_ = ctx
  20103. return c
  20104. }
  20105. // Header returns an http.Header that can be modified by the caller to
  20106. // add HTTP headers to the request.
  20107. func (c *VideosInsertCall) Header() http.Header {
  20108. if c.header_ == nil {
  20109. c.header_ = make(http.Header)
  20110. }
  20111. return c.header_
  20112. }
  20113. func (c *VideosInsertCall) doRequest(alt string) (*http.Response, error) {
  20114. reqHeaders := make(http.Header)
  20115. for k, v := range c.header_ {
  20116. reqHeaders[k] = v
  20117. }
  20118. reqHeaders.Set("User-Agent", c.s.userAgent())
  20119. var body io.Reader = nil
  20120. body, err := googleapi.WithoutDataWrapper.JSONReader(c.video)
  20121. if err != nil {
  20122. return nil, err
  20123. }
  20124. reqHeaders.Set("Content-Type", "application/json")
  20125. c.urlParams_.Set("alt", alt)
  20126. c.urlParams_.Set("prettyPrint", "false")
  20127. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  20128. if c.mediaInfo_ != nil {
  20129. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  20130. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  20131. }
  20132. if body == nil {
  20133. body = new(bytes.Buffer)
  20134. reqHeaders.Set("Content-Type", "application/json")
  20135. }
  20136. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  20137. defer cleanup()
  20138. urls += "?" + c.urlParams_.Encode()
  20139. req, err := http.NewRequest("POST", urls, body)
  20140. if err != nil {
  20141. return nil, err
  20142. }
  20143. req.Header = reqHeaders
  20144. req.GetBody = getBody
  20145. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20146. }
  20147. // Do executes the "youtube.videos.insert" call.
  20148. // Exactly one of *Video or error will be non-nil. Any non-2xx status
  20149. // code is an error. Response headers are in either
  20150. // *Video.ServerResponse.Header or (if a response was returned at all)
  20151. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  20152. // check whether the returned error was because http.StatusNotModified
  20153. // was returned.
  20154. func (c *VideosInsertCall) Do(opts ...googleapi.CallOption) (*Video, error) {
  20155. gensupport.SetOptions(c.urlParams_, opts...)
  20156. res, err := c.doRequest("json")
  20157. if res != nil && res.StatusCode == http.StatusNotModified {
  20158. if res.Body != nil {
  20159. res.Body.Close()
  20160. }
  20161. return nil, &googleapi.Error{
  20162. Code: res.StatusCode,
  20163. Header: res.Header,
  20164. }
  20165. }
  20166. if err != nil {
  20167. return nil, err
  20168. }
  20169. defer googleapi.CloseBody(res)
  20170. if err := googleapi.CheckResponse(res); err != nil {
  20171. return nil, err
  20172. }
  20173. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  20174. if rx != nil {
  20175. rx.Client = c.s.client
  20176. rx.UserAgent = c.s.userAgent()
  20177. ctx := c.ctx_
  20178. if ctx == nil {
  20179. ctx = context.TODO()
  20180. }
  20181. res, err = rx.Upload(ctx)
  20182. if err != nil {
  20183. return nil, err
  20184. }
  20185. defer res.Body.Close()
  20186. if err := googleapi.CheckResponse(res); err != nil {
  20187. return nil, err
  20188. }
  20189. }
  20190. ret := &Video{
  20191. ServerResponse: googleapi.ServerResponse{
  20192. Header: res.Header,
  20193. HTTPStatusCode: res.StatusCode,
  20194. },
  20195. }
  20196. target := &ret
  20197. if err := gensupport.DecodeResponse(target, res); err != nil {
  20198. return nil, err
  20199. }
  20200. return ret, nil
  20201. // {
  20202. // "description": "Uploads a video to YouTube and optionally sets the video's metadata.",
  20203. // "httpMethod": "POST",
  20204. // "id": "youtube.videos.insert",
  20205. // "mediaUpload": {
  20206. // "accept": [
  20207. // "application/octet-stream",
  20208. // "video/*"
  20209. // ],
  20210. // "maxSize": "64GB",
  20211. // "protocols": {
  20212. // "resumable": {
  20213. // "multipart": true,
  20214. // "path": "/resumable/upload/youtube/v3/videos"
  20215. // },
  20216. // "simple": {
  20217. // "multipart": true,
  20218. // "path": "/upload/youtube/v3/videos"
  20219. // }
  20220. // }
  20221. // },
  20222. // "parameterOrder": [
  20223. // "part"
  20224. // ],
  20225. // "parameters": {
  20226. // "autoLevels": {
  20227. // "description": "The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color.",
  20228. // "location": "query",
  20229. // "type": "boolean"
  20230. // },
  20231. // "notifySubscribers": {
  20232. // "default": "true",
  20233. // "description": "The notifySubscribers parameter indicates whether YouTube should send a notification about the new video to users who subscribe to the video's channel. A parameter value of True indicates that subscribers will be notified of newly uploaded videos. However, a channel owner who is uploading many videos might prefer to set the value to False to avoid sending a notification about each new video to the channel's subscribers.",
  20234. // "location": "query",
  20235. // "type": "boolean"
  20236. // },
  20237. // "onBehalfOfContentOwner": {
  20238. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  20239. // "location": "query",
  20240. // "type": "string"
  20241. // },
  20242. // "onBehalfOfContentOwnerChannel": {
  20243. // "description": "This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies.\n\nThis parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel.",
  20244. // "location": "query",
  20245. // "type": "string"
  20246. // },
  20247. // "part": {
  20248. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.",
  20249. // "location": "query",
  20250. // "required": true,
  20251. // "type": "string"
  20252. // },
  20253. // "stabilize": {
  20254. // "description": "The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions.",
  20255. // "location": "query",
  20256. // "type": "boolean"
  20257. // }
  20258. // },
  20259. // "path": "videos",
  20260. // "request": {
  20261. // "$ref": "Video"
  20262. // },
  20263. // "response": {
  20264. // "$ref": "Video"
  20265. // },
  20266. // "scopes": [
  20267. // "https://www.googleapis.com/auth/youtube",
  20268. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20269. // "https://www.googleapis.com/auth/youtube.upload",
  20270. // "https://www.googleapis.com/auth/youtubepartner"
  20271. // ],
  20272. // "supportsMediaUpload": true
  20273. // }
  20274. }
  20275. // method id "youtube.videos.list":
  20276. type VideosListCall struct {
  20277. s *Service
  20278. urlParams_ gensupport.URLParams
  20279. ifNoneMatch_ string
  20280. ctx_ context.Context
  20281. header_ http.Header
  20282. }
  20283. // List: Returns a list of videos that match the API request parameters.
  20284. func (r *VideosService) List(part string) *VideosListCall {
  20285. c := &VideosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20286. c.urlParams_.Set("part", part)
  20287. return c
  20288. }
  20289. // Chart sets the optional parameter "chart": The chart parameter
  20290. // identifies the chart that you want to retrieve.
  20291. //
  20292. // Possible values:
  20293. // "mostPopular" - Return the most popular videos for the specified
  20294. // content region and video category.
  20295. func (c *VideosListCall) Chart(chart string) *VideosListCall {
  20296. c.urlParams_.Set("chart", chart)
  20297. return c
  20298. }
  20299. // Hl sets the optional parameter "hl": The hl parameter instructs the
  20300. // API to retrieve localized resource metadata for a specific
  20301. // application language that the YouTube website supports. The parameter
  20302. // value must be a language code included in the list returned by the
  20303. // i18nLanguages.list method.
  20304. //
  20305. // If localized resource details are available in that language, the
  20306. // resource's snippet.localized object will contain the localized
  20307. // values. However, if localized details are not available, the
  20308. // snippet.localized object will contain resource details in the
  20309. // resource's default language.
  20310. func (c *VideosListCall) Hl(hl string) *VideosListCall {
  20311. c.urlParams_.Set("hl", hl)
  20312. return c
  20313. }
  20314. // Id sets the optional parameter "id": The id parameter specifies a
  20315. // comma-separated list of the YouTube video ID(s) for the resource(s)
  20316. // that are being retrieved. In a video resource, the id property
  20317. // specifies the video's ID.
  20318. func (c *VideosListCall) Id(id string) *VideosListCall {
  20319. c.urlParams_.Set("id", id)
  20320. return c
  20321. }
  20322. // Locale sets the optional parameter "locale": DEPRECATED
  20323. func (c *VideosListCall) Locale(locale string) *VideosListCall {
  20324. c.urlParams_.Set("locale", locale)
  20325. return c
  20326. }
  20327. // MaxHeight sets the optional parameter "maxHeight": The maxHeight
  20328. // parameter specifies a maximum height of the embedded player. If
  20329. // maxWidth is provided, maxHeight may not be reached in order to not
  20330. // violate the width request.
  20331. func (c *VideosListCall) MaxHeight(maxHeight int64) *VideosListCall {
  20332. c.urlParams_.Set("maxHeight", fmt.Sprint(maxHeight))
  20333. return c
  20334. }
  20335. // MaxResults sets the optional parameter "maxResults": The maxResults
  20336. // parameter specifies the maximum number of items that should be
  20337. // returned in the result set.
  20338. //
  20339. // Note: This parameter is supported for use in conjunction with the
  20340. // myRating and chart parameters, but it is not supported for use in
  20341. // conjunction with the id parameter.
  20342. func (c *VideosListCall) MaxResults(maxResults int64) *VideosListCall {
  20343. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20344. return c
  20345. }
  20346. // MaxWidth sets the optional parameter "maxWidth": The maxWidth
  20347. // parameter specifies a maximum width of the embedded player. If
  20348. // maxHeight is provided, maxWidth may not be reached in order to not
  20349. // violate the height request.
  20350. func (c *VideosListCall) MaxWidth(maxWidth int64) *VideosListCall {
  20351. c.urlParams_.Set("maxWidth", fmt.Sprint(maxWidth))
  20352. return c
  20353. }
  20354. // MyRating sets the optional parameter "myRating": Set this parameter's
  20355. // value to like or dislike to instruct the API to only return videos
  20356. // liked or disliked by the authenticated user.
  20357. //
  20358. // Possible values:
  20359. // "dislike" - Returns only videos disliked by the authenticated user.
  20360. // "like" - Returns only video liked by the authenticated user.
  20361. func (c *VideosListCall) MyRating(myRating string) *VideosListCall {
  20362. c.urlParams_.Set("myRating", myRating)
  20363. return c
  20364. }
  20365. // OnBehalfOfContentOwner sets the optional parameter
  20366. // "onBehalfOfContentOwner": Note: This parameter is intended
  20367. // exclusively for YouTube content partners.
  20368. //
  20369. // The onBehalfOfContentOwner parameter indicates that the request's
  20370. // authorization credentials identify a YouTube CMS user who is acting
  20371. // on behalf of the content owner specified in the parameter value. This
  20372. // parameter is intended for YouTube content partners that own and
  20373. // manage many different YouTube channels. It allows content owners to
  20374. // authenticate once and get access to all their video and channel data,
  20375. // without having to provide authentication credentials for each
  20376. // individual channel. The CMS account that the user authenticates with
  20377. // must be linked to the specified YouTube content owner.
  20378. func (c *VideosListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosListCall {
  20379. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20380. return c
  20381. }
  20382. // PageToken sets the optional parameter "pageToken": The pageToken
  20383. // parameter identifies a specific page in the result set that should be
  20384. // returned. In an API response, the nextPageToken and prevPageToken
  20385. // properties identify other pages that could be retrieved.
  20386. //
  20387. // Note: This parameter is supported for use in conjunction with the
  20388. // myRating and chart parameters, but it is not supported for use in
  20389. // conjunction with the id parameter.
  20390. func (c *VideosListCall) PageToken(pageToken string) *VideosListCall {
  20391. c.urlParams_.Set("pageToken", pageToken)
  20392. return c
  20393. }
  20394. // RegionCode sets the optional parameter "regionCode": The regionCode
  20395. // parameter instructs the API to select a video chart available in the
  20396. // specified region. This parameter can only be used in conjunction with
  20397. // the chart parameter. The parameter value is an ISO 3166-1 alpha-2
  20398. // country code.
  20399. func (c *VideosListCall) RegionCode(regionCode string) *VideosListCall {
  20400. c.urlParams_.Set("regionCode", regionCode)
  20401. return c
  20402. }
  20403. // VideoCategoryId sets the optional parameter "videoCategoryId": The
  20404. // videoCategoryId parameter identifies the video category for which the
  20405. // chart should be retrieved. This parameter can only be used in
  20406. // conjunction with the chart parameter. By default, charts are not
  20407. // restricted to a particular category.
  20408. func (c *VideosListCall) VideoCategoryId(videoCategoryId string) *VideosListCall {
  20409. c.urlParams_.Set("videoCategoryId", videoCategoryId)
  20410. return c
  20411. }
  20412. // Fields allows partial responses to be retrieved. See
  20413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20414. // for more information.
  20415. func (c *VideosListCall) Fields(s ...googleapi.Field) *VideosListCall {
  20416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20417. return c
  20418. }
  20419. // IfNoneMatch sets the optional parameter which makes the operation
  20420. // fail if the object's ETag matches the given value. This is useful for
  20421. // getting updates only after the object has changed since the last
  20422. // request. Use googleapi.IsNotModified to check whether the response
  20423. // error from Do is the result of In-None-Match.
  20424. func (c *VideosListCall) IfNoneMatch(entityTag string) *VideosListCall {
  20425. c.ifNoneMatch_ = entityTag
  20426. return c
  20427. }
  20428. // Context sets the context to be used in this call's Do method. Any
  20429. // pending HTTP request will be aborted if the provided context is
  20430. // canceled.
  20431. func (c *VideosListCall) Context(ctx context.Context) *VideosListCall {
  20432. c.ctx_ = ctx
  20433. return c
  20434. }
  20435. // Header returns an http.Header that can be modified by the caller to
  20436. // add HTTP headers to the request.
  20437. func (c *VideosListCall) Header() http.Header {
  20438. if c.header_ == nil {
  20439. c.header_ = make(http.Header)
  20440. }
  20441. return c.header_
  20442. }
  20443. func (c *VideosListCall) doRequest(alt string) (*http.Response, error) {
  20444. reqHeaders := make(http.Header)
  20445. for k, v := range c.header_ {
  20446. reqHeaders[k] = v
  20447. }
  20448. reqHeaders.Set("User-Agent", c.s.userAgent())
  20449. if c.ifNoneMatch_ != "" {
  20450. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20451. }
  20452. var body io.Reader = nil
  20453. c.urlParams_.Set("alt", alt)
  20454. c.urlParams_.Set("prettyPrint", "false")
  20455. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  20456. urls += "?" + c.urlParams_.Encode()
  20457. req, err := http.NewRequest("GET", urls, body)
  20458. if err != nil {
  20459. return nil, err
  20460. }
  20461. req.Header = reqHeaders
  20462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20463. }
  20464. // Do executes the "youtube.videos.list" call.
  20465. // Exactly one of *VideoListResponse or error will be non-nil. Any
  20466. // non-2xx status code is an error. Response headers are in either
  20467. // *VideoListResponse.ServerResponse.Header or (if a response was
  20468. // returned at all) in error.(*googleapi.Error).Header. Use
  20469. // googleapi.IsNotModified to check whether the returned error was
  20470. // because http.StatusNotModified was returned.
  20471. func (c *VideosListCall) Do(opts ...googleapi.CallOption) (*VideoListResponse, error) {
  20472. gensupport.SetOptions(c.urlParams_, opts...)
  20473. res, err := c.doRequest("json")
  20474. if res != nil && res.StatusCode == http.StatusNotModified {
  20475. if res.Body != nil {
  20476. res.Body.Close()
  20477. }
  20478. return nil, &googleapi.Error{
  20479. Code: res.StatusCode,
  20480. Header: res.Header,
  20481. }
  20482. }
  20483. if err != nil {
  20484. return nil, err
  20485. }
  20486. defer googleapi.CloseBody(res)
  20487. if err := googleapi.CheckResponse(res); err != nil {
  20488. return nil, err
  20489. }
  20490. ret := &VideoListResponse{
  20491. ServerResponse: googleapi.ServerResponse{
  20492. Header: res.Header,
  20493. HTTPStatusCode: res.StatusCode,
  20494. },
  20495. }
  20496. target := &ret
  20497. if err := gensupport.DecodeResponse(target, res); err != nil {
  20498. return nil, err
  20499. }
  20500. return ret, nil
  20501. // {
  20502. // "description": "Returns a list of videos that match the API request parameters.",
  20503. // "httpMethod": "GET",
  20504. // "id": "youtube.videos.list",
  20505. // "parameterOrder": [
  20506. // "part"
  20507. // ],
  20508. // "parameters": {
  20509. // "chart": {
  20510. // "description": "The chart parameter identifies the chart that you want to retrieve.",
  20511. // "enum": [
  20512. // "mostPopular"
  20513. // ],
  20514. // "enumDescriptions": [
  20515. // "Return the most popular videos for the specified content region and video category."
  20516. // ],
  20517. // "location": "query",
  20518. // "type": "string"
  20519. // },
  20520. // "hl": {
  20521. // "description": "The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method.\n\nIf localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language.",
  20522. // "location": "query",
  20523. // "type": "string"
  20524. // },
  20525. // "id": {
  20526. // "description": "The id parameter specifies a comma-separated list of the YouTube video ID(s) for the resource(s) that are being retrieved. In a video resource, the id property specifies the video's ID.",
  20527. // "location": "query",
  20528. // "type": "string"
  20529. // },
  20530. // "locale": {
  20531. // "description": "DEPRECATED",
  20532. // "location": "query",
  20533. // "type": "string"
  20534. // },
  20535. // "maxHeight": {
  20536. // "description": "The maxHeight parameter specifies a maximum height of the embedded player. If maxWidth is provided, maxHeight may not be reached in order to not violate the width request.",
  20537. // "format": "uint32",
  20538. // "location": "query",
  20539. // "maximum": "8192",
  20540. // "minimum": "72",
  20541. // "type": "integer"
  20542. // },
  20543. // "maxResults": {
  20544. // "default": "5",
  20545. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.\n\nNote: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter.",
  20546. // "format": "uint32",
  20547. // "location": "query",
  20548. // "maximum": "50",
  20549. // "minimum": "1",
  20550. // "type": "integer"
  20551. // },
  20552. // "maxWidth": {
  20553. // "description": "The maxWidth parameter specifies a maximum width of the embedded player. If maxHeight is provided, maxWidth may not be reached in order to not violate the height request.",
  20554. // "format": "uint32",
  20555. // "location": "query",
  20556. // "maximum": "8192",
  20557. // "minimum": "72",
  20558. // "type": "integer"
  20559. // },
  20560. // "myRating": {
  20561. // "description": "Set this parameter's value to like or dislike to instruct the API to only return videos liked or disliked by the authenticated user.",
  20562. // "enum": [
  20563. // "dislike",
  20564. // "like"
  20565. // ],
  20566. // "enumDescriptions": [
  20567. // "Returns only videos disliked by the authenticated user.",
  20568. // "Returns only video liked by the authenticated user."
  20569. // ],
  20570. // "location": "query",
  20571. // "type": "string"
  20572. // },
  20573. // "onBehalfOfContentOwner": {
  20574. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  20575. // "location": "query",
  20576. // "type": "string"
  20577. // },
  20578. // "pageToken": {
  20579. // "description": "The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved.\n\nNote: This parameter is supported for use in conjunction with the myRating and chart parameters, but it is not supported for use in conjunction with the id parameter.",
  20580. // "location": "query",
  20581. // "type": "string"
  20582. // },
  20583. // "part": {
  20584. // "description": "The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include.\n\nIf the parameter identifies a property that contains child properties, the child properties will be included in the response. For example, in a video resource, the snippet property contains the channelId, title, description, tags, and categoryId properties. As such, if you set part=snippet, the API response will contain all of those properties.",
  20585. // "location": "query",
  20586. // "required": true,
  20587. // "type": "string"
  20588. // },
  20589. // "regionCode": {
  20590. // "description": "The regionCode parameter instructs the API to select a video chart available in the specified region. This parameter can only be used in conjunction with the chart parameter. The parameter value is an ISO 3166-1 alpha-2 country code.",
  20591. // "location": "query",
  20592. // "type": "string"
  20593. // },
  20594. // "videoCategoryId": {
  20595. // "default": "0",
  20596. // "description": "The videoCategoryId parameter identifies the video category for which the chart should be retrieved. This parameter can only be used in conjunction with the chart parameter. By default, charts are not restricted to a particular category.",
  20597. // "location": "query",
  20598. // "type": "string"
  20599. // }
  20600. // },
  20601. // "path": "videos",
  20602. // "response": {
  20603. // "$ref": "VideoListResponse"
  20604. // },
  20605. // "scopes": [
  20606. // "https://www.googleapis.com/auth/youtube",
  20607. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20608. // "https://www.googleapis.com/auth/youtube.readonly",
  20609. // "https://www.googleapis.com/auth/youtubepartner"
  20610. // ]
  20611. // }
  20612. }
  20613. // Pages invokes f for each page of results.
  20614. // A non-nil error returned from f will halt the iteration.
  20615. // The provided context supersedes any context provided to the Context method.
  20616. func (c *VideosListCall) Pages(ctx context.Context, f func(*VideoListResponse) error) error {
  20617. c.ctx_ = ctx
  20618. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20619. for {
  20620. x, err := c.Do()
  20621. if err != nil {
  20622. return err
  20623. }
  20624. if err := f(x); err != nil {
  20625. return err
  20626. }
  20627. if x.NextPageToken == "" {
  20628. return nil
  20629. }
  20630. c.PageToken(x.NextPageToken)
  20631. }
  20632. }
  20633. // method id "youtube.videos.rate":
  20634. type VideosRateCall struct {
  20635. s *Service
  20636. urlParams_ gensupport.URLParams
  20637. ctx_ context.Context
  20638. header_ http.Header
  20639. }
  20640. // Rate: Add a like or dislike rating to a video or remove a rating from
  20641. // a video.
  20642. func (r *VideosService) Rate(id string, rating string) *VideosRateCall {
  20643. c := &VideosRateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20644. c.urlParams_.Set("id", id)
  20645. c.urlParams_.Set("rating", rating)
  20646. return c
  20647. }
  20648. // Fields allows partial responses to be retrieved. See
  20649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20650. // for more information.
  20651. func (c *VideosRateCall) Fields(s ...googleapi.Field) *VideosRateCall {
  20652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20653. return c
  20654. }
  20655. // Context sets the context to be used in this call's Do method. Any
  20656. // pending HTTP request will be aborted if the provided context is
  20657. // canceled.
  20658. func (c *VideosRateCall) Context(ctx context.Context) *VideosRateCall {
  20659. c.ctx_ = ctx
  20660. return c
  20661. }
  20662. // Header returns an http.Header that can be modified by the caller to
  20663. // add HTTP headers to the request.
  20664. func (c *VideosRateCall) Header() http.Header {
  20665. if c.header_ == nil {
  20666. c.header_ = make(http.Header)
  20667. }
  20668. return c.header_
  20669. }
  20670. func (c *VideosRateCall) doRequest(alt string) (*http.Response, error) {
  20671. reqHeaders := make(http.Header)
  20672. for k, v := range c.header_ {
  20673. reqHeaders[k] = v
  20674. }
  20675. reqHeaders.Set("User-Agent", c.s.userAgent())
  20676. var body io.Reader = nil
  20677. c.urlParams_.Set("alt", alt)
  20678. c.urlParams_.Set("prettyPrint", "false")
  20679. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/rate")
  20680. urls += "?" + c.urlParams_.Encode()
  20681. req, err := http.NewRequest("POST", urls, body)
  20682. if err != nil {
  20683. return nil, err
  20684. }
  20685. req.Header = reqHeaders
  20686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20687. }
  20688. // Do executes the "youtube.videos.rate" call.
  20689. func (c *VideosRateCall) Do(opts ...googleapi.CallOption) error {
  20690. gensupport.SetOptions(c.urlParams_, opts...)
  20691. res, err := c.doRequest("json")
  20692. if err != nil {
  20693. return err
  20694. }
  20695. defer googleapi.CloseBody(res)
  20696. if err := googleapi.CheckResponse(res); err != nil {
  20697. return err
  20698. }
  20699. return nil
  20700. // {
  20701. // "description": "Add a like or dislike rating to a video or remove a rating from a video.",
  20702. // "httpMethod": "POST",
  20703. // "id": "youtube.videos.rate",
  20704. // "parameterOrder": [
  20705. // "id",
  20706. // "rating"
  20707. // ],
  20708. // "parameters": {
  20709. // "id": {
  20710. // "description": "The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.",
  20711. // "location": "query",
  20712. // "required": true,
  20713. // "type": "string"
  20714. // },
  20715. // "rating": {
  20716. // "description": "Specifies the rating to record.",
  20717. // "enum": [
  20718. // "dislike",
  20719. // "like",
  20720. // "none"
  20721. // ],
  20722. // "enumDescriptions": [
  20723. // "Records that the authenticated user disliked the video.",
  20724. // "Records that the authenticated user liked the video.",
  20725. // "Removes any rating that the authenticated user had previously set for the video."
  20726. // ],
  20727. // "location": "query",
  20728. // "required": true,
  20729. // "type": "string"
  20730. // }
  20731. // },
  20732. // "path": "videos/rate",
  20733. // "scopes": [
  20734. // "https://www.googleapis.com/auth/youtube",
  20735. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20736. // "https://www.googleapis.com/auth/youtubepartner"
  20737. // ]
  20738. // }
  20739. }
  20740. // method id "youtube.videos.reportAbuse":
  20741. type VideosReportAbuseCall struct {
  20742. s *Service
  20743. videoabusereport *VideoAbuseReport
  20744. urlParams_ gensupport.URLParams
  20745. ctx_ context.Context
  20746. header_ http.Header
  20747. }
  20748. // ReportAbuse: Report abuse for a video.
  20749. func (r *VideosService) ReportAbuse(videoabusereport *VideoAbuseReport) *VideosReportAbuseCall {
  20750. c := &VideosReportAbuseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20751. c.videoabusereport = videoabusereport
  20752. return c
  20753. }
  20754. // OnBehalfOfContentOwner sets the optional parameter
  20755. // "onBehalfOfContentOwner": Note: This parameter is intended
  20756. // exclusively for YouTube content partners.
  20757. //
  20758. // The onBehalfOfContentOwner parameter indicates that the request's
  20759. // authorization credentials identify a YouTube CMS user who is acting
  20760. // on behalf of the content owner specified in the parameter value. This
  20761. // parameter is intended for YouTube content partners that own and
  20762. // manage many different YouTube channels. It allows content owners to
  20763. // authenticate once and get access to all their video and channel data,
  20764. // without having to provide authentication credentials for each
  20765. // individual channel. The CMS account that the user authenticates with
  20766. // must be linked to the specified YouTube content owner.
  20767. func (c *VideosReportAbuseCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosReportAbuseCall {
  20768. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20769. return c
  20770. }
  20771. // Fields allows partial responses to be retrieved. See
  20772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20773. // for more information.
  20774. func (c *VideosReportAbuseCall) Fields(s ...googleapi.Field) *VideosReportAbuseCall {
  20775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20776. return c
  20777. }
  20778. // Context sets the context to be used in this call's Do method. Any
  20779. // pending HTTP request will be aborted if the provided context is
  20780. // canceled.
  20781. func (c *VideosReportAbuseCall) Context(ctx context.Context) *VideosReportAbuseCall {
  20782. c.ctx_ = ctx
  20783. return c
  20784. }
  20785. // Header returns an http.Header that can be modified by the caller to
  20786. // add HTTP headers to the request.
  20787. func (c *VideosReportAbuseCall) Header() http.Header {
  20788. if c.header_ == nil {
  20789. c.header_ = make(http.Header)
  20790. }
  20791. return c.header_
  20792. }
  20793. func (c *VideosReportAbuseCall) doRequest(alt string) (*http.Response, error) {
  20794. reqHeaders := make(http.Header)
  20795. for k, v := range c.header_ {
  20796. reqHeaders[k] = v
  20797. }
  20798. reqHeaders.Set("User-Agent", c.s.userAgent())
  20799. var body io.Reader = nil
  20800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.videoabusereport)
  20801. if err != nil {
  20802. return nil, err
  20803. }
  20804. reqHeaders.Set("Content-Type", "application/json")
  20805. c.urlParams_.Set("alt", alt)
  20806. c.urlParams_.Set("prettyPrint", "false")
  20807. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/reportAbuse")
  20808. urls += "?" + c.urlParams_.Encode()
  20809. req, err := http.NewRequest("POST", urls, body)
  20810. if err != nil {
  20811. return nil, err
  20812. }
  20813. req.Header = reqHeaders
  20814. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20815. }
  20816. // Do executes the "youtube.videos.reportAbuse" call.
  20817. func (c *VideosReportAbuseCall) Do(opts ...googleapi.CallOption) error {
  20818. gensupport.SetOptions(c.urlParams_, opts...)
  20819. res, err := c.doRequest("json")
  20820. if err != nil {
  20821. return err
  20822. }
  20823. defer googleapi.CloseBody(res)
  20824. if err := googleapi.CheckResponse(res); err != nil {
  20825. return err
  20826. }
  20827. return nil
  20828. // {
  20829. // "description": "Report abuse for a video.",
  20830. // "httpMethod": "POST",
  20831. // "id": "youtube.videos.reportAbuse",
  20832. // "parameters": {
  20833. // "onBehalfOfContentOwner": {
  20834. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  20835. // "location": "query",
  20836. // "type": "string"
  20837. // }
  20838. // },
  20839. // "path": "videos/reportAbuse",
  20840. // "request": {
  20841. // "$ref": "VideoAbuseReport"
  20842. // },
  20843. // "scopes": [
  20844. // "https://www.googleapis.com/auth/youtube",
  20845. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20846. // "https://www.googleapis.com/auth/youtubepartner"
  20847. // ]
  20848. // }
  20849. }
  20850. // method id "youtube.videos.update":
  20851. type VideosUpdateCall struct {
  20852. s *Service
  20853. video *Video
  20854. urlParams_ gensupport.URLParams
  20855. ctx_ context.Context
  20856. header_ http.Header
  20857. }
  20858. // Update: Updates a video's metadata.
  20859. func (r *VideosService) Update(part string, video *Video) *VideosUpdateCall {
  20860. c := &VideosUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20861. c.urlParams_.Set("part", part)
  20862. c.video = video
  20863. return c
  20864. }
  20865. // OnBehalfOfContentOwner sets the optional parameter
  20866. // "onBehalfOfContentOwner": Note: This parameter is intended
  20867. // exclusively for YouTube content partners.
  20868. //
  20869. // The onBehalfOfContentOwner parameter indicates that the request's
  20870. // authorization credentials identify a YouTube CMS user who is acting
  20871. // on behalf of the content owner specified in the parameter value. This
  20872. // parameter is intended for YouTube content partners that own and
  20873. // manage many different YouTube channels. It allows content owners to
  20874. // authenticate once and get access to all their video and channel data,
  20875. // without having to provide authentication credentials for each
  20876. // individual channel. The actual CMS account that the user
  20877. // authenticates with must be linked to the specified YouTube content
  20878. // owner.
  20879. func (c *VideosUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosUpdateCall {
  20880. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20881. return c
  20882. }
  20883. // Fields allows partial responses to be retrieved. See
  20884. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20885. // for more information.
  20886. func (c *VideosUpdateCall) Fields(s ...googleapi.Field) *VideosUpdateCall {
  20887. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20888. return c
  20889. }
  20890. // Context sets the context to be used in this call's Do method. Any
  20891. // pending HTTP request will be aborted if the provided context is
  20892. // canceled.
  20893. func (c *VideosUpdateCall) Context(ctx context.Context) *VideosUpdateCall {
  20894. c.ctx_ = ctx
  20895. return c
  20896. }
  20897. // Header returns an http.Header that can be modified by the caller to
  20898. // add HTTP headers to the request.
  20899. func (c *VideosUpdateCall) Header() http.Header {
  20900. if c.header_ == nil {
  20901. c.header_ = make(http.Header)
  20902. }
  20903. return c.header_
  20904. }
  20905. func (c *VideosUpdateCall) doRequest(alt string) (*http.Response, error) {
  20906. reqHeaders := make(http.Header)
  20907. for k, v := range c.header_ {
  20908. reqHeaders[k] = v
  20909. }
  20910. reqHeaders.Set("User-Agent", c.s.userAgent())
  20911. var body io.Reader = nil
  20912. body, err := googleapi.WithoutDataWrapper.JSONReader(c.video)
  20913. if err != nil {
  20914. return nil, err
  20915. }
  20916. reqHeaders.Set("Content-Type", "application/json")
  20917. c.urlParams_.Set("alt", alt)
  20918. c.urlParams_.Set("prettyPrint", "false")
  20919. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  20920. urls += "?" + c.urlParams_.Encode()
  20921. req, err := http.NewRequest("PUT", urls, body)
  20922. if err != nil {
  20923. return nil, err
  20924. }
  20925. req.Header = reqHeaders
  20926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20927. }
  20928. // Do executes the "youtube.videos.update" call.
  20929. // Exactly one of *Video or error will be non-nil. Any non-2xx status
  20930. // code is an error. Response headers are in either
  20931. // *Video.ServerResponse.Header or (if a response was returned at all)
  20932. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  20933. // check whether the returned error was because http.StatusNotModified
  20934. // was returned.
  20935. func (c *VideosUpdateCall) Do(opts ...googleapi.CallOption) (*Video, error) {
  20936. gensupport.SetOptions(c.urlParams_, opts...)
  20937. res, err := c.doRequest("json")
  20938. if res != nil && res.StatusCode == http.StatusNotModified {
  20939. if res.Body != nil {
  20940. res.Body.Close()
  20941. }
  20942. return nil, &googleapi.Error{
  20943. Code: res.StatusCode,
  20944. Header: res.Header,
  20945. }
  20946. }
  20947. if err != nil {
  20948. return nil, err
  20949. }
  20950. defer googleapi.CloseBody(res)
  20951. if err := googleapi.CheckResponse(res); err != nil {
  20952. return nil, err
  20953. }
  20954. ret := &Video{
  20955. ServerResponse: googleapi.ServerResponse{
  20956. Header: res.Header,
  20957. HTTPStatusCode: res.StatusCode,
  20958. },
  20959. }
  20960. target := &ret
  20961. if err := gensupport.DecodeResponse(target, res); err != nil {
  20962. return nil, err
  20963. }
  20964. return ret, nil
  20965. // {
  20966. // "description": "Updates a video's metadata.",
  20967. // "httpMethod": "PUT",
  20968. // "id": "youtube.videos.update",
  20969. // "parameterOrder": [
  20970. // "part"
  20971. // ],
  20972. // "parameters": {
  20973. // "onBehalfOfContentOwner": {
  20974. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The actual CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  20975. // "location": "query",
  20976. // "type": "string"
  20977. // },
  20978. // "part": {
  20979. // "description": "The part parameter serves two purposes in this operation. It identifies the properties that the write operation will set as well as the properties that the API response will include.\n\nNote that this method will override the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies. For example, a video's privacy setting is contained in the status part. As such, if your request is updating a private video, and the request's part parameter value includes the status part, the video's privacy setting will be updated to whatever value the request body specifies. If the request body does not specify a value, the existing privacy setting will be removed and the video will revert to the default privacy setting.\n\nIn addition, not all parts contain properties that can be set when inserting or updating a video. For example, the statistics object encapsulates statistics that YouTube calculates for a video and does not contain values that you can set or modify. If the parameter value specifies a part that does not contain mutable values, that part will still be included in the API response.",
  20980. // "location": "query",
  20981. // "required": true,
  20982. // "type": "string"
  20983. // }
  20984. // },
  20985. // "path": "videos",
  20986. // "request": {
  20987. // "$ref": "Video"
  20988. // },
  20989. // "response": {
  20990. // "$ref": "Video"
  20991. // },
  20992. // "scopes": [
  20993. // "https://www.googleapis.com/auth/youtube",
  20994. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20995. // "https://www.googleapis.com/auth/youtubepartner"
  20996. // ]
  20997. // }
  20998. }
  20999. // method id "youtube.watermarks.set":
  21000. type WatermarksSetCall struct {
  21001. s *Service
  21002. invideobranding *InvideoBranding
  21003. urlParams_ gensupport.URLParams
  21004. mediaInfo_ *gensupport.MediaInfo
  21005. ctx_ context.Context
  21006. header_ http.Header
  21007. }
  21008. // Set: Uploads a watermark image to YouTube and sets it for a channel.
  21009. func (r *WatermarksService) Set(channelId string, invideobranding *InvideoBranding) *WatermarksSetCall {
  21010. c := &WatermarksSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21011. c.urlParams_.Set("channelId", channelId)
  21012. c.invideobranding = invideobranding
  21013. return c
  21014. }
  21015. // OnBehalfOfContentOwner sets the optional parameter
  21016. // "onBehalfOfContentOwner": Note: This parameter is intended
  21017. // exclusively for YouTube content partners.
  21018. //
  21019. // The onBehalfOfContentOwner parameter indicates that the request's
  21020. // authorization credentials identify a YouTube CMS user who is acting
  21021. // on behalf of the content owner specified in the parameter value. This
  21022. // parameter is intended for YouTube content partners that own and
  21023. // manage many different YouTube channels. It allows content owners to
  21024. // authenticate once and get access to all their video and channel data,
  21025. // without having to provide authentication credentials for each
  21026. // individual channel. The CMS account that the user authenticates with
  21027. // must be linked to the specified YouTube content owner.
  21028. func (c *WatermarksSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksSetCall {
  21029. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  21030. return c
  21031. }
  21032. // Media specifies the media to upload in one or more chunks. The chunk
  21033. // size may be controlled by supplying a MediaOption generated by
  21034. // googleapi.ChunkSize. The chunk size defaults to
  21035. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21036. // upload request will be determined by sniffing the contents of r,
  21037. // unless a MediaOption generated by googleapi.ContentType is
  21038. // supplied.
  21039. // At most one of Media and ResumableMedia may be set.
  21040. func (c *WatermarksSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *WatermarksSetCall {
  21041. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21042. return c
  21043. }
  21044. // ResumableMedia specifies the media to upload in chunks and can be
  21045. // canceled with ctx.
  21046. //
  21047. // Deprecated: use Media instead.
  21048. //
  21049. // At most one of Media and ResumableMedia may be set. mediaType
  21050. // identifies the MIME media type of the upload, such as "image/png". If
  21051. // mediaType is "", it will be auto-detected. The provided ctx will
  21052. // supersede any context previously provided to the Context method.
  21053. func (c *WatermarksSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *WatermarksSetCall {
  21054. c.ctx_ = ctx
  21055. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21056. return c
  21057. }
  21058. // ProgressUpdater provides a callback function that will be called
  21059. // after every chunk. It should be a low-latency function in order to
  21060. // not slow down the upload operation. This should only be called when
  21061. // using ResumableMedia (as opposed to Media).
  21062. func (c *WatermarksSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *WatermarksSetCall {
  21063. c.mediaInfo_.SetProgressUpdater(pu)
  21064. return c
  21065. }
  21066. // Fields allows partial responses to be retrieved. See
  21067. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21068. // for more information.
  21069. func (c *WatermarksSetCall) Fields(s ...googleapi.Field) *WatermarksSetCall {
  21070. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21071. return c
  21072. }
  21073. // Context sets the context to be used in this call's Do method. Any
  21074. // pending HTTP request will be aborted if the provided context is
  21075. // canceled.
  21076. // This context will supersede any context previously provided to the
  21077. // ResumableMedia method.
  21078. func (c *WatermarksSetCall) Context(ctx context.Context) *WatermarksSetCall {
  21079. c.ctx_ = ctx
  21080. return c
  21081. }
  21082. // Header returns an http.Header that can be modified by the caller to
  21083. // add HTTP headers to the request.
  21084. func (c *WatermarksSetCall) Header() http.Header {
  21085. if c.header_ == nil {
  21086. c.header_ = make(http.Header)
  21087. }
  21088. return c.header_
  21089. }
  21090. func (c *WatermarksSetCall) doRequest(alt string) (*http.Response, error) {
  21091. reqHeaders := make(http.Header)
  21092. for k, v := range c.header_ {
  21093. reqHeaders[k] = v
  21094. }
  21095. reqHeaders.Set("User-Agent", c.s.userAgent())
  21096. var body io.Reader = nil
  21097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.invideobranding)
  21098. if err != nil {
  21099. return nil, err
  21100. }
  21101. reqHeaders.Set("Content-Type", "application/json")
  21102. c.urlParams_.Set("alt", alt)
  21103. c.urlParams_.Set("prettyPrint", "false")
  21104. urls := googleapi.ResolveRelative(c.s.BasePath, "watermarks/set")
  21105. if c.mediaInfo_ != nil {
  21106. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21107. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21108. }
  21109. if body == nil {
  21110. body = new(bytes.Buffer)
  21111. reqHeaders.Set("Content-Type", "application/json")
  21112. }
  21113. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21114. defer cleanup()
  21115. urls += "?" + c.urlParams_.Encode()
  21116. req, err := http.NewRequest("POST", urls, body)
  21117. if err != nil {
  21118. return nil, err
  21119. }
  21120. req.Header = reqHeaders
  21121. req.GetBody = getBody
  21122. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21123. }
  21124. // Do executes the "youtube.watermarks.set" call.
  21125. func (c *WatermarksSetCall) Do(opts ...googleapi.CallOption) error {
  21126. gensupport.SetOptions(c.urlParams_, opts...)
  21127. res, err := c.doRequest("json")
  21128. if err != nil {
  21129. return err
  21130. }
  21131. defer googleapi.CloseBody(res)
  21132. if err := googleapi.CheckResponse(res); err != nil {
  21133. return err
  21134. }
  21135. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21136. if rx != nil {
  21137. rx.Client = c.s.client
  21138. rx.UserAgent = c.s.userAgent()
  21139. ctx := c.ctx_
  21140. if ctx == nil {
  21141. ctx = context.TODO()
  21142. }
  21143. res, err = rx.Upload(ctx)
  21144. if err != nil {
  21145. return err
  21146. }
  21147. defer res.Body.Close()
  21148. if err := googleapi.CheckResponse(res); err != nil {
  21149. return err
  21150. }
  21151. }
  21152. return nil
  21153. // {
  21154. // "description": "Uploads a watermark image to YouTube and sets it for a channel.",
  21155. // "httpMethod": "POST",
  21156. // "id": "youtube.watermarks.set",
  21157. // "mediaUpload": {
  21158. // "accept": [
  21159. // "application/octet-stream",
  21160. // "image/jpeg",
  21161. // "image/png"
  21162. // ],
  21163. // "maxSize": "10MB",
  21164. // "protocols": {
  21165. // "resumable": {
  21166. // "multipart": true,
  21167. // "path": "/resumable/upload/youtube/v3/watermarks/set"
  21168. // },
  21169. // "simple": {
  21170. // "multipart": true,
  21171. // "path": "/upload/youtube/v3/watermarks/set"
  21172. // }
  21173. // }
  21174. // },
  21175. // "parameterOrder": [
  21176. // "channelId"
  21177. // ],
  21178. // "parameters": {
  21179. // "channelId": {
  21180. // "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being provided.",
  21181. // "location": "query",
  21182. // "required": true,
  21183. // "type": "string"
  21184. // },
  21185. // "onBehalfOfContentOwner": {
  21186. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  21187. // "location": "query",
  21188. // "type": "string"
  21189. // }
  21190. // },
  21191. // "path": "watermarks/set",
  21192. // "request": {
  21193. // "$ref": "InvideoBranding"
  21194. // },
  21195. // "scopes": [
  21196. // "https://www.googleapis.com/auth/youtube",
  21197. // "https://www.googleapis.com/auth/youtube.force-ssl",
  21198. // "https://www.googleapis.com/auth/youtube.upload",
  21199. // "https://www.googleapis.com/auth/youtubepartner"
  21200. // ],
  21201. // "supportsMediaUpload": true
  21202. // }
  21203. }
  21204. // method id "youtube.watermarks.unset":
  21205. type WatermarksUnsetCall struct {
  21206. s *Service
  21207. urlParams_ gensupport.URLParams
  21208. ctx_ context.Context
  21209. header_ http.Header
  21210. }
  21211. // Unset: Deletes a channel's watermark image.
  21212. func (r *WatermarksService) Unset(channelId string) *WatermarksUnsetCall {
  21213. c := &WatermarksUnsetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21214. c.urlParams_.Set("channelId", channelId)
  21215. return c
  21216. }
  21217. // OnBehalfOfContentOwner sets the optional parameter
  21218. // "onBehalfOfContentOwner": Note: This parameter is intended
  21219. // exclusively for YouTube content partners.
  21220. //
  21221. // The onBehalfOfContentOwner parameter indicates that the request's
  21222. // authorization credentials identify a YouTube CMS user who is acting
  21223. // on behalf of the content owner specified in the parameter value. This
  21224. // parameter is intended for YouTube content partners that own and
  21225. // manage many different YouTube channels. It allows content owners to
  21226. // authenticate once and get access to all their video and channel data,
  21227. // without having to provide authentication credentials for each
  21228. // individual channel. The CMS account that the user authenticates with
  21229. // must be linked to the specified YouTube content owner.
  21230. func (c *WatermarksUnsetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksUnsetCall {
  21231. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  21232. return c
  21233. }
  21234. // Fields allows partial responses to be retrieved. See
  21235. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21236. // for more information.
  21237. func (c *WatermarksUnsetCall) Fields(s ...googleapi.Field) *WatermarksUnsetCall {
  21238. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21239. return c
  21240. }
  21241. // Context sets the context to be used in this call's Do method. Any
  21242. // pending HTTP request will be aborted if the provided context is
  21243. // canceled.
  21244. func (c *WatermarksUnsetCall) Context(ctx context.Context) *WatermarksUnsetCall {
  21245. c.ctx_ = ctx
  21246. return c
  21247. }
  21248. // Header returns an http.Header that can be modified by the caller to
  21249. // add HTTP headers to the request.
  21250. func (c *WatermarksUnsetCall) Header() http.Header {
  21251. if c.header_ == nil {
  21252. c.header_ = make(http.Header)
  21253. }
  21254. return c.header_
  21255. }
  21256. func (c *WatermarksUnsetCall) doRequest(alt string) (*http.Response, error) {
  21257. reqHeaders := make(http.Header)
  21258. for k, v := range c.header_ {
  21259. reqHeaders[k] = v
  21260. }
  21261. reqHeaders.Set("User-Agent", c.s.userAgent())
  21262. var body io.Reader = nil
  21263. c.urlParams_.Set("alt", alt)
  21264. c.urlParams_.Set("prettyPrint", "false")
  21265. urls := googleapi.ResolveRelative(c.s.BasePath, "watermarks/unset")
  21266. urls += "?" + c.urlParams_.Encode()
  21267. req, err := http.NewRequest("POST", urls, body)
  21268. if err != nil {
  21269. return nil, err
  21270. }
  21271. req.Header = reqHeaders
  21272. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21273. }
  21274. // Do executes the "youtube.watermarks.unset" call.
  21275. func (c *WatermarksUnsetCall) Do(opts ...googleapi.CallOption) error {
  21276. gensupport.SetOptions(c.urlParams_, opts...)
  21277. res, err := c.doRequest("json")
  21278. if err != nil {
  21279. return err
  21280. }
  21281. defer googleapi.CloseBody(res)
  21282. if err := googleapi.CheckResponse(res); err != nil {
  21283. return err
  21284. }
  21285. return nil
  21286. // {
  21287. // "description": "Deletes a channel's watermark image.",
  21288. // "httpMethod": "POST",
  21289. // "id": "youtube.watermarks.unset",
  21290. // "parameterOrder": [
  21291. // "channelId"
  21292. // ],
  21293. // "parameters": {
  21294. // "channelId": {
  21295. // "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.",
  21296. // "location": "query",
  21297. // "required": true,
  21298. // "type": "string"
  21299. // },
  21300. // "onBehalfOfContentOwner": {
  21301. // "description": "Note: This parameter is intended exclusively for YouTube content partners.\n\nThe onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner.",
  21302. // "location": "query",
  21303. // "type": "string"
  21304. // }
  21305. // },
  21306. // "path": "watermarks/unset",
  21307. // "scopes": [
  21308. // "https://www.googleapis.com/auth/youtube",
  21309. // "https://www.googleapis.com/auth/youtube.force-ssl",
  21310. // "https://www.googleapis.com/auth/youtubepartner"
  21311. // ]
  21312. // }
  21313. }