25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

23347 lines
922 KiB

  1. // Package youtube provides access to the YouTube Data API.
  2. //
  3. // See https://developers.google.com/youtube/v3
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/youtube/v3"
  8. // ...
  9. // youtubeService, err := youtube.New(oauthHttpClient)
  10. package youtube // import "google.golang.org/api/youtube/v3"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "youtube:v3"
  41. const apiName = "youtube"
  42. const apiVersion = "v3"
  43. const basePath = "https://www.googleapis.com/youtube/v3/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your YouTube account
  47. YoutubeScope = "https://www.googleapis.com/auth/youtube"
  48. // Manage your YouTube account
  49. YoutubeForceSslScope = "https://www.googleapis.com/auth/youtube.force-ssl"
  50. // View your YouTube account
  51. YoutubeReadonlyScope = "https://www.googleapis.com/auth/youtube.readonly"
  52. // Manage your YouTube videos
  53. YoutubeUploadScope = "https://www.googleapis.com/auth/youtube.upload"
  54. // View and manage your assets and associated content on YouTube
  55. YoutubepartnerScope = "https://www.googleapis.com/auth/youtubepartner"
  56. // View private information of your YouTube channel relevant during the
  57. // audit process with a YouTube partner
  58. YoutubepartnerChannelAuditScope = "https://www.googleapis.com/auth/youtubepartner-channel-audit"
  59. )
  60. func New(client *http.Client) (*Service, error) {
  61. if client == nil {
  62. return nil, errors.New("client is nil")
  63. }
  64. s := &Service{client: client, BasePath: basePath}
  65. s.Activities = NewActivitiesService(s)
  66. s.Captions = NewCaptionsService(s)
  67. s.ChannelBanners = NewChannelBannersService(s)
  68. s.ChannelSections = NewChannelSectionsService(s)
  69. s.Channels = NewChannelsService(s)
  70. s.CommentThreads = NewCommentThreadsService(s)
  71. s.Comments = NewCommentsService(s)
  72. s.GuideCategories = NewGuideCategoriesService(s)
  73. s.I18nLanguages = NewI18nLanguagesService(s)
  74. s.I18nRegions = NewI18nRegionsService(s)
  75. s.LiveBroadcasts = NewLiveBroadcastsService(s)
  76. s.LiveChatBans = NewLiveChatBansService(s)
  77. s.LiveChatMessages = NewLiveChatMessagesService(s)
  78. s.LiveChatModerators = NewLiveChatModeratorsService(s)
  79. s.LiveStreams = NewLiveStreamsService(s)
  80. s.PlaylistItems = NewPlaylistItemsService(s)
  81. s.Playlists = NewPlaylistsService(s)
  82. s.Search = NewSearchService(s)
  83. s.Sponsors = NewSponsorsService(s)
  84. s.Subscriptions = NewSubscriptionsService(s)
  85. s.SuperChatEvents = NewSuperChatEventsService(s)
  86. s.Thumbnails = NewThumbnailsService(s)
  87. s.VideoAbuseReportReasons = NewVideoAbuseReportReasonsService(s)
  88. s.VideoCategories = NewVideoCategoriesService(s)
  89. s.Videos = NewVideosService(s)
  90. s.Watermarks = NewWatermarksService(s)
  91. return s, nil
  92. }
  93. type Service struct {
  94. client *http.Client
  95. BasePath string // API endpoint base URL
  96. UserAgent string // optional additional User-Agent fragment
  97. Activities *ActivitiesService
  98. Captions *CaptionsService
  99. ChannelBanners *ChannelBannersService
  100. ChannelSections *ChannelSectionsService
  101. Channels *ChannelsService
  102. CommentThreads *CommentThreadsService
  103. Comments *CommentsService
  104. GuideCategories *GuideCategoriesService
  105. I18nLanguages *I18nLanguagesService
  106. I18nRegions *I18nRegionsService
  107. LiveBroadcasts *LiveBroadcastsService
  108. LiveChatBans *LiveChatBansService
  109. LiveChatMessages *LiveChatMessagesService
  110. LiveChatModerators *LiveChatModeratorsService
  111. LiveStreams *LiveStreamsService
  112. PlaylistItems *PlaylistItemsService
  113. Playlists *PlaylistsService
  114. Search *SearchService
  115. Sponsors *SponsorsService
  116. Subscriptions *SubscriptionsService
  117. SuperChatEvents *SuperChatEventsService
  118. Thumbnails *ThumbnailsService
  119. VideoAbuseReportReasons *VideoAbuseReportReasonsService
  120. VideoCategories *VideoCategoriesService
  121. Videos *VideosService
  122. Watermarks *WatermarksService
  123. }
  124. func (s *Service) userAgent() string {
  125. if s.UserAgent == "" {
  126. return googleapi.UserAgent
  127. }
  128. return googleapi.UserAgent + " " + s.UserAgent
  129. }
  130. func NewActivitiesService(s *Service) *ActivitiesService {
  131. rs := &ActivitiesService{s: s}
  132. return rs
  133. }
  134. type ActivitiesService struct {
  135. s *Service
  136. }
  137. func NewCaptionsService(s *Service) *CaptionsService {
  138. rs := &CaptionsService{s: s}
  139. return rs
  140. }
  141. type CaptionsService struct {
  142. s *Service
  143. }
  144. func NewChannelBannersService(s *Service) *ChannelBannersService {
  145. rs := &ChannelBannersService{s: s}
  146. return rs
  147. }
  148. type ChannelBannersService struct {
  149. s *Service
  150. }
  151. func NewChannelSectionsService(s *Service) *ChannelSectionsService {
  152. rs := &ChannelSectionsService{s: s}
  153. return rs
  154. }
  155. type ChannelSectionsService struct {
  156. s *Service
  157. }
  158. func NewChannelsService(s *Service) *ChannelsService {
  159. rs := &ChannelsService{s: s}
  160. return rs
  161. }
  162. type ChannelsService struct {
  163. s *Service
  164. }
  165. func NewCommentThreadsService(s *Service) *CommentThreadsService {
  166. rs := &CommentThreadsService{s: s}
  167. return rs
  168. }
  169. type CommentThreadsService struct {
  170. s *Service
  171. }
  172. func NewCommentsService(s *Service) *CommentsService {
  173. rs := &CommentsService{s: s}
  174. return rs
  175. }
  176. type CommentsService struct {
  177. s *Service
  178. }
  179. func NewGuideCategoriesService(s *Service) *GuideCategoriesService {
  180. rs := &GuideCategoriesService{s: s}
  181. return rs
  182. }
  183. type GuideCategoriesService struct {
  184. s *Service
  185. }
  186. func NewI18nLanguagesService(s *Service) *I18nLanguagesService {
  187. rs := &I18nLanguagesService{s: s}
  188. return rs
  189. }
  190. type I18nLanguagesService struct {
  191. s *Service
  192. }
  193. func NewI18nRegionsService(s *Service) *I18nRegionsService {
  194. rs := &I18nRegionsService{s: s}
  195. return rs
  196. }
  197. type I18nRegionsService struct {
  198. s *Service
  199. }
  200. func NewLiveBroadcastsService(s *Service) *LiveBroadcastsService {
  201. rs := &LiveBroadcastsService{s: s}
  202. return rs
  203. }
  204. type LiveBroadcastsService struct {
  205. s *Service
  206. }
  207. func NewLiveChatBansService(s *Service) *LiveChatBansService {
  208. rs := &LiveChatBansService{s: s}
  209. return rs
  210. }
  211. type LiveChatBansService struct {
  212. s *Service
  213. }
  214. func NewLiveChatMessagesService(s *Service) *LiveChatMessagesService {
  215. rs := &LiveChatMessagesService{s: s}
  216. return rs
  217. }
  218. type LiveChatMessagesService struct {
  219. s *Service
  220. }
  221. func NewLiveChatModeratorsService(s *Service) *LiveChatModeratorsService {
  222. rs := &LiveChatModeratorsService{s: s}
  223. return rs
  224. }
  225. type LiveChatModeratorsService struct {
  226. s *Service
  227. }
  228. func NewLiveStreamsService(s *Service) *LiveStreamsService {
  229. rs := &LiveStreamsService{s: s}
  230. return rs
  231. }
  232. type LiveStreamsService struct {
  233. s *Service
  234. }
  235. func NewPlaylistItemsService(s *Service) *PlaylistItemsService {
  236. rs := &PlaylistItemsService{s: s}
  237. return rs
  238. }
  239. type PlaylistItemsService struct {
  240. s *Service
  241. }
  242. func NewPlaylistsService(s *Service) *PlaylistsService {
  243. rs := &PlaylistsService{s: s}
  244. return rs
  245. }
  246. type PlaylistsService struct {
  247. s *Service
  248. }
  249. func NewSearchService(s *Service) *SearchService {
  250. rs := &SearchService{s: s}
  251. return rs
  252. }
  253. type SearchService struct {
  254. s *Service
  255. }
  256. func NewSponsorsService(s *Service) *SponsorsService {
  257. rs := &SponsorsService{s: s}
  258. return rs
  259. }
  260. type SponsorsService struct {
  261. s *Service
  262. }
  263. func NewSubscriptionsService(s *Service) *SubscriptionsService {
  264. rs := &SubscriptionsService{s: s}
  265. return rs
  266. }
  267. type SubscriptionsService struct {
  268. s *Service
  269. }
  270. func NewSuperChatEventsService(s *Service) *SuperChatEventsService {
  271. rs := &SuperChatEventsService{s: s}
  272. return rs
  273. }
  274. type SuperChatEventsService struct {
  275. s *Service
  276. }
  277. func NewThumbnailsService(s *Service) *ThumbnailsService {
  278. rs := &ThumbnailsService{s: s}
  279. return rs
  280. }
  281. type ThumbnailsService struct {
  282. s *Service
  283. }
  284. func NewVideoAbuseReportReasonsService(s *Service) *VideoAbuseReportReasonsService {
  285. rs := &VideoAbuseReportReasonsService{s: s}
  286. return rs
  287. }
  288. type VideoAbuseReportReasonsService struct {
  289. s *Service
  290. }
  291. func NewVideoCategoriesService(s *Service) *VideoCategoriesService {
  292. rs := &VideoCategoriesService{s: s}
  293. return rs
  294. }
  295. type VideoCategoriesService struct {
  296. s *Service
  297. }
  298. func NewVideosService(s *Service) *VideosService {
  299. rs := &VideosService{s: s}
  300. return rs
  301. }
  302. type VideosService struct {
  303. s *Service
  304. }
  305. func NewWatermarksService(s *Service) *WatermarksService {
  306. rs := &WatermarksService{s: s}
  307. return rs
  308. }
  309. type WatermarksService struct {
  310. s *Service
  311. }
  312. // AccessPolicy: Rights management policy for YouTube resources.
  313. type AccessPolicy struct {
  314. // Allowed: The value of allowed indicates whether the access to the
  315. // policy is allowed or denied by default.
  316. Allowed bool `json:"allowed,omitempty"`
  317. // Exception: A list of region codes that identify countries where the
  318. // default policy do not apply.
  319. Exception []string `json:"exception,omitempty"`
  320. // ForceSendFields is a list of field names (e.g. "Allowed") to
  321. // unconditionally include in API requests. By default, fields with
  322. // empty values are omitted from API requests. However, any non-pointer,
  323. // non-interface field appearing in ForceSendFields will be sent to the
  324. // server regardless of whether the field is empty or not. This may be
  325. // used to include empty fields in Patch requests.
  326. ForceSendFields []string `json:"-"`
  327. // NullFields is a list of field names (e.g. "Allowed") to include in
  328. // API requests with the JSON null value. By default, fields with empty
  329. // values are omitted from API requests. However, any field with an
  330. // empty value appearing in NullFields will be sent to the server as
  331. // null. It is an error if a field in this list has a non-empty value.
  332. // This may be used to include null fields in Patch requests.
  333. NullFields []string `json:"-"`
  334. }
  335. func (s *AccessPolicy) MarshalJSON() ([]byte, error) {
  336. type NoMethod AccessPolicy
  337. raw := NoMethod(*s)
  338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  339. }
  340. // Activity: An activity resource contains information about an action
  341. // that a particular channel, or user, has taken on YouTube.The actions
  342. // reported in activity feeds include rating a video, sharing a video,
  343. // marking a video as a favorite, commenting on a video, uploading a
  344. // video, and so forth. Each activity resource identifies the type of
  345. // action, the channel associated with the action, and the resource(s)
  346. // associated with the action, such as the video that was rated or
  347. // uploaded.
  348. type Activity struct {
  349. // ContentDetails: The contentDetails object contains information about
  350. // the content associated with the activity. For example, if the
  351. // snippet.type value is videoRated, then the contentDetails object's
  352. // content identifies the rated video.
  353. ContentDetails *ActivityContentDetails `json:"contentDetails,omitempty"`
  354. // Etag: Etag of this resource.
  355. Etag string `json:"etag,omitempty"`
  356. // Id: The ID that YouTube uses to uniquely identify the activity.
  357. Id string `json:"id,omitempty"`
  358. // Kind: Identifies what kind of resource this is. Value: the fixed
  359. // string "youtube#activity".
  360. Kind string `json:"kind,omitempty"`
  361. // Snippet: The snippet object contains basic details about the
  362. // activity, including the activity's type and group ID.
  363. Snippet *ActivitySnippet `json:"snippet,omitempty"`
  364. // ServerResponse contains the HTTP response code and headers from the
  365. // server.
  366. googleapi.ServerResponse `json:"-"`
  367. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  368. // unconditionally include in API requests. By default, fields with
  369. // empty values are omitted from API requests. However, any non-pointer,
  370. // non-interface field appearing in ForceSendFields will be sent to the
  371. // server regardless of whether the field is empty or not. This may be
  372. // used to include empty fields in Patch requests.
  373. ForceSendFields []string `json:"-"`
  374. // NullFields is a list of field names (e.g. "ContentDetails") to
  375. // include in API requests with the JSON null value. By default, fields
  376. // with empty values are omitted from API requests. However, any field
  377. // with an empty value appearing in NullFields will be sent to the
  378. // server as null. It is an error if a field in this list has a
  379. // non-empty value. This may be used to include null fields in Patch
  380. // requests.
  381. NullFields []string `json:"-"`
  382. }
  383. func (s *Activity) MarshalJSON() ([]byte, error) {
  384. type NoMethod Activity
  385. raw := NoMethod(*s)
  386. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  387. }
  388. // ActivityContentDetails: Details about the content of an activity: the
  389. // video that was shared, the channel that was subscribed to, etc.
  390. type ActivityContentDetails struct {
  391. // Bulletin: The bulletin object contains details about a channel
  392. // bulletin post. This object is only present if the snippet.type is
  393. // bulletin.
  394. Bulletin *ActivityContentDetailsBulletin `json:"bulletin,omitempty"`
  395. // ChannelItem: The channelItem object contains details about a resource
  396. // which was added to a channel. This property is only present if the
  397. // snippet.type is channelItem.
  398. ChannelItem *ActivityContentDetailsChannelItem `json:"channelItem,omitempty"`
  399. // Comment: The comment object contains information about a resource
  400. // that received a comment. This property is only present if the
  401. // snippet.type is comment.
  402. Comment *ActivityContentDetailsComment `json:"comment,omitempty"`
  403. // Favorite: The favorite object contains information about a video that
  404. // was marked as a favorite video. This property is only present if the
  405. // snippet.type is favorite.
  406. Favorite *ActivityContentDetailsFavorite `json:"favorite,omitempty"`
  407. // Like: The like object contains information about a resource that
  408. // received a positive (like) rating. This property is only present if
  409. // the snippet.type is like.
  410. Like *ActivityContentDetailsLike `json:"like,omitempty"`
  411. // PlaylistItem: The playlistItem object contains information about a
  412. // new playlist item. This property is only present if the snippet.type
  413. // is playlistItem.
  414. PlaylistItem *ActivityContentDetailsPlaylistItem `json:"playlistItem,omitempty"`
  415. // PromotedItem: The promotedItem object contains details about a
  416. // resource which is being promoted. This property is only present if
  417. // the snippet.type is promotedItem.
  418. PromotedItem *ActivityContentDetailsPromotedItem `json:"promotedItem,omitempty"`
  419. // Recommendation: The recommendation object contains information about
  420. // a recommended resource. This property is only present if the
  421. // snippet.type is recommendation.
  422. Recommendation *ActivityContentDetailsRecommendation `json:"recommendation,omitempty"`
  423. // Social: The social object contains details about a social network
  424. // post. This property is only present if the snippet.type is social.
  425. Social *ActivityContentDetailsSocial `json:"social,omitempty"`
  426. // Subscription: The subscription object contains information about a
  427. // channel that a user subscribed to. This property is only present if
  428. // the snippet.type is subscription.
  429. Subscription *ActivityContentDetailsSubscription `json:"subscription,omitempty"`
  430. // Upload: The upload object contains information about the uploaded
  431. // video. This property is only present if the snippet.type is upload.
  432. Upload *ActivityContentDetailsUpload `json:"upload,omitempty"`
  433. // ForceSendFields is a list of field names (e.g. "Bulletin") to
  434. // unconditionally include in API requests. By default, fields with
  435. // empty values are omitted from API requests. However, any non-pointer,
  436. // non-interface field appearing in ForceSendFields will be sent to the
  437. // server regardless of whether the field is empty or not. This may be
  438. // used to include empty fields in Patch requests.
  439. ForceSendFields []string `json:"-"`
  440. // NullFields is a list of field names (e.g. "Bulletin") to include in
  441. // API requests with the JSON null value. By default, fields with empty
  442. // values are omitted from API requests. However, any field with an
  443. // empty value appearing in NullFields will be sent to the server as
  444. // null. It is an error if a field in this list has a non-empty value.
  445. // This may be used to include null fields in Patch requests.
  446. NullFields []string `json:"-"`
  447. }
  448. func (s *ActivityContentDetails) MarshalJSON() ([]byte, error) {
  449. type NoMethod ActivityContentDetails
  450. raw := NoMethod(*s)
  451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  452. }
  453. // ActivityContentDetailsBulletin: Details about a channel bulletin
  454. // post.
  455. type ActivityContentDetailsBulletin struct {
  456. // ResourceId: The resourceId object contains information that
  457. // identifies the resource associated with a bulletin post.
  458. ResourceId *ResourceId `json:"resourceId,omitempty"`
  459. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  460. // unconditionally include in API requests. By default, fields with
  461. // empty values are omitted from API requests. However, any non-pointer,
  462. // non-interface field appearing in ForceSendFields will be sent to the
  463. // server regardless of whether the field is empty or not. This may be
  464. // used to include empty fields in Patch requests.
  465. ForceSendFields []string `json:"-"`
  466. // NullFields is a list of field names (e.g. "ResourceId") to include in
  467. // API requests with the JSON null value. By default, fields with empty
  468. // values are omitted from API requests. However, any field with an
  469. // empty value appearing in NullFields will be sent to the server as
  470. // null. It is an error if a field in this list has a non-empty value.
  471. // This may be used to include null fields in Patch requests.
  472. NullFields []string `json:"-"`
  473. }
  474. func (s *ActivityContentDetailsBulletin) MarshalJSON() ([]byte, error) {
  475. type NoMethod ActivityContentDetailsBulletin
  476. raw := NoMethod(*s)
  477. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  478. }
  479. // ActivityContentDetailsChannelItem: Details about a resource which was
  480. // added to a channel.
  481. type ActivityContentDetailsChannelItem struct {
  482. // ResourceId: The resourceId object contains information that
  483. // identifies the resource that was added to the channel.
  484. ResourceId *ResourceId `json:"resourceId,omitempty"`
  485. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  486. // unconditionally include in API requests. By default, fields with
  487. // empty values are omitted from API requests. However, any non-pointer,
  488. // non-interface field appearing in ForceSendFields will be sent to the
  489. // server regardless of whether the field is empty or not. This may be
  490. // used to include empty fields in Patch requests.
  491. ForceSendFields []string `json:"-"`
  492. // NullFields is a list of field names (e.g. "ResourceId") to include in
  493. // API requests with the JSON null value. By default, fields with empty
  494. // values are omitted from API requests. However, any field with an
  495. // empty value appearing in NullFields will be sent to the server as
  496. // null. It is an error if a field in this list has a non-empty value.
  497. // This may be used to include null fields in Patch requests.
  498. NullFields []string `json:"-"`
  499. }
  500. func (s *ActivityContentDetailsChannelItem) MarshalJSON() ([]byte, error) {
  501. type NoMethod ActivityContentDetailsChannelItem
  502. raw := NoMethod(*s)
  503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  504. }
  505. // ActivityContentDetailsComment: Information about a resource that
  506. // received a comment.
  507. type ActivityContentDetailsComment struct {
  508. // ResourceId: The resourceId object contains information that
  509. // identifies the resource associated with the comment.
  510. ResourceId *ResourceId `json:"resourceId,omitempty"`
  511. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  512. // unconditionally include in API requests. By default, fields with
  513. // empty values are omitted from API requests. However, any non-pointer,
  514. // non-interface field appearing in ForceSendFields will be sent to the
  515. // server regardless of whether the field is empty or not. This may be
  516. // used to include empty fields in Patch requests.
  517. ForceSendFields []string `json:"-"`
  518. // NullFields is a list of field names (e.g. "ResourceId") to include in
  519. // API requests with the JSON null value. By default, fields with empty
  520. // values are omitted from API requests. However, any field with an
  521. // empty value appearing in NullFields will be sent to the server as
  522. // null. It is an error if a field in this list has a non-empty value.
  523. // This may be used to include null fields in Patch requests.
  524. NullFields []string `json:"-"`
  525. }
  526. func (s *ActivityContentDetailsComment) MarshalJSON() ([]byte, error) {
  527. type NoMethod ActivityContentDetailsComment
  528. raw := NoMethod(*s)
  529. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  530. }
  531. // ActivityContentDetailsFavorite: Information about a video that was
  532. // marked as a favorite video.
  533. type ActivityContentDetailsFavorite struct {
  534. // ResourceId: The resourceId object contains information that
  535. // identifies the resource that was marked as a favorite.
  536. ResourceId *ResourceId `json:"resourceId,omitempty"`
  537. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  538. // unconditionally include in API requests. By default, fields with
  539. // empty values are omitted from API requests. However, any non-pointer,
  540. // non-interface field appearing in ForceSendFields will be sent to the
  541. // server regardless of whether the field is empty or not. This may be
  542. // used to include empty fields in Patch requests.
  543. ForceSendFields []string `json:"-"`
  544. // NullFields is a list of field names (e.g. "ResourceId") to include in
  545. // API requests with the JSON null value. By default, fields with empty
  546. // values are omitted from API requests. However, any field with an
  547. // empty value appearing in NullFields will be sent to the server as
  548. // null. It is an error if a field in this list has a non-empty value.
  549. // This may be used to include null fields in Patch requests.
  550. NullFields []string `json:"-"`
  551. }
  552. func (s *ActivityContentDetailsFavorite) MarshalJSON() ([]byte, error) {
  553. type NoMethod ActivityContentDetailsFavorite
  554. raw := NoMethod(*s)
  555. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  556. }
  557. // ActivityContentDetailsLike: Information about a resource that
  558. // received a positive (like) rating.
  559. type ActivityContentDetailsLike struct {
  560. // ResourceId: The resourceId object contains information that
  561. // identifies the rated resource.
  562. ResourceId *ResourceId `json:"resourceId,omitempty"`
  563. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  564. // unconditionally include in API requests. By default, fields with
  565. // empty values are omitted from API requests. However, any non-pointer,
  566. // non-interface field appearing in ForceSendFields will be sent to the
  567. // server regardless of whether the field is empty or not. This may be
  568. // used to include empty fields in Patch requests.
  569. ForceSendFields []string `json:"-"`
  570. // NullFields is a list of field names (e.g. "ResourceId") to include in
  571. // API requests with the JSON null value. By default, fields with empty
  572. // values are omitted from API requests. However, any field with an
  573. // empty value appearing in NullFields will be sent to the server as
  574. // null. It is an error if a field in this list has a non-empty value.
  575. // This may be used to include null fields in Patch requests.
  576. NullFields []string `json:"-"`
  577. }
  578. func (s *ActivityContentDetailsLike) MarshalJSON() ([]byte, error) {
  579. type NoMethod ActivityContentDetailsLike
  580. raw := NoMethod(*s)
  581. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  582. }
  583. // ActivityContentDetailsPlaylistItem: Information about a new playlist
  584. // item.
  585. type ActivityContentDetailsPlaylistItem struct {
  586. // PlaylistId: The value that YouTube uses to uniquely identify the
  587. // playlist.
  588. PlaylistId string `json:"playlistId,omitempty"`
  589. // PlaylistItemId: ID of the item within the playlist.
  590. PlaylistItemId string `json:"playlistItemId,omitempty"`
  591. // ResourceId: The resourceId object contains information about the
  592. // resource that was added to the playlist.
  593. ResourceId *ResourceId `json:"resourceId,omitempty"`
  594. // ForceSendFields is a list of field names (e.g. "PlaylistId") to
  595. // unconditionally include in API requests. By default, fields with
  596. // empty values are omitted from API requests. However, any non-pointer,
  597. // non-interface field appearing in ForceSendFields will be sent to the
  598. // server regardless of whether the field is empty or not. This may be
  599. // used to include empty fields in Patch requests.
  600. ForceSendFields []string `json:"-"`
  601. // NullFields is a list of field names (e.g. "PlaylistId") to include in
  602. // API requests with the JSON null value. By default, fields with empty
  603. // values are omitted from API requests. However, any field with an
  604. // empty value appearing in NullFields will be sent to the server as
  605. // null. It is an error if a field in this list has a non-empty value.
  606. // This may be used to include null fields in Patch requests.
  607. NullFields []string `json:"-"`
  608. }
  609. func (s *ActivityContentDetailsPlaylistItem) MarshalJSON() ([]byte, error) {
  610. type NoMethod ActivityContentDetailsPlaylistItem
  611. raw := NoMethod(*s)
  612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  613. }
  614. // ActivityContentDetailsPromotedItem: Details about a resource which is
  615. // being promoted.
  616. type ActivityContentDetailsPromotedItem struct {
  617. // AdTag: The URL the client should fetch to request a promoted item.
  618. AdTag string `json:"adTag,omitempty"`
  619. // ClickTrackingUrl: The URL the client should ping to indicate that the
  620. // user clicked through on this promoted item.
  621. ClickTrackingUrl string `json:"clickTrackingUrl,omitempty"`
  622. // CreativeViewUrl: The URL the client should ping to indicate that the
  623. // user was shown this promoted item.
  624. CreativeViewUrl string `json:"creativeViewUrl,omitempty"`
  625. // CtaType: The type of call-to-action, a message to the user indicating
  626. // action that can be taken.
  627. //
  628. // Possible values:
  629. // "unspecified"
  630. // "visitAdvertiserSite"
  631. CtaType string `json:"ctaType,omitempty"`
  632. // CustomCtaButtonText: The custom call-to-action button text. If
  633. // specified, it will override the default button text for the cta_type.
  634. CustomCtaButtonText string `json:"customCtaButtonText,omitempty"`
  635. // DescriptionText: The text description to accompany the promoted item.
  636. DescriptionText string `json:"descriptionText,omitempty"`
  637. // DestinationUrl: The URL the client should direct the user to, if the
  638. // user chooses to visit the advertiser's website.
  639. DestinationUrl string `json:"destinationUrl,omitempty"`
  640. // ForecastingUrl: The list of forecasting URLs. The client should ping
  641. // all of these URLs when a promoted item is not available, to indicate
  642. // that a promoted item could have been shown.
  643. ForecastingUrl []string `json:"forecastingUrl,omitempty"`
  644. // ImpressionUrl: The list of impression URLs. The client should ping
  645. // all of these URLs to indicate that the user was shown this promoted
  646. // item.
  647. ImpressionUrl []string `json:"impressionUrl,omitempty"`
  648. // VideoId: The ID that YouTube uses to uniquely identify the promoted
  649. // video.
  650. VideoId string `json:"videoId,omitempty"`
  651. // ForceSendFields is a list of field names (e.g. "AdTag") to
  652. // unconditionally include in API requests. By default, fields with
  653. // empty values are omitted from API requests. However, any non-pointer,
  654. // non-interface field appearing in ForceSendFields will be sent to the
  655. // server regardless of whether the field is empty or not. This may be
  656. // used to include empty fields in Patch requests.
  657. ForceSendFields []string `json:"-"`
  658. // NullFields is a list of field names (e.g. "AdTag") to include in API
  659. // requests with the JSON null value. By default, fields with empty
  660. // values are omitted from API requests. However, any field with an
  661. // empty value appearing in NullFields will be sent to the server as
  662. // null. It is an error if a field in this list has a non-empty value.
  663. // This may be used to include null fields in Patch requests.
  664. NullFields []string `json:"-"`
  665. }
  666. func (s *ActivityContentDetailsPromotedItem) MarshalJSON() ([]byte, error) {
  667. type NoMethod ActivityContentDetailsPromotedItem
  668. raw := NoMethod(*s)
  669. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  670. }
  671. // ActivityContentDetailsRecommendation: Information that identifies the
  672. // recommended resource.
  673. type ActivityContentDetailsRecommendation struct {
  674. // Reason: The reason that the resource is recommended to the user.
  675. //
  676. // Possible values:
  677. // "unspecified"
  678. // "videoFavorited"
  679. // "videoLiked"
  680. // "videoWatched"
  681. Reason string `json:"reason,omitempty"`
  682. // ResourceId: The resourceId object contains information that
  683. // identifies the recommended resource.
  684. ResourceId *ResourceId `json:"resourceId,omitempty"`
  685. // SeedResourceId: The seedResourceId object contains information about
  686. // the resource that caused the recommendation.
  687. SeedResourceId *ResourceId `json:"seedResourceId,omitempty"`
  688. // ForceSendFields is a list of field names (e.g. "Reason") to
  689. // unconditionally include in API requests. By default, fields with
  690. // empty values are omitted from API requests. However, any non-pointer,
  691. // non-interface field appearing in ForceSendFields will be sent to the
  692. // server regardless of whether the field is empty or not. This may be
  693. // used to include empty fields in Patch requests.
  694. ForceSendFields []string `json:"-"`
  695. // NullFields is a list of field names (e.g. "Reason") to include in API
  696. // requests with the JSON null value. By default, fields with empty
  697. // values are omitted from API requests. However, any field with an
  698. // empty value appearing in NullFields will be sent to the server as
  699. // null. It is an error if a field in this list has a non-empty value.
  700. // This may be used to include null fields in Patch requests.
  701. NullFields []string `json:"-"`
  702. }
  703. func (s *ActivityContentDetailsRecommendation) MarshalJSON() ([]byte, error) {
  704. type NoMethod ActivityContentDetailsRecommendation
  705. raw := NoMethod(*s)
  706. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  707. }
  708. // ActivityContentDetailsSocial: Details about a social network post.
  709. type ActivityContentDetailsSocial struct {
  710. // Author: The author of the social network post.
  711. Author string `json:"author,omitempty"`
  712. // ImageUrl: An image of the post's author.
  713. ImageUrl string `json:"imageUrl,omitempty"`
  714. // ReferenceUrl: The URL of the social network post.
  715. ReferenceUrl string `json:"referenceUrl,omitempty"`
  716. // ResourceId: The resourceId object encapsulates information that
  717. // identifies the resource associated with a social network post.
  718. ResourceId *ResourceId `json:"resourceId,omitempty"`
  719. // Type: The name of the social network.
  720. //
  721. // Possible values:
  722. // "facebook"
  723. // "googlePlus"
  724. // "twitter"
  725. // "unspecified"
  726. Type string `json:"type,omitempty"`
  727. // ForceSendFields is a list of field names (e.g. "Author") to
  728. // unconditionally include in API requests. By default, fields with
  729. // empty values are omitted from API requests. However, any non-pointer,
  730. // non-interface field appearing in ForceSendFields will be sent to the
  731. // server regardless of whether the field is empty or not. This may be
  732. // used to include empty fields in Patch requests.
  733. ForceSendFields []string `json:"-"`
  734. // NullFields is a list of field names (e.g. "Author") to include in API
  735. // requests with the JSON null value. By default, fields with empty
  736. // values are omitted from API requests. However, any field with an
  737. // empty value appearing in NullFields will be sent to the server as
  738. // null. It is an error if a field in this list has a non-empty value.
  739. // This may be used to include null fields in Patch requests.
  740. NullFields []string `json:"-"`
  741. }
  742. func (s *ActivityContentDetailsSocial) MarshalJSON() ([]byte, error) {
  743. type NoMethod ActivityContentDetailsSocial
  744. raw := NoMethod(*s)
  745. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  746. }
  747. // ActivityContentDetailsSubscription: Information about a channel that
  748. // a user subscribed to.
  749. type ActivityContentDetailsSubscription struct {
  750. // ResourceId: The resourceId object contains information that
  751. // identifies the resource that the user subscribed to.
  752. ResourceId *ResourceId `json:"resourceId,omitempty"`
  753. // ForceSendFields is a list of field names (e.g. "ResourceId") to
  754. // unconditionally include in API requests. By default, fields with
  755. // empty values are omitted from API requests. However, any non-pointer,
  756. // non-interface field appearing in ForceSendFields will be sent to the
  757. // server regardless of whether the field is empty or not. This may be
  758. // used to include empty fields in Patch requests.
  759. ForceSendFields []string `json:"-"`
  760. // NullFields is a list of field names (e.g. "ResourceId") to include in
  761. // API requests with the JSON null value. By default, fields with empty
  762. // values are omitted from API requests. However, any field with an
  763. // empty value appearing in NullFields will be sent to the server as
  764. // null. It is an error if a field in this list has a non-empty value.
  765. // This may be used to include null fields in Patch requests.
  766. NullFields []string `json:"-"`
  767. }
  768. func (s *ActivityContentDetailsSubscription) MarshalJSON() ([]byte, error) {
  769. type NoMethod ActivityContentDetailsSubscription
  770. raw := NoMethod(*s)
  771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  772. }
  773. // ActivityContentDetailsUpload: Information about the uploaded video.
  774. type ActivityContentDetailsUpload struct {
  775. // VideoId: The ID that YouTube uses to uniquely identify the uploaded
  776. // video.
  777. VideoId string `json:"videoId,omitempty"`
  778. // ForceSendFields is a list of field names (e.g. "VideoId") to
  779. // unconditionally include in API requests. By default, fields with
  780. // empty values are omitted from API requests. However, any non-pointer,
  781. // non-interface field appearing in ForceSendFields will be sent to the
  782. // server regardless of whether the field is empty or not. This may be
  783. // used to include empty fields in Patch requests.
  784. ForceSendFields []string `json:"-"`
  785. // NullFields is a list of field names (e.g. "VideoId") to include in
  786. // API requests with the JSON null value. By default, fields with empty
  787. // values are omitted from API requests. However, any field with an
  788. // empty value appearing in NullFields will be sent to the server as
  789. // null. It is an error if a field in this list has a non-empty value.
  790. // This may be used to include null fields in Patch requests.
  791. NullFields []string `json:"-"`
  792. }
  793. func (s *ActivityContentDetailsUpload) MarshalJSON() ([]byte, error) {
  794. type NoMethod ActivityContentDetailsUpload
  795. raw := NoMethod(*s)
  796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  797. }
  798. type ActivityListResponse struct {
  799. // Etag: Etag of this resource.
  800. Etag string `json:"etag,omitempty"`
  801. // EventId: Serialized EventId of the request which produced this
  802. // response.
  803. EventId string `json:"eventId,omitempty"`
  804. // Items: A list of activities, or events, that match the request
  805. // criteria.
  806. Items []*Activity `json:"items,omitempty"`
  807. // Kind: Identifies what kind of resource this is. Value: the fixed
  808. // string "youtube#activityListResponse".
  809. Kind string `json:"kind,omitempty"`
  810. // NextPageToken: The token that can be used as the value of the
  811. // pageToken parameter to retrieve the next page in the result set.
  812. NextPageToken string `json:"nextPageToken,omitempty"`
  813. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  814. // PrevPageToken: The token that can be used as the value of the
  815. // pageToken parameter to retrieve the previous page in the result set.
  816. PrevPageToken string `json:"prevPageToken,omitempty"`
  817. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  818. // VisitorId: The visitorId identifies the visitor.
  819. VisitorId string `json:"visitorId,omitempty"`
  820. // ServerResponse contains the HTTP response code and headers from the
  821. // server.
  822. googleapi.ServerResponse `json:"-"`
  823. // ForceSendFields is a list of field names (e.g. "Etag") to
  824. // unconditionally include in API requests. By default, fields with
  825. // empty values are omitted from API requests. However, any non-pointer,
  826. // non-interface field appearing in ForceSendFields will be sent to the
  827. // server regardless of whether the field is empty or not. This may be
  828. // used to include empty fields in Patch requests.
  829. ForceSendFields []string `json:"-"`
  830. // NullFields is a list of field names (e.g. "Etag") to include in API
  831. // requests with the JSON null value. By default, fields with empty
  832. // values are omitted from API requests. However, any field with an
  833. // empty value appearing in NullFields will be sent to the server as
  834. // null. It is an error if a field in this list has a non-empty value.
  835. // This may be used to include null fields in Patch requests.
  836. NullFields []string `json:"-"`
  837. }
  838. func (s *ActivityListResponse) MarshalJSON() ([]byte, error) {
  839. type NoMethod ActivityListResponse
  840. raw := NoMethod(*s)
  841. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  842. }
  843. // ActivitySnippet: Basic details about an activity, including title,
  844. // description, thumbnails, activity type and group.
  845. type ActivitySnippet struct {
  846. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  847. // associated with the activity.
  848. ChannelId string `json:"channelId,omitempty"`
  849. // ChannelTitle: Channel title for the channel responsible for this
  850. // activity
  851. ChannelTitle string `json:"channelTitle,omitempty"`
  852. // Description: The description of the resource primarily associated
  853. // with the activity.
  854. Description string `json:"description,omitempty"`
  855. // GroupId: The group ID associated with the activity. A group ID
  856. // identifies user events that are associated with the same user and
  857. // resource. For example, if a user rates a video and marks the same
  858. // video as a favorite, the entries for those events would have the same
  859. // group ID in the user's activity feed. In your user interface, you can
  860. // avoid repetition by grouping events with the same groupId value.
  861. GroupId string `json:"groupId,omitempty"`
  862. // PublishedAt: The date and time that the video was uploaded. The value
  863. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  864. PublishedAt string `json:"publishedAt,omitempty"`
  865. // Thumbnails: A map of thumbnail images associated with the resource
  866. // that is primarily associated with the activity. For each object in
  867. // the map, the key is the name of the thumbnail image, and the value is
  868. // an object that contains other information about the thumbnail.
  869. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  870. // Title: The title of the resource primarily associated with the
  871. // activity.
  872. Title string `json:"title,omitempty"`
  873. // Type: The type of activity that the resource describes.
  874. //
  875. // Possible values:
  876. // "bulletin"
  877. // "channelItem"
  878. // "comment"
  879. // "favorite"
  880. // "like"
  881. // "playlistItem"
  882. // "promotedItem"
  883. // "recommendation"
  884. // "social"
  885. // "subscription"
  886. // "upload"
  887. Type string `json:"type,omitempty"`
  888. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  889. // unconditionally include in API requests. By default, fields with
  890. // empty values are omitted from API requests. However, any non-pointer,
  891. // non-interface field appearing in ForceSendFields will be sent to the
  892. // server regardless of whether the field is empty or not. This may be
  893. // used to include empty fields in Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. // NullFields is a list of field names (e.g. "ChannelId") to include in
  896. // API requests with the JSON null value. By default, fields with empty
  897. // values are omitted from API requests. However, any field with an
  898. // empty value appearing in NullFields will be sent to the server as
  899. // null. It is an error if a field in this list has a non-empty value.
  900. // This may be used to include null fields in Patch requests.
  901. NullFields []string `json:"-"`
  902. }
  903. func (s *ActivitySnippet) MarshalJSON() ([]byte, error) {
  904. type NoMethod ActivitySnippet
  905. raw := NoMethod(*s)
  906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  907. }
  908. // Caption: A caption resource represents a YouTube caption track. A
  909. // caption track is associated with exactly one YouTube video.
  910. type Caption struct {
  911. // Etag: Etag of this resource.
  912. Etag string `json:"etag,omitempty"`
  913. // Id: The ID that YouTube uses to uniquely identify the caption track.
  914. Id string `json:"id,omitempty"`
  915. // Kind: Identifies what kind of resource this is. Value: the fixed
  916. // string "youtube#caption".
  917. Kind string `json:"kind,omitempty"`
  918. // Snippet: The snippet object contains basic details about the caption.
  919. Snippet *CaptionSnippet `json:"snippet,omitempty"`
  920. // ServerResponse contains the HTTP response code and headers from the
  921. // server.
  922. googleapi.ServerResponse `json:"-"`
  923. // ForceSendFields is a list of field names (e.g. "Etag") to
  924. // unconditionally include in API requests. By default, fields with
  925. // empty values are omitted from API requests. However, any non-pointer,
  926. // non-interface field appearing in ForceSendFields will be sent to the
  927. // server regardless of whether the field is empty or not. This may be
  928. // used to include empty fields in Patch requests.
  929. ForceSendFields []string `json:"-"`
  930. // NullFields is a list of field names (e.g. "Etag") to include in API
  931. // requests with the JSON null value. By default, fields with empty
  932. // values are omitted from API requests. However, any field with an
  933. // empty value appearing in NullFields will be sent to the server as
  934. // null. It is an error if a field in this list has a non-empty value.
  935. // This may be used to include null fields in Patch requests.
  936. NullFields []string `json:"-"`
  937. }
  938. func (s *Caption) MarshalJSON() ([]byte, error) {
  939. type NoMethod Caption
  940. raw := NoMethod(*s)
  941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  942. }
  943. type CaptionListResponse struct {
  944. // Etag: Etag of this resource.
  945. Etag string `json:"etag,omitempty"`
  946. // EventId: Serialized EventId of the request which produced this
  947. // response.
  948. EventId string `json:"eventId,omitempty"`
  949. // Items: A list of captions that match the request criteria.
  950. Items []*Caption `json:"items,omitempty"`
  951. // Kind: Identifies what kind of resource this is. Value: the fixed
  952. // string "youtube#captionListResponse".
  953. Kind string `json:"kind,omitempty"`
  954. // VisitorId: The visitorId identifies the visitor.
  955. VisitorId string `json:"visitorId,omitempty"`
  956. // ServerResponse contains the HTTP response code and headers from the
  957. // server.
  958. googleapi.ServerResponse `json:"-"`
  959. // ForceSendFields is a list of field names (e.g. "Etag") to
  960. // unconditionally include in API requests. By default, fields with
  961. // empty values are omitted from API requests. However, any non-pointer,
  962. // non-interface field appearing in ForceSendFields will be sent to the
  963. // server regardless of whether the field is empty or not. This may be
  964. // used to include empty fields in Patch requests.
  965. ForceSendFields []string `json:"-"`
  966. // NullFields is a list of field names (e.g. "Etag") to include in API
  967. // requests with the JSON null value. By default, fields with empty
  968. // values are omitted from API requests. However, any field with an
  969. // empty value appearing in NullFields will be sent to the server as
  970. // null. It is an error if a field in this list has a non-empty value.
  971. // This may be used to include null fields in Patch requests.
  972. NullFields []string `json:"-"`
  973. }
  974. func (s *CaptionListResponse) MarshalJSON() ([]byte, error) {
  975. type NoMethod CaptionListResponse
  976. raw := NoMethod(*s)
  977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  978. }
  979. // CaptionSnippet: Basic details about a caption track, such as its
  980. // language and name.
  981. type CaptionSnippet struct {
  982. // AudioTrackType: The type of audio track associated with the caption
  983. // track.
  984. //
  985. // Possible values:
  986. // "commentary"
  987. // "descriptive"
  988. // "primary"
  989. // "unknown"
  990. AudioTrackType string `json:"audioTrackType,omitempty"`
  991. // FailureReason: The reason that YouTube failed to process the caption
  992. // track. This property is only present if the state property's value is
  993. // failed.
  994. //
  995. // Possible values:
  996. // "processingFailed"
  997. // "unknownFormat"
  998. // "unsupportedFormat"
  999. FailureReason string `json:"failureReason,omitempty"`
  1000. // IsAutoSynced: Indicates whether YouTube synchronized the caption
  1001. // track to the audio track in the video. The value will be true if a
  1002. // sync was explicitly requested when the caption track was uploaded.
  1003. // For example, when calling the captions.insert or captions.update
  1004. // methods, you can set the sync parameter to true to instruct YouTube
  1005. // to sync the uploaded track to the video. If the value is false,
  1006. // YouTube uses the time codes in the uploaded caption track to
  1007. // determine when to display captions.
  1008. IsAutoSynced bool `json:"isAutoSynced,omitempty"`
  1009. // IsCC: Indicates whether the track contains closed captions for the
  1010. // deaf and hard of hearing. The default value is false.
  1011. IsCC bool `json:"isCC,omitempty"`
  1012. // IsDraft: Indicates whether the caption track is a draft. If the value
  1013. // is true, then the track is not publicly visible. The default value is
  1014. // false.
  1015. IsDraft bool `json:"isDraft,omitempty"`
  1016. // IsEasyReader: Indicates whether caption track is formatted for "easy
  1017. // reader," meaning it is at a third-grade level for language learners.
  1018. // The default value is false.
  1019. IsEasyReader bool `json:"isEasyReader,omitempty"`
  1020. // IsLarge: Indicates whether the caption track uses large text for the
  1021. // vision-impaired. The default value is false.
  1022. IsLarge bool `json:"isLarge,omitempty"`
  1023. // Language: The language of the caption track. The property value is a
  1024. // BCP-47 language tag.
  1025. Language string `json:"language,omitempty"`
  1026. // LastUpdated: The date and time when the caption track was last
  1027. // updated. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  1028. // format.
  1029. LastUpdated string `json:"lastUpdated,omitempty"`
  1030. // Name: The name of the caption track. The name is intended to be
  1031. // visible to the user as an option during playback.
  1032. Name string `json:"name,omitempty"`
  1033. // Status: The caption track's status.
  1034. //
  1035. // Possible values:
  1036. // "failed"
  1037. // "serving"
  1038. // "syncing"
  1039. Status string `json:"status,omitempty"`
  1040. // TrackKind: The caption track's type.
  1041. //
  1042. // Possible values:
  1043. // "ASR"
  1044. // "forced"
  1045. // "standard"
  1046. TrackKind string `json:"trackKind,omitempty"`
  1047. // VideoId: The ID that YouTube uses to uniquely identify the video
  1048. // associated with the caption track.
  1049. VideoId string `json:"videoId,omitempty"`
  1050. // ForceSendFields is a list of field names (e.g. "AudioTrackType") to
  1051. // unconditionally include in API requests. By default, fields with
  1052. // empty values are omitted from API requests. However, any non-pointer,
  1053. // non-interface field appearing in ForceSendFields will be sent to the
  1054. // server regardless of whether the field is empty or not. This may be
  1055. // used to include empty fields in Patch requests.
  1056. ForceSendFields []string `json:"-"`
  1057. // NullFields is a list of field names (e.g. "AudioTrackType") to
  1058. // include in API requests with the JSON null value. By default, fields
  1059. // with empty values are omitted from API requests. However, any field
  1060. // with an empty value appearing in NullFields will be sent to the
  1061. // server as null. It is an error if a field in this list has a
  1062. // non-empty value. This may be used to include null fields in Patch
  1063. // requests.
  1064. NullFields []string `json:"-"`
  1065. }
  1066. func (s *CaptionSnippet) MarshalJSON() ([]byte, error) {
  1067. type NoMethod CaptionSnippet
  1068. raw := NoMethod(*s)
  1069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1070. }
  1071. // CdnSettings: Brief description of the live stream cdn settings.
  1072. type CdnSettings struct {
  1073. // Format: The format of the video stream that you are sending to
  1074. // Youtube.
  1075. Format string `json:"format,omitempty"`
  1076. // FrameRate: The frame rate of the inbound video data.
  1077. //
  1078. // Possible values:
  1079. // "30fps"
  1080. // "60fps"
  1081. // "variable"
  1082. FrameRate string `json:"frameRate,omitempty"`
  1083. // IngestionInfo: The ingestionInfo object contains information that
  1084. // YouTube provides that you need to transmit your RTMP or HTTP stream
  1085. // to YouTube.
  1086. IngestionInfo *IngestionInfo `json:"ingestionInfo,omitempty"`
  1087. // IngestionType: The method or protocol used to transmit the video
  1088. // stream.
  1089. //
  1090. // Possible values:
  1091. // "dash"
  1092. // "rtmp"
  1093. IngestionType string `json:"ingestionType,omitempty"`
  1094. // Resolution: The resolution of the inbound video data.
  1095. //
  1096. // Possible values:
  1097. // "1080p"
  1098. // "1440p"
  1099. // "2160p"
  1100. // "240p"
  1101. // "360p"
  1102. // "480p"
  1103. // "720p"
  1104. // "variable"
  1105. Resolution string `json:"resolution,omitempty"`
  1106. // ForceSendFields is a list of field names (e.g. "Format") to
  1107. // unconditionally include in API requests. By default, fields with
  1108. // empty values are omitted from API requests. However, any non-pointer,
  1109. // non-interface field appearing in ForceSendFields will be sent to the
  1110. // server regardless of whether the field is empty or not. This may be
  1111. // used to include empty fields in Patch requests.
  1112. ForceSendFields []string `json:"-"`
  1113. // NullFields is a list of field names (e.g. "Format") to include in API
  1114. // requests with the JSON null value. By default, fields with empty
  1115. // values are omitted from API requests. However, any field with an
  1116. // empty value appearing in NullFields will be sent to the server as
  1117. // null. It is an error if a field in this list has a non-empty value.
  1118. // This may be used to include null fields in Patch requests.
  1119. NullFields []string `json:"-"`
  1120. }
  1121. func (s *CdnSettings) MarshalJSON() ([]byte, error) {
  1122. type NoMethod CdnSettings
  1123. raw := NoMethod(*s)
  1124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1125. }
  1126. // Channel: A channel resource contains information about a YouTube
  1127. // channel.
  1128. type Channel struct {
  1129. // AuditDetails: The auditionDetails object encapsulates channel data
  1130. // that is relevant for YouTube Partners during the audition process.
  1131. AuditDetails *ChannelAuditDetails `json:"auditDetails,omitempty"`
  1132. // BrandingSettings: The brandingSettings object encapsulates
  1133. // information about the branding of the channel.
  1134. BrandingSettings *ChannelBrandingSettings `json:"brandingSettings,omitempty"`
  1135. // ContentDetails: The contentDetails object encapsulates information
  1136. // about the channel's content.
  1137. ContentDetails *ChannelContentDetails `json:"contentDetails,omitempty"`
  1138. // ContentOwnerDetails: The contentOwnerDetails object encapsulates
  1139. // channel data that is relevant for YouTube Partners linked with the
  1140. // channel.
  1141. ContentOwnerDetails *ChannelContentOwnerDetails `json:"contentOwnerDetails,omitempty"`
  1142. // ConversionPings: The conversionPings object encapsulates information
  1143. // about conversion pings that need to be respected by the channel.
  1144. ConversionPings *ChannelConversionPings `json:"conversionPings,omitempty"`
  1145. // Etag: Etag of this resource.
  1146. Etag string `json:"etag,omitempty"`
  1147. // Id: The ID that YouTube uses to uniquely identify the channel.
  1148. Id string `json:"id,omitempty"`
  1149. // InvideoPromotion: The invideoPromotion object encapsulates
  1150. // information about promotion campaign associated with the channel.
  1151. InvideoPromotion *InvideoPromotion `json:"invideoPromotion,omitempty"`
  1152. // Kind: Identifies what kind of resource this is. Value: the fixed
  1153. // string "youtube#channel".
  1154. Kind string `json:"kind,omitempty"`
  1155. // Localizations: Localizations for different languages
  1156. Localizations map[string]ChannelLocalization `json:"localizations,omitempty"`
  1157. // Snippet: The snippet object contains basic details about the channel,
  1158. // such as its title, description, and thumbnail images.
  1159. Snippet *ChannelSnippet `json:"snippet,omitempty"`
  1160. // Statistics: The statistics object encapsulates statistics for the
  1161. // channel.
  1162. Statistics *ChannelStatistics `json:"statistics,omitempty"`
  1163. // Status: The status object encapsulates information about the privacy
  1164. // status of the channel.
  1165. Status *ChannelStatus `json:"status,omitempty"`
  1166. // TopicDetails: The topicDetails object encapsulates information about
  1167. // Freebase topics associated with the channel.
  1168. TopicDetails *ChannelTopicDetails `json:"topicDetails,omitempty"`
  1169. // ServerResponse contains the HTTP response code and headers from the
  1170. // server.
  1171. googleapi.ServerResponse `json:"-"`
  1172. // ForceSendFields is a list of field names (e.g. "AuditDetails") to
  1173. // unconditionally include in API requests. By default, fields with
  1174. // empty values are omitted from API requests. However, any non-pointer,
  1175. // non-interface field appearing in ForceSendFields will be sent to the
  1176. // server regardless of whether the field is empty or not. This may be
  1177. // used to include empty fields in Patch requests.
  1178. ForceSendFields []string `json:"-"`
  1179. // NullFields is a list of field names (e.g. "AuditDetails") to include
  1180. // in API requests with the JSON null value. By default, fields with
  1181. // empty values are omitted from API requests. However, any field with
  1182. // an empty value appearing in NullFields will be sent to the server as
  1183. // null. It is an error if a field in this list has a non-empty value.
  1184. // This may be used to include null fields in Patch requests.
  1185. NullFields []string `json:"-"`
  1186. }
  1187. func (s *Channel) MarshalJSON() ([]byte, error) {
  1188. type NoMethod Channel
  1189. raw := NoMethod(*s)
  1190. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1191. }
  1192. // ChannelAuditDetails: The auditDetails object encapsulates channel
  1193. // data that is relevant for YouTube Partners during the audit process.
  1194. type ChannelAuditDetails struct {
  1195. // CommunityGuidelinesGoodStanding: Whether or not the channel respects
  1196. // the community guidelines.
  1197. CommunityGuidelinesGoodStanding bool `json:"communityGuidelinesGoodStanding,omitempty"`
  1198. // ContentIdClaimsGoodStanding: Whether or not the channel has any
  1199. // unresolved claims.
  1200. ContentIdClaimsGoodStanding bool `json:"contentIdClaimsGoodStanding,omitempty"`
  1201. // CopyrightStrikesGoodStanding: Whether or not the channel has any
  1202. // copyright strikes.
  1203. CopyrightStrikesGoodStanding bool `json:"copyrightStrikesGoodStanding,omitempty"`
  1204. // OverallGoodStanding: Describes the general state of the channel. This
  1205. // field will always show if there are any issues whatsoever with the
  1206. // channel. Currently this field represents the result of the logical
  1207. // and operation over the community guidelines good standing, the
  1208. // copyright strikes good standing and the content ID claims good
  1209. // standing, but this may change in the future.
  1210. OverallGoodStanding bool `json:"overallGoodStanding,omitempty"`
  1211. // ForceSendFields is a list of field names (e.g.
  1212. // "CommunityGuidelinesGoodStanding") to unconditionally include in API
  1213. // requests. By default, fields with empty values are omitted from API
  1214. // requests. However, any non-pointer, non-interface field appearing in
  1215. // ForceSendFields will be sent to the server regardless of whether the
  1216. // field is empty or not. This may be used to include empty fields in
  1217. // Patch requests.
  1218. ForceSendFields []string `json:"-"`
  1219. // NullFields is a list of field names (e.g.
  1220. // "CommunityGuidelinesGoodStanding") to include in API requests with
  1221. // the JSON null value. By default, fields with empty values are omitted
  1222. // from API requests. However, any field with an empty value appearing
  1223. // in NullFields will be sent to the server as null. It is an error if a
  1224. // field in this list has a non-empty value. This may be used to include
  1225. // null fields in Patch requests.
  1226. NullFields []string `json:"-"`
  1227. }
  1228. func (s *ChannelAuditDetails) MarshalJSON() ([]byte, error) {
  1229. type NoMethod ChannelAuditDetails
  1230. raw := NoMethod(*s)
  1231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1232. }
  1233. // ChannelBannerResource: A channel banner returned as the response to a
  1234. // channel_banner.insert call.
  1235. type ChannelBannerResource struct {
  1236. // Etag: Etag of this resource.
  1237. Etag string `json:"etag,omitempty"`
  1238. // Kind: Identifies what kind of resource this is. Value: the fixed
  1239. // string "youtube#channelBannerResource".
  1240. Kind string `json:"kind,omitempty"`
  1241. // Url: The URL of this banner image.
  1242. Url string `json:"url,omitempty"`
  1243. // ServerResponse contains the HTTP response code and headers from the
  1244. // server.
  1245. googleapi.ServerResponse `json:"-"`
  1246. // ForceSendFields is a list of field names (e.g. "Etag") to
  1247. // unconditionally include in API requests. By default, fields with
  1248. // empty values are omitted from API requests. However, any non-pointer,
  1249. // non-interface field appearing in ForceSendFields will be sent to the
  1250. // server regardless of whether the field is empty or not. This may be
  1251. // used to include empty fields in Patch requests.
  1252. ForceSendFields []string `json:"-"`
  1253. // NullFields is a list of field names (e.g. "Etag") to include in API
  1254. // requests with the JSON null value. By default, fields with empty
  1255. // values are omitted from API requests. However, any field with an
  1256. // empty value appearing in NullFields will be sent to the server as
  1257. // null. It is an error if a field in this list has a non-empty value.
  1258. // This may be used to include null fields in Patch requests.
  1259. NullFields []string `json:"-"`
  1260. }
  1261. func (s *ChannelBannerResource) MarshalJSON() ([]byte, error) {
  1262. type NoMethod ChannelBannerResource
  1263. raw := NoMethod(*s)
  1264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1265. }
  1266. // ChannelBrandingSettings: Branding properties of a YouTube channel.
  1267. type ChannelBrandingSettings struct {
  1268. // Channel: Branding properties for the channel view.
  1269. Channel *ChannelSettings `json:"channel,omitempty"`
  1270. // Hints: Additional experimental branding properties.
  1271. Hints []*PropertyValue `json:"hints,omitempty"`
  1272. // Image: Branding properties for branding images.
  1273. Image *ImageSettings `json:"image,omitempty"`
  1274. // Watch: Branding properties for the watch page.
  1275. Watch *WatchSettings `json:"watch,omitempty"`
  1276. // ForceSendFields is a list of field names (e.g. "Channel") to
  1277. // unconditionally include in API requests. By default, fields with
  1278. // empty values are omitted from API requests. However, any non-pointer,
  1279. // non-interface field appearing in ForceSendFields will be sent to the
  1280. // server regardless of whether the field is empty or not. This may be
  1281. // used to include empty fields in Patch requests.
  1282. ForceSendFields []string `json:"-"`
  1283. // NullFields is a list of field names (e.g. "Channel") to include in
  1284. // API requests with the JSON null value. By default, fields with empty
  1285. // values are omitted from API requests. However, any field with an
  1286. // empty value appearing in NullFields will be sent to the server as
  1287. // null. It is an error if a field in this list has a non-empty value.
  1288. // This may be used to include null fields in Patch requests.
  1289. NullFields []string `json:"-"`
  1290. }
  1291. func (s *ChannelBrandingSettings) MarshalJSON() ([]byte, error) {
  1292. type NoMethod ChannelBrandingSettings
  1293. raw := NoMethod(*s)
  1294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1295. }
  1296. // ChannelContentDetails: Details about the content of a channel.
  1297. type ChannelContentDetails struct {
  1298. RelatedPlaylists *ChannelContentDetailsRelatedPlaylists `json:"relatedPlaylists,omitempty"`
  1299. // ForceSendFields is a list of field names (e.g. "RelatedPlaylists") to
  1300. // unconditionally include in API requests. By default, fields with
  1301. // empty values are omitted from API requests. However, any non-pointer,
  1302. // non-interface field appearing in ForceSendFields will be sent to the
  1303. // server regardless of whether the field is empty or not. This may be
  1304. // used to include empty fields in Patch requests.
  1305. ForceSendFields []string `json:"-"`
  1306. // NullFields is a list of field names (e.g. "RelatedPlaylists") to
  1307. // include in API requests with the JSON null value. By default, fields
  1308. // with empty values are omitted from API requests. However, any field
  1309. // with an empty value appearing in NullFields will be sent to the
  1310. // server as null. It is an error if a field in this list has a
  1311. // non-empty value. This may be used to include null fields in Patch
  1312. // requests.
  1313. NullFields []string `json:"-"`
  1314. }
  1315. func (s *ChannelContentDetails) MarshalJSON() ([]byte, error) {
  1316. type NoMethod ChannelContentDetails
  1317. raw := NoMethod(*s)
  1318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1319. }
  1320. type ChannelContentDetailsRelatedPlaylists struct {
  1321. // Favorites: The ID of the playlist that contains the channel"s
  1322. // favorite videos. Use the playlistItems.insert and
  1323. // playlistItems.delete to add or remove items from that list.
  1324. Favorites string `json:"favorites,omitempty"`
  1325. // Likes: The ID of the playlist that contains the channel"s liked
  1326. // videos. Use the playlistItems.insert and playlistItems.delete to
  1327. // add or remove items from that list.
  1328. Likes string `json:"likes,omitempty"`
  1329. // Uploads: The ID of the playlist that contains the channel"s uploaded
  1330. // videos. Use the videos.insert method to upload new videos and the
  1331. // videos.delete method to delete previously uploaded videos.
  1332. Uploads string `json:"uploads,omitempty"`
  1333. // WatchHistory: The ID of the playlist that contains the channel"s
  1334. // watch history. Use the playlistItems.insert and
  1335. // playlistItems.delete to add or remove items from that list.
  1336. WatchHistory string `json:"watchHistory,omitempty"`
  1337. // WatchLater: The ID of the playlist that contains the channel"s watch
  1338. // later playlist. Use the playlistItems.insert and
  1339. // playlistItems.delete to add or remove items from that list.
  1340. WatchLater string `json:"watchLater,omitempty"`
  1341. // ForceSendFields is a list of field names (e.g. "Favorites") to
  1342. // unconditionally include in API requests. By default, fields with
  1343. // empty values are omitted from API requests. However, any non-pointer,
  1344. // non-interface field appearing in ForceSendFields will be sent to the
  1345. // server regardless of whether the field is empty or not. This may be
  1346. // used to include empty fields in Patch requests.
  1347. ForceSendFields []string `json:"-"`
  1348. // NullFields is a list of field names (e.g. "Favorites") to include in
  1349. // API requests with the JSON null value. By default, fields with empty
  1350. // values are omitted from API requests. However, any field with an
  1351. // empty value appearing in NullFields will be sent to the server as
  1352. // null. It is an error if a field in this list has a non-empty value.
  1353. // This may be used to include null fields in Patch requests.
  1354. NullFields []string `json:"-"`
  1355. }
  1356. func (s *ChannelContentDetailsRelatedPlaylists) MarshalJSON() ([]byte, error) {
  1357. type NoMethod ChannelContentDetailsRelatedPlaylists
  1358. raw := NoMethod(*s)
  1359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1360. }
  1361. // ChannelContentOwnerDetails: The contentOwnerDetails object
  1362. // encapsulates channel data that is relevant for YouTube Partners
  1363. // linked with the channel.
  1364. type ChannelContentOwnerDetails struct {
  1365. // ContentOwner: The ID of the content owner linked to the channel.
  1366. ContentOwner string `json:"contentOwner,omitempty"`
  1367. // TimeLinked: The date and time of when the channel was linked to the
  1368. // content owner. The value is specified in ISO 8601
  1369. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  1370. TimeLinked string `json:"timeLinked,omitempty"`
  1371. // ForceSendFields is a list of field names (e.g. "ContentOwner") to
  1372. // unconditionally include in API requests. By default, fields with
  1373. // empty values are omitted from API requests. However, any non-pointer,
  1374. // non-interface field appearing in ForceSendFields will be sent to the
  1375. // server regardless of whether the field is empty or not. This may be
  1376. // used to include empty fields in Patch requests.
  1377. ForceSendFields []string `json:"-"`
  1378. // NullFields is a list of field names (e.g. "ContentOwner") to include
  1379. // in API requests with the JSON null value. By default, fields with
  1380. // empty values are omitted from API requests. However, any field with
  1381. // an empty value appearing in NullFields will be sent to the server as
  1382. // null. It is an error if a field in this list has a non-empty value.
  1383. // This may be used to include null fields in Patch requests.
  1384. NullFields []string `json:"-"`
  1385. }
  1386. func (s *ChannelContentOwnerDetails) MarshalJSON() ([]byte, error) {
  1387. type NoMethod ChannelContentOwnerDetails
  1388. raw := NoMethod(*s)
  1389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1390. }
  1391. // ChannelConversionPing: Pings that the app shall fire (authenticated
  1392. // by biscotti cookie). Each ping has a context, in which the app must
  1393. // fire the ping, and a url identifying the ping.
  1394. type ChannelConversionPing struct {
  1395. // Context: Defines the context of the ping.
  1396. //
  1397. // Possible values:
  1398. // "cview"
  1399. // "subscribe"
  1400. // "unsubscribe"
  1401. Context string `json:"context,omitempty"`
  1402. // ConversionUrl: The url (without the schema) that the player shall
  1403. // send the ping to. It's at caller's descretion to decide which schema
  1404. // to use (http vs https) Example of a returned url:
  1405. // //googleads.g.doubleclick.net/pagead/
  1406. // viewthroughconversion/962985656/?data=path%3DtHe_path%3Btype%3D
  1407. // cview%3Butuid%3DGISQtTNGYqaYl4sKxoVvKA&labe=default The caller must
  1408. // append biscotti authentication (ms param in case of mobile, for
  1409. // example) to this ping.
  1410. ConversionUrl string `json:"conversionUrl,omitempty"`
  1411. // ForceSendFields is a list of field names (e.g. "Context") to
  1412. // unconditionally include in API requests. By default, fields with
  1413. // empty values are omitted from API requests. However, any non-pointer,
  1414. // non-interface field appearing in ForceSendFields will be sent to the
  1415. // server regardless of whether the field is empty or not. This may be
  1416. // used to include empty fields in Patch requests.
  1417. ForceSendFields []string `json:"-"`
  1418. // NullFields is a list of field names (e.g. "Context") to include in
  1419. // API requests with the JSON null value. By default, fields with empty
  1420. // values are omitted from API requests. However, any field with an
  1421. // empty value appearing in NullFields will be sent to the server as
  1422. // null. It is an error if a field in this list has a non-empty value.
  1423. // This may be used to include null fields in Patch requests.
  1424. NullFields []string `json:"-"`
  1425. }
  1426. func (s *ChannelConversionPing) MarshalJSON() ([]byte, error) {
  1427. type NoMethod ChannelConversionPing
  1428. raw := NoMethod(*s)
  1429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1430. }
  1431. // ChannelConversionPings: The conversionPings object encapsulates
  1432. // information about conversion pings that need to be respected by the
  1433. // channel.
  1434. type ChannelConversionPings struct {
  1435. // Pings: Pings that the app shall fire (authenticated by biscotti
  1436. // cookie). Each ping has a context, in which the app must fire the
  1437. // ping, and a url identifying the ping.
  1438. Pings []*ChannelConversionPing `json:"pings,omitempty"`
  1439. // ForceSendFields is a list of field names (e.g. "Pings") to
  1440. // unconditionally include in API requests. By default, fields with
  1441. // empty values are omitted from API requests. However, any non-pointer,
  1442. // non-interface field appearing in ForceSendFields will be sent to the
  1443. // server regardless of whether the field is empty or not. This may be
  1444. // used to include empty fields in Patch requests.
  1445. ForceSendFields []string `json:"-"`
  1446. // NullFields is a list of field names (e.g. "Pings") to include in API
  1447. // requests with the JSON null value. By default, fields with empty
  1448. // values are omitted from API requests. However, any field with an
  1449. // empty value appearing in NullFields will be sent to the server as
  1450. // null. It is an error if a field in this list has a non-empty value.
  1451. // This may be used to include null fields in Patch requests.
  1452. NullFields []string `json:"-"`
  1453. }
  1454. func (s *ChannelConversionPings) MarshalJSON() ([]byte, error) {
  1455. type NoMethod ChannelConversionPings
  1456. raw := NoMethod(*s)
  1457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1458. }
  1459. type ChannelListResponse struct {
  1460. // Etag: Etag of this resource.
  1461. Etag string `json:"etag,omitempty"`
  1462. // EventId: Serialized EventId of the request which produced this
  1463. // response.
  1464. EventId string `json:"eventId,omitempty"`
  1465. // Items: A list of channels that match the request criteria.
  1466. Items []*Channel `json:"items,omitempty"`
  1467. // Kind: Identifies what kind of resource this is. Value: the fixed
  1468. // string "youtube#channelListResponse".
  1469. Kind string `json:"kind,omitempty"`
  1470. // NextPageToken: The token that can be used as the value of the
  1471. // pageToken parameter to retrieve the next page in the result set.
  1472. NextPageToken string `json:"nextPageToken,omitempty"`
  1473. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  1474. // PrevPageToken: The token that can be used as the value of the
  1475. // pageToken parameter to retrieve the previous page in the result set.
  1476. PrevPageToken string `json:"prevPageToken,omitempty"`
  1477. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  1478. // VisitorId: The visitorId identifies the visitor.
  1479. VisitorId string `json:"visitorId,omitempty"`
  1480. // ServerResponse contains the HTTP response code and headers from the
  1481. // server.
  1482. googleapi.ServerResponse `json:"-"`
  1483. // ForceSendFields is a list of field names (e.g. "Etag") to
  1484. // unconditionally include in API requests. By default, fields with
  1485. // empty values are omitted from API requests. However, any non-pointer,
  1486. // non-interface field appearing in ForceSendFields will be sent to the
  1487. // server regardless of whether the field is empty or not. This may be
  1488. // used to include empty fields in Patch requests.
  1489. ForceSendFields []string `json:"-"`
  1490. // NullFields is a list of field names (e.g. "Etag") to include in API
  1491. // requests with the JSON null value. By default, fields with empty
  1492. // values are omitted from API requests. However, any field with an
  1493. // empty value appearing in NullFields will be sent to the server as
  1494. // null. It is an error if a field in this list has a non-empty value.
  1495. // This may be used to include null fields in Patch requests.
  1496. NullFields []string `json:"-"`
  1497. }
  1498. func (s *ChannelListResponse) MarshalJSON() ([]byte, error) {
  1499. type NoMethod ChannelListResponse
  1500. raw := NoMethod(*s)
  1501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1502. }
  1503. // ChannelLocalization: Channel localization setting
  1504. type ChannelLocalization struct {
  1505. // Description: The localized strings for channel's description.
  1506. Description string `json:"description,omitempty"`
  1507. // Title: The localized strings for channel's title.
  1508. Title string `json:"title,omitempty"`
  1509. // ForceSendFields is a list of field names (e.g. "Description") to
  1510. // unconditionally include in API requests. By default, fields with
  1511. // empty values are omitted from API requests. However, any non-pointer,
  1512. // non-interface field appearing in ForceSendFields will be sent to the
  1513. // server regardless of whether the field is empty or not. This may be
  1514. // used to include empty fields in Patch requests.
  1515. ForceSendFields []string `json:"-"`
  1516. // NullFields is a list of field names (e.g. "Description") to include
  1517. // in API requests with the JSON null value. By default, fields with
  1518. // empty values are omitted from API requests. However, any field with
  1519. // an empty value appearing in NullFields will be sent to the server as
  1520. // null. It is an error if a field in this list has a non-empty value.
  1521. // This may be used to include null fields in Patch requests.
  1522. NullFields []string `json:"-"`
  1523. }
  1524. func (s *ChannelLocalization) MarshalJSON() ([]byte, error) {
  1525. type NoMethod ChannelLocalization
  1526. raw := NoMethod(*s)
  1527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1528. }
  1529. type ChannelProfileDetails struct {
  1530. // ChannelId: The YouTube channel ID.
  1531. ChannelId string `json:"channelId,omitempty"`
  1532. // ChannelUrl: The channel's URL.
  1533. ChannelUrl string `json:"channelUrl,omitempty"`
  1534. // DisplayName: The channel's display name.
  1535. DisplayName string `json:"displayName,omitempty"`
  1536. // ProfileImageUrl: The channels's avatar URL.
  1537. ProfileImageUrl string `json:"profileImageUrl,omitempty"`
  1538. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  1539. // unconditionally include in API requests. By default, fields with
  1540. // empty values are omitted from API requests. However, any non-pointer,
  1541. // non-interface field appearing in ForceSendFields will be sent to the
  1542. // server regardless of whether the field is empty or not. This may be
  1543. // used to include empty fields in Patch requests.
  1544. ForceSendFields []string `json:"-"`
  1545. // NullFields is a list of field names (e.g. "ChannelId") to include in
  1546. // API requests with the JSON null value. By default, fields with empty
  1547. // values are omitted from API requests. However, any field with an
  1548. // empty value appearing in NullFields will be sent to the server as
  1549. // null. It is an error if a field in this list has a non-empty value.
  1550. // This may be used to include null fields in Patch requests.
  1551. NullFields []string `json:"-"`
  1552. }
  1553. func (s *ChannelProfileDetails) MarshalJSON() ([]byte, error) {
  1554. type NoMethod ChannelProfileDetails
  1555. raw := NoMethod(*s)
  1556. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1557. }
  1558. type ChannelSection struct {
  1559. // ContentDetails: The contentDetails object contains details about the
  1560. // channel section content, such as a list of playlists or channels
  1561. // featured in the section.
  1562. ContentDetails *ChannelSectionContentDetails `json:"contentDetails,omitempty"`
  1563. // Etag: Etag of this resource.
  1564. Etag string `json:"etag,omitempty"`
  1565. // Id: The ID that YouTube uses to uniquely identify the channel
  1566. // section.
  1567. Id string `json:"id,omitempty"`
  1568. // Kind: Identifies what kind of resource this is. Value: the fixed
  1569. // string "youtube#channelSection".
  1570. Kind string `json:"kind,omitempty"`
  1571. // Localizations: Localizations for different languages
  1572. Localizations map[string]ChannelSectionLocalization `json:"localizations,omitempty"`
  1573. // Snippet: The snippet object contains basic details about the channel
  1574. // section, such as its type, style and title.
  1575. Snippet *ChannelSectionSnippet `json:"snippet,omitempty"`
  1576. // Targeting: The targeting object contains basic targeting settings
  1577. // about the channel section.
  1578. Targeting *ChannelSectionTargeting `json:"targeting,omitempty"`
  1579. // ServerResponse contains the HTTP response code and headers from the
  1580. // server.
  1581. googleapi.ServerResponse `json:"-"`
  1582. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  1583. // unconditionally include in API requests. By default, fields with
  1584. // empty values are omitted from API requests. However, any non-pointer,
  1585. // non-interface field appearing in ForceSendFields will be sent to the
  1586. // server regardless of whether the field is empty or not. This may be
  1587. // used to include empty fields in Patch requests.
  1588. ForceSendFields []string `json:"-"`
  1589. // NullFields is a list of field names (e.g. "ContentDetails") to
  1590. // include in API requests with the JSON null value. By default, fields
  1591. // with empty values are omitted from API requests. However, any field
  1592. // with an empty value appearing in NullFields will be sent to the
  1593. // server as null. It is an error if a field in this list has a
  1594. // non-empty value. This may be used to include null fields in Patch
  1595. // requests.
  1596. NullFields []string `json:"-"`
  1597. }
  1598. func (s *ChannelSection) MarshalJSON() ([]byte, error) {
  1599. type NoMethod ChannelSection
  1600. raw := NoMethod(*s)
  1601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1602. }
  1603. // ChannelSectionContentDetails: Details about a channelsection,
  1604. // including playlists and channels.
  1605. type ChannelSectionContentDetails struct {
  1606. // Channels: The channel ids for type multiple_channels.
  1607. Channels []string `json:"channels,omitempty"`
  1608. // Playlists: The playlist ids for type single_playlist and
  1609. // multiple_playlists. For singlePlaylist, only one playlistId is
  1610. // allowed.
  1611. Playlists []string `json:"playlists,omitempty"`
  1612. // ForceSendFields is a list of field names (e.g. "Channels") to
  1613. // unconditionally include in API requests. By default, fields with
  1614. // empty values are omitted from API requests. However, any non-pointer,
  1615. // non-interface field appearing in ForceSendFields will be sent to the
  1616. // server regardless of whether the field is empty or not. This may be
  1617. // used to include empty fields in Patch requests.
  1618. ForceSendFields []string `json:"-"`
  1619. // NullFields is a list of field names (e.g. "Channels") to include in
  1620. // API requests with the JSON null value. By default, fields with empty
  1621. // values are omitted from API requests. However, any field with an
  1622. // empty value appearing in NullFields will be sent to the server as
  1623. // null. It is an error if a field in this list has a non-empty value.
  1624. // This may be used to include null fields in Patch requests.
  1625. NullFields []string `json:"-"`
  1626. }
  1627. func (s *ChannelSectionContentDetails) MarshalJSON() ([]byte, error) {
  1628. type NoMethod ChannelSectionContentDetails
  1629. raw := NoMethod(*s)
  1630. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1631. }
  1632. type ChannelSectionListResponse struct {
  1633. // Etag: Etag of this resource.
  1634. Etag string `json:"etag,omitempty"`
  1635. // EventId: Serialized EventId of the request which produced this
  1636. // response.
  1637. EventId string `json:"eventId,omitempty"`
  1638. // Items: A list of ChannelSections that match the request criteria.
  1639. Items []*ChannelSection `json:"items,omitempty"`
  1640. // Kind: Identifies what kind of resource this is. Value: the fixed
  1641. // string "youtube#channelSectionListResponse".
  1642. Kind string `json:"kind,omitempty"`
  1643. // VisitorId: The visitorId identifies the visitor.
  1644. VisitorId string `json:"visitorId,omitempty"`
  1645. // ServerResponse contains the HTTP response code and headers from the
  1646. // server.
  1647. googleapi.ServerResponse `json:"-"`
  1648. // ForceSendFields is a list of field names (e.g. "Etag") to
  1649. // unconditionally include in API requests. By default, fields with
  1650. // empty values are omitted from API requests. However, any non-pointer,
  1651. // non-interface field appearing in ForceSendFields will be sent to the
  1652. // server regardless of whether the field is empty or not. This may be
  1653. // used to include empty fields in Patch requests.
  1654. ForceSendFields []string `json:"-"`
  1655. // NullFields is a list of field names (e.g. "Etag") to include in API
  1656. // requests with the JSON null value. By default, fields with empty
  1657. // values are omitted from API requests. However, any field with an
  1658. // empty value appearing in NullFields will be sent to the server as
  1659. // null. It is an error if a field in this list has a non-empty value.
  1660. // This may be used to include null fields in Patch requests.
  1661. NullFields []string `json:"-"`
  1662. }
  1663. func (s *ChannelSectionListResponse) MarshalJSON() ([]byte, error) {
  1664. type NoMethod ChannelSectionListResponse
  1665. raw := NoMethod(*s)
  1666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1667. }
  1668. // ChannelSectionLocalization: ChannelSection localization setting
  1669. type ChannelSectionLocalization struct {
  1670. // Title: The localized strings for channel section's title.
  1671. Title string `json:"title,omitempty"`
  1672. // ForceSendFields is a list of field names (e.g. "Title") to
  1673. // unconditionally include in API requests. By default, fields with
  1674. // empty values are omitted from API requests. However, any non-pointer,
  1675. // non-interface field appearing in ForceSendFields will be sent to the
  1676. // server regardless of whether the field is empty or not. This may be
  1677. // used to include empty fields in Patch requests.
  1678. ForceSendFields []string `json:"-"`
  1679. // NullFields is a list of field names (e.g. "Title") to include in API
  1680. // requests with the JSON null value. By default, fields with empty
  1681. // values are omitted from API requests. However, any field with an
  1682. // empty value appearing in NullFields will be sent to the server as
  1683. // null. It is an error if a field in this list has a non-empty value.
  1684. // This may be used to include null fields in Patch requests.
  1685. NullFields []string `json:"-"`
  1686. }
  1687. func (s *ChannelSectionLocalization) MarshalJSON() ([]byte, error) {
  1688. type NoMethod ChannelSectionLocalization
  1689. raw := NoMethod(*s)
  1690. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1691. }
  1692. // ChannelSectionSnippet: Basic details about a channel section,
  1693. // including title, style and position.
  1694. type ChannelSectionSnippet struct {
  1695. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  1696. // that published the channel section.
  1697. ChannelId string `json:"channelId,omitempty"`
  1698. // DefaultLanguage: The language of the channel section's default title
  1699. // and description.
  1700. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1701. // Localized: Localized title, read-only.
  1702. Localized *ChannelSectionLocalization `json:"localized,omitempty"`
  1703. // Position: The position of the channel section in the channel.
  1704. Position *int64 `json:"position,omitempty"`
  1705. // Style: The style of the channel section.
  1706. //
  1707. // Possible values:
  1708. // "channelsectionStyleUndefined"
  1709. // "horizontalRow"
  1710. // "verticalList"
  1711. Style string `json:"style,omitempty"`
  1712. // Title: The channel section's title for multiple_playlists and
  1713. // multiple_channels.
  1714. Title string `json:"title,omitempty"`
  1715. // Type: The type of the channel section.
  1716. //
  1717. // Possible values:
  1718. // "allPlaylists"
  1719. // "channelsectionTypeUndefined"
  1720. // "completedEvents"
  1721. // "likedPlaylists"
  1722. // "likes"
  1723. // "liveEvents"
  1724. // "multipleChannels"
  1725. // "multiplePlaylists"
  1726. // "popularUploads"
  1727. // "postedPlaylists"
  1728. // "postedVideos"
  1729. // "recentActivity"
  1730. // "recentPosts"
  1731. // "recentUploads"
  1732. // "singlePlaylist"
  1733. // "subscriptions"
  1734. // "upcomingEvents"
  1735. Type string `json:"type,omitempty"`
  1736. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  1737. // unconditionally include in API requests. By default, fields with
  1738. // empty values are omitted from API requests. However, any non-pointer,
  1739. // non-interface field appearing in ForceSendFields will be sent to the
  1740. // server regardless of whether the field is empty or not. This may be
  1741. // used to include empty fields in Patch requests.
  1742. ForceSendFields []string `json:"-"`
  1743. // NullFields is a list of field names (e.g. "ChannelId") to include in
  1744. // API requests with the JSON null value. By default, fields with empty
  1745. // values are omitted from API requests. However, any field with an
  1746. // empty value appearing in NullFields will be sent to the server as
  1747. // null. It is an error if a field in this list has a non-empty value.
  1748. // This may be used to include null fields in Patch requests.
  1749. NullFields []string `json:"-"`
  1750. }
  1751. func (s *ChannelSectionSnippet) MarshalJSON() ([]byte, error) {
  1752. type NoMethod ChannelSectionSnippet
  1753. raw := NoMethod(*s)
  1754. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1755. }
  1756. // ChannelSectionTargeting: ChannelSection targeting setting.
  1757. type ChannelSectionTargeting struct {
  1758. // Countries: The country the channel section is targeting.
  1759. Countries []string `json:"countries,omitempty"`
  1760. // Languages: The language the channel section is targeting.
  1761. Languages []string `json:"languages,omitempty"`
  1762. // Regions: The region the channel section is targeting.
  1763. Regions []string `json:"regions,omitempty"`
  1764. // ForceSendFields is a list of field names (e.g. "Countries") to
  1765. // unconditionally include in API requests. By default, fields with
  1766. // empty values are omitted from API requests. However, any non-pointer,
  1767. // non-interface field appearing in ForceSendFields will be sent to the
  1768. // server regardless of whether the field is empty or not. This may be
  1769. // used to include empty fields in Patch requests.
  1770. ForceSendFields []string `json:"-"`
  1771. // NullFields is a list of field names (e.g. "Countries") to include in
  1772. // API requests with the JSON null value. By default, fields with empty
  1773. // values are omitted from API requests. However, any field with an
  1774. // empty value appearing in NullFields will be sent to the server as
  1775. // null. It is an error if a field in this list has a non-empty value.
  1776. // This may be used to include null fields in Patch requests.
  1777. NullFields []string `json:"-"`
  1778. }
  1779. func (s *ChannelSectionTargeting) MarshalJSON() ([]byte, error) {
  1780. type NoMethod ChannelSectionTargeting
  1781. raw := NoMethod(*s)
  1782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1783. }
  1784. // ChannelSettings: Branding properties for the channel view.
  1785. type ChannelSettings struct {
  1786. // Country: The country of the channel.
  1787. Country string `json:"country,omitempty"`
  1788. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1789. // DefaultTab: Which content tab users should see when viewing the
  1790. // channel.
  1791. DefaultTab string `json:"defaultTab,omitempty"`
  1792. // Description: Specifies the channel description.
  1793. Description string `json:"description,omitempty"`
  1794. // FeaturedChannelsTitle: Title for the featured channels tab.
  1795. FeaturedChannelsTitle string `json:"featuredChannelsTitle,omitempty"`
  1796. // FeaturedChannelsUrls: The list of featured channels.
  1797. FeaturedChannelsUrls []string `json:"featuredChannelsUrls,omitempty"`
  1798. // Keywords: Lists keywords associated with the channel,
  1799. // comma-separated.
  1800. Keywords string `json:"keywords,omitempty"`
  1801. // ModerateComments: Whether user-submitted comments left on the channel
  1802. // page need to be approved by the channel owner to be publicly visible.
  1803. ModerateComments bool `json:"moderateComments,omitempty"`
  1804. // ProfileColor: A prominent color that can be rendered on this channel
  1805. // page.
  1806. ProfileColor string `json:"profileColor,omitempty"`
  1807. // ShowBrowseView: Whether the tab to browse the videos should be
  1808. // displayed.
  1809. ShowBrowseView bool `json:"showBrowseView,omitempty"`
  1810. // ShowRelatedChannels: Whether related channels should be proposed.
  1811. ShowRelatedChannels bool `json:"showRelatedChannels,omitempty"`
  1812. // Title: Specifies the channel title.
  1813. Title string `json:"title,omitempty"`
  1814. // TrackingAnalyticsAccountId: The ID for a Google Analytics account to
  1815. // track and measure traffic to the channels.
  1816. TrackingAnalyticsAccountId string `json:"trackingAnalyticsAccountId,omitempty"`
  1817. // UnsubscribedTrailer: The trailer of the channel, for users that are
  1818. // not subscribers.
  1819. UnsubscribedTrailer string `json:"unsubscribedTrailer,omitempty"`
  1820. // ForceSendFields is a list of field names (e.g. "Country") 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. "Country") 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 *ChannelSettings) MarshalJSON() ([]byte, error) {
  1836. type NoMethod ChannelSettings
  1837. raw := NoMethod(*s)
  1838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1839. }
  1840. // ChannelSnippet: Basic details about a channel, including title,
  1841. // description and thumbnails.
  1842. type ChannelSnippet struct {
  1843. // Country: The country of the channel.
  1844. Country string `json:"country,omitempty"`
  1845. // CustomUrl: The custom url of the channel.
  1846. CustomUrl string `json:"customUrl,omitempty"`
  1847. // DefaultLanguage: The language of the channel's default title and
  1848. // description.
  1849. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  1850. // Description: The description of the channel.
  1851. Description string `json:"description,omitempty"`
  1852. // Localized: Localized title and description, read-only.
  1853. Localized *ChannelLocalization `json:"localized,omitempty"`
  1854. // PublishedAt: The date and time that the channel was created. The
  1855. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  1856. PublishedAt string `json:"publishedAt,omitempty"`
  1857. // Thumbnails: A map of thumbnail images associated with the channel.
  1858. // For each object in the map, the key is the name of the thumbnail
  1859. // image, and the value is an object that contains other information
  1860. // about the thumbnail.
  1861. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  1862. // Title: The channel's title.
  1863. Title string `json:"title,omitempty"`
  1864. // ForceSendFields is a list of field names (e.g. "Country") to
  1865. // unconditionally include in API requests. By default, fields with
  1866. // empty values are omitted from API requests. However, any non-pointer,
  1867. // non-interface field appearing in ForceSendFields will be sent to the
  1868. // server regardless of whether the field is empty or not. This may be
  1869. // used to include empty fields in Patch requests.
  1870. ForceSendFields []string `json:"-"`
  1871. // NullFields is a list of field names (e.g. "Country") to include in
  1872. // API requests with the JSON null value. By default, fields with empty
  1873. // values are omitted from API requests. However, any field with an
  1874. // empty value appearing in NullFields will be sent to the server as
  1875. // null. It is an error if a field in this list has a non-empty value.
  1876. // This may be used to include null fields in Patch requests.
  1877. NullFields []string `json:"-"`
  1878. }
  1879. func (s *ChannelSnippet) MarshalJSON() ([]byte, error) {
  1880. type NoMethod ChannelSnippet
  1881. raw := NoMethod(*s)
  1882. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1883. }
  1884. // ChannelStatistics: Statistics about a channel: number of subscribers,
  1885. // number of videos in the channel, etc.
  1886. type ChannelStatistics struct {
  1887. // CommentCount: The number of comments for the channel.
  1888. CommentCount uint64 `json:"commentCount,omitempty,string"`
  1889. // HiddenSubscriberCount: Whether or not the number of subscribers is
  1890. // shown for this user.
  1891. HiddenSubscriberCount bool `json:"hiddenSubscriberCount,omitempty"`
  1892. // SubscriberCount: The number of subscribers that the channel has.
  1893. SubscriberCount uint64 `json:"subscriberCount,omitempty,string"`
  1894. // VideoCount: The number of videos uploaded to the channel.
  1895. VideoCount uint64 `json:"videoCount,omitempty,string"`
  1896. // ViewCount: The number of times the channel has been viewed.
  1897. ViewCount uint64 `json:"viewCount,omitempty,string"`
  1898. // ForceSendFields is a list of field names (e.g. "CommentCount") to
  1899. // unconditionally include in API requests. By default, fields with
  1900. // empty values are omitted from API requests. However, any non-pointer,
  1901. // non-interface field appearing in ForceSendFields will be sent to the
  1902. // server regardless of whether the field is empty or not. This may be
  1903. // used to include empty fields in Patch requests.
  1904. ForceSendFields []string `json:"-"`
  1905. // NullFields is a list of field names (e.g. "CommentCount") to include
  1906. // in API requests with the JSON null value. By default, fields with
  1907. // empty values are omitted from API requests. However, any field with
  1908. // an empty value appearing in NullFields will be sent to the server as
  1909. // null. It is an error if a field in this list has a non-empty value.
  1910. // This may be used to include null fields in Patch requests.
  1911. NullFields []string `json:"-"`
  1912. }
  1913. func (s *ChannelStatistics) MarshalJSON() ([]byte, error) {
  1914. type NoMethod ChannelStatistics
  1915. raw := NoMethod(*s)
  1916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1917. }
  1918. // ChannelStatus: JSON template for the status part of a channel.
  1919. type ChannelStatus struct {
  1920. // IsLinked: If true, then the user is linked to either a YouTube
  1921. // username or G+ account. Otherwise, the user doesn't have a public
  1922. // YouTube identity.
  1923. IsLinked bool `json:"isLinked,omitempty"`
  1924. // LongUploadsStatus: The long uploads status of this channel. See
  1925. //
  1926. // Possible values:
  1927. // "allowed"
  1928. // "disallowed"
  1929. // "eligible"
  1930. // "longUploadsUnspecified"
  1931. LongUploadsStatus string `json:"longUploadsStatus,omitempty"`
  1932. // PrivacyStatus: Privacy status of the channel.
  1933. //
  1934. // Possible values:
  1935. // "private"
  1936. // "public"
  1937. // "unlisted"
  1938. // "unlisted_new"
  1939. PrivacyStatus string `json:"privacyStatus,omitempty"`
  1940. // ForceSendFields is a list of field names (e.g. "IsLinked") to
  1941. // unconditionally include in API requests. By default, fields with
  1942. // empty values are omitted from API requests. However, any non-pointer,
  1943. // non-interface field appearing in ForceSendFields will be sent to the
  1944. // server regardless of whether the field is empty or not. This may be
  1945. // used to include empty fields in Patch requests.
  1946. ForceSendFields []string `json:"-"`
  1947. // NullFields is a list of field names (e.g. "IsLinked") to include in
  1948. // API requests with the JSON null value. By default, fields with empty
  1949. // values are omitted from API requests. However, any field with an
  1950. // empty value appearing in NullFields will be sent to the server as
  1951. // null. It is an error if a field in this list has a non-empty value.
  1952. // This may be used to include null fields in Patch requests.
  1953. NullFields []string `json:"-"`
  1954. }
  1955. func (s *ChannelStatus) MarshalJSON() ([]byte, error) {
  1956. type NoMethod ChannelStatus
  1957. raw := NoMethod(*s)
  1958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1959. }
  1960. // ChannelTopicDetails: Freebase topic information related to the
  1961. // channel.
  1962. type ChannelTopicDetails struct {
  1963. // TopicCategories: A list of Wikipedia URLs that describe the channel's
  1964. // content.
  1965. TopicCategories []string `json:"topicCategories,omitempty"`
  1966. // TopicIds: A list of Freebase topic IDs associated with the channel.
  1967. // You can retrieve information about each topic using the Freebase
  1968. // Topic API.
  1969. TopicIds []string `json:"topicIds,omitempty"`
  1970. // ForceSendFields is a list of field names (e.g. "TopicCategories") to
  1971. // unconditionally include in API requests. By default, fields with
  1972. // empty values are omitted from API requests. However, any non-pointer,
  1973. // non-interface field appearing in ForceSendFields will be sent to the
  1974. // server regardless of whether the field is empty or not. This may be
  1975. // used to include empty fields in Patch requests.
  1976. ForceSendFields []string `json:"-"`
  1977. // NullFields is a list of field names (e.g. "TopicCategories") to
  1978. // include in API requests with the JSON null value. By default, fields
  1979. // with empty values are omitted from API requests. However, any field
  1980. // with an empty value appearing in NullFields will be sent to the
  1981. // server as null. It is an error if a field in this list has a
  1982. // non-empty value. This may be used to include null fields in Patch
  1983. // requests.
  1984. NullFields []string `json:"-"`
  1985. }
  1986. func (s *ChannelTopicDetails) MarshalJSON() ([]byte, error) {
  1987. type NoMethod ChannelTopicDetails
  1988. raw := NoMethod(*s)
  1989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1990. }
  1991. // Comment: A comment represents a single YouTube comment.
  1992. type Comment struct {
  1993. // Etag: Etag of this resource.
  1994. Etag string `json:"etag,omitempty"`
  1995. // Id: The ID that YouTube uses to uniquely identify the comment.
  1996. Id string `json:"id,omitempty"`
  1997. // Kind: Identifies what kind of resource this is. Value: the fixed
  1998. // string "youtube#comment".
  1999. Kind string `json:"kind,omitempty"`
  2000. // Snippet: The snippet object contains basic details about the comment.
  2001. Snippet *CommentSnippet `json:"snippet,omitempty"`
  2002. // ServerResponse contains the HTTP response code and headers from the
  2003. // server.
  2004. googleapi.ServerResponse `json:"-"`
  2005. // ForceSendFields is a list of field names (e.g. "Etag") to
  2006. // unconditionally include in API requests. By default, fields with
  2007. // empty values are omitted from API requests. However, any non-pointer,
  2008. // non-interface field appearing in ForceSendFields will be sent to the
  2009. // server regardless of whether the field is empty or not. This may be
  2010. // used to include empty fields in Patch requests.
  2011. ForceSendFields []string `json:"-"`
  2012. // NullFields is a list of field names (e.g. "Etag") to include in API
  2013. // requests with the JSON null value. By default, fields with empty
  2014. // values are omitted from API requests. However, any field with an
  2015. // empty value appearing in NullFields will be sent to the server as
  2016. // null. It is an error if a field in this list has a non-empty value.
  2017. // This may be used to include null fields in Patch requests.
  2018. NullFields []string `json:"-"`
  2019. }
  2020. func (s *Comment) MarshalJSON() ([]byte, error) {
  2021. type NoMethod Comment
  2022. raw := NoMethod(*s)
  2023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2024. }
  2025. type CommentListResponse struct {
  2026. // Etag: Etag of this resource.
  2027. Etag string `json:"etag,omitempty"`
  2028. // EventId: Serialized EventId of the request which produced this
  2029. // response.
  2030. EventId string `json:"eventId,omitempty"`
  2031. // Items: A list of comments that match the request criteria.
  2032. Items []*Comment `json:"items,omitempty"`
  2033. // Kind: Identifies what kind of resource this is. Value: the fixed
  2034. // string "youtube#commentListResponse".
  2035. Kind string `json:"kind,omitempty"`
  2036. // NextPageToken: The token that can be used as the value of the
  2037. // pageToken parameter to retrieve the next page in the result set.
  2038. NextPageToken string `json:"nextPageToken,omitempty"`
  2039. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2040. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2041. // VisitorId: The visitorId identifies the visitor.
  2042. VisitorId string `json:"visitorId,omitempty"`
  2043. // ServerResponse contains the HTTP response code and headers from the
  2044. // server.
  2045. googleapi.ServerResponse `json:"-"`
  2046. // ForceSendFields is a list of field names (e.g. "Etag") to
  2047. // unconditionally include in API requests. By default, fields with
  2048. // empty values are omitted from API requests. However, any non-pointer,
  2049. // non-interface field appearing in ForceSendFields will be sent to the
  2050. // server regardless of whether the field is empty or not. This may be
  2051. // used to include empty fields in Patch requests.
  2052. ForceSendFields []string `json:"-"`
  2053. // NullFields is a list of field names (e.g. "Etag") to include in API
  2054. // requests with the JSON null value. By default, fields with empty
  2055. // values are omitted from API requests. However, any field with an
  2056. // empty value appearing in NullFields will be sent to the server as
  2057. // null. It is an error if a field in this list has a non-empty value.
  2058. // This may be used to include null fields in Patch requests.
  2059. NullFields []string `json:"-"`
  2060. }
  2061. func (s *CommentListResponse) MarshalJSON() ([]byte, error) {
  2062. type NoMethod CommentListResponse
  2063. raw := NoMethod(*s)
  2064. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2065. }
  2066. // CommentSnippet: Basic details about a comment, such as its author and
  2067. // text.
  2068. type CommentSnippet struct {
  2069. // AuthorChannelId: The id of the author's YouTube channel, if any.
  2070. AuthorChannelId interface{} `json:"authorChannelId,omitempty"`
  2071. // AuthorChannelUrl: Link to the author's YouTube channel, if any.
  2072. AuthorChannelUrl string `json:"authorChannelUrl,omitempty"`
  2073. // AuthorDisplayName: The name of the user who posted the comment.
  2074. AuthorDisplayName string `json:"authorDisplayName,omitempty"`
  2075. // AuthorProfileImageUrl: The URL for the avatar of the user who posted
  2076. // the comment.
  2077. AuthorProfileImageUrl string `json:"authorProfileImageUrl,omitempty"`
  2078. // CanRate: Whether the current viewer can rate this comment.
  2079. CanRate bool `json:"canRate,omitempty"`
  2080. // ChannelId: The id of the corresponding YouTube channel. In case of a
  2081. // channel comment this is the channel the comment refers to. In case of
  2082. // a video comment it's the video's channel.
  2083. ChannelId string `json:"channelId,omitempty"`
  2084. // LikeCount: The total number of likes this comment has received.
  2085. LikeCount int64 `json:"likeCount,omitempty"`
  2086. // ModerationStatus: The comment's moderation status. Will not be set if
  2087. // the comments were requested through the id filter.
  2088. //
  2089. // Possible values:
  2090. // "heldForReview"
  2091. // "likelySpam"
  2092. // "published"
  2093. // "rejected"
  2094. ModerationStatus string `json:"moderationStatus,omitempty"`
  2095. // ParentId: The unique id of the parent comment, only set for replies.
  2096. ParentId string `json:"parentId,omitempty"`
  2097. // PublishedAt: The date and time when the comment was orignally
  2098. // published. The value is specified in ISO 8601
  2099. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  2100. PublishedAt string `json:"publishedAt,omitempty"`
  2101. // TextDisplay: The comment's text. The format is either plain text or
  2102. // HTML dependent on what has been requested. Even the plain text
  2103. // representation may differ from the text originally posted in that it
  2104. // may replace video links with video titles etc.
  2105. TextDisplay string `json:"textDisplay,omitempty"`
  2106. // TextOriginal: The comment's original raw text as initially posted or
  2107. // last updated. The original text will only be returned if it is
  2108. // accessible to the viewer, which is only guaranteed if the viewer is
  2109. // the comment's author.
  2110. TextOriginal string `json:"textOriginal,omitempty"`
  2111. // UpdatedAt: The date and time when was last updated . The value is
  2112. // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  2113. UpdatedAt string `json:"updatedAt,omitempty"`
  2114. // VideoId: The ID of the video the comment refers to, if any.
  2115. VideoId string `json:"videoId,omitempty"`
  2116. // ViewerRating: The rating the viewer has given to this comment. For
  2117. // the time being this will never return RATE_TYPE_DISLIKE and instead
  2118. // return RATE_TYPE_NONE. This may change in the future.
  2119. //
  2120. // Possible values:
  2121. // "dislike"
  2122. // "like"
  2123. // "none"
  2124. // "unspecified"
  2125. ViewerRating string `json:"viewerRating,omitempty"`
  2126. // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
  2127. // unconditionally include in API requests. By default, fields with
  2128. // empty values are omitted from API requests. However, any non-pointer,
  2129. // non-interface field appearing in ForceSendFields will be sent to the
  2130. // server regardless of whether the field is empty or not. This may be
  2131. // used to include empty fields in Patch requests.
  2132. ForceSendFields []string `json:"-"`
  2133. // NullFields is a list of field names (e.g. "AuthorChannelId") to
  2134. // include in API requests with the JSON null value. By default, fields
  2135. // with empty values are omitted from API requests. However, any field
  2136. // with an empty value appearing in NullFields will be sent to the
  2137. // server as null. It is an error if a field in this list has a
  2138. // non-empty value. This may be used to include null fields in Patch
  2139. // requests.
  2140. NullFields []string `json:"-"`
  2141. }
  2142. func (s *CommentSnippet) MarshalJSON() ([]byte, error) {
  2143. type NoMethod CommentSnippet
  2144. raw := NoMethod(*s)
  2145. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2146. }
  2147. // CommentThread: A comment thread represents information that applies
  2148. // to a top level comment and all its replies. It can also include the
  2149. // top level comment itself and some of the replies.
  2150. type CommentThread struct {
  2151. // Etag: Etag of this resource.
  2152. Etag string `json:"etag,omitempty"`
  2153. // Id: The ID that YouTube uses to uniquely identify the comment thread.
  2154. Id string `json:"id,omitempty"`
  2155. // Kind: Identifies what kind of resource this is. Value: the fixed
  2156. // string "youtube#commentThread".
  2157. Kind string `json:"kind,omitempty"`
  2158. // Replies: The replies object contains a limited number of replies (if
  2159. // any) to the top level comment found in the snippet.
  2160. Replies *CommentThreadReplies `json:"replies,omitempty"`
  2161. // Snippet: The snippet object contains basic details about the comment
  2162. // thread and also the top level comment.
  2163. Snippet *CommentThreadSnippet `json:"snippet,omitempty"`
  2164. // ServerResponse contains the HTTP response code and headers from the
  2165. // server.
  2166. googleapi.ServerResponse `json:"-"`
  2167. // ForceSendFields is a list of field names (e.g. "Etag") to
  2168. // unconditionally include in API requests. By default, fields with
  2169. // empty values are omitted from API requests. However, any non-pointer,
  2170. // non-interface field appearing in ForceSendFields will be sent to the
  2171. // server regardless of whether the field is empty or not. This may be
  2172. // used to include empty fields in Patch requests.
  2173. ForceSendFields []string `json:"-"`
  2174. // NullFields is a list of field names (e.g. "Etag") to include in API
  2175. // requests with the JSON null value. By default, fields with empty
  2176. // values are omitted from API requests. However, any field with an
  2177. // empty value appearing in NullFields will be sent to the server as
  2178. // null. It is an error if a field in this list has a non-empty value.
  2179. // This may be used to include null fields in Patch requests.
  2180. NullFields []string `json:"-"`
  2181. }
  2182. func (s *CommentThread) MarshalJSON() ([]byte, error) {
  2183. type NoMethod CommentThread
  2184. raw := NoMethod(*s)
  2185. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2186. }
  2187. type CommentThreadListResponse struct {
  2188. // Etag: Etag of this resource.
  2189. Etag string `json:"etag,omitempty"`
  2190. // EventId: Serialized EventId of the request which produced this
  2191. // response.
  2192. EventId string `json:"eventId,omitempty"`
  2193. // Items: A list of comment threads that match the request criteria.
  2194. Items []*CommentThread `json:"items,omitempty"`
  2195. // Kind: Identifies what kind of resource this is. Value: the fixed
  2196. // string "youtube#commentThreadListResponse".
  2197. Kind string `json:"kind,omitempty"`
  2198. // NextPageToken: The token that can be used as the value of the
  2199. // pageToken parameter to retrieve the next page in the result set.
  2200. NextPageToken string `json:"nextPageToken,omitempty"`
  2201. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  2202. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  2203. // VisitorId: The visitorId identifies the visitor.
  2204. VisitorId string `json:"visitorId,omitempty"`
  2205. // ServerResponse contains the HTTP response code and headers from the
  2206. // server.
  2207. googleapi.ServerResponse `json:"-"`
  2208. // ForceSendFields is a list of field names (e.g. "Etag") to
  2209. // unconditionally include in API requests. By default, fields with
  2210. // empty values are omitted from API requests. However, any non-pointer,
  2211. // non-interface field appearing in ForceSendFields will be sent to the
  2212. // server regardless of whether the field is empty or not. This may be
  2213. // used to include empty fields in Patch requests.
  2214. ForceSendFields []string `json:"-"`
  2215. // NullFields is a list of field names (e.g. "Etag") to include in API
  2216. // requests with the JSON null value. By default, fields with empty
  2217. // values are omitted from API requests. However, any field with an
  2218. // empty value appearing in NullFields will be sent to the server as
  2219. // null. It is an error if a field in this list has a non-empty value.
  2220. // This may be used to include null fields in Patch requests.
  2221. NullFields []string `json:"-"`
  2222. }
  2223. func (s *CommentThreadListResponse) MarshalJSON() ([]byte, error) {
  2224. type NoMethod CommentThreadListResponse
  2225. raw := NoMethod(*s)
  2226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2227. }
  2228. // CommentThreadReplies: Comments written in (direct or indirect) reply
  2229. // to the top level comment.
  2230. type CommentThreadReplies struct {
  2231. // Comments: A limited number of replies. Unless the number of replies
  2232. // returned equals total_reply_count in the snippet the returned replies
  2233. // are only a subset of the total number of replies.
  2234. Comments []*Comment `json:"comments,omitempty"`
  2235. // ForceSendFields is a list of field names (e.g. "Comments") to
  2236. // unconditionally include in API requests. By default, fields with
  2237. // empty values are omitted from API requests. However, any non-pointer,
  2238. // non-interface field appearing in ForceSendFields will be sent to the
  2239. // server regardless of whether the field is empty or not. This may be
  2240. // used to include empty fields in Patch requests.
  2241. ForceSendFields []string `json:"-"`
  2242. // NullFields is a list of field names (e.g. "Comments") to include in
  2243. // API requests with the JSON null value. By default, fields with empty
  2244. // values are omitted from API requests. However, any field with an
  2245. // empty value appearing in NullFields will be sent to the server as
  2246. // null. It is an error if a field in this list has a non-empty value.
  2247. // This may be used to include null fields in Patch requests.
  2248. NullFields []string `json:"-"`
  2249. }
  2250. func (s *CommentThreadReplies) MarshalJSON() ([]byte, error) {
  2251. type NoMethod CommentThreadReplies
  2252. raw := NoMethod(*s)
  2253. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2254. }
  2255. // CommentThreadSnippet: Basic details about a comment thread.
  2256. type CommentThreadSnippet struct {
  2257. // CanReply: Whether the current viewer of the thread can reply to it.
  2258. // This is viewer specific - other viewers may see a different value for
  2259. // this field.
  2260. CanReply bool `json:"canReply,omitempty"`
  2261. // ChannelId: The YouTube channel the comments in the thread refer to or
  2262. // the channel with the video the comments refer to. If video_id isn't
  2263. // set the comments refer to the channel itself.
  2264. ChannelId string `json:"channelId,omitempty"`
  2265. // IsPublic: Whether the thread (and therefore all its comments) is
  2266. // visible to all YouTube users.
  2267. IsPublic bool `json:"isPublic,omitempty"`
  2268. // TopLevelComment: The top level comment of this thread.
  2269. TopLevelComment *Comment `json:"topLevelComment,omitempty"`
  2270. // TotalReplyCount: The total number of replies (not including the top
  2271. // level comment).
  2272. TotalReplyCount int64 `json:"totalReplyCount,omitempty"`
  2273. // VideoId: The ID of the video the comments refer to, if any. No
  2274. // video_id implies a channel discussion comment.
  2275. VideoId string `json:"videoId,omitempty"`
  2276. // ForceSendFields is a list of field names (e.g. "CanReply") to
  2277. // unconditionally include in API requests. By default, fields with
  2278. // empty values are omitted from API requests. However, any non-pointer,
  2279. // non-interface field appearing in ForceSendFields will be sent to the
  2280. // server regardless of whether the field is empty or not. This may be
  2281. // used to include empty fields in Patch requests.
  2282. ForceSendFields []string `json:"-"`
  2283. // NullFields is a list of field names (e.g. "CanReply") to include in
  2284. // API requests with the JSON null value. By default, fields with empty
  2285. // values are omitted from API requests. However, any field with an
  2286. // empty value appearing in NullFields will be sent to the server as
  2287. // null. It is an error if a field in this list has a non-empty value.
  2288. // This may be used to include null fields in Patch requests.
  2289. NullFields []string `json:"-"`
  2290. }
  2291. func (s *CommentThreadSnippet) MarshalJSON() ([]byte, error) {
  2292. type NoMethod CommentThreadSnippet
  2293. raw := NoMethod(*s)
  2294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2295. }
  2296. // ContentRating: Ratings schemes. The country-specific ratings are
  2297. // mostly for movies and shows. NEXT_ID: 71
  2298. type ContentRating struct {
  2299. // AcbRating: The video's Australian Classification Board (ACB) or
  2300. // Australian Communications and Media Authority (ACMA) rating. ACMA
  2301. // ratings are used to classify children's television programming.
  2302. //
  2303. // Possible values:
  2304. // "acbC"
  2305. // "acbE"
  2306. // "acbG"
  2307. // "acbM"
  2308. // "acbMa15plus"
  2309. // "acbP"
  2310. // "acbPg"
  2311. // "acbR18plus"
  2312. // "acbUnrated"
  2313. AcbRating string `json:"acbRating,omitempty"`
  2314. // AgcomRating: The video's rating from Italy's Autorità per le
  2315. // Garanzie nelle Comunicazioni (AGCOM).
  2316. //
  2317. // Possible values:
  2318. // "agcomT"
  2319. // "agcomUnrated"
  2320. // "agcomVm14"
  2321. // "agcomVm18"
  2322. AgcomRating string `json:"agcomRating,omitempty"`
  2323. // AnatelRating: The video's Anatel (Asociación Nacional de
  2324. // Televisión) rating for Chilean television.
  2325. //
  2326. // Possible values:
  2327. // "anatelA"
  2328. // "anatelF"
  2329. // "anatelI"
  2330. // "anatelI10"
  2331. // "anatelI12"
  2332. // "anatelI7"
  2333. // "anatelR"
  2334. // "anatelUnrated"
  2335. AnatelRating string `json:"anatelRating,omitempty"`
  2336. // BbfcRating: The video's British Board of Film Classification (BBFC)
  2337. // rating.
  2338. //
  2339. // Possible values:
  2340. // "bbfc12"
  2341. // "bbfc12a"
  2342. // "bbfc15"
  2343. // "bbfc18"
  2344. // "bbfcPg"
  2345. // "bbfcR18"
  2346. // "bbfcU"
  2347. // "bbfcUnrated"
  2348. BbfcRating string `json:"bbfcRating,omitempty"`
  2349. // BfvcRating: The video's rating from Thailand's Board of Film and
  2350. // Video Censors.
  2351. //
  2352. // Possible values:
  2353. // "bfvc13"
  2354. // "bfvc15"
  2355. // "bfvc18"
  2356. // "bfvc20"
  2357. // "bfvcB"
  2358. // "bfvcE"
  2359. // "bfvcG"
  2360. // "bfvcUnrated"
  2361. BfvcRating string `json:"bfvcRating,omitempty"`
  2362. // BmukkRating: The video's rating from the Austrian Board of Media
  2363. // Classification (Bundesministerium für Unterricht, Kunst und Kultur).
  2364. //
  2365. // Possible values:
  2366. // "bmukk10"
  2367. // "bmukk12"
  2368. // "bmukk14"
  2369. // "bmukk16"
  2370. // "bmukk6"
  2371. // "bmukk8"
  2372. // "bmukkAa"
  2373. // "bmukkUnrated"
  2374. BmukkRating string `json:"bmukkRating,omitempty"`
  2375. // CatvRating: Rating system for Canadian TV - Canadian TV
  2376. // Classification System The video's rating from the Canadian
  2377. // Radio-Television and Telecommunications Commission (CRTC) for
  2378. // Canadian English-language broadcasts. For more information, see the
  2379. // Canadian Broadcast Standards Council website.
  2380. //
  2381. // Possible values:
  2382. // "catv14plus"
  2383. // "catv18plus"
  2384. // "catvC"
  2385. // "catvC8"
  2386. // "catvG"
  2387. // "catvPg"
  2388. // "catvUnrated"
  2389. CatvRating string `json:"catvRating,omitempty"`
  2390. // CatvfrRating: The video's rating from the Canadian Radio-Television
  2391. // and Telecommunications Commission (CRTC) for Canadian French-language
  2392. // broadcasts. For more information, see the Canadian Broadcast
  2393. // Standards Council website.
  2394. //
  2395. // Possible values:
  2396. // "catvfr13plus"
  2397. // "catvfr16plus"
  2398. // "catvfr18plus"
  2399. // "catvfr8plus"
  2400. // "catvfrG"
  2401. // "catvfrUnrated"
  2402. CatvfrRating string `json:"catvfrRating,omitempty"`
  2403. // CbfcRating: The video's Central Board of Film Certification (CBFC -
  2404. // India) rating.
  2405. //
  2406. // Possible values:
  2407. // "cbfcA"
  2408. // "cbfcS"
  2409. // "cbfcU"
  2410. // "cbfcUA"
  2411. // "cbfcUnrated"
  2412. CbfcRating string `json:"cbfcRating,omitempty"`
  2413. // CccRating: The video's Consejo de Calificación Cinematográfica
  2414. // (Chile) rating.
  2415. //
  2416. // Possible values:
  2417. // "ccc14"
  2418. // "ccc18"
  2419. // "ccc18s"
  2420. // "ccc18v"
  2421. // "ccc6"
  2422. // "cccTe"
  2423. // "cccUnrated"
  2424. CccRating string `json:"cccRating,omitempty"`
  2425. // CceRating: The video's rating from Portugal's Comissão de
  2426. // Classificação de Espect´culos.
  2427. //
  2428. // Possible values:
  2429. // "cceM12"
  2430. // "cceM14"
  2431. // "cceM16"
  2432. // "cceM18"
  2433. // "cceM4"
  2434. // "cceM6"
  2435. // "cceUnrated"
  2436. CceRating string `json:"cceRating,omitempty"`
  2437. // ChfilmRating: The video's rating in Switzerland.
  2438. //
  2439. // Possible values:
  2440. // "chfilm0"
  2441. // "chfilm12"
  2442. // "chfilm16"
  2443. // "chfilm18"
  2444. // "chfilm6"
  2445. // "chfilmUnrated"
  2446. ChfilmRating string `json:"chfilmRating,omitempty"`
  2447. // ChvrsRating: The video's Canadian Home Video Rating System (CHVRS)
  2448. // rating.
  2449. //
  2450. // Possible values:
  2451. // "chvrs14a"
  2452. // "chvrs18a"
  2453. // "chvrsE"
  2454. // "chvrsG"
  2455. // "chvrsPg"
  2456. // "chvrsR"
  2457. // "chvrsUnrated"
  2458. ChvrsRating string `json:"chvrsRating,omitempty"`
  2459. // CicfRating: The video's rating from the Commission de Contrôle des
  2460. // Films (Belgium).
  2461. //
  2462. // Possible values:
  2463. // "cicfE"
  2464. // "cicfKntEna"
  2465. // "cicfKtEa"
  2466. // "cicfUnrated"
  2467. CicfRating string `json:"cicfRating,omitempty"`
  2468. // CnaRating: The video's rating from Romania's CONSILIUL NATIONAL AL
  2469. // AUDIOVIZUALULUI (CNA).
  2470. //
  2471. // Possible values:
  2472. // "cna12"
  2473. // "cna15"
  2474. // "cna18"
  2475. // "cna18plus"
  2476. // "cnaAp"
  2477. // "cnaUnrated"
  2478. CnaRating string `json:"cnaRating,omitempty"`
  2479. // CncRating: Rating system in France - Commission de classification
  2480. // cinematographique
  2481. //
  2482. // Possible values:
  2483. // "cnc10"
  2484. // "cnc12"
  2485. // "cnc16"
  2486. // "cnc18"
  2487. // "cncE"
  2488. // "cncT"
  2489. // "cncUnrated"
  2490. CncRating string `json:"cncRating,omitempty"`
  2491. // CsaRating: The video's rating from France's Conseil supérieur de
  2492. // l?audiovisuel, which rates broadcast content.
  2493. //
  2494. // Possible values:
  2495. // "csa10"
  2496. // "csa12"
  2497. // "csa16"
  2498. // "csa18"
  2499. // "csaInterdiction"
  2500. // "csaT"
  2501. // "csaUnrated"
  2502. CsaRating string `json:"csaRating,omitempty"`
  2503. // CscfRating: The video's rating from Luxembourg's Commission de
  2504. // surveillance de la classification des films (CSCF).
  2505. //
  2506. // Possible values:
  2507. // "cscf12"
  2508. // "cscf16"
  2509. // "cscf18"
  2510. // "cscf6"
  2511. // "cscf9"
  2512. // "cscfA"
  2513. // "cscfAl"
  2514. // "cscfUnrated"
  2515. CscfRating string `json:"cscfRating,omitempty"`
  2516. // CzfilmRating: The video's rating in the Czech Republic.
  2517. //
  2518. // Possible values:
  2519. // "czfilm12"
  2520. // "czfilm14"
  2521. // "czfilm18"
  2522. // "czfilmU"
  2523. // "czfilmUnrated"
  2524. CzfilmRating string `json:"czfilmRating,omitempty"`
  2525. // DjctqRating: The video's Departamento de Justiça, Classificação,
  2526. // Qualificação e Títulos (DJCQT - Brazil) rating.
  2527. //
  2528. // Possible values:
  2529. // "djctq10"
  2530. // "djctq12"
  2531. // "djctq14"
  2532. // "djctq16"
  2533. // "djctq18"
  2534. // "djctqL"
  2535. // "djctqUnrated"
  2536. DjctqRating string `json:"djctqRating,omitempty"`
  2537. // DjctqRatingReasons: Reasons that explain why the video received its
  2538. // DJCQT (Brazil) rating.
  2539. //
  2540. // Possible values:
  2541. // "djctqCriminalActs"
  2542. // "djctqDrugs"
  2543. // "djctqExplicitSex"
  2544. // "djctqExtremeViolence"
  2545. // "djctqIllegalDrugs"
  2546. // "djctqImpactingContent"
  2547. // "djctqInappropriateLanguage"
  2548. // "djctqLegalDrugs"
  2549. // "djctqNudity"
  2550. // "djctqSex"
  2551. // "djctqSexualContent"
  2552. // "djctqViolence"
  2553. DjctqRatingReasons []string `json:"djctqRatingReasons,omitempty"`
  2554. // EcbmctRating: Rating system in Turkey - Evaluation and Classification
  2555. // Board of the Ministry of Culture and Tourism
  2556. //
  2557. // Possible values:
  2558. // "ecbmct13a"
  2559. // "ecbmct13plus"
  2560. // "ecbmct15a"
  2561. // "ecbmct15plus"
  2562. // "ecbmct18plus"
  2563. // "ecbmct7a"
  2564. // "ecbmct7plus"
  2565. // "ecbmctG"
  2566. // "ecbmctUnrated"
  2567. EcbmctRating string `json:"ecbmctRating,omitempty"`
  2568. // EefilmRating: The video's rating in Estonia.
  2569. //
  2570. // Possible values:
  2571. // "eefilmK12"
  2572. // "eefilmK14"
  2573. // "eefilmK16"
  2574. // "eefilmK6"
  2575. // "eefilmL"
  2576. // "eefilmMs12"
  2577. // "eefilmMs6"
  2578. // "eefilmPere"
  2579. // "eefilmUnrated"
  2580. EefilmRating string `json:"eefilmRating,omitempty"`
  2581. // EgfilmRating: The video's rating in Egypt.
  2582. //
  2583. // Possible values:
  2584. // "egfilm18"
  2585. // "egfilmBn"
  2586. // "egfilmGn"
  2587. // "egfilmUnrated"
  2588. EgfilmRating string `json:"egfilmRating,omitempty"`
  2589. // EirinRating: The video's Eirin (映倫) rating. Eirin is the Japanese
  2590. // rating system.
  2591. //
  2592. // Possible values:
  2593. // "eirinG"
  2594. // "eirinPg12"
  2595. // "eirinR15plus"
  2596. // "eirinR18plus"
  2597. // "eirinUnrated"
  2598. EirinRating string `json:"eirinRating,omitempty"`
  2599. // FcbmRating: The video's rating from Malaysia's Film Censorship Board.
  2600. //
  2601. // Possible values:
  2602. // "fcbm18"
  2603. // "fcbm18pa"
  2604. // "fcbm18pl"
  2605. // "fcbm18sg"
  2606. // "fcbm18sx"
  2607. // "fcbmP13"
  2608. // "fcbmPg13"
  2609. // "fcbmU"
  2610. // "fcbmUnrated"
  2611. FcbmRating string `json:"fcbmRating,omitempty"`
  2612. // FcoRating: The video's rating from Hong Kong's Office for Film,
  2613. // Newspaper and Article Administration.
  2614. //
  2615. // Possible values:
  2616. // "fcoI"
  2617. // "fcoIi"
  2618. // "fcoIia"
  2619. // "fcoIib"
  2620. // "fcoIii"
  2621. // "fcoUnrated"
  2622. FcoRating string `json:"fcoRating,omitempty"`
  2623. // FmocRating: This property has been deprecated. Use the
  2624. // contentDetails.contentRating.cncRating instead.
  2625. //
  2626. // Possible values:
  2627. // "fmoc10"
  2628. // "fmoc12"
  2629. // "fmoc16"
  2630. // "fmoc18"
  2631. // "fmocE"
  2632. // "fmocU"
  2633. // "fmocUnrated"
  2634. FmocRating string `json:"fmocRating,omitempty"`
  2635. // FpbRating: The video's rating from South Africa's Film and
  2636. // Publication Board.
  2637. //
  2638. // Possible values:
  2639. // "fpb10"
  2640. // "fpb1012Pg"
  2641. // "fpb13"
  2642. // "fpb16"
  2643. // "fpb18"
  2644. // "fpb79Pg"
  2645. // "fpbA"
  2646. // "fpbPg"
  2647. // "fpbUnrated"
  2648. // "fpbX18"
  2649. // "fpbXx"
  2650. FpbRating string `json:"fpbRating,omitempty"`
  2651. // FpbRatingReasons: Reasons that explain why the video received its FPB
  2652. // (South Africa) rating.
  2653. //
  2654. // Possible values:
  2655. // "fpbBlasphemy"
  2656. // "fpbCriminalTechniques"
  2657. // "fpbDrugs"
  2658. // "fpbHorror"
  2659. // "fpbImitativeActsTechniques"
  2660. // "fpbLanguage"
  2661. // "fpbNudity"
  2662. // "fpbPrejudice"
  2663. // "fpbSex"
  2664. // "fpbSexualViolence"
  2665. // "fpbViolence"
  2666. FpbRatingReasons []string `json:"fpbRatingReasons,omitempty"`
  2667. // FskRating: The video's Freiwillige Selbstkontrolle der Filmwirtschaft
  2668. // (FSK - Germany) rating.
  2669. //
  2670. // Possible values:
  2671. // "fsk0"
  2672. // "fsk12"
  2673. // "fsk16"
  2674. // "fsk18"
  2675. // "fsk6"
  2676. // "fskUnrated"
  2677. FskRating string `json:"fskRating,omitempty"`
  2678. // GrfilmRating: The video's rating in Greece.
  2679. //
  2680. // Possible values:
  2681. // "grfilmE"
  2682. // "grfilmK"
  2683. // "grfilmK12"
  2684. // "grfilmK13"
  2685. // "grfilmK15"
  2686. // "grfilmK17"
  2687. // "grfilmK18"
  2688. // "grfilmUnrated"
  2689. GrfilmRating string `json:"grfilmRating,omitempty"`
  2690. // IcaaRating: The video's Instituto de la Cinematografía y de las
  2691. // Artes Audiovisuales (ICAA - Spain) rating.
  2692. //
  2693. // Possible values:
  2694. // "icaa12"
  2695. // "icaa13"
  2696. // "icaa16"
  2697. // "icaa18"
  2698. // "icaa7"
  2699. // "icaaApta"
  2700. // "icaaUnrated"
  2701. // "icaaX"
  2702. IcaaRating string `json:"icaaRating,omitempty"`
  2703. // IfcoRating: The video's Irish Film Classification Office (IFCO -
  2704. // Ireland) rating. See the IFCO website for more information.
  2705. //
  2706. // Possible values:
  2707. // "ifco12"
  2708. // "ifco12a"
  2709. // "ifco15"
  2710. // "ifco15a"
  2711. // "ifco16"
  2712. // "ifco18"
  2713. // "ifcoG"
  2714. // "ifcoPg"
  2715. // "ifcoUnrated"
  2716. IfcoRating string `json:"ifcoRating,omitempty"`
  2717. // IlfilmRating: The video's rating in Israel.
  2718. //
  2719. // Possible values:
  2720. // "ilfilm12"
  2721. // "ilfilm14"
  2722. // "ilfilm16"
  2723. // "ilfilm18"
  2724. // "ilfilmAa"
  2725. // "ilfilmUnrated"
  2726. IlfilmRating string `json:"ilfilmRating,omitempty"`
  2727. // IncaaRating: The video's INCAA (Instituto Nacional de Cine y Artes
  2728. // Audiovisuales - Argentina) rating.
  2729. //
  2730. // Possible values:
  2731. // "incaaAtp"
  2732. // "incaaC"
  2733. // "incaaSam13"
  2734. // "incaaSam16"
  2735. // "incaaSam18"
  2736. // "incaaUnrated"
  2737. IncaaRating string `json:"incaaRating,omitempty"`
  2738. // KfcbRating: The video's rating from the Kenya Film Classification
  2739. // Board.
  2740. //
  2741. // Possible values:
  2742. // "kfcb16plus"
  2743. // "kfcbG"
  2744. // "kfcbPg"
  2745. // "kfcbR"
  2746. // "kfcbUnrated"
  2747. KfcbRating string `json:"kfcbRating,omitempty"`
  2748. // KijkwijzerRating: voor de Classificatie van Audiovisuele Media
  2749. // (Netherlands).
  2750. //
  2751. // Possible values:
  2752. // "kijkwijzer12"
  2753. // "kijkwijzer16"
  2754. // "kijkwijzer18"
  2755. // "kijkwijzer6"
  2756. // "kijkwijzer9"
  2757. // "kijkwijzerAl"
  2758. // "kijkwijzerUnrated"
  2759. KijkwijzerRating string `json:"kijkwijzerRating,omitempty"`
  2760. // KmrbRating: The video's Korea Media Rating Board
  2761. // (영상물등급위원회) rating. The KMRB rates videos in South
  2762. // Korea.
  2763. //
  2764. // Possible values:
  2765. // "kmrb12plus"
  2766. // "kmrb15plus"
  2767. // "kmrbAll"
  2768. // "kmrbR"
  2769. // "kmrbTeenr"
  2770. // "kmrbUnrated"
  2771. KmrbRating string `json:"kmrbRating,omitempty"`
  2772. // LsfRating: The video's rating from Indonesia's Lembaga Sensor Film.
  2773. //
  2774. // Possible values:
  2775. // "lsf13"
  2776. // "lsf17"
  2777. // "lsf21"
  2778. // "lsfA"
  2779. // "lsfBo"
  2780. // "lsfD"
  2781. // "lsfR"
  2782. // "lsfSu"
  2783. // "lsfUnrated"
  2784. LsfRating string `json:"lsfRating,omitempty"`
  2785. // MccaaRating: The video's rating from Malta's Film Age-Classification
  2786. // Board.
  2787. //
  2788. // Possible values:
  2789. // "mccaa12"
  2790. // "mccaa12a"
  2791. // "mccaa14"
  2792. // "mccaa15"
  2793. // "mccaa16"
  2794. // "mccaa18"
  2795. // "mccaaPg"
  2796. // "mccaaU"
  2797. // "mccaaUnrated"
  2798. MccaaRating string `json:"mccaaRating,omitempty"`
  2799. // MccypRating: The video's rating from the Danish Film Institute's (Det
  2800. // Danske Filminstitut) Media Council for Children and Young People.
  2801. //
  2802. // Possible values:
  2803. // "mccyp11"
  2804. // "mccyp15"
  2805. // "mccyp7"
  2806. // "mccypA"
  2807. // "mccypUnrated"
  2808. MccypRating string `json:"mccypRating,omitempty"`
  2809. // McstRating: The video's rating system for Vietnam - MCST
  2810. //
  2811. // Possible values:
  2812. // "mcst0"
  2813. // "mcst16plus"
  2814. // "mcstC13"
  2815. // "mcstC16"
  2816. // "mcstC18"
  2817. // "mcstGPg"
  2818. // "mcstP"
  2819. // "mcstUnrated"
  2820. McstRating string `json:"mcstRating,omitempty"`
  2821. // MdaRating: The video's rating from Singapore's Media Development
  2822. // Authority (MDA) and, specifically, it's Board of Film Censors (BFC).
  2823. //
  2824. // Possible values:
  2825. // "mdaG"
  2826. // "mdaM18"
  2827. // "mdaNc16"
  2828. // "mdaPg"
  2829. // "mdaPg13"
  2830. // "mdaR21"
  2831. // "mdaUnrated"
  2832. MdaRating string `json:"mdaRating,omitempty"`
  2833. // MedietilsynetRating: The video's rating from Medietilsynet, the
  2834. // Norwegian Media Authority.
  2835. //
  2836. // Possible values:
  2837. // "medietilsynet11"
  2838. // "medietilsynet12"
  2839. // "medietilsynet15"
  2840. // "medietilsynet18"
  2841. // "medietilsynet6"
  2842. // "medietilsynet7"
  2843. // "medietilsynet9"
  2844. // "medietilsynetA"
  2845. // "medietilsynetUnrated"
  2846. MedietilsynetRating string `json:"medietilsynetRating,omitempty"`
  2847. // MekuRating: The video's rating from Finland's Kansallinen
  2848. // Audiovisuaalinen Instituutti (National Audiovisual Institute).
  2849. //
  2850. // Possible values:
  2851. // "meku12"
  2852. // "meku16"
  2853. // "meku18"
  2854. // "meku7"
  2855. // "mekuS"
  2856. // "mekuUnrated"
  2857. MekuRating string `json:"mekuRating,omitempty"`
  2858. // MenaMpaaRating: The rating system for MENA countries, a clone of
  2859. // MPAA. It is needed to
  2860. //
  2861. // Possible values:
  2862. // "menaMpaaG"
  2863. // "menaMpaaPg"
  2864. // "menaMpaaPg13"
  2865. // "menaMpaaR"
  2866. // "menaMpaaUnrated"
  2867. MenaMpaaRating string `json:"menaMpaaRating,omitempty"`
  2868. // MibacRating: The video's rating from the Ministero dei Beni e delle
  2869. // Attività Culturali e del Turismo (Italy).
  2870. //
  2871. // Possible values:
  2872. // "mibacT"
  2873. // "mibacUnrated"
  2874. // "mibacVap"
  2875. // "mibacVm12"
  2876. // "mibacVm14"
  2877. // "mibacVm18"
  2878. MibacRating string `json:"mibacRating,omitempty"`
  2879. // MocRating: The video's Ministerio de Cultura (Colombia) rating.
  2880. //
  2881. // Possible values:
  2882. // "moc12"
  2883. // "moc15"
  2884. // "moc18"
  2885. // "moc7"
  2886. // "mocBanned"
  2887. // "mocE"
  2888. // "mocT"
  2889. // "mocUnrated"
  2890. // "mocX"
  2891. MocRating string `json:"mocRating,omitempty"`
  2892. // MoctwRating: The video's rating from Taiwan's Ministry of Culture
  2893. // (文化部).
  2894. //
  2895. // Possible values:
  2896. // "moctwG"
  2897. // "moctwP"
  2898. // "moctwPg"
  2899. // "moctwR"
  2900. // "moctwR12"
  2901. // "moctwR15"
  2902. // "moctwUnrated"
  2903. MoctwRating string `json:"moctwRating,omitempty"`
  2904. // MpaaRating: The video's Motion Picture Association of America (MPAA)
  2905. // rating.
  2906. //
  2907. // Possible values:
  2908. // "mpaaG"
  2909. // "mpaaNc17"
  2910. // "mpaaPg"
  2911. // "mpaaPg13"
  2912. // "mpaaR"
  2913. // "mpaaUnrated"
  2914. MpaaRating string `json:"mpaaRating,omitempty"`
  2915. // MpaatRating: The rating system for trailer, DVD, and Ad in the US.
  2916. // See http://movielabs.com/md/ratings/v2.3/html/US_MPAAT_Ratings.html.
  2917. //
  2918. // Possible values:
  2919. // "mpaatGb"
  2920. // "mpaatRb"
  2921. MpaatRating string `json:"mpaatRating,omitempty"`
  2922. // MtrcbRating: The video's rating from the Movie and Television Review
  2923. // and Classification Board (Philippines).
  2924. //
  2925. // Possible values:
  2926. // "mtrcbG"
  2927. // "mtrcbPg"
  2928. // "mtrcbR13"
  2929. // "mtrcbR16"
  2930. // "mtrcbR18"
  2931. // "mtrcbUnrated"
  2932. // "mtrcbX"
  2933. MtrcbRating string `json:"mtrcbRating,omitempty"`
  2934. // NbcRating: The video's rating from the Maldives National Bureau of
  2935. // Classification.
  2936. //
  2937. // Possible values:
  2938. // "nbc12plus"
  2939. // "nbc15plus"
  2940. // "nbc18plus"
  2941. // "nbc18plusr"
  2942. // "nbcG"
  2943. // "nbcPg"
  2944. // "nbcPu"
  2945. // "nbcUnrated"
  2946. NbcRating string `json:"nbcRating,omitempty"`
  2947. // NbcplRating: The video's rating in Poland.
  2948. //
  2949. // Possible values:
  2950. // "nbcpl18plus"
  2951. // "nbcplI"
  2952. // "nbcplIi"
  2953. // "nbcplIii"
  2954. // "nbcplIv"
  2955. // "nbcplUnrated"
  2956. NbcplRating string `json:"nbcplRating,omitempty"`
  2957. // NfrcRating: The video's rating from the Bulgarian National Film
  2958. // Center.
  2959. //
  2960. // Possible values:
  2961. // "nfrcA"
  2962. // "nfrcB"
  2963. // "nfrcC"
  2964. // "nfrcD"
  2965. // "nfrcUnrated"
  2966. // "nfrcX"
  2967. NfrcRating string `json:"nfrcRating,omitempty"`
  2968. // NfvcbRating: The video's rating from Nigeria's National Film and
  2969. // Video Censors Board.
  2970. //
  2971. // Possible values:
  2972. // "nfvcb12"
  2973. // "nfvcb12a"
  2974. // "nfvcb15"
  2975. // "nfvcb18"
  2976. // "nfvcbG"
  2977. // "nfvcbPg"
  2978. // "nfvcbRe"
  2979. // "nfvcbUnrated"
  2980. NfvcbRating string `json:"nfvcbRating,omitempty"`
  2981. // NkclvRating: The video's rating from the Nacionãlais Kino centrs
  2982. // (National Film Centre of Latvia).
  2983. //
  2984. // Possible values:
  2985. // "nkclv12plus"
  2986. // "nkclv18plus"
  2987. // "nkclv7plus"
  2988. // "nkclvU"
  2989. // "nkclvUnrated"
  2990. NkclvRating string `json:"nkclvRating,omitempty"`
  2991. // OflcRating: The video's Office of Film and Literature Classification
  2992. // (OFLC - New Zealand) rating.
  2993. //
  2994. // Possible values:
  2995. // "oflcG"
  2996. // "oflcM"
  2997. // "oflcPg"
  2998. // "oflcR13"
  2999. // "oflcR15"
  3000. // "oflcR16"
  3001. // "oflcR18"
  3002. // "oflcRp13"
  3003. // "oflcRp16"
  3004. // "oflcRp18"
  3005. // "oflcUnrated"
  3006. OflcRating string `json:"oflcRating,omitempty"`
  3007. // PefilmRating: The video's rating in Peru.
  3008. //
  3009. // Possible values:
  3010. // "pefilm14"
  3011. // "pefilm18"
  3012. // "pefilmPg"
  3013. // "pefilmPt"
  3014. // "pefilmUnrated"
  3015. PefilmRating string `json:"pefilmRating,omitempty"`
  3016. // RcnofRating: The video's rating from the Hungarian Nemzeti Filmiroda,
  3017. // the Rating Committee of the National Office of Film.
  3018. //
  3019. // Possible values:
  3020. // "rcnofI"
  3021. // "rcnofIi"
  3022. // "rcnofIii"
  3023. // "rcnofIv"
  3024. // "rcnofUnrated"
  3025. // "rcnofV"
  3026. // "rcnofVi"
  3027. RcnofRating string `json:"rcnofRating,omitempty"`
  3028. // ResorteviolenciaRating: The video's rating in Venezuela.
  3029. //
  3030. // Possible values:
  3031. // "resorteviolenciaA"
  3032. // "resorteviolenciaB"
  3033. // "resorteviolenciaC"
  3034. // "resorteviolenciaD"
  3035. // "resorteviolenciaE"
  3036. // "resorteviolenciaUnrated"
  3037. ResorteviolenciaRating string `json:"resorteviolenciaRating,omitempty"`
  3038. // RtcRating: The video's General Directorate of Radio, Television and
  3039. // Cinematography (Mexico) rating.
  3040. //
  3041. // Possible values:
  3042. // "rtcA"
  3043. // "rtcAa"
  3044. // "rtcB"
  3045. // "rtcB15"
  3046. // "rtcC"
  3047. // "rtcD"
  3048. // "rtcUnrated"
  3049. RtcRating string `json:"rtcRating,omitempty"`
  3050. // RteRating: The video's rating from Ireland's Raidió Teilifís
  3051. // Éireann.
  3052. //
  3053. // Possible values:
  3054. // "rteCh"
  3055. // "rteGa"
  3056. // "rteMa"
  3057. // "rtePs"
  3058. // "rteUnrated"
  3059. RteRating string `json:"rteRating,omitempty"`
  3060. // RussiaRating: The video's National Film Registry of the Russian
  3061. // Federation (MKRF - Russia) rating.
  3062. //
  3063. // Possible values:
  3064. // "russia0"
  3065. // "russia12"
  3066. // "russia16"
  3067. // "russia18"
  3068. // "russia6"
  3069. // "russiaUnrated"
  3070. RussiaRating string `json:"russiaRating,omitempty"`
  3071. // SkfilmRating: The video's rating in Slovakia.
  3072. //
  3073. // Possible values:
  3074. // "skfilmG"
  3075. // "skfilmP2"
  3076. // "skfilmP5"
  3077. // "skfilmP8"
  3078. // "skfilmUnrated"
  3079. SkfilmRating string `json:"skfilmRating,omitempty"`
  3080. // SmaisRating: The video's rating in Iceland.
  3081. //
  3082. // Possible values:
  3083. // "smais12"
  3084. // "smais14"
  3085. // "smais16"
  3086. // "smais18"
  3087. // "smais7"
  3088. // "smaisL"
  3089. // "smaisUnrated"
  3090. SmaisRating string `json:"smaisRating,omitempty"`
  3091. // SmsaRating: The video's rating from Statens medieråd (Sweden's
  3092. // National Media Council).
  3093. //
  3094. // Possible values:
  3095. // "smsa11"
  3096. // "smsa15"
  3097. // "smsa7"
  3098. // "smsaA"
  3099. // "smsaUnrated"
  3100. SmsaRating string `json:"smsaRating,omitempty"`
  3101. // TvpgRating: The video's TV Parental Guidelines (TVPG) rating.
  3102. //
  3103. // Possible values:
  3104. // "pg14"
  3105. // "tvpgG"
  3106. // "tvpgMa"
  3107. // "tvpgPg"
  3108. // "tvpgUnrated"
  3109. // "tvpgY"
  3110. // "tvpgY7"
  3111. // "tvpgY7Fv"
  3112. TvpgRating string `json:"tvpgRating,omitempty"`
  3113. // YtRating: A rating that YouTube uses to identify age-restricted
  3114. // content.
  3115. //
  3116. // Possible values:
  3117. // "ytAgeRestricted"
  3118. YtRating string `json:"ytRating,omitempty"`
  3119. // ForceSendFields is a list of field names (e.g. "AcbRating") to
  3120. // unconditionally include in API requests. By default, fields with
  3121. // empty values are omitted from API requests. However, any non-pointer,
  3122. // non-interface field appearing in ForceSendFields will be sent to the
  3123. // server regardless of whether the field is empty or not. This may be
  3124. // used to include empty fields in Patch requests.
  3125. ForceSendFields []string `json:"-"`
  3126. // NullFields is a list of field names (e.g. "AcbRating") to include in
  3127. // API requests with the JSON null value. By default, fields with empty
  3128. // values are omitted from API requests. However, any field with an
  3129. // empty value appearing in NullFields will be sent to the server as
  3130. // null. It is an error if a field in this list has a non-empty value.
  3131. // This may be used to include null fields in Patch requests.
  3132. NullFields []string `json:"-"`
  3133. }
  3134. func (s *ContentRating) MarshalJSON() ([]byte, error) {
  3135. type NoMethod ContentRating
  3136. raw := NoMethod(*s)
  3137. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3138. }
  3139. // GeoPoint: Geographical coordinates of a point, in WGS84.
  3140. type GeoPoint struct {
  3141. // Altitude: Altitude above the reference ellipsoid, in meters.
  3142. Altitude float64 `json:"altitude,omitempty"`
  3143. // Latitude: Latitude in degrees.
  3144. Latitude float64 `json:"latitude,omitempty"`
  3145. // Longitude: Longitude in degrees.
  3146. Longitude float64 `json:"longitude,omitempty"`
  3147. // ForceSendFields is a list of field names (e.g. "Altitude") to
  3148. // unconditionally include in API requests. By default, fields with
  3149. // empty values are omitted from API requests. However, any non-pointer,
  3150. // non-interface field appearing in ForceSendFields will be sent to the
  3151. // server regardless of whether the field is empty or not. This may be
  3152. // used to include empty fields in Patch requests.
  3153. ForceSendFields []string `json:"-"`
  3154. // NullFields is a list of field names (e.g. "Altitude") to include in
  3155. // API requests with the JSON null value. By default, fields with empty
  3156. // values are omitted from API requests. However, any field with an
  3157. // empty value appearing in NullFields will be sent to the server as
  3158. // null. It is an error if a field in this list has a non-empty value.
  3159. // This may be used to include null fields in Patch requests.
  3160. NullFields []string `json:"-"`
  3161. }
  3162. func (s *GeoPoint) MarshalJSON() ([]byte, error) {
  3163. type NoMethod GeoPoint
  3164. raw := NoMethod(*s)
  3165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3166. }
  3167. func (s *GeoPoint) UnmarshalJSON(data []byte) error {
  3168. type NoMethod GeoPoint
  3169. var s1 struct {
  3170. Altitude gensupport.JSONFloat64 `json:"altitude"`
  3171. Latitude gensupport.JSONFloat64 `json:"latitude"`
  3172. Longitude gensupport.JSONFloat64 `json:"longitude"`
  3173. *NoMethod
  3174. }
  3175. s1.NoMethod = (*NoMethod)(s)
  3176. if err := json.Unmarshal(data, &s1); err != nil {
  3177. return err
  3178. }
  3179. s.Altitude = float64(s1.Altitude)
  3180. s.Latitude = float64(s1.Latitude)
  3181. s.Longitude = float64(s1.Longitude)
  3182. return nil
  3183. }
  3184. // GuideCategory: A guideCategory resource identifies a category that
  3185. // YouTube algorithmically assigns based on a channel's content or other
  3186. // indicators, such as the channel's popularity. The list is similar to
  3187. // video categories, with the difference being that a video's uploader
  3188. // can assign a video category but only YouTube can assign a channel
  3189. // category.
  3190. type GuideCategory struct {
  3191. // Etag: Etag of this resource.
  3192. Etag string `json:"etag,omitempty"`
  3193. // Id: The ID that YouTube uses to uniquely identify the guide category.
  3194. Id string `json:"id,omitempty"`
  3195. // Kind: Identifies what kind of resource this is. Value: the fixed
  3196. // string "youtube#guideCategory".
  3197. Kind string `json:"kind,omitempty"`
  3198. // Snippet: The snippet object contains basic details about the
  3199. // category, such as its title.
  3200. Snippet *GuideCategorySnippet `json:"snippet,omitempty"`
  3201. // ForceSendFields is a list of field names (e.g. "Etag") to
  3202. // unconditionally include in API requests. By default, fields with
  3203. // empty values are omitted from API requests. However, any non-pointer,
  3204. // non-interface field appearing in ForceSendFields will be sent to the
  3205. // server regardless of whether the field is empty or not. This may be
  3206. // used to include empty fields in Patch requests.
  3207. ForceSendFields []string `json:"-"`
  3208. // NullFields is a list of field names (e.g. "Etag") to include in API
  3209. // requests with the JSON null value. By default, fields with empty
  3210. // values are omitted from API requests. However, any field with an
  3211. // empty value appearing in NullFields will be sent to the server as
  3212. // null. It is an error if a field in this list has a non-empty value.
  3213. // This may be used to include null fields in Patch requests.
  3214. NullFields []string `json:"-"`
  3215. }
  3216. func (s *GuideCategory) MarshalJSON() ([]byte, error) {
  3217. type NoMethod GuideCategory
  3218. raw := NoMethod(*s)
  3219. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3220. }
  3221. type GuideCategoryListResponse struct {
  3222. // Etag: Etag of this resource.
  3223. Etag string `json:"etag,omitempty"`
  3224. // EventId: Serialized EventId of the request which produced this
  3225. // response.
  3226. EventId string `json:"eventId,omitempty"`
  3227. // Items: A list of categories that can be associated with YouTube
  3228. // channels. In this map, the category ID is the map key, and its value
  3229. // is the corresponding guideCategory resource.
  3230. Items []*GuideCategory `json:"items,omitempty"`
  3231. // Kind: Identifies what kind of resource this is. Value: the fixed
  3232. // string "youtube#guideCategoryListResponse".
  3233. Kind string `json:"kind,omitempty"`
  3234. // NextPageToken: The token that can be used as the value of the
  3235. // pageToken parameter to retrieve the next page in the result set.
  3236. NextPageToken string `json:"nextPageToken,omitempty"`
  3237. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  3238. // PrevPageToken: The token that can be used as the value of the
  3239. // pageToken parameter to retrieve the previous page in the result set.
  3240. PrevPageToken string `json:"prevPageToken,omitempty"`
  3241. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  3242. // VisitorId: The visitorId identifies the visitor.
  3243. VisitorId string `json:"visitorId,omitempty"`
  3244. // ServerResponse contains the HTTP response code and headers from the
  3245. // server.
  3246. googleapi.ServerResponse `json:"-"`
  3247. // ForceSendFields is a list of field names (e.g. "Etag") to
  3248. // unconditionally include in API requests. By default, fields with
  3249. // empty values are omitted from API requests. However, any non-pointer,
  3250. // non-interface field appearing in ForceSendFields will be sent to the
  3251. // server regardless of whether the field is empty or not. This may be
  3252. // used to include empty fields in Patch requests.
  3253. ForceSendFields []string `json:"-"`
  3254. // NullFields is a list of field names (e.g. "Etag") to include in API
  3255. // requests with the JSON null value. By default, fields with empty
  3256. // values are omitted from API requests. However, any field with an
  3257. // empty value appearing in NullFields will be sent to the server as
  3258. // null. It is an error if a field in this list has a non-empty value.
  3259. // This may be used to include null fields in Patch requests.
  3260. NullFields []string `json:"-"`
  3261. }
  3262. func (s *GuideCategoryListResponse) MarshalJSON() ([]byte, error) {
  3263. type NoMethod GuideCategoryListResponse
  3264. raw := NoMethod(*s)
  3265. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3266. }
  3267. // GuideCategorySnippet: Basic details about a guide category.
  3268. type GuideCategorySnippet struct {
  3269. ChannelId string `json:"channelId,omitempty"`
  3270. // Title: Description of the guide category.
  3271. Title string `json:"title,omitempty"`
  3272. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  3273. // unconditionally include in API requests. By default, fields with
  3274. // empty values are omitted from API requests. However, any non-pointer,
  3275. // non-interface field appearing in ForceSendFields will be sent to the
  3276. // server regardless of whether the field is empty or not. This may be
  3277. // used to include empty fields in Patch requests.
  3278. ForceSendFields []string `json:"-"`
  3279. // NullFields is a list of field names (e.g. "ChannelId") to include in
  3280. // API requests with the JSON null value. By default, fields with empty
  3281. // values are omitted from API requests. However, any field with an
  3282. // empty value appearing in NullFields will be sent to the server as
  3283. // null. It is an error if a field in this list has a non-empty value.
  3284. // This may be used to include null fields in Patch requests.
  3285. NullFields []string `json:"-"`
  3286. }
  3287. func (s *GuideCategorySnippet) MarshalJSON() ([]byte, error) {
  3288. type NoMethod GuideCategorySnippet
  3289. raw := NoMethod(*s)
  3290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3291. }
  3292. // I18nLanguage: An i18nLanguage resource identifies a UI language
  3293. // currently supported by YouTube.
  3294. type I18nLanguage struct {
  3295. // Etag: Etag of this resource.
  3296. Etag string `json:"etag,omitempty"`
  3297. // Id: The ID that YouTube uses to uniquely identify the i18n language.
  3298. Id string `json:"id,omitempty"`
  3299. // Kind: Identifies what kind of resource this is. Value: the fixed
  3300. // string "youtube#i18nLanguage".
  3301. Kind string `json:"kind,omitempty"`
  3302. // Snippet: The snippet object contains basic details about the i18n
  3303. // language, such as language code and human-readable name.
  3304. Snippet *I18nLanguageSnippet `json:"snippet,omitempty"`
  3305. // ForceSendFields is a list of field names (e.g. "Etag") to
  3306. // unconditionally include in API requests. By default, fields with
  3307. // empty values are omitted from API requests. However, any non-pointer,
  3308. // non-interface field appearing in ForceSendFields will be sent to the
  3309. // server regardless of whether the field is empty or not. This may be
  3310. // used to include empty fields in Patch requests.
  3311. ForceSendFields []string `json:"-"`
  3312. // NullFields is a list of field names (e.g. "Etag") to include in API
  3313. // requests with the JSON null value. By default, fields with empty
  3314. // values are omitted from API requests. However, any field with an
  3315. // empty value appearing in NullFields will be sent to the server as
  3316. // null. It is an error if a field in this list has a non-empty value.
  3317. // This may be used to include null fields in Patch requests.
  3318. NullFields []string `json:"-"`
  3319. }
  3320. func (s *I18nLanguage) MarshalJSON() ([]byte, error) {
  3321. type NoMethod I18nLanguage
  3322. raw := NoMethod(*s)
  3323. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3324. }
  3325. type I18nLanguageListResponse struct {
  3326. // Etag: Etag of this resource.
  3327. Etag string `json:"etag,omitempty"`
  3328. // EventId: Serialized EventId of the request which produced this
  3329. // response.
  3330. EventId string `json:"eventId,omitempty"`
  3331. // Items: A list of supported i18n languages. In this map, the i18n
  3332. // language ID is the map key, and its value is the corresponding
  3333. // i18nLanguage resource.
  3334. Items []*I18nLanguage `json:"items,omitempty"`
  3335. // Kind: Identifies what kind of resource this is. Value: the fixed
  3336. // string "youtube#i18nLanguageListResponse".
  3337. Kind string `json:"kind,omitempty"`
  3338. // VisitorId: The visitorId identifies the visitor.
  3339. VisitorId string `json:"visitorId,omitempty"`
  3340. // ServerResponse contains the HTTP response code and headers from the
  3341. // server.
  3342. googleapi.ServerResponse `json:"-"`
  3343. // ForceSendFields is a list of field names (e.g. "Etag") to
  3344. // unconditionally include in API requests. By default, fields with
  3345. // empty values are omitted from API requests. However, any non-pointer,
  3346. // non-interface field appearing in ForceSendFields will be sent to the
  3347. // server regardless of whether the field is empty or not. This may be
  3348. // used to include empty fields in Patch requests.
  3349. ForceSendFields []string `json:"-"`
  3350. // NullFields is a list of field names (e.g. "Etag") to include in API
  3351. // requests with the JSON null value. By default, fields with empty
  3352. // values are omitted from API requests. However, any field with an
  3353. // empty value appearing in NullFields will be sent to the server as
  3354. // null. It is an error if a field in this list has a non-empty value.
  3355. // This may be used to include null fields in Patch requests.
  3356. NullFields []string `json:"-"`
  3357. }
  3358. func (s *I18nLanguageListResponse) MarshalJSON() ([]byte, error) {
  3359. type NoMethod I18nLanguageListResponse
  3360. raw := NoMethod(*s)
  3361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3362. }
  3363. // I18nLanguageSnippet: Basic details about an i18n language, such as
  3364. // language code and human-readable name.
  3365. type I18nLanguageSnippet struct {
  3366. // Hl: A short BCP-47 code that uniquely identifies a language.
  3367. Hl string `json:"hl,omitempty"`
  3368. // Name: The human-readable name of the language in the language itself.
  3369. Name string `json:"name,omitempty"`
  3370. // ForceSendFields is a list of field names (e.g. "Hl") to
  3371. // unconditionally include in API requests. By default, fields with
  3372. // empty values are omitted from API requests. However, any non-pointer,
  3373. // non-interface field appearing in ForceSendFields will be sent to the
  3374. // server regardless of whether the field is empty or not. This may be
  3375. // used to include empty fields in Patch requests.
  3376. ForceSendFields []string `json:"-"`
  3377. // NullFields is a list of field names (e.g. "Hl") to include in API
  3378. // requests with the JSON null value. By default, fields with empty
  3379. // values are omitted from API requests. However, any field with an
  3380. // empty value appearing in NullFields will be sent to the server as
  3381. // null. It is an error if a field in this list has a non-empty value.
  3382. // This may be used to include null fields in Patch requests.
  3383. NullFields []string `json:"-"`
  3384. }
  3385. func (s *I18nLanguageSnippet) MarshalJSON() ([]byte, error) {
  3386. type NoMethod I18nLanguageSnippet
  3387. raw := NoMethod(*s)
  3388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3389. }
  3390. // I18nRegion: A i18nRegion resource identifies a region where YouTube
  3391. // is available.
  3392. type I18nRegion struct {
  3393. // Etag: Etag of this resource.
  3394. Etag string `json:"etag,omitempty"`
  3395. // Id: The ID that YouTube uses to uniquely identify the i18n region.
  3396. Id string `json:"id,omitempty"`
  3397. // Kind: Identifies what kind of resource this is. Value: the fixed
  3398. // string "youtube#i18nRegion".
  3399. Kind string `json:"kind,omitempty"`
  3400. // Snippet: The snippet object contains basic details about the i18n
  3401. // region, such as region code and human-readable name.
  3402. Snippet *I18nRegionSnippet `json:"snippet,omitempty"`
  3403. // ForceSendFields is a list of field names (e.g. "Etag") to
  3404. // unconditionally include in API requests. By default, fields with
  3405. // empty values are omitted from API requests. However, any non-pointer,
  3406. // non-interface field appearing in ForceSendFields will be sent to the
  3407. // server regardless of whether the field is empty or not. This may be
  3408. // used to include empty fields in Patch requests.
  3409. ForceSendFields []string `json:"-"`
  3410. // NullFields is a list of field names (e.g. "Etag") to include in API
  3411. // requests with the JSON null value. By default, fields with empty
  3412. // values are omitted from API requests. However, any field with an
  3413. // empty value appearing in NullFields will be sent to the server as
  3414. // null. It is an error if a field in this list has a non-empty value.
  3415. // This may be used to include null fields in Patch requests.
  3416. NullFields []string `json:"-"`
  3417. }
  3418. func (s *I18nRegion) MarshalJSON() ([]byte, error) {
  3419. type NoMethod I18nRegion
  3420. raw := NoMethod(*s)
  3421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3422. }
  3423. type I18nRegionListResponse struct {
  3424. // Etag: Etag of this resource.
  3425. Etag string `json:"etag,omitempty"`
  3426. // EventId: Serialized EventId of the request which produced this
  3427. // response.
  3428. EventId string `json:"eventId,omitempty"`
  3429. // Items: A list of regions where YouTube is available. In this map, the
  3430. // i18n region ID is the map key, and its value is the corresponding
  3431. // i18nRegion resource.
  3432. Items []*I18nRegion `json:"items,omitempty"`
  3433. // Kind: Identifies what kind of resource this is. Value: the fixed
  3434. // string "youtube#i18nRegionListResponse".
  3435. Kind string `json:"kind,omitempty"`
  3436. // VisitorId: The visitorId identifies the visitor.
  3437. VisitorId string `json:"visitorId,omitempty"`
  3438. // ServerResponse contains the HTTP response code and headers from the
  3439. // server.
  3440. googleapi.ServerResponse `json:"-"`
  3441. // ForceSendFields is a list of field names (e.g. "Etag") to
  3442. // unconditionally include in API requests. By default, fields with
  3443. // empty values are omitted from API requests. However, any non-pointer,
  3444. // non-interface field appearing in ForceSendFields will be sent to the
  3445. // server regardless of whether the field is empty or not. This may be
  3446. // used to include empty fields in Patch requests.
  3447. ForceSendFields []string `json:"-"`
  3448. // NullFields is a list of field names (e.g. "Etag") to include in API
  3449. // requests with the JSON null value. By default, fields with empty
  3450. // values are omitted from API requests. However, any field with an
  3451. // empty value appearing in NullFields will be sent to the server as
  3452. // null. It is an error if a field in this list has a non-empty value.
  3453. // This may be used to include null fields in Patch requests.
  3454. NullFields []string `json:"-"`
  3455. }
  3456. func (s *I18nRegionListResponse) MarshalJSON() ([]byte, error) {
  3457. type NoMethod I18nRegionListResponse
  3458. raw := NoMethod(*s)
  3459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3460. }
  3461. // I18nRegionSnippet: Basic details about an i18n region, such as region
  3462. // code and human-readable name.
  3463. type I18nRegionSnippet struct {
  3464. // Gl: The region code as a 2-letter ISO country code.
  3465. Gl string `json:"gl,omitempty"`
  3466. // Name: The human-readable name of the region.
  3467. Name string `json:"name,omitempty"`
  3468. // ForceSendFields is a list of field names (e.g. "Gl") to
  3469. // unconditionally include in API requests. By default, fields with
  3470. // empty values are omitted from API requests. However, any non-pointer,
  3471. // non-interface field appearing in ForceSendFields will be sent to the
  3472. // server regardless of whether the field is empty or not. This may be
  3473. // used to include empty fields in Patch requests.
  3474. ForceSendFields []string `json:"-"`
  3475. // NullFields is a list of field names (e.g. "Gl") to include in API
  3476. // requests with the JSON null value. By default, fields with empty
  3477. // values are omitted from API requests. However, any field with an
  3478. // empty value appearing in NullFields will be sent to the server as
  3479. // null. It is an error if a field in this list has a non-empty value.
  3480. // This may be used to include null fields in Patch requests.
  3481. NullFields []string `json:"-"`
  3482. }
  3483. func (s *I18nRegionSnippet) MarshalJSON() ([]byte, error) {
  3484. type NoMethod I18nRegionSnippet
  3485. raw := NoMethod(*s)
  3486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3487. }
  3488. // ImageSettings: Branding properties for images associated with the
  3489. // channel.
  3490. type ImageSettings struct {
  3491. // BackgroundImageUrl: The URL for the background image shown on the
  3492. // video watch page. The image should be 1200px by 615px, with a maximum
  3493. // file size of 128k.
  3494. BackgroundImageUrl *LocalizedProperty `json:"backgroundImageUrl,omitempty"`
  3495. // BannerExternalUrl: This is used only in update requests; if it's set,
  3496. // we use this URL to generate all of the above banner URLs.
  3497. BannerExternalUrl string `json:"bannerExternalUrl,omitempty"`
  3498. // BannerImageUrl: Banner image. Desktop size (1060x175).
  3499. BannerImageUrl string `json:"bannerImageUrl,omitempty"`
  3500. // BannerMobileExtraHdImageUrl: Banner image. Mobile size high
  3501. // resolution (1440x395).
  3502. BannerMobileExtraHdImageUrl string `json:"bannerMobileExtraHdImageUrl,omitempty"`
  3503. // BannerMobileHdImageUrl: Banner image. Mobile size high resolution
  3504. // (1280x360).
  3505. BannerMobileHdImageUrl string `json:"bannerMobileHdImageUrl,omitempty"`
  3506. // BannerMobileImageUrl: Banner image. Mobile size (640x175).
  3507. BannerMobileImageUrl string `json:"bannerMobileImageUrl,omitempty"`
  3508. // BannerMobileLowImageUrl: Banner image. Mobile size low resolution
  3509. // (320x88).
  3510. BannerMobileLowImageUrl string `json:"bannerMobileLowImageUrl,omitempty"`
  3511. // BannerMobileMediumHdImageUrl: Banner image. Mobile size medium/high
  3512. // resolution (960x263).
  3513. BannerMobileMediumHdImageUrl string `json:"bannerMobileMediumHdImageUrl,omitempty"`
  3514. // BannerTabletExtraHdImageUrl: Banner image. Tablet size extra high
  3515. // resolution (2560x424).
  3516. BannerTabletExtraHdImageUrl string `json:"bannerTabletExtraHdImageUrl,omitempty"`
  3517. // BannerTabletHdImageUrl: Banner image. Tablet size high resolution
  3518. // (2276x377).
  3519. BannerTabletHdImageUrl string `json:"bannerTabletHdImageUrl,omitempty"`
  3520. // BannerTabletImageUrl: Banner image. Tablet size (1707x283).
  3521. BannerTabletImageUrl string `json:"bannerTabletImageUrl,omitempty"`
  3522. // BannerTabletLowImageUrl: Banner image. Tablet size low resolution
  3523. // (1138x188).
  3524. BannerTabletLowImageUrl string `json:"bannerTabletLowImageUrl,omitempty"`
  3525. // BannerTvHighImageUrl: Banner image. TV size high resolution
  3526. // (1920x1080).
  3527. BannerTvHighImageUrl string `json:"bannerTvHighImageUrl,omitempty"`
  3528. // BannerTvImageUrl: Banner image. TV size extra high resolution
  3529. // (2120x1192).
  3530. BannerTvImageUrl string `json:"bannerTvImageUrl,omitempty"`
  3531. // BannerTvLowImageUrl: Banner image. TV size low resolution (854x480).
  3532. BannerTvLowImageUrl string `json:"bannerTvLowImageUrl,omitempty"`
  3533. // BannerTvMediumImageUrl: Banner image. TV size medium resolution
  3534. // (1280x720).
  3535. BannerTvMediumImageUrl string `json:"bannerTvMediumImageUrl,omitempty"`
  3536. // LargeBrandedBannerImageImapScript: The image map script for the large
  3537. // banner image.
  3538. LargeBrandedBannerImageImapScript *LocalizedProperty `json:"largeBrandedBannerImageImapScript,omitempty"`
  3539. // LargeBrandedBannerImageUrl: The URL for the 854px by 70px image that
  3540. // appears below the video player in the expanded video view of the
  3541. // video watch page.
  3542. LargeBrandedBannerImageUrl *LocalizedProperty `json:"largeBrandedBannerImageUrl,omitempty"`
  3543. // SmallBrandedBannerImageImapScript: The image map script for the small
  3544. // banner image.
  3545. SmallBrandedBannerImageImapScript *LocalizedProperty `json:"smallBrandedBannerImageImapScript,omitempty"`
  3546. // SmallBrandedBannerImageUrl: The URL for the 640px by 70px banner
  3547. // image that appears below the video player in the default view of the
  3548. // video watch page.
  3549. SmallBrandedBannerImageUrl *LocalizedProperty `json:"smallBrandedBannerImageUrl,omitempty"`
  3550. // TrackingImageUrl: The URL for a 1px by 1px tracking pixel that can be
  3551. // used to collect statistics for views of the channel or video pages.
  3552. TrackingImageUrl string `json:"trackingImageUrl,omitempty"`
  3553. // WatchIconImageUrl: The URL for the image that appears above the
  3554. // top-left corner of the video player. This is a 25-pixel-high image
  3555. // with a flexible width that cannot exceed 170 pixels.
  3556. WatchIconImageUrl string `json:"watchIconImageUrl,omitempty"`
  3557. // ForceSendFields is a list of field names (e.g. "BackgroundImageUrl")
  3558. // to unconditionally include in API requests. By default, fields with
  3559. // empty values are omitted from API requests. However, any non-pointer,
  3560. // non-interface field appearing in ForceSendFields will be sent to the
  3561. // server regardless of whether the field is empty or not. This may be
  3562. // used to include empty fields in Patch requests.
  3563. ForceSendFields []string `json:"-"`
  3564. // NullFields is a list of field names (e.g. "BackgroundImageUrl") to
  3565. // include in API requests with the JSON null value. By default, fields
  3566. // with empty values are omitted from API requests. However, any field
  3567. // with an empty value appearing in NullFields will be sent to the
  3568. // server as null. It is an error if a field in this list has a
  3569. // non-empty value. This may be used to include null fields in Patch
  3570. // requests.
  3571. NullFields []string `json:"-"`
  3572. }
  3573. func (s *ImageSettings) MarshalJSON() ([]byte, error) {
  3574. type NoMethod ImageSettings
  3575. raw := NoMethod(*s)
  3576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3577. }
  3578. // IngestionInfo: Describes information necessary for ingesting an RTMP
  3579. // or an HTTP stream.
  3580. type IngestionInfo struct {
  3581. // BackupIngestionAddress: The backup ingestion URL that you should use
  3582. // to stream video to YouTube. You have the option of simultaneously
  3583. // streaming the content that you are sending to the ingestionAddress to
  3584. // this URL.
  3585. BackupIngestionAddress string `json:"backupIngestionAddress,omitempty"`
  3586. // IngestionAddress: The primary ingestion URL that you should use to
  3587. // stream video to YouTube. You must stream video to this
  3588. // URL.
  3589. //
  3590. // Depending on which application or tool you use to encode your video
  3591. // stream, you may need to enter the stream URL and stream name
  3592. // separately or you may need to concatenate them in the following
  3593. // format:
  3594. //
  3595. // STREAM_URL/STREAM_NAME
  3596. IngestionAddress string `json:"ingestionAddress,omitempty"`
  3597. // StreamName: The HTTP or RTMP stream name that YouTube assigns to the
  3598. // video stream.
  3599. StreamName string `json:"streamName,omitempty"`
  3600. // ForceSendFields is a list of field names (e.g.
  3601. // "BackupIngestionAddress") to unconditionally include in API requests.
  3602. // By default, fields with empty values are omitted from API requests.
  3603. // However, any non-pointer, non-interface field appearing in
  3604. // ForceSendFields will be sent to the server regardless of whether the
  3605. // field is empty or not. This may be used to include empty fields in
  3606. // Patch requests.
  3607. ForceSendFields []string `json:"-"`
  3608. // NullFields is a list of field names (e.g. "BackupIngestionAddress")
  3609. // to include in API requests with the JSON null value. By default,
  3610. // fields with empty values are omitted from API requests. However, any
  3611. // field with an empty value appearing in NullFields will be sent to the
  3612. // server as null. It is an error if a field in this list has a
  3613. // non-empty value. This may be used to include null fields in Patch
  3614. // requests.
  3615. NullFields []string `json:"-"`
  3616. }
  3617. func (s *IngestionInfo) MarshalJSON() ([]byte, error) {
  3618. type NoMethod IngestionInfo
  3619. raw := NoMethod(*s)
  3620. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3621. }
  3622. type InvideoBranding struct {
  3623. ImageBytes string `json:"imageBytes,omitempty"`
  3624. ImageUrl string `json:"imageUrl,omitempty"`
  3625. Position *InvideoPosition `json:"position,omitempty"`
  3626. TargetChannelId string `json:"targetChannelId,omitempty"`
  3627. Timing *InvideoTiming `json:"timing,omitempty"`
  3628. // ForceSendFields is a list of field names (e.g. "ImageBytes") to
  3629. // unconditionally include in API requests. By default, fields with
  3630. // empty values are omitted from API requests. However, any non-pointer,
  3631. // non-interface field appearing in ForceSendFields will be sent to the
  3632. // server regardless of whether the field is empty or not. This may be
  3633. // used to include empty fields in Patch requests.
  3634. ForceSendFields []string `json:"-"`
  3635. // NullFields is a list of field names (e.g. "ImageBytes") to include in
  3636. // API requests with the JSON null value. By default, fields with empty
  3637. // values are omitted from API requests. However, any field with an
  3638. // empty value appearing in NullFields will be sent to the server as
  3639. // null. It is an error if a field in this list has a non-empty value.
  3640. // This may be used to include null fields in Patch requests.
  3641. NullFields []string `json:"-"`
  3642. }
  3643. func (s *InvideoBranding) MarshalJSON() ([]byte, error) {
  3644. type NoMethod InvideoBranding
  3645. raw := NoMethod(*s)
  3646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3647. }
  3648. // InvideoPosition: Describes the spatial position of a visual widget
  3649. // inside a video. It is a union of various position types, out of which
  3650. // only will be set one.
  3651. type InvideoPosition struct {
  3652. // CornerPosition: Describes in which corner of the video the visual
  3653. // widget will appear.
  3654. //
  3655. // Possible values:
  3656. // "bottomLeft"
  3657. // "bottomRight"
  3658. // "topLeft"
  3659. // "topRight"
  3660. CornerPosition string `json:"cornerPosition,omitempty"`
  3661. // Type: Defines the position type.
  3662. //
  3663. // Possible values:
  3664. // "corner"
  3665. Type string `json:"type,omitempty"`
  3666. // ForceSendFields is a list of field names (e.g. "CornerPosition") to
  3667. // unconditionally include in API requests. By default, fields with
  3668. // empty values are omitted from API requests. However, any non-pointer,
  3669. // non-interface field appearing in ForceSendFields will be sent to the
  3670. // server regardless of whether the field is empty or not. This may be
  3671. // used to include empty fields in Patch requests.
  3672. ForceSendFields []string `json:"-"`
  3673. // NullFields is a list of field names (e.g. "CornerPosition") to
  3674. // include in API requests with the JSON null value. By default, fields
  3675. // with empty values are omitted from API requests. However, any field
  3676. // with an empty value appearing in NullFields will be sent to the
  3677. // server as null. It is an error if a field in this list has a
  3678. // non-empty value. This may be used to include null fields in Patch
  3679. // requests.
  3680. NullFields []string `json:"-"`
  3681. }
  3682. func (s *InvideoPosition) MarshalJSON() ([]byte, error) {
  3683. type NoMethod InvideoPosition
  3684. raw := NoMethod(*s)
  3685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3686. }
  3687. // InvideoPromotion: Describes an invideo promotion campaign consisting
  3688. // of multiple promoted items. A campaign belongs to a single
  3689. // channel_id.
  3690. type InvideoPromotion struct {
  3691. // DefaultTiming: The default temporal position within the video where
  3692. // the promoted item will be displayed. Can be overriden by more
  3693. // specific timing in the item.
  3694. DefaultTiming *InvideoTiming `json:"defaultTiming,omitempty"`
  3695. // Items: List of promoted items in decreasing priority.
  3696. Items []*PromotedItem `json:"items,omitempty"`
  3697. // Position: The spatial position within the video where the promoted
  3698. // item will be displayed.
  3699. Position *InvideoPosition `json:"position,omitempty"`
  3700. // UseSmartTiming: Indicates whether the channel's promotional campaign
  3701. // uses "smart timing." This feature attempts to show promotions at a
  3702. // point in the video when they are more likely to be clicked and less
  3703. // likely to disrupt the viewing experience. This feature also picks up
  3704. // a single promotion to show on each video.
  3705. UseSmartTiming bool `json:"useSmartTiming,omitempty"`
  3706. // ForceSendFields is a list of field names (e.g. "DefaultTiming") to
  3707. // unconditionally include in API requests. By default, fields with
  3708. // empty values are omitted from API requests. However, any non-pointer,
  3709. // non-interface field appearing in ForceSendFields will be sent to the
  3710. // server regardless of whether the field is empty or not. This may be
  3711. // used to include empty fields in Patch requests.
  3712. ForceSendFields []string `json:"-"`
  3713. // NullFields is a list of field names (e.g. "DefaultTiming") to include
  3714. // in API requests with the JSON null value. By default, fields with
  3715. // empty values are omitted from API requests. However, any field with
  3716. // an empty value appearing in NullFields will be sent to the server as
  3717. // null. It is an error if a field in this list has a non-empty value.
  3718. // This may be used to include null fields in Patch requests.
  3719. NullFields []string `json:"-"`
  3720. }
  3721. func (s *InvideoPromotion) MarshalJSON() ([]byte, error) {
  3722. type NoMethod InvideoPromotion
  3723. raw := NoMethod(*s)
  3724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3725. }
  3726. // InvideoTiming: Describes a temporal position of a visual widget
  3727. // inside a video.
  3728. type InvideoTiming struct {
  3729. // DurationMs: Defines the duration in milliseconds for which the
  3730. // promotion should be displayed. If missing, the client should use the
  3731. // default.
  3732. DurationMs uint64 `json:"durationMs,omitempty,string"`
  3733. // OffsetMs: Defines the time at which the promotion will appear.
  3734. // Depending on the value of type the value of the offsetMs field will
  3735. // represent a time offset from the start or from the end of the video,
  3736. // expressed in milliseconds.
  3737. OffsetMs uint64 `json:"offsetMs,omitempty,string"`
  3738. // Type: Describes a timing type. If the value is offsetFromStart, then
  3739. // the offsetMs field represents an offset from the start of the video.
  3740. // If the value is offsetFromEnd, then the offsetMs field represents an
  3741. // offset from the end of the video.
  3742. //
  3743. // Possible values:
  3744. // "offsetFromEnd"
  3745. // "offsetFromStart"
  3746. Type string `json:"type,omitempty"`
  3747. // ForceSendFields is a list of field names (e.g. "DurationMs") to
  3748. // unconditionally include in API requests. By default, fields with
  3749. // empty values are omitted from API requests. However, any non-pointer,
  3750. // non-interface field appearing in ForceSendFields will be sent to the
  3751. // server regardless of whether the field is empty or not. This may be
  3752. // used to include empty fields in Patch requests.
  3753. ForceSendFields []string `json:"-"`
  3754. // NullFields is a list of field names (e.g. "DurationMs") to include in
  3755. // API requests with the JSON null value. By default, fields with empty
  3756. // values are omitted from API requests. However, any field with an
  3757. // empty value appearing in NullFields will be sent to the server as
  3758. // null. It is an error if a field in this list has a non-empty value.
  3759. // This may be used to include null fields in Patch requests.
  3760. NullFields []string `json:"-"`
  3761. }
  3762. func (s *InvideoTiming) MarshalJSON() ([]byte, error) {
  3763. type NoMethod InvideoTiming
  3764. raw := NoMethod(*s)
  3765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3766. }
  3767. type LanguageTag struct {
  3768. Value string `json:"value,omitempty"`
  3769. // ForceSendFields is a list of field names (e.g. "Value") to
  3770. // unconditionally include in API requests. By default, fields with
  3771. // empty values are omitted from API requests. However, any non-pointer,
  3772. // non-interface field appearing in ForceSendFields will be sent to the
  3773. // server regardless of whether the field is empty or not. This may be
  3774. // used to include empty fields in Patch requests.
  3775. ForceSendFields []string `json:"-"`
  3776. // NullFields is a list of field names (e.g. "Value") to include in API
  3777. // requests with the JSON null value. By default, fields with empty
  3778. // values are omitted from API requests. However, any field with an
  3779. // empty value appearing in NullFields will be sent to the server as
  3780. // null. It is an error if a field in this list has a non-empty value.
  3781. // This may be used to include null fields in Patch requests.
  3782. NullFields []string `json:"-"`
  3783. }
  3784. func (s *LanguageTag) MarshalJSON() ([]byte, error) {
  3785. type NoMethod LanguageTag
  3786. raw := NoMethod(*s)
  3787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3788. }
  3789. // LiveBroadcast: A liveBroadcast resource represents an event that will
  3790. // be streamed, via live video, on YouTube.
  3791. type LiveBroadcast struct {
  3792. // ContentDetails: The contentDetails object contains information about
  3793. // the event's video content, such as whether the content can be shown
  3794. // in an embedded video player or if it will be archived and therefore
  3795. // available for viewing after the event has concluded.
  3796. ContentDetails *LiveBroadcastContentDetails `json:"contentDetails,omitempty"`
  3797. // Etag: Etag of this resource.
  3798. Etag string `json:"etag,omitempty"`
  3799. // Id: The ID that YouTube assigns to uniquely identify the broadcast.
  3800. Id string `json:"id,omitempty"`
  3801. // Kind: Identifies what kind of resource this is. Value: the fixed
  3802. // string "youtube#liveBroadcast".
  3803. Kind string `json:"kind,omitempty"`
  3804. // Snippet: The snippet object contains basic details about the event,
  3805. // including its title, description, start time, and end time.
  3806. Snippet *LiveBroadcastSnippet `json:"snippet,omitempty"`
  3807. // Statistics: The statistics object contains info about the event's
  3808. // current stats. These include concurrent viewers and total chat count.
  3809. // Statistics can change (in either direction) during the lifetime of an
  3810. // event. Statistics are only returned while the event is live.
  3811. Statistics *LiveBroadcastStatistics `json:"statistics,omitempty"`
  3812. // Status: The status object contains information about the event's
  3813. // status.
  3814. Status *LiveBroadcastStatus `json:"status,omitempty"`
  3815. // ServerResponse contains the HTTP response code and headers from the
  3816. // server.
  3817. googleapi.ServerResponse `json:"-"`
  3818. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  3819. // unconditionally include in API requests. By default, fields with
  3820. // empty values are omitted from API requests. However, any non-pointer,
  3821. // non-interface field appearing in ForceSendFields will be sent to the
  3822. // server regardless of whether the field is empty or not. This may be
  3823. // used to include empty fields in Patch requests.
  3824. ForceSendFields []string `json:"-"`
  3825. // NullFields is a list of field names (e.g. "ContentDetails") to
  3826. // include in API requests with the JSON null value. By default, fields
  3827. // with empty values are omitted from API requests. However, any field
  3828. // with an empty value appearing in NullFields will be sent to the
  3829. // server as null. It is an error if a field in this list has a
  3830. // non-empty value. This may be used to include null fields in Patch
  3831. // requests.
  3832. NullFields []string `json:"-"`
  3833. }
  3834. func (s *LiveBroadcast) MarshalJSON() ([]byte, error) {
  3835. type NoMethod LiveBroadcast
  3836. raw := NoMethod(*s)
  3837. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3838. }
  3839. // LiveBroadcastContentDetails: Detailed settings of a broadcast.
  3840. type LiveBroadcastContentDetails struct {
  3841. // BoundStreamId: This value uniquely identifies the live stream bound
  3842. // to the broadcast.
  3843. BoundStreamId string `json:"boundStreamId,omitempty"`
  3844. // BoundStreamLastUpdateTimeMs: The date and time that the live stream
  3845. // referenced by boundStreamId was last updated.
  3846. BoundStreamLastUpdateTimeMs string `json:"boundStreamLastUpdateTimeMs,omitempty"`
  3847. // Possible values:
  3848. // "closedCaptionsDisabled"
  3849. // "closedCaptionsEmbedded"
  3850. // "closedCaptionsHttpPost"
  3851. ClosedCaptionsType string `json:"closedCaptionsType,omitempty"`
  3852. // EnableAutoStart: This setting indicates whether auto start is enabled
  3853. // for this broadcast.
  3854. EnableAutoStart bool `json:"enableAutoStart,omitempty"`
  3855. // EnableClosedCaptions: This setting indicates whether HTTP POST closed
  3856. // captioning is enabled for this broadcast. The ingestion URL of the
  3857. // closed captions is returned through the liveStreams API. This is
  3858. // mutually exclusive with using the closed_captions_type property, and
  3859. // is equivalent to setting closed_captions_type to
  3860. // CLOSED_CAPTIONS_HTTP_POST.
  3861. EnableClosedCaptions bool `json:"enableClosedCaptions,omitempty"`
  3862. // EnableContentEncryption: This setting indicates whether YouTube
  3863. // should enable content encryption for the broadcast.
  3864. EnableContentEncryption bool `json:"enableContentEncryption,omitempty"`
  3865. // EnableDvr: This setting determines whether viewers can access DVR
  3866. // controls while watching the video. DVR controls enable the viewer to
  3867. // control the video playback experience by pausing, rewinding, or fast
  3868. // forwarding content. The default value for this property is
  3869. // true.
  3870. //
  3871. //
  3872. //
  3873. // Important: You must set the value to true and also set the
  3874. // enableArchive property's value to true if you want to make playback
  3875. // available immediately after the broadcast ends.
  3876. EnableDvr bool `json:"enableDvr,omitempty"`
  3877. // EnableEmbed: This setting indicates whether the broadcast video can
  3878. // be played in an embedded player. If you choose to archive the video
  3879. // (using the enableArchive property), this setting will also apply to
  3880. // the archived video.
  3881. EnableEmbed bool `json:"enableEmbed,omitempty"`
  3882. // EnableLowLatency: Indicates whether this broadcast has low latency
  3883. // enabled.
  3884. EnableLowLatency bool `json:"enableLowLatency,omitempty"`
  3885. // LatencyPreference: If both this and enable_low_latency are set, they
  3886. // must match. LATENCY_NORMAL should match enable_low_latency=false
  3887. // LATENCY_LOW should match enable_low_latency=true LATENCY_ULTRA_LOW
  3888. // should have enable_low_latency omitted.
  3889. //
  3890. // Possible values:
  3891. // "low"
  3892. // "normal"
  3893. // "ultraLow"
  3894. LatencyPreference string `json:"latencyPreference,omitempty"`
  3895. Mesh string `json:"mesh,omitempty"`
  3896. // MonitorStream: The monitorStream object contains information about
  3897. // the monitor stream, which the broadcaster can use to review the event
  3898. // content before the broadcast stream is shown publicly.
  3899. MonitorStream *MonitorStreamInfo `json:"monitorStream,omitempty"`
  3900. // Projection: The projection format of this broadcast. This defaults to
  3901. // rectangular.
  3902. //
  3903. // Possible values:
  3904. // "360"
  3905. // "mesh"
  3906. // "rectangular"
  3907. Projection string `json:"projection,omitempty"`
  3908. // RecordFromStart: Automatically start recording after the event goes
  3909. // live. The default value for this property is true.
  3910. //
  3911. //
  3912. //
  3913. // Important: You must also set the enableDvr property's value to true
  3914. // if you want the playback to be available immediately after the
  3915. // broadcast ends. If you set this property's value to true but do not
  3916. // also set the enableDvr property to true, there may be a delay of
  3917. // around one day before the archived video will be available for
  3918. // playback.
  3919. RecordFromStart bool `json:"recordFromStart,omitempty"`
  3920. // StartWithSlate: This setting indicates whether the broadcast should
  3921. // automatically begin with an in-stream slate when you update the
  3922. // broadcast's status to live. After updating the status, you then need
  3923. // to send a liveCuepoints.insert request that sets the cuepoint's
  3924. // eventState to end to remove the in-stream slate and make your
  3925. // broadcast stream visible to viewers.
  3926. StartWithSlate bool `json:"startWithSlate,omitempty"`
  3927. // Possible values:
  3928. // "left_right"
  3929. // "mono"
  3930. // "top_bottom"
  3931. StereoLayout string `json:"stereoLayout,omitempty"`
  3932. // ForceSendFields is a list of field names (e.g. "BoundStreamId") to
  3933. // unconditionally include in API requests. By default, fields with
  3934. // empty values are omitted from API requests. However, any non-pointer,
  3935. // non-interface field appearing in ForceSendFields will be sent to the
  3936. // server regardless of whether the field is empty or not. This may be
  3937. // used to include empty fields in Patch requests.
  3938. ForceSendFields []string `json:"-"`
  3939. // NullFields is a list of field names (e.g. "BoundStreamId") to include
  3940. // in API requests with the JSON null value. By default, fields with
  3941. // empty values are omitted from API requests. However, any field with
  3942. // an empty value appearing in NullFields will be sent to the server as
  3943. // null. It is an error if a field in this list has a non-empty value.
  3944. // This may be used to include null fields in Patch requests.
  3945. NullFields []string `json:"-"`
  3946. }
  3947. func (s *LiveBroadcastContentDetails) MarshalJSON() ([]byte, error) {
  3948. type NoMethod LiveBroadcastContentDetails
  3949. raw := NoMethod(*s)
  3950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3951. }
  3952. type LiveBroadcastListResponse struct {
  3953. // Etag: Etag of this resource.
  3954. Etag string `json:"etag,omitempty"`
  3955. // EventId: Serialized EventId of the request which produced this
  3956. // response.
  3957. EventId string `json:"eventId,omitempty"`
  3958. // Items: A list of broadcasts that match the request criteria.
  3959. Items []*LiveBroadcast `json:"items,omitempty"`
  3960. // Kind: Identifies what kind of resource this is. Value: the fixed
  3961. // string "youtube#liveBroadcastListResponse".
  3962. Kind string `json:"kind,omitempty"`
  3963. // NextPageToken: The token that can be used as the value of the
  3964. // pageToken parameter to retrieve the next page in the result set.
  3965. NextPageToken string `json:"nextPageToken,omitempty"`
  3966. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  3967. // PrevPageToken: The token that can be used as the value of the
  3968. // pageToken parameter to retrieve the previous page in the result set.
  3969. PrevPageToken string `json:"prevPageToken,omitempty"`
  3970. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  3971. // VisitorId: The visitorId identifies the visitor.
  3972. VisitorId string `json:"visitorId,omitempty"`
  3973. // ServerResponse contains the HTTP response code and headers from the
  3974. // server.
  3975. googleapi.ServerResponse `json:"-"`
  3976. // ForceSendFields is a list of field names (e.g. "Etag") to
  3977. // unconditionally include in API requests. By default, fields with
  3978. // empty values are omitted from API requests. However, any non-pointer,
  3979. // non-interface field appearing in ForceSendFields will be sent to the
  3980. // server regardless of whether the field is empty or not. This may be
  3981. // used to include empty fields in Patch requests.
  3982. ForceSendFields []string `json:"-"`
  3983. // NullFields is a list of field names (e.g. "Etag") to include in API
  3984. // requests with the JSON null value. By default, fields with empty
  3985. // values are omitted from API requests. However, any field with an
  3986. // empty value appearing in NullFields will be sent to the server as
  3987. // null. It is an error if a field in this list has a non-empty value.
  3988. // This may be used to include null fields in Patch requests.
  3989. NullFields []string `json:"-"`
  3990. }
  3991. func (s *LiveBroadcastListResponse) MarshalJSON() ([]byte, error) {
  3992. type NoMethod LiveBroadcastListResponse
  3993. raw := NoMethod(*s)
  3994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3995. }
  3996. type LiveBroadcastSnippet struct {
  3997. // ActualEndTime: The date and time that the broadcast actually ended.
  3998. // This information is only available once the broadcast's state is
  3999. // complete. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4000. // format.
  4001. ActualEndTime string `json:"actualEndTime,omitempty"`
  4002. // ActualStartTime: The date and time that the broadcast actually
  4003. // started. This information is only available once the broadcast's
  4004. // state is live. The value is specified in ISO 8601
  4005. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4006. ActualStartTime string `json:"actualStartTime,omitempty"`
  4007. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  4008. // that is publishing the broadcast.
  4009. ChannelId string `json:"channelId,omitempty"`
  4010. // Description: The broadcast's description. As with the title, you can
  4011. // set this field by modifying the broadcast resource or by setting the
  4012. // description field of the corresponding video resource.
  4013. Description string `json:"description,omitempty"`
  4014. IsDefaultBroadcast bool `json:"isDefaultBroadcast,omitempty"`
  4015. // LiveChatId: The id of the live chat for this broadcast.
  4016. LiveChatId string `json:"liveChatId,omitempty"`
  4017. // PublishedAt: The date and time that the broadcast was added to
  4018. // YouTube's live broadcast schedule. The value is specified in ISO 8601
  4019. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4020. PublishedAt string `json:"publishedAt,omitempty"`
  4021. // ScheduledEndTime: The date and time that the broadcast is scheduled
  4022. // to end. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4023. // format.
  4024. ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
  4025. // ScheduledStartTime: The date and time that the broadcast is scheduled
  4026. // to start. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  4027. // format.
  4028. ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
  4029. // Thumbnails: A map of thumbnail images associated with the broadcast.
  4030. // For each nested object in this object, the key is the name of the
  4031. // thumbnail image, and the value is an object that contains other
  4032. // information about the thumbnail.
  4033. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  4034. // Title: The broadcast's title. Note that the broadcast represents
  4035. // exactly one YouTube video. You can set this field by modifying the
  4036. // broadcast resource or by setting the title field of the corresponding
  4037. // video resource.
  4038. Title string `json:"title,omitempty"`
  4039. // ForceSendFields is a list of field names (e.g. "ActualEndTime") to
  4040. // unconditionally include in API requests. By default, fields with
  4041. // empty values are omitted from API requests. However, any non-pointer,
  4042. // non-interface field appearing in ForceSendFields will be sent to the
  4043. // server regardless of whether the field is empty or not. This may be
  4044. // used to include empty fields in Patch requests.
  4045. ForceSendFields []string `json:"-"`
  4046. // NullFields is a list of field names (e.g. "ActualEndTime") to include
  4047. // in API requests with the JSON null value. By default, fields with
  4048. // empty values are omitted from API requests. However, any field with
  4049. // an empty value appearing in NullFields will be sent to the server as
  4050. // null. It is an error if a field in this list has a non-empty value.
  4051. // This may be used to include null fields in Patch requests.
  4052. NullFields []string `json:"-"`
  4053. }
  4054. func (s *LiveBroadcastSnippet) MarshalJSON() ([]byte, error) {
  4055. type NoMethod LiveBroadcastSnippet
  4056. raw := NoMethod(*s)
  4057. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4058. }
  4059. // LiveBroadcastStatistics: Statistics about the live broadcast. These
  4060. // represent a snapshot of the values at the time of the request.
  4061. // Statistics are only returned for live broadcasts.
  4062. type LiveBroadcastStatistics struct {
  4063. // ConcurrentViewers: The number of viewers currently watching the
  4064. // broadcast. The property and its value will be present if the
  4065. // broadcast has current viewers and the broadcast owner has not hidden
  4066. // the viewcount for the video. Note that YouTube stops tracking the
  4067. // number of concurrent viewers for a broadcast when the broadcast ends.
  4068. // So, this property would not identify the number of viewers watching
  4069. // an archived video of a live broadcast that already ended.
  4070. ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
  4071. // TotalChatCount: The total number of live chat messages currently on
  4072. // the broadcast. The property and its value will be present if the
  4073. // broadcast is public, has the live chat feature enabled, and has at
  4074. // least one message. Note that this field will not be filled after the
  4075. // broadcast ends. So this property would not identify the number of
  4076. // chat messages for an archived video of a completed live broadcast.
  4077. TotalChatCount uint64 `json:"totalChatCount,omitempty,string"`
  4078. // ForceSendFields is a list of field names (e.g. "ConcurrentViewers")
  4079. // to unconditionally include in API requests. By default, fields with
  4080. // empty values are omitted from API requests. However, any non-pointer,
  4081. // non-interface field appearing in ForceSendFields will be sent to the
  4082. // server regardless of whether the field is empty or not. This may be
  4083. // used to include empty fields in Patch requests.
  4084. ForceSendFields []string `json:"-"`
  4085. // NullFields is a list of field names (e.g. "ConcurrentViewers") to
  4086. // include in API requests with the JSON null value. By default, fields
  4087. // with empty values are omitted from API requests. However, any field
  4088. // with an empty value appearing in NullFields will be sent to the
  4089. // server as null. It is an error if a field in this list has a
  4090. // non-empty value. This may be used to include null fields in Patch
  4091. // requests.
  4092. NullFields []string `json:"-"`
  4093. }
  4094. func (s *LiveBroadcastStatistics) MarshalJSON() ([]byte, error) {
  4095. type NoMethod LiveBroadcastStatistics
  4096. raw := NoMethod(*s)
  4097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4098. }
  4099. type LiveBroadcastStatus struct {
  4100. // LifeCycleStatus: The broadcast's status. The status can be updated
  4101. // using the API's liveBroadcasts.transition method.
  4102. //
  4103. // Possible values:
  4104. // "abandoned"
  4105. // "complete"
  4106. // "completeStarting"
  4107. // "created"
  4108. // "live"
  4109. // "liveStarting"
  4110. // "ready"
  4111. // "reclaimed"
  4112. // "revoked"
  4113. // "testStarting"
  4114. // "testing"
  4115. LifeCycleStatus string `json:"lifeCycleStatus,omitempty"`
  4116. // LiveBroadcastPriority: Priority of the live broadcast event (internal
  4117. // state).
  4118. //
  4119. // Possible values:
  4120. // "high"
  4121. // "low"
  4122. // "normal"
  4123. LiveBroadcastPriority string `json:"liveBroadcastPriority,omitempty"`
  4124. // PrivacyStatus: The broadcast's privacy status. Note that the
  4125. // broadcast represents exactly one YouTube video, so the privacy
  4126. // settings are identical to those supported for videos. In addition,
  4127. // you can set this field by modifying the broadcast resource or by
  4128. // setting the privacyStatus field of the corresponding video resource.
  4129. //
  4130. // Possible values:
  4131. // "private"
  4132. // "public"
  4133. // "unlisted"
  4134. // "unlisted_new"
  4135. PrivacyStatus string `json:"privacyStatus,omitempty"`
  4136. // RecordingStatus: The broadcast's recording status.
  4137. //
  4138. // Possible values:
  4139. // "notRecording"
  4140. // "recorded"
  4141. // "recording"
  4142. RecordingStatus string `json:"recordingStatus,omitempty"`
  4143. // ForceSendFields is a list of field names (e.g. "LifeCycleStatus") to
  4144. // unconditionally include in API requests. By default, fields with
  4145. // empty values are omitted from API requests. However, any non-pointer,
  4146. // non-interface field appearing in ForceSendFields will be sent to the
  4147. // server regardless of whether the field is empty or not. This may be
  4148. // used to include empty fields in Patch requests.
  4149. ForceSendFields []string `json:"-"`
  4150. // NullFields is a list of field names (e.g. "LifeCycleStatus") to
  4151. // include in API requests with the JSON null value. By default, fields
  4152. // with empty values are omitted from API requests. However, any field
  4153. // with an empty value appearing in NullFields will be sent to the
  4154. // server as null. It is an error if a field in this list has a
  4155. // non-empty value. This may be used to include null fields in Patch
  4156. // requests.
  4157. NullFields []string `json:"-"`
  4158. }
  4159. func (s *LiveBroadcastStatus) MarshalJSON() ([]byte, error) {
  4160. type NoMethod LiveBroadcastStatus
  4161. raw := NoMethod(*s)
  4162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4163. }
  4164. // LiveChatBan: A liveChatBan resource represents a ban for a YouTube
  4165. // live chat.
  4166. type LiveChatBan struct {
  4167. // Etag: Etag of this resource.
  4168. Etag string `json:"etag,omitempty"`
  4169. // Id: The ID that YouTube assigns to uniquely identify the ban.
  4170. Id string `json:"id,omitempty"`
  4171. // Kind: Identifies what kind of resource this is. Value: the fixed
  4172. // string "youtube#liveChatBan".
  4173. Kind string `json:"kind,omitempty"`
  4174. // Snippet: The snippet object contains basic details about the ban.
  4175. Snippet *LiveChatBanSnippet `json:"snippet,omitempty"`
  4176. // ServerResponse contains the HTTP response code and headers from the
  4177. // server.
  4178. googleapi.ServerResponse `json:"-"`
  4179. // ForceSendFields is a list of field names (e.g. "Etag") to
  4180. // unconditionally include in API requests. By default, fields with
  4181. // empty values are omitted from API requests. However, any non-pointer,
  4182. // non-interface field appearing in ForceSendFields will be sent to the
  4183. // server regardless of whether the field is empty or not. This may be
  4184. // used to include empty fields in Patch requests.
  4185. ForceSendFields []string `json:"-"`
  4186. // NullFields is a list of field names (e.g. "Etag") to include in API
  4187. // requests with the JSON null value. By default, fields with empty
  4188. // values are omitted from API requests. However, any field with an
  4189. // empty value appearing in NullFields will be sent to the server as
  4190. // null. It is an error if a field in this list has a non-empty value.
  4191. // This may be used to include null fields in Patch requests.
  4192. NullFields []string `json:"-"`
  4193. }
  4194. func (s *LiveChatBan) MarshalJSON() ([]byte, error) {
  4195. type NoMethod LiveChatBan
  4196. raw := NoMethod(*s)
  4197. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4198. }
  4199. type LiveChatBanSnippet struct {
  4200. // BanDurationSeconds: The duration of a ban, only filled if the ban has
  4201. // type TEMPORARY.
  4202. BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
  4203. BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
  4204. // LiveChatId: The chat this ban is pertinent to.
  4205. LiveChatId string `json:"liveChatId,omitempty"`
  4206. // Type: The type of ban.
  4207. //
  4208. // Possible values:
  4209. // "permanent"
  4210. // "temporary"
  4211. Type string `json:"type,omitempty"`
  4212. // ForceSendFields is a list of field names (e.g. "BanDurationSeconds")
  4213. // to unconditionally include in API requests. By default, fields with
  4214. // empty values are omitted from API requests. However, any non-pointer,
  4215. // non-interface field appearing in ForceSendFields will be sent to the
  4216. // server regardless of whether the field is empty or not. This may be
  4217. // used to include empty fields in Patch requests.
  4218. ForceSendFields []string `json:"-"`
  4219. // NullFields is a list of field names (e.g. "BanDurationSeconds") to
  4220. // include in API requests with the JSON null value. By default, fields
  4221. // with empty values are omitted from API requests. However, any field
  4222. // with an empty value appearing in NullFields will be sent to the
  4223. // server as null. It is an error if a field in this list has a
  4224. // non-empty value. This may be used to include null fields in Patch
  4225. // requests.
  4226. NullFields []string `json:"-"`
  4227. }
  4228. func (s *LiveChatBanSnippet) MarshalJSON() ([]byte, error) {
  4229. type NoMethod LiveChatBanSnippet
  4230. raw := NoMethod(*s)
  4231. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4232. }
  4233. type LiveChatFanFundingEventDetails struct {
  4234. // AmountDisplayString: A rendered string that displays the fund amount
  4235. // and currency to the user.
  4236. AmountDisplayString string `json:"amountDisplayString,omitempty"`
  4237. // AmountMicros: The amount of the fund.
  4238. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  4239. // Currency: The currency in which the fund was made.
  4240. Currency string `json:"currency,omitempty"`
  4241. // UserComment: The comment added by the user to this fan funding event.
  4242. UserComment string `json:"userComment,omitempty"`
  4243. // ForceSendFields is a list of field names (e.g. "AmountDisplayString")
  4244. // to unconditionally include in API requests. By default, fields with
  4245. // empty values are omitted from API requests. However, any non-pointer,
  4246. // non-interface field appearing in ForceSendFields will be sent to the
  4247. // server regardless of whether the field is empty or not. This may be
  4248. // used to include empty fields in Patch requests.
  4249. ForceSendFields []string `json:"-"`
  4250. // NullFields is a list of field names (e.g. "AmountDisplayString") to
  4251. // include in API requests with the JSON null value. By default, fields
  4252. // with empty values are omitted from API requests. However, any field
  4253. // with an empty value appearing in NullFields will be sent to the
  4254. // server as null. It is an error if a field in this list has a
  4255. // non-empty value. This may be used to include null fields in Patch
  4256. // requests.
  4257. NullFields []string `json:"-"`
  4258. }
  4259. func (s *LiveChatFanFundingEventDetails) MarshalJSON() ([]byte, error) {
  4260. type NoMethod LiveChatFanFundingEventDetails
  4261. raw := NoMethod(*s)
  4262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4263. }
  4264. // LiveChatMessage: A liveChatMessage resource represents a chat message
  4265. // in a YouTube Live Chat.
  4266. type LiveChatMessage struct {
  4267. // AuthorDetails: The authorDetails object contains basic details about
  4268. // the user that posted this message.
  4269. AuthorDetails *LiveChatMessageAuthorDetails `json:"authorDetails,omitempty"`
  4270. // Etag: Etag of this resource.
  4271. Etag string `json:"etag,omitempty"`
  4272. // Id: The ID that YouTube assigns to uniquely identify the message.
  4273. Id string `json:"id,omitempty"`
  4274. // Kind: Identifies what kind of resource this is. Value: the fixed
  4275. // string "youtube#liveChatMessage".
  4276. Kind string `json:"kind,omitempty"`
  4277. // Snippet: The snippet object contains basic details about the message.
  4278. Snippet *LiveChatMessageSnippet `json:"snippet,omitempty"`
  4279. // ServerResponse contains the HTTP response code and headers from the
  4280. // server.
  4281. googleapi.ServerResponse `json:"-"`
  4282. // ForceSendFields is a list of field names (e.g. "AuthorDetails") to
  4283. // unconditionally include in API requests. By default, fields with
  4284. // empty values are omitted from API requests. However, any non-pointer,
  4285. // non-interface field appearing in ForceSendFields will be sent to the
  4286. // server regardless of whether the field is empty or not. This may be
  4287. // used to include empty fields in Patch requests.
  4288. ForceSendFields []string `json:"-"`
  4289. // NullFields is a list of field names (e.g. "AuthorDetails") to include
  4290. // in API requests with the JSON null value. By default, fields with
  4291. // empty values are omitted from API requests. However, any field with
  4292. // an empty value appearing in NullFields will be sent to the server as
  4293. // null. It is an error if a field in this list has a non-empty value.
  4294. // This may be used to include null fields in Patch requests.
  4295. NullFields []string `json:"-"`
  4296. }
  4297. func (s *LiveChatMessage) MarshalJSON() ([]byte, error) {
  4298. type NoMethod LiveChatMessage
  4299. raw := NoMethod(*s)
  4300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4301. }
  4302. type LiveChatMessageAuthorDetails struct {
  4303. // ChannelId: The YouTube channel ID.
  4304. ChannelId string `json:"channelId,omitempty"`
  4305. // ChannelUrl: The channel's URL.
  4306. ChannelUrl string `json:"channelUrl,omitempty"`
  4307. // DisplayName: The channel's display name.
  4308. DisplayName string `json:"displayName,omitempty"`
  4309. // IsChatModerator: Whether the author is a moderator of the live chat.
  4310. IsChatModerator bool `json:"isChatModerator,omitempty"`
  4311. // IsChatOwner: Whether the author is the owner of the live chat.
  4312. IsChatOwner bool `json:"isChatOwner,omitempty"`
  4313. // IsChatSponsor: Whether the author is a sponsor of the live chat.
  4314. IsChatSponsor bool `json:"isChatSponsor,omitempty"`
  4315. // IsVerified: Whether the author's identity has been verified by
  4316. // YouTube.
  4317. IsVerified bool `json:"isVerified,omitempty"`
  4318. // ProfileImageUrl: The channels's avatar URL.
  4319. ProfileImageUrl string `json:"profileImageUrl,omitempty"`
  4320. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  4321. // unconditionally include in API requests. By default, fields with
  4322. // empty values are omitted from API requests. However, any non-pointer,
  4323. // non-interface field appearing in ForceSendFields will be sent to the
  4324. // server regardless of whether the field is empty or not. This may be
  4325. // used to include empty fields in Patch requests.
  4326. ForceSendFields []string `json:"-"`
  4327. // NullFields is a list of field names (e.g. "ChannelId") to include in
  4328. // API requests with the JSON null value. By default, fields with empty
  4329. // values are omitted from API requests. However, any field with an
  4330. // empty value appearing in NullFields will be sent to the server as
  4331. // null. It is an error if a field in this list has a non-empty value.
  4332. // This may be used to include null fields in Patch requests.
  4333. NullFields []string `json:"-"`
  4334. }
  4335. func (s *LiveChatMessageAuthorDetails) MarshalJSON() ([]byte, error) {
  4336. type NoMethod LiveChatMessageAuthorDetails
  4337. raw := NoMethod(*s)
  4338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4339. }
  4340. type LiveChatMessageDeletedDetails struct {
  4341. DeletedMessageId string `json:"deletedMessageId,omitempty"`
  4342. // ForceSendFields is a list of field names (e.g. "DeletedMessageId") to
  4343. // unconditionally include in API requests. By default, fields with
  4344. // empty values are omitted from API requests. However, any non-pointer,
  4345. // non-interface field appearing in ForceSendFields will be sent to the
  4346. // server regardless of whether the field is empty or not. This may be
  4347. // used to include empty fields in Patch requests.
  4348. ForceSendFields []string `json:"-"`
  4349. // NullFields is a list of field names (e.g. "DeletedMessageId") to
  4350. // include in API requests with the JSON null value. By default, fields
  4351. // with empty values are omitted from API requests. However, any field
  4352. // with an empty value appearing in NullFields will be sent to the
  4353. // server as null. It is an error if a field in this list has a
  4354. // non-empty value. This may be used to include null fields in Patch
  4355. // requests.
  4356. NullFields []string `json:"-"`
  4357. }
  4358. func (s *LiveChatMessageDeletedDetails) MarshalJSON() ([]byte, error) {
  4359. type NoMethod LiveChatMessageDeletedDetails
  4360. raw := NoMethod(*s)
  4361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4362. }
  4363. type LiveChatMessageListResponse struct {
  4364. // Etag: Etag of this resource.
  4365. Etag string `json:"etag,omitempty"`
  4366. // EventId: Serialized EventId of the request which produced this
  4367. // response.
  4368. EventId string `json:"eventId,omitempty"`
  4369. // Items: A list of live chat messages.
  4370. Items []*LiveChatMessage `json:"items,omitempty"`
  4371. // Kind: Identifies what kind of resource this is. Value: the fixed
  4372. // string "youtube#liveChatMessageListResponse".
  4373. Kind string `json:"kind,omitempty"`
  4374. // NextPageToken: The token that can be used as the value of the
  4375. // pageToken parameter to retrieve the next page in the result set.
  4376. NextPageToken string `json:"nextPageToken,omitempty"`
  4377. // OfflineAt: The date and time when the underlying stream went offline.
  4378. // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  4379. OfflineAt string `json:"offlineAt,omitempty"`
  4380. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4381. // PollingIntervalMillis: The amount of time the client should wait
  4382. // before polling again.
  4383. PollingIntervalMillis int64 `json:"pollingIntervalMillis,omitempty"`
  4384. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4385. // VisitorId: The visitorId identifies the visitor.
  4386. VisitorId string `json:"visitorId,omitempty"`
  4387. // ServerResponse contains the HTTP response code and headers from the
  4388. // server.
  4389. googleapi.ServerResponse `json:"-"`
  4390. // ForceSendFields is a list of field names (e.g. "Etag") to
  4391. // unconditionally include in API requests. By default, fields with
  4392. // empty values are omitted from API requests. However, any non-pointer,
  4393. // non-interface field appearing in ForceSendFields will be sent to the
  4394. // server regardless of whether the field is empty or not. This may be
  4395. // used to include empty fields in Patch requests.
  4396. ForceSendFields []string `json:"-"`
  4397. // NullFields is a list of field names (e.g. "Etag") to include in API
  4398. // requests with the JSON null value. By default, fields with empty
  4399. // values are omitted from API requests. However, any field with an
  4400. // empty value appearing in NullFields will be sent to the server as
  4401. // null. It is an error if a field in this list has a non-empty value.
  4402. // This may be used to include null fields in Patch requests.
  4403. NullFields []string `json:"-"`
  4404. }
  4405. func (s *LiveChatMessageListResponse) MarshalJSON() ([]byte, error) {
  4406. type NoMethod LiveChatMessageListResponse
  4407. raw := NoMethod(*s)
  4408. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4409. }
  4410. type LiveChatMessageRetractedDetails struct {
  4411. RetractedMessageId string `json:"retractedMessageId,omitempty"`
  4412. // ForceSendFields is a list of field names (e.g. "RetractedMessageId")
  4413. // to unconditionally include in API requests. By default, fields with
  4414. // empty values are omitted from API requests. However, any non-pointer,
  4415. // non-interface field appearing in ForceSendFields will be sent to the
  4416. // server regardless of whether the field is empty or not. This may be
  4417. // used to include empty fields in Patch requests.
  4418. ForceSendFields []string `json:"-"`
  4419. // NullFields is a list of field names (e.g. "RetractedMessageId") to
  4420. // include in API requests with the JSON null value. By default, fields
  4421. // with empty values are omitted from API requests. However, any field
  4422. // with an empty value appearing in NullFields will be sent to the
  4423. // server as null. It is an error if a field in this list has a
  4424. // non-empty value. This may be used to include null fields in Patch
  4425. // requests.
  4426. NullFields []string `json:"-"`
  4427. }
  4428. func (s *LiveChatMessageRetractedDetails) MarshalJSON() ([]byte, error) {
  4429. type NoMethod LiveChatMessageRetractedDetails
  4430. raw := NoMethod(*s)
  4431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4432. }
  4433. type LiveChatMessageSnippet struct {
  4434. // AuthorChannelId: The ID of the user that authored this message, this
  4435. // field is not always filled. textMessageEvent - the user that wrote
  4436. // the message fanFundingEvent - the user that funded the broadcast
  4437. // newSponsorEvent - the user that just became a sponsor
  4438. // messageDeletedEvent - the moderator that took the action
  4439. // messageRetractedEvent - the author that retracted their message
  4440. // userBannedEvent - the moderator that took the action superChatEvent -
  4441. // the user that made the purchase
  4442. AuthorChannelId string `json:"authorChannelId,omitempty"`
  4443. // DisplayMessage: Contains a string that can be displayed to the user.
  4444. // If this field is not present the message is silent, at the moment
  4445. // only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent.
  4446. DisplayMessage string `json:"displayMessage,omitempty"`
  4447. // FanFundingEventDetails: Details about the funding event, this is only
  4448. // set if the type is 'fanFundingEvent'.
  4449. FanFundingEventDetails *LiveChatFanFundingEventDetails `json:"fanFundingEventDetails,omitempty"`
  4450. // HasDisplayContent: Whether the message has display content that
  4451. // should be displayed to users.
  4452. HasDisplayContent bool `json:"hasDisplayContent,omitempty"`
  4453. LiveChatId string `json:"liveChatId,omitempty"`
  4454. MessageDeletedDetails *LiveChatMessageDeletedDetails `json:"messageDeletedDetails,omitempty"`
  4455. MessageRetractedDetails *LiveChatMessageRetractedDetails `json:"messageRetractedDetails,omitempty"`
  4456. PollClosedDetails *LiveChatPollClosedDetails `json:"pollClosedDetails,omitempty"`
  4457. PollEditedDetails *LiveChatPollEditedDetails `json:"pollEditedDetails,omitempty"`
  4458. PollOpenedDetails *LiveChatPollOpenedDetails `json:"pollOpenedDetails,omitempty"`
  4459. PollVotedDetails *LiveChatPollVotedDetails `json:"pollVotedDetails,omitempty"`
  4460. // PublishedAt: The date and time when the message was orignally
  4461. // published. The value is specified in ISO 8601
  4462. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  4463. PublishedAt string `json:"publishedAt,omitempty"`
  4464. // SuperChatDetails: Details about the Super Chat event, this is only
  4465. // set if the type is 'superChatEvent'.
  4466. SuperChatDetails *LiveChatSuperChatDetails `json:"superChatDetails,omitempty"`
  4467. // TextMessageDetails: Details about the text message, this is only set
  4468. // if the type is 'textMessageEvent'.
  4469. TextMessageDetails *LiveChatTextMessageDetails `json:"textMessageDetails,omitempty"`
  4470. // Type: The type of message, this will always be present, it determines
  4471. // the contents of the message as well as which fields will be present.
  4472. //
  4473. // Possible values:
  4474. // "chatEndedEvent"
  4475. // "fanFundingEvent"
  4476. // "messageDeletedEvent"
  4477. // "messageRetractedEvent"
  4478. // "newSponsorEvent"
  4479. // "pollClosedEvent"
  4480. // "pollEditedEvent"
  4481. // "pollOpenedEvent"
  4482. // "pollVotedEvent"
  4483. // "sponsorOnlyModeEndedEvent"
  4484. // "sponsorOnlyModeStartedEvent"
  4485. // "superChatEvent"
  4486. // "textMessageEvent"
  4487. // "tombstone"
  4488. // "userBannedEvent"
  4489. Type string `json:"type,omitempty"`
  4490. UserBannedDetails *LiveChatUserBannedMessageDetails `json:"userBannedDetails,omitempty"`
  4491. // ForceSendFields is a list of field names (e.g. "AuthorChannelId") to
  4492. // unconditionally include in API requests. By default, fields with
  4493. // empty values are omitted from API requests. However, any non-pointer,
  4494. // non-interface field appearing in ForceSendFields will be sent to the
  4495. // server regardless of whether the field is empty or not. This may be
  4496. // used to include empty fields in Patch requests.
  4497. ForceSendFields []string `json:"-"`
  4498. // NullFields is a list of field names (e.g. "AuthorChannelId") to
  4499. // include in API requests with the JSON null value. By default, fields
  4500. // with empty values are omitted from API requests. However, any field
  4501. // with an empty value appearing in NullFields will be sent to the
  4502. // server as null. It is an error if a field in this list has a
  4503. // non-empty value. This may be used to include null fields in Patch
  4504. // requests.
  4505. NullFields []string `json:"-"`
  4506. }
  4507. func (s *LiveChatMessageSnippet) MarshalJSON() ([]byte, error) {
  4508. type NoMethod LiveChatMessageSnippet
  4509. raw := NoMethod(*s)
  4510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4511. }
  4512. // LiveChatModerator: A liveChatModerator resource represents a
  4513. // moderator for a YouTube live chat. A chat moderator has the ability
  4514. // to ban/unban users from a chat, remove message, etc.
  4515. type LiveChatModerator struct {
  4516. // Etag: Etag of this resource.
  4517. Etag string `json:"etag,omitempty"`
  4518. // Id: The ID that YouTube assigns to uniquely identify the moderator.
  4519. Id string `json:"id,omitempty"`
  4520. // Kind: Identifies what kind of resource this is. Value: the fixed
  4521. // string "youtube#liveChatModerator".
  4522. Kind string `json:"kind,omitempty"`
  4523. // Snippet: The snippet object contains basic details about the
  4524. // moderator.
  4525. Snippet *LiveChatModeratorSnippet `json:"snippet,omitempty"`
  4526. // ServerResponse contains the HTTP response code and headers from the
  4527. // server.
  4528. googleapi.ServerResponse `json:"-"`
  4529. // ForceSendFields is a list of field names (e.g. "Etag") to
  4530. // unconditionally include in API requests. By default, fields with
  4531. // empty values are omitted from API requests. However, any non-pointer,
  4532. // non-interface field appearing in ForceSendFields will be sent to the
  4533. // server regardless of whether the field is empty or not. This may be
  4534. // used to include empty fields in Patch requests.
  4535. ForceSendFields []string `json:"-"`
  4536. // NullFields is a list of field names (e.g. "Etag") to include in API
  4537. // requests with the JSON null value. By default, fields with empty
  4538. // values are omitted from API requests. However, any field with an
  4539. // empty value appearing in NullFields will be sent to the server as
  4540. // null. It is an error if a field in this list has a non-empty value.
  4541. // This may be used to include null fields in Patch requests.
  4542. NullFields []string `json:"-"`
  4543. }
  4544. func (s *LiveChatModerator) MarshalJSON() ([]byte, error) {
  4545. type NoMethod LiveChatModerator
  4546. raw := NoMethod(*s)
  4547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4548. }
  4549. type LiveChatModeratorListResponse struct {
  4550. // Etag: Etag of this resource.
  4551. Etag string `json:"etag,omitempty"`
  4552. // EventId: Serialized EventId of the request which produced this
  4553. // response.
  4554. EventId string `json:"eventId,omitempty"`
  4555. // Items: A list of moderators that match the request criteria.
  4556. Items []*LiveChatModerator `json:"items,omitempty"`
  4557. // Kind: Identifies what kind of resource this is. Value: the fixed
  4558. // string "youtube#liveChatModeratorListResponse".
  4559. Kind string `json:"kind,omitempty"`
  4560. // NextPageToken: The token that can be used as the value of the
  4561. // pageToken parameter to retrieve the next page in the result set.
  4562. NextPageToken string `json:"nextPageToken,omitempty"`
  4563. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  4564. // PrevPageToken: The token that can be used as the value of the
  4565. // pageToken parameter to retrieve the previous page in the result set.
  4566. PrevPageToken string `json:"prevPageToken,omitempty"`
  4567. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  4568. // VisitorId: The visitorId identifies the visitor.
  4569. VisitorId string `json:"visitorId,omitempty"`
  4570. // ServerResponse contains the HTTP response code and headers from the
  4571. // server.
  4572. googleapi.ServerResponse `json:"-"`
  4573. // ForceSendFields is a list of field names (e.g. "Etag") to
  4574. // unconditionally include in API requests. By default, fields with
  4575. // empty values are omitted from API requests. However, any non-pointer,
  4576. // non-interface field appearing in ForceSendFields will be sent to the
  4577. // server regardless of whether the field is empty or not. This may be
  4578. // used to include empty fields in Patch requests.
  4579. ForceSendFields []string `json:"-"`
  4580. // NullFields is a list of field names (e.g. "Etag") to include in API
  4581. // requests with the JSON null value. By default, fields with empty
  4582. // values are omitted from API requests. However, any field with an
  4583. // empty value appearing in NullFields will be sent to the server as
  4584. // null. It is an error if a field in this list has a non-empty value.
  4585. // This may be used to include null fields in Patch requests.
  4586. NullFields []string `json:"-"`
  4587. }
  4588. func (s *LiveChatModeratorListResponse) MarshalJSON() ([]byte, error) {
  4589. type NoMethod LiveChatModeratorListResponse
  4590. raw := NoMethod(*s)
  4591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4592. }
  4593. type LiveChatModeratorSnippet struct {
  4594. // LiveChatId: The ID of the live chat this moderator can act on.
  4595. LiveChatId string `json:"liveChatId,omitempty"`
  4596. // ModeratorDetails: Details about the moderator.
  4597. ModeratorDetails *ChannelProfileDetails `json:"moderatorDetails,omitempty"`
  4598. // ForceSendFields is a list of field names (e.g. "LiveChatId") to
  4599. // unconditionally include in API requests. By default, fields with
  4600. // empty values are omitted from API requests. However, any non-pointer,
  4601. // non-interface field appearing in ForceSendFields will be sent to the
  4602. // server regardless of whether the field is empty or not. This may be
  4603. // used to include empty fields in Patch requests.
  4604. ForceSendFields []string `json:"-"`
  4605. // NullFields is a list of field names (e.g. "LiveChatId") to include in
  4606. // API requests with the JSON null value. By default, fields with empty
  4607. // values are omitted from API requests. However, any field with an
  4608. // empty value appearing in NullFields will be sent to the server as
  4609. // null. It is an error if a field in this list has a non-empty value.
  4610. // This may be used to include null fields in Patch requests.
  4611. NullFields []string `json:"-"`
  4612. }
  4613. func (s *LiveChatModeratorSnippet) MarshalJSON() ([]byte, error) {
  4614. type NoMethod LiveChatModeratorSnippet
  4615. raw := NoMethod(*s)
  4616. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4617. }
  4618. type LiveChatPollClosedDetails struct {
  4619. // PollId: The id of the poll that was closed.
  4620. PollId string `json:"pollId,omitempty"`
  4621. // ForceSendFields is a list of field names (e.g. "PollId") to
  4622. // unconditionally include in API requests. By default, fields with
  4623. // empty values are omitted from API requests. However, any non-pointer,
  4624. // non-interface field appearing in ForceSendFields will be sent to the
  4625. // server regardless of whether the field is empty or not. This may be
  4626. // used to include empty fields in Patch requests.
  4627. ForceSendFields []string `json:"-"`
  4628. // NullFields is a list of field names (e.g. "PollId") to include in API
  4629. // requests with the JSON null value. By default, fields with empty
  4630. // values are omitted from API requests. However, any field with an
  4631. // empty value appearing in NullFields will be sent to the server as
  4632. // null. It is an error if a field in this list has a non-empty value.
  4633. // This may be used to include null fields in Patch requests.
  4634. NullFields []string `json:"-"`
  4635. }
  4636. func (s *LiveChatPollClosedDetails) MarshalJSON() ([]byte, error) {
  4637. type NoMethod LiveChatPollClosedDetails
  4638. raw := NoMethod(*s)
  4639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4640. }
  4641. type LiveChatPollEditedDetails struct {
  4642. Id string `json:"id,omitempty"`
  4643. Items []*LiveChatPollItem `json:"items,omitempty"`
  4644. Prompt string `json:"prompt,omitempty"`
  4645. // ForceSendFields is a list of field names (e.g. "Id") to
  4646. // unconditionally include in API requests. By default, fields with
  4647. // empty values are omitted from API requests. However, any non-pointer,
  4648. // non-interface field appearing in ForceSendFields will be sent to the
  4649. // server regardless of whether the field is empty or not. This may be
  4650. // used to include empty fields in Patch requests.
  4651. ForceSendFields []string `json:"-"`
  4652. // NullFields is a list of field names (e.g. "Id") to include in API
  4653. // requests with the JSON null value. By default, fields with empty
  4654. // values are omitted from API requests. However, any field with an
  4655. // empty value appearing in NullFields will be sent to the server as
  4656. // null. It is an error if a field in this list has a non-empty value.
  4657. // This may be used to include null fields in Patch requests.
  4658. NullFields []string `json:"-"`
  4659. }
  4660. func (s *LiveChatPollEditedDetails) MarshalJSON() ([]byte, error) {
  4661. type NoMethod LiveChatPollEditedDetails
  4662. raw := NoMethod(*s)
  4663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4664. }
  4665. type LiveChatPollItem struct {
  4666. // Description: Plain text description of the item.
  4667. Description string `json:"description,omitempty"`
  4668. ItemId string `json:"itemId,omitempty"`
  4669. // ForceSendFields is a list of field names (e.g. "Description") to
  4670. // unconditionally include in API requests. By default, fields with
  4671. // empty values are omitted from API requests. However, any non-pointer,
  4672. // non-interface field appearing in ForceSendFields will be sent to the
  4673. // server regardless of whether the field is empty or not. This may be
  4674. // used to include empty fields in Patch requests.
  4675. ForceSendFields []string `json:"-"`
  4676. // NullFields is a list of field names (e.g. "Description") to include
  4677. // in API requests with the JSON null value. By default, fields with
  4678. // empty values are omitted from API requests. However, any field with
  4679. // an empty value appearing in NullFields will be sent to the server as
  4680. // null. It is an error if a field in this list has a non-empty value.
  4681. // This may be used to include null fields in Patch requests.
  4682. NullFields []string `json:"-"`
  4683. }
  4684. func (s *LiveChatPollItem) MarshalJSON() ([]byte, error) {
  4685. type NoMethod LiveChatPollItem
  4686. raw := NoMethod(*s)
  4687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4688. }
  4689. type LiveChatPollOpenedDetails struct {
  4690. Id string `json:"id,omitempty"`
  4691. Items []*LiveChatPollItem `json:"items,omitempty"`
  4692. Prompt string `json:"prompt,omitempty"`
  4693. // ForceSendFields is a list of field names (e.g. "Id") to
  4694. // unconditionally include in API requests. By default, fields with
  4695. // empty values are omitted from API requests. However, any non-pointer,
  4696. // non-interface field appearing in ForceSendFields will be sent to the
  4697. // server regardless of whether the field is empty or not. This may be
  4698. // used to include empty fields in Patch requests.
  4699. ForceSendFields []string `json:"-"`
  4700. // NullFields is a list of field names (e.g. "Id") to include in API
  4701. // requests with the JSON null value. By default, fields with empty
  4702. // values are omitted from API requests. However, any field with an
  4703. // empty value appearing in NullFields will be sent to the server as
  4704. // null. It is an error if a field in this list has a non-empty value.
  4705. // This may be used to include null fields in Patch requests.
  4706. NullFields []string `json:"-"`
  4707. }
  4708. func (s *LiveChatPollOpenedDetails) MarshalJSON() ([]byte, error) {
  4709. type NoMethod LiveChatPollOpenedDetails
  4710. raw := NoMethod(*s)
  4711. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4712. }
  4713. type LiveChatPollVotedDetails struct {
  4714. // ItemId: The poll item the user chose.
  4715. ItemId string `json:"itemId,omitempty"`
  4716. // PollId: The poll the user voted on.
  4717. PollId string `json:"pollId,omitempty"`
  4718. // ForceSendFields is a list of field names (e.g. "ItemId") to
  4719. // unconditionally include in API requests. By default, fields with
  4720. // empty values are omitted from API requests. However, any non-pointer,
  4721. // non-interface field appearing in ForceSendFields will be sent to the
  4722. // server regardless of whether the field is empty or not. This may be
  4723. // used to include empty fields in Patch requests.
  4724. ForceSendFields []string `json:"-"`
  4725. // NullFields is a list of field names (e.g. "ItemId") to include in API
  4726. // requests with the JSON null value. By default, fields with empty
  4727. // values are omitted from API requests. However, any field with an
  4728. // empty value appearing in NullFields will be sent to the server as
  4729. // null. It is an error if a field in this list has a non-empty value.
  4730. // This may be used to include null fields in Patch requests.
  4731. NullFields []string `json:"-"`
  4732. }
  4733. func (s *LiveChatPollVotedDetails) MarshalJSON() ([]byte, error) {
  4734. type NoMethod LiveChatPollVotedDetails
  4735. raw := NoMethod(*s)
  4736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4737. }
  4738. type LiveChatSuperChatDetails struct {
  4739. // AmountDisplayString: A rendered string that displays the fund amount
  4740. // and currency to the user.
  4741. AmountDisplayString string `json:"amountDisplayString,omitempty"`
  4742. // AmountMicros: The amount purchased by the user, in micros (1,750,000
  4743. // micros = 1.75).
  4744. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  4745. // Currency: The currency in which the purchase was made.
  4746. Currency string `json:"currency,omitempty"`
  4747. // Tier: The tier in which the amount belongs to. Lower amounts belong
  4748. // to lower tiers. Starts at 1.
  4749. Tier int64 `json:"tier,omitempty"`
  4750. // UserComment: The comment added by the user to this Super Chat event.
  4751. UserComment string `json:"userComment,omitempty"`
  4752. // ForceSendFields is a list of field names (e.g. "AmountDisplayString")
  4753. // to unconditionally include in API requests. By default, fields with
  4754. // empty values are omitted from API requests. However, any non-pointer,
  4755. // non-interface field appearing in ForceSendFields will be sent to the
  4756. // server regardless of whether the field is empty or not. This may be
  4757. // used to include empty fields in Patch requests.
  4758. ForceSendFields []string `json:"-"`
  4759. // NullFields is a list of field names (e.g. "AmountDisplayString") to
  4760. // include in API requests with the JSON null value. By default, fields
  4761. // with empty values are omitted from API requests. However, any field
  4762. // with an empty value appearing in NullFields will be sent to the
  4763. // server as null. It is an error if a field in this list has a
  4764. // non-empty value. This may be used to include null fields in Patch
  4765. // requests.
  4766. NullFields []string `json:"-"`
  4767. }
  4768. func (s *LiveChatSuperChatDetails) MarshalJSON() ([]byte, error) {
  4769. type NoMethod LiveChatSuperChatDetails
  4770. raw := NoMethod(*s)
  4771. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4772. }
  4773. type LiveChatTextMessageDetails struct {
  4774. // MessageText: The user's message.
  4775. MessageText string `json:"messageText,omitempty"`
  4776. // ForceSendFields is a list of field names (e.g. "MessageText") to
  4777. // unconditionally include in API requests. By default, fields with
  4778. // empty values are omitted from API requests. However, any non-pointer,
  4779. // non-interface field appearing in ForceSendFields will be sent to the
  4780. // server regardless of whether the field is empty or not. This may be
  4781. // used to include empty fields in Patch requests.
  4782. ForceSendFields []string `json:"-"`
  4783. // NullFields is a list of field names (e.g. "MessageText") to include
  4784. // in API requests with the JSON null value. By default, fields with
  4785. // empty values are omitted from API requests. However, any field with
  4786. // an empty value appearing in NullFields will be sent to the server as
  4787. // null. It is an error if a field in this list has a non-empty value.
  4788. // This may be used to include null fields in Patch requests.
  4789. NullFields []string `json:"-"`
  4790. }
  4791. func (s *LiveChatTextMessageDetails) MarshalJSON() ([]byte, error) {
  4792. type NoMethod LiveChatTextMessageDetails
  4793. raw := NoMethod(*s)
  4794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4795. }
  4796. type LiveChatUserBannedMessageDetails struct {
  4797. // BanDurationSeconds: The duration of the ban. This property is only
  4798. // present if the banType is temporary.
  4799. BanDurationSeconds uint64 `json:"banDurationSeconds,omitempty,string"`
  4800. // BanType: The type of ban.
  4801. //
  4802. // Possible values:
  4803. // "permanent"
  4804. // "temporary"
  4805. BanType string `json:"banType,omitempty"`
  4806. // BannedUserDetails: The details of the user that was banned.
  4807. BannedUserDetails *ChannelProfileDetails `json:"bannedUserDetails,omitempty"`
  4808. // ForceSendFields is a list of field names (e.g. "BanDurationSeconds")
  4809. // to unconditionally include in API requests. By default, fields with
  4810. // empty values are omitted from API requests. However, any non-pointer,
  4811. // non-interface field appearing in ForceSendFields will be sent to the
  4812. // server regardless of whether the field is empty or not. This may be
  4813. // used to include empty fields in Patch requests.
  4814. ForceSendFields []string `json:"-"`
  4815. // NullFields is a list of field names (e.g. "BanDurationSeconds") to
  4816. // include in API requests with the JSON null value. By default, fields
  4817. // with empty values are omitted from API requests. However, any field
  4818. // with an empty value appearing in NullFields will be sent to the
  4819. // server as null. It is an error if a field in this list has a
  4820. // non-empty value. This may be used to include null fields in Patch
  4821. // requests.
  4822. NullFields []string `json:"-"`
  4823. }
  4824. func (s *LiveChatUserBannedMessageDetails) MarshalJSON() ([]byte, error) {
  4825. type NoMethod LiveChatUserBannedMessageDetails
  4826. raw := NoMethod(*s)
  4827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4828. }
  4829. // LiveStream: A live stream describes a live ingestion point.
  4830. type LiveStream struct {
  4831. // Cdn: The cdn object defines the live stream's content delivery
  4832. // network (CDN) settings. These settings provide details about the
  4833. // manner in which you stream your content to YouTube.
  4834. Cdn *CdnSettings `json:"cdn,omitempty"`
  4835. // ContentDetails: The content_details object contains information about
  4836. // the stream, including the closed captions ingestion URL.
  4837. ContentDetails *LiveStreamContentDetails `json:"contentDetails,omitempty"`
  4838. // Etag: Etag of this resource.
  4839. Etag string `json:"etag,omitempty"`
  4840. // Id: The ID that YouTube assigns to uniquely identify the stream.
  4841. Id string `json:"id,omitempty"`
  4842. // Kind: Identifies what kind of resource this is. Value: the fixed
  4843. // string "youtube#liveStream".
  4844. Kind string `json:"kind,omitempty"`
  4845. // Snippet: The snippet object contains basic details about the stream,
  4846. // including its channel, title, and description.
  4847. Snippet *LiveStreamSnippet `json:"snippet,omitempty"`
  4848. // Status: The status object contains information about live stream's
  4849. // status.
  4850. Status *LiveStreamStatus `json:"status,omitempty"`
  4851. // ServerResponse contains the HTTP response code and headers from the
  4852. // server.
  4853. googleapi.ServerResponse `json:"-"`
  4854. // ForceSendFields is a list of field names (e.g. "Cdn") to
  4855. // unconditionally include in API requests. By default, fields with
  4856. // empty values are omitted from API requests. However, any non-pointer,
  4857. // non-interface field appearing in ForceSendFields will be sent to the
  4858. // server regardless of whether the field is empty or not. This may be
  4859. // used to include empty fields in Patch requests.
  4860. ForceSendFields []string `json:"-"`
  4861. // NullFields is a list of field names (e.g. "Cdn") to include in API
  4862. // requests with the JSON null value. By default, fields with empty
  4863. // values are omitted from API requests. However, any field with an
  4864. // empty value appearing in NullFields will be sent to the server as
  4865. // null. It is an error if a field in this list has a non-empty value.
  4866. // This may be used to include null fields in Patch requests.
  4867. NullFields []string `json:"-"`
  4868. }
  4869. func (s *LiveStream) MarshalJSON() ([]byte, error) {
  4870. type NoMethod LiveStream
  4871. raw := NoMethod(*s)
  4872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4873. }
  4874. type LiveStreamConfigurationIssue struct {
  4875. // Description: The long-form description of the issue and how to
  4876. // resolve it.
  4877. Description string `json:"description,omitempty"`
  4878. // Reason: The short-form reason for this issue.
  4879. Reason string `json:"reason,omitempty"`
  4880. // Severity: How severe this issue is to the stream.
  4881. //
  4882. // Possible values:
  4883. // "error"
  4884. // "info"
  4885. // "warning"
  4886. Severity string `json:"severity,omitempty"`
  4887. // Type: The kind of error happening.
  4888. //
  4889. // Possible values:
  4890. // "audioBitrateHigh"
  4891. // "audioBitrateLow"
  4892. // "audioBitrateMismatch"
  4893. // "audioCodec"
  4894. // "audioCodecMismatch"
  4895. // "audioSampleRate"
  4896. // "audioSampleRateMismatch"
  4897. // "audioStereoMismatch"
  4898. // "audioTooManyChannels"
  4899. // "badContainer"
  4900. // "bitrateHigh"
  4901. // "bitrateLow"
  4902. // "frameRateHigh"
  4903. // "framerateMismatch"
  4904. // "gopMismatch"
  4905. // "gopSizeLong"
  4906. // "gopSizeOver"
  4907. // "gopSizeShort"
  4908. // "interlacedVideo"
  4909. // "multipleAudioStreams"
  4910. // "multipleVideoStreams"
  4911. // "noAudioStream"
  4912. // "noVideoStream"
  4913. // "openGop"
  4914. // "resolutionMismatch"
  4915. // "videoBitrateMismatch"
  4916. // "videoCodec"
  4917. // "videoCodecMismatch"
  4918. // "videoIngestionFasterThanRealtime"
  4919. // "videoIngestionStarved"
  4920. // "videoInterlaceMismatch"
  4921. // "videoProfileMismatch"
  4922. // "videoResolutionSuboptimal"
  4923. // "videoResolutionUnsupported"
  4924. Type string `json:"type,omitempty"`
  4925. // ForceSendFields is a list of field names (e.g. "Description") to
  4926. // unconditionally include in API requests. By default, fields with
  4927. // empty values are omitted from API requests. However, any non-pointer,
  4928. // non-interface field appearing in ForceSendFields will be sent to the
  4929. // server regardless of whether the field is empty or not. This may be
  4930. // used to include empty fields in Patch requests.
  4931. ForceSendFields []string `json:"-"`
  4932. // NullFields is a list of field names (e.g. "Description") to include
  4933. // in API requests with the JSON null value. By default, fields with
  4934. // empty values are omitted from API requests. However, any field with
  4935. // an empty value appearing in NullFields will be sent to the server as
  4936. // null. It is an error if a field in this list has a non-empty value.
  4937. // This may be used to include null fields in Patch requests.
  4938. NullFields []string `json:"-"`
  4939. }
  4940. func (s *LiveStreamConfigurationIssue) MarshalJSON() ([]byte, error) {
  4941. type NoMethod LiveStreamConfigurationIssue
  4942. raw := NoMethod(*s)
  4943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4944. }
  4945. // LiveStreamContentDetails: Detailed settings of a stream.
  4946. type LiveStreamContentDetails struct {
  4947. // ClosedCaptionsIngestionUrl: The ingestion URL where the closed
  4948. // captions of this stream are sent.
  4949. ClosedCaptionsIngestionUrl string `json:"closedCaptionsIngestionUrl,omitempty"`
  4950. // IsReusable: Indicates whether the stream is reusable, which means
  4951. // that it can be bound to multiple broadcasts. It is common for
  4952. // broadcasters to reuse the same stream for many different broadcasts
  4953. // if those broadcasts occur at different times.
  4954. //
  4955. // If you set this value to false, then the stream will not be reusable,
  4956. // which means that it can only be bound to one broadcast. Non-reusable
  4957. // streams differ from reusable streams in the following ways:
  4958. // - A non-reusable stream can only be bound to one broadcast.
  4959. // - A non-reusable stream might be deleted by an automated process
  4960. // after the broadcast ends.
  4961. // - The liveStreams.list method does not list non-reusable streams if
  4962. // you call the method and set the mine parameter to true. The only way
  4963. // to use that method to retrieve the resource for a non-reusable stream
  4964. // is to use the id parameter to identify the stream.
  4965. IsReusable bool `json:"isReusable,omitempty"`
  4966. // ForceSendFields is a list of field names (e.g.
  4967. // "ClosedCaptionsIngestionUrl") to unconditionally include in API
  4968. // requests. By default, fields with empty values are omitted from API
  4969. // requests. However, any non-pointer, non-interface field appearing in
  4970. // ForceSendFields will be sent to the server regardless of whether the
  4971. // field is empty or not. This may be used to include empty fields in
  4972. // Patch requests.
  4973. ForceSendFields []string `json:"-"`
  4974. // NullFields is a list of field names (e.g.
  4975. // "ClosedCaptionsIngestionUrl") to include in API requests with the
  4976. // JSON null value. By default, fields with empty values are omitted
  4977. // from API requests. However, any field with an empty value appearing
  4978. // in NullFields will be sent to the server as null. It is an error if a
  4979. // field in this list has a non-empty value. This may be used to include
  4980. // null fields in Patch requests.
  4981. NullFields []string `json:"-"`
  4982. }
  4983. func (s *LiveStreamContentDetails) MarshalJSON() ([]byte, error) {
  4984. type NoMethod LiveStreamContentDetails
  4985. raw := NoMethod(*s)
  4986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4987. }
  4988. type LiveStreamHealthStatus struct {
  4989. // ConfigurationIssues: The configurations issues on this stream
  4990. ConfigurationIssues []*LiveStreamConfigurationIssue `json:"configurationIssues,omitempty"`
  4991. // LastUpdateTimeSeconds: The last time this status was updated (in
  4992. // seconds)
  4993. LastUpdateTimeSeconds uint64 `json:"lastUpdateTimeSeconds,omitempty,string"`
  4994. // Status: The status code of this stream
  4995. //
  4996. // Possible values:
  4997. // "bad"
  4998. // "good"
  4999. // "noData"
  5000. // "ok"
  5001. // "revoked"
  5002. Status string `json:"status,omitempty"`
  5003. // ForceSendFields is a list of field names (e.g. "ConfigurationIssues")
  5004. // to unconditionally include in API requests. By default, fields with
  5005. // empty values are omitted from API requests. However, any non-pointer,
  5006. // non-interface field appearing in ForceSendFields will be sent to the
  5007. // server regardless of whether the field is empty or not. This may be
  5008. // used to include empty fields in Patch requests.
  5009. ForceSendFields []string `json:"-"`
  5010. // NullFields is a list of field names (e.g. "ConfigurationIssues") to
  5011. // include in API requests with the JSON null value. By default, fields
  5012. // with empty values are omitted from API requests. However, any field
  5013. // with an empty value appearing in NullFields will be sent to the
  5014. // server as null. It is an error if a field in this list has a
  5015. // non-empty value. This may be used to include null fields in Patch
  5016. // requests.
  5017. NullFields []string `json:"-"`
  5018. }
  5019. func (s *LiveStreamHealthStatus) MarshalJSON() ([]byte, error) {
  5020. type NoMethod LiveStreamHealthStatus
  5021. raw := NoMethod(*s)
  5022. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5023. }
  5024. type LiveStreamListResponse struct {
  5025. // Etag: Etag of this resource.
  5026. Etag string `json:"etag,omitempty"`
  5027. // EventId: Serialized EventId of the request which produced this
  5028. // response.
  5029. EventId string `json:"eventId,omitempty"`
  5030. // Items: A list of live streams that match the request criteria.
  5031. Items []*LiveStream `json:"items,omitempty"`
  5032. // Kind: Identifies what kind of resource this is. Value: the fixed
  5033. // string "youtube#liveStreamListResponse".
  5034. Kind string `json:"kind,omitempty"`
  5035. // NextPageToken: The token that can be used as the value of the
  5036. // pageToken parameter to retrieve the next page in the result set.
  5037. NextPageToken string `json:"nextPageToken,omitempty"`
  5038. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5039. // PrevPageToken: The token that can be used as the value of the
  5040. // pageToken parameter to retrieve the previous page in the result set.
  5041. PrevPageToken string `json:"prevPageToken,omitempty"`
  5042. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5043. // VisitorId: The visitorId identifies the visitor.
  5044. VisitorId string `json:"visitorId,omitempty"`
  5045. // ServerResponse contains the HTTP response code and headers from the
  5046. // server.
  5047. googleapi.ServerResponse `json:"-"`
  5048. // ForceSendFields is a list of field names (e.g. "Etag") to
  5049. // unconditionally include in API requests. By default, fields with
  5050. // empty values are omitted from API requests. However, any non-pointer,
  5051. // non-interface field appearing in ForceSendFields will be sent to the
  5052. // server regardless of whether the field is empty or not. This may be
  5053. // used to include empty fields in Patch requests.
  5054. ForceSendFields []string `json:"-"`
  5055. // NullFields is a list of field names (e.g. "Etag") to include in API
  5056. // requests with the JSON null value. By default, fields with empty
  5057. // values are omitted from API requests. However, any field with an
  5058. // empty value appearing in NullFields will be sent to the server as
  5059. // null. It is an error if a field in this list has a non-empty value.
  5060. // This may be used to include null fields in Patch requests.
  5061. NullFields []string `json:"-"`
  5062. }
  5063. func (s *LiveStreamListResponse) MarshalJSON() ([]byte, error) {
  5064. type NoMethod LiveStreamListResponse
  5065. raw := NoMethod(*s)
  5066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5067. }
  5068. type LiveStreamSnippet struct {
  5069. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  5070. // that is transmitting the stream.
  5071. ChannelId string `json:"channelId,omitempty"`
  5072. // Description: The stream's description. The value cannot be longer
  5073. // than 10000 characters.
  5074. Description string `json:"description,omitempty"`
  5075. IsDefaultStream bool `json:"isDefaultStream,omitempty"`
  5076. // PublishedAt: The date and time that the stream was created. The value
  5077. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5078. PublishedAt string `json:"publishedAt,omitempty"`
  5079. // Title: The stream's title. The value must be between 1 and 128
  5080. // characters long.
  5081. Title string `json:"title,omitempty"`
  5082. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5083. // unconditionally include in API requests. By default, fields with
  5084. // empty values are omitted from API requests. However, any non-pointer,
  5085. // non-interface field appearing in ForceSendFields will be sent to the
  5086. // server regardless of whether the field is empty or not. This may be
  5087. // used to include empty fields in Patch requests.
  5088. ForceSendFields []string `json:"-"`
  5089. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5090. // API requests with the JSON null value. By default, fields with empty
  5091. // values are omitted from API requests. However, any field with an
  5092. // empty value appearing in NullFields will be sent to the server as
  5093. // null. It is an error if a field in this list has a non-empty value.
  5094. // This may be used to include null fields in Patch requests.
  5095. NullFields []string `json:"-"`
  5096. }
  5097. func (s *LiveStreamSnippet) MarshalJSON() ([]byte, error) {
  5098. type NoMethod LiveStreamSnippet
  5099. raw := NoMethod(*s)
  5100. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5101. }
  5102. // LiveStreamStatus: Brief description of the live stream status.
  5103. type LiveStreamStatus struct {
  5104. // HealthStatus: The health status of the stream.
  5105. HealthStatus *LiveStreamHealthStatus `json:"healthStatus,omitempty"`
  5106. // Possible values:
  5107. // "active"
  5108. // "created"
  5109. // "error"
  5110. // "inactive"
  5111. // "ready"
  5112. StreamStatus string `json:"streamStatus,omitempty"`
  5113. // ForceSendFields is a list of field names (e.g. "HealthStatus") to
  5114. // unconditionally include in API requests. By default, fields with
  5115. // empty values are omitted from API requests. However, any non-pointer,
  5116. // non-interface field appearing in ForceSendFields will be sent to the
  5117. // server regardless of whether the field is empty or not. This may be
  5118. // used to include empty fields in Patch requests.
  5119. ForceSendFields []string `json:"-"`
  5120. // NullFields is a list of field names (e.g. "HealthStatus") to include
  5121. // in API requests with the JSON null value. By default, fields with
  5122. // empty values are omitted from API requests. However, any field with
  5123. // an empty value appearing in NullFields will be sent to the server as
  5124. // null. It is an error if a field in this list has a non-empty value.
  5125. // This may be used to include null fields in Patch requests.
  5126. NullFields []string `json:"-"`
  5127. }
  5128. func (s *LiveStreamStatus) MarshalJSON() ([]byte, error) {
  5129. type NoMethod LiveStreamStatus
  5130. raw := NoMethod(*s)
  5131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5132. }
  5133. type LocalizedProperty struct {
  5134. Default string `json:"default,omitempty"`
  5135. // DefaultLanguage: The language of the default property.
  5136. DefaultLanguage *LanguageTag `json:"defaultLanguage,omitempty"`
  5137. Localized []*LocalizedString `json:"localized,omitempty"`
  5138. // ForceSendFields is a list of field names (e.g. "Default") to
  5139. // unconditionally include in API requests. By default, fields with
  5140. // empty values are omitted from API requests. However, any non-pointer,
  5141. // non-interface field appearing in ForceSendFields will be sent to the
  5142. // server regardless of whether the field is empty or not. This may be
  5143. // used to include empty fields in Patch requests.
  5144. ForceSendFields []string `json:"-"`
  5145. // NullFields is a list of field names (e.g. "Default") to include in
  5146. // API requests with the JSON null value. By default, fields with empty
  5147. // values are omitted from API requests. However, any field with an
  5148. // empty value appearing in NullFields will be sent to the server as
  5149. // null. It is an error if a field in this list has a non-empty value.
  5150. // This may be used to include null fields in Patch requests.
  5151. NullFields []string `json:"-"`
  5152. }
  5153. func (s *LocalizedProperty) MarshalJSON() ([]byte, error) {
  5154. type NoMethod LocalizedProperty
  5155. raw := NoMethod(*s)
  5156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5157. }
  5158. type LocalizedString struct {
  5159. Language string `json:"language,omitempty"`
  5160. Value string `json:"value,omitempty"`
  5161. // ForceSendFields is a list of field names (e.g. "Language") to
  5162. // unconditionally include in API requests. By default, fields with
  5163. // empty values are omitted from API requests. However, any non-pointer,
  5164. // non-interface field appearing in ForceSendFields will be sent to the
  5165. // server regardless of whether the field is empty or not. This may be
  5166. // used to include empty fields in Patch requests.
  5167. ForceSendFields []string `json:"-"`
  5168. // NullFields is a list of field names (e.g. "Language") to include in
  5169. // API requests with the JSON null value. By default, fields with empty
  5170. // values are omitted from API requests. However, any field with an
  5171. // empty value appearing in NullFields will be sent to the server as
  5172. // null. It is an error if a field in this list has a non-empty value.
  5173. // This may be used to include null fields in Patch requests.
  5174. NullFields []string `json:"-"`
  5175. }
  5176. func (s *LocalizedString) MarshalJSON() ([]byte, error) {
  5177. type NoMethod LocalizedString
  5178. raw := NoMethod(*s)
  5179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5180. }
  5181. // MonitorStreamInfo: Settings and Info of the monitor stream
  5182. type MonitorStreamInfo struct {
  5183. // BroadcastStreamDelayMs: If you have set the enableMonitorStream
  5184. // property to true, then this property determines the length of the
  5185. // live broadcast delay.
  5186. BroadcastStreamDelayMs int64 `json:"broadcastStreamDelayMs,omitempty"`
  5187. // EmbedHtml: HTML code that embeds a player that plays the monitor
  5188. // stream.
  5189. EmbedHtml string `json:"embedHtml,omitempty"`
  5190. // EnableMonitorStream: This value determines whether the monitor stream
  5191. // is enabled for the broadcast. If the monitor stream is enabled, then
  5192. // YouTube will broadcast the event content on a special stream intended
  5193. // only for the broadcaster's consumption. The broadcaster can use the
  5194. // stream to review the event content and also to identify the optimal
  5195. // times to insert cuepoints.
  5196. //
  5197. // You need to set this value to true if you intend to have a broadcast
  5198. // delay for your event.
  5199. //
  5200. // Note: This property cannot be updated once the broadcast is in the
  5201. // testing or live state.
  5202. EnableMonitorStream bool `json:"enableMonitorStream,omitempty"`
  5203. // ForceSendFields is a list of field names (e.g.
  5204. // "BroadcastStreamDelayMs") to unconditionally include in API requests.
  5205. // By default, fields with empty values are omitted from API requests.
  5206. // However, any non-pointer, non-interface field appearing in
  5207. // ForceSendFields will be sent to the server regardless of whether the
  5208. // field is empty or not. This may be used to include empty fields in
  5209. // Patch requests.
  5210. ForceSendFields []string `json:"-"`
  5211. // NullFields is a list of field names (e.g. "BroadcastStreamDelayMs")
  5212. // to include in API requests with the JSON null value. By default,
  5213. // fields with empty values are omitted from API requests. However, any
  5214. // field with an empty value appearing in NullFields will be sent to the
  5215. // server as null. It is an error if a field in this list has a
  5216. // non-empty value. This may be used to include null fields in Patch
  5217. // requests.
  5218. NullFields []string `json:"-"`
  5219. }
  5220. func (s *MonitorStreamInfo) MarshalJSON() ([]byte, error) {
  5221. type NoMethod MonitorStreamInfo
  5222. raw := NoMethod(*s)
  5223. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5224. }
  5225. // Nonprofit: Nonprofit information.
  5226. type Nonprofit struct {
  5227. // NonprofitId: Id of the nonprofit.
  5228. NonprofitId *NonprofitId `json:"nonprofitId,omitempty"`
  5229. // NonprofitLegalName: Legal name of the nonprofit.
  5230. NonprofitLegalName string `json:"nonprofitLegalName,omitempty"`
  5231. // ForceSendFields is a list of field names (e.g. "NonprofitId") to
  5232. // unconditionally include in API requests. By default, fields with
  5233. // empty values are omitted from API requests. However, any non-pointer,
  5234. // non-interface field appearing in ForceSendFields will be sent to the
  5235. // server regardless of whether the field is empty or not. This may be
  5236. // used to include empty fields in Patch requests.
  5237. ForceSendFields []string `json:"-"`
  5238. // NullFields is a list of field names (e.g. "NonprofitId") to include
  5239. // in API requests with the JSON null value. By default, fields with
  5240. // empty values are omitted from API requests. However, any field with
  5241. // an empty value appearing in NullFields will be sent to the server as
  5242. // null. It is an error if a field in this list has a non-empty value.
  5243. // This may be used to include null fields in Patch requests.
  5244. NullFields []string `json:"-"`
  5245. }
  5246. func (s *Nonprofit) MarshalJSON() ([]byte, error) {
  5247. type NoMethod Nonprofit
  5248. raw := NoMethod(*s)
  5249. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5250. }
  5251. type NonprofitId struct {
  5252. Value string `json:"value,omitempty"`
  5253. // ForceSendFields is a list of field names (e.g. "Value") to
  5254. // unconditionally include in API requests. By default, fields with
  5255. // empty values are omitted from API requests. However, any non-pointer,
  5256. // non-interface field appearing in ForceSendFields will be sent to the
  5257. // server regardless of whether the field is empty or not. This may be
  5258. // used to include empty fields in Patch requests.
  5259. ForceSendFields []string `json:"-"`
  5260. // NullFields is a list of field names (e.g. "Value") to include in API
  5261. // requests with the JSON null value. By default, fields with empty
  5262. // values are omitted from API requests. However, any field with an
  5263. // empty value appearing in NullFields will be sent to the server as
  5264. // null. It is an error if a field in this list has a non-empty value.
  5265. // This may be used to include null fields in Patch requests.
  5266. NullFields []string `json:"-"`
  5267. }
  5268. func (s *NonprofitId) MarshalJSON() ([]byte, error) {
  5269. type NoMethod NonprofitId
  5270. raw := NoMethod(*s)
  5271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5272. }
  5273. // PageInfo: Paging details for lists of resources, including total
  5274. // number of items available and number of resources returned in a
  5275. // single page.
  5276. type PageInfo struct {
  5277. // ResultsPerPage: The number of results included in the API response.
  5278. ResultsPerPage int64 `json:"resultsPerPage,omitempty"`
  5279. // TotalResults: The total number of results in the result set.
  5280. TotalResults int64 `json:"totalResults,omitempty"`
  5281. // ForceSendFields is a list of field names (e.g. "ResultsPerPage") to
  5282. // unconditionally include in API requests. By default, fields with
  5283. // empty values are omitted from API requests. However, any non-pointer,
  5284. // non-interface field appearing in ForceSendFields will be sent to the
  5285. // server regardless of whether the field is empty or not. This may be
  5286. // used to include empty fields in Patch requests.
  5287. ForceSendFields []string `json:"-"`
  5288. // NullFields is a list of field names (e.g. "ResultsPerPage") to
  5289. // include in API requests with the JSON null value. By default, fields
  5290. // with empty values are omitted from API requests. However, any field
  5291. // with an empty value appearing in NullFields will be sent to the
  5292. // server as null. It is an error if a field in this list has a
  5293. // non-empty value. This may be used to include null fields in Patch
  5294. // requests.
  5295. NullFields []string `json:"-"`
  5296. }
  5297. func (s *PageInfo) MarshalJSON() ([]byte, error) {
  5298. type NoMethod PageInfo
  5299. raw := NoMethod(*s)
  5300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5301. }
  5302. // Playlist: A playlist resource represents a YouTube playlist. A
  5303. // playlist is a collection of videos that can be viewed sequentially
  5304. // and shared with other users. A playlist can contain up to 200 videos,
  5305. // and YouTube does not limit the number of playlists that each user
  5306. // creates. By default, playlists are publicly visible to other users,
  5307. // but playlists can be public or private.
  5308. //
  5309. // YouTube also uses playlists to identify special collections of videos
  5310. // for a channel, such as:
  5311. // - uploaded videos
  5312. // - favorite videos
  5313. // - positively rated (liked) videos
  5314. // - watch history
  5315. // - watch later To be more specific, these lists are associated with a
  5316. // channel, which is a collection of a person, group, or company's
  5317. // videos, playlists, and other YouTube information. You can retrieve
  5318. // the playlist IDs for each of these lists from the channel resource
  5319. // for a given channel.
  5320. //
  5321. // You can then use the playlistItems.list method to retrieve any of
  5322. // those lists. You can also add or remove items from those lists by
  5323. // calling the playlistItems.insert and playlistItems.delete
  5324. // methods.
  5325. type Playlist struct {
  5326. // ContentDetails: The contentDetails object contains information like
  5327. // video count.
  5328. ContentDetails *PlaylistContentDetails `json:"contentDetails,omitempty"`
  5329. // Etag: Etag of this resource.
  5330. Etag string `json:"etag,omitempty"`
  5331. // Id: The ID that YouTube uses to uniquely identify the playlist.
  5332. Id string `json:"id,omitempty"`
  5333. // Kind: Identifies what kind of resource this is. Value: the fixed
  5334. // string "youtube#playlist".
  5335. Kind string `json:"kind,omitempty"`
  5336. // Localizations: Localizations for different languages
  5337. Localizations map[string]PlaylistLocalization `json:"localizations,omitempty"`
  5338. // Player: The player object contains information that you would use to
  5339. // play the playlist in an embedded player.
  5340. Player *PlaylistPlayer `json:"player,omitempty"`
  5341. // Snippet: The snippet object contains basic details about the
  5342. // playlist, such as its title and description.
  5343. Snippet *PlaylistSnippet `json:"snippet,omitempty"`
  5344. // Status: The status object contains status information for the
  5345. // playlist.
  5346. Status *PlaylistStatus `json:"status,omitempty"`
  5347. // ServerResponse contains the HTTP response code and headers from the
  5348. // server.
  5349. googleapi.ServerResponse `json:"-"`
  5350. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  5351. // unconditionally include in API requests. By default, fields with
  5352. // empty values are omitted from API requests. However, any non-pointer,
  5353. // non-interface field appearing in ForceSendFields will be sent to the
  5354. // server regardless of whether the field is empty or not. This may be
  5355. // used to include empty fields in Patch requests.
  5356. ForceSendFields []string `json:"-"`
  5357. // NullFields is a list of field names (e.g. "ContentDetails") to
  5358. // include in API requests with the JSON null value. By default, fields
  5359. // with empty values are omitted from API requests. However, any field
  5360. // with an empty value appearing in NullFields will be sent to the
  5361. // server as null. It is an error if a field in this list has a
  5362. // non-empty value. This may be used to include null fields in Patch
  5363. // requests.
  5364. NullFields []string `json:"-"`
  5365. }
  5366. func (s *Playlist) MarshalJSON() ([]byte, error) {
  5367. type NoMethod Playlist
  5368. raw := NoMethod(*s)
  5369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5370. }
  5371. type PlaylistContentDetails struct {
  5372. // ItemCount: The number of videos in the playlist.
  5373. ItemCount int64 `json:"itemCount,omitempty"`
  5374. // ForceSendFields is a list of field names (e.g. "ItemCount") 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. "ItemCount") to include in
  5382. // API 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 *PlaylistContentDetails) MarshalJSON() ([]byte, error) {
  5390. type NoMethod PlaylistContentDetails
  5391. raw := NoMethod(*s)
  5392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5393. }
  5394. // PlaylistItem: A playlistItem resource identifies another resource,
  5395. // such as a video, that is included in a playlist. In addition, the
  5396. // playlistItem resource contains details about the included resource
  5397. // that pertain specifically to how that resource is used in that
  5398. // playlist.
  5399. //
  5400. // YouTube uses playlists to identify special collections of videos for
  5401. // a channel, such as:
  5402. // - uploaded videos
  5403. // - favorite videos
  5404. // - positively rated (liked) videos
  5405. // - watch history
  5406. // - watch later To be more specific, these lists are associated with a
  5407. // channel, which is a collection of a person, group, or company's
  5408. // videos, playlists, and other YouTube information.
  5409. //
  5410. // You can retrieve the playlist IDs for each of these lists from the
  5411. // channel resource for a given channel. You can then use the
  5412. // playlistItems.list method to retrieve any of those lists. You can
  5413. // also add or remove items from those lists by calling the
  5414. // playlistItems.insert and playlistItems.delete methods. For example,
  5415. // if a user gives a positive rating to a video, you would insert that
  5416. // video into the liked videos playlist for that user's channel.
  5417. type PlaylistItem struct {
  5418. // ContentDetails: The contentDetails object is included in the resource
  5419. // if the included item is a YouTube video. The object contains
  5420. // additional information about the video.
  5421. ContentDetails *PlaylistItemContentDetails `json:"contentDetails,omitempty"`
  5422. // Etag: Etag of this resource.
  5423. Etag string `json:"etag,omitempty"`
  5424. // Id: The ID that YouTube uses to uniquely identify the playlist item.
  5425. Id string `json:"id,omitempty"`
  5426. // Kind: Identifies what kind of resource this is. Value: the fixed
  5427. // string "youtube#playlistItem".
  5428. Kind string `json:"kind,omitempty"`
  5429. // Snippet: The snippet object contains basic details about the playlist
  5430. // item, such as its title and position in the playlist.
  5431. Snippet *PlaylistItemSnippet `json:"snippet,omitempty"`
  5432. // Status: The status object contains information about the playlist
  5433. // item's privacy status.
  5434. Status *PlaylistItemStatus `json:"status,omitempty"`
  5435. // ServerResponse contains the HTTP response code and headers from the
  5436. // server.
  5437. googleapi.ServerResponse `json:"-"`
  5438. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  5439. // unconditionally include in API requests. By default, fields with
  5440. // empty values are omitted from API requests. However, any non-pointer,
  5441. // non-interface field appearing in ForceSendFields will be sent to the
  5442. // server regardless of whether the field is empty or not. This may be
  5443. // used to include empty fields in Patch requests.
  5444. ForceSendFields []string `json:"-"`
  5445. // NullFields is a list of field names (e.g. "ContentDetails") to
  5446. // include in API requests with the JSON null value. By default, fields
  5447. // with empty values are omitted from API requests. However, any field
  5448. // with an empty value appearing in NullFields will be sent to the
  5449. // server as null. It is an error if a field in this list has a
  5450. // non-empty value. This may be used to include null fields in Patch
  5451. // requests.
  5452. NullFields []string `json:"-"`
  5453. }
  5454. func (s *PlaylistItem) MarshalJSON() ([]byte, error) {
  5455. type NoMethod PlaylistItem
  5456. raw := NoMethod(*s)
  5457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5458. }
  5459. type PlaylistItemContentDetails struct {
  5460. // EndAt: The time, measured in seconds from the start of the video,
  5461. // when the video should stop playing. (The playlist owner can specify
  5462. // the times when the video should start and stop playing when the video
  5463. // is played in the context of the playlist.) By default, assume that
  5464. // the video.endTime is the end of the video.
  5465. EndAt string `json:"endAt,omitempty"`
  5466. // Note: A user-generated note for this item.
  5467. Note string `json:"note,omitempty"`
  5468. // StartAt: The time, measured in seconds from the start of the video,
  5469. // when the video should start playing. (The playlist owner can specify
  5470. // the times when the video should start and stop playing when the video
  5471. // is played in the context of the playlist.) The default value is 0.
  5472. StartAt string `json:"startAt,omitempty"`
  5473. // VideoId: The ID that YouTube uses to uniquely identify a video. To
  5474. // retrieve the video resource, set the id query parameter to this value
  5475. // in your API request.
  5476. VideoId string `json:"videoId,omitempty"`
  5477. // VideoPublishedAt: The date and time that the video was published to
  5478. // YouTube. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  5479. // format.
  5480. VideoPublishedAt string `json:"videoPublishedAt,omitempty"`
  5481. // ForceSendFields is a list of field names (e.g. "EndAt") to
  5482. // unconditionally include in API requests. By default, fields with
  5483. // empty values are omitted from API requests. However, any non-pointer,
  5484. // non-interface field appearing in ForceSendFields will be sent to the
  5485. // server regardless of whether the field is empty or not. This may be
  5486. // used to include empty fields in Patch requests.
  5487. ForceSendFields []string `json:"-"`
  5488. // NullFields is a list of field names (e.g. "EndAt") to include in API
  5489. // requests with the JSON null value. By default, fields with empty
  5490. // values are omitted from API requests. However, any field with an
  5491. // empty value appearing in NullFields will be sent to the server as
  5492. // null. It is an error if a field in this list has a non-empty value.
  5493. // This may be used to include null fields in Patch requests.
  5494. NullFields []string `json:"-"`
  5495. }
  5496. func (s *PlaylistItemContentDetails) MarshalJSON() ([]byte, error) {
  5497. type NoMethod PlaylistItemContentDetails
  5498. raw := NoMethod(*s)
  5499. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5500. }
  5501. type PlaylistItemListResponse struct {
  5502. // Etag: Etag of this resource.
  5503. Etag string `json:"etag,omitempty"`
  5504. // EventId: Serialized EventId of the request which produced this
  5505. // response.
  5506. EventId string `json:"eventId,omitempty"`
  5507. // Items: A list of playlist items that match the request criteria.
  5508. Items []*PlaylistItem `json:"items,omitempty"`
  5509. // Kind: Identifies what kind of resource this is. Value: the fixed
  5510. // string "youtube#playlistItemListResponse".
  5511. Kind string `json:"kind,omitempty"`
  5512. // NextPageToken: The token that can be used as the value of the
  5513. // pageToken parameter to retrieve the next page in the result set.
  5514. NextPageToken string `json:"nextPageToken,omitempty"`
  5515. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5516. // PrevPageToken: The token that can be used as the value of the
  5517. // pageToken parameter to retrieve the previous page in the result set.
  5518. PrevPageToken string `json:"prevPageToken,omitempty"`
  5519. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5520. // VisitorId: The visitorId identifies the visitor.
  5521. VisitorId string `json:"visitorId,omitempty"`
  5522. // ServerResponse contains the HTTP response code and headers from the
  5523. // server.
  5524. googleapi.ServerResponse `json:"-"`
  5525. // ForceSendFields is a list of field names (e.g. "Etag") to
  5526. // unconditionally include in API requests. By default, fields with
  5527. // empty values are omitted from API requests. However, any non-pointer,
  5528. // non-interface field appearing in ForceSendFields will be sent to the
  5529. // server regardless of whether the field is empty or not. This may be
  5530. // used to include empty fields in Patch requests.
  5531. ForceSendFields []string `json:"-"`
  5532. // NullFields is a list of field names (e.g. "Etag") to include in API
  5533. // requests with the JSON null value. By default, fields with empty
  5534. // values are omitted from API requests. However, any field with an
  5535. // empty value appearing in NullFields will be sent to the server as
  5536. // null. It is an error if a field in this list has a non-empty value.
  5537. // This may be used to include null fields in Patch requests.
  5538. NullFields []string `json:"-"`
  5539. }
  5540. func (s *PlaylistItemListResponse) MarshalJSON() ([]byte, error) {
  5541. type NoMethod PlaylistItemListResponse
  5542. raw := NoMethod(*s)
  5543. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5544. }
  5545. // PlaylistItemSnippet: Basic details about a playlist, including title,
  5546. // description and thumbnails.
  5547. type PlaylistItemSnippet struct {
  5548. // ChannelId: The ID that YouTube uses to uniquely identify the user
  5549. // that added the item to the playlist.
  5550. ChannelId string `json:"channelId,omitempty"`
  5551. // ChannelTitle: Channel title for the channel that the playlist item
  5552. // belongs to.
  5553. ChannelTitle string `json:"channelTitle,omitempty"`
  5554. // Description: The item's description.
  5555. Description string `json:"description,omitempty"`
  5556. // PlaylistId: The ID that YouTube uses to uniquely identify the
  5557. // playlist that the playlist item is in.
  5558. PlaylistId string `json:"playlistId,omitempty"`
  5559. // Position: The order in which the item appears in the playlist. The
  5560. // value uses a zero-based index, so the first item has a position of 0,
  5561. // the second item has a position of 1, and so forth.
  5562. Position int64 `json:"position,omitempty"`
  5563. // PublishedAt: The date and time that the item was added to the
  5564. // playlist. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  5565. // format.
  5566. PublishedAt string `json:"publishedAt,omitempty"`
  5567. // ResourceId: The id object contains information that can be used to
  5568. // uniquely identify the resource that is included in the playlist as
  5569. // the playlist item.
  5570. ResourceId *ResourceId `json:"resourceId,omitempty"`
  5571. // Thumbnails: A map of thumbnail images associated with the playlist
  5572. // item. For each object in the map, the key is the name of the
  5573. // thumbnail image, and the value is an object that contains other
  5574. // information about the thumbnail.
  5575. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  5576. // Title: The item's title.
  5577. Title string `json:"title,omitempty"`
  5578. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5579. // unconditionally include in API requests. By default, fields with
  5580. // empty values are omitted from API requests. However, any non-pointer,
  5581. // non-interface field appearing in ForceSendFields will be sent to the
  5582. // server regardless of whether the field is empty or not. This may be
  5583. // used to include empty fields in Patch requests.
  5584. ForceSendFields []string `json:"-"`
  5585. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5586. // API requests with the JSON null value. By default, fields with empty
  5587. // values are omitted from API requests. However, any field with an
  5588. // empty value appearing in NullFields will be sent to the server as
  5589. // null. It is an error if a field in this list has a non-empty value.
  5590. // This may be used to include null fields in Patch requests.
  5591. NullFields []string `json:"-"`
  5592. }
  5593. func (s *PlaylistItemSnippet) MarshalJSON() ([]byte, error) {
  5594. type NoMethod PlaylistItemSnippet
  5595. raw := NoMethod(*s)
  5596. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5597. }
  5598. // PlaylistItemStatus: Information about the playlist item's privacy
  5599. // status.
  5600. type PlaylistItemStatus struct {
  5601. // PrivacyStatus: This resource's privacy status.
  5602. //
  5603. // Possible values:
  5604. // "private"
  5605. // "public"
  5606. // "unlisted"
  5607. // "unlisted_new"
  5608. PrivacyStatus string `json:"privacyStatus,omitempty"`
  5609. // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
  5610. // unconditionally include in API requests. By default, fields with
  5611. // empty values are omitted from API requests. However, any non-pointer,
  5612. // non-interface field appearing in ForceSendFields will be sent to the
  5613. // server regardless of whether the field is empty or not. This may be
  5614. // used to include empty fields in Patch requests.
  5615. ForceSendFields []string `json:"-"`
  5616. // NullFields is a list of field names (e.g. "PrivacyStatus") to include
  5617. // in API requests with the JSON null value. By default, fields with
  5618. // empty values are omitted from API requests. However, any field with
  5619. // an empty value appearing in NullFields will be sent to the server as
  5620. // null. It is an error if a field in this list has a non-empty value.
  5621. // This may be used to include null fields in Patch requests.
  5622. NullFields []string `json:"-"`
  5623. }
  5624. func (s *PlaylistItemStatus) MarshalJSON() ([]byte, error) {
  5625. type NoMethod PlaylistItemStatus
  5626. raw := NoMethod(*s)
  5627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5628. }
  5629. type PlaylistListResponse struct {
  5630. // Etag: Etag of this resource.
  5631. Etag string `json:"etag,omitempty"`
  5632. // EventId: Serialized EventId of the request which produced this
  5633. // response.
  5634. EventId string `json:"eventId,omitempty"`
  5635. // Items: A list of playlists that match the request criteria.
  5636. Items []*Playlist `json:"items,omitempty"`
  5637. // Kind: Identifies what kind of resource this is. Value: the fixed
  5638. // string "youtube#playlistListResponse".
  5639. Kind string `json:"kind,omitempty"`
  5640. // NextPageToken: The token that can be used as the value of the
  5641. // pageToken parameter to retrieve the next page in the result set.
  5642. NextPageToken string `json:"nextPageToken,omitempty"`
  5643. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5644. // PrevPageToken: The token that can be used as the value of the
  5645. // pageToken parameter to retrieve the previous page in the result set.
  5646. PrevPageToken string `json:"prevPageToken,omitempty"`
  5647. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5648. // VisitorId: The visitorId identifies the visitor.
  5649. VisitorId string `json:"visitorId,omitempty"`
  5650. // ServerResponse contains the HTTP response code and headers from the
  5651. // server.
  5652. googleapi.ServerResponse `json:"-"`
  5653. // ForceSendFields is a list of field names (e.g. "Etag") to
  5654. // unconditionally include in API requests. By default, fields with
  5655. // empty values are omitted from API requests. However, any non-pointer,
  5656. // non-interface field appearing in ForceSendFields will be sent to the
  5657. // server regardless of whether the field is empty or not. This may be
  5658. // used to include empty fields in Patch requests.
  5659. ForceSendFields []string `json:"-"`
  5660. // NullFields is a list of field names (e.g. "Etag") to include in API
  5661. // requests with the JSON null value. By default, fields with empty
  5662. // values are omitted from API requests. However, any field with an
  5663. // empty value appearing in NullFields will be sent to the server as
  5664. // null. It is an error if a field in this list has a non-empty value.
  5665. // This may be used to include null fields in Patch requests.
  5666. NullFields []string `json:"-"`
  5667. }
  5668. func (s *PlaylistListResponse) MarshalJSON() ([]byte, error) {
  5669. type NoMethod PlaylistListResponse
  5670. raw := NoMethod(*s)
  5671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5672. }
  5673. // PlaylistLocalization: Playlist localization setting
  5674. type PlaylistLocalization struct {
  5675. // Description: The localized strings for playlist's description.
  5676. Description string `json:"description,omitempty"`
  5677. // Title: The localized strings for playlist's title.
  5678. Title string `json:"title,omitempty"`
  5679. // ForceSendFields is a list of field names (e.g. "Description") to
  5680. // unconditionally include in API requests. By default, fields with
  5681. // empty values are omitted from API requests. However, any non-pointer,
  5682. // non-interface field appearing in ForceSendFields will be sent to the
  5683. // server regardless of whether the field is empty or not. This may be
  5684. // used to include empty fields in Patch requests.
  5685. ForceSendFields []string `json:"-"`
  5686. // NullFields is a list of field names (e.g. "Description") to include
  5687. // in API requests with the JSON null value. By default, fields with
  5688. // empty values are omitted from API requests. However, any field with
  5689. // an empty value appearing in NullFields will be sent to the server as
  5690. // null. It is an error if a field in this list has a non-empty value.
  5691. // This may be used to include null fields in Patch requests.
  5692. NullFields []string `json:"-"`
  5693. }
  5694. func (s *PlaylistLocalization) MarshalJSON() ([]byte, error) {
  5695. type NoMethod PlaylistLocalization
  5696. raw := NoMethod(*s)
  5697. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5698. }
  5699. type PlaylistPlayer struct {
  5700. // EmbedHtml: An <iframe> tag that embeds a player that will play the
  5701. // playlist.
  5702. EmbedHtml string `json:"embedHtml,omitempty"`
  5703. // ForceSendFields is a list of field names (e.g. "EmbedHtml") to
  5704. // unconditionally include in API requests. By default, fields with
  5705. // empty values are omitted from API requests. However, any non-pointer,
  5706. // non-interface field appearing in ForceSendFields will be sent to the
  5707. // server regardless of whether the field is empty or not. This may be
  5708. // used to include empty fields in Patch requests.
  5709. ForceSendFields []string `json:"-"`
  5710. // NullFields is a list of field names (e.g. "EmbedHtml") to include in
  5711. // API requests with the JSON null value. By default, fields with empty
  5712. // values are omitted from API requests. However, any field with an
  5713. // empty value appearing in NullFields will be sent to the server as
  5714. // null. It is an error if a field in this list has a non-empty value.
  5715. // This may be used to include null fields in Patch requests.
  5716. NullFields []string `json:"-"`
  5717. }
  5718. func (s *PlaylistPlayer) MarshalJSON() ([]byte, error) {
  5719. type NoMethod PlaylistPlayer
  5720. raw := NoMethod(*s)
  5721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5722. }
  5723. // PlaylistSnippet: Basic details about a playlist, including title,
  5724. // description and thumbnails.
  5725. type PlaylistSnippet struct {
  5726. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  5727. // that published the playlist.
  5728. ChannelId string `json:"channelId,omitempty"`
  5729. // ChannelTitle: The channel title of the channel that the video belongs
  5730. // to.
  5731. ChannelTitle string `json:"channelTitle,omitempty"`
  5732. // DefaultLanguage: The language of the playlist's default title and
  5733. // description.
  5734. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  5735. // Description: The playlist's description.
  5736. Description string `json:"description,omitempty"`
  5737. // Localized: Localized title and description, read-only.
  5738. Localized *PlaylistLocalization `json:"localized,omitempty"`
  5739. // PublishedAt: The date and time that the playlist was created. The
  5740. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  5741. PublishedAt string `json:"publishedAt,omitempty"`
  5742. // Tags: Keyword tags associated with the playlist.
  5743. Tags []string `json:"tags,omitempty"`
  5744. // Thumbnails: A map of thumbnail images associated with the playlist.
  5745. // For each object in the map, the key is the name of the thumbnail
  5746. // image, and the value is an object that contains other information
  5747. // about the thumbnail.
  5748. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  5749. // Title: The playlist's title.
  5750. Title string `json:"title,omitempty"`
  5751. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5752. // unconditionally include in API requests. By default, fields with
  5753. // empty values are omitted from API requests. However, any non-pointer,
  5754. // non-interface field appearing in ForceSendFields will be sent to the
  5755. // server regardless of whether the field is empty or not. This may be
  5756. // used to include empty fields in Patch requests.
  5757. ForceSendFields []string `json:"-"`
  5758. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5759. // API requests with the JSON null value. By default, fields with empty
  5760. // values are omitted from API requests. However, any field with an
  5761. // empty value appearing in NullFields will be sent to the server as
  5762. // null. It is an error if a field in this list has a non-empty value.
  5763. // This may be used to include null fields in Patch requests.
  5764. NullFields []string `json:"-"`
  5765. }
  5766. func (s *PlaylistSnippet) MarshalJSON() ([]byte, error) {
  5767. type NoMethod PlaylistSnippet
  5768. raw := NoMethod(*s)
  5769. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5770. }
  5771. type PlaylistStatus struct {
  5772. // PrivacyStatus: The playlist's privacy status.
  5773. //
  5774. // Possible values:
  5775. // "private"
  5776. // "public"
  5777. // "unlisted"
  5778. // "unlisted_new"
  5779. PrivacyStatus string `json:"privacyStatus,omitempty"`
  5780. // ForceSendFields is a list of field names (e.g. "PrivacyStatus") to
  5781. // unconditionally include in API requests. By default, fields with
  5782. // empty values are omitted from API requests. However, any non-pointer,
  5783. // non-interface field appearing in ForceSendFields will be sent to the
  5784. // server regardless of whether the field is empty or not. This may be
  5785. // used to include empty fields in Patch requests.
  5786. ForceSendFields []string `json:"-"`
  5787. // NullFields is a list of field names (e.g. "PrivacyStatus") to include
  5788. // in API requests with the JSON null value. By default, fields with
  5789. // empty values are omitted from API requests. However, any field with
  5790. // an empty value appearing in NullFields will be sent to the server as
  5791. // null. It is an error if a field in this list has a non-empty value.
  5792. // This may be used to include null fields in Patch requests.
  5793. NullFields []string `json:"-"`
  5794. }
  5795. func (s *PlaylistStatus) MarshalJSON() ([]byte, error) {
  5796. type NoMethod PlaylistStatus
  5797. raw := NoMethod(*s)
  5798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5799. }
  5800. // PromotedItem: Describes a single promoted item.
  5801. type PromotedItem struct {
  5802. // CustomMessage: A custom message to display for this promotion. This
  5803. // field is currently ignored unless the promoted item is a website.
  5804. CustomMessage string `json:"customMessage,omitempty"`
  5805. // Id: Identifies the promoted item.
  5806. Id *PromotedItemId `json:"id,omitempty"`
  5807. // PromotedByContentOwner: If true, the content owner's name will be
  5808. // used when displaying the promotion. This field can only be set when
  5809. // the update is made on behalf of the content owner.
  5810. PromotedByContentOwner bool `json:"promotedByContentOwner,omitempty"`
  5811. // Timing: The temporal position within the video where the promoted
  5812. // item will be displayed. If present, it overrides the default timing.
  5813. Timing *InvideoTiming `json:"timing,omitempty"`
  5814. // ForceSendFields is a list of field names (e.g. "CustomMessage") to
  5815. // unconditionally include in API requests. By default, fields with
  5816. // empty values are omitted from API requests. However, any non-pointer,
  5817. // non-interface field appearing in ForceSendFields will be sent to the
  5818. // server regardless of whether the field is empty or not. This may be
  5819. // used to include empty fields in Patch requests.
  5820. ForceSendFields []string `json:"-"`
  5821. // NullFields is a list of field names (e.g. "CustomMessage") to include
  5822. // in API requests with the JSON null value. By default, fields with
  5823. // empty values are omitted from API requests. However, any field with
  5824. // an empty value appearing in NullFields will be sent to the server as
  5825. // null. It is an error if a field in this list has a non-empty value.
  5826. // This may be used to include null fields in Patch requests.
  5827. NullFields []string `json:"-"`
  5828. }
  5829. func (s *PromotedItem) MarshalJSON() ([]byte, error) {
  5830. type NoMethod PromotedItem
  5831. raw := NoMethod(*s)
  5832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5833. }
  5834. // PromotedItemId: Describes a single promoted item id. It is a union of
  5835. // various possible types.
  5836. type PromotedItemId struct {
  5837. // RecentlyUploadedBy: If type is recentUpload, this field identifies
  5838. // the channel from which to take the recent upload. If missing, the
  5839. // channel is assumed to be the same channel for which the
  5840. // invideoPromotion is set.
  5841. RecentlyUploadedBy string `json:"recentlyUploadedBy,omitempty"`
  5842. // Type: Describes the type of the promoted item.
  5843. //
  5844. // Possible values:
  5845. // "recentUpload"
  5846. // "video"
  5847. // "website"
  5848. Type string `json:"type,omitempty"`
  5849. // VideoId: If the promoted item represents a video, this field
  5850. // represents the unique YouTube ID identifying it. This field will be
  5851. // present only if type has the value video.
  5852. VideoId string `json:"videoId,omitempty"`
  5853. // WebsiteUrl: If the promoted item represents a website, this field
  5854. // represents the url pointing to the website. This field will be
  5855. // present only if type has the value website.
  5856. WebsiteUrl string `json:"websiteUrl,omitempty"`
  5857. // ForceSendFields is a list of field names (e.g. "RecentlyUploadedBy")
  5858. // to unconditionally include in API requests. By default, fields with
  5859. // empty values are omitted from API requests. However, any non-pointer,
  5860. // non-interface field appearing in ForceSendFields will be sent to the
  5861. // server regardless of whether the field is empty or not. This may be
  5862. // used to include empty fields in Patch requests.
  5863. ForceSendFields []string `json:"-"`
  5864. // NullFields is a list of field names (e.g. "RecentlyUploadedBy") to
  5865. // include in API requests with the JSON null value. By default, fields
  5866. // with empty values are omitted from API requests. However, any field
  5867. // with an empty value appearing in NullFields will be sent to the
  5868. // server as null. It is an error if a field in this list has a
  5869. // non-empty value. This may be used to include null fields in Patch
  5870. // requests.
  5871. NullFields []string `json:"-"`
  5872. }
  5873. func (s *PromotedItemId) MarshalJSON() ([]byte, error) {
  5874. type NoMethod PromotedItemId
  5875. raw := NoMethod(*s)
  5876. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5877. }
  5878. // PropertyValue: A pair Property / Value.
  5879. type PropertyValue struct {
  5880. // Property: A property.
  5881. Property string `json:"property,omitempty"`
  5882. // Value: The property's value.
  5883. Value string `json:"value,omitempty"`
  5884. // ForceSendFields is a list of field names (e.g. "Property") to
  5885. // unconditionally include in API requests. By default, fields with
  5886. // empty values are omitted from API requests. However, any non-pointer,
  5887. // non-interface field appearing in ForceSendFields will be sent to the
  5888. // server regardless of whether the field is empty or not. This may be
  5889. // used to include empty fields in Patch requests.
  5890. ForceSendFields []string `json:"-"`
  5891. // NullFields is a list of field names (e.g. "Property") to include in
  5892. // API requests with the JSON null value. By default, fields with empty
  5893. // values are omitted from API requests. However, any field with an
  5894. // empty value appearing in NullFields will be sent to the server as
  5895. // null. It is an error if a field in this list has a non-empty value.
  5896. // This may be used to include null fields in Patch requests.
  5897. NullFields []string `json:"-"`
  5898. }
  5899. func (s *PropertyValue) MarshalJSON() ([]byte, error) {
  5900. type NoMethod PropertyValue
  5901. raw := NoMethod(*s)
  5902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5903. }
  5904. // ResourceId: A resource id is a generic reference that points to
  5905. // another YouTube resource.
  5906. type ResourceId struct {
  5907. // ChannelId: The ID that YouTube uses to uniquely identify the referred
  5908. // resource, if that resource is a channel. This property is only
  5909. // present if the resourceId.kind value is youtube#channel.
  5910. ChannelId string `json:"channelId,omitempty"`
  5911. // Kind: The type of the API resource.
  5912. Kind string `json:"kind,omitempty"`
  5913. // PlaylistId: The ID that YouTube uses to uniquely identify the
  5914. // referred resource, if that resource is a playlist. This property is
  5915. // only present if the resourceId.kind value is youtube#playlist.
  5916. PlaylistId string `json:"playlistId,omitempty"`
  5917. // VideoId: The ID that YouTube uses to uniquely identify the referred
  5918. // resource, if that resource is a video. This property is only present
  5919. // if the resourceId.kind value is youtube#video.
  5920. VideoId string `json:"videoId,omitempty"`
  5921. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  5922. // unconditionally include in API requests. By default, fields with
  5923. // empty values are omitted from API requests. However, any non-pointer,
  5924. // non-interface field appearing in ForceSendFields will be sent to the
  5925. // server regardless of whether the field is empty or not. This may be
  5926. // used to include empty fields in Patch requests.
  5927. ForceSendFields []string `json:"-"`
  5928. // NullFields is a list of field names (e.g. "ChannelId") to include in
  5929. // API requests with the JSON null value. By default, fields with empty
  5930. // values are omitted from API requests. However, any field with an
  5931. // empty value appearing in NullFields will be sent to the server as
  5932. // null. It is an error if a field in this list has a non-empty value.
  5933. // This may be used to include null fields in Patch requests.
  5934. NullFields []string `json:"-"`
  5935. }
  5936. func (s *ResourceId) MarshalJSON() ([]byte, error) {
  5937. type NoMethod ResourceId
  5938. raw := NoMethod(*s)
  5939. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5940. }
  5941. type SearchListResponse struct {
  5942. // Etag: Etag of this resource.
  5943. Etag string `json:"etag,omitempty"`
  5944. // EventId: Serialized EventId of the request which produced this
  5945. // response.
  5946. EventId string `json:"eventId,omitempty"`
  5947. // Items: A list of results that match the search criteria.
  5948. Items []*SearchResult `json:"items,omitempty"`
  5949. // Kind: Identifies what kind of resource this is. Value: the fixed
  5950. // string "youtube#searchListResponse".
  5951. Kind string `json:"kind,omitempty"`
  5952. // NextPageToken: The token that can be used as the value of the
  5953. // pageToken parameter to retrieve the next page in the result set.
  5954. NextPageToken string `json:"nextPageToken,omitempty"`
  5955. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  5956. // PrevPageToken: The token that can be used as the value of the
  5957. // pageToken parameter to retrieve the previous page in the result set.
  5958. PrevPageToken string `json:"prevPageToken,omitempty"`
  5959. RegionCode string `json:"regionCode,omitempty"`
  5960. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  5961. // VisitorId: The visitorId identifies the visitor.
  5962. VisitorId string `json:"visitorId,omitempty"`
  5963. // ServerResponse contains the HTTP response code and headers from the
  5964. // server.
  5965. googleapi.ServerResponse `json:"-"`
  5966. // ForceSendFields is a list of field names (e.g. "Etag") to
  5967. // unconditionally include in API requests. By default, fields with
  5968. // empty values are omitted from API requests. However, any non-pointer,
  5969. // non-interface field appearing in ForceSendFields will be sent to the
  5970. // server regardless of whether the field is empty or not. This may be
  5971. // used to include empty fields in Patch requests.
  5972. ForceSendFields []string `json:"-"`
  5973. // NullFields is a list of field names (e.g. "Etag") to include in API
  5974. // requests with the JSON null value. By default, fields with empty
  5975. // values are omitted from API requests. However, any field with an
  5976. // empty value appearing in NullFields will be sent to the server as
  5977. // null. It is an error if a field in this list has a non-empty value.
  5978. // This may be used to include null fields in Patch requests.
  5979. NullFields []string `json:"-"`
  5980. }
  5981. func (s *SearchListResponse) MarshalJSON() ([]byte, error) {
  5982. type NoMethod SearchListResponse
  5983. raw := NoMethod(*s)
  5984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5985. }
  5986. // SearchResult: A search result contains information about a YouTube
  5987. // video, channel, or playlist that matches the search parameters
  5988. // specified in an API request. While a search result points to a
  5989. // uniquely identifiable resource, like a video, it does not have its
  5990. // own persistent data.
  5991. type SearchResult struct {
  5992. // Etag: Etag of this resource.
  5993. Etag string `json:"etag,omitempty"`
  5994. // Id: The id object contains information that can be used to uniquely
  5995. // identify the resource that matches the search request.
  5996. Id *ResourceId `json:"id,omitempty"`
  5997. // Kind: Identifies what kind of resource this is. Value: the fixed
  5998. // string "youtube#searchResult".
  5999. Kind string `json:"kind,omitempty"`
  6000. // Snippet: The snippet object contains basic details about a search
  6001. // result, such as its title or description. For example, if the search
  6002. // result is a video, then the title will be the video's title and the
  6003. // description will be the video's description.
  6004. Snippet *SearchResultSnippet `json:"snippet,omitempty"`
  6005. // ForceSendFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API
  6013. // 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 *SearchResult) MarshalJSON() ([]byte, error) {
  6021. type NoMethod SearchResult
  6022. raw := NoMethod(*s)
  6023. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6024. }
  6025. // SearchResultSnippet: Basic details about a search result, including
  6026. // title, description and thumbnails of the item referenced by the
  6027. // search result.
  6028. type SearchResultSnippet struct {
  6029. // ChannelId: The value that YouTube uses to uniquely identify the
  6030. // channel that published the resource that the search result
  6031. // identifies.
  6032. ChannelId string `json:"channelId,omitempty"`
  6033. // ChannelTitle: The title of the channel that published the resource
  6034. // that the search result identifies.
  6035. ChannelTitle string `json:"channelTitle,omitempty"`
  6036. // Description: A description of the search result.
  6037. Description string `json:"description,omitempty"`
  6038. // LiveBroadcastContent: It indicates if the resource (video or channel)
  6039. // has upcoming/active live broadcast content. Or it's "none" if there
  6040. // is not any upcoming/active live broadcasts.
  6041. //
  6042. // Possible values:
  6043. // "live"
  6044. // "none"
  6045. // "upcoming"
  6046. LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
  6047. // PublishedAt: The creation date and time of the resource that the
  6048. // search result identifies. The value is specified in ISO 8601
  6049. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  6050. PublishedAt string `json:"publishedAt,omitempty"`
  6051. // Thumbnails: A map of thumbnail images associated with the search
  6052. // result. For each object in the map, the key is the name of the
  6053. // thumbnail image, and the value is an object that contains other
  6054. // information about the thumbnail.
  6055. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6056. // Title: The title of the search result.
  6057. Title string `json:"title,omitempty"`
  6058. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6059. // unconditionally include in API requests. By default, fields with
  6060. // empty values are omitted from API requests. However, any non-pointer,
  6061. // non-interface field appearing in ForceSendFields will be sent to the
  6062. // server regardless of whether the field is empty or not. This may be
  6063. // used to include empty fields in Patch requests.
  6064. ForceSendFields []string `json:"-"`
  6065. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6066. // API requests with the JSON null value. By default, fields with empty
  6067. // values are omitted from API requests. However, any field with an
  6068. // empty value appearing in NullFields will be sent to the server as
  6069. // null. It is an error if a field in this list has a non-empty value.
  6070. // This may be used to include null fields in Patch requests.
  6071. NullFields []string `json:"-"`
  6072. }
  6073. func (s *SearchResultSnippet) MarshalJSON() ([]byte, error) {
  6074. type NoMethod SearchResultSnippet
  6075. raw := NoMethod(*s)
  6076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6077. }
  6078. // Sponsor: A sponsor resource represents a sponsor for a YouTube
  6079. // channel. A sponsor provides recurring monetary support to a creator
  6080. // and receives special benefits.
  6081. type Sponsor struct {
  6082. // Etag: Etag of this resource.
  6083. Etag string `json:"etag,omitempty"`
  6084. // Kind: Identifies what kind of resource this is. Value: the fixed
  6085. // string "youtube#sponsor".
  6086. Kind string `json:"kind,omitempty"`
  6087. // Snippet: The snippet object contains basic details about the sponsor.
  6088. Snippet *SponsorSnippet `json:"snippet,omitempty"`
  6089. // ForceSendFields is a list of field names (e.g. "Etag") to
  6090. // unconditionally include in API requests. By default, fields with
  6091. // empty values are omitted from API requests. However, any non-pointer,
  6092. // non-interface field appearing in ForceSendFields will be sent to the
  6093. // server regardless of whether the field is empty or not. This may be
  6094. // used to include empty fields in Patch requests.
  6095. ForceSendFields []string `json:"-"`
  6096. // NullFields is a list of field names (e.g. "Etag") to include in API
  6097. // requests with the JSON null value. By default, fields with empty
  6098. // values are omitted from API requests. However, any field with an
  6099. // empty value appearing in NullFields will be sent to the server as
  6100. // null. It is an error if a field in this list has a non-empty value.
  6101. // This may be used to include null fields in Patch requests.
  6102. NullFields []string `json:"-"`
  6103. }
  6104. func (s *Sponsor) MarshalJSON() ([]byte, error) {
  6105. type NoMethod Sponsor
  6106. raw := NoMethod(*s)
  6107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6108. }
  6109. type SponsorListResponse struct {
  6110. // Etag: Etag of this resource.
  6111. Etag string `json:"etag,omitempty"`
  6112. // EventId: Serialized EventId of the request which produced this
  6113. // response.
  6114. EventId string `json:"eventId,omitempty"`
  6115. // Items: A list of sponsors that match the request criteria.
  6116. Items []*Sponsor `json:"items,omitempty"`
  6117. // Kind: Identifies what kind of resource this is. Value: the fixed
  6118. // string "youtube#sponsorListResponse".
  6119. Kind string `json:"kind,omitempty"`
  6120. // NextPageToken: The token that can be used as the value of the
  6121. // pageToken parameter to retrieve the next page in the result set.
  6122. NextPageToken string `json:"nextPageToken,omitempty"`
  6123. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6124. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6125. // VisitorId: The visitorId identifies the visitor.
  6126. VisitorId string `json:"visitorId,omitempty"`
  6127. // ServerResponse contains the HTTP response code and headers from the
  6128. // server.
  6129. googleapi.ServerResponse `json:"-"`
  6130. // ForceSendFields is a list of field names (e.g. "Etag") to
  6131. // unconditionally include in API requests. By default, fields with
  6132. // empty values are omitted from API requests. However, any non-pointer,
  6133. // non-interface field appearing in ForceSendFields will be sent to the
  6134. // server regardless of whether the field is empty or not. This may be
  6135. // used to include empty fields in Patch requests.
  6136. ForceSendFields []string `json:"-"`
  6137. // NullFields is a list of field names (e.g. "Etag") to include in API
  6138. // requests with the JSON null value. By default, fields with empty
  6139. // values are omitted from API requests. However, any field with an
  6140. // empty value appearing in NullFields will be sent to the server as
  6141. // null. It is an error if a field in this list has a non-empty value.
  6142. // This may be used to include null fields in Patch requests.
  6143. NullFields []string `json:"-"`
  6144. }
  6145. func (s *SponsorListResponse) MarshalJSON() ([]byte, error) {
  6146. type NoMethod SponsorListResponse
  6147. raw := NoMethod(*s)
  6148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6149. }
  6150. type SponsorSnippet struct {
  6151. // ChannelId: The id of the channel being sponsored.
  6152. ChannelId string `json:"channelId,omitempty"`
  6153. // CumulativeDurationMonths: The cumulative time a user has been a
  6154. // sponsor in months.
  6155. CumulativeDurationMonths int64 `json:"cumulativeDurationMonths,omitempty"`
  6156. // SponsorDetails: Details about the sponsor.
  6157. SponsorDetails *ChannelProfileDetails `json:"sponsorDetails,omitempty"`
  6158. // SponsorSince: The date and time when the user became a sponsor. The
  6159. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6160. SponsorSince string `json:"sponsorSince,omitempty"`
  6161. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6162. // unconditionally include in API requests. By default, fields with
  6163. // empty values are omitted from API requests. However, any non-pointer,
  6164. // non-interface field appearing in ForceSendFields will be sent to the
  6165. // server regardless of whether the field is empty or not. This may be
  6166. // used to include empty fields in Patch requests.
  6167. ForceSendFields []string `json:"-"`
  6168. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6169. // API requests with the JSON null value. By default, fields with empty
  6170. // values are omitted from API requests. However, any field with an
  6171. // empty value appearing in NullFields will be sent to the server as
  6172. // null. It is an error if a field in this list has a non-empty value.
  6173. // This may be used to include null fields in Patch requests.
  6174. NullFields []string `json:"-"`
  6175. }
  6176. func (s *SponsorSnippet) MarshalJSON() ([]byte, error) {
  6177. type NoMethod SponsorSnippet
  6178. raw := NoMethod(*s)
  6179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6180. }
  6181. // Subscription: A subscription resource contains information about a
  6182. // YouTube user subscription. A subscription notifies a user when new
  6183. // videos are added to a channel or when another user takes one of
  6184. // several actions on YouTube, such as uploading a video, rating a
  6185. // video, or commenting on a video.
  6186. type Subscription struct {
  6187. // ContentDetails: The contentDetails object contains basic statistics
  6188. // about the subscription.
  6189. ContentDetails *SubscriptionContentDetails `json:"contentDetails,omitempty"`
  6190. // Etag: Etag of this resource.
  6191. Etag string `json:"etag,omitempty"`
  6192. // Id: The ID that YouTube uses to uniquely identify the subscription.
  6193. Id string `json:"id,omitempty"`
  6194. // Kind: Identifies what kind of resource this is. Value: the fixed
  6195. // string "youtube#subscription".
  6196. Kind string `json:"kind,omitempty"`
  6197. // Snippet: The snippet object contains basic details about the
  6198. // subscription, including its title and the channel that the user
  6199. // subscribed to.
  6200. Snippet *SubscriptionSnippet `json:"snippet,omitempty"`
  6201. // SubscriberSnippet: The subscriberSnippet object contains basic
  6202. // details about the sbuscriber.
  6203. SubscriberSnippet *SubscriptionSubscriberSnippet `json:"subscriberSnippet,omitempty"`
  6204. // ServerResponse contains the HTTP response code and headers from the
  6205. // server.
  6206. googleapi.ServerResponse `json:"-"`
  6207. // ForceSendFields is a list of field names (e.g. "ContentDetails") to
  6208. // unconditionally include in API requests. By default, fields with
  6209. // empty values are omitted from API requests. However, any non-pointer,
  6210. // non-interface field appearing in ForceSendFields will be sent to the
  6211. // server regardless of whether the field is empty or not. This may be
  6212. // used to include empty fields in Patch requests.
  6213. ForceSendFields []string `json:"-"`
  6214. // NullFields is a list of field names (e.g. "ContentDetails") to
  6215. // include in API requests with the JSON null value. By default, fields
  6216. // with empty values are omitted from API requests. However, any field
  6217. // with an empty value appearing in NullFields will be sent to the
  6218. // server as null. It is an error if a field in this list has a
  6219. // non-empty value. This may be used to include null fields in Patch
  6220. // requests.
  6221. NullFields []string `json:"-"`
  6222. }
  6223. func (s *Subscription) MarshalJSON() ([]byte, error) {
  6224. type NoMethod Subscription
  6225. raw := NoMethod(*s)
  6226. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6227. }
  6228. // SubscriptionContentDetails: Details about the content to witch a
  6229. // subscription refers.
  6230. type SubscriptionContentDetails struct {
  6231. // ActivityType: The type of activity this subscription is for (only
  6232. // uploads, everything).
  6233. //
  6234. // Possible values:
  6235. // "all"
  6236. // "uploads"
  6237. ActivityType string `json:"activityType,omitempty"`
  6238. // NewItemCount: The number of new items in the subscription since its
  6239. // content was last read.
  6240. NewItemCount int64 `json:"newItemCount,omitempty"`
  6241. // TotalItemCount: The approximate number of items that the subscription
  6242. // points to.
  6243. TotalItemCount int64 `json:"totalItemCount,omitempty"`
  6244. // ForceSendFields is a list of field names (e.g. "ActivityType") to
  6245. // unconditionally include in API requests. By default, fields with
  6246. // empty values are omitted from API requests. However, any non-pointer,
  6247. // non-interface field appearing in ForceSendFields will be sent to the
  6248. // server regardless of whether the field is empty or not. This may be
  6249. // used to include empty fields in Patch requests.
  6250. ForceSendFields []string `json:"-"`
  6251. // NullFields is a list of field names (e.g. "ActivityType") to include
  6252. // in API requests with the JSON null value. By default, fields with
  6253. // empty values are omitted from API requests. However, any field with
  6254. // an empty value appearing in NullFields will be sent to the server as
  6255. // null. It is an error if a field in this list has a non-empty value.
  6256. // This may be used to include null fields in Patch requests.
  6257. NullFields []string `json:"-"`
  6258. }
  6259. func (s *SubscriptionContentDetails) MarshalJSON() ([]byte, error) {
  6260. type NoMethod SubscriptionContentDetails
  6261. raw := NoMethod(*s)
  6262. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6263. }
  6264. type SubscriptionListResponse struct {
  6265. // Etag: Etag of this resource.
  6266. Etag string `json:"etag,omitempty"`
  6267. // EventId: Serialized EventId of the request which produced this
  6268. // response.
  6269. EventId string `json:"eventId,omitempty"`
  6270. // Items: A list of subscriptions that match the request criteria.
  6271. Items []*Subscription `json:"items,omitempty"`
  6272. // Kind: Identifies what kind of resource this is. Value: the fixed
  6273. // string "youtube#subscriptionListResponse".
  6274. Kind string `json:"kind,omitempty"`
  6275. // NextPageToken: The token that can be used as the value of the
  6276. // pageToken parameter to retrieve the next page in the result set.
  6277. NextPageToken string `json:"nextPageToken,omitempty"`
  6278. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6279. // PrevPageToken: The token that can be used as the value of the
  6280. // pageToken parameter to retrieve the previous page in the result set.
  6281. PrevPageToken string `json:"prevPageToken,omitempty"`
  6282. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6283. // VisitorId: The visitorId identifies the visitor.
  6284. VisitorId string `json:"visitorId,omitempty"`
  6285. // ServerResponse contains the HTTP response code and headers from the
  6286. // server.
  6287. googleapi.ServerResponse `json:"-"`
  6288. // ForceSendFields is a list of field names (e.g. "Etag") to
  6289. // unconditionally include in API requests. By default, fields with
  6290. // empty values are omitted from API requests. However, any non-pointer,
  6291. // non-interface field appearing in ForceSendFields will be sent to the
  6292. // server regardless of whether the field is empty or not. This may be
  6293. // used to include empty fields in Patch requests.
  6294. ForceSendFields []string `json:"-"`
  6295. // NullFields is a list of field names (e.g. "Etag") to include in API
  6296. // requests with the JSON null value. By default, fields with empty
  6297. // values are omitted from API requests. However, any field with an
  6298. // empty value appearing in NullFields will be sent to the server as
  6299. // null. It is an error if a field in this list has a non-empty value.
  6300. // This may be used to include null fields in Patch requests.
  6301. NullFields []string `json:"-"`
  6302. }
  6303. func (s *SubscriptionListResponse) MarshalJSON() ([]byte, error) {
  6304. type NoMethod SubscriptionListResponse
  6305. raw := NoMethod(*s)
  6306. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6307. }
  6308. // SubscriptionSnippet: Basic details about a subscription, including
  6309. // title, description and thumbnails of the subscribed item.
  6310. type SubscriptionSnippet struct {
  6311. // ChannelId: The ID that YouTube uses to uniquely identify the
  6312. // subscriber's channel.
  6313. ChannelId string `json:"channelId,omitempty"`
  6314. // ChannelTitle: Channel title for the channel that the subscription
  6315. // belongs to.
  6316. ChannelTitle string `json:"channelTitle,omitempty"`
  6317. // Description: The subscription's details.
  6318. Description string `json:"description,omitempty"`
  6319. // PublishedAt: The date and time that the subscription was created. The
  6320. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6321. PublishedAt string `json:"publishedAt,omitempty"`
  6322. // ResourceId: The id object contains information about the channel that
  6323. // the user subscribed to.
  6324. ResourceId *ResourceId `json:"resourceId,omitempty"`
  6325. // Thumbnails: A map of thumbnail images associated with the video. For
  6326. // each object in the map, the key is the name of the thumbnail image,
  6327. // and the value is an object that contains other information about the
  6328. // thumbnail.
  6329. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6330. // Title: The subscription's title.
  6331. Title string `json:"title,omitempty"`
  6332. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6333. // unconditionally include in API requests. By default, fields with
  6334. // empty values are omitted from API requests. However, any non-pointer,
  6335. // non-interface field appearing in ForceSendFields will be sent to the
  6336. // server regardless of whether the field is empty or not. This may be
  6337. // used to include empty fields in Patch requests.
  6338. ForceSendFields []string `json:"-"`
  6339. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6340. // API requests with the JSON null value. By default, fields with empty
  6341. // values are omitted from API requests. However, any field with an
  6342. // empty value appearing in NullFields will be sent to the server as
  6343. // null. It is an error if a field in this list has a non-empty value.
  6344. // This may be used to include null fields in Patch requests.
  6345. NullFields []string `json:"-"`
  6346. }
  6347. func (s *SubscriptionSnippet) MarshalJSON() ([]byte, error) {
  6348. type NoMethod SubscriptionSnippet
  6349. raw := NoMethod(*s)
  6350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6351. }
  6352. // SubscriptionSubscriberSnippet: Basic details about a subscription's
  6353. // subscriber including title, description, channel ID and thumbnails.
  6354. type SubscriptionSubscriberSnippet struct {
  6355. // ChannelId: The channel ID of the subscriber.
  6356. ChannelId string `json:"channelId,omitempty"`
  6357. // Description: The description of the subscriber.
  6358. Description string `json:"description,omitempty"`
  6359. // Thumbnails: Thumbnails for this subscriber.
  6360. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  6361. // Title: The title of the subscriber.
  6362. Title string `json:"title,omitempty"`
  6363. // ForceSendFields is a list of field names (e.g. "ChannelId") to
  6364. // unconditionally include in API requests. By default, fields with
  6365. // empty values are omitted from API requests. However, any non-pointer,
  6366. // non-interface field appearing in ForceSendFields will be sent to the
  6367. // server regardless of whether the field is empty or not. This may be
  6368. // used to include empty fields in Patch requests.
  6369. ForceSendFields []string `json:"-"`
  6370. // NullFields is a list of field names (e.g. "ChannelId") to include in
  6371. // API requests with the JSON null value. By default, fields with empty
  6372. // values are omitted from API requests. However, any field with an
  6373. // empty value appearing in NullFields will be sent to the server as
  6374. // null. It is an error if a field in this list has a non-empty value.
  6375. // This may be used to include null fields in Patch requests.
  6376. NullFields []string `json:"-"`
  6377. }
  6378. func (s *SubscriptionSubscriberSnippet) MarshalJSON() ([]byte, error) {
  6379. type NoMethod SubscriptionSubscriberSnippet
  6380. raw := NoMethod(*s)
  6381. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6382. }
  6383. // SuperChatEvent: A superChatEvent resource represents a Super Chat
  6384. // purchase on a YouTube channel.
  6385. type SuperChatEvent struct {
  6386. // Etag: Etag of this resource.
  6387. Etag string `json:"etag,omitempty"`
  6388. // Id: The ID that YouTube assigns to uniquely identify the Super Chat
  6389. // event.
  6390. Id string `json:"id,omitempty"`
  6391. // Kind: Identifies what kind of resource this is. Value: the fixed
  6392. // string "youtube#superChatEvent".
  6393. Kind string `json:"kind,omitempty"`
  6394. // Snippet: The snippet object contains basic details about the Super
  6395. // Chat event.
  6396. Snippet *SuperChatEventSnippet `json:"snippet,omitempty"`
  6397. // ForceSendFields is a list of field names (e.g. "Etag") to
  6398. // unconditionally include in API requests. By default, fields with
  6399. // empty values are omitted from API requests. However, any non-pointer,
  6400. // non-interface field appearing in ForceSendFields will be sent to the
  6401. // server regardless of whether the field is empty or not. This may be
  6402. // used to include empty fields in Patch requests.
  6403. ForceSendFields []string `json:"-"`
  6404. // NullFields is a list of field names (e.g. "Etag") to include in API
  6405. // requests with the JSON null value. By default, fields with empty
  6406. // values are omitted from API requests. However, any field with an
  6407. // empty value appearing in NullFields will be sent to the server as
  6408. // null. It is an error if a field in this list has a non-empty value.
  6409. // This may be used to include null fields in Patch requests.
  6410. NullFields []string `json:"-"`
  6411. }
  6412. func (s *SuperChatEvent) MarshalJSON() ([]byte, error) {
  6413. type NoMethod SuperChatEvent
  6414. raw := NoMethod(*s)
  6415. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6416. }
  6417. type SuperChatEventListResponse struct {
  6418. // Etag: Etag of this resource.
  6419. Etag string `json:"etag,omitempty"`
  6420. // EventId: Serialized EventId of the request which produced this
  6421. // response.
  6422. EventId string `json:"eventId,omitempty"`
  6423. // Items: A list of Super Chat purchases that match the request
  6424. // criteria.
  6425. Items []*SuperChatEvent `json:"items,omitempty"`
  6426. // Kind: Identifies what kind of resource this is. Value: the fixed
  6427. // string "youtube#superChatEventListResponse".
  6428. Kind string `json:"kind,omitempty"`
  6429. // NextPageToken: The token that can be used as the value of the
  6430. // pageToken parameter to retrieve the next page in the result set.
  6431. NextPageToken string `json:"nextPageToken,omitempty"`
  6432. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6433. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6434. // VisitorId: The visitorId identifies the visitor.
  6435. VisitorId string `json:"visitorId,omitempty"`
  6436. // ServerResponse contains the HTTP response code and headers from the
  6437. // server.
  6438. googleapi.ServerResponse `json:"-"`
  6439. // ForceSendFields is a list of field names (e.g. "Etag") to
  6440. // unconditionally include in API requests. By default, fields with
  6441. // empty values are omitted from API requests. However, any non-pointer,
  6442. // non-interface field appearing in ForceSendFields will be sent to the
  6443. // server regardless of whether the field is empty or not. This may be
  6444. // used to include empty fields in Patch requests.
  6445. ForceSendFields []string `json:"-"`
  6446. // NullFields is a list of field names (e.g. "Etag") to include in API
  6447. // requests with the JSON null value. By default, fields with empty
  6448. // values are omitted from API requests. However, any field with an
  6449. // empty value appearing in NullFields will be sent to the server as
  6450. // null. It is an error if a field in this list has a non-empty value.
  6451. // This may be used to include null fields in Patch requests.
  6452. NullFields []string `json:"-"`
  6453. }
  6454. func (s *SuperChatEventListResponse) MarshalJSON() ([]byte, error) {
  6455. type NoMethod SuperChatEventListResponse
  6456. raw := NoMethod(*s)
  6457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6458. }
  6459. type SuperChatEventSnippet struct {
  6460. // AmountMicros: The purchase amount, in micros of the purchase
  6461. // currency. e.g., 1 is represented as 1000000.
  6462. AmountMicros uint64 `json:"amountMicros,omitempty,string"`
  6463. // ChannelId: Channel id where the event occurred.
  6464. ChannelId string `json:"channelId,omitempty"`
  6465. // CommentText: The text contents of the comment left by the user.
  6466. CommentText string `json:"commentText,omitempty"`
  6467. // CreatedAt: The date and time when the event occurred. The value is
  6468. // specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  6469. CreatedAt string `json:"createdAt,omitempty"`
  6470. // Currency: The currency in which the purchase was made. ISO 4217.
  6471. Currency string `json:"currency,omitempty"`
  6472. // DisplayString: A rendered string that displays the purchase amount
  6473. // and currency (e.g., "$1.00"). The string is rendered for the given
  6474. // language.
  6475. DisplayString string `json:"displayString,omitempty"`
  6476. // IsSuperChatForGood: True if this event is a Super Chat for Good
  6477. // purchase.
  6478. IsSuperChatForGood bool `json:"isSuperChatForGood,omitempty"`
  6479. // MessageType: The tier for the paid message, which is based on the
  6480. // amount of money spent to purchase the message.
  6481. MessageType int64 `json:"messageType,omitempty"`
  6482. // Nonprofit: If this event is a Super Chat for Good purchase, this
  6483. // field will contain information about the charity the purchase is
  6484. // donated to.
  6485. Nonprofit *Nonprofit `json:"nonprofit,omitempty"`
  6486. // SupporterDetails: Details about the supporter.
  6487. SupporterDetails *ChannelProfileDetails `json:"supporterDetails,omitempty"`
  6488. // ForceSendFields is a list of field names (e.g. "AmountMicros") to
  6489. // unconditionally include in API requests. By default, fields with
  6490. // empty values are omitted from API requests. However, any non-pointer,
  6491. // non-interface field appearing in ForceSendFields will be sent to the
  6492. // server regardless of whether the field is empty or not. This may be
  6493. // used to include empty fields in Patch requests.
  6494. ForceSendFields []string `json:"-"`
  6495. // NullFields is a list of field names (e.g. "AmountMicros") to include
  6496. // in API requests with the JSON null value. By default, fields with
  6497. // empty values are omitted from API requests. However, any field with
  6498. // an empty value appearing in NullFields will be sent to the server as
  6499. // null. It is an error if a field in this list has a non-empty value.
  6500. // This may be used to include null fields in Patch requests.
  6501. NullFields []string `json:"-"`
  6502. }
  6503. func (s *SuperChatEventSnippet) MarshalJSON() ([]byte, error) {
  6504. type NoMethod SuperChatEventSnippet
  6505. raw := NoMethod(*s)
  6506. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6507. }
  6508. // Thumbnail: A thumbnail is an image representing a YouTube resource.
  6509. type Thumbnail struct {
  6510. // Height: (Optional) Height of the thumbnail image.
  6511. Height int64 `json:"height,omitempty"`
  6512. // Url: The thumbnail image's URL.
  6513. Url string `json:"url,omitempty"`
  6514. // Width: (Optional) Width of the thumbnail image.
  6515. Width int64 `json:"width,omitempty"`
  6516. // ForceSendFields is a list of field names (e.g. "Height") to
  6517. // unconditionally include in API requests. By default, fields with
  6518. // empty values are omitted from API requests. However, any non-pointer,
  6519. // non-interface field appearing in ForceSendFields will be sent to the
  6520. // server regardless of whether the field is empty or not. This may be
  6521. // used to include empty fields in Patch requests.
  6522. ForceSendFields []string `json:"-"`
  6523. // NullFields is a list of field names (e.g. "Height") to include in API
  6524. // requests with the JSON null value. By default, fields with empty
  6525. // values are omitted from API requests. However, any field with an
  6526. // empty value appearing in NullFields will be sent to the server as
  6527. // null. It is an error if a field in this list has a non-empty value.
  6528. // This may be used to include null fields in Patch requests.
  6529. NullFields []string `json:"-"`
  6530. }
  6531. func (s *Thumbnail) MarshalJSON() ([]byte, error) {
  6532. type NoMethod Thumbnail
  6533. raw := NoMethod(*s)
  6534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6535. }
  6536. // ThumbnailDetails: Internal representation of thumbnails for a YouTube
  6537. // resource.
  6538. type ThumbnailDetails struct {
  6539. // Default: The default image for this resource.
  6540. Default *Thumbnail `json:"default,omitempty"`
  6541. // High: The high quality image for this resource.
  6542. High *Thumbnail `json:"high,omitempty"`
  6543. // Maxres: The maximum resolution quality image for this resource.
  6544. Maxres *Thumbnail `json:"maxres,omitempty"`
  6545. // Medium: The medium quality image for this resource.
  6546. Medium *Thumbnail `json:"medium,omitempty"`
  6547. // Standard: The standard quality image for this resource.
  6548. Standard *Thumbnail `json:"standard,omitempty"`
  6549. // ForceSendFields is a list of field names (e.g. "Default") to
  6550. // unconditionally include in API requests. By default, fields with
  6551. // empty values are omitted from API requests. However, any non-pointer,
  6552. // non-interface field appearing in ForceSendFields will be sent to the
  6553. // server regardless of whether the field is empty or not. This may be
  6554. // used to include empty fields in Patch requests.
  6555. ForceSendFields []string `json:"-"`
  6556. // NullFields is a list of field names (e.g. "Default") to include in
  6557. // API requests with the JSON null value. By default, fields with empty
  6558. // values are omitted from API requests. However, any field with an
  6559. // empty value appearing in NullFields will be sent to the server as
  6560. // null. It is an error if a field in this list has a non-empty value.
  6561. // This may be used to include null fields in Patch requests.
  6562. NullFields []string `json:"-"`
  6563. }
  6564. func (s *ThumbnailDetails) MarshalJSON() ([]byte, error) {
  6565. type NoMethod ThumbnailDetails
  6566. raw := NoMethod(*s)
  6567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6568. }
  6569. type ThumbnailSetResponse struct {
  6570. // Etag: Etag of this resource.
  6571. Etag string `json:"etag,omitempty"`
  6572. // EventId: Serialized EventId of the request which produced this
  6573. // response.
  6574. EventId string `json:"eventId,omitempty"`
  6575. // Items: A list of thumbnails.
  6576. Items []*ThumbnailDetails `json:"items,omitempty"`
  6577. // Kind: Identifies what kind of resource this is. Value: the fixed
  6578. // string "youtube#thumbnailSetResponse".
  6579. Kind string `json:"kind,omitempty"`
  6580. // VisitorId: The visitorId identifies the visitor.
  6581. VisitorId string `json:"visitorId,omitempty"`
  6582. // ServerResponse contains the HTTP response code and headers from the
  6583. // server.
  6584. googleapi.ServerResponse `json:"-"`
  6585. // ForceSendFields is a list of field names (e.g. "Etag") to
  6586. // unconditionally include in API requests. By default, fields with
  6587. // empty values are omitted from API requests. However, any non-pointer,
  6588. // non-interface field appearing in ForceSendFields will be sent to the
  6589. // server regardless of whether the field is empty or not. This may be
  6590. // used to include empty fields in Patch requests.
  6591. ForceSendFields []string `json:"-"`
  6592. // NullFields is a list of field names (e.g. "Etag") to include in API
  6593. // requests with the JSON null value. By default, fields with empty
  6594. // values are omitted from API requests. However, any field with an
  6595. // empty value appearing in NullFields will be sent to the server as
  6596. // null. It is an error if a field in this list has a non-empty value.
  6597. // This may be used to include null fields in Patch requests.
  6598. NullFields []string `json:"-"`
  6599. }
  6600. func (s *ThumbnailSetResponse) MarshalJSON() ([]byte, error) {
  6601. type NoMethod ThumbnailSetResponse
  6602. raw := NoMethod(*s)
  6603. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6604. }
  6605. // TokenPagination: Stub token pagination template to suppress results.
  6606. type TokenPagination struct {
  6607. }
  6608. // Video: A video resource represents a YouTube video.
  6609. type Video struct {
  6610. // AgeGating: Age restriction details related to a video. This data can
  6611. // only be retrieved by the video owner.
  6612. AgeGating *VideoAgeGating `json:"ageGating,omitempty"`
  6613. // ContentDetails: The contentDetails object contains information about
  6614. // the video content, including the length of the video and its aspect
  6615. // ratio.
  6616. ContentDetails *VideoContentDetails `json:"contentDetails,omitempty"`
  6617. // Etag: Etag of this resource.
  6618. Etag string `json:"etag,omitempty"`
  6619. // FileDetails: The fileDetails object encapsulates information about
  6620. // the video file that was uploaded to YouTube, including the file's
  6621. // resolution, duration, audio and video codecs, stream bitrates, and
  6622. // more. This data can only be retrieved by the video owner.
  6623. FileDetails *VideoFileDetails `json:"fileDetails,omitempty"`
  6624. // Id: The ID that YouTube uses to uniquely identify the video.
  6625. Id string `json:"id,omitempty"`
  6626. // Kind: Identifies what kind of resource this is. Value: the fixed
  6627. // string "youtube#video".
  6628. Kind string `json:"kind,omitempty"`
  6629. // LiveStreamingDetails: The liveStreamingDetails object contains
  6630. // metadata about a live video broadcast. The object will only be
  6631. // present in a video resource if the video is an upcoming, live, or
  6632. // completed live broadcast.
  6633. LiveStreamingDetails *VideoLiveStreamingDetails `json:"liveStreamingDetails,omitempty"`
  6634. // Localizations: List with all localizations.
  6635. Localizations map[string]VideoLocalization `json:"localizations,omitempty"`
  6636. // MonetizationDetails: The monetizationDetails object encapsulates
  6637. // information about the monetization status of the video.
  6638. MonetizationDetails *VideoMonetizationDetails `json:"monetizationDetails,omitempty"`
  6639. // Player: The player object contains information that you would use to
  6640. // play the video in an embedded player.
  6641. Player *VideoPlayer `json:"player,omitempty"`
  6642. // ProcessingDetails: The processingDetails object encapsulates
  6643. // information about YouTube's progress in processing the uploaded video
  6644. // file. The properties in the object identify the current processing
  6645. // status and an estimate of the time remaining until YouTube finishes
  6646. // processing the video. This part also indicates whether different
  6647. // types of data or content, such as file details or thumbnail images,
  6648. // are available for the video.
  6649. //
  6650. // The processingProgress object is designed to be polled so that the
  6651. // video uploaded can track the progress that YouTube has made in
  6652. // processing the uploaded video file. This data can only be retrieved
  6653. // by the video owner.
  6654. ProcessingDetails *VideoProcessingDetails `json:"processingDetails,omitempty"`
  6655. // ProjectDetails: The projectDetails object contains information about
  6656. // the project specific video metadata.
  6657. ProjectDetails *VideoProjectDetails `json:"projectDetails,omitempty"`
  6658. // RecordingDetails: The recordingDetails object encapsulates
  6659. // information about the location, date and address where the video was
  6660. // recorded.
  6661. RecordingDetails *VideoRecordingDetails `json:"recordingDetails,omitempty"`
  6662. // Snippet: The snippet object contains basic details about the video,
  6663. // such as its title, description, and category.
  6664. Snippet *VideoSnippet `json:"snippet,omitempty"`
  6665. // Statistics: The statistics object contains statistics about the
  6666. // video.
  6667. Statistics *VideoStatistics `json:"statistics,omitempty"`
  6668. // Status: The status object contains information about the video's
  6669. // uploading, processing, and privacy statuses.
  6670. Status *VideoStatus `json:"status,omitempty"`
  6671. // Suggestions: The suggestions object encapsulates suggestions that
  6672. // identify opportunities to improve the video quality or the metadata
  6673. // for the uploaded video. This data can only be retrieved by the video
  6674. // owner.
  6675. Suggestions *VideoSuggestions `json:"suggestions,omitempty"`
  6676. // TopicDetails: The topicDetails object encapsulates information about
  6677. // Freebase topics associated with the video.
  6678. TopicDetails *VideoTopicDetails `json:"topicDetails,omitempty"`
  6679. // ServerResponse contains the HTTP response code and headers from the
  6680. // server.
  6681. googleapi.ServerResponse `json:"-"`
  6682. // ForceSendFields is a list of field names (e.g. "AgeGating") to
  6683. // unconditionally include in API requests. By default, fields with
  6684. // empty values are omitted from API requests. However, any non-pointer,
  6685. // non-interface field appearing in ForceSendFields will be sent to the
  6686. // server regardless of whether the field is empty or not. This may be
  6687. // used to include empty fields in Patch requests.
  6688. ForceSendFields []string `json:"-"`
  6689. // NullFields is a list of field names (e.g. "AgeGating") to include in
  6690. // API requests with the JSON null value. By default, fields with empty
  6691. // values are omitted from API requests. However, any field with an
  6692. // empty value appearing in NullFields will be sent to the server as
  6693. // null. It is an error if a field in this list has a non-empty value.
  6694. // This may be used to include null fields in Patch requests.
  6695. NullFields []string `json:"-"`
  6696. }
  6697. func (s *Video) MarshalJSON() ([]byte, error) {
  6698. type NoMethod Video
  6699. raw := NoMethod(*s)
  6700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6701. }
  6702. type VideoAbuseReport struct {
  6703. // Comments: Additional comments regarding the abuse report.
  6704. Comments string `json:"comments,omitempty"`
  6705. // Language: The language that the content was viewed in.
  6706. Language string `json:"language,omitempty"`
  6707. // ReasonId: The high-level, or primary, reason that the content is
  6708. // abusive. The value is an abuse report reason ID.
  6709. ReasonId string `json:"reasonId,omitempty"`
  6710. // SecondaryReasonId: The specific, or secondary, reason that this
  6711. // content is abusive (if available). The value is an abuse report
  6712. // reason ID that is a valid secondary reason for the primary reason.
  6713. SecondaryReasonId string `json:"secondaryReasonId,omitempty"`
  6714. // VideoId: The ID that YouTube uses to uniquely identify the video.
  6715. VideoId string `json:"videoId,omitempty"`
  6716. // ForceSendFields is a list of field names (e.g. "Comments") to
  6717. // unconditionally include in API requests. By default, fields with
  6718. // empty values are omitted from API requests. However, any non-pointer,
  6719. // non-interface field appearing in ForceSendFields will be sent to the
  6720. // server regardless of whether the field is empty or not. This may be
  6721. // used to include empty fields in Patch requests.
  6722. ForceSendFields []string `json:"-"`
  6723. // NullFields is a list of field names (e.g. "Comments") to include in
  6724. // API requests with the JSON null value. By default, fields with empty
  6725. // values are omitted from API requests. However, any field with an
  6726. // empty value appearing in NullFields will be sent to the server as
  6727. // null. It is an error if a field in this list has a non-empty value.
  6728. // This may be used to include null fields in Patch requests.
  6729. NullFields []string `json:"-"`
  6730. }
  6731. func (s *VideoAbuseReport) MarshalJSON() ([]byte, error) {
  6732. type NoMethod VideoAbuseReport
  6733. raw := NoMethod(*s)
  6734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6735. }
  6736. // VideoAbuseReportReason: A videoAbuseReportReason resource identifies
  6737. // a reason that a video could be reported as abusive. Video abuse
  6738. // report reasons are used with video.ReportAbuse.
  6739. type VideoAbuseReportReason struct {
  6740. // Etag: Etag of this resource.
  6741. Etag string `json:"etag,omitempty"`
  6742. // Id: The ID of this abuse report reason.
  6743. Id string `json:"id,omitempty"`
  6744. // Kind: Identifies what kind of resource this is. Value: the fixed
  6745. // string "youtube#videoAbuseReportReason".
  6746. Kind string `json:"kind,omitempty"`
  6747. // Snippet: The snippet object contains basic details about the abuse
  6748. // report reason.
  6749. Snippet *VideoAbuseReportReasonSnippet `json:"snippet,omitempty"`
  6750. // ForceSendFields is a list of field names (e.g. "Etag") to
  6751. // unconditionally include in API requests. By default, fields with
  6752. // empty values are omitted from API requests. However, any non-pointer,
  6753. // non-interface field appearing in ForceSendFields will be sent to the
  6754. // server regardless of whether the field is empty or not. This may be
  6755. // used to include empty fields in Patch requests.
  6756. ForceSendFields []string `json:"-"`
  6757. // NullFields is a list of field names (e.g. "Etag") to include in API
  6758. // requests with the JSON null value. By default, fields with empty
  6759. // values are omitted from API requests. However, any field with an
  6760. // empty value appearing in NullFields will be sent to the server as
  6761. // null. It is an error if a field in this list has a non-empty value.
  6762. // This may be used to include null fields in Patch requests.
  6763. NullFields []string `json:"-"`
  6764. }
  6765. func (s *VideoAbuseReportReason) MarshalJSON() ([]byte, error) {
  6766. type NoMethod VideoAbuseReportReason
  6767. raw := NoMethod(*s)
  6768. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6769. }
  6770. type VideoAbuseReportReasonListResponse struct {
  6771. // Etag: Etag of this resource.
  6772. Etag string `json:"etag,omitempty"`
  6773. // EventId: Serialized EventId of the request which produced this
  6774. // response.
  6775. EventId string `json:"eventId,omitempty"`
  6776. // Items: A list of valid abuse reasons that are used with
  6777. // video.ReportAbuse.
  6778. Items []*VideoAbuseReportReason `json:"items,omitempty"`
  6779. // Kind: Identifies what kind of resource this is. Value: the fixed
  6780. // string "youtube#videoAbuseReportReasonListResponse".
  6781. Kind string `json:"kind,omitempty"`
  6782. // VisitorId: The visitorId identifies the visitor.
  6783. VisitorId string `json:"visitorId,omitempty"`
  6784. // ServerResponse contains the HTTP response code and headers from the
  6785. // server.
  6786. googleapi.ServerResponse `json:"-"`
  6787. // ForceSendFields is a list of field names (e.g. "Etag") to
  6788. // unconditionally include in API requests. By default, fields with
  6789. // empty values are omitted from API requests. However, any non-pointer,
  6790. // non-interface field appearing in ForceSendFields will be sent to the
  6791. // server regardless of whether the field is empty or not. This may be
  6792. // used to include empty fields in Patch requests.
  6793. ForceSendFields []string `json:"-"`
  6794. // NullFields is a list of field names (e.g. "Etag") to include in API
  6795. // requests with the JSON null value. By default, fields with empty
  6796. // values are omitted from API requests. However, any field with an
  6797. // empty value appearing in NullFields will be sent to the server as
  6798. // null. It is an error if a field in this list has a non-empty value.
  6799. // This may be used to include null fields in Patch requests.
  6800. NullFields []string `json:"-"`
  6801. }
  6802. func (s *VideoAbuseReportReasonListResponse) MarshalJSON() ([]byte, error) {
  6803. type NoMethod VideoAbuseReportReasonListResponse
  6804. raw := NoMethod(*s)
  6805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6806. }
  6807. // VideoAbuseReportReasonSnippet: Basic details about a video category,
  6808. // such as its localized title.
  6809. type VideoAbuseReportReasonSnippet struct {
  6810. // Label: The localized label belonging to this abuse report reason.
  6811. Label string `json:"label,omitempty"`
  6812. // SecondaryReasons: The secondary reasons associated with this reason,
  6813. // if any are available. (There might be 0 or more.)
  6814. SecondaryReasons []*VideoAbuseReportSecondaryReason `json:"secondaryReasons,omitempty"`
  6815. // ForceSendFields is a list of field names (e.g. "Label") to
  6816. // unconditionally include in API requests. By default, fields with
  6817. // empty values are omitted from API requests. However, any non-pointer,
  6818. // non-interface field appearing in ForceSendFields will be sent to the
  6819. // server regardless of whether the field is empty or not. This may be
  6820. // used to include empty fields in Patch requests.
  6821. ForceSendFields []string `json:"-"`
  6822. // NullFields is a list of field names (e.g. "Label") to include in API
  6823. // requests with the JSON null value. By default, fields with empty
  6824. // values are omitted from API requests. However, any field with an
  6825. // empty value appearing in NullFields will be sent to the server as
  6826. // null. It is an error if a field in this list has a non-empty value.
  6827. // This may be used to include null fields in Patch requests.
  6828. NullFields []string `json:"-"`
  6829. }
  6830. func (s *VideoAbuseReportReasonSnippet) MarshalJSON() ([]byte, error) {
  6831. type NoMethod VideoAbuseReportReasonSnippet
  6832. raw := NoMethod(*s)
  6833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6834. }
  6835. type VideoAbuseReportSecondaryReason struct {
  6836. // Id: The ID of this abuse report secondary reason.
  6837. Id string `json:"id,omitempty"`
  6838. // Label: The localized label for this abuse report secondary reason.
  6839. Label string `json:"label,omitempty"`
  6840. // ForceSendFields is a list of field names (e.g. "Id") to
  6841. // unconditionally include in API requests. By default, fields with
  6842. // empty values are omitted from API requests. However, any non-pointer,
  6843. // non-interface field appearing in ForceSendFields will be sent to the
  6844. // server regardless of whether the field is empty or not. This may be
  6845. // used to include empty fields in Patch requests.
  6846. ForceSendFields []string `json:"-"`
  6847. // NullFields is a list of field names (e.g. "Id") to include in API
  6848. // requests with the JSON null value. By default, fields with empty
  6849. // values are omitted from API requests. However, any field with an
  6850. // empty value appearing in NullFields will be sent to the server as
  6851. // null. It is an error if a field in this list has a non-empty value.
  6852. // This may be used to include null fields in Patch requests.
  6853. NullFields []string `json:"-"`
  6854. }
  6855. func (s *VideoAbuseReportSecondaryReason) MarshalJSON() ([]byte, error) {
  6856. type NoMethod VideoAbuseReportSecondaryReason
  6857. raw := NoMethod(*s)
  6858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6859. }
  6860. type VideoAgeGating struct {
  6861. // AlcoholContent: Indicates whether or not the video has alcoholic
  6862. // beverage content. Only users of legal purchasing age in a particular
  6863. // country, as identified by ICAP, can view the content.
  6864. AlcoholContent bool `json:"alcoholContent,omitempty"`
  6865. // Restricted: Age-restricted trailers. For redband trailers and
  6866. // adult-rated video-games. Only users aged 18+ can view the content.
  6867. // The the field is true the content is restricted to viewers aged 18+.
  6868. // Otherwise The field won't be present.
  6869. Restricted bool `json:"restricted,omitempty"`
  6870. // VideoGameRating: Video game rating, if any.
  6871. //
  6872. // Possible values:
  6873. // "anyone"
  6874. // "m15Plus"
  6875. // "m16Plus"
  6876. // "m17Plus"
  6877. VideoGameRating string `json:"videoGameRating,omitempty"`
  6878. // ForceSendFields is a list of field names (e.g. "AlcoholContent") to
  6879. // unconditionally include in API requests. By default, fields with
  6880. // empty values are omitted from API requests. However, any non-pointer,
  6881. // non-interface field appearing in ForceSendFields will be sent to the
  6882. // server regardless of whether the field is empty or not. This may be
  6883. // used to include empty fields in Patch requests.
  6884. ForceSendFields []string `json:"-"`
  6885. // NullFields is a list of field names (e.g. "AlcoholContent") to
  6886. // include in API requests with the JSON null value. By default, fields
  6887. // with empty values are omitted from API requests. However, any field
  6888. // with an empty value appearing in NullFields will be sent to the
  6889. // server as null. It is an error if a field in this list has a
  6890. // non-empty value. This may be used to include null fields in Patch
  6891. // requests.
  6892. NullFields []string `json:"-"`
  6893. }
  6894. func (s *VideoAgeGating) MarshalJSON() ([]byte, error) {
  6895. type NoMethod VideoAgeGating
  6896. raw := NoMethod(*s)
  6897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6898. }
  6899. // VideoCategory: A videoCategory resource identifies a category that
  6900. // has been or could be associated with uploaded videos.
  6901. type VideoCategory struct {
  6902. // Etag: Etag of this resource.
  6903. Etag string `json:"etag,omitempty"`
  6904. // Id: The ID that YouTube uses to uniquely identify the video category.
  6905. Id string `json:"id,omitempty"`
  6906. // Kind: Identifies what kind of resource this is. Value: the fixed
  6907. // string "youtube#videoCategory".
  6908. Kind string `json:"kind,omitempty"`
  6909. // Snippet: The snippet object contains basic details about the video
  6910. // category, including its title.
  6911. Snippet *VideoCategorySnippet `json:"snippet,omitempty"`
  6912. // ForceSendFields is a list of field names (e.g. "Etag") to
  6913. // unconditionally include in API requests. By default, fields with
  6914. // empty values are omitted from API requests. However, any non-pointer,
  6915. // non-interface field appearing in ForceSendFields will be sent to the
  6916. // server regardless of whether the field is empty or not. This may be
  6917. // used to include empty fields in Patch requests.
  6918. ForceSendFields []string `json:"-"`
  6919. // NullFields is a list of field names (e.g. "Etag") to include in API
  6920. // requests with the JSON null value. By default, fields with empty
  6921. // values are omitted from API requests. However, any field with an
  6922. // empty value appearing in NullFields will be sent to the server as
  6923. // null. It is an error if a field in this list has a non-empty value.
  6924. // This may be used to include null fields in Patch requests.
  6925. NullFields []string `json:"-"`
  6926. }
  6927. func (s *VideoCategory) MarshalJSON() ([]byte, error) {
  6928. type NoMethod VideoCategory
  6929. raw := NoMethod(*s)
  6930. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6931. }
  6932. type VideoCategoryListResponse struct {
  6933. // Etag: Etag of this resource.
  6934. Etag string `json:"etag,omitempty"`
  6935. // EventId: Serialized EventId of the request which produced this
  6936. // response.
  6937. EventId string `json:"eventId,omitempty"`
  6938. // Items: A list of video categories that can be associated with YouTube
  6939. // videos. In this map, the video category ID is the map key, and its
  6940. // value is the corresponding videoCategory resource.
  6941. Items []*VideoCategory `json:"items,omitempty"`
  6942. // Kind: Identifies what kind of resource this is. Value: the fixed
  6943. // string "youtube#videoCategoryListResponse".
  6944. Kind string `json:"kind,omitempty"`
  6945. // NextPageToken: The token that can be used as the value of the
  6946. // pageToken parameter to retrieve the next page in the result set.
  6947. NextPageToken string `json:"nextPageToken,omitempty"`
  6948. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  6949. // PrevPageToken: The token that can be used as the value of the
  6950. // pageToken parameter to retrieve the previous page in the result set.
  6951. PrevPageToken string `json:"prevPageToken,omitempty"`
  6952. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  6953. // VisitorId: The visitorId identifies the visitor.
  6954. VisitorId string `json:"visitorId,omitempty"`
  6955. // ServerResponse contains the HTTP response code and headers from the
  6956. // server.
  6957. googleapi.ServerResponse `json:"-"`
  6958. // ForceSendFields is a list of field names (e.g. "Etag") to
  6959. // unconditionally include in API requests. By default, fields with
  6960. // empty values are omitted from API requests. However, any non-pointer,
  6961. // non-interface field appearing in ForceSendFields will be sent to the
  6962. // server regardless of whether the field is empty or not. This may be
  6963. // used to include empty fields in Patch requests.
  6964. ForceSendFields []string `json:"-"`
  6965. // NullFields is a list of field names (e.g. "Etag") to include in API
  6966. // requests with the JSON null value. By default, fields with empty
  6967. // values are omitted from API requests. However, any field with an
  6968. // empty value appearing in NullFields will be sent to the server as
  6969. // null. It is an error if a field in this list has a non-empty value.
  6970. // This may be used to include null fields in Patch requests.
  6971. NullFields []string `json:"-"`
  6972. }
  6973. func (s *VideoCategoryListResponse) MarshalJSON() ([]byte, error) {
  6974. type NoMethod VideoCategoryListResponse
  6975. raw := NoMethod(*s)
  6976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6977. }
  6978. // VideoCategorySnippet: Basic details about a video category, such as
  6979. // its localized title.
  6980. type VideoCategorySnippet struct {
  6981. Assignable bool `json:"assignable,omitempty"`
  6982. // ChannelId: The YouTube channel that created the video category.
  6983. ChannelId string `json:"channelId,omitempty"`
  6984. // Title: The video category's title.
  6985. Title string `json:"title,omitempty"`
  6986. // ForceSendFields is a list of field names (e.g. "Assignable") to
  6987. // unconditionally include in API requests. By default, fields with
  6988. // empty values are omitted from API requests. However, any non-pointer,
  6989. // non-interface field appearing in ForceSendFields will be sent to the
  6990. // server regardless of whether the field is empty or not. This may be
  6991. // used to include empty fields in Patch requests.
  6992. ForceSendFields []string `json:"-"`
  6993. // NullFields is a list of field names (e.g. "Assignable") to include in
  6994. // API requests with the JSON null value. By default, fields with empty
  6995. // values are omitted from API requests. However, any field with an
  6996. // empty value appearing in NullFields will be sent to the server as
  6997. // null. It is an error if a field in this list has a non-empty value.
  6998. // This may be used to include null fields in Patch requests.
  6999. NullFields []string `json:"-"`
  7000. }
  7001. func (s *VideoCategorySnippet) MarshalJSON() ([]byte, error) {
  7002. type NoMethod VideoCategorySnippet
  7003. raw := NoMethod(*s)
  7004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7005. }
  7006. // VideoContentDetails: Details about the content of a YouTube Video.
  7007. type VideoContentDetails struct {
  7008. // Caption: The value of captions indicates whether the video has
  7009. // captions or not.
  7010. //
  7011. // Possible values:
  7012. // "false"
  7013. // "true"
  7014. Caption string `json:"caption,omitempty"`
  7015. // ContentRating: Specifies the ratings that the video received under
  7016. // various rating schemes.
  7017. ContentRating *ContentRating `json:"contentRating,omitempty"`
  7018. // CountryRestriction: The countryRestriction object contains
  7019. // information about the countries where a video is (or is not)
  7020. // viewable.
  7021. CountryRestriction *AccessPolicy `json:"countryRestriction,omitempty"`
  7022. // Definition: The value of definition indicates whether the video is
  7023. // available in high definition or only in standard definition.
  7024. //
  7025. // Possible values:
  7026. // "hd"
  7027. // "sd"
  7028. Definition string `json:"definition,omitempty"`
  7029. // Dimension: The value of dimension indicates whether the video is
  7030. // available in 3D or in 2D.
  7031. Dimension string `json:"dimension,omitempty"`
  7032. // Duration: The length of the video. The tag value is an ISO 8601
  7033. // duration in the format PT#M#S, in which the letters PT indicate that
  7034. // the value specifies a period of time, and the letters M and S refer
  7035. // to length in minutes and seconds, respectively. The # characters
  7036. // preceding the M and S letters are both integers that specify the
  7037. // number of minutes (or seconds) of the video. For example, a value of
  7038. // PT15M51S indicates that the video is 15 minutes and 51 seconds long.
  7039. Duration string `json:"duration,omitempty"`
  7040. // HasCustomThumbnail: Indicates whether the video uploader has provided
  7041. // a custom thumbnail image for the video. This property is only visible
  7042. // to the video uploader.
  7043. HasCustomThumbnail bool `json:"hasCustomThumbnail,omitempty"`
  7044. // LicensedContent: The value of is_license_content indicates whether
  7045. // the video is licensed content.
  7046. LicensedContent bool `json:"licensedContent,omitempty"`
  7047. // Projection: Specifies the projection format of the video.
  7048. //
  7049. // Possible values:
  7050. // "360"
  7051. // "rectangular"
  7052. Projection string `json:"projection,omitempty"`
  7053. // RegionRestriction: The regionRestriction object contains information
  7054. // about the countries where a video is (or is not) viewable. The object
  7055. // will contain either the contentDetails.regionRestriction.allowed
  7056. // property or the contentDetails.regionRestriction.blocked property.
  7057. RegionRestriction *VideoContentDetailsRegionRestriction `json:"regionRestriction,omitempty"`
  7058. // ForceSendFields is a list of field names (e.g. "Caption") to
  7059. // unconditionally include in API requests. By default, fields with
  7060. // empty values are omitted from API requests. However, any non-pointer,
  7061. // non-interface field appearing in ForceSendFields will be sent to the
  7062. // server regardless of whether the field is empty or not. This may be
  7063. // used to include empty fields in Patch requests.
  7064. ForceSendFields []string `json:"-"`
  7065. // NullFields is a list of field names (e.g. "Caption") to include in
  7066. // API requests with the JSON null value. By default, fields with empty
  7067. // values are omitted from API requests. However, any field with an
  7068. // empty value appearing in NullFields will be sent to the server as
  7069. // null. It is an error if a field in this list has a non-empty value.
  7070. // This may be used to include null fields in Patch requests.
  7071. NullFields []string `json:"-"`
  7072. }
  7073. func (s *VideoContentDetails) MarshalJSON() ([]byte, error) {
  7074. type NoMethod VideoContentDetails
  7075. raw := NoMethod(*s)
  7076. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7077. }
  7078. // VideoContentDetailsRegionRestriction: DEPRECATED Region restriction
  7079. // of the video.
  7080. type VideoContentDetailsRegionRestriction struct {
  7081. // Allowed: A list of region codes that identify countries where the
  7082. // video is viewable. If this property is present and a country is not
  7083. // listed in its value, then the video is blocked from appearing in that
  7084. // country. If this property is present and contains an empty list, the
  7085. // video is blocked in all countries.
  7086. Allowed []string `json:"allowed,omitempty"`
  7087. // Blocked: A list of region codes that identify countries where the
  7088. // video is blocked. If this property is present and a country is not
  7089. // listed in its value, then the video is viewable in that country. If
  7090. // this property is present and contains an empty list, the video is
  7091. // viewable in all countries.
  7092. Blocked []string `json:"blocked,omitempty"`
  7093. // ForceSendFields is a list of field names (e.g. "Allowed") to
  7094. // unconditionally include in API requests. By default, fields with
  7095. // empty values are omitted from API requests. However, any non-pointer,
  7096. // non-interface field appearing in ForceSendFields will be sent to the
  7097. // server regardless of whether the field is empty or not. This may be
  7098. // used to include empty fields in Patch requests.
  7099. ForceSendFields []string `json:"-"`
  7100. // NullFields is a list of field names (e.g. "Allowed") to include in
  7101. // API requests with the JSON null value. By default, fields with empty
  7102. // values are omitted from API requests. However, any field with an
  7103. // empty value appearing in NullFields will be sent to the server as
  7104. // null. It is an error if a field in this list has a non-empty value.
  7105. // This may be used to include null fields in Patch requests.
  7106. NullFields []string `json:"-"`
  7107. }
  7108. func (s *VideoContentDetailsRegionRestriction) MarshalJSON() ([]byte, error) {
  7109. type NoMethod VideoContentDetailsRegionRestriction
  7110. raw := NoMethod(*s)
  7111. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7112. }
  7113. // VideoFileDetails: Describes original video file properties, including
  7114. // technical details about audio and video streams, but also metadata
  7115. // information like content length, digitization time, or geotagging
  7116. // information.
  7117. type VideoFileDetails struct {
  7118. // AudioStreams: A list of audio streams contained in the uploaded video
  7119. // file. Each item in the list contains detailed metadata about an audio
  7120. // stream.
  7121. AudioStreams []*VideoFileDetailsAudioStream `json:"audioStreams,omitempty"`
  7122. // BitrateBps: The uploaded video file's combined (video and audio)
  7123. // bitrate in bits per second.
  7124. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  7125. // Container: The uploaded video file's container format.
  7126. Container string `json:"container,omitempty"`
  7127. // CreationTime: The date and time when the uploaded video file was
  7128. // created. The value is specified in ISO 8601 format. Currently, the
  7129. // following ISO 8601 formats are supported:
  7130. // - Date only: YYYY-MM-DD
  7131. // - Naive time: YYYY-MM-DDTHH:MM:SS
  7132. // - Time with timezone: YYYY-MM-DDTHH:MM:SS+HH:MM
  7133. CreationTime string `json:"creationTime,omitempty"`
  7134. // DurationMs: The length of the uploaded video in milliseconds.
  7135. DurationMs uint64 `json:"durationMs,omitempty,string"`
  7136. // FileName: The uploaded file's name. This field is present whether a
  7137. // video file or another type of file was uploaded.
  7138. FileName string `json:"fileName,omitempty"`
  7139. // FileSize: The uploaded file's size in bytes. This field is present
  7140. // whether a video file or another type of file was uploaded.
  7141. FileSize uint64 `json:"fileSize,omitempty,string"`
  7142. // FileType: The uploaded file's type as detected by YouTube's video
  7143. // processing engine. Currently, YouTube only processes video files, but
  7144. // this field is present whether a video file or another type of file
  7145. // was uploaded.
  7146. //
  7147. // Possible values:
  7148. // "archive"
  7149. // "audio"
  7150. // "document"
  7151. // "image"
  7152. // "other"
  7153. // "project"
  7154. // "video"
  7155. FileType string `json:"fileType,omitempty"`
  7156. // VideoStreams: A list of video streams contained in the uploaded video
  7157. // file. Each item in the list contains detailed metadata about a video
  7158. // stream.
  7159. VideoStreams []*VideoFileDetailsVideoStream `json:"videoStreams,omitempty"`
  7160. // ForceSendFields is a list of field names (e.g. "AudioStreams") to
  7161. // unconditionally include in API requests. By default, fields with
  7162. // empty values are omitted from API requests. However, any non-pointer,
  7163. // non-interface field appearing in ForceSendFields will be sent to the
  7164. // server regardless of whether the field is empty or not. This may be
  7165. // used to include empty fields in Patch requests.
  7166. ForceSendFields []string `json:"-"`
  7167. // NullFields is a list of field names (e.g. "AudioStreams") to include
  7168. // in API requests with the JSON null value. By default, fields with
  7169. // empty values are omitted from API requests. However, any field with
  7170. // an empty value appearing in NullFields will be sent to the server as
  7171. // null. It is an error if a field in this list has a non-empty value.
  7172. // This may be used to include null fields in Patch requests.
  7173. NullFields []string `json:"-"`
  7174. }
  7175. func (s *VideoFileDetails) MarshalJSON() ([]byte, error) {
  7176. type NoMethod VideoFileDetails
  7177. raw := NoMethod(*s)
  7178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7179. }
  7180. // VideoFileDetailsAudioStream: Information about an audio stream.
  7181. type VideoFileDetailsAudioStream struct {
  7182. // BitrateBps: The audio stream's bitrate, in bits per second.
  7183. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  7184. // ChannelCount: The number of audio channels that the stream contains.
  7185. ChannelCount int64 `json:"channelCount,omitempty"`
  7186. // Codec: The audio codec that the stream uses.
  7187. Codec string `json:"codec,omitempty"`
  7188. // Vendor: A value that uniquely identifies a video vendor. Typically,
  7189. // the value is a four-letter vendor code.
  7190. Vendor string `json:"vendor,omitempty"`
  7191. // ForceSendFields is a list of field names (e.g. "BitrateBps") to
  7192. // unconditionally include in API requests. By default, fields with
  7193. // empty values are omitted from API requests. However, any non-pointer,
  7194. // non-interface field appearing in ForceSendFields will be sent to the
  7195. // server regardless of whether the field is empty or not. This may be
  7196. // used to include empty fields in Patch requests.
  7197. ForceSendFields []string `json:"-"`
  7198. // NullFields is a list of field names (e.g. "BitrateBps") to include in
  7199. // API requests with the JSON null value. By default, fields with empty
  7200. // values are omitted from API requests. However, any field with an
  7201. // empty value appearing in NullFields will be sent to the server as
  7202. // null. It is an error if a field in this list has a non-empty value.
  7203. // This may be used to include null fields in Patch requests.
  7204. NullFields []string `json:"-"`
  7205. }
  7206. func (s *VideoFileDetailsAudioStream) MarshalJSON() ([]byte, error) {
  7207. type NoMethod VideoFileDetailsAudioStream
  7208. raw := NoMethod(*s)
  7209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7210. }
  7211. // VideoFileDetailsVideoStream: Information about a video stream.
  7212. type VideoFileDetailsVideoStream struct {
  7213. // AspectRatio: The video content's display aspect ratio, which
  7214. // specifies the aspect ratio in which the video should be displayed.
  7215. AspectRatio float64 `json:"aspectRatio,omitempty"`
  7216. // BitrateBps: The video stream's bitrate, in bits per second.
  7217. BitrateBps uint64 `json:"bitrateBps,omitempty,string"`
  7218. // Codec: The video codec that the stream uses.
  7219. Codec string `json:"codec,omitempty"`
  7220. // FrameRateFps: The video stream's frame rate, in frames per second.
  7221. FrameRateFps float64 `json:"frameRateFps,omitempty"`
  7222. // HeightPixels: The encoded video content's height in pixels.
  7223. HeightPixels int64 `json:"heightPixels,omitempty"`
  7224. // Rotation: The amount that YouTube needs to rotate the original source
  7225. // content to properly display the video.
  7226. //
  7227. // Possible values:
  7228. // "clockwise"
  7229. // "counterClockwise"
  7230. // "none"
  7231. // "other"
  7232. // "upsideDown"
  7233. Rotation string `json:"rotation,omitempty"`
  7234. // Vendor: A value that uniquely identifies a video vendor. Typically,
  7235. // the value is a four-letter vendor code.
  7236. Vendor string `json:"vendor,omitempty"`
  7237. // WidthPixels: The encoded video content's width in pixels. You can
  7238. // calculate the video's encoding aspect ratio as
  7239. // width_pixels / height_pixels.
  7240. WidthPixels int64 `json:"widthPixels,omitempty"`
  7241. // ForceSendFields is a list of field names (e.g. "AspectRatio") to
  7242. // unconditionally include in API requests. By default, fields with
  7243. // empty values are omitted from API requests. However, any non-pointer,
  7244. // non-interface field appearing in ForceSendFields will be sent to the
  7245. // server regardless of whether the field is empty or not. This may be
  7246. // used to include empty fields in Patch requests.
  7247. ForceSendFields []string `json:"-"`
  7248. // NullFields is a list of field names (e.g. "AspectRatio") to include
  7249. // in API requests with the JSON null value. By default, fields with
  7250. // empty values are omitted from API requests. However, any field with
  7251. // an empty value appearing in NullFields will be sent to the server as
  7252. // null. It is an error if a field in this list has a non-empty value.
  7253. // This may be used to include null fields in Patch requests.
  7254. NullFields []string `json:"-"`
  7255. }
  7256. func (s *VideoFileDetailsVideoStream) MarshalJSON() ([]byte, error) {
  7257. type NoMethod VideoFileDetailsVideoStream
  7258. raw := NoMethod(*s)
  7259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7260. }
  7261. func (s *VideoFileDetailsVideoStream) UnmarshalJSON(data []byte) error {
  7262. type NoMethod VideoFileDetailsVideoStream
  7263. var s1 struct {
  7264. AspectRatio gensupport.JSONFloat64 `json:"aspectRatio"`
  7265. FrameRateFps gensupport.JSONFloat64 `json:"frameRateFps"`
  7266. *NoMethod
  7267. }
  7268. s1.NoMethod = (*NoMethod)(s)
  7269. if err := json.Unmarshal(data, &s1); err != nil {
  7270. return err
  7271. }
  7272. s.AspectRatio = float64(s1.AspectRatio)
  7273. s.FrameRateFps = float64(s1.FrameRateFps)
  7274. return nil
  7275. }
  7276. type VideoGetRatingResponse struct {
  7277. // Etag: Etag of this resource.
  7278. Etag string `json:"etag,omitempty"`
  7279. // EventId: Serialized EventId of the request which produced this
  7280. // response.
  7281. EventId string `json:"eventId,omitempty"`
  7282. // Items: A list of ratings that match the request criteria.
  7283. Items []*VideoRating `json:"items,omitempty"`
  7284. // Kind: Identifies what kind of resource this is. Value: the fixed
  7285. // string "youtube#videoGetRatingResponse".
  7286. Kind string `json:"kind,omitempty"`
  7287. // VisitorId: The visitorId identifies the visitor.
  7288. VisitorId string `json:"visitorId,omitempty"`
  7289. // ServerResponse contains the HTTP response code and headers from the
  7290. // server.
  7291. googleapi.ServerResponse `json:"-"`
  7292. // ForceSendFields is a list of field names (e.g. "Etag") to
  7293. // unconditionally include in API requests. By default, fields with
  7294. // empty values are omitted from API requests. However, any non-pointer,
  7295. // non-interface field appearing in ForceSendFields will be sent to the
  7296. // server regardless of whether the field is empty or not. This may be
  7297. // used to include empty fields in Patch requests.
  7298. ForceSendFields []string `json:"-"`
  7299. // NullFields is a list of field names (e.g. "Etag") to include in API
  7300. // requests with the JSON null value. By default, fields with empty
  7301. // values are omitted from API requests. However, any field with an
  7302. // empty value appearing in NullFields will be sent to the server as
  7303. // null. It is an error if a field in this list has a non-empty value.
  7304. // This may be used to include null fields in Patch requests.
  7305. NullFields []string `json:"-"`
  7306. }
  7307. func (s *VideoGetRatingResponse) MarshalJSON() ([]byte, error) {
  7308. type NoMethod VideoGetRatingResponse
  7309. raw := NoMethod(*s)
  7310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7311. }
  7312. type VideoListResponse struct {
  7313. // Etag: Etag of this resource.
  7314. Etag string `json:"etag,omitempty"`
  7315. // EventId: Serialized EventId of the request which produced this
  7316. // response.
  7317. EventId string `json:"eventId,omitempty"`
  7318. // Items: A list of videos that match the request criteria.
  7319. Items []*Video `json:"items,omitempty"`
  7320. // Kind: Identifies what kind of resource this is. Value: the fixed
  7321. // string "youtube#videoListResponse".
  7322. Kind string `json:"kind,omitempty"`
  7323. // NextPageToken: The token that can be used as the value of the
  7324. // pageToken parameter to retrieve the next page in the result set.
  7325. NextPageToken string `json:"nextPageToken,omitempty"`
  7326. PageInfo *PageInfo `json:"pageInfo,omitempty"`
  7327. // PrevPageToken: The token that can be used as the value of the
  7328. // pageToken parameter to retrieve the previous page in the result set.
  7329. PrevPageToken string `json:"prevPageToken,omitempty"`
  7330. TokenPagination *TokenPagination `json:"tokenPagination,omitempty"`
  7331. // VisitorId: The visitorId identifies the visitor.
  7332. VisitorId string `json:"visitorId,omitempty"`
  7333. // ServerResponse contains the HTTP response code and headers from the
  7334. // server.
  7335. googleapi.ServerResponse `json:"-"`
  7336. // ForceSendFields is a list of field names (e.g. "Etag") to
  7337. // unconditionally include in API requests. By default, fields with
  7338. // empty values are omitted from API requests. However, any non-pointer,
  7339. // non-interface field appearing in ForceSendFields will be sent to the
  7340. // server regardless of whether the field is empty or not. This may be
  7341. // used to include empty fields in Patch requests.
  7342. ForceSendFields []string `json:"-"`
  7343. // NullFields is a list of field names (e.g. "Etag") to include in API
  7344. // requests with the JSON null value. By default, fields with empty
  7345. // values are omitted from API requests. However, any field with an
  7346. // empty value appearing in NullFields will be sent to the server as
  7347. // null. It is an error if a field in this list has a non-empty value.
  7348. // This may be used to include null fields in Patch requests.
  7349. NullFields []string `json:"-"`
  7350. }
  7351. func (s *VideoListResponse) MarshalJSON() ([]byte, error) {
  7352. type NoMethod VideoListResponse
  7353. raw := NoMethod(*s)
  7354. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7355. }
  7356. // VideoLiveStreamingDetails: Details about the live streaming metadata.
  7357. type VideoLiveStreamingDetails struct {
  7358. // ActiveLiveChatId: The ID of the currently active live chat attached
  7359. // to this video. This field is filled only if the video is a currently
  7360. // live broadcast that has live chat. Once the broadcast transitions to
  7361. // complete this field will be removed and the live chat closed down.
  7362. // For persistent broadcasts that live chat id will no longer be tied to
  7363. // this video but rather to the new video being displayed at the
  7364. // persistent page.
  7365. ActiveLiveChatId string `json:"activeLiveChatId,omitempty"`
  7366. // ActualEndTime: The time that the broadcast actually ended. The value
  7367. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This value
  7368. // will not be available until the broadcast is over.
  7369. ActualEndTime string `json:"actualEndTime,omitempty"`
  7370. // ActualStartTime: The time that the broadcast actually started. The
  7371. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. This
  7372. // value will not be available until the broadcast begins.
  7373. ActualStartTime string `json:"actualStartTime,omitempty"`
  7374. // ConcurrentViewers: The number of viewers currently watching the
  7375. // broadcast. The property and its value will be present if the
  7376. // broadcast has current viewers and the broadcast owner has not hidden
  7377. // the viewcount for the video. Note that YouTube stops tracking the
  7378. // number of concurrent viewers for a broadcast when the broadcast ends.
  7379. // So, this property would not identify the number of viewers watching
  7380. // an archived video of a live broadcast that already ended.
  7381. ConcurrentViewers uint64 `json:"concurrentViewers,omitempty,string"`
  7382. // ScheduledEndTime: The time that the broadcast is scheduled to end.
  7383. // The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  7384. // If the value is empty or the property is not present, then the
  7385. // broadcast is scheduled to continue indefinitely.
  7386. ScheduledEndTime string `json:"scheduledEndTime,omitempty"`
  7387. // ScheduledStartTime: The time that the broadcast is scheduled to
  7388. // begin. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ)
  7389. // format.
  7390. ScheduledStartTime string `json:"scheduledStartTime,omitempty"`
  7391. // ForceSendFields is a list of field names (e.g. "ActiveLiveChatId") to
  7392. // unconditionally include in API requests. By default, fields with
  7393. // empty values are omitted from API requests. However, any non-pointer,
  7394. // non-interface field appearing in ForceSendFields will be sent to the
  7395. // server regardless of whether the field is empty or not. This may be
  7396. // used to include empty fields in Patch requests.
  7397. ForceSendFields []string `json:"-"`
  7398. // NullFields is a list of field names (e.g. "ActiveLiveChatId") to
  7399. // include in API requests with the JSON null value. By default, fields
  7400. // with empty values are omitted from API requests. However, any field
  7401. // with an empty value appearing in NullFields will be sent to the
  7402. // server as null. It is an error if a field in this list has a
  7403. // non-empty value. This may be used to include null fields in Patch
  7404. // requests.
  7405. NullFields []string `json:"-"`
  7406. }
  7407. func (s *VideoLiveStreamingDetails) MarshalJSON() ([]byte, error) {
  7408. type NoMethod VideoLiveStreamingDetails
  7409. raw := NoMethod(*s)
  7410. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7411. }
  7412. // VideoLocalization: Localized versions of certain video properties
  7413. // (e.g. title).
  7414. type VideoLocalization struct {
  7415. // Description: Localized version of the video's description.
  7416. Description string `json:"description,omitempty"`
  7417. // Title: Localized version of the video's title.
  7418. Title string `json:"title,omitempty"`
  7419. // ForceSendFields is a list of field names (e.g. "Description") to
  7420. // unconditionally include in API requests. By default, fields with
  7421. // empty values are omitted from API requests. However, any non-pointer,
  7422. // non-interface field appearing in ForceSendFields will be sent to the
  7423. // server regardless of whether the field is empty or not. This may be
  7424. // used to include empty fields in Patch requests.
  7425. ForceSendFields []string `json:"-"`
  7426. // NullFields is a list of field names (e.g. "Description") to include
  7427. // in API requests with the JSON null value. By default, fields with
  7428. // empty values are omitted from API requests. However, any field with
  7429. // an empty value appearing in NullFields will be sent to the server as
  7430. // null. It is an error if a field in this list has a non-empty value.
  7431. // This may be used to include null fields in Patch requests.
  7432. NullFields []string `json:"-"`
  7433. }
  7434. func (s *VideoLocalization) MarshalJSON() ([]byte, error) {
  7435. type NoMethod VideoLocalization
  7436. raw := NoMethod(*s)
  7437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7438. }
  7439. // VideoMonetizationDetails: Details about monetization of a YouTube
  7440. // Video.
  7441. type VideoMonetizationDetails struct {
  7442. // Access: The value of access indicates whether the video can be
  7443. // monetized or not.
  7444. Access *AccessPolicy `json:"access,omitempty"`
  7445. // ForceSendFields is a list of field names (e.g. "Access") to
  7446. // unconditionally include in API requests. By default, fields with
  7447. // empty values are omitted from API requests. However, any non-pointer,
  7448. // non-interface field appearing in ForceSendFields will be sent to the
  7449. // server regardless of whether the field is empty or not. This may be
  7450. // used to include empty fields in Patch requests.
  7451. ForceSendFields []string `json:"-"`
  7452. // NullFields is a list of field names (e.g. "Access") to include in API
  7453. // requests with the JSON null value. By default, fields with empty
  7454. // values are omitted from API requests. However, any field with an
  7455. // empty value appearing in NullFields will be sent to the server as
  7456. // null. It is an error if a field in this list has a non-empty value.
  7457. // This may be used to include null fields in Patch requests.
  7458. NullFields []string `json:"-"`
  7459. }
  7460. func (s *VideoMonetizationDetails) MarshalJSON() ([]byte, error) {
  7461. type NoMethod VideoMonetizationDetails
  7462. raw := NoMethod(*s)
  7463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7464. }
  7465. // VideoPlayer: Player to be used for a video playback.
  7466. type VideoPlayer struct {
  7467. EmbedHeight int64 `json:"embedHeight,omitempty,string"`
  7468. // EmbedHtml: An <iframe> tag that embeds a player that will play the
  7469. // video.
  7470. EmbedHtml string `json:"embedHtml,omitempty"`
  7471. // EmbedWidth: The embed width
  7472. EmbedWidth int64 `json:"embedWidth,omitempty,string"`
  7473. // ForceSendFields is a list of field names (e.g. "EmbedHeight") to
  7474. // unconditionally include in API requests. By default, fields with
  7475. // empty values are omitted from API requests. However, any non-pointer,
  7476. // non-interface field appearing in ForceSendFields will be sent to the
  7477. // server regardless of whether the field is empty or not. This may be
  7478. // used to include empty fields in Patch requests.
  7479. ForceSendFields []string `json:"-"`
  7480. // NullFields is a list of field names (e.g. "EmbedHeight") to include
  7481. // in API requests with the JSON null value. By default, fields with
  7482. // empty values are omitted from API requests. However, any field with
  7483. // an empty value appearing in NullFields will be sent to the server as
  7484. // null. It is an error if a field in this list has a non-empty value.
  7485. // This may be used to include null fields in Patch requests.
  7486. NullFields []string `json:"-"`
  7487. }
  7488. func (s *VideoPlayer) MarshalJSON() ([]byte, error) {
  7489. type NoMethod VideoPlayer
  7490. raw := NoMethod(*s)
  7491. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7492. }
  7493. // VideoProcessingDetails: Describes processing status and progress and
  7494. // availability of some other Video resource parts.
  7495. type VideoProcessingDetails struct {
  7496. // EditorSuggestionsAvailability: This value indicates whether video
  7497. // editing suggestions, which might improve video quality or the
  7498. // playback experience, are available for the video. You can retrieve
  7499. // these suggestions by requesting the suggestions part in your
  7500. // videos.list() request.
  7501. EditorSuggestionsAvailability string `json:"editorSuggestionsAvailability,omitempty"`
  7502. // FileDetailsAvailability: This value indicates whether file details
  7503. // are available for the uploaded video. You can retrieve a video's file
  7504. // details by requesting the fileDetails part in your videos.list()
  7505. // request.
  7506. FileDetailsAvailability string `json:"fileDetailsAvailability,omitempty"`
  7507. // ProcessingFailureReason: The reason that YouTube failed to process
  7508. // the video. This property will only have a value if the
  7509. // processingStatus property's value is failed.
  7510. //
  7511. // Possible values:
  7512. // "other"
  7513. // "streamingFailed"
  7514. // "transcodeFailed"
  7515. // "uploadFailed"
  7516. ProcessingFailureReason string `json:"processingFailureReason,omitempty"`
  7517. // ProcessingIssuesAvailability: This value indicates whether the video
  7518. // processing engine has generated suggestions that might improve
  7519. // YouTube's ability to process the the video, warnings that explain
  7520. // video processing problems, or errors that cause video processing
  7521. // problems. You can retrieve these suggestions by requesting the
  7522. // suggestions part in your videos.list() request.
  7523. ProcessingIssuesAvailability string `json:"processingIssuesAvailability,omitempty"`
  7524. // ProcessingProgress: The processingProgress object contains
  7525. // information about the progress YouTube has made in processing the
  7526. // video. The values are really only relevant if the video's processing
  7527. // status is processing.
  7528. ProcessingProgress *VideoProcessingDetailsProcessingProgress `json:"processingProgress,omitempty"`
  7529. // ProcessingStatus: The video's processing status. This value indicates
  7530. // whether YouTube was able to process the video or if the video is
  7531. // still being processed.
  7532. //
  7533. // Possible values:
  7534. // "failed"
  7535. // "processing"
  7536. // "succeeded"
  7537. // "terminated"
  7538. ProcessingStatus string `json:"processingStatus,omitempty"`
  7539. // TagSuggestionsAvailability: This value indicates whether keyword
  7540. // (tag) suggestions are available for the video. Tags can be added to a
  7541. // video's metadata to make it easier for other users to find the video.
  7542. // You can retrieve these suggestions by requesting the suggestions part
  7543. // in your videos.list() request.
  7544. TagSuggestionsAvailability string `json:"tagSuggestionsAvailability,omitempty"`
  7545. // ThumbnailsAvailability: This value indicates whether thumbnail images
  7546. // have been generated for the video.
  7547. ThumbnailsAvailability string `json:"thumbnailsAvailability,omitempty"`
  7548. // ForceSendFields is a list of field names (e.g.
  7549. // "EditorSuggestionsAvailability") to unconditionally include in API
  7550. // requests. By default, fields with empty values are omitted from API
  7551. // requests. However, any non-pointer, non-interface field appearing in
  7552. // ForceSendFields will be sent to the server regardless of whether the
  7553. // field is empty or not. This may be used to include empty fields in
  7554. // Patch requests.
  7555. ForceSendFields []string `json:"-"`
  7556. // NullFields is a list of field names (e.g.
  7557. // "EditorSuggestionsAvailability") to include in API requests with the
  7558. // JSON null value. By default, fields with empty values are omitted
  7559. // from API requests. However, any field with an empty value appearing
  7560. // in NullFields will be sent to the server as null. It is an error if a
  7561. // field in this list has a non-empty value. This may be used to include
  7562. // null fields in Patch requests.
  7563. NullFields []string `json:"-"`
  7564. }
  7565. func (s *VideoProcessingDetails) MarshalJSON() ([]byte, error) {
  7566. type NoMethod VideoProcessingDetails
  7567. raw := NoMethod(*s)
  7568. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7569. }
  7570. // VideoProcessingDetailsProcessingProgress: Video processing progress
  7571. // and completion time estimate.
  7572. type VideoProcessingDetailsProcessingProgress struct {
  7573. // PartsProcessed: The number of parts of the video that YouTube has
  7574. // already processed. You can estimate the percentage of the video that
  7575. // YouTube has already processed by calculating:
  7576. // 100 * parts_processed / parts_total
  7577. //
  7578. // Note that since the estimated number of parts could increase without
  7579. // a corresponding increase in the number of parts that have already
  7580. // been processed, it is possible that the calculated progress could
  7581. // periodically decrease while YouTube processes a video.
  7582. PartsProcessed uint64 `json:"partsProcessed,omitempty,string"`
  7583. // PartsTotal: An estimate of the total number of parts that need to be
  7584. // processed for the video. The number may be updated with more precise
  7585. // estimates while YouTube processes the video.
  7586. PartsTotal uint64 `json:"partsTotal,omitempty,string"`
  7587. // TimeLeftMs: An estimate of the amount of time, in millseconds, that
  7588. // YouTube needs to finish processing the video.
  7589. TimeLeftMs uint64 `json:"timeLeftMs,omitempty,string"`
  7590. // ForceSendFields is a list of field names (e.g. "PartsProcessed") to
  7591. // unconditionally include in API requests. By default, fields with
  7592. // empty values are omitted from API requests. However, any non-pointer,
  7593. // non-interface field appearing in ForceSendFields will be sent to the
  7594. // server regardless of whether the field is empty or not. This may be
  7595. // used to include empty fields in Patch requests.
  7596. ForceSendFields []string `json:"-"`
  7597. // NullFields is a list of field names (e.g. "PartsProcessed") to
  7598. // include in API requests with the JSON null value. By default, fields
  7599. // with empty values are omitted from API requests. However, any field
  7600. // with an empty value appearing in NullFields will be sent to the
  7601. // server as null. It is an error if a field in this list has a
  7602. // non-empty value. This may be used to include null fields in Patch
  7603. // requests.
  7604. NullFields []string `json:"-"`
  7605. }
  7606. func (s *VideoProcessingDetailsProcessingProgress) MarshalJSON() ([]byte, error) {
  7607. type NoMethod VideoProcessingDetailsProcessingProgress
  7608. raw := NoMethod(*s)
  7609. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7610. }
  7611. // VideoProjectDetails: Project specific details about the content of a
  7612. // YouTube Video.
  7613. type VideoProjectDetails struct {
  7614. // Tags: A list of project tags associated with the video during the
  7615. // upload.
  7616. Tags []string `json:"tags,omitempty"`
  7617. // ForceSendFields is a list of field names (e.g. "Tags") to
  7618. // unconditionally include in API requests. By default, fields with
  7619. // empty values are omitted from API requests. However, any non-pointer,
  7620. // non-interface field appearing in ForceSendFields will be sent to the
  7621. // server regardless of whether the field is empty or not. This may be
  7622. // used to include empty fields in Patch requests.
  7623. ForceSendFields []string `json:"-"`
  7624. // NullFields is a list of field names (e.g. "Tags") to include in API
  7625. // requests with the JSON null value. By default, fields with empty
  7626. // values are omitted from API requests. However, any field with an
  7627. // empty value appearing in NullFields will be sent to the server as
  7628. // null. It is an error if a field in this list has a non-empty value.
  7629. // This may be used to include null fields in Patch requests.
  7630. NullFields []string `json:"-"`
  7631. }
  7632. func (s *VideoProjectDetails) MarshalJSON() ([]byte, error) {
  7633. type NoMethod VideoProjectDetails
  7634. raw := NoMethod(*s)
  7635. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7636. }
  7637. type VideoRating struct {
  7638. // Possible values:
  7639. // "dislike"
  7640. // "like"
  7641. // "none"
  7642. // "unspecified"
  7643. Rating string `json:"rating,omitempty"`
  7644. VideoId string `json:"videoId,omitempty"`
  7645. // ForceSendFields is a list of field names (e.g. "Rating") to
  7646. // unconditionally include in API requests. By default, fields with
  7647. // empty values are omitted from API requests. However, any non-pointer,
  7648. // non-interface field appearing in ForceSendFields will be sent to the
  7649. // server regardless of whether the field is empty or not. This may be
  7650. // used to include empty fields in Patch requests.
  7651. ForceSendFields []string `json:"-"`
  7652. // NullFields is a list of field names (e.g. "Rating") to include in API
  7653. // requests with the JSON null value. By default, fields with empty
  7654. // values are omitted from API requests. However, any field with an
  7655. // empty value appearing in NullFields will be sent to the server as
  7656. // null. It is an error if a field in this list has a non-empty value.
  7657. // This may be used to include null fields in Patch requests.
  7658. NullFields []string `json:"-"`
  7659. }
  7660. func (s *VideoRating) MarshalJSON() ([]byte, error) {
  7661. type NoMethod VideoRating
  7662. raw := NoMethod(*s)
  7663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7664. }
  7665. // VideoRecordingDetails: Recording information associated with the
  7666. // video.
  7667. type VideoRecordingDetails struct {
  7668. // Location: The geolocation information associated with the video.
  7669. Location *GeoPoint `json:"location,omitempty"`
  7670. // LocationDescription: The text description of the location where the
  7671. // video was recorded.
  7672. LocationDescription string `json:"locationDescription,omitempty"`
  7673. // RecordingDate: The date and time when the video was recorded. The
  7674. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sssZ) format.
  7675. RecordingDate string `json:"recordingDate,omitempty"`
  7676. // ForceSendFields is a list of field names (e.g. "Location") to
  7677. // unconditionally include in API requests. By default, fields with
  7678. // empty values are omitted from API requests. However, any non-pointer,
  7679. // non-interface field appearing in ForceSendFields will be sent to the
  7680. // server regardless of whether the field is empty or not. This may be
  7681. // used to include empty fields in Patch requests.
  7682. ForceSendFields []string `json:"-"`
  7683. // NullFields is a list of field names (e.g. "Location") to include in
  7684. // API requests with the JSON null value. By default, fields with empty
  7685. // values are omitted from API requests. However, any field with an
  7686. // empty value appearing in NullFields will be sent to the server as
  7687. // null. It is an error if a field in this list has a non-empty value.
  7688. // This may be used to include null fields in Patch requests.
  7689. NullFields []string `json:"-"`
  7690. }
  7691. func (s *VideoRecordingDetails) MarshalJSON() ([]byte, error) {
  7692. type NoMethod VideoRecordingDetails
  7693. raw := NoMethod(*s)
  7694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7695. }
  7696. // VideoSnippet: Basic details about a video, including title,
  7697. // description, uploader, thumbnails and category.
  7698. type VideoSnippet struct {
  7699. // CategoryId: The YouTube video category associated with the video.
  7700. CategoryId string `json:"categoryId,omitempty"`
  7701. // ChannelId: The ID that YouTube uses to uniquely identify the channel
  7702. // that the video was uploaded to.
  7703. ChannelId string `json:"channelId,omitempty"`
  7704. // ChannelTitle: Channel title for the channel that the video belongs
  7705. // to.
  7706. ChannelTitle string `json:"channelTitle,omitempty"`
  7707. // DefaultAudioLanguage: The default_audio_language property specifies
  7708. // the language spoken in the video's default audio track.
  7709. DefaultAudioLanguage string `json:"defaultAudioLanguage,omitempty"`
  7710. // DefaultLanguage: The language of the videos's default snippet.
  7711. DefaultLanguage string `json:"defaultLanguage,omitempty"`
  7712. // Description: The video's description.
  7713. Description string `json:"description,omitempty"`
  7714. // LiveBroadcastContent: Indicates if the video is an upcoming/active
  7715. // live broadcast. Or it's "none" if the video is not an upcoming/active
  7716. // live broadcast.
  7717. //
  7718. // Possible values:
  7719. // "live"
  7720. // "none"
  7721. // "upcoming"
  7722. LiveBroadcastContent string `json:"liveBroadcastContent,omitempty"`
  7723. // Localized: Localized snippet selected with the hl parameter. If no
  7724. // such localization exists, this field is populated with the default
  7725. // snippet. (Read-only)
  7726. Localized *VideoLocalization `json:"localized,omitempty"`
  7727. // PublishedAt: The date and time that the video was uploaded. The value
  7728. // is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  7729. PublishedAt string `json:"publishedAt,omitempty"`
  7730. // Tags: A list of keyword tags associated with the video. Tags may
  7731. // contain spaces.
  7732. Tags []string `json:"tags,omitempty"`
  7733. // Thumbnails: A map of thumbnail images associated with the video. For
  7734. // each object in the map, the key is the name of the thumbnail image,
  7735. // and the value is an object that contains other information about the
  7736. // thumbnail.
  7737. Thumbnails *ThumbnailDetails `json:"thumbnails,omitempty"`
  7738. // Title: The video's title.
  7739. Title string `json:"title,omitempty"`
  7740. // ForceSendFields is a list of field names (e.g. "CategoryId") to
  7741. // unconditionally include in API requests. By default, fields with
  7742. // empty values are omitted from API requests. However, any non-pointer,
  7743. // non-interface field appearing in ForceSendFields will be sent to the
  7744. // server regardless of whether the field is empty or not. This may be
  7745. // used to include empty fields in Patch requests.
  7746. ForceSendFields []string `json:"-"`
  7747. // NullFields is a list of field names (e.g. "CategoryId") to include in
  7748. // API requests with the JSON null value. By default, fields with empty
  7749. // values are omitted from API requests. However, any field with an
  7750. // empty value appearing in NullFields will be sent to the server as
  7751. // null. It is an error if a field in this list has a non-empty value.
  7752. // This may be used to include null fields in Patch requests.
  7753. NullFields []string `json:"-"`
  7754. }
  7755. func (s *VideoSnippet) MarshalJSON() ([]byte, error) {
  7756. type NoMethod VideoSnippet
  7757. raw := NoMethod(*s)
  7758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7759. }
  7760. // VideoStatistics: Statistics about the video, such as the number of
  7761. // times the video was viewed or liked.
  7762. type VideoStatistics struct {
  7763. // CommentCount: The number of comments for the video.
  7764. CommentCount uint64 `json:"commentCount,omitempty,string"`
  7765. // DislikeCount: The number of users who have indicated that they
  7766. // disliked the video by giving it a negative rating.
  7767. DislikeCount uint64 `json:"dislikeCount,omitempty,string"`
  7768. // FavoriteCount: The number of users who currently have the video
  7769. // marked as a favorite video.
  7770. FavoriteCount uint64 `json:"favoriteCount,omitempty,string"`
  7771. // LikeCount: The number of users who have indicated that they liked the
  7772. // video by giving it a positive rating.
  7773. LikeCount uint64 `json:"likeCount,omitempty,string"`
  7774. // ViewCount: The number of times the video has been viewed.
  7775. ViewCount uint64 `json:"viewCount,omitempty,string"`
  7776. // ForceSendFields is a list of field names (e.g. "CommentCount") to
  7777. // unconditionally include in API requests. By default, fields with
  7778. // empty values are omitted from API requests. However, any non-pointer,
  7779. // non-interface field appearing in ForceSendFields will be sent to the
  7780. // server regardless of whether the field is empty or not. This may be
  7781. // used to include empty fields in Patch requests.
  7782. ForceSendFields []string `json:"-"`
  7783. // NullFields is a list of field names (e.g. "CommentCount") to include
  7784. // in API requests with the JSON null value. By default, fields with
  7785. // empty values are omitted from API requests. However, any field with
  7786. // an empty value appearing in NullFields will be sent to the server as
  7787. // null. It is an error if a field in this list has a non-empty value.
  7788. // This may be used to include null fields in Patch requests.
  7789. NullFields []string `json:"-"`
  7790. }
  7791. func (s *VideoStatistics) MarshalJSON() ([]byte, error) {
  7792. type NoMethod VideoStatistics
  7793. raw := NoMethod(*s)
  7794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7795. }
  7796. // VideoStatus: Basic details about a video category, such as its
  7797. // localized title.
  7798. type VideoStatus struct {
  7799. // Embeddable: This value indicates if the video can be embedded on
  7800. // another website.
  7801. Embeddable bool `json:"embeddable,omitempty"`
  7802. // FailureReason: This value explains why a video failed to upload. This
  7803. // property is only present if the uploadStatus property indicates that
  7804. // the upload failed.
  7805. //
  7806. // Possible values:
  7807. // "codec"
  7808. // "conversion"
  7809. // "emptyFile"
  7810. // "invalidFile"
  7811. // "tooSmall"
  7812. // "uploadAborted"
  7813. FailureReason string `json:"failureReason,omitempty"`
  7814. // License: The video's license.
  7815. //
  7816. // Possible values:
  7817. // "creativeCommon"
  7818. // "youtube"
  7819. License string `json:"license,omitempty"`
  7820. // PrivacyStatus: The video's privacy status.
  7821. //
  7822. // Possible values:
  7823. // "private"
  7824. // "public"
  7825. // "unlisted"
  7826. // "unlisted_new"
  7827. PrivacyStatus string `json:"privacyStatus,omitempty"`
  7828. // PublicStatsViewable: This value indicates if the extended video
  7829. // statistics on the watch page can be viewed by everyone. Note that the
  7830. // view count, likes, etc will still be visible if this is disabled.
  7831. PublicStatsViewable bool `json:"publicStatsViewable,omitempty"`
  7832. // PublishAt: The date and time when the video is scheduled to publish.
  7833. // It can be set only if the privacy status of the video is private. The
  7834. // value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format.
  7835. PublishAt string `json:"publishAt,omitempty"`
  7836. // RejectionReason: This value explains why YouTube rejected an uploaded
  7837. // video. This property is only present if the uploadStatus property
  7838. // indicates that the upload was rejected.
  7839. //
  7840. // Possible values:
  7841. // "claim"
  7842. // "copyright"
  7843. // "duplicate"
  7844. // "inappropriate"
  7845. // "legal"
  7846. // "length"
  7847. // "termsOfUse"
  7848. // "trademark"
  7849. // "uploaderAccountClosed"
  7850. // "uploaderAccountSuspended"
  7851. RejectionReason string `json:"rejectionReason,omitempty"`
  7852. // UploadStatus: The status of the uploaded video.
  7853. //
  7854. // Possible values:
  7855. // "deleted"
  7856. // "failed"
  7857. // "processed"
  7858. // "rejected"
  7859. // "uploaded"
  7860. UploadStatus string `json:"uploadStatus,omitempty"`
  7861. // ForceSendFields is a list of field names (e.g. "Embeddable") to
  7862. // unconditionally include in API requests. By default, fields with
  7863. // empty values are omitted from API requests. However, any non-pointer,
  7864. // non-interface field appearing in ForceSendFields will be sent to the
  7865. // server regardless of whether the field is empty or not. This may be
  7866. // used to include empty fields in Patch requests.
  7867. ForceSendFields []string `json:"-"`
  7868. // NullFields is a list of field names (e.g. "Embeddable") to include in
  7869. // API requests with the JSON null value. By default, fields with empty
  7870. // values are omitted from API requests. However, any field with an
  7871. // empty value appearing in NullFields will be sent to the server as
  7872. // null. It is an error if a field in this list has a non-empty value.
  7873. // This may be used to include null fields in Patch requests.
  7874. NullFields []string `json:"-"`
  7875. }
  7876. func (s *VideoStatus) MarshalJSON() ([]byte, error) {
  7877. type NoMethod VideoStatus
  7878. raw := NoMethod(*s)
  7879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7880. }
  7881. // VideoSuggestions: Specifies suggestions on how to improve video
  7882. // content, including encoding hints, tag suggestions, and editor
  7883. // suggestions.
  7884. type VideoSuggestions struct {
  7885. // EditorSuggestions: A list of video editing operations that might
  7886. // improve the video quality or playback experience of the uploaded
  7887. // video.
  7888. //
  7889. // Possible values:
  7890. // "audioQuietAudioSwap"
  7891. // "videoAutoLevels"
  7892. // "videoCrop"
  7893. // "videoStabilize"
  7894. EditorSuggestions []string `json:"editorSuggestions,omitempty"`
  7895. // ProcessingErrors: A list of errors that will prevent YouTube from
  7896. // successfully processing the uploaded video video. These errors
  7897. // indicate that, regardless of the video's current processing status,
  7898. // eventually, that status will almost certainly be failed.
  7899. //
  7900. // Possible values:
  7901. // "archiveFile"
  7902. // "audioFile"
  7903. // "docFile"
  7904. // "imageFile"
  7905. // "notAVideoFile"
  7906. // "projectFile"
  7907. // "unsupportedSpatialAudioLayout"
  7908. ProcessingErrors []string `json:"processingErrors,omitempty"`
  7909. // ProcessingHints: A list of suggestions that may improve YouTube's
  7910. // ability to process the video.
  7911. //
  7912. // Possible values:
  7913. // "hdrVideo"
  7914. // "nonStreamableMov"
  7915. // "sendBestQualityVideo"
  7916. // "spatialAudio"
  7917. // "sphericalVideo"
  7918. // "vrVideo"
  7919. ProcessingHints []string `json:"processingHints,omitempty"`
  7920. // ProcessingWarnings: A list of reasons why YouTube may have difficulty
  7921. // transcoding the uploaded video or that might result in an erroneous
  7922. // transcoding. These warnings are generated before YouTube actually
  7923. // processes the uploaded video file. In addition, they identify issues
  7924. // that are unlikely to cause the video processing to fail but that
  7925. // might cause problems such as sync issues, video artifacts, or a
  7926. // missing audio track.
  7927. //
  7928. // Possible values:
  7929. // "hasEditlist"
  7930. // "inconsistentResolution"
  7931. // "problematicAudioCodec"
  7932. // "problematicHdrLookupTable"
  7933. // "problematicVideoCodec"
  7934. // "unknownAudioCodec"
  7935. // "unknownContainer"
  7936. // "unknownVideoCodec"
  7937. // "unsupportedHdrColorMetadata"
  7938. // "unsupportedHdrPixelFormat"
  7939. // "unsupportedSphericalProjectionType"
  7940. // "unsupportedVrStereoMode"
  7941. ProcessingWarnings []string `json:"processingWarnings,omitempty"`
  7942. // TagSuggestions: A list of keyword tags that could be added to the
  7943. // video's metadata to increase the likelihood that users will locate
  7944. // your video when searching or browsing on YouTube.
  7945. TagSuggestions []*VideoSuggestionsTagSuggestion `json:"tagSuggestions,omitempty"`
  7946. // ForceSendFields is a list of field names (e.g. "EditorSuggestions")
  7947. // to unconditionally include in API requests. By default, fields with
  7948. // empty values are omitted from API requests. However, any non-pointer,
  7949. // non-interface field appearing in ForceSendFields will be sent to the
  7950. // server regardless of whether the field is empty or not. This may be
  7951. // used to include empty fields in Patch requests.
  7952. ForceSendFields []string `json:"-"`
  7953. // NullFields is a list of field names (e.g. "EditorSuggestions") to
  7954. // include in API requests with the JSON null value. By default, fields
  7955. // with empty values are omitted from API requests. However, any field
  7956. // with an empty value appearing in NullFields will be sent to the
  7957. // server as null. It is an error if a field in this list has a
  7958. // non-empty value. This may be used to include null fields in Patch
  7959. // requests.
  7960. NullFields []string `json:"-"`
  7961. }
  7962. func (s *VideoSuggestions) MarshalJSON() ([]byte, error) {
  7963. type NoMethod VideoSuggestions
  7964. raw := NoMethod(*s)
  7965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7966. }
  7967. // VideoSuggestionsTagSuggestion: A single tag suggestion with it's
  7968. // relevance information.
  7969. type VideoSuggestionsTagSuggestion struct {
  7970. // CategoryRestricts: A set of video categories for which the tag is
  7971. // relevant. You can use this information to display appropriate tag
  7972. // suggestions based on the video category that the video uploader
  7973. // associates with the video. By default, tag suggestions are relevant
  7974. // for all categories if there are no restricts defined for the keyword.
  7975. CategoryRestricts []string `json:"categoryRestricts,omitempty"`
  7976. // Tag: The keyword tag suggested for the video.
  7977. Tag string `json:"tag,omitempty"`
  7978. // ForceSendFields is a list of field names (e.g. "CategoryRestricts")
  7979. // to unconditionally include in API requests. By default, fields with
  7980. // empty values are omitted from API requests. However, any non-pointer,
  7981. // non-interface field appearing in ForceSendFields will be sent to the
  7982. // server regardless of whether the field is empty or not. This may be
  7983. // used to include empty fields in Patch requests.
  7984. ForceSendFields []string `json:"-"`
  7985. // NullFields is a list of field names (e.g. "CategoryRestricts") to
  7986. // include in API requests with the JSON null value. By default, fields
  7987. // with empty values are omitted from API requests. However, any field
  7988. // with an empty value appearing in NullFields will be sent to the
  7989. // server as null. It is an error if a field in this list has a
  7990. // non-empty value. This may be used to include null fields in Patch
  7991. // requests.
  7992. NullFields []string `json:"-"`
  7993. }
  7994. func (s *VideoSuggestionsTagSuggestion) MarshalJSON() ([]byte, error) {
  7995. type NoMethod VideoSuggestionsTagSuggestion
  7996. raw := NoMethod(*s)
  7997. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7998. }
  7999. // VideoTopicDetails: Freebase topic information related to the video.
  8000. type VideoTopicDetails struct {
  8001. // RelevantTopicIds: Similar to topic_id, except that these topics are
  8002. // merely relevant to the video. These are topics that may be mentioned
  8003. // in, or appear in the video. You can retrieve information about each
  8004. // topic using Freebase Topic API.
  8005. RelevantTopicIds []string `json:"relevantTopicIds,omitempty"`
  8006. // TopicCategories: A list of Wikipedia URLs that provide a high-level
  8007. // description of the video's content.
  8008. TopicCategories []string `json:"topicCategories,omitempty"`
  8009. // TopicIds: A list of Freebase topic IDs that are centrally associated
  8010. // with the video. These are topics that are centrally featured in the
  8011. // video, and it can be said that the video is mainly about each of
  8012. // these. You can retrieve information about each topic using the
  8013. // Freebase Topic API.
  8014. TopicIds []string `json:"topicIds,omitempty"`
  8015. // ForceSendFields is a list of field names (e.g. "RelevantTopicIds") to
  8016. // unconditionally include in API requests. By default, fields with
  8017. // empty values are omitted from API requests. However, any non-pointer,
  8018. // non-interface field appearing in ForceSendFields will be sent to the
  8019. // server regardless of whether the field is empty or not. This may be
  8020. // used to include empty fields in Patch requests.
  8021. ForceSendFields []string `json:"-"`
  8022. // NullFields is a list of field names (e.g. "RelevantTopicIds") to
  8023. // include in API requests with the JSON null value. By default, fields
  8024. // with empty values are omitted from API requests. However, any field
  8025. // with an empty value appearing in NullFields will be sent to the
  8026. // server as null. It is an error if a field in this list has a
  8027. // non-empty value. This may be used to include null fields in Patch
  8028. // requests.
  8029. NullFields []string `json:"-"`
  8030. }
  8031. func (s *VideoTopicDetails) MarshalJSON() ([]byte, error) {
  8032. type NoMethod VideoTopicDetails
  8033. raw := NoMethod(*s)
  8034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8035. }
  8036. // WatchSettings: Branding properties for the watch. All deprecated.
  8037. type WatchSettings struct {
  8038. // BackgroundColor: The text color for the video watch page's branded
  8039. // area.
  8040. BackgroundColor string `json:"backgroundColor,omitempty"`
  8041. // FeaturedPlaylistId: An ID that uniquely identifies a playlist that
  8042. // displays next to the video player.
  8043. FeaturedPlaylistId string `json:"featuredPlaylistId,omitempty"`
  8044. // TextColor: The background color for the video watch page's branded
  8045. // area.
  8046. TextColor string `json:"textColor,omitempty"`
  8047. // ForceSendFields is a list of field names (e.g. "BackgroundColor") to
  8048. // unconditionally include in API requests. By default, fields with
  8049. // empty values are omitted from API requests. However, any non-pointer,
  8050. // non-interface field appearing in ForceSendFields will be sent to the
  8051. // server regardless of whether the field is empty or not. This may be
  8052. // used to include empty fields in Patch requests.
  8053. ForceSendFields []string `json:"-"`
  8054. // NullFields is a list of field names (e.g. "BackgroundColor") to
  8055. // include in API requests with the JSON null value. By default, fields
  8056. // with empty values are omitted from API requests. However, any field
  8057. // with an empty value appearing in NullFields will be sent to the
  8058. // server as null. It is an error if a field in this list has a
  8059. // non-empty value. This may be used to include null fields in Patch
  8060. // requests.
  8061. NullFields []string `json:"-"`
  8062. }
  8063. func (s *WatchSettings) MarshalJSON() ([]byte, error) {
  8064. type NoMethod WatchSettings
  8065. raw := NoMethod(*s)
  8066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8067. }
  8068. // method id "youtube.activities.insert":
  8069. type ActivitiesInsertCall struct {
  8070. s *Service
  8071. activity *Activity
  8072. urlParams_ gensupport.URLParams
  8073. ctx_ context.Context
  8074. header_ http.Header
  8075. }
  8076. // Insert: Posts a bulletin for a specific channel. (The user submitting
  8077. // the request must be authorized to act on the channel's
  8078. // behalf.)
  8079. //
  8080. // Note: Even though an activity resource can contain information about
  8081. // actions like a user rating a video or marking a video as a favorite,
  8082. // you need to use other API methods to generate those activity
  8083. // resources. For example, you would use the API's videos.rate() method
  8084. // to rate a video and the playlistItems.insert() method to mark a video
  8085. // as a favorite.
  8086. func (r *ActivitiesService) Insert(part string, activity *Activity) *ActivitiesInsertCall {
  8087. c := &ActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8088. c.urlParams_.Set("part", part)
  8089. c.activity = activity
  8090. return c
  8091. }
  8092. // Fields allows partial responses to be retrieved. See
  8093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8094. // for more information.
  8095. func (c *ActivitiesInsertCall) Fields(s ...googleapi.Field) *ActivitiesInsertCall {
  8096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8097. return c
  8098. }
  8099. // Context sets the context to be used in this call's Do method. Any
  8100. // pending HTTP request will be aborted if the provided context is
  8101. // canceled.
  8102. func (c *ActivitiesInsertCall) Context(ctx context.Context) *ActivitiesInsertCall {
  8103. c.ctx_ = ctx
  8104. return c
  8105. }
  8106. // Header returns an http.Header that can be modified by the caller to
  8107. // add HTTP headers to the request.
  8108. func (c *ActivitiesInsertCall) Header() http.Header {
  8109. if c.header_ == nil {
  8110. c.header_ = make(http.Header)
  8111. }
  8112. return c.header_
  8113. }
  8114. func (c *ActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  8115. reqHeaders := make(http.Header)
  8116. for k, v := range c.header_ {
  8117. reqHeaders[k] = v
  8118. }
  8119. reqHeaders.Set("User-Agent", c.s.userAgent())
  8120. var body io.Reader = nil
  8121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.activity)
  8122. if err != nil {
  8123. return nil, err
  8124. }
  8125. reqHeaders.Set("Content-Type", "application/json")
  8126. c.urlParams_.Set("alt", alt)
  8127. urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
  8128. urls += "?" + c.urlParams_.Encode()
  8129. req, _ := http.NewRequest("POST", urls, body)
  8130. req.Header = reqHeaders
  8131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8132. }
  8133. // Do executes the "youtube.activities.insert" call.
  8134. // Exactly one of *Activity or error will be non-nil. Any non-2xx status
  8135. // code is an error. Response headers are in either
  8136. // *Activity.ServerResponse.Header or (if a response was returned at
  8137. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8138. // to check whether the returned error was because
  8139. // http.StatusNotModified was returned.
  8140. func (c *ActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*Activity, error) {
  8141. gensupport.SetOptions(c.urlParams_, opts...)
  8142. res, err := c.doRequest("json")
  8143. if res != nil && res.StatusCode == http.StatusNotModified {
  8144. if res.Body != nil {
  8145. res.Body.Close()
  8146. }
  8147. return nil, &googleapi.Error{
  8148. Code: res.StatusCode,
  8149. Header: res.Header,
  8150. }
  8151. }
  8152. if err != nil {
  8153. return nil, err
  8154. }
  8155. defer googleapi.CloseBody(res)
  8156. if err := googleapi.CheckResponse(res); err != nil {
  8157. return nil, err
  8158. }
  8159. ret := &Activity{
  8160. ServerResponse: googleapi.ServerResponse{
  8161. Header: res.Header,
  8162. HTTPStatusCode: res.StatusCode,
  8163. },
  8164. }
  8165. target := &ret
  8166. if err := gensupport.DecodeResponse(target, res); err != nil {
  8167. return nil, err
  8168. }
  8169. return ret, nil
  8170. // {
  8171. // "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.",
  8172. // "httpMethod": "POST",
  8173. // "id": "youtube.activities.insert",
  8174. // "parameterOrder": [
  8175. // "part"
  8176. // ],
  8177. // "parameters": {
  8178. // "part": {
  8179. // "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.",
  8180. // "location": "query",
  8181. // "required": true,
  8182. // "type": "string"
  8183. // }
  8184. // },
  8185. // "path": "activities",
  8186. // "request": {
  8187. // "$ref": "Activity"
  8188. // },
  8189. // "response": {
  8190. // "$ref": "Activity"
  8191. // },
  8192. // "scopes": [
  8193. // "https://www.googleapis.com/auth/youtube",
  8194. // "https://www.googleapis.com/auth/youtube.force-ssl"
  8195. // ]
  8196. // }
  8197. }
  8198. // method id "youtube.activities.list":
  8199. type ActivitiesListCall struct {
  8200. s *Service
  8201. urlParams_ gensupport.URLParams
  8202. ifNoneMatch_ string
  8203. ctx_ context.Context
  8204. header_ http.Header
  8205. }
  8206. // List: Returns a list of channel activity events that match the
  8207. // request criteria. For example, you can retrieve events associated
  8208. // with a particular channel, events associated with the user's
  8209. // subscriptions and Google+ friends, or the YouTube home page feed,
  8210. // which is customized for each user.
  8211. func (r *ActivitiesService) List(part string) *ActivitiesListCall {
  8212. c := &ActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8213. c.urlParams_.Set("part", part)
  8214. return c
  8215. }
  8216. // ChannelId sets the optional parameter "channelId": The channelId
  8217. // parameter specifies a unique YouTube channel ID. The API will then
  8218. // return a list of that channel's activities.
  8219. func (c *ActivitiesListCall) ChannelId(channelId string) *ActivitiesListCall {
  8220. c.urlParams_.Set("channelId", channelId)
  8221. return c
  8222. }
  8223. // Home sets the optional parameter "home": Set this parameter's value
  8224. // to true to retrieve the activity feed that displays on the YouTube
  8225. // home page for the currently authenticated user.
  8226. func (c *ActivitiesListCall) Home(home bool) *ActivitiesListCall {
  8227. c.urlParams_.Set("home", fmt.Sprint(home))
  8228. return c
  8229. }
  8230. // MaxResults sets the optional parameter "maxResults": The maxResults
  8231. // parameter specifies the maximum number of items that should be
  8232. // returned in the result set.
  8233. func (c *ActivitiesListCall) MaxResults(maxResults int64) *ActivitiesListCall {
  8234. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  8235. return c
  8236. }
  8237. // Mine sets the optional parameter "mine": Set this parameter's value
  8238. // to true to retrieve a feed of the authenticated user's activities.
  8239. func (c *ActivitiesListCall) Mine(mine bool) *ActivitiesListCall {
  8240. c.urlParams_.Set("mine", fmt.Sprint(mine))
  8241. return c
  8242. }
  8243. // PageToken sets the optional parameter "pageToken": The pageToken
  8244. // parameter identifies a specific page in the result set that should be
  8245. // returned. In an API response, the nextPageToken and prevPageToken
  8246. // properties identify other pages that could be retrieved.
  8247. func (c *ActivitiesListCall) PageToken(pageToken string) *ActivitiesListCall {
  8248. c.urlParams_.Set("pageToken", pageToken)
  8249. return c
  8250. }
  8251. // PublishedAfter sets the optional parameter "publishedAfter": The
  8252. // publishedAfter parameter specifies the earliest date and time that an
  8253. // activity could have occurred for that activity to be included in the
  8254. // API response. If the parameter value specifies a day, but not a time,
  8255. // then any activities that occurred that day will be included in the
  8256. // result set. The value is specified in ISO 8601
  8257. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  8258. func (c *ActivitiesListCall) PublishedAfter(publishedAfter string) *ActivitiesListCall {
  8259. c.urlParams_.Set("publishedAfter", publishedAfter)
  8260. return c
  8261. }
  8262. // PublishedBefore sets the optional parameter "publishedBefore": The
  8263. // publishedBefore parameter specifies the date and time before which an
  8264. // activity must have occurred for that activity to be included in the
  8265. // API response. If the parameter value specifies a day, but not a time,
  8266. // then any activities that occurred that day will be excluded from the
  8267. // result set. The value is specified in ISO 8601
  8268. // (YYYY-MM-DDThh:mm:ss.sZ) format.
  8269. func (c *ActivitiesListCall) PublishedBefore(publishedBefore string) *ActivitiesListCall {
  8270. c.urlParams_.Set("publishedBefore", publishedBefore)
  8271. return c
  8272. }
  8273. // RegionCode sets the optional parameter "regionCode": The regionCode
  8274. // parameter instructs the API to return results for the specified
  8275. // country. The parameter value is an ISO 3166-1 alpha-2 country code.
  8276. // YouTube uses this value when the authorized user's previous activity
  8277. // on YouTube does not provide enough information to generate the
  8278. // activity feed.
  8279. func (c *ActivitiesListCall) RegionCode(regionCode string) *ActivitiesListCall {
  8280. c.urlParams_.Set("regionCode", regionCode)
  8281. return c
  8282. }
  8283. // Fields allows partial responses to be retrieved. See
  8284. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8285. // for more information.
  8286. func (c *ActivitiesListCall) Fields(s ...googleapi.Field) *ActivitiesListCall {
  8287. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8288. return c
  8289. }
  8290. // IfNoneMatch sets the optional parameter which makes the operation
  8291. // fail if the object's ETag matches the given value. This is useful for
  8292. // getting updates only after the object has changed since the last
  8293. // request. Use googleapi.IsNotModified to check whether the response
  8294. // error from Do is the result of In-None-Match.
  8295. func (c *ActivitiesListCall) IfNoneMatch(entityTag string) *ActivitiesListCall {
  8296. c.ifNoneMatch_ = entityTag
  8297. return c
  8298. }
  8299. // Context sets the context to be used in this call's Do method. Any
  8300. // pending HTTP request will be aborted if the provided context is
  8301. // canceled.
  8302. func (c *ActivitiesListCall) Context(ctx context.Context) *ActivitiesListCall {
  8303. c.ctx_ = ctx
  8304. return c
  8305. }
  8306. // Header returns an http.Header that can be modified by the caller to
  8307. // add HTTP headers to the request.
  8308. func (c *ActivitiesListCall) Header() http.Header {
  8309. if c.header_ == nil {
  8310. c.header_ = make(http.Header)
  8311. }
  8312. return c.header_
  8313. }
  8314. func (c *ActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  8315. reqHeaders := make(http.Header)
  8316. for k, v := range c.header_ {
  8317. reqHeaders[k] = v
  8318. }
  8319. reqHeaders.Set("User-Agent", c.s.userAgent())
  8320. if c.ifNoneMatch_ != "" {
  8321. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8322. }
  8323. var body io.Reader = nil
  8324. c.urlParams_.Set("alt", alt)
  8325. urls := googleapi.ResolveRelative(c.s.BasePath, "activities")
  8326. urls += "?" + c.urlParams_.Encode()
  8327. req, _ := http.NewRequest("GET", urls, body)
  8328. req.Header = reqHeaders
  8329. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8330. }
  8331. // Do executes the "youtube.activities.list" call.
  8332. // Exactly one of *ActivityListResponse or error will be non-nil. Any
  8333. // non-2xx status code is an error. Response headers are in either
  8334. // *ActivityListResponse.ServerResponse.Header or (if a response was
  8335. // returned at all) in error.(*googleapi.Error).Header. Use
  8336. // googleapi.IsNotModified to check whether the returned error was
  8337. // because http.StatusNotModified was returned.
  8338. func (c *ActivitiesListCall) Do(opts ...googleapi.CallOption) (*ActivityListResponse, error) {
  8339. gensupport.SetOptions(c.urlParams_, opts...)
  8340. res, err := c.doRequest("json")
  8341. if res != nil && res.StatusCode == http.StatusNotModified {
  8342. if res.Body != nil {
  8343. res.Body.Close()
  8344. }
  8345. return nil, &googleapi.Error{
  8346. Code: res.StatusCode,
  8347. Header: res.Header,
  8348. }
  8349. }
  8350. if err != nil {
  8351. return nil, err
  8352. }
  8353. defer googleapi.CloseBody(res)
  8354. if err := googleapi.CheckResponse(res); err != nil {
  8355. return nil, err
  8356. }
  8357. ret := &ActivityListResponse{
  8358. ServerResponse: googleapi.ServerResponse{
  8359. Header: res.Header,
  8360. HTTPStatusCode: res.StatusCode,
  8361. },
  8362. }
  8363. target := &ret
  8364. if err := gensupport.DecodeResponse(target, res); err != nil {
  8365. return nil, err
  8366. }
  8367. return ret, nil
  8368. // {
  8369. // "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.",
  8370. // "httpMethod": "GET",
  8371. // "id": "youtube.activities.list",
  8372. // "parameterOrder": [
  8373. // "part"
  8374. // ],
  8375. // "parameters": {
  8376. // "channelId": {
  8377. // "description": "The channelId parameter specifies a unique YouTube channel ID. The API will then return a list of that channel's activities.",
  8378. // "location": "query",
  8379. // "type": "string"
  8380. // },
  8381. // "home": {
  8382. // "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.",
  8383. // "location": "query",
  8384. // "type": "boolean"
  8385. // },
  8386. // "maxResults": {
  8387. // "default": "5",
  8388. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  8389. // "format": "uint32",
  8390. // "location": "query",
  8391. // "maximum": "50",
  8392. // "minimum": "0",
  8393. // "type": "integer"
  8394. // },
  8395. // "mine": {
  8396. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's activities.",
  8397. // "location": "query",
  8398. // "type": "boolean"
  8399. // },
  8400. // "pageToken": {
  8401. // "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.",
  8402. // "location": "query",
  8403. // "type": "string"
  8404. // },
  8405. // "part": {
  8406. // "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.",
  8407. // "location": "query",
  8408. // "required": true,
  8409. // "type": "string"
  8410. // },
  8411. // "publishedAfter": {
  8412. // "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.",
  8413. // "format": "date-time",
  8414. // "location": "query",
  8415. // "type": "string"
  8416. // },
  8417. // "publishedBefore": {
  8418. // "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.",
  8419. // "format": "date-time",
  8420. // "location": "query",
  8421. // "type": "string"
  8422. // },
  8423. // "regionCode": {
  8424. // "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.",
  8425. // "location": "query",
  8426. // "type": "string"
  8427. // }
  8428. // },
  8429. // "path": "activities",
  8430. // "response": {
  8431. // "$ref": "ActivityListResponse"
  8432. // },
  8433. // "scopes": [
  8434. // "https://www.googleapis.com/auth/youtube",
  8435. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8436. // "https://www.googleapis.com/auth/youtube.readonly"
  8437. // ]
  8438. // }
  8439. }
  8440. // Pages invokes f for each page of results.
  8441. // A non-nil error returned from f will halt the iteration.
  8442. // The provided context supersedes any context provided to the Context method.
  8443. func (c *ActivitiesListCall) Pages(ctx context.Context, f func(*ActivityListResponse) error) error {
  8444. c.ctx_ = ctx
  8445. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8446. for {
  8447. x, err := c.Do()
  8448. if err != nil {
  8449. return err
  8450. }
  8451. if err := f(x); err != nil {
  8452. return err
  8453. }
  8454. if x.NextPageToken == "" {
  8455. return nil
  8456. }
  8457. c.PageToken(x.NextPageToken)
  8458. }
  8459. }
  8460. // method id "youtube.captions.delete":
  8461. type CaptionsDeleteCall struct {
  8462. s *Service
  8463. urlParams_ gensupport.URLParams
  8464. ctx_ context.Context
  8465. header_ http.Header
  8466. }
  8467. // Delete: Deletes a specified caption track.
  8468. func (r *CaptionsService) Delete(id string) *CaptionsDeleteCall {
  8469. c := &CaptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8470. c.urlParams_.Set("id", id)
  8471. return c
  8472. }
  8473. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  8474. // Google+ Page for the channel that the request is be on behalf of
  8475. func (c *CaptionsDeleteCall) OnBehalfOf(onBehalfOf string) *CaptionsDeleteCall {
  8476. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  8477. return c
  8478. }
  8479. // OnBehalfOfContentOwner sets the optional parameter
  8480. // "onBehalfOfContentOwner": Note: This parameter is intended
  8481. // exclusively for YouTube content partners.
  8482. //
  8483. // The onBehalfOfContentOwner parameter indicates that the request's
  8484. // authorization credentials identify a YouTube CMS user who is acting
  8485. // on behalf of the content owner specified in the parameter value. This
  8486. // parameter is intended for YouTube content partners that own and
  8487. // manage many different YouTube channels. It allows content owners to
  8488. // authenticate once and get access to all their video and channel data,
  8489. // without having to provide authentication credentials for each
  8490. // individual channel. The actual CMS account that the user
  8491. // authenticates with must be linked to the specified YouTube content
  8492. // owner.
  8493. func (c *CaptionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDeleteCall {
  8494. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8495. return c
  8496. }
  8497. // Fields allows partial responses to be retrieved. See
  8498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8499. // for more information.
  8500. func (c *CaptionsDeleteCall) Fields(s ...googleapi.Field) *CaptionsDeleteCall {
  8501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8502. return c
  8503. }
  8504. // Context sets the context to be used in this call's Do method. Any
  8505. // pending HTTP request will be aborted if the provided context is
  8506. // canceled.
  8507. func (c *CaptionsDeleteCall) Context(ctx context.Context) *CaptionsDeleteCall {
  8508. c.ctx_ = ctx
  8509. return c
  8510. }
  8511. // Header returns an http.Header that can be modified by the caller to
  8512. // add HTTP headers to the request.
  8513. func (c *CaptionsDeleteCall) Header() http.Header {
  8514. if c.header_ == nil {
  8515. c.header_ = make(http.Header)
  8516. }
  8517. return c.header_
  8518. }
  8519. func (c *CaptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8520. reqHeaders := make(http.Header)
  8521. for k, v := range c.header_ {
  8522. reqHeaders[k] = v
  8523. }
  8524. reqHeaders.Set("User-Agent", c.s.userAgent())
  8525. var body io.Reader = nil
  8526. c.urlParams_.Set("alt", alt)
  8527. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  8528. urls += "?" + c.urlParams_.Encode()
  8529. req, _ := http.NewRequest("DELETE", urls, body)
  8530. req.Header = reqHeaders
  8531. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8532. }
  8533. // Do executes the "youtube.captions.delete" call.
  8534. func (c *CaptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8535. gensupport.SetOptions(c.urlParams_, opts...)
  8536. res, err := c.doRequest("json")
  8537. if err != nil {
  8538. return err
  8539. }
  8540. defer googleapi.CloseBody(res)
  8541. if err := googleapi.CheckResponse(res); err != nil {
  8542. return err
  8543. }
  8544. return nil
  8545. // {
  8546. // "description": "Deletes a specified caption track.",
  8547. // "httpMethod": "DELETE",
  8548. // "id": "youtube.captions.delete",
  8549. // "parameterOrder": [
  8550. // "id"
  8551. // ],
  8552. // "parameters": {
  8553. // "id": {
  8554. // "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.",
  8555. // "location": "query",
  8556. // "required": true,
  8557. // "type": "string"
  8558. // },
  8559. // "onBehalfOf": {
  8560. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  8561. // "location": "query",
  8562. // "type": "string"
  8563. // },
  8564. // "onBehalfOfContentOwner": {
  8565. // "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.",
  8566. // "location": "query",
  8567. // "type": "string"
  8568. // }
  8569. // },
  8570. // "path": "captions",
  8571. // "scopes": [
  8572. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8573. // "https://www.googleapis.com/auth/youtubepartner"
  8574. // ]
  8575. // }
  8576. }
  8577. // method id "youtube.captions.download":
  8578. type CaptionsDownloadCall struct {
  8579. s *Service
  8580. id string
  8581. urlParams_ gensupport.URLParams
  8582. ifNoneMatch_ string
  8583. ctx_ context.Context
  8584. header_ http.Header
  8585. }
  8586. // Download: Downloads a caption track. The caption track is returned in
  8587. // its original format unless the request specifies a value for the tfmt
  8588. // parameter and in its original language unless the request specifies a
  8589. // value for the tlang parameter.
  8590. func (r *CaptionsService) Download(id string) *CaptionsDownloadCall {
  8591. c := &CaptionsDownloadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8592. c.id = id
  8593. return c
  8594. }
  8595. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  8596. // Google+ Page for the channel that the request is be on behalf of
  8597. func (c *CaptionsDownloadCall) OnBehalfOf(onBehalfOf string) *CaptionsDownloadCall {
  8598. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  8599. return c
  8600. }
  8601. // OnBehalfOfContentOwner sets the optional parameter
  8602. // "onBehalfOfContentOwner": Note: This parameter is intended
  8603. // exclusively for YouTube content partners.
  8604. //
  8605. // The onBehalfOfContentOwner parameter indicates that the request's
  8606. // authorization credentials identify a YouTube CMS user who is acting
  8607. // on behalf of the content owner specified in the parameter value. This
  8608. // parameter is intended for YouTube content partners that own and
  8609. // manage many different YouTube channels. It allows content owners to
  8610. // authenticate once and get access to all their video and channel data,
  8611. // without having to provide authentication credentials for each
  8612. // individual channel. The actual CMS account that the user
  8613. // authenticates with must be linked to the specified YouTube content
  8614. // owner.
  8615. func (c *CaptionsDownloadCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsDownloadCall {
  8616. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8617. return c
  8618. }
  8619. // Tfmt sets the optional parameter "tfmt": The tfmt parameter specifies
  8620. // that the caption track should be returned in a specific format. If
  8621. // the parameter is not included in the request, the track is returned
  8622. // in its original format.
  8623. //
  8624. // Possible values:
  8625. // "sbv" - SubViewer subtitle.
  8626. // "scc" - Scenarist Closed Caption format.
  8627. // "srt" - SubRip subtitle.
  8628. // "ttml" - Timed Text Markup Language caption.
  8629. // "vtt" - Web Video Text Tracks caption.
  8630. func (c *CaptionsDownloadCall) Tfmt(tfmt string) *CaptionsDownloadCall {
  8631. c.urlParams_.Set("tfmt", tfmt)
  8632. return c
  8633. }
  8634. // Tlang sets the optional parameter "tlang": The tlang parameter
  8635. // specifies that the API response should return a translation of the
  8636. // specified caption track. The parameter value is an ISO 639-1
  8637. // two-letter language code that identifies the desired caption
  8638. // language. The translation is generated by using machine translation,
  8639. // such as Google Translate.
  8640. func (c *CaptionsDownloadCall) Tlang(tlang string) *CaptionsDownloadCall {
  8641. c.urlParams_.Set("tlang", tlang)
  8642. return c
  8643. }
  8644. // Fields allows partial responses to be retrieved. See
  8645. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8646. // for more information.
  8647. func (c *CaptionsDownloadCall) Fields(s ...googleapi.Field) *CaptionsDownloadCall {
  8648. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8649. return c
  8650. }
  8651. // IfNoneMatch sets the optional parameter which makes the operation
  8652. // fail if the object's ETag matches the given value. This is useful for
  8653. // getting updates only after the object has changed since the last
  8654. // request. Use googleapi.IsNotModified to check whether the response
  8655. // error from Do is the result of In-None-Match.
  8656. func (c *CaptionsDownloadCall) IfNoneMatch(entityTag string) *CaptionsDownloadCall {
  8657. c.ifNoneMatch_ = entityTag
  8658. return c
  8659. }
  8660. // Context sets the context to be used in this call's Do and Download
  8661. // methods. Any pending HTTP request will be aborted if the provided
  8662. // context is canceled.
  8663. func (c *CaptionsDownloadCall) Context(ctx context.Context) *CaptionsDownloadCall {
  8664. c.ctx_ = ctx
  8665. return c
  8666. }
  8667. // Header returns an http.Header that can be modified by the caller to
  8668. // add HTTP headers to the request.
  8669. func (c *CaptionsDownloadCall) Header() http.Header {
  8670. if c.header_ == nil {
  8671. c.header_ = make(http.Header)
  8672. }
  8673. return c.header_
  8674. }
  8675. func (c *CaptionsDownloadCall) doRequest(alt string) (*http.Response, error) {
  8676. reqHeaders := make(http.Header)
  8677. for k, v := range c.header_ {
  8678. reqHeaders[k] = v
  8679. }
  8680. reqHeaders.Set("User-Agent", c.s.userAgent())
  8681. if c.ifNoneMatch_ != "" {
  8682. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8683. }
  8684. var body io.Reader = nil
  8685. c.urlParams_.Set("alt", alt)
  8686. urls := googleapi.ResolveRelative(c.s.BasePath, "captions/{id}")
  8687. urls += "?" + c.urlParams_.Encode()
  8688. req, _ := http.NewRequest("GET", urls, body)
  8689. req.Header = reqHeaders
  8690. googleapi.Expand(req.URL, map[string]string{
  8691. "id": c.id,
  8692. })
  8693. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8694. }
  8695. // Download fetches the API endpoint's "media" value, instead of the normal
  8696. // API response value. If the returned error is nil, the Response is guaranteed to
  8697. // have a 2xx status code. Callers must close the Response.Body as usual.
  8698. func (c *CaptionsDownloadCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  8699. gensupport.SetOptions(c.urlParams_, opts...)
  8700. res, err := c.doRequest("media")
  8701. if err != nil {
  8702. return nil, err
  8703. }
  8704. if err := googleapi.CheckMediaResponse(res); err != nil {
  8705. res.Body.Close()
  8706. return nil, err
  8707. }
  8708. return res, nil
  8709. }
  8710. // Do executes the "youtube.captions.download" call.
  8711. func (c *CaptionsDownloadCall) Do(opts ...googleapi.CallOption) error {
  8712. gensupport.SetOptions(c.urlParams_, opts...)
  8713. res, err := c.doRequest("json")
  8714. if err != nil {
  8715. return err
  8716. }
  8717. defer googleapi.CloseBody(res)
  8718. if err := googleapi.CheckResponse(res); err != nil {
  8719. return err
  8720. }
  8721. return nil
  8722. // {
  8723. // "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.",
  8724. // "httpMethod": "GET",
  8725. // "id": "youtube.captions.download",
  8726. // "parameterOrder": [
  8727. // "id"
  8728. // ],
  8729. // "parameters": {
  8730. // "id": {
  8731. // "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.",
  8732. // "location": "path",
  8733. // "required": true,
  8734. // "type": "string"
  8735. // },
  8736. // "onBehalfOf": {
  8737. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  8738. // "location": "query",
  8739. // "type": "string"
  8740. // },
  8741. // "onBehalfOfContentOwner": {
  8742. // "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.",
  8743. // "location": "query",
  8744. // "type": "string"
  8745. // },
  8746. // "tfmt": {
  8747. // "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.",
  8748. // "enum": [
  8749. // "sbv",
  8750. // "scc",
  8751. // "srt",
  8752. // "ttml",
  8753. // "vtt"
  8754. // ],
  8755. // "enumDescriptions": [
  8756. // "SubViewer subtitle.",
  8757. // "Scenarist Closed Caption format.",
  8758. // "SubRip subtitle.",
  8759. // "Timed Text Markup Language caption.",
  8760. // "Web Video Text Tracks caption."
  8761. // ],
  8762. // "location": "query",
  8763. // "type": "string"
  8764. // },
  8765. // "tlang": {
  8766. // "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.",
  8767. // "location": "query",
  8768. // "type": "string"
  8769. // }
  8770. // },
  8771. // "path": "captions/{id}",
  8772. // "scopes": [
  8773. // "https://www.googleapis.com/auth/youtube.force-ssl",
  8774. // "https://www.googleapis.com/auth/youtubepartner"
  8775. // ],
  8776. // "supportsMediaDownload": true
  8777. // }
  8778. }
  8779. // method id "youtube.captions.insert":
  8780. type CaptionsInsertCall struct {
  8781. s *Service
  8782. caption *Caption
  8783. urlParams_ gensupport.URLParams
  8784. mediaInfo_ *gensupport.MediaInfo
  8785. ctx_ context.Context
  8786. header_ http.Header
  8787. }
  8788. // Insert: Uploads a caption track.
  8789. func (r *CaptionsService) Insert(part string, caption *Caption) *CaptionsInsertCall {
  8790. c := &CaptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8791. c.urlParams_.Set("part", part)
  8792. c.caption = caption
  8793. return c
  8794. }
  8795. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  8796. // Google+ Page for the channel that the request is be on behalf of
  8797. func (c *CaptionsInsertCall) OnBehalfOf(onBehalfOf string) *CaptionsInsertCall {
  8798. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  8799. return c
  8800. }
  8801. // OnBehalfOfContentOwner sets the optional parameter
  8802. // "onBehalfOfContentOwner": Note: This parameter is intended
  8803. // exclusively for YouTube content partners.
  8804. //
  8805. // The onBehalfOfContentOwner parameter indicates that the request's
  8806. // authorization credentials identify a YouTube CMS user who is acting
  8807. // on behalf of the content owner specified in the parameter value. This
  8808. // parameter is intended for YouTube content partners that own and
  8809. // manage many different YouTube channels. It allows content owners to
  8810. // authenticate once and get access to all their video and channel data,
  8811. // without having to provide authentication credentials for each
  8812. // individual channel. The actual CMS account that the user
  8813. // authenticates with must be linked to the specified YouTube content
  8814. // owner.
  8815. func (c *CaptionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsInsertCall {
  8816. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  8817. return c
  8818. }
  8819. // Sync sets the optional parameter "sync": The sync parameter indicates
  8820. // whether YouTube should automatically synchronize the caption file
  8821. // with the audio track of the video. If you set the value to true,
  8822. // YouTube will disregard any time codes that are in the uploaded
  8823. // caption file and generate new time codes for the captions.
  8824. //
  8825. // You should set the sync parameter to true if you are uploading a
  8826. // transcript, which has no time codes, or if you suspect the time codes
  8827. // in your file are incorrect and want YouTube to try to fix them.
  8828. func (c *CaptionsInsertCall) Sync(sync bool) *CaptionsInsertCall {
  8829. c.urlParams_.Set("sync", fmt.Sprint(sync))
  8830. return c
  8831. }
  8832. // Media specifies the media to upload in one or more chunks. The chunk
  8833. // size may be controlled by supplying a MediaOption generated by
  8834. // googleapi.ChunkSize. The chunk size defaults to
  8835. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  8836. // upload request will be determined by sniffing the contents of r,
  8837. // unless a MediaOption generated by googleapi.ContentType is
  8838. // supplied.
  8839. // At most one of Media and ResumableMedia may be set.
  8840. func (c *CaptionsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsInsertCall {
  8841. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  8842. return c
  8843. }
  8844. // ResumableMedia specifies the media to upload in chunks and can be
  8845. // canceled with ctx.
  8846. //
  8847. // Deprecated: use Media instead.
  8848. //
  8849. // At most one of Media and ResumableMedia may be set. mediaType
  8850. // identifies the MIME media type of the upload, such as "image/png". If
  8851. // mediaType is "", it will be auto-detected. The provided ctx will
  8852. // supersede any context previously provided to the Context method.
  8853. func (c *CaptionsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsInsertCall {
  8854. c.ctx_ = ctx
  8855. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  8856. return c
  8857. }
  8858. // ProgressUpdater provides a callback function that will be called
  8859. // after every chunk. It should be a low-latency function in order to
  8860. // not slow down the upload operation. This should only be called when
  8861. // using ResumableMedia (as opposed to Media).
  8862. func (c *CaptionsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsInsertCall {
  8863. c.mediaInfo_.SetProgressUpdater(pu)
  8864. return c
  8865. }
  8866. // Fields allows partial responses to be retrieved. See
  8867. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8868. // for more information.
  8869. func (c *CaptionsInsertCall) Fields(s ...googleapi.Field) *CaptionsInsertCall {
  8870. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8871. return c
  8872. }
  8873. // Context sets the context to be used in this call's Do method. Any
  8874. // pending HTTP request will be aborted if the provided context is
  8875. // canceled.
  8876. // This context will supersede any context previously provided to the
  8877. // ResumableMedia method.
  8878. func (c *CaptionsInsertCall) Context(ctx context.Context) *CaptionsInsertCall {
  8879. c.ctx_ = ctx
  8880. return c
  8881. }
  8882. // Header returns an http.Header that can be modified by the caller to
  8883. // add HTTP headers to the request.
  8884. func (c *CaptionsInsertCall) Header() http.Header {
  8885. if c.header_ == nil {
  8886. c.header_ = make(http.Header)
  8887. }
  8888. return c.header_
  8889. }
  8890. func (c *CaptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  8891. reqHeaders := make(http.Header)
  8892. for k, v := range c.header_ {
  8893. reqHeaders[k] = v
  8894. }
  8895. reqHeaders.Set("User-Agent", c.s.userAgent())
  8896. var body io.Reader = nil
  8897. body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption)
  8898. if err != nil {
  8899. return nil, err
  8900. }
  8901. reqHeaders.Set("Content-Type", "application/json")
  8902. c.urlParams_.Set("alt", alt)
  8903. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  8904. if c.mediaInfo_ != nil {
  8905. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  8906. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  8907. }
  8908. if body == nil {
  8909. body = new(bytes.Buffer)
  8910. reqHeaders.Set("Content-Type", "application/json")
  8911. }
  8912. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  8913. defer cleanup()
  8914. urls += "?" + c.urlParams_.Encode()
  8915. req, _ := http.NewRequest("POST", urls, body)
  8916. req.Header = reqHeaders
  8917. gensupport.SetGetBody(req, getBody)
  8918. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8919. }
  8920. // Do executes the "youtube.captions.insert" call.
  8921. // Exactly one of *Caption or error will be non-nil. Any non-2xx status
  8922. // code is an error. Response headers are in either
  8923. // *Caption.ServerResponse.Header or (if a response was returned at all)
  8924. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8925. // check whether the returned error was because http.StatusNotModified
  8926. // was returned.
  8927. func (c *CaptionsInsertCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
  8928. gensupport.SetOptions(c.urlParams_, opts...)
  8929. res, err := c.doRequest("json")
  8930. if res != nil && res.StatusCode == http.StatusNotModified {
  8931. if res.Body != nil {
  8932. res.Body.Close()
  8933. }
  8934. return nil, &googleapi.Error{
  8935. Code: res.StatusCode,
  8936. Header: res.Header,
  8937. }
  8938. }
  8939. if err != nil {
  8940. return nil, err
  8941. }
  8942. defer googleapi.CloseBody(res)
  8943. if err := googleapi.CheckResponse(res); err != nil {
  8944. return nil, err
  8945. }
  8946. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  8947. if rx != nil {
  8948. rx.Client = c.s.client
  8949. rx.UserAgent = c.s.userAgent()
  8950. ctx := c.ctx_
  8951. if ctx == nil {
  8952. ctx = context.TODO()
  8953. }
  8954. res, err = rx.Upload(ctx)
  8955. if err != nil {
  8956. return nil, err
  8957. }
  8958. defer res.Body.Close()
  8959. if err := googleapi.CheckResponse(res); err != nil {
  8960. return nil, err
  8961. }
  8962. }
  8963. ret := &Caption{
  8964. ServerResponse: googleapi.ServerResponse{
  8965. Header: res.Header,
  8966. HTTPStatusCode: res.StatusCode,
  8967. },
  8968. }
  8969. target := &ret
  8970. if err := gensupport.DecodeResponse(target, res); err != nil {
  8971. return nil, err
  8972. }
  8973. return ret, nil
  8974. // {
  8975. // "description": "Uploads a caption track.",
  8976. // "httpMethod": "POST",
  8977. // "id": "youtube.captions.insert",
  8978. // "mediaUpload": {
  8979. // "accept": [
  8980. // "*/*",
  8981. // "application/octet-stream",
  8982. // "text/xml"
  8983. // ],
  8984. // "maxSize": "100MB",
  8985. // "protocols": {
  8986. // "resumable": {
  8987. // "multipart": true,
  8988. // "path": "/resumable/upload/youtube/v3/captions"
  8989. // },
  8990. // "simple": {
  8991. // "multipart": true,
  8992. // "path": "/upload/youtube/v3/captions"
  8993. // }
  8994. // }
  8995. // },
  8996. // "parameterOrder": [
  8997. // "part"
  8998. // ],
  8999. // "parameters": {
  9000. // "onBehalfOf": {
  9001. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  9002. // "location": "query",
  9003. // "type": "string"
  9004. // },
  9005. // "onBehalfOfContentOwner": {
  9006. // "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.",
  9007. // "location": "query",
  9008. // "type": "string"
  9009. // },
  9010. // "part": {
  9011. // "description": "The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.",
  9012. // "location": "query",
  9013. // "required": true,
  9014. // "type": "string"
  9015. // },
  9016. // "sync": {
  9017. // "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.",
  9018. // "location": "query",
  9019. // "type": "boolean"
  9020. // }
  9021. // },
  9022. // "path": "captions",
  9023. // "request": {
  9024. // "$ref": "Caption"
  9025. // },
  9026. // "response": {
  9027. // "$ref": "Caption"
  9028. // },
  9029. // "scopes": [
  9030. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9031. // "https://www.googleapis.com/auth/youtubepartner"
  9032. // ],
  9033. // "supportsMediaUpload": true
  9034. // }
  9035. }
  9036. // method id "youtube.captions.list":
  9037. type CaptionsListCall struct {
  9038. s *Service
  9039. urlParams_ gensupport.URLParams
  9040. ifNoneMatch_ string
  9041. ctx_ context.Context
  9042. header_ http.Header
  9043. }
  9044. // List: Returns a list of caption tracks that are associated with a
  9045. // specified video. Note that the API response does not contain the
  9046. // actual captions and that the captions.download method provides the
  9047. // ability to retrieve a caption track.
  9048. func (r *CaptionsService) List(part string, videoId string) *CaptionsListCall {
  9049. c := &CaptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9050. c.urlParams_.Set("part", part)
  9051. c.urlParams_.Set("videoId", videoId)
  9052. return c
  9053. }
  9054. // Id sets the optional parameter "id": The id parameter specifies a
  9055. // comma-separated list of IDs that identify the caption resources that
  9056. // should be retrieved. Each ID must identify a caption track associated
  9057. // with the specified video.
  9058. func (c *CaptionsListCall) Id(id string) *CaptionsListCall {
  9059. c.urlParams_.Set("id", id)
  9060. return c
  9061. }
  9062. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  9063. // Google+ Page for the channel that the request is on behalf of.
  9064. func (c *CaptionsListCall) OnBehalfOf(onBehalfOf string) *CaptionsListCall {
  9065. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  9066. return c
  9067. }
  9068. // OnBehalfOfContentOwner sets the optional parameter
  9069. // "onBehalfOfContentOwner": Note: This parameter is intended
  9070. // exclusively for YouTube content partners.
  9071. //
  9072. // The onBehalfOfContentOwner parameter indicates that the request's
  9073. // authorization credentials identify a YouTube CMS user who is acting
  9074. // on behalf of the content owner specified in the parameter value. This
  9075. // parameter is intended for YouTube content partners that own and
  9076. // manage many different YouTube channels. It allows content owners to
  9077. // authenticate once and get access to all their video and channel data,
  9078. // without having to provide authentication credentials for each
  9079. // individual channel. The actual CMS account that the user
  9080. // authenticates with must be linked to the specified YouTube content
  9081. // owner.
  9082. func (c *CaptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsListCall {
  9083. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9084. return c
  9085. }
  9086. // Fields allows partial responses to be retrieved. See
  9087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9088. // for more information.
  9089. func (c *CaptionsListCall) Fields(s ...googleapi.Field) *CaptionsListCall {
  9090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9091. return c
  9092. }
  9093. // IfNoneMatch sets the optional parameter which makes the operation
  9094. // fail if the object's ETag matches the given value. This is useful for
  9095. // getting updates only after the object has changed since the last
  9096. // request. Use googleapi.IsNotModified to check whether the response
  9097. // error from Do is the result of In-None-Match.
  9098. func (c *CaptionsListCall) IfNoneMatch(entityTag string) *CaptionsListCall {
  9099. c.ifNoneMatch_ = entityTag
  9100. return c
  9101. }
  9102. // Context sets the context to be used in this call's Do method. Any
  9103. // pending HTTP request will be aborted if the provided context is
  9104. // canceled.
  9105. func (c *CaptionsListCall) Context(ctx context.Context) *CaptionsListCall {
  9106. c.ctx_ = ctx
  9107. return c
  9108. }
  9109. // Header returns an http.Header that can be modified by the caller to
  9110. // add HTTP headers to the request.
  9111. func (c *CaptionsListCall) Header() http.Header {
  9112. if c.header_ == nil {
  9113. c.header_ = make(http.Header)
  9114. }
  9115. return c.header_
  9116. }
  9117. func (c *CaptionsListCall) doRequest(alt string) (*http.Response, error) {
  9118. reqHeaders := make(http.Header)
  9119. for k, v := range c.header_ {
  9120. reqHeaders[k] = v
  9121. }
  9122. reqHeaders.Set("User-Agent", c.s.userAgent())
  9123. if c.ifNoneMatch_ != "" {
  9124. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9125. }
  9126. var body io.Reader = nil
  9127. c.urlParams_.Set("alt", alt)
  9128. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  9129. urls += "?" + c.urlParams_.Encode()
  9130. req, _ := http.NewRequest("GET", urls, body)
  9131. req.Header = reqHeaders
  9132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9133. }
  9134. // Do executes the "youtube.captions.list" call.
  9135. // Exactly one of *CaptionListResponse or error will be non-nil. Any
  9136. // non-2xx status code is an error. Response headers are in either
  9137. // *CaptionListResponse.ServerResponse.Header or (if a response was
  9138. // returned at all) in error.(*googleapi.Error).Header. Use
  9139. // googleapi.IsNotModified to check whether the returned error was
  9140. // because http.StatusNotModified was returned.
  9141. func (c *CaptionsListCall) Do(opts ...googleapi.CallOption) (*CaptionListResponse, error) {
  9142. gensupport.SetOptions(c.urlParams_, opts...)
  9143. res, err := c.doRequest("json")
  9144. if res != nil && res.StatusCode == http.StatusNotModified {
  9145. if res.Body != nil {
  9146. res.Body.Close()
  9147. }
  9148. return nil, &googleapi.Error{
  9149. Code: res.StatusCode,
  9150. Header: res.Header,
  9151. }
  9152. }
  9153. if err != nil {
  9154. return nil, err
  9155. }
  9156. defer googleapi.CloseBody(res)
  9157. if err := googleapi.CheckResponse(res); err != nil {
  9158. return nil, err
  9159. }
  9160. ret := &CaptionListResponse{
  9161. ServerResponse: googleapi.ServerResponse{
  9162. Header: res.Header,
  9163. HTTPStatusCode: res.StatusCode,
  9164. },
  9165. }
  9166. target := &ret
  9167. if err := gensupport.DecodeResponse(target, res); err != nil {
  9168. return nil, err
  9169. }
  9170. return ret, nil
  9171. // {
  9172. // "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.",
  9173. // "httpMethod": "GET",
  9174. // "id": "youtube.captions.list",
  9175. // "parameterOrder": [
  9176. // "part",
  9177. // "videoId"
  9178. // ],
  9179. // "parameters": {
  9180. // "id": {
  9181. // "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.",
  9182. // "location": "query",
  9183. // "type": "string"
  9184. // },
  9185. // "onBehalfOf": {
  9186. // "description": "ID of the Google+ Page for the channel that the request is on behalf of.",
  9187. // "location": "query",
  9188. // "type": "string"
  9189. // },
  9190. // "onBehalfOfContentOwner": {
  9191. // "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.",
  9192. // "location": "query",
  9193. // "type": "string"
  9194. // },
  9195. // "part": {
  9196. // "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.",
  9197. // "location": "query",
  9198. // "required": true,
  9199. // "type": "string"
  9200. // },
  9201. // "videoId": {
  9202. // "description": "The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.",
  9203. // "location": "query",
  9204. // "required": true,
  9205. // "type": "string"
  9206. // }
  9207. // },
  9208. // "path": "captions",
  9209. // "response": {
  9210. // "$ref": "CaptionListResponse"
  9211. // },
  9212. // "scopes": [
  9213. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9214. // "https://www.googleapis.com/auth/youtubepartner"
  9215. // ]
  9216. // }
  9217. }
  9218. // method id "youtube.captions.update":
  9219. type CaptionsUpdateCall struct {
  9220. s *Service
  9221. caption *Caption
  9222. urlParams_ gensupport.URLParams
  9223. mediaInfo_ *gensupport.MediaInfo
  9224. ctx_ context.Context
  9225. header_ http.Header
  9226. }
  9227. // Update: Updates a caption track. When updating a caption track, you
  9228. // can change the track's draft status, upload a new caption file for
  9229. // the track, or both.
  9230. func (r *CaptionsService) Update(part string, caption *Caption) *CaptionsUpdateCall {
  9231. c := &CaptionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9232. c.urlParams_.Set("part", part)
  9233. c.caption = caption
  9234. return c
  9235. }
  9236. // OnBehalfOf sets the optional parameter "onBehalfOf": ID of the
  9237. // Google+ Page for the channel that the request is be on behalf of
  9238. func (c *CaptionsUpdateCall) OnBehalfOf(onBehalfOf string) *CaptionsUpdateCall {
  9239. c.urlParams_.Set("onBehalfOf", onBehalfOf)
  9240. return c
  9241. }
  9242. // OnBehalfOfContentOwner sets the optional parameter
  9243. // "onBehalfOfContentOwner": Note: This parameter is intended
  9244. // exclusively for YouTube content partners.
  9245. //
  9246. // The onBehalfOfContentOwner parameter indicates that the request's
  9247. // authorization credentials identify a YouTube CMS user who is acting
  9248. // on behalf of the content owner specified in the parameter value. This
  9249. // parameter is intended for YouTube content partners that own and
  9250. // manage many different YouTube channels. It allows content owners to
  9251. // authenticate once and get access to all their video and channel data,
  9252. // without having to provide authentication credentials for each
  9253. // individual channel. The actual CMS account that the user
  9254. // authenticates with must be linked to the specified YouTube content
  9255. // owner.
  9256. func (c *CaptionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *CaptionsUpdateCall {
  9257. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9258. return c
  9259. }
  9260. // Sync sets the optional parameter "sync": Note: The API server only
  9261. // processes the parameter value if the request contains an updated
  9262. // caption file.
  9263. //
  9264. // The sync parameter indicates whether YouTube should automatically
  9265. // synchronize the caption file with the audio track of the video. If
  9266. // you set the value to true, YouTube will automatically synchronize the
  9267. // caption track with the audio track.
  9268. func (c *CaptionsUpdateCall) Sync(sync bool) *CaptionsUpdateCall {
  9269. c.urlParams_.Set("sync", fmt.Sprint(sync))
  9270. return c
  9271. }
  9272. // Media specifies the media to upload in one or more chunks. The chunk
  9273. // size may be controlled by supplying a MediaOption generated by
  9274. // googleapi.ChunkSize. The chunk size defaults to
  9275. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  9276. // upload request will be determined by sniffing the contents of r,
  9277. // unless a MediaOption generated by googleapi.ContentType is
  9278. // supplied.
  9279. // At most one of Media and ResumableMedia may be set.
  9280. func (c *CaptionsUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *CaptionsUpdateCall {
  9281. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  9282. return c
  9283. }
  9284. // ResumableMedia specifies the media to upload in chunks and can be
  9285. // canceled with ctx.
  9286. //
  9287. // Deprecated: use Media instead.
  9288. //
  9289. // At most one of Media and ResumableMedia may be set. mediaType
  9290. // identifies the MIME media type of the upload, such as "image/png". If
  9291. // mediaType is "", it will be auto-detected. The provided ctx will
  9292. // supersede any context previously provided to the Context method.
  9293. func (c *CaptionsUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CaptionsUpdateCall {
  9294. c.ctx_ = ctx
  9295. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  9296. return c
  9297. }
  9298. // ProgressUpdater provides a callback function that will be called
  9299. // after every chunk. It should be a low-latency function in order to
  9300. // not slow down the upload operation. This should only be called when
  9301. // using ResumableMedia (as opposed to Media).
  9302. func (c *CaptionsUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CaptionsUpdateCall {
  9303. c.mediaInfo_.SetProgressUpdater(pu)
  9304. return c
  9305. }
  9306. // Fields allows partial responses to be retrieved. See
  9307. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9308. // for more information.
  9309. func (c *CaptionsUpdateCall) Fields(s ...googleapi.Field) *CaptionsUpdateCall {
  9310. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9311. return c
  9312. }
  9313. // Context sets the context to be used in this call's Do method. Any
  9314. // pending HTTP request will be aborted if the provided context is
  9315. // canceled.
  9316. // This context will supersede any context previously provided to the
  9317. // ResumableMedia method.
  9318. func (c *CaptionsUpdateCall) Context(ctx context.Context) *CaptionsUpdateCall {
  9319. c.ctx_ = ctx
  9320. return c
  9321. }
  9322. // Header returns an http.Header that can be modified by the caller to
  9323. // add HTTP headers to the request.
  9324. func (c *CaptionsUpdateCall) Header() http.Header {
  9325. if c.header_ == nil {
  9326. c.header_ = make(http.Header)
  9327. }
  9328. return c.header_
  9329. }
  9330. func (c *CaptionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  9331. reqHeaders := make(http.Header)
  9332. for k, v := range c.header_ {
  9333. reqHeaders[k] = v
  9334. }
  9335. reqHeaders.Set("User-Agent", c.s.userAgent())
  9336. var body io.Reader = nil
  9337. body, err := googleapi.WithoutDataWrapper.JSONReader(c.caption)
  9338. if err != nil {
  9339. return nil, err
  9340. }
  9341. reqHeaders.Set("Content-Type", "application/json")
  9342. c.urlParams_.Set("alt", alt)
  9343. urls := googleapi.ResolveRelative(c.s.BasePath, "captions")
  9344. if c.mediaInfo_ != nil {
  9345. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  9346. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  9347. }
  9348. if body == nil {
  9349. body = new(bytes.Buffer)
  9350. reqHeaders.Set("Content-Type", "application/json")
  9351. }
  9352. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  9353. defer cleanup()
  9354. urls += "?" + c.urlParams_.Encode()
  9355. req, _ := http.NewRequest("PUT", urls, body)
  9356. req.Header = reqHeaders
  9357. gensupport.SetGetBody(req, getBody)
  9358. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9359. }
  9360. // Do executes the "youtube.captions.update" call.
  9361. // Exactly one of *Caption or error will be non-nil. Any non-2xx status
  9362. // code is an error. Response headers are in either
  9363. // *Caption.ServerResponse.Header or (if a response was returned at all)
  9364. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9365. // check whether the returned error was because http.StatusNotModified
  9366. // was returned.
  9367. func (c *CaptionsUpdateCall) Do(opts ...googleapi.CallOption) (*Caption, error) {
  9368. gensupport.SetOptions(c.urlParams_, opts...)
  9369. res, err := c.doRequest("json")
  9370. if res != nil && res.StatusCode == http.StatusNotModified {
  9371. if res.Body != nil {
  9372. res.Body.Close()
  9373. }
  9374. return nil, &googleapi.Error{
  9375. Code: res.StatusCode,
  9376. Header: res.Header,
  9377. }
  9378. }
  9379. if err != nil {
  9380. return nil, err
  9381. }
  9382. defer googleapi.CloseBody(res)
  9383. if err := googleapi.CheckResponse(res); err != nil {
  9384. return nil, err
  9385. }
  9386. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  9387. if rx != nil {
  9388. rx.Client = c.s.client
  9389. rx.UserAgent = c.s.userAgent()
  9390. ctx := c.ctx_
  9391. if ctx == nil {
  9392. ctx = context.TODO()
  9393. }
  9394. res, err = rx.Upload(ctx)
  9395. if err != nil {
  9396. return nil, err
  9397. }
  9398. defer res.Body.Close()
  9399. if err := googleapi.CheckResponse(res); err != nil {
  9400. return nil, err
  9401. }
  9402. }
  9403. ret := &Caption{
  9404. ServerResponse: googleapi.ServerResponse{
  9405. Header: res.Header,
  9406. HTTPStatusCode: res.StatusCode,
  9407. },
  9408. }
  9409. target := &ret
  9410. if err := gensupport.DecodeResponse(target, res); err != nil {
  9411. return nil, err
  9412. }
  9413. return ret, nil
  9414. // {
  9415. // "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.",
  9416. // "httpMethod": "PUT",
  9417. // "id": "youtube.captions.update",
  9418. // "mediaUpload": {
  9419. // "accept": [
  9420. // "*/*",
  9421. // "application/octet-stream",
  9422. // "text/xml"
  9423. // ],
  9424. // "maxSize": "100MB",
  9425. // "protocols": {
  9426. // "resumable": {
  9427. // "multipart": true,
  9428. // "path": "/resumable/upload/youtube/v3/captions"
  9429. // },
  9430. // "simple": {
  9431. // "multipart": true,
  9432. // "path": "/upload/youtube/v3/captions"
  9433. // }
  9434. // }
  9435. // },
  9436. // "parameterOrder": [
  9437. // "part"
  9438. // ],
  9439. // "parameters": {
  9440. // "onBehalfOf": {
  9441. // "description": "ID of the Google+ Page for the channel that the request is be on behalf of",
  9442. // "location": "query",
  9443. // "type": "string"
  9444. // },
  9445. // "onBehalfOfContentOwner": {
  9446. // "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.",
  9447. // "location": "query",
  9448. // "type": "string"
  9449. // },
  9450. // "part": {
  9451. // "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.",
  9452. // "location": "query",
  9453. // "required": true,
  9454. // "type": "string"
  9455. // },
  9456. // "sync": {
  9457. // "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.",
  9458. // "location": "query",
  9459. // "type": "boolean"
  9460. // }
  9461. // },
  9462. // "path": "captions",
  9463. // "request": {
  9464. // "$ref": "Caption"
  9465. // },
  9466. // "response": {
  9467. // "$ref": "Caption"
  9468. // },
  9469. // "scopes": [
  9470. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9471. // "https://www.googleapis.com/auth/youtubepartner"
  9472. // ],
  9473. // "supportsMediaUpload": true
  9474. // }
  9475. }
  9476. // method id "youtube.channelBanners.insert":
  9477. type ChannelBannersInsertCall struct {
  9478. s *Service
  9479. channelbannerresource *ChannelBannerResource
  9480. urlParams_ gensupport.URLParams
  9481. mediaInfo_ *gensupport.MediaInfo
  9482. ctx_ context.Context
  9483. header_ http.Header
  9484. }
  9485. // Insert: Uploads a channel banner image to YouTube. This method
  9486. // represents the first two steps in a three-step process to update the
  9487. // banner image for a channel:
  9488. //
  9489. // - Call the channelBanners.insert method to upload the binary image
  9490. // data to YouTube. The image must have a 16:9 aspect ratio and be at
  9491. // least 2120x1192 pixels.
  9492. // - Extract the url property's value from the response that the API
  9493. // returns for step 1.
  9494. // - Call the channels.update method to update the channel's branding
  9495. // settings. Set the brandingSettings.image.bannerExternalUrl property's
  9496. // value to the URL obtained in step 2.
  9497. func (r *ChannelBannersService) Insert(channelbannerresource *ChannelBannerResource) *ChannelBannersInsertCall {
  9498. c := &ChannelBannersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9499. c.channelbannerresource = channelbannerresource
  9500. return c
  9501. }
  9502. // ChannelId sets the optional parameter "channelId": The channelId
  9503. // parameter identifies the YouTube channel to which the banner is
  9504. // uploaded. The channelId parameter was introduced as a required
  9505. // parameter in May 2017. As this was a backward-incompatible change,
  9506. // channelBanners.insert requests that do not specify this parameter
  9507. // will not return an error until six months have passed from the time
  9508. // that the parameter was introduced. Please see the API Terms of
  9509. // Service for the official policy regarding backward incompatible
  9510. // changes and the API revision history for the exact date that the
  9511. // parameter was introduced.
  9512. func (c *ChannelBannersInsertCall) ChannelId(channelId string) *ChannelBannersInsertCall {
  9513. c.urlParams_.Set("channelId", channelId)
  9514. return c
  9515. }
  9516. // OnBehalfOfContentOwner sets the optional parameter
  9517. // "onBehalfOfContentOwner": Note: This parameter is intended
  9518. // exclusively for YouTube content partners.
  9519. //
  9520. // The onBehalfOfContentOwner parameter indicates that the request's
  9521. // authorization credentials identify a YouTube CMS user who is acting
  9522. // on behalf of the content owner specified in the parameter value. This
  9523. // parameter is intended for YouTube content partners that own and
  9524. // manage many different YouTube channels. It allows content owners to
  9525. // authenticate once and get access to all their video and channel data,
  9526. // without having to provide authentication credentials for each
  9527. // individual channel. The CMS account that the user authenticates with
  9528. // must be linked to the specified YouTube content owner.
  9529. func (c *ChannelBannersInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelBannersInsertCall {
  9530. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9531. return c
  9532. }
  9533. // Media specifies the media to upload in one or more chunks. The chunk
  9534. // size may be controlled by supplying a MediaOption generated by
  9535. // googleapi.ChunkSize. The chunk size defaults to
  9536. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  9537. // upload request will be determined by sniffing the contents of r,
  9538. // unless a MediaOption generated by googleapi.ContentType is
  9539. // supplied.
  9540. // At most one of Media and ResumableMedia may be set.
  9541. func (c *ChannelBannersInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ChannelBannersInsertCall {
  9542. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  9543. return c
  9544. }
  9545. // ResumableMedia specifies the media to upload in chunks and can be
  9546. // canceled with ctx.
  9547. //
  9548. // Deprecated: use Media instead.
  9549. //
  9550. // At most one of Media and ResumableMedia may be set. mediaType
  9551. // identifies the MIME media type of the upload, such as "image/png". If
  9552. // mediaType is "", it will be auto-detected. The provided ctx will
  9553. // supersede any context previously provided to the Context method.
  9554. func (c *ChannelBannersInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ChannelBannersInsertCall {
  9555. c.ctx_ = ctx
  9556. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  9557. return c
  9558. }
  9559. // ProgressUpdater provides a callback function that will be called
  9560. // after every chunk. It should be a low-latency function in order to
  9561. // not slow down the upload operation. This should only be called when
  9562. // using ResumableMedia (as opposed to Media).
  9563. func (c *ChannelBannersInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ChannelBannersInsertCall {
  9564. c.mediaInfo_.SetProgressUpdater(pu)
  9565. return c
  9566. }
  9567. // Fields allows partial responses to be retrieved. See
  9568. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9569. // for more information.
  9570. func (c *ChannelBannersInsertCall) Fields(s ...googleapi.Field) *ChannelBannersInsertCall {
  9571. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9572. return c
  9573. }
  9574. // Context sets the context to be used in this call's Do method. Any
  9575. // pending HTTP request will be aborted if the provided context is
  9576. // canceled.
  9577. // This context will supersede any context previously provided to the
  9578. // ResumableMedia method.
  9579. func (c *ChannelBannersInsertCall) Context(ctx context.Context) *ChannelBannersInsertCall {
  9580. c.ctx_ = ctx
  9581. return c
  9582. }
  9583. // Header returns an http.Header that can be modified by the caller to
  9584. // add HTTP headers to the request.
  9585. func (c *ChannelBannersInsertCall) Header() http.Header {
  9586. if c.header_ == nil {
  9587. c.header_ = make(http.Header)
  9588. }
  9589. return c.header_
  9590. }
  9591. func (c *ChannelBannersInsertCall) doRequest(alt string) (*http.Response, error) {
  9592. reqHeaders := make(http.Header)
  9593. for k, v := range c.header_ {
  9594. reqHeaders[k] = v
  9595. }
  9596. reqHeaders.Set("User-Agent", c.s.userAgent())
  9597. var body io.Reader = nil
  9598. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelbannerresource)
  9599. if err != nil {
  9600. return nil, err
  9601. }
  9602. reqHeaders.Set("Content-Type", "application/json")
  9603. c.urlParams_.Set("alt", alt)
  9604. urls := googleapi.ResolveRelative(c.s.BasePath, "channelBanners/insert")
  9605. if c.mediaInfo_ != nil {
  9606. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  9607. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  9608. }
  9609. if body == nil {
  9610. body = new(bytes.Buffer)
  9611. reqHeaders.Set("Content-Type", "application/json")
  9612. }
  9613. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  9614. defer cleanup()
  9615. urls += "?" + c.urlParams_.Encode()
  9616. req, _ := http.NewRequest("POST", urls, body)
  9617. req.Header = reqHeaders
  9618. gensupport.SetGetBody(req, getBody)
  9619. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9620. }
  9621. // Do executes the "youtube.channelBanners.insert" call.
  9622. // Exactly one of *ChannelBannerResource or error will be non-nil. Any
  9623. // non-2xx status code is an error. Response headers are in either
  9624. // *ChannelBannerResource.ServerResponse.Header or (if a response was
  9625. // returned at all) in error.(*googleapi.Error).Header. Use
  9626. // googleapi.IsNotModified to check whether the returned error was
  9627. // because http.StatusNotModified was returned.
  9628. func (c *ChannelBannersInsertCall) Do(opts ...googleapi.CallOption) (*ChannelBannerResource, error) {
  9629. gensupport.SetOptions(c.urlParams_, opts...)
  9630. res, err := c.doRequest("json")
  9631. if res != nil && res.StatusCode == http.StatusNotModified {
  9632. if res.Body != nil {
  9633. res.Body.Close()
  9634. }
  9635. return nil, &googleapi.Error{
  9636. Code: res.StatusCode,
  9637. Header: res.Header,
  9638. }
  9639. }
  9640. if err != nil {
  9641. return nil, err
  9642. }
  9643. defer googleapi.CloseBody(res)
  9644. if err := googleapi.CheckResponse(res); err != nil {
  9645. return nil, err
  9646. }
  9647. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  9648. if rx != nil {
  9649. rx.Client = c.s.client
  9650. rx.UserAgent = c.s.userAgent()
  9651. ctx := c.ctx_
  9652. if ctx == nil {
  9653. ctx = context.TODO()
  9654. }
  9655. res, err = rx.Upload(ctx)
  9656. if err != nil {
  9657. return nil, err
  9658. }
  9659. defer res.Body.Close()
  9660. if err := googleapi.CheckResponse(res); err != nil {
  9661. return nil, err
  9662. }
  9663. }
  9664. ret := &ChannelBannerResource{
  9665. ServerResponse: googleapi.ServerResponse{
  9666. Header: res.Header,
  9667. HTTPStatusCode: res.StatusCode,
  9668. },
  9669. }
  9670. target := &ret
  9671. if err := gensupport.DecodeResponse(target, res); err != nil {
  9672. return nil, err
  9673. }
  9674. return ret, nil
  9675. // {
  9676. // "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.",
  9677. // "httpMethod": "POST",
  9678. // "id": "youtube.channelBanners.insert",
  9679. // "mediaUpload": {
  9680. // "accept": [
  9681. // "application/octet-stream",
  9682. // "image/jpeg",
  9683. // "image/png"
  9684. // ],
  9685. // "maxSize": "6MB",
  9686. // "protocols": {
  9687. // "resumable": {
  9688. // "multipart": true,
  9689. // "path": "/resumable/upload/youtube/v3/channelBanners/insert"
  9690. // },
  9691. // "simple": {
  9692. // "multipart": true,
  9693. // "path": "/upload/youtube/v3/channelBanners/insert"
  9694. // }
  9695. // }
  9696. // },
  9697. // "parameters": {
  9698. // "channelId": {
  9699. // "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.",
  9700. // "location": "query",
  9701. // "type": "string"
  9702. // },
  9703. // "onBehalfOfContentOwner": {
  9704. // "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.",
  9705. // "location": "query",
  9706. // "type": "string"
  9707. // }
  9708. // },
  9709. // "path": "channelBanners/insert",
  9710. // "request": {
  9711. // "$ref": "ChannelBannerResource"
  9712. // },
  9713. // "response": {
  9714. // "$ref": "ChannelBannerResource"
  9715. // },
  9716. // "scopes": [
  9717. // "https://www.googleapis.com/auth/youtube",
  9718. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9719. // "https://www.googleapis.com/auth/youtube.upload"
  9720. // ],
  9721. // "supportsMediaUpload": true
  9722. // }
  9723. }
  9724. // method id "youtube.channelSections.delete":
  9725. type ChannelSectionsDeleteCall struct {
  9726. s *Service
  9727. urlParams_ gensupport.URLParams
  9728. ctx_ context.Context
  9729. header_ http.Header
  9730. }
  9731. // Delete: Deletes a channelSection.
  9732. func (r *ChannelSectionsService) Delete(id string) *ChannelSectionsDeleteCall {
  9733. c := &ChannelSectionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9734. c.urlParams_.Set("id", id)
  9735. return c
  9736. }
  9737. // OnBehalfOfContentOwner sets the optional parameter
  9738. // "onBehalfOfContentOwner": Note: This parameter is intended
  9739. // exclusively for YouTube content partners.
  9740. //
  9741. // The onBehalfOfContentOwner parameter indicates that the request's
  9742. // authorization credentials identify a YouTube CMS user who is acting
  9743. // on behalf of the content owner specified in the parameter value. This
  9744. // parameter is intended for YouTube content partners that own and
  9745. // manage many different YouTube channels. It allows content owners to
  9746. // authenticate once and get access to all their video and channel data,
  9747. // without having to provide authentication credentials for each
  9748. // individual channel. The CMS account that the user authenticates with
  9749. // must be linked to the specified YouTube content owner.
  9750. func (c *ChannelSectionsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsDeleteCall {
  9751. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9752. return c
  9753. }
  9754. // Fields allows partial responses to be retrieved. See
  9755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9756. // for more information.
  9757. func (c *ChannelSectionsDeleteCall) Fields(s ...googleapi.Field) *ChannelSectionsDeleteCall {
  9758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9759. return c
  9760. }
  9761. // Context sets the context to be used in this call's Do method. Any
  9762. // pending HTTP request will be aborted if the provided context is
  9763. // canceled.
  9764. func (c *ChannelSectionsDeleteCall) Context(ctx context.Context) *ChannelSectionsDeleteCall {
  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 *ChannelSectionsDeleteCall) Header() http.Header {
  9771. if c.header_ == nil {
  9772. c.header_ = make(http.Header)
  9773. }
  9774. return c.header_
  9775. }
  9776. func (c *ChannelSectionsDeleteCall) 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. c.urlParams_.Set("alt", alt)
  9784. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  9785. urls += "?" + c.urlParams_.Encode()
  9786. req, _ := http.NewRequest("DELETE", urls, body)
  9787. req.Header = reqHeaders
  9788. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9789. }
  9790. // Do executes the "youtube.channelSections.delete" call.
  9791. func (c *ChannelSectionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  9792. gensupport.SetOptions(c.urlParams_, opts...)
  9793. res, err := c.doRequest("json")
  9794. if err != nil {
  9795. return err
  9796. }
  9797. defer googleapi.CloseBody(res)
  9798. if err := googleapi.CheckResponse(res); err != nil {
  9799. return err
  9800. }
  9801. return nil
  9802. // {
  9803. // "description": "Deletes a channelSection.",
  9804. // "httpMethod": "DELETE",
  9805. // "id": "youtube.channelSections.delete",
  9806. // "parameterOrder": [
  9807. // "id"
  9808. // ],
  9809. // "parameters": {
  9810. // "id": {
  9811. // "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.",
  9812. // "location": "query",
  9813. // "required": true,
  9814. // "type": "string"
  9815. // },
  9816. // "onBehalfOfContentOwner": {
  9817. // "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.",
  9818. // "location": "query",
  9819. // "type": "string"
  9820. // }
  9821. // },
  9822. // "path": "channelSections",
  9823. // "scopes": [
  9824. // "https://www.googleapis.com/auth/youtube",
  9825. // "https://www.googleapis.com/auth/youtube.force-ssl",
  9826. // "https://www.googleapis.com/auth/youtubepartner"
  9827. // ]
  9828. // }
  9829. }
  9830. // method id "youtube.channelSections.insert":
  9831. type ChannelSectionsInsertCall struct {
  9832. s *Service
  9833. channelsection *ChannelSection
  9834. urlParams_ gensupport.URLParams
  9835. ctx_ context.Context
  9836. header_ http.Header
  9837. }
  9838. // Insert: Adds a channelSection for the authenticated user's channel.
  9839. func (r *ChannelSectionsService) Insert(part string, channelsection *ChannelSection) *ChannelSectionsInsertCall {
  9840. c := &ChannelSectionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9841. c.urlParams_.Set("part", part)
  9842. c.channelsection = channelsection
  9843. return c
  9844. }
  9845. // OnBehalfOfContentOwner sets the optional parameter
  9846. // "onBehalfOfContentOwner": Note: This parameter is intended
  9847. // exclusively for YouTube content partners.
  9848. //
  9849. // The onBehalfOfContentOwner parameter indicates that the request's
  9850. // authorization credentials identify a YouTube CMS user who is acting
  9851. // on behalf of the content owner specified in the parameter value. This
  9852. // parameter is intended for YouTube content partners that own and
  9853. // manage many different YouTube channels. It allows content owners to
  9854. // authenticate once and get access to all their video and channel data,
  9855. // without having to provide authentication credentials for each
  9856. // individual channel. The CMS account that the user authenticates with
  9857. // must be linked to the specified YouTube content owner.
  9858. func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsInsertCall {
  9859. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  9860. return c
  9861. }
  9862. // OnBehalfOfContentOwnerChannel sets the optional parameter
  9863. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  9864. // properly authorized request. Note: This parameter is intended
  9865. // exclusively for YouTube content partners.
  9866. //
  9867. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  9868. // channel ID of the channel to which a video is being added. This
  9869. // parameter is required when a request specifies a value for the
  9870. // onBehalfOfContentOwner parameter, and it can only be used in
  9871. // conjunction with that parameter. In addition, the request must be
  9872. // authorized using a CMS account that is linked to the content owner
  9873. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  9874. // channel that the onBehalfOfContentOwnerChannel parameter value
  9875. // specifies must be linked to the content owner that the
  9876. // onBehalfOfContentOwner parameter specifies.
  9877. //
  9878. // This parameter is intended for YouTube content partners that own and
  9879. // manage many different YouTube channels. It allows content owners to
  9880. // authenticate once and perform actions on behalf of the channel
  9881. // specified in the parameter value, without having to provide
  9882. // authentication credentials for each separate channel.
  9883. func (c *ChannelSectionsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *ChannelSectionsInsertCall {
  9884. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  9885. return c
  9886. }
  9887. // Fields allows partial responses to be retrieved. See
  9888. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9889. // for more information.
  9890. func (c *ChannelSectionsInsertCall) Fields(s ...googleapi.Field) *ChannelSectionsInsertCall {
  9891. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9892. return c
  9893. }
  9894. // Context sets the context to be used in this call's Do method. Any
  9895. // pending HTTP request will be aborted if the provided context is
  9896. // canceled.
  9897. func (c *ChannelSectionsInsertCall) Context(ctx context.Context) *ChannelSectionsInsertCall {
  9898. c.ctx_ = ctx
  9899. return c
  9900. }
  9901. // Header returns an http.Header that can be modified by the caller to
  9902. // add HTTP headers to the request.
  9903. func (c *ChannelSectionsInsertCall) Header() http.Header {
  9904. if c.header_ == nil {
  9905. c.header_ = make(http.Header)
  9906. }
  9907. return c.header_
  9908. }
  9909. func (c *ChannelSectionsInsertCall) doRequest(alt string) (*http.Response, error) {
  9910. reqHeaders := make(http.Header)
  9911. for k, v := range c.header_ {
  9912. reqHeaders[k] = v
  9913. }
  9914. reqHeaders.Set("User-Agent", c.s.userAgent())
  9915. var body io.Reader = nil
  9916. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection)
  9917. if err != nil {
  9918. return nil, err
  9919. }
  9920. reqHeaders.Set("Content-Type", "application/json")
  9921. c.urlParams_.Set("alt", alt)
  9922. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  9923. urls += "?" + c.urlParams_.Encode()
  9924. req, _ := http.NewRequest("POST", urls, body)
  9925. req.Header = reqHeaders
  9926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9927. }
  9928. // Do executes the "youtube.channelSections.insert" call.
  9929. // Exactly one of *ChannelSection or error will be non-nil. Any non-2xx
  9930. // status code is an error. Response headers are in either
  9931. // *ChannelSection.ServerResponse.Header or (if a response was returned
  9932. // at all) in error.(*googleapi.Error).Header. Use
  9933. // googleapi.IsNotModified to check whether the returned error was
  9934. // because http.StatusNotModified was returned.
  9935. func (c *ChannelSectionsInsertCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
  9936. gensupport.SetOptions(c.urlParams_, opts...)
  9937. res, err := c.doRequest("json")
  9938. if res != nil && res.StatusCode == http.StatusNotModified {
  9939. if res.Body != nil {
  9940. res.Body.Close()
  9941. }
  9942. return nil, &googleapi.Error{
  9943. Code: res.StatusCode,
  9944. Header: res.Header,
  9945. }
  9946. }
  9947. if err != nil {
  9948. return nil, err
  9949. }
  9950. defer googleapi.CloseBody(res)
  9951. if err := googleapi.CheckResponse(res); err != nil {
  9952. return nil, err
  9953. }
  9954. ret := &ChannelSection{
  9955. ServerResponse: googleapi.ServerResponse{
  9956. Header: res.Header,
  9957. HTTPStatusCode: res.StatusCode,
  9958. },
  9959. }
  9960. target := &ret
  9961. if err := gensupport.DecodeResponse(target, res); err != nil {
  9962. return nil, err
  9963. }
  9964. return ret, nil
  9965. // {
  9966. // "description": "Adds a channelSection for the authenticated user's channel.",
  9967. // "httpMethod": "POST",
  9968. // "id": "youtube.channelSections.insert",
  9969. // "parameterOrder": [
  9970. // "part"
  9971. // ],
  9972. // "parameters": {
  9973. // "onBehalfOfContentOwner": {
  9974. // "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.",
  9975. // "location": "query",
  9976. // "type": "string"
  9977. // },
  9978. // "onBehalfOfContentOwnerChannel": {
  9979. // "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.",
  9980. // "location": "query",
  9981. // "type": "string"
  9982. // },
  9983. // "part": {
  9984. // "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.",
  9985. // "location": "query",
  9986. // "required": true,
  9987. // "type": "string"
  9988. // }
  9989. // },
  9990. // "path": "channelSections",
  9991. // "request": {
  9992. // "$ref": "ChannelSection"
  9993. // },
  9994. // "response": {
  9995. // "$ref": "ChannelSection"
  9996. // },
  9997. // "scopes": [
  9998. // "https://www.googleapis.com/auth/youtube",
  9999. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10000. // "https://www.googleapis.com/auth/youtubepartner"
  10001. // ]
  10002. // }
  10003. }
  10004. // method id "youtube.channelSections.list":
  10005. type ChannelSectionsListCall struct {
  10006. s *Service
  10007. urlParams_ gensupport.URLParams
  10008. ifNoneMatch_ string
  10009. ctx_ context.Context
  10010. header_ http.Header
  10011. }
  10012. // List: Returns channelSection resources that match the API request
  10013. // criteria.
  10014. func (r *ChannelSectionsService) List(part string) *ChannelSectionsListCall {
  10015. c := &ChannelSectionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10016. c.urlParams_.Set("part", part)
  10017. return c
  10018. }
  10019. // ChannelId sets the optional parameter "channelId": The channelId
  10020. // parameter specifies a YouTube channel ID. The API will only return
  10021. // that channel's channelSections.
  10022. func (c *ChannelSectionsListCall) ChannelId(channelId string) *ChannelSectionsListCall {
  10023. c.urlParams_.Set("channelId", channelId)
  10024. return c
  10025. }
  10026. // Hl sets the optional parameter "hl": The hl parameter indicates that
  10027. // the snippet.localized property values in the returned channelSection
  10028. // resources should be in the specified language if localized values for
  10029. // that language are available. For example, if the API request
  10030. // specifies hl=de, the snippet.localized properties in the API response
  10031. // will contain German titles if German titles are available. Channel
  10032. // owners can provide localized channel section titles using either the
  10033. // channelSections.insert or channelSections.update method.
  10034. func (c *ChannelSectionsListCall) Hl(hl string) *ChannelSectionsListCall {
  10035. c.urlParams_.Set("hl", hl)
  10036. return c
  10037. }
  10038. // Id sets the optional parameter "id": The id parameter specifies a
  10039. // comma-separated list of the YouTube channelSection ID(s) for the
  10040. // resource(s) that are being retrieved. In a channelSection resource,
  10041. // the id property specifies the YouTube channelSection ID.
  10042. func (c *ChannelSectionsListCall) Id(id string) *ChannelSectionsListCall {
  10043. c.urlParams_.Set("id", id)
  10044. return c
  10045. }
  10046. // Mine sets the optional parameter "mine": Set this parameter's value
  10047. // to true to retrieve a feed of the authenticated user's
  10048. // channelSections.
  10049. func (c *ChannelSectionsListCall) Mine(mine bool) *ChannelSectionsListCall {
  10050. c.urlParams_.Set("mine", fmt.Sprint(mine))
  10051. return c
  10052. }
  10053. // OnBehalfOfContentOwner sets the optional parameter
  10054. // "onBehalfOfContentOwner": Note: This parameter is intended
  10055. // exclusively for YouTube content partners.
  10056. //
  10057. // The onBehalfOfContentOwner parameter indicates that the request's
  10058. // authorization credentials identify a YouTube CMS user who is acting
  10059. // on behalf of the content owner specified in the parameter value. This
  10060. // parameter is intended for YouTube content partners that own and
  10061. // manage many different YouTube channels. It allows content owners to
  10062. // authenticate once and get access to all their video and channel data,
  10063. // without having to provide authentication credentials for each
  10064. // individual channel. The CMS account that the user authenticates with
  10065. // must be linked to the specified YouTube content owner.
  10066. func (c *ChannelSectionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsListCall {
  10067. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10068. return c
  10069. }
  10070. // Fields allows partial responses to be retrieved. See
  10071. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10072. // for more information.
  10073. func (c *ChannelSectionsListCall) Fields(s ...googleapi.Field) *ChannelSectionsListCall {
  10074. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10075. return c
  10076. }
  10077. // IfNoneMatch sets the optional parameter which makes the operation
  10078. // fail if the object's ETag matches the given value. This is useful for
  10079. // getting updates only after the object has changed since the last
  10080. // request. Use googleapi.IsNotModified to check whether the response
  10081. // error from Do is the result of In-None-Match.
  10082. func (c *ChannelSectionsListCall) IfNoneMatch(entityTag string) *ChannelSectionsListCall {
  10083. c.ifNoneMatch_ = entityTag
  10084. return c
  10085. }
  10086. // Context sets the context to be used in this call's Do method. Any
  10087. // pending HTTP request will be aborted if the provided context is
  10088. // canceled.
  10089. func (c *ChannelSectionsListCall) Context(ctx context.Context) *ChannelSectionsListCall {
  10090. c.ctx_ = ctx
  10091. return c
  10092. }
  10093. // Header returns an http.Header that can be modified by the caller to
  10094. // add HTTP headers to the request.
  10095. func (c *ChannelSectionsListCall) Header() http.Header {
  10096. if c.header_ == nil {
  10097. c.header_ = make(http.Header)
  10098. }
  10099. return c.header_
  10100. }
  10101. func (c *ChannelSectionsListCall) doRequest(alt string) (*http.Response, error) {
  10102. reqHeaders := make(http.Header)
  10103. for k, v := range c.header_ {
  10104. reqHeaders[k] = v
  10105. }
  10106. reqHeaders.Set("User-Agent", c.s.userAgent())
  10107. if c.ifNoneMatch_ != "" {
  10108. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10109. }
  10110. var body io.Reader = nil
  10111. c.urlParams_.Set("alt", alt)
  10112. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  10113. urls += "?" + c.urlParams_.Encode()
  10114. req, _ := http.NewRequest("GET", urls, body)
  10115. req.Header = reqHeaders
  10116. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10117. }
  10118. // Do executes the "youtube.channelSections.list" call.
  10119. // Exactly one of *ChannelSectionListResponse or error will be non-nil.
  10120. // Any non-2xx status code is an error. Response headers are in either
  10121. // *ChannelSectionListResponse.ServerResponse.Header or (if a response
  10122. // was returned at all) in error.(*googleapi.Error).Header. Use
  10123. // googleapi.IsNotModified to check whether the returned error was
  10124. // because http.StatusNotModified was returned.
  10125. func (c *ChannelSectionsListCall) Do(opts ...googleapi.CallOption) (*ChannelSectionListResponse, error) {
  10126. gensupport.SetOptions(c.urlParams_, opts...)
  10127. res, err := c.doRequest("json")
  10128. if res != nil && res.StatusCode == http.StatusNotModified {
  10129. if res.Body != nil {
  10130. res.Body.Close()
  10131. }
  10132. return nil, &googleapi.Error{
  10133. Code: res.StatusCode,
  10134. Header: res.Header,
  10135. }
  10136. }
  10137. if err != nil {
  10138. return nil, err
  10139. }
  10140. defer googleapi.CloseBody(res)
  10141. if err := googleapi.CheckResponse(res); err != nil {
  10142. return nil, err
  10143. }
  10144. ret := &ChannelSectionListResponse{
  10145. ServerResponse: googleapi.ServerResponse{
  10146. Header: res.Header,
  10147. HTTPStatusCode: res.StatusCode,
  10148. },
  10149. }
  10150. target := &ret
  10151. if err := gensupport.DecodeResponse(target, res); err != nil {
  10152. return nil, err
  10153. }
  10154. return ret, nil
  10155. // {
  10156. // "description": "Returns channelSection resources that match the API request criteria.",
  10157. // "httpMethod": "GET",
  10158. // "id": "youtube.channelSections.list",
  10159. // "parameterOrder": [
  10160. // "part"
  10161. // ],
  10162. // "parameters": {
  10163. // "channelId": {
  10164. // "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's channelSections.",
  10165. // "location": "query",
  10166. // "type": "string"
  10167. // },
  10168. // "hl": {
  10169. // "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.",
  10170. // "location": "query",
  10171. // "type": "string"
  10172. // },
  10173. // "id": {
  10174. // "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.",
  10175. // "location": "query",
  10176. // "type": "string"
  10177. // },
  10178. // "mine": {
  10179. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's channelSections.",
  10180. // "location": "query",
  10181. // "type": "boolean"
  10182. // },
  10183. // "onBehalfOfContentOwner": {
  10184. // "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.",
  10185. // "location": "query",
  10186. // "type": "string"
  10187. // },
  10188. // "part": {
  10189. // "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.",
  10190. // "location": "query",
  10191. // "required": true,
  10192. // "type": "string"
  10193. // }
  10194. // },
  10195. // "path": "channelSections",
  10196. // "response": {
  10197. // "$ref": "ChannelSectionListResponse"
  10198. // },
  10199. // "scopes": [
  10200. // "https://www.googleapis.com/auth/youtube",
  10201. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10202. // "https://www.googleapis.com/auth/youtube.readonly",
  10203. // "https://www.googleapis.com/auth/youtubepartner"
  10204. // ]
  10205. // }
  10206. }
  10207. // method id "youtube.channelSections.update":
  10208. type ChannelSectionsUpdateCall struct {
  10209. s *Service
  10210. channelsection *ChannelSection
  10211. urlParams_ gensupport.URLParams
  10212. ctx_ context.Context
  10213. header_ http.Header
  10214. }
  10215. // Update: Update a channelSection.
  10216. func (r *ChannelSectionsService) Update(part string, channelsection *ChannelSection) *ChannelSectionsUpdateCall {
  10217. c := &ChannelSectionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10218. c.urlParams_.Set("part", part)
  10219. c.channelsection = channelsection
  10220. return c
  10221. }
  10222. // OnBehalfOfContentOwner sets the optional parameter
  10223. // "onBehalfOfContentOwner": Note: This parameter is intended
  10224. // exclusively for YouTube content partners.
  10225. //
  10226. // The onBehalfOfContentOwner parameter indicates that the request's
  10227. // authorization credentials identify a YouTube CMS user who is acting
  10228. // on behalf of the content owner specified in the parameter value. This
  10229. // parameter is intended for YouTube content partners that own and
  10230. // manage many different YouTube channels. It allows content owners to
  10231. // authenticate once and get access to all their video and channel data,
  10232. // without having to provide authentication credentials for each
  10233. // individual channel. The CMS account that the user authenticates with
  10234. // must be linked to the specified YouTube content owner.
  10235. func (c *ChannelSectionsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelSectionsUpdateCall {
  10236. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10237. return c
  10238. }
  10239. // Fields allows partial responses to be retrieved. See
  10240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10241. // for more information.
  10242. func (c *ChannelSectionsUpdateCall) Fields(s ...googleapi.Field) *ChannelSectionsUpdateCall {
  10243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10244. return c
  10245. }
  10246. // Context sets the context to be used in this call's Do method. Any
  10247. // pending HTTP request will be aborted if the provided context is
  10248. // canceled.
  10249. func (c *ChannelSectionsUpdateCall) Context(ctx context.Context) *ChannelSectionsUpdateCall {
  10250. c.ctx_ = ctx
  10251. return c
  10252. }
  10253. // Header returns an http.Header that can be modified by the caller to
  10254. // add HTTP headers to the request.
  10255. func (c *ChannelSectionsUpdateCall) Header() http.Header {
  10256. if c.header_ == nil {
  10257. c.header_ = make(http.Header)
  10258. }
  10259. return c.header_
  10260. }
  10261. func (c *ChannelSectionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10262. reqHeaders := make(http.Header)
  10263. for k, v := range c.header_ {
  10264. reqHeaders[k] = v
  10265. }
  10266. reqHeaders.Set("User-Agent", c.s.userAgent())
  10267. var body io.Reader = nil
  10268. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channelsection)
  10269. if err != nil {
  10270. return nil, err
  10271. }
  10272. reqHeaders.Set("Content-Type", "application/json")
  10273. c.urlParams_.Set("alt", alt)
  10274. urls := googleapi.ResolveRelative(c.s.BasePath, "channelSections")
  10275. urls += "?" + c.urlParams_.Encode()
  10276. req, _ := http.NewRequest("PUT", urls, body)
  10277. req.Header = reqHeaders
  10278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10279. }
  10280. // Do executes the "youtube.channelSections.update" call.
  10281. // Exactly one of *ChannelSection or error will be non-nil. Any non-2xx
  10282. // status code is an error. Response headers are in either
  10283. // *ChannelSection.ServerResponse.Header or (if a response was returned
  10284. // at all) in error.(*googleapi.Error).Header. Use
  10285. // googleapi.IsNotModified to check whether the returned error was
  10286. // because http.StatusNotModified was returned.
  10287. func (c *ChannelSectionsUpdateCall) Do(opts ...googleapi.CallOption) (*ChannelSection, error) {
  10288. gensupport.SetOptions(c.urlParams_, opts...)
  10289. res, err := c.doRequest("json")
  10290. if res != nil && res.StatusCode == http.StatusNotModified {
  10291. if res.Body != nil {
  10292. res.Body.Close()
  10293. }
  10294. return nil, &googleapi.Error{
  10295. Code: res.StatusCode,
  10296. Header: res.Header,
  10297. }
  10298. }
  10299. if err != nil {
  10300. return nil, err
  10301. }
  10302. defer googleapi.CloseBody(res)
  10303. if err := googleapi.CheckResponse(res); err != nil {
  10304. return nil, err
  10305. }
  10306. ret := &ChannelSection{
  10307. ServerResponse: googleapi.ServerResponse{
  10308. Header: res.Header,
  10309. HTTPStatusCode: res.StatusCode,
  10310. },
  10311. }
  10312. target := &ret
  10313. if err := gensupport.DecodeResponse(target, res); err != nil {
  10314. return nil, err
  10315. }
  10316. return ret, nil
  10317. // {
  10318. // "description": "Update a channelSection.",
  10319. // "httpMethod": "PUT",
  10320. // "id": "youtube.channelSections.update",
  10321. // "parameterOrder": [
  10322. // "part"
  10323. // ],
  10324. // "parameters": {
  10325. // "onBehalfOfContentOwner": {
  10326. // "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.",
  10327. // "location": "query",
  10328. // "type": "string"
  10329. // },
  10330. // "part": {
  10331. // "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.",
  10332. // "location": "query",
  10333. // "required": true,
  10334. // "type": "string"
  10335. // }
  10336. // },
  10337. // "path": "channelSections",
  10338. // "request": {
  10339. // "$ref": "ChannelSection"
  10340. // },
  10341. // "response": {
  10342. // "$ref": "ChannelSection"
  10343. // },
  10344. // "scopes": [
  10345. // "https://www.googleapis.com/auth/youtube",
  10346. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10347. // "https://www.googleapis.com/auth/youtubepartner"
  10348. // ]
  10349. // }
  10350. }
  10351. // method id "youtube.channels.list":
  10352. type ChannelsListCall struct {
  10353. s *Service
  10354. urlParams_ gensupport.URLParams
  10355. ifNoneMatch_ string
  10356. ctx_ context.Context
  10357. header_ http.Header
  10358. }
  10359. // List: Returns a collection of zero or more channel resources that
  10360. // match the request criteria.
  10361. func (r *ChannelsService) List(part string) *ChannelsListCall {
  10362. c := &ChannelsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10363. c.urlParams_.Set("part", part)
  10364. return c
  10365. }
  10366. // CategoryId sets the optional parameter "categoryId": The categoryId
  10367. // parameter specifies a YouTube guide category, thereby requesting
  10368. // YouTube channels associated with that category.
  10369. func (c *ChannelsListCall) CategoryId(categoryId string) *ChannelsListCall {
  10370. c.urlParams_.Set("categoryId", categoryId)
  10371. return c
  10372. }
  10373. // ForUsername sets the optional parameter "forUsername": The
  10374. // forUsername parameter specifies a YouTube username, thereby
  10375. // requesting the channel associated with that username.
  10376. func (c *ChannelsListCall) ForUsername(forUsername string) *ChannelsListCall {
  10377. c.urlParams_.Set("forUsername", forUsername)
  10378. return c
  10379. }
  10380. // Hl sets the optional parameter "hl": The hl parameter should be used
  10381. // for filter out the properties that are not in the given language.
  10382. // Used for the brandingSettings part.
  10383. func (c *ChannelsListCall) Hl(hl string) *ChannelsListCall {
  10384. c.urlParams_.Set("hl", hl)
  10385. return c
  10386. }
  10387. // Id sets the optional parameter "id": The id parameter specifies a
  10388. // comma-separated list of the YouTube channel ID(s) for the resource(s)
  10389. // that are being retrieved. In a channel resource, the id property
  10390. // specifies the channel's YouTube channel ID.
  10391. func (c *ChannelsListCall) Id(id string) *ChannelsListCall {
  10392. c.urlParams_.Set("id", id)
  10393. return c
  10394. }
  10395. // ManagedByMe sets the optional parameter "managedByMe": Note: This
  10396. // parameter is intended exclusively for YouTube content partners.
  10397. //
  10398. // Set this parameter's value to true to instruct the API to only return
  10399. // channels managed by the content owner that the onBehalfOfContentOwner
  10400. // parameter specifies. The user must be authenticated as a CMS account
  10401. // linked to the specified content owner and onBehalfOfContentOwner must
  10402. // be provided.
  10403. func (c *ChannelsListCall) ManagedByMe(managedByMe bool) *ChannelsListCall {
  10404. c.urlParams_.Set("managedByMe", fmt.Sprint(managedByMe))
  10405. return c
  10406. }
  10407. // MaxResults sets the optional parameter "maxResults": The maxResults
  10408. // parameter specifies the maximum number of items that should be
  10409. // returned in the result set.
  10410. func (c *ChannelsListCall) MaxResults(maxResults int64) *ChannelsListCall {
  10411. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10412. return c
  10413. }
  10414. // Mine sets the optional parameter "mine": Set this parameter's value
  10415. // to true to instruct the API to only return channels owned by the
  10416. // authenticated user.
  10417. func (c *ChannelsListCall) Mine(mine bool) *ChannelsListCall {
  10418. c.urlParams_.Set("mine", fmt.Sprint(mine))
  10419. return c
  10420. }
  10421. // MySubscribers sets the optional parameter "mySubscribers": Use the
  10422. // subscriptions.list method and its mySubscribers parameter to retrieve
  10423. // a list of subscribers to the authenticated user's channel.
  10424. func (c *ChannelsListCall) MySubscribers(mySubscribers bool) *ChannelsListCall {
  10425. c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
  10426. return c
  10427. }
  10428. // OnBehalfOfContentOwner sets the optional parameter
  10429. // "onBehalfOfContentOwner": Note: This parameter is intended
  10430. // exclusively for YouTube content partners.
  10431. //
  10432. // The onBehalfOfContentOwner parameter indicates that the request's
  10433. // authorization credentials identify a YouTube CMS user who is acting
  10434. // on behalf of the content owner specified in the parameter value. This
  10435. // parameter is intended for YouTube content partners that own and
  10436. // manage many different YouTube channels. It allows content owners to
  10437. // authenticate once and get access to all their video and channel data,
  10438. // without having to provide authentication credentials for each
  10439. // individual channel. The CMS account that the user authenticates with
  10440. // must be linked to the specified YouTube content owner.
  10441. func (c *ChannelsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsListCall {
  10442. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10443. return c
  10444. }
  10445. // PageToken sets the optional parameter "pageToken": The pageToken
  10446. // parameter identifies a specific page in the result set that should be
  10447. // returned. In an API response, the nextPageToken and prevPageToken
  10448. // properties identify other pages that could be retrieved.
  10449. func (c *ChannelsListCall) PageToken(pageToken string) *ChannelsListCall {
  10450. c.urlParams_.Set("pageToken", pageToken)
  10451. return c
  10452. }
  10453. // Fields allows partial responses to be retrieved. See
  10454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10455. // for more information.
  10456. func (c *ChannelsListCall) Fields(s ...googleapi.Field) *ChannelsListCall {
  10457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10458. return c
  10459. }
  10460. // IfNoneMatch sets the optional parameter which makes the operation
  10461. // fail if the object's ETag matches the given value. This is useful for
  10462. // getting updates only after the object has changed since the last
  10463. // request. Use googleapi.IsNotModified to check whether the response
  10464. // error from Do is the result of In-None-Match.
  10465. func (c *ChannelsListCall) IfNoneMatch(entityTag string) *ChannelsListCall {
  10466. c.ifNoneMatch_ = entityTag
  10467. return c
  10468. }
  10469. // Context sets the context to be used in this call's Do method. Any
  10470. // pending HTTP request will be aborted if the provided context is
  10471. // canceled.
  10472. func (c *ChannelsListCall) Context(ctx context.Context) *ChannelsListCall {
  10473. c.ctx_ = ctx
  10474. return c
  10475. }
  10476. // Header returns an http.Header that can be modified by the caller to
  10477. // add HTTP headers to the request.
  10478. func (c *ChannelsListCall) Header() http.Header {
  10479. if c.header_ == nil {
  10480. c.header_ = make(http.Header)
  10481. }
  10482. return c.header_
  10483. }
  10484. func (c *ChannelsListCall) doRequest(alt string) (*http.Response, error) {
  10485. reqHeaders := make(http.Header)
  10486. for k, v := range c.header_ {
  10487. reqHeaders[k] = v
  10488. }
  10489. reqHeaders.Set("User-Agent", c.s.userAgent())
  10490. if c.ifNoneMatch_ != "" {
  10491. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10492. }
  10493. var body io.Reader = nil
  10494. c.urlParams_.Set("alt", alt)
  10495. urls := googleapi.ResolveRelative(c.s.BasePath, "channels")
  10496. urls += "?" + c.urlParams_.Encode()
  10497. req, _ := http.NewRequest("GET", urls, body)
  10498. req.Header = reqHeaders
  10499. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10500. }
  10501. // Do executes the "youtube.channels.list" call.
  10502. // Exactly one of *ChannelListResponse or error will be non-nil. Any
  10503. // non-2xx status code is an error. Response headers are in either
  10504. // *ChannelListResponse.ServerResponse.Header or (if a response was
  10505. // returned at all) in error.(*googleapi.Error).Header. Use
  10506. // googleapi.IsNotModified to check whether the returned error was
  10507. // because http.StatusNotModified was returned.
  10508. func (c *ChannelsListCall) Do(opts ...googleapi.CallOption) (*ChannelListResponse, error) {
  10509. gensupport.SetOptions(c.urlParams_, opts...)
  10510. res, err := c.doRequest("json")
  10511. if res != nil && res.StatusCode == http.StatusNotModified {
  10512. if res.Body != nil {
  10513. res.Body.Close()
  10514. }
  10515. return nil, &googleapi.Error{
  10516. Code: res.StatusCode,
  10517. Header: res.Header,
  10518. }
  10519. }
  10520. if err != nil {
  10521. return nil, err
  10522. }
  10523. defer googleapi.CloseBody(res)
  10524. if err := googleapi.CheckResponse(res); err != nil {
  10525. return nil, err
  10526. }
  10527. ret := &ChannelListResponse{
  10528. ServerResponse: googleapi.ServerResponse{
  10529. Header: res.Header,
  10530. HTTPStatusCode: res.StatusCode,
  10531. },
  10532. }
  10533. target := &ret
  10534. if err := gensupport.DecodeResponse(target, res); err != nil {
  10535. return nil, err
  10536. }
  10537. return ret, nil
  10538. // {
  10539. // "description": "Returns a collection of zero or more channel resources that match the request criteria.",
  10540. // "httpMethod": "GET",
  10541. // "id": "youtube.channels.list",
  10542. // "parameterOrder": [
  10543. // "part"
  10544. // ],
  10545. // "parameters": {
  10546. // "categoryId": {
  10547. // "description": "The categoryId parameter specifies a YouTube guide category, thereby requesting YouTube channels associated with that category.",
  10548. // "location": "query",
  10549. // "type": "string"
  10550. // },
  10551. // "forUsername": {
  10552. // "description": "The forUsername parameter specifies a YouTube username, thereby requesting the channel associated with that username.",
  10553. // "location": "query",
  10554. // "type": "string"
  10555. // },
  10556. // "hl": {
  10557. // "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the brandingSettings part.",
  10558. // "location": "query",
  10559. // "type": "string"
  10560. // },
  10561. // "id": {
  10562. // "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.",
  10563. // "location": "query",
  10564. // "type": "string"
  10565. // },
  10566. // "managedByMe": {
  10567. // "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.",
  10568. // "location": "query",
  10569. // "type": "boolean"
  10570. // },
  10571. // "maxResults": {
  10572. // "default": "5",
  10573. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  10574. // "format": "uint32",
  10575. // "location": "query",
  10576. // "maximum": "50",
  10577. // "minimum": "0",
  10578. // "type": "integer"
  10579. // },
  10580. // "mine": {
  10581. // "description": "Set this parameter's value to true to instruct the API to only return channels owned by the authenticated user.",
  10582. // "location": "query",
  10583. // "type": "boolean"
  10584. // },
  10585. // "mySubscribers": {
  10586. // "description": "Use the subscriptions.list method and its mySubscribers parameter to retrieve a list of subscribers to the authenticated user's channel.",
  10587. // "location": "query",
  10588. // "type": "boolean"
  10589. // },
  10590. // "onBehalfOfContentOwner": {
  10591. // "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.",
  10592. // "location": "query",
  10593. // "type": "string"
  10594. // },
  10595. // "pageToken": {
  10596. // "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.",
  10597. // "location": "query",
  10598. // "type": "string"
  10599. // },
  10600. // "part": {
  10601. // "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.",
  10602. // "location": "query",
  10603. // "required": true,
  10604. // "type": "string"
  10605. // }
  10606. // },
  10607. // "path": "channels",
  10608. // "response": {
  10609. // "$ref": "ChannelListResponse"
  10610. // },
  10611. // "scopes": [
  10612. // "https://www.googleapis.com/auth/youtube",
  10613. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10614. // "https://www.googleapis.com/auth/youtube.readonly",
  10615. // "https://www.googleapis.com/auth/youtubepartner",
  10616. // "https://www.googleapis.com/auth/youtubepartner-channel-audit"
  10617. // ]
  10618. // }
  10619. }
  10620. // Pages invokes f for each page of results.
  10621. // A non-nil error returned from f will halt the iteration.
  10622. // The provided context supersedes any context provided to the Context method.
  10623. func (c *ChannelsListCall) Pages(ctx context.Context, f func(*ChannelListResponse) error) error {
  10624. c.ctx_ = ctx
  10625. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10626. for {
  10627. x, err := c.Do()
  10628. if err != nil {
  10629. return err
  10630. }
  10631. if err := f(x); err != nil {
  10632. return err
  10633. }
  10634. if x.NextPageToken == "" {
  10635. return nil
  10636. }
  10637. c.PageToken(x.NextPageToken)
  10638. }
  10639. }
  10640. // method id "youtube.channels.update":
  10641. type ChannelsUpdateCall struct {
  10642. s *Service
  10643. channel *Channel
  10644. urlParams_ gensupport.URLParams
  10645. ctx_ context.Context
  10646. header_ http.Header
  10647. }
  10648. // Update: Updates a channel's metadata. Note that this method currently
  10649. // only supports updates to the channel resource's brandingSettings and
  10650. // invideoPromotion objects and their child properties.
  10651. func (r *ChannelsService) Update(part string, channel *Channel) *ChannelsUpdateCall {
  10652. c := &ChannelsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10653. c.urlParams_.Set("part", part)
  10654. c.channel = channel
  10655. return c
  10656. }
  10657. // OnBehalfOfContentOwner sets the optional parameter
  10658. // "onBehalfOfContentOwner": The onBehalfOfContentOwner parameter
  10659. // indicates that the authenticated user is acting on behalf of the
  10660. // content owner specified in the parameter value. This parameter is
  10661. // intended for YouTube content partners that own and manage many
  10662. // different YouTube channels. It allows content owners to authenticate
  10663. // once and get access to all their video and channel data, without
  10664. // having to provide authentication credentials for each individual
  10665. // channel. The actual CMS account that the user authenticates with
  10666. // needs to be linked to the specified YouTube content owner.
  10667. func (c *ChannelsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ChannelsUpdateCall {
  10668. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  10669. return c
  10670. }
  10671. // Fields allows partial responses to be retrieved. See
  10672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10673. // for more information.
  10674. func (c *ChannelsUpdateCall) Fields(s ...googleapi.Field) *ChannelsUpdateCall {
  10675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10676. return c
  10677. }
  10678. // Context sets the context to be used in this call's Do method. Any
  10679. // pending HTTP request will be aborted if the provided context is
  10680. // canceled.
  10681. func (c *ChannelsUpdateCall) Context(ctx context.Context) *ChannelsUpdateCall {
  10682. c.ctx_ = ctx
  10683. return c
  10684. }
  10685. // Header returns an http.Header that can be modified by the caller to
  10686. // add HTTP headers to the request.
  10687. func (c *ChannelsUpdateCall) Header() http.Header {
  10688. if c.header_ == nil {
  10689. c.header_ = make(http.Header)
  10690. }
  10691. return c.header_
  10692. }
  10693. func (c *ChannelsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10694. reqHeaders := make(http.Header)
  10695. for k, v := range c.header_ {
  10696. reqHeaders[k] = v
  10697. }
  10698. reqHeaders.Set("User-Agent", c.s.userAgent())
  10699. var body io.Reader = nil
  10700. body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  10701. if err != nil {
  10702. return nil, err
  10703. }
  10704. reqHeaders.Set("Content-Type", "application/json")
  10705. c.urlParams_.Set("alt", alt)
  10706. urls := googleapi.ResolveRelative(c.s.BasePath, "channels")
  10707. urls += "?" + c.urlParams_.Encode()
  10708. req, _ := http.NewRequest("PUT", urls, body)
  10709. req.Header = reqHeaders
  10710. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10711. }
  10712. // Do executes the "youtube.channels.update" call.
  10713. // Exactly one of *Channel or error will be non-nil. Any non-2xx status
  10714. // code is an error. Response headers are in either
  10715. // *Channel.ServerResponse.Header or (if a response was returned at all)
  10716. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10717. // check whether the returned error was because http.StatusNotModified
  10718. // was returned.
  10719. func (c *ChannelsUpdateCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  10720. gensupport.SetOptions(c.urlParams_, opts...)
  10721. res, err := c.doRequest("json")
  10722. if res != nil && res.StatusCode == http.StatusNotModified {
  10723. if res.Body != nil {
  10724. res.Body.Close()
  10725. }
  10726. return nil, &googleapi.Error{
  10727. Code: res.StatusCode,
  10728. Header: res.Header,
  10729. }
  10730. }
  10731. if err != nil {
  10732. return nil, err
  10733. }
  10734. defer googleapi.CloseBody(res)
  10735. if err := googleapi.CheckResponse(res); err != nil {
  10736. return nil, err
  10737. }
  10738. ret := &Channel{
  10739. ServerResponse: googleapi.ServerResponse{
  10740. Header: res.Header,
  10741. HTTPStatusCode: res.StatusCode,
  10742. },
  10743. }
  10744. target := &ret
  10745. if err := gensupport.DecodeResponse(target, res); err != nil {
  10746. return nil, err
  10747. }
  10748. return ret, nil
  10749. // {
  10750. // "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.",
  10751. // "httpMethod": "PUT",
  10752. // "id": "youtube.channels.update",
  10753. // "parameterOrder": [
  10754. // "part"
  10755. // ],
  10756. // "parameters": {
  10757. // "onBehalfOfContentOwner": {
  10758. // "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.",
  10759. // "location": "query",
  10760. // "type": "string"
  10761. // },
  10762. // "part": {
  10763. // "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.",
  10764. // "location": "query",
  10765. // "required": true,
  10766. // "type": "string"
  10767. // }
  10768. // },
  10769. // "path": "channels",
  10770. // "request": {
  10771. // "$ref": "Channel"
  10772. // },
  10773. // "response": {
  10774. // "$ref": "Channel"
  10775. // },
  10776. // "scopes": [
  10777. // "https://www.googleapis.com/auth/youtube",
  10778. // "https://www.googleapis.com/auth/youtube.force-ssl",
  10779. // "https://www.googleapis.com/auth/youtubepartner"
  10780. // ]
  10781. // }
  10782. }
  10783. // method id "youtube.commentThreads.insert":
  10784. type CommentThreadsInsertCall struct {
  10785. s *Service
  10786. commentthread *CommentThread
  10787. urlParams_ gensupport.URLParams
  10788. ctx_ context.Context
  10789. header_ http.Header
  10790. }
  10791. // Insert: Creates a new top-level comment. To add a reply to an
  10792. // existing comment, use the comments.insert method instead.
  10793. func (r *CommentThreadsService) Insert(part string, commentthread *CommentThread) *CommentThreadsInsertCall {
  10794. c := &CommentThreadsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10795. c.urlParams_.Set("part", part)
  10796. c.commentthread = commentthread
  10797. return c
  10798. }
  10799. // Fields allows partial responses to be retrieved. See
  10800. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10801. // for more information.
  10802. func (c *CommentThreadsInsertCall) Fields(s ...googleapi.Field) *CommentThreadsInsertCall {
  10803. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10804. return c
  10805. }
  10806. // Context sets the context to be used in this call's Do method. Any
  10807. // pending HTTP request will be aborted if the provided context is
  10808. // canceled.
  10809. func (c *CommentThreadsInsertCall) Context(ctx context.Context) *CommentThreadsInsertCall {
  10810. c.ctx_ = ctx
  10811. return c
  10812. }
  10813. // Header returns an http.Header that can be modified by the caller to
  10814. // add HTTP headers to the request.
  10815. func (c *CommentThreadsInsertCall) Header() http.Header {
  10816. if c.header_ == nil {
  10817. c.header_ = make(http.Header)
  10818. }
  10819. return c.header_
  10820. }
  10821. func (c *CommentThreadsInsertCall) doRequest(alt string) (*http.Response, error) {
  10822. reqHeaders := make(http.Header)
  10823. for k, v := range c.header_ {
  10824. reqHeaders[k] = v
  10825. }
  10826. reqHeaders.Set("User-Agent", c.s.userAgent())
  10827. var body io.Reader = nil
  10828. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread)
  10829. if err != nil {
  10830. return nil, err
  10831. }
  10832. reqHeaders.Set("Content-Type", "application/json")
  10833. c.urlParams_.Set("alt", alt)
  10834. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  10835. urls += "?" + c.urlParams_.Encode()
  10836. req, _ := http.NewRequest("POST", urls, body)
  10837. req.Header = reqHeaders
  10838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10839. }
  10840. // Do executes the "youtube.commentThreads.insert" call.
  10841. // Exactly one of *CommentThread or error will be non-nil. Any non-2xx
  10842. // status code is an error. Response headers are in either
  10843. // *CommentThread.ServerResponse.Header or (if a response was returned
  10844. // at all) in error.(*googleapi.Error).Header. Use
  10845. // googleapi.IsNotModified to check whether the returned error was
  10846. // because http.StatusNotModified was returned.
  10847. func (c *CommentThreadsInsertCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
  10848. gensupport.SetOptions(c.urlParams_, opts...)
  10849. res, err := c.doRequest("json")
  10850. if res != nil && res.StatusCode == http.StatusNotModified {
  10851. if res.Body != nil {
  10852. res.Body.Close()
  10853. }
  10854. return nil, &googleapi.Error{
  10855. Code: res.StatusCode,
  10856. Header: res.Header,
  10857. }
  10858. }
  10859. if err != nil {
  10860. return nil, err
  10861. }
  10862. defer googleapi.CloseBody(res)
  10863. if err := googleapi.CheckResponse(res); err != nil {
  10864. return nil, err
  10865. }
  10866. ret := &CommentThread{
  10867. ServerResponse: googleapi.ServerResponse{
  10868. Header: res.Header,
  10869. HTTPStatusCode: res.StatusCode,
  10870. },
  10871. }
  10872. target := &ret
  10873. if err := gensupport.DecodeResponse(target, res); err != nil {
  10874. return nil, err
  10875. }
  10876. return ret, nil
  10877. // {
  10878. // "description": "Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.",
  10879. // "httpMethod": "POST",
  10880. // "id": "youtube.commentThreads.insert",
  10881. // "parameterOrder": [
  10882. // "part"
  10883. // ],
  10884. // "parameters": {
  10885. // "part": {
  10886. // "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.",
  10887. // "location": "query",
  10888. // "required": true,
  10889. // "type": "string"
  10890. // }
  10891. // },
  10892. // "path": "commentThreads",
  10893. // "request": {
  10894. // "$ref": "CommentThread"
  10895. // },
  10896. // "response": {
  10897. // "$ref": "CommentThread"
  10898. // },
  10899. // "scopes": [
  10900. // "https://www.googleapis.com/auth/youtube.force-ssl"
  10901. // ]
  10902. // }
  10903. }
  10904. // method id "youtube.commentThreads.list":
  10905. type CommentThreadsListCall struct {
  10906. s *Service
  10907. urlParams_ gensupport.URLParams
  10908. ifNoneMatch_ string
  10909. ctx_ context.Context
  10910. header_ http.Header
  10911. }
  10912. // List: Returns a list of comment threads that match the API request
  10913. // parameters.
  10914. func (r *CommentThreadsService) List(part string) *CommentThreadsListCall {
  10915. c := &CommentThreadsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10916. c.urlParams_.Set("part", part)
  10917. return c
  10918. }
  10919. // AllThreadsRelatedToChannelId sets the optional parameter
  10920. // "allThreadsRelatedToChannelId": The allThreadsRelatedToChannelId
  10921. // parameter instructs the API to return all comment threads associated
  10922. // with the specified channel. The response can include comments about
  10923. // the channel or about the channel's videos.
  10924. func (c *CommentThreadsListCall) AllThreadsRelatedToChannelId(allThreadsRelatedToChannelId string) *CommentThreadsListCall {
  10925. c.urlParams_.Set("allThreadsRelatedToChannelId", allThreadsRelatedToChannelId)
  10926. return c
  10927. }
  10928. // ChannelId sets the optional parameter "channelId": The channelId
  10929. // parameter instructs the API to return comment threads containing
  10930. // comments about the specified channel. (The response will not include
  10931. // comments left on videos that the channel uploaded.)
  10932. func (c *CommentThreadsListCall) ChannelId(channelId string) *CommentThreadsListCall {
  10933. c.urlParams_.Set("channelId", channelId)
  10934. return c
  10935. }
  10936. // Id sets the optional parameter "id": The id parameter specifies a
  10937. // comma-separated list of comment thread IDs for the resources that
  10938. // should be retrieved.
  10939. func (c *CommentThreadsListCall) Id(id string) *CommentThreadsListCall {
  10940. c.urlParams_.Set("id", id)
  10941. return c
  10942. }
  10943. // MaxResults sets the optional parameter "maxResults": The maxResults
  10944. // parameter specifies the maximum number of items that should be
  10945. // returned in the result set.
  10946. //
  10947. // Note: This parameter is not supported for use in conjunction with the
  10948. // id parameter.
  10949. func (c *CommentThreadsListCall) MaxResults(maxResults int64) *CommentThreadsListCall {
  10950. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  10951. return c
  10952. }
  10953. // ModerationStatus sets the optional parameter "moderationStatus": Set
  10954. // this parameter to limit the returned comment threads to a particular
  10955. // moderation state.
  10956. //
  10957. // Note: This parameter is not supported for use in conjunction with the
  10958. // id parameter.
  10959. //
  10960. // Possible values:
  10961. // "heldForReview" - Retrieve comment threads that are awaiting review
  10962. // by a moderator. A comment thread can be included in the response if
  10963. // the top-level comment or at least one of the replies to that comment
  10964. // are awaiting review.
  10965. // "likelySpam" - Retrieve comment threads classified as likely to be
  10966. // spam. A comment thread can be included in the response if the
  10967. // top-level comment or at least one of the replies to that comment is
  10968. // considered likely to be spam.
  10969. // "published" - Retrieve threads of published comments. This is the
  10970. // default value. A comment thread can be included in the response if
  10971. // its top-level comment has been published.
  10972. func (c *CommentThreadsListCall) ModerationStatus(moderationStatus string) *CommentThreadsListCall {
  10973. c.urlParams_.Set("moderationStatus", moderationStatus)
  10974. return c
  10975. }
  10976. // Order sets the optional parameter "order": The order parameter
  10977. // specifies the order in which the API response should list comment
  10978. // threads. Valid values are:
  10979. // - time - Comment threads are ordered by time. This is the default
  10980. // behavior.
  10981. // - relevance - Comment threads are ordered by relevance.Note: This
  10982. // parameter is not supported for use in conjunction with the id
  10983. // parameter.
  10984. //
  10985. // Possible values:
  10986. // "relevance" - Order by relevance.
  10987. // "time" - Order by time.
  10988. func (c *CommentThreadsListCall) Order(order string) *CommentThreadsListCall {
  10989. c.urlParams_.Set("order", order)
  10990. return c
  10991. }
  10992. // PageToken sets the optional parameter "pageToken": The pageToken
  10993. // parameter identifies a specific page in the result set that should be
  10994. // returned. In an API response, the nextPageToken property identifies
  10995. // the next page of the result that can be retrieved.
  10996. //
  10997. // Note: This parameter is not supported for use in conjunction with the
  10998. // id parameter.
  10999. func (c *CommentThreadsListCall) PageToken(pageToken string) *CommentThreadsListCall {
  11000. c.urlParams_.Set("pageToken", pageToken)
  11001. return c
  11002. }
  11003. // SearchTerms sets the optional parameter "searchTerms": The
  11004. // searchTerms parameter instructs the API to limit the API response to
  11005. // only contain comments that contain the specified search terms.
  11006. //
  11007. // Note: This parameter is not supported for use in conjunction with the
  11008. // id parameter.
  11009. func (c *CommentThreadsListCall) SearchTerms(searchTerms string) *CommentThreadsListCall {
  11010. c.urlParams_.Set("searchTerms", searchTerms)
  11011. return c
  11012. }
  11013. // TextFormat sets the optional parameter "textFormat": Set this
  11014. // parameter's value to html or plainText to instruct the API to return
  11015. // the comments left by users in html formatted or in plain text.
  11016. //
  11017. // Possible values:
  11018. // "html" - Returns the comments in HTML format. This is the default
  11019. // value.
  11020. // "plainText" - Returns the comments in plain text format.
  11021. func (c *CommentThreadsListCall) TextFormat(textFormat string) *CommentThreadsListCall {
  11022. c.urlParams_.Set("textFormat", textFormat)
  11023. return c
  11024. }
  11025. // VideoId sets the optional parameter "videoId": The videoId parameter
  11026. // instructs the API to return comment threads associated with the
  11027. // specified video ID.
  11028. func (c *CommentThreadsListCall) VideoId(videoId string) *CommentThreadsListCall {
  11029. c.urlParams_.Set("videoId", videoId)
  11030. return c
  11031. }
  11032. // Fields allows partial responses to be retrieved. See
  11033. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11034. // for more information.
  11035. func (c *CommentThreadsListCall) Fields(s ...googleapi.Field) *CommentThreadsListCall {
  11036. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11037. return c
  11038. }
  11039. // IfNoneMatch sets the optional parameter which makes the operation
  11040. // fail if the object's ETag matches the given value. This is useful for
  11041. // getting updates only after the object has changed since the last
  11042. // request. Use googleapi.IsNotModified to check whether the response
  11043. // error from Do is the result of In-None-Match.
  11044. func (c *CommentThreadsListCall) IfNoneMatch(entityTag string) *CommentThreadsListCall {
  11045. c.ifNoneMatch_ = entityTag
  11046. return c
  11047. }
  11048. // Context sets the context to be used in this call's Do method. Any
  11049. // pending HTTP request will be aborted if the provided context is
  11050. // canceled.
  11051. func (c *CommentThreadsListCall) Context(ctx context.Context) *CommentThreadsListCall {
  11052. c.ctx_ = ctx
  11053. return c
  11054. }
  11055. // Header returns an http.Header that can be modified by the caller to
  11056. // add HTTP headers to the request.
  11057. func (c *CommentThreadsListCall) Header() http.Header {
  11058. if c.header_ == nil {
  11059. c.header_ = make(http.Header)
  11060. }
  11061. return c.header_
  11062. }
  11063. func (c *CommentThreadsListCall) doRequest(alt string) (*http.Response, error) {
  11064. reqHeaders := make(http.Header)
  11065. for k, v := range c.header_ {
  11066. reqHeaders[k] = v
  11067. }
  11068. reqHeaders.Set("User-Agent", c.s.userAgent())
  11069. if c.ifNoneMatch_ != "" {
  11070. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11071. }
  11072. var body io.Reader = nil
  11073. c.urlParams_.Set("alt", alt)
  11074. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  11075. urls += "?" + c.urlParams_.Encode()
  11076. req, _ := http.NewRequest("GET", urls, body)
  11077. req.Header = reqHeaders
  11078. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11079. }
  11080. // Do executes the "youtube.commentThreads.list" call.
  11081. // Exactly one of *CommentThreadListResponse or error will be non-nil.
  11082. // Any non-2xx status code is an error. Response headers are in either
  11083. // *CommentThreadListResponse.ServerResponse.Header or (if a response
  11084. // was returned at all) in error.(*googleapi.Error).Header. Use
  11085. // googleapi.IsNotModified to check whether the returned error was
  11086. // because http.StatusNotModified was returned.
  11087. func (c *CommentThreadsListCall) Do(opts ...googleapi.CallOption) (*CommentThreadListResponse, error) {
  11088. gensupport.SetOptions(c.urlParams_, opts...)
  11089. res, err := c.doRequest("json")
  11090. if res != nil && res.StatusCode == http.StatusNotModified {
  11091. if res.Body != nil {
  11092. res.Body.Close()
  11093. }
  11094. return nil, &googleapi.Error{
  11095. Code: res.StatusCode,
  11096. Header: res.Header,
  11097. }
  11098. }
  11099. if err != nil {
  11100. return nil, err
  11101. }
  11102. defer googleapi.CloseBody(res)
  11103. if err := googleapi.CheckResponse(res); err != nil {
  11104. return nil, err
  11105. }
  11106. ret := &CommentThreadListResponse{
  11107. ServerResponse: googleapi.ServerResponse{
  11108. Header: res.Header,
  11109. HTTPStatusCode: res.StatusCode,
  11110. },
  11111. }
  11112. target := &ret
  11113. if err := gensupport.DecodeResponse(target, res); err != nil {
  11114. return nil, err
  11115. }
  11116. return ret, nil
  11117. // {
  11118. // "description": "Returns a list of comment threads that match the API request parameters.",
  11119. // "httpMethod": "GET",
  11120. // "id": "youtube.commentThreads.list",
  11121. // "parameterOrder": [
  11122. // "part"
  11123. // ],
  11124. // "parameters": {
  11125. // "allThreadsRelatedToChannelId": {
  11126. // "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.",
  11127. // "location": "query",
  11128. // "type": "string"
  11129. // },
  11130. // "channelId": {
  11131. // "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.)",
  11132. // "location": "query",
  11133. // "type": "string"
  11134. // },
  11135. // "id": {
  11136. // "description": "The id parameter specifies a comma-separated list of comment thread IDs for the resources that should be retrieved.",
  11137. // "location": "query",
  11138. // "type": "string"
  11139. // },
  11140. // "maxResults": {
  11141. // "default": "20",
  11142. // "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.",
  11143. // "format": "uint32",
  11144. // "location": "query",
  11145. // "maximum": "100",
  11146. // "minimum": "1",
  11147. // "type": "integer"
  11148. // },
  11149. // "moderationStatus": {
  11150. // "default": "MODERATION_STATUS_PUBLISHED",
  11151. // "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.",
  11152. // "enum": [
  11153. // "heldForReview",
  11154. // "likelySpam",
  11155. // "published"
  11156. // ],
  11157. // "enumDescriptions": [
  11158. // "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.",
  11159. // "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.",
  11160. // "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."
  11161. // ],
  11162. // "location": "query",
  11163. // "type": "string"
  11164. // },
  11165. // "order": {
  11166. // "default": "true",
  11167. // "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.",
  11168. // "enum": [
  11169. // "relevance",
  11170. // "time"
  11171. // ],
  11172. // "enumDescriptions": [
  11173. // "Order by relevance.",
  11174. // "Order by time."
  11175. // ],
  11176. // "location": "query",
  11177. // "type": "string"
  11178. // },
  11179. // "pageToken": {
  11180. // "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.",
  11181. // "location": "query",
  11182. // "type": "string"
  11183. // },
  11184. // "part": {
  11185. // "description": "The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.",
  11186. // "location": "query",
  11187. // "required": true,
  11188. // "type": "string"
  11189. // },
  11190. // "searchTerms": {
  11191. // "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.",
  11192. // "location": "query",
  11193. // "type": "string"
  11194. // },
  11195. // "textFormat": {
  11196. // "default": "FORMAT_HTML",
  11197. // "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.",
  11198. // "enum": [
  11199. // "html",
  11200. // "plainText"
  11201. // ],
  11202. // "enumDescriptions": [
  11203. // "Returns the comments in HTML format. This is the default value.",
  11204. // "Returns the comments in plain text format."
  11205. // ],
  11206. // "location": "query",
  11207. // "type": "string"
  11208. // },
  11209. // "videoId": {
  11210. // "description": "The videoId parameter instructs the API to return comment threads associated with the specified video ID.",
  11211. // "location": "query",
  11212. // "type": "string"
  11213. // }
  11214. // },
  11215. // "path": "commentThreads",
  11216. // "response": {
  11217. // "$ref": "CommentThreadListResponse"
  11218. // },
  11219. // "scopes": [
  11220. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11221. // ]
  11222. // }
  11223. }
  11224. // Pages invokes f for each page of results.
  11225. // A non-nil error returned from f will halt the iteration.
  11226. // The provided context supersedes any context provided to the Context method.
  11227. func (c *CommentThreadsListCall) Pages(ctx context.Context, f func(*CommentThreadListResponse) error) error {
  11228. c.ctx_ = ctx
  11229. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11230. for {
  11231. x, err := c.Do()
  11232. if err != nil {
  11233. return err
  11234. }
  11235. if err := f(x); err != nil {
  11236. return err
  11237. }
  11238. if x.NextPageToken == "" {
  11239. return nil
  11240. }
  11241. c.PageToken(x.NextPageToken)
  11242. }
  11243. }
  11244. // method id "youtube.commentThreads.update":
  11245. type CommentThreadsUpdateCall struct {
  11246. s *Service
  11247. commentthread *CommentThread
  11248. urlParams_ gensupport.URLParams
  11249. ctx_ context.Context
  11250. header_ http.Header
  11251. }
  11252. // Update: Modifies the top-level comment in a comment thread.
  11253. func (r *CommentThreadsService) Update(part string, commentthread *CommentThread) *CommentThreadsUpdateCall {
  11254. c := &CommentThreadsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11255. c.urlParams_.Set("part", part)
  11256. c.commentthread = commentthread
  11257. return c
  11258. }
  11259. // Fields allows partial responses to be retrieved. See
  11260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11261. // for more information.
  11262. func (c *CommentThreadsUpdateCall) Fields(s ...googleapi.Field) *CommentThreadsUpdateCall {
  11263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11264. return c
  11265. }
  11266. // Context sets the context to be used in this call's Do method. Any
  11267. // pending HTTP request will be aborted if the provided context is
  11268. // canceled.
  11269. func (c *CommentThreadsUpdateCall) Context(ctx context.Context) *CommentThreadsUpdateCall {
  11270. c.ctx_ = ctx
  11271. return c
  11272. }
  11273. // Header returns an http.Header that can be modified by the caller to
  11274. // add HTTP headers to the request.
  11275. func (c *CommentThreadsUpdateCall) Header() http.Header {
  11276. if c.header_ == nil {
  11277. c.header_ = make(http.Header)
  11278. }
  11279. return c.header_
  11280. }
  11281. func (c *CommentThreadsUpdateCall) doRequest(alt string) (*http.Response, error) {
  11282. reqHeaders := make(http.Header)
  11283. for k, v := range c.header_ {
  11284. reqHeaders[k] = v
  11285. }
  11286. reqHeaders.Set("User-Agent", c.s.userAgent())
  11287. var body io.Reader = nil
  11288. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentthread)
  11289. if err != nil {
  11290. return nil, err
  11291. }
  11292. reqHeaders.Set("Content-Type", "application/json")
  11293. c.urlParams_.Set("alt", alt)
  11294. urls := googleapi.ResolveRelative(c.s.BasePath, "commentThreads")
  11295. urls += "?" + c.urlParams_.Encode()
  11296. req, _ := http.NewRequest("PUT", urls, body)
  11297. req.Header = reqHeaders
  11298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11299. }
  11300. // Do executes the "youtube.commentThreads.update" call.
  11301. // Exactly one of *CommentThread or error will be non-nil. Any non-2xx
  11302. // status code is an error. Response headers are in either
  11303. // *CommentThread.ServerResponse.Header or (if a response was returned
  11304. // at all) in error.(*googleapi.Error).Header. Use
  11305. // googleapi.IsNotModified to check whether the returned error was
  11306. // because http.StatusNotModified was returned.
  11307. func (c *CommentThreadsUpdateCall) Do(opts ...googleapi.CallOption) (*CommentThread, error) {
  11308. gensupport.SetOptions(c.urlParams_, opts...)
  11309. res, err := c.doRequest("json")
  11310. if res != nil && res.StatusCode == http.StatusNotModified {
  11311. if res.Body != nil {
  11312. res.Body.Close()
  11313. }
  11314. return nil, &googleapi.Error{
  11315. Code: res.StatusCode,
  11316. Header: res.Header,
  11317. }
  11318. }
  11319. if err != nil {
  11320. return nil, err
  11321. }
  11322. defer googleapi.CloseBody(res)
  11323. if err := googleapi.CheckResponse(res); err != nil {
  11324. return nil, err
  11325. }
  11326. ret := &CommentThread{
  11327. ServerResponse: googleapi.ServerResponse{
  11328. Header: res.Header,
  11329. HTTPStatusCode: res.StatusCode,
  11330. },
  11331. }
  11332. target := &ret
  11333. if err := gensupport.DecodeResponse(target, res); err != nil {
  11334. return nil, err
  11335. }
  11336. return ret, nil
  11337. // {
  11338. // "description": "Modifies the top-level comment in a comment thread.",
  11339. // "httpMethod": "PUT",
  11340. // "id": "youtube.commentThreads.update",
  11341. // "parameterOrder": [
  11342. // "part"
  11343. // ],
  11344. // "parameters": {
  11345. // "part": {
  11346. // "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.",
  11347. // "location": "query",
  11348. // "required": true,
  11349. // "type": "string"
  11350. // }
  11351. // },
  11352. // "path": "commentThreads",
  11353. // "request": {
  11354. // "$ref": "CommentThread"
  11355. // },
  11356. // "response": {
  11357. // "$ref": "CommentThread"
  11358. // },
  11359. // "scopes": [
  11360. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11361. // ]
  11362. // }
  11363. }
  11364. // method id "youtube.comments.delete":
  11365. type CommentsDeleteCall struct {
  11366. s *Service
  11367. urlParams_ gensupport.URLParams
  11368. ctx_ context.Context
  11369. header_ http.Header
  11370. }
  11371. // Delete: Deletes a comment.
  11372. func (r *CommentsService) Delete(id string) *CommentsDeleteCall {
  11373. c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11374. c.urlParams_.Set("id", id)
  11375. return c
  11376. }
  11377. // Fields allows partial responses to be retrieved. See
  11378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11379. // for more information.
  11380. func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
  11381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11382. return c
  11383. }
  11384. // Context sets the context to be used in this call's Do method. Any
  11385. // pending HTTP request will be aborted if the provided context is
  11386. // canceled.
  11387. func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
  11388. c.ctx_ = ctx
  11389. return c
  11390. }
  11391. // Header returns an http.Header that can be modified by the caller to
  11392. // add HTTP headers to the request.
  11393. func (c *CommentsDeleteCall) Header() http.Header {
  11394. if c.header_ == nil {
  11395. c.header_ = make(http.Header)
  11396. }
  11397. return c.header_
  11398. }
  11399. func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  11400. reqHeaders := make(http.Header)
  11401. for k, v := range c.header_ {
  11402. reqHeaders[k] = v
  11403. }
  11404. reqHeaders.Set("User-Agent", c.s.userAgent())
  11405. var body io.Reader = nil
  11406. c.urlParams_.Set("alt", alt)
  11407. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  11408. urls += "?" + c.urlParams_.Encode()
  11409. req, _ := http.NewRequest("DELETE", urls, body)
  11410. req.Header = reqHeaders
  11411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11412. }
  11413. // Do executes the "youtube.comments.delete" call.
  11414. func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  11415. gensupport.SetOptions(c.urlParams_, opts...)
  11416. res, err := c.doRequest("json")
  11417. if err != nil {
  11418. return err
  11419. }
  11420. defer googleapi.CloseBody(res)
  11421. if err := googleapi.CheckResponse(res); err != nil {
  11422. return err
  11423. }
  11424. return nil
  11425. // {
  11426. // "description": "Deletes a comment.",
  11427. // "httpMethod": "DELETE",
  11428. // "id": "youtube.comments.delete",
  11429. // "parameterOrder": [
  11430. // "id"
  11431. // ],
  11432. // "parameters": {
  11433. // "id": {
  11434. // "description": "The id parameter specifies the comment ID for the resource that is being deleted.",
  11435. // "location": "query",
  11436. // "required": true,
  11437. // "type": "string"
  11438. // }
  11439. // },
  11440. // "path": "comments",
  11441. // "scopes": [
  11442. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11443. // ]
  11444. // }
  11445. }
  11446. // method id "youtube.comments.insert":
  11447. type CommentsInsertCall struct {
  11448. s *Service
  11449. comment *Comment
  11450. urlParams_ gensupport.URLParams
  11451. ctx_ context.Context
  11452. header_ http.Header
  11453. }
  11454. // Insert: Creates a reply to an existing comment. Note: To create a
  11455. // top-level comment, use the commentThreads.insert method.
  11456. func (r *CommentsService) Insert(part string, comment *Comment) *CommentsInsertCall {
  11457. c := &CommentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11458. c.urlParams_.Set("part", part)
  11459. c.comment = comment
  11460. return c
  11461. }
  11462. // Fields allows partial responses to be retrieved. See
  11463. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11464. // for more information.
  11465. func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall {
  11466. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11467. return c
  11468. }
  11469. // Context sets the context to be used in this call's Do method. Any
  11470. // pending HTTP request will be aborted if the provided context is
  11471. // canceled.
  11472. func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall {
  11473. c.ctx_ = ctx
  11474. return c
  11475. }
  11476. // Header returns an http.Header that can be modified by the caller to
  11477. // add HTTP headers to the request.
  11478. func (c *CommentsInsertCall) Header() http.Header {
  11479. if c.header_ == nil {
  11480. c.header_ = make(http.Header)
  11481. }
  11482. return c.header_
  11483. }
  11484. func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) {
  11485. reqHeaders := make(http.Header)
  11486. for k, v := range c.header_ {
  11487. reqHeaders[k] = v
  11488. }
  11489. reqHeaders.Set("User-Agent", c.s.userAgent())
  11490. var body io.Reader = nil
  11491. body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  11492. if err != nil {
  11493. return nil, err
  11494. }
  11495. reqHeaders.Set("Content-Type", "application/json")
  11496. c.urlParams_.Set("alt", alt)
  11497. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  11498. urls += "?" + c.urlParams_.Encode()
  11499. req, _ := http.NewRequest("POST", urls, body)
  11500. req.Header = reqHeaders
  11501. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11502. }
  11503. // Do executes the "youtube.comments.insert" call.
  11504. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  11505. // code is an error. Response headers are in either
  11506. // *Comment.ServerResponse.Header or (if a response was returned at all)
  11507. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11508. // check whether the returned error was because http.StatusNotModified
  11509. // was returned.
  11510. func (c *CommentsInsertCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  11511. gensupport.SetOptions(c.urlParams_, opts...)
  11512. res, err := c.doRequest("json")
  11513. if res != nil && res.StatusCode == http.StatusNotModified {
  11514. if res.Body != nil {
  11515. res.Body.Close()
  11516. }
  11517. return nil, &googleapi.Error{
  11518. Code: res.StatusCode,
  11519. Header: res.Header,
  11520. }
  11521. }
  11522. if err != nil {
  11523. return nil, err
  11524. }
  11525. defer googleapi.CloseBody(res)
  11526. if err := googleapi.CheckResponse(res); err != nil {
  11527. return nil, err
  11528. }
  11529. ret := &Comment{
  11530. ServerResponse: googleapi.ServerResponse{
  11531. Header: res.Header,
  11532. HTTPStatusCode: res.StatusCode,
  11533. },
  11534. }
  11535. target := &ret
  11536. if err := gensupport.DecodeResponse(target, res); err != nil {
  11537. return nil, err
  11538. }
  11539. return ret, nil
  11540. // {
  11541. // "description": "Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.",
  11542. // "httpMethod": "POST",
  11543. // "id": "youtube.comments.insert",
  11544. // "parameterOrder": [
  11545. // "part"
  11546. // ],
  11547. // "parameters": {
  11548. // "part": {
  11549. // "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.",
  11550. // "location": "query",
  11551. // "required": true,
  11552. // "type": "string"
  11553. // }
  11554. // },
  11555. // "path": "comments",
  11556. // "request": {
  11557. // "$ref": "Comment"
  11558. // },
  11559. // "response": {
  11560. // "$ref": "Comment"
  11561. // },
  11562. // "scopes": [
  11563. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11564. // ]
  11565. // }
  11566. }
  11567. // method id "youtube.comments.list":
  11568. type CommentsListCall struct {
  11569. s *Service
  11570. urlParams_ gensupport.URLParams
  11571. ifNoneMatch_ string
  11572. ctx_ context.Context
  11573. header_ http.Header
  11574. }
  11575. // List: Returns a list of comments that match the API request
  11576. // parameters.
  11577. func (r *CommentsService) List(part string) *CommentsListCall {
  11578. c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11579. c.urlParams_.Set("part", part)
  11580. return c
  11581. }
  11582. // Id sets the optional parameter "id": The id parameter specifies a
  11583. // comma-separated list of comment IDs for the resources that are being
  11584. // retrieved. In a comment resource, the id property specifies the
  11585. // comment's ID.
  11586. func (c *CommentsListCall) Id(id string) *CommentsListCall {
  11587. c.urlParams_.Set("id", id)
  11588. return c
  11589. }
  11590. // MaxResults sets the optional parameter "maxResults": The maxResults
  11591. // parameter specifies the maximum number of items that should be
  11592. // returned in the result set.
  11593. //
  11594. // Note: This parameter is not supported for use in conjunction with the
  11595. // id parameter.
  11596. func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall {
  11597. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  11598. return c
  11599. }
  11600. // PageToken sets the optional parameter "pageToken": The pageToken
  11601. // parameter identifies a specific page in the result set that should be
  11602. // returned. In an API response, the nextPageToken property identifies
  11603. // the next page of the result that can be retrieved.
  11604. //
  11605. // Note: This parameter is not supported for use in conjunction with the
  11606. // id parameter.
  11607. func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
  11608. c.urlParams_.Set("pageToken", pageToken)
  11609. return c
  11610. }
  11611. // ParentId sets the optional parameter "parentId": The parentId
  11612. // parameter specifies the ID of the comment for which replies should be
  11613. // retrieved.
  11614. //
  11615. // Note: YouTube currently supports replies only for top-level comments.
  11616. // However, replies to replies may be supported in the future.
  11617. func (c *CommentsListCall) ParentId(parentId string) *CommentsListCall {
  11618. c.urlParams_.Set("parentId", parentId)
  11619. return c
  11620. }
  11621. // TextFormat sets the optional parameter "textFormat": This parameter
  11622. // indicates whether the API should return comments formatted as HTML or
  11623. // as plain text.
  11624. //
  11625. // Possible values:
  11626. // "html" - Returns the comments in HTML format. This is the default
  11627. // value.
  11628. // "plainText" - Returns the comments in plain text format.
  11629. func (c *CommentsListCall) TextFormat(textFormat string) *CommentsListCall {
  11630. c.urlParams_.Set("textFormat", textFormat)
  11631. return c
  11632. }
  11633. // Fields allows partial responses to be retrieved. See
  11634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11635. // for more information.
  11636. func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
  11637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11638. return c
  11639. }
  11640. // IfNoneMatch sets the optional parameter which makes the operation
  11641. // fail if the object's ETag matches the given value. This is useful for
  11642. // getting updates only after the object has changed since the last
  11643. // request. Use googleapi.IsNotModified to check whether the response
  11644. // error from Do is the result of In-None-Match.
  11645. func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
  11646. c.ifNoneMatch_ = entityTag
  11647. return c
  11648. }
  11649. // Context sets the context to be used in this call's Do method. Any
  11650. // pending HTTP request will be aborted if the provided context is
  11651. // canceled.
  11652. func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
  11653. c.ctx_ = ctx
  11654. return c
  11655. }
  11656. // Header returns an http.Header that can be modified by the caller to
  11657. // add HTTP headers to the request.
  11658. func (c *CommentsListCall) Header() http.Header {
  11659. if c.header_ == nil {
  11660. c.header_ = make(http.Header)
  11661. }
  11662. return c.header_
  11663. }
  11664. func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
  11665. reqHeaders := make(http.Header)
  11666. for k, v := range c.header_ {
  11667. reqHeaders[k] = v
  11668. }
  11669. reqHeaders.Set("User-Agent", c.s.userAgent())
  11670. if c.ifNoneMatch_ != "" {
  11671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11672. }
  11673. var body io.Reader = nil
  11674. c.urlParams_.Set("alt", alt)
  11675. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  11676. urls += "?" + c.urlParams_.Encode()
  11677. req, _ := http.NewRequest("GET", urls, body)
  11678. req.Header = reqHeaders
  11679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11680. }
  11681. // Do executes the "youtube.comments.list" call.
  11682. // Exactly one of *CommentListResponse or error will be non-nil. Any
  11683. // non-2xx status code is an error. Response headers are in either
  11684. // *CommentListResponse.ServerResponse.Header or (if a response was
  11685. // returned at all) in error.(*googleapi.Error).Header. Use
  11686. // googleapi.IsNotModified to check whether the returned error was
  11687. // because http.StatusNotModified was returned.
  11688. func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentListResponse, error) {
  11689. gensupport.SetOptions(c.urlParams_, opts...)
  11690. res, err := c.doRequest("json")
  11691. if res != nil && res.StatusCode == http.StatusNotModified {
  11692. if res.Body != nil {
  11693. res.Body.Close()
  11694. }
  11695. return nil, &googleapi.Error{
  11696. Code: res.StatusCode,
  11697. Header: res.Header,
  11698. }
  11699. }
  11700. if err != nil {
  11701. return nil, err
  11702. }
  11703. defer googleapi.CloseBody(res)
  11704. if err := googleapi.CheckResponse(res); err != nil {
  11705. return nil, err
  11706. }
  11707. ret := &CommentListResponse{
  11708. ServerResponse: googleapi.ServerResponse{
  11709. Header: res.Header,
  11710. HTTPStatusCode: res.StatusCode,
  11711. },
  11712. }
  11713. target := &ret
  11714. if err := gensupport.DecodeResponse(target, res); err != nil {
  11715. return nil, err
  11716. }
  11717. return ret, nil
  11718. // {
  11719. // "description": "Returns a list of comments that match the API request parameters.",
  11720. // "httpMethod": "GET",
  11721. // "id": "youtube.comments.list",
  11722. // "parameterOrder": [
  11723. // "part"
  11724. // ],
  11725. // "parameters": {
  11726. // "id": {
  11727. // "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.",
  11728. // "location": "query",
  11729. // "type": "string"
  11730. // },
  11731. // "maxResults": {
  11732. // "default": "20",
  11733. // "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.",
  11734. // "format": "uint32",
  11735. // "location": "query",
  11736. // "maximum": "100",
  11737. // "minimum": "1",
  11738. // "type": "integer"
  11739. // },
  11740. // "pageToken": {
  11741. // "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.",
  11742. // "location": "query",
  11743. // "type": "string"
  11744. // },
  11745. // "parentId": {
  11746. // "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.",
  11747. // "location": "query",
  11748. // "type": "string"
  11749. // },
  11750. // "part": {
  11751. // "description": "The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.",
  11752. // "location": "query",
  11753. // "required": true,
  11754. // "type": "string"
  11755. // },
  11756. // "textFormat": {
  11757. // "default": "FORMAT_HTML",
  11758. // "description": "This parameter indicates whether the API should return comments formatted as HTML or as plain text.",
  11759. // "enum": [
  11760. // "html",
  11761. // "plainText"
  11762. // ],
  11763. // "enumDescriptions": [
  11764. // "Returns the comments in HTML format. This is the default value.",
  11765. // "Returns the comments in plain text format."
  11766. // ],
  11767. // "location": "query",
  11768. // "type": "string"
  11769. // }
  11770. // },
  11771. // "path": "comments",
  11772. // "response": {
  11773. // "$ref": "CommentListResponse"
  11774. // },
  11775. // "scopes": [
  11776. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11777. // ]
  11778. // }
  11779. }
  11780. // Pages invokes f for each page of results.
  11781. // A non-nil error returned from f will halt the iteration.
  11782. // The provided context supersedes any context provided to the Context method.
  11783. func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentListResponse) error) error {
  11784. c.ctx_ = ctx
  11785. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11786. for {
  11787. x, err := c.Do()
  11788. if err != nil {
  11789. return err
  11790. }
  11791. if err := f(x); err != nil {
  11792. return err
  11793. }
  11794. if x.NextPageToken == "" {
  11795. return nil
  11796. }
  11797. c.PageToken(x.NextPageToken)
  11798. }
  11799. }
  11800. // method id "youtube.comments.markAsSpam":
  11801. type CommentsMarkAsSpamCall struct {
  11802. s *Service
  11803. urlParams_ gensupport.URLParams
  11804. ctx_ context.Context
  11805. header_ http.Header
  11806. }
  11807. // MarkAsSpam: Expresses the caller's opinion that one or more comments
  11808. // should be flagged as spam.
  11809. func (r *CommentsService) MarkAsSpam(id string) *CommentsMarkAsSpamCall {
  11810. c := &CommentsMarkAsSpamCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11811. c.urlParams_.Set("id", id)
  11812. return c
  11813. }
  11814. // Fields allows partial responses to be retrieved. See
  11815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11816. // for more information.
  11817. func (c *CommentsMarkAsSpamCall) Fields(s ...googleapi.Field) *CommentsMarkAsSpamCall {
  11818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11819. return c
  11820. }
  11821. // Context sets the context to be used in this call's Do method. Any
  11822. // pending HTTP request will be aborted if the provided context is
  11823. // canceled.
  11824. func (c *CommentsMarkAsSpamCall) Context(ctx context.Context) *CommentsMarkAsSpamCall {
  11825. c.ctx_ = ctx
  11826. return c
  11827. }
  11828. // Header returns an http.Header that can be modified by the caller to
  11829. // add HTTP headers to the request.
  11830. func (c *CommentsMarkAsSpamCall) Header() http.Header {
  11831. if c.header_ == nil {
  11832. c.header_ = make(http.Header)
  11833. }
  11834. return c.header_
  11835. }
  11836. func (c *CommentsMarkAsSpamCall) doRequest(alt string) (*http.Response, error) {
  11837. reqHeaders := make(http.Header)
  11838. for k, v := range c.header_ {
  11839. reqHeaders[k] = v
  11840. }
  11841. reqHeaders.Set("User-Agent", c.s.userAgent())
  11842. var body io.Reader = nil
  11843. c.urlParams_.Set("alt", alt)
  11844. urls := googleapi.ResolveRelative(c.s.BasePath, "comments/markAsSpam")
  11845. urls += "?" + c.urlParams_.Encode()
  11846. req, _ := http.NewRequest("POST", urls, body)
  11847. req.Header = reqHeaders
  11848. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11849. }
  11850. // Do executes the "youtube.comments.markAsSpam" call.
  11851. func (c *CommentsMarkAsSpamCall) Do(opts ...googleapi.CallOption) error {
  11852. gensupport.SetOptions(c.urlParams_, opts...)
  11853. res, err := c.doRequest("json")
  11854. if err != nil {
  11855. return err
  11856. }
  11857. defer googleapi.CloseBody(res)
  11858. if err := googleapi.CheckResponse(res); err != nil {
  11859. return err
  11860. }
  11861. return nil
  11862. // {
  11863. // "description": "Expresses the caller's opinion that one or more comments should be flagged as spam.",
  11864. // "httpMethod": "POST",
  11865. // "id": "youtube.comments.markAsSpam",
  11866. // "parameterOrder": [
  11867. // "id"
  11868. // ],
  11869. // "parameters": {
  11870. // "id": {
  11871. // "description": "The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.",
  11872. // "location": "query",
  11873. // "required": true,
  11874. // "type": "string"
  11875. // }
  11876. // },
  11877. // "path": "comments/markAsSpam",
  11878. // "scopes": [
  11879. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11880. // ]
  11881. // }
  11882. }
  11883. // method id "youtube.comments.setModerationStatus":
  11884. type CommentsSetModerationStatusCall struct {
  11885. s *Service
  11886. urlParams_ gensupport.URLParams
  11887. ctx_ context.Context
  11888. header_ http.Header
  11889. }
  11890. // SetModerationStatus: Sets the moderation status of one or more
  11891. // comments. The API request must be authorized by the owner of the
  11892. // channel or video associated with the comments.
  11893. func (r *CommentsService) SetModerationStatus(id string, moderationStatus string) *CommentsSetModerationStatusCall {
  11894. c := &CommentsSetModerationStatusCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11895. c.urlParams_.Set("id", id)
  11896. c.urlParams_.Set("moderationStatus", moderationStatus)
  11897. return c
  11898. }
  11899. // BanAuthor sets the optional parameter "banAuthor": The banAuthor
  11900. // parameter lets you indicate that you want to automatically reject any
  11901. // additional comments written by the comment's author. Set the
  11902. // parameter value to true to ban the author.
  11903. //
  11904. // Note: This parameter is only valid if the moderationStatus parameter
  11905. // is also set to rejected.
  11906. func (c *CommentsSetModerationStatusCall) BanAuthor(banAuthor bool) *CommentsSetModerationStatusCall {
  11907. c.urlParams_.Set("banAuthor", fmt.Sprint(banAuthor))
  11908. return c
  11909. }
  11910. // Fields allows partial responses to be retrieved. See
  11911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11912. // for more information.
  11913. func (c *CommentsSetModerationStatusCall) Fields(s ...googleapi.Field) *CommentsSetModerationStatusCall {
  11914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11915. return c
  11916. }
  11917. // Context sets the context to be used in this call's Do method. Any
  11918. // pending HTTP request will be aborted if the provided context is
  11919. // canceled.
  11920. func (c *CommentsSetModerationStatusCall) Context(ctx context.Context) *CommentsSetModerationStatusCall {
  11921. c.ctx_ = ctx
  11922. return c
  11923. }
  11924. // Header returns an http.Header that can be modified by the caller to
  11925. // add HTTP headers to the request.
  11926. func (c *CommentsSetModerationStatusCall) Header() http.Header {
  11927. if c.header_ == nil {
  11928. c.header_ = make(http.Header)
  11929. }
  11930. return c.header_
  11931. }
  11932. func (c *CommentsSetModerationStatusCall) doRequest(alt string) (*http.Response, error) {
  11933. reqHeaders := make(http.Header)
  11934. for k, v := range c.header_ {
  11935. reqHeaders[k] = v
  11936. }
  11937. reqHeaders.Set("User-Agent", c.s.userAgent())
  11938. var body io.Reader = nil
  11939. c.urlParams_.Set("alt", alt)
  11940. urls := googleapi.ResolveRelative(c.s.BasePath, "comments/setModerationStatus")
  11941. urls += "?" + c.urlParams_.Encode()
  11942. req, _ := http.NewRequest("POST", urls, body)
  11943. req.Header = reqHeaders
  11944. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11945. }
  11946. // Do executes the "youtube.comments.setModerationStatus" call.
  11947. func (c *CommentsSetModerationStatusCall) Do(opts ...googleapi.CallOption) error {
  11948. gensupport.SetOptions(c.urlParams_, opts...)
  11949. res, err := c.doRequest("json")
  11950. if err != nil {
  11951. return err
  11952. }
  11953. defer googleapi.CloseBody(res)
  11954. if err := googleapi.CheckResponse(res); err != nil {
  11955. return err
  11956. }
  11957. return nil
  11958. // {
  11959. // "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.",
  11960. // "httpMethod": "POST",
  11961. // "id": "youtube.comments.setModerationStatus",
  11962. // "parameterOrder": [
  11963. // "id",
  11964. // "moderationStatus"
  11965. // ],
  11966. // "parameters": {
  11967. // "banAuthor": {
  11968. // "default": "false",
  11969. // "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.",
  11970. // "location": "query",
  11971. // "type": "boolean"
  11972. // },
  11973. // "id": {
  11974. // "description": "The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.",
  11975. // "location": "query",
  11976. // "required": true,
  11977. // "type": "string"
  11978. // },
  11979. // "moderationStatus": {
  11980. // "description": "Identifies the new moderation status of the specified comments.",
  11981. // "enum": [
  11982. // "heldForReview",
  11983. // "published",
  11984. // "rejected"
  11985. // ],
  11986. // "enumDescriptions": [
  11987. // "Marks a comment as awaiting review by a moderator.",
  11988. // "Clears a comment for public display.",
  11989. // "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."
  11990. // ],
  11991. // "location": "query",
  11992. // "required": true,
  11993. // "type": "string"
  11994. // }
  11995. // },
  11996. // "path": "comments/setModerationStatus",
  11997. // "scopes": [
  11998. // "https://www.googleapis.com/auth/youtube.force-ssl"
  11999. // ]
  12000. // }
  12001. }
  12002. // method id "youtube.comments.update":
  12003. type CommentsUpdateCall struct {
  12004. s *Service
  12005. comment *Comment
  12006. urlParams_ gensupport.URLParams
  12007. ctx_ context.Context
  12008. header_ http.Header
  12009. }
  12010. // Update: Modifies a comment.
  12011. func (r *CommentsService) Update(part string, comment *Comment) *CommentsUpdateCall {
  12012. c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12013. c.urlParams_.Set("part", part)
  12014. c.comment = comment
  12015. return c
  12016. }
  12017. // Fields allows partial responses to be retrieved. See
  12018. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12019. // for more information.
  12020. func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
  12021. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12022. return c
  12023. }
  12024. // Context sets the context to be used in this call's Do method. Any
  12025. // pending HTTP request will be aborted if the provided context is
  12026. // canceled.
  12027. func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
  12028. c.ctx_ = ctx
  12029. return c
  12030. }
  12031. // Header returns an http.Header that can be modified by the caller to
  12032. // add HTTP headers to the request.
  12033. func (c *CommentsUpdateCall) Header() http.Header {
  12034. if c.header_ == nil {
  12035. c.header_ = make(http.Header)
  12036. }
  12037. return c.header_
  12038. }
  12039. func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  12040. reqHeaders := make(http.Header)
  12041. for k, v := range c.header_ {
  12042. reqHeaders[k] = v
  12043. }
  12044. reqHeaders.Set("User-Agent", c.s.userAgent())
  12045. var body io.Reader = nil
  12046. body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  12047. if err != nil {
  12048. return nil, err
  12049. }
  12050. reqHeaders.Set("Content-Type", "application/json")
  12051. c.urlParams_.Set("alt", alt)
  12052. urls := googleapi.ResolveRelative(c.s.BasePath, "comments")
  12053. urls += "?" + c.urlParams_.Encode()
  12054. req, _ := http.NewRequest("PUT", urls, body)
  12055. req.Header = reqHeaders
  12056. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12057. }
  12058. // Do executes the "youtube.comments.update" call.
  12059. // Exactly one of *Comment or error will be non-nil. Any non-2xx status
  12060. // code is an error. Response headers are in either
  12061. // *Comment.ServerResponse.Header or (if a response was returned at all)
  12062. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  12063. // check whether the returned error was because http.StatusNotModified
  12064. // was returned.
  12065. func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  12066. gensupport.SetOptions(c.urlParams_, opts...)
  12067. res, err := c.doRequest("json")
  12068. if res != nil && res.StatusCode == http.StatusNotModified {
  12069. if res.Body != nil {
  12070. res.Body.Close()
  12071. }
  12072. return nil, &googleapi.Error{
  12073. Code: res.StatusCode,
  12074. Header: res.Header,
  12075. }
  12076. }
  12077. if err != nil {
  12078. return nil, err
  12079. }
  12080. defer googleapi.CloseBody(res)
  12081. if err := googleapi.CheckResponse(res); err != nil {
  12082. return nil, err
  12083. }
  12084. ret := &Comment{
  12085. ServerResponse: googleapi.ServerResponse{
  12086. Header: res.Header,
  12087. HTTPStatusCode: res.StatusCode,
  12088. },
  12089. }
  12090. target := &ret
  12091. if err := gensupport.DecodeResponse(target, res); err != nil {
  12092. return nil, err
  12093. }
  12094. return ret, nil
  12095. // {
  12096. // "description": "Modifies a comment.",
  12097. // "httpMethod": "PUT",
  12098. // "id": "youtube.comments.update",
  12099. // "parameterOrder": [
  12100. // "part"
  12101. // ],
  12102. // "parameters": {
  12103. // "part": {
  12104. // "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.",
  12105. // "location": "query",
  12106. // "required": true,
  12107. // "type": "string"
  12108. // }
  12109. // },
  12110. // "path": "comments",
  12111. // "request": {
  12112. // "$ref": "Comment"
  12113. // },
  12114. // "response": {
  12115. // "$ref": "Comment"
  12116. // },
  12117. // "scopes": [
  12118. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12119. // ]
  12120. // }
  12121. }
  12122. // method id "youtube.guideCategories.list":
  12123. type GuideCategoriesListCall struct {
  12124. s *Service
  12125. urlParams_ gensupport.URLParams
  12126. ifNoneMatch_ string
  12127. ctx_ context.Context
  12128. header_ http.Header
  12129. }
  12130. // List: Returns a list of categories that can be associated with
  12131. // YouTube channels.
  12132. func (r *GuideCategoriesService) List(part string) *GuideCategoriesListCall {
  12133. c := &GuideCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12134. c.urlParams_.Set("part", part)
  12135. return c
  12136. }
  12137. // Hl sets the optional parameter "hl": The hl parameter specifies the
  12138. // language that will be used for text values in the API response.
  12139. func (c *GuideCategoriesListCall) Hl(hl string) *GuideCategoriesListCall {
  12140. c.urlParams_.Set("hl", hl)
  12141. return c
  12142. }
  12143. // Id sets the optional parameter "id": The id parameter specifies a
  12144. // comma-separated list of the YouTube channel category ID(s) for the
  12145. // resource(s) that are being retrieved. In a guideCategory resource,
  12146. // the id property specifies the YouTube channel category ID.
  12147. func (c *GuideCategoriesListCall) Id(id string) *GuideCategoriesListCall {
  12148. c.urlParams_.Set("id", id)
  12149. return c
  12150. }
  12151. // RegionCode sets the optional parameter "regionCode": The regionCode
  12152. // parameter instructs the API to return the list of guide categories
  12153. // available in the specified country. The parameter value is an ISO
  12154. // 3166-1 alpha-2 country code.
  12155. func (c *GuideCategoriesListCall) RegionCode(regionCode string) *GuideCategoriesListCall {
  12156. c.urlParams_.Set("regionCode", regionCode)
  12157. return c
  12158. }
  12159. // Fields allows partial responses to be retrieved. See
  12160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12161. // for more information.
  12162. func (c *GuideCategoriesListCall) Fields(s ...googleapi.Field) *GuideCategoriesListCall {
  12163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12164. return c
  12165. }
  12166. // IfNoneMatch sets the optional parameter which makes the operation
  12167. // fail if the object's ETag matches the given value. This is useful for
  12168. // getting updates only after the object has changed since the last
  12169. // request. Use googleapi.IsNotModified to check whether the response
  12170. // error from Do is the result of In-None-Match.
  12171. func (c *GuideCategoriesListCall) IfNoneMatch(entityTag string) *GuideCategoriesListCall {
  12172. c.ifNoneMatch_ = entityTag
  12173. return c
  12174. }
  12175. // Context sets the context to be used in this call's Do method. Any
  12176. // pending HTTP request will be aborted if the provided context is
  12177. // canceled.
  12178. func (c *GuideCategoriesListCall) Context(ctx context.Context) *GuideCategoriesListCall {
  12179. c.ctx_ = ctx
  12180. return c
  12181. }
  12182. // Header returns an http.Header that can be modified by the caller to
  12183. // add HTTP headers to the request.
  12184. func (c *GuideCategoriesListCall) Header() http.Header {
  12185. if c.header_ == nil {
  12186. c.header_ = make(http.Header)
  12187. }
  12188. return c.header_
  12189. }
  12190. func (c *GuideCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  12191. reqHeaders := make(http.Header)
  12192. for k, v := range c.header_ {
  12193. reqHeaders[k] = v
  12194. }
  12195. reqHeaders.Set("User-Agent", c.s.userAgent())
  12196. if c.ifNoneMatch_ != "" {
  12197. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12198. }
  12199. var body io.Reader = nil
  12200. c.urlParams_.Set("alt", alt)
  12201. urls := googleapi.ResolveRelative(c.s.BasePath, "guideCategories")
  12202. urls += "?" + c.urlParams_.Encode()
  12203. req, _ := http.NewRequest("GET", urls, body)
  12204. req.Header = reqHeaders
  12205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12206. }
  12207. // Do executes the "youtube.guideCategories.list" call.
  12208. // Exactly one of *GuideCategoryListResponse or error will be non-nil.
  12209. // Any non-2xx status code is an error. Response headers are in either
  12210. // *GuideCategoryListResponse.ServerResponse.Header or (if a response
  12211. // was returned at all) in error.(*googleapi.Error).Header. Use
  12212. // googleapi.IsNotModified to check whether the returned error was
  12213. // because http.StatusNotModified was returned.
  12214. func (c *GuideCategoriesListCall) Do(opts ...googleapi.CallOption) (*GuideCategoryListResponse, error) {
  12215. gensupport.SetOptions(c.urlParams_, opts...)
  12216. res, err := c.doRequest("json")
  12217. if res != nil && res.StatusCode == http.StatusNotModified {
  12218. if res.Body != nil {
  12219. res.Body.Close()
  12220. }
  12221. return nil, &googleapi.Error{
  12222. Code: res.StatusCode,
  12223. Header: res.Header,
  12224. }
  12225. }
  12226. if err != nil {
  12227. return nil, err
  12228. }
  12229. defer googleapi.CloseBody(res)
  12230. if err := googleapi.CheckResponse(res); err != nil {
  12231. return nil, err
  12232. }
  12233. ret := &GuideCategoryListResponse{
  12234. ServerResponse: googleapi.ServerResponse{
  12235. Header: res.Header,
  12236. HTTPStatusCode: res.StatusCode,
  12237. },
  12238. }
  12239. target := &ret
  12240. if err := gensupport.DecodeResponse(target, res); err != nil {
  12241. return nil, err
  12242. }
  12243. return ret, nil
  12244. // {
  12245. // "description": "Returns a list of categories that can be associated with YouTube channels.",
  12246. // "httpMethod": "GET",
  12247. // "id": "youtube.guideCategories.list",
  12248. // "parameterOrder": [
  12249. // "part"
  12250. // ],
  12251. // "parameters": {
  12252. // "hl": {
  12253. // "default": "en-US",
  12254. // "description": "The hl parameter specifies the language that will be used for text values in the API response.",
  12255. // "location": "query",
  12256. // "type": "string"
  12257. // },
  12258. // "id": {
  12259. // "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.",
  12260. // "location": "query",
  12261. // "type": "string"
  12262. // },
  12263. // "part": {
  12264. // "description": "The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet.",
  12265. // "location": "query",
  12266. // "required": true,
  12267. // "type": "string"
  12268. // },
  12269. // "regionCode": {
  12270. // "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.",
  12271. // "location": "query",
  12272. // "type": "string"
  12273. // }
  12274. // },
  12275. // "path": "guideCategories",
  12276. // "response": {
  12277. // "$ref": "GuideCategoryListResponse"
  12278. // },
  12279. // "scopes": [
  12280. // "https://www.googleapis.com/auth/youtube",
  12281. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12282. // "https://www.googleapis.com/auth/youtube.readonly",
  12283. // "https://www.googleapis.com/auth/youtubepartner"
  12284. // ]
  12285. // }
  12286. }
  12287. // method id "youtube.i18nLanguages.list":
  12288. type I18nLanguagesListCall struct {
  12289. s *Service
  12290. urlParams_ gensupport.URLParams
  12291. ifNoneMatch_ string
  12292. ctx_ context.Context
  12293. header_ http.Header
  12294. }
  12295. // List: Returns a list of application languages that the YouTube
  12296. // website supports.
  12297. func (r *I18nLanguagesService) List(part string) *I18nLanguagesListCall {
  12298. c := &I18nLanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12299. c.urlParams_.Set("part", part)
  12300. return c
  12301. }
  12302. // Hl sets the optional parameter "hl": The hl parameter specifies the
  12303. // language that should be used for text values in the API response.
  12304. func (c *I18nLanguagesListCall) Hl(hl string) *I18nLanguagesListCall {
  12305. c.urlParams_.Set("hl", hl)
  12306. return c
  12307. }
  12308. // Fields allows partial responses to be retrieved. See
  12309. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12310. // for more information.
  12311. func (c *I18nLanguagesListCall) Fields(s ...googleapi.Field) *I18nLanguagesListCall {
  12312. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12313. return c
  12314. }
  12315. // IfNoneMatch sets the optional parameter which makes the operation
  12316. // fail if the object's ETag matches the given value. This is useful for
  12317. // getting updates only after the object has changed since the last
  12318. // request. Use googleapi.IsNotModified to check whether the response
  12319. // error from Do is the result of In-None-Match.
  12320. func (c *I18nLanguagesListCall) IfNoneMatch(entityTag string) *I18nLanguagesListCall {
  12321. c.ifNoneMatch_ = entityTag
  12322. return c
  12323. }
  12324. // Context sets the context to be used in this call's Do method. Any
  12325. // pending HTTP request will be aborted if the provided context is
  12326. // canceled.
  12327. func (c *I18nLanguagesListCall) Context(ctx context.Context) *I18nLanguagesListCall {
  12328. c.ctx_ = ctx
  12329. return c
  12330. }
  12331. // Header returns an http.Header that can be modified by the caller to
  12332. // add HTTP headers to the request.
  12333. func (c *I18nLanguagesListCall) Header() http.Header {
  12334. if c.header_ == nil {
  12335. c.header_ = make(http.Header)
  12336. }
  12337. return c.header_
  12338. }
  12339. func (c *I18nLanguagesListCall) doRequest(alt string) (*http.Response, error) {
  12340. reqHeaders := make(http.Header)
  12341. for k, v := range c.header_ {
  12342. reqHeaders[k] = v
  12343. }
  12344. reqHeaders.Set("User-Agent", c.s.userAgent())
  12345. if c.ifNoneMatch_ != "" {
  12346. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12347. }
  12348. var body io.Reader = nil
  12349. c.urlParams_.Set("alt", alt)
  12350. urls := googleapi.ResolveRelative(c.s.BasePath, "i18nLanguages")
  12351. urls += "?" + c.urlParams_.Encode()
  12352. req, _ := http.NewRequest("GET", urls, body)
  12353. req.Header = reqHeaders
  12354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12355. }
  12356. // Do executes the "youtube.i18nLanguages.list" call.
  12357. // Exactly one of *I18nLanguageListResponse or error will be non-nil.
  12358. // Any non-2xx status code is an error. Response headers are in either
  12359. // *I18nLanguageListResponse.ServerResponse.Header or (if a response was
  12360. // returned at all) in error.(*googleapi.Error).Header. Use
  12361. // googleapi.IsNotModified to check whether the returned error was
  12362. // because http.StatusNotModified was returned.
  12363. func (c *I18nLanguagesListCall) Do(opts ...googleapi.CallOption) (*I18nLanguageListResponse, error) {
  12364. gensupport.SetOptions(c.urlParams_, opts...)
  12365. res, err := c.doRequest("json")
  12366. if res != nil && res.StatusCode == http.StatusNotModified {
  12367. if res.Body != nil {
  12368. res.Body.Close()
  12369. }
  12370. return nil, &googleapi.Error{
  12371. Code: res.StatusCode,
  12372. Header: res.Header,
  12373. }
  12374. }
  12375. if err != nil {
  12376. return nil, err
  12377. }
  12378. defer googleapi.CloseBody(res)
  12379. if err := googleapi.CheckResponse(res); err != nil {
  12380. return nil, err
  12381. }
  12382. ret := &I18nLanguageListResponse{
  12383. ServerResponse: googleapi.ServerResponse{
  12384. Header: res.Header,
  12385. HTTPStatusCode: res.StatusCode,
  12386. },
  12387. }
  12388. target := &ret
  12389. if err := gensupport.DecodeResponse(target, res); err != nil {
  12390. return nil, err
  12391. }
  12392. return ret, nil
  12393. // {
  12394. // "description": "Returns a list of application languages that the YouTube website supports.",
  12395. // "httpMethod": "GET",
  12396. // "id": "youtube.i18nLanguages.list",
  12397. // "parameterOrder": [
  12398. // "part"
  12399. // ],
  12400. // "parameters": {
  12401. // "hl": {
  12402. // "default": "en_US",
  12403. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  12404. // "location": "query",
  12405. // "type": "string"
  12406. // },
  12407. // "part": {
  12408. // "description": "The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.",
  12409. // "location": "query",
  12410. // "required": true,
  12411. // "type": "string"
  12412. // }
  12413. // },
  12414. // "path": "i18nLanguages",
  12415. // "response": {
  12416. // "$ref": "I18nLanguageListResponse"
  12417. // },
  12418. // "scopes": [
  12419. // "https://www.googleapis.com/auth/youtube",
  12420. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12421. // "https://www.googleapis.com/auth/youtube.readonly",
  12422. // "https://www.googleapis.com/auth/youtubepartner"
  12423. // ]
  12424. // }
  12425. }
  12426. // method id "youtube.i18nRegions.list":
  12427. type I18nRegionsListCall struct {
  12428. s *Service
  12429. urlParams_ gensupport.URLParams
  12430. ifNoneMatch_ string
  12431. ctx_ context.Context
  12432. header_ http.Header
  12433. }
  12434. // List: Returns a list of content regions that the YouTube website
  12435. // supports.
  12436. func (r *I18nRegionsService) List(part string) *I18nRegionsListCall {
  12437. c := &I18nRegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12438. c.urlParams_.Set("part", part)
  12439. return c
  12440. }
  12441. // Hl sets the optional parameter "hl": The hl parameter specifies the
  12442. // language that should be used for text values in the API response.
  12443. func (c *I18nRegionsListCall) Hl(hl string) *I18nRegionsListCall {
  12444. c.urlParams_.Set("hl", hl)
  12445. return c
  12446. }
  12447. // Fields allows partial responses to be retrieved. See
  12448. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12449. // for more information.
  12450. func (c *I18nRegionsListCall) Fields(s ...googleapi.Field) *I18nRegionsListCall {
  12451. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12452. return c
  12453. }
  12454. // IfNoneMatch sets the optional parameter which makes the operation
  12455. // fail if the object's ETag matches the given value. This is useful for
  12456. // getting updates only after the object has changed since the last
  12457. // request. Use googleapi.IsNotModified to check whether the response
  12458. // error from Do is the result of In-None-Match.
  12459. func (c *I18nRegionsListCall) IfNoneMatch(entityTag string) *I18nRegionsListCall {
  12460. c.ifNoneMatch_ = entityTag
  12461. return c
  12462. }
  12463. // Context sets the context to be used in this call's Do method. Any
  12464. // pending HTTP request will be aborted if the provided context is
  12465. // canceled.
  12466. func (c *I18nRegionsListCall) Context(ctx context.Context) *I18nRegionsListCall {
  12467. c.ctx_ = ctx
  12468. return c
  12469. }
  12470. // Header returns an http.Header that can be modified by the caller to
  12471. // add HTTP headers to the request.
  12472. func (c *I18nRegionsListCall) Header() http.Header {
  12473. if c.header_ == nil {
  12474. c.header_ = make(http.Header)
  12475. }
  12476. return c.header_
  12477. }
  12478. func (c *I18nRegionsListCall) doRequest(alt string) (*http.Response, error) {
  12479. reqHeaders := make(http.Header)
  12480. for k, v := range c.header_ {
  12481. reqHeaders[k] = v
  12482. }
  12483. reqHeaders.Set("User-Agent", c.s.userAgent())
  12484. if c.ifNoneMatch_ != "" {
  12485. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12486. }
  12487. var body io.Reader = nil
  12488. c.urlParams_.Set("alt", alt)
  12489. urls := googleapi.ResolveRelative(c.s.BasePath, "i18nRegions")
  12490. urls += "?" + c.urlParams_.Encode()
  12491. req, _ := http.NewRequest("GET", urls, body)
  12492. req.Header = reqHeaders
  12493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12494. }
  12495. // Do executes the "youtube.i18nRegions.list" call.
  12496. // Exactly one of *I18nRegionListResponse or error will be non-nil. Any
  12497. // non-2xx status code is an error. Response headers are in either
  12498. // *I18nRegionListResponse.ServerResponse.Header or (if a response was
  12499. // returned at all) in error.(*googleapi.Error).Header. Use
  12500. // googleapi.IsNotModified to check whether the returned error was
  12501. // because http.StatusNotModified was returned.
  12502. func (c *I18nRegionsListCall) Do(opts ...googleapi.CallOption) (*I18nRegionListResponse, error) {
  12503. gensupport.SetOptions(c.urlParams_, opts...)
  12504. res, err := c.doRequest("json")
  12505. if res != nil && res.StatusCode == http.StatusNotModified {
  12506. if res.Body != nil {
  12507. res.Body.Close()
  12508. }
  12509. return nil, &googleapi.Error{
  12510. Code: res.StatusCode,
  12511. Header: res.Header,
  12512. }
  12513. }
  12514. if err != nil {
  12515. return nil, err
  12516. }
  12517. defer googleapi.CloseBody(res)
  12518. if err := googleapi.CheckResponse(res); err != nil {
  12519. return nil, err
  12520. }
  12521. ret := &I18nRegionListResponse{
  12522. ServerResponse: googleapi.ServerResponse{
  12523. Header: res.Header,
  12524. HTTPStatusCode: res.StatusCode,
  12525. },
  12526. }
  12527. target := &ret
  12528. if err := gensupport.DecodeResponse(target, res); err != nil {
  12529. return nil, err
  12530. }
  12531. return ret, nil
  12532. // {
  12533. // "description": "Returns a list of content regions that the YouTube website supports.",
  12534. // "httpMethod": "GET",
  12535. // "id": "youtube.i18nRegions.list",
  12536. // "parameterOrder": [
  12537. // "part"
  12538. // ],
  12539. // "parameters": {
  12540. // "hl": {
  12541. // "default": "en_US",
  12542. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  12543. // "location": "query",
  12544. // "type": "string"
  12545. // },
  12546. // "part": {
  12547. // "description": "The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.",
  12548. // "location": "query",
  12549. // "required": true,
  12550. // "type": "string"
  12551. // }
  12552. // },
  12553. // "path": "i18nRegions",
  12554. // "response": {
  12555. // "$ref": "I18nRegionListResponse"
  12556. // },
  12557. // "scopes": [
  12558. // "https://www.googleapis.com/auth/youtube",
  12559. // "https://www.googleapis.com/auth/youtube.force-ssl",
  12560. // "https://www.googleapis.com/auth/youtube.readonly",
  12561. // "https://www.googleapis.com/auth/youtubepartner"
  12562. // ]
  12563. // }
  12564. }
  12565. // method id "youtube.liveBroadcasts.bind":
  12566. type LiveBroadcastsBindCall struct {
  12567. s *Service
  12568. urlParams_ gensupport.URLParams
  12569. ctx_ context.Context
  12570. header_ http.Header
  12571. }
  12572. // Bind: Binds a YouTube broadcast to a stream or removes an existing
  12573. // binding between a broadcast and a stream. A broadcast can only be
  12574. // bound to one video stream, though a video stream may be bound to more
  12575. // than one broadcast.
  12576. func (r *LiveBroadcastsService) Bind(id string, part string) *LiveBroadcastsBindCall {
  12577. c := &LiveBroadcastsBindCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12578. c.urlParams_.Set("id", id)
  12579. c.urlParams_.Set("part", part)
  12580. return c
  12581. }
  12582. // OnBehalfOfContentOwner sets the optional parameter
  12583. // "onBehalfOfContentOwner": Note: This parameter is intended
  12584. // exclusively for YouTube content partners.
  12585. //
  12586. // The onBehalfOfContentOwner parameter indicates that the request's
  12587. // authorization credentials identify a YouTube CMS user who is acting
  12588. // on behalf of the content owner specified in the parameter value. This
  12589. // parameter is intended for YouTube content partners that own and
  12590. // manage many different YouTube channels. It allows content owners to
  12591. // authenticate once and get access to all their video and channel data,
  12592. // without having to provide authentication credentials for each
  12593. // individual channel. The CMS account that the user authenticates with
  12594. // must be linked to the specified YouTube content owner.
  12595. func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsBindCall {
  12596. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  12597. return c
  12598. }
  12599. // OnBehalfOfContentOwnerChannel sets the optional parameter
  12600. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  12601. // properly authorized request. Note: This parameter is intended
  12602. // exclusively for YouTube content partners.
  12603. //
  12604. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  12605. // channel ID of the channel to which a video is being added. This
  12606. // parameter is required when a request specifies a value for the
  12607. // onBehalfOfContentOwner parameter, and it can only be used in
  12608. // conjunction with that parameter. In addition, the request must be
  12609. // authorized using a CMS account that is linked to the content owner
  12610. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  12611. // channel that the onBehalfOfContentOwnerChannel parameter value
  12612. // specifies must be linked to the content owner that the
  12613. // onBehalfOfContentOwner parameter specifies.
  12614. //
  12615. // This parameter is intended for YouTube content partners that own and
  12616. // manage many different YouTube channels. It allows content owners to
  12617. // authenticate once and perform actions on behalf of the channel
  12618. // specified in the parameter value, without having to provide
  12619. // authentication credentials for each separate channel.
  12620. func (c *LiveBroadcastsBindCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsBindCall {
  12621. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  12622. return c
  12623. }
  12624. // StreamId sets the optional parameter "streamId": The streamId
  12625. // parameter specifies the unique ID of the video stream that is being
  12626. // bound to a broadcast. If this parameter is omitted, the API will
  12627. // remove any existing binding between the broadcast and a video stream.
  12628. func (c *LiveBroadcastsBindCall) StreamId(streamId string) *LiveBroadcastsBindCall {
  12629. c.urlParams_.Set("streamId", streamId)
  12630. return c
  12631. }
  12632. // Fields allows partial responses to be retrieved. See
  12633. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12634. // for more information.
  12635. func (c *LiveBroadcastsBindCall) Fields(s ...googleapi.Field) *LiveBroadcastsBindCall {
  12636. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12637. return c
  12638. }
  12639. // Context sets the context to be used in this call's Do method. Any
  12640. // pending HTTP request will be aborted if the provided context is
  12641. // canceled.
  12642. func (c *LiveBroadcastsBindCall) Context(ctx context.Context) *LiveBroadcastsBindCall {
  12643. c.ctx_ = ctx
  12644. return c
  12645. }
  12646. // Header returns an http.Header that can be modified by the caller to
  12647. // add HTTP headers to the request.
  12648. func (c *LiveBroadcastsBindCall) Header() http.Header {
  12649. if c.header_ == nil {
  12650. c.header_ = make(http.Header)
  12651. }
  12652. return c.header_
  12653. }
  12654. func (c *LiveBroadcastsBindCall) doRequest(alt string) (*http.Response, error) {
  12655. reqHeaders := make(http.Header)
  12656. for k, v := range c.header_ {
  12657. reqHeaders[k] = v
  12658. }
  12659. reqHeaders.Set("User-Agent", c.s.userAgent())
  12660. var body io.Reader = nil
  12661. c.urlParams_.Set("alt", alt)
  12662. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/bind")
  12663. urls += "?" + c.urlParams_.Encode()
  12664. req, _ := http.NewRequest("POST", urls, body)
  12665. req.Header = reqHeaders
  12666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12667. }
  12668. // Do executes the "youtube.liveBroadcasts.bind" call.
  12669. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  12670. // status code is an error. Response headers are in either
  12671. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  12672. // at all) in error.(*googleapi.Error).Header. Use
  12673. // googleapi.IsNotModified to check whether the returned error was
  12674. // because http.StatusNotModified was returned.
  12675. func (c *LiveBroadcastsBindCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  12676. gensupport.SetOptions(c.urlParams_, opts...)
  12677. res, err := c.doRequest("json")
  12678. if res != nil && res.StatusCode == http.StatusNotModified {
  12679. if res.Body != nil {
  12680. res.Body.Close()
  12681. }
  12682. return nil, &googleapi.Error{
  12683. Code: res.StatusCode,
  12684. Header: res.Header,
  12685. }
  12686. }
  12687. if err != nil {
  12688. return nil, err
  12689. }
  12690. defer googleapi.CloseBody(res)
  12691. if err := googleapi.CheckResponse(res); err != nil {
  12692. return nil, err
  12693. }
  12694. ret := &LiveBroadcast{
  12695. ServerResponse: googleapi.ServerResponse{
  12696. Header: res.Header,
  12697. HTTPStatusCode: res.StatusCode,
  12698. },
  12699. }
  12700. target := &ret
  12701. if err := gensupport.DecodeResponse(target, res); err != nil {
  12702. return nil, err
  12703. }
  12704. return ret, nil
  12705. // {
  12706. // "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.",
  12707. // "httpMethod": "POST",
  12708. // "id": "youtube.liveBroadcasts.bind",
  12709. // "parameterOrder": [
  12710. // "id",
  12711. // "part"
  12712. // ],
  12713. // "parameters": {
  12714. // "id": {
  12715. // "description": "The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.",
  12716. // "location": "query",
  12717. // "required": true,
  12718. // "type": "string"
  12719. // },
  12720. // "onBehalfOfContentOwner": {
  12721. // "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.",
  12722. // "location": "query",
  12723. // "type": "string"
  12724. // },
  12725. // "onBehalfOfContentOwnerChannel": {
  12726. // "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.",
  12727. // "location": "query",
  12728. // "type": "string"
  12729. // },
  12730. // "part": {
  12731. // "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.",
  12732. // "location": "query",
  12733. // "required": true,
  12734. // "type": "string"
  12735. // },
  12736. // "streamId": {
  12737. // "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.",
  12738. // "location": "query",
  12739. // "type": "string"
  12740. // }
  12741. // },
  12742. // "path": "liveBroadcasts/bind",
  12743. // "response": {
  12744. // "$ref": "LiveBroadcast"
  12745. // },
  12746. // "scopes": [
  12747. // "https://www.googleapis.com/auth/youtube",
  12748. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12749. // ]
  12750. // }
  12751. }
  12752. // method id "youtube.liveBroadcasts.control":
  12753. type LiveBroadcastsControlCall struct {
  12754. s *Service
  12755. urlParams_ gensupport.URLParams
  12756. ctx_ context.Context
  12757. header_ http.Header
  12758. }
  12759. // Control: Controls the settings for a slate that can be displayed in
  12760. // the broadcast stream.
  12761. func (r *LiveBroadcastsService) Control(id string, part string) *LiveBroadcastsControlCall {
  12762. c := &LiveBroadcastsControlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12763. c.urlParams_.Set("id", id)
  12764. c.urlParams_.Set("part", part)
  12765. return c
  12766. }
  12767. // DisplaySlate sets the optional parameter "displaySlate": The
  12768. // displaySlate parameter specifies whether the slate is being enabled
  12769. // or disabled.
  12770. func (c *LiveBroadcastsControlCall) DisplaySlate(displaySlate bool) *LiveBroadcastsControlCall {
  12771. c.urlParams_.Set("displaySlate", fmt.Sprint(displaySlate))
  12772. return c
  12773. }
  12774. // OffsetTimeMs sets the optional parameter "offsetTimeMs": The
  12775. // offsetTimeMs parameter specifies a positive time offset when the
  12776. // specified slate change will occur. The value is measured in
  12777. // milliseconds from the beginning of the broadcast's monitor stream,
  12778. // which is the time that the testing phase for the broadcast began.
  12779. // Even though it is specified in milliseconds, the value is actually an
  12780. // approximation, and YouTube completes the requested action as closely
  12781. // as possible to that time.
  12782. //
  12783. // If you do not specify a value for this parameter, then YouTube
  12784. // performs the action as soon as possible. See the Getting started
  12785. // guide for more details.
  12786. //
  12787. // Important: You should only specify a value for this parameter if your
  12788. // broadcast stream is delayed.
  12789. func (c *LiveBroadcastsControlCall) OffsetTimeMs(offsetTimeMs uint64) *LiveBroadcastsControlCall {
  12790. c.urlParams_.Set("offsetTimeMs", fmt.Sprint(offsetTimeMs))
  12791. return c
  12792. }
  12793. // OnBehalfOfContentOwner sets the optional parameter
  12794. // "onBehalfOfContentOwner": Note: This parameter is intended
  12795. // exclusively for YouTube content partners.
  12796. //
  12797. // The onBehalfOfContentOwner parameter indicates that the request's
  12798. // authorization credentials identify a YouTube CMS user who is acting
  12799. // on behalf of the content owner specified in the parameter value. This
  12800. // parameter is intended for YouTube content partners that own and
  12801. // manage many different YouTube channels. It allows content owners to
  12802. // authenticate once and get access to all their video and channel data,
  12803. // without having to provide authentication credentials for each
  12804. // individual channel. The CMS account that the user authenticates with
  12805. // must be linked to the specified YouTube content owner.
  12806. func (c *LiveBroadcastsControlCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsControlCall {
  12807. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  12808. return c
  12809. }
  12810. // OnBehalfOfContentOwnerChannel sets the optional parameter
  12811. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  12812. // properly authorized request. Note: This parameter is intended
  12813. // exclusively for YouTube content partners.
  12814. //
  12815. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  12816. // channel ID of the channel to which a video is being added. This
  12817. // parameter is required when a request specifies a value for the
  12818. // onBehalfOfContentOwner parameter, and it can only be used in
  12819. // conjunction with that parameter. In addition, the request must be
  12820. // authorized using a CMS account that is linked to the content owner
  12821. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  12822. // channel that the onBehalfOfContentOwnerChannel parameter value
  12823. // specifies must be linked to the content owner that the
  12824. // onBehalfOfContentOwner parameter specifies.
  12825. //
  12826. // This parameter is intended for YouTube content partners that own and
  12827. // manage many different YouTube channels. It allows content owners to
  12828. // authenticate once and perform actions on behalf of the channel
  12829. // specified in the parameter value, without having to provide
  12830. // authentication credentials for each separate channel.
  12831. func (c *LiveBroadcastsControlCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsControlCall {
  12832. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  12833. return c
  12834. }
  12835. // Walltime sets the optional parameter "walltime": The walltime
  12836. // parameter specifies the wall clock time at which the specified slate
  12837. // change will occur. The value is specified in ISO 8601
  12838. // (YYYY-MM-DDThh:mm:ss.sssZ) format.
  12839. func (c *LiveBroadcastsControlCall) Walltime(walltime string) *LiveBroadcastsControlCall {
  12840. c.urlParams_.Set("walltime", walltime)
  12841. return c
  12842. }
  12843. // Fields allows partial responses to be retrieved. See
  12844. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12845. // for more information.
  12846. func (c *LiveBroadcastsControlCall) Fields(s ...googleapi.Field) *LiveBroadcastsControlCall {
  12847. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12848. return c
  12849. }
  12850. // Context sets the context to be used in this call's Do method. Any
  12851. // pending HTTP request will be aborted if the provided context is
  12852. // canceled.
  12853. func (c *LiveBroadcastsControlCall) Context(ctx context.Context) *LiveBroadcastsControlCall {
  12854. c.ctx_ = ctx
  12855. return c
  12856. }
  12857. // Header returns an http.Header that can be modified by the caller to
  12858. // add HTTP headers to the request.
  12859. func (c *LiveBroadcastsControlCall) Header() http.Header {
  12860. if c.header_ == nil {
  12861. c.header_ = make(http.Header)
  12862. }
  12863. return c.header_
  12864. }
  12865. func (c *LiveBroadcastsControlCall) doRequest(alt string) (*http.Response, error) {
  12866. reqHeaders := make(http.Header)
  12867. for k, v := range c.header_ {
  12868. reqHeaders[k] = v
  12869. }
  12870. reqHeaders.Set("User-Agent", c.s.userAgent())
  12871. var body io.Reader = nil
  12872. c.urlParams_.Set("alt", alt)
  12873. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/control")
  12874. urls += "?" + c.urlParams_.Encode()
  12875. req, _ := http.NewRequest("POST", urls, body)
  12876. req.Header = reqHeaders
  12877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12878. }
  12879. // Do executes the "youtube.liveBroadcasts.control" call.
  12880. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  12881. // status code is an error. Response headers are in either
  12882. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  12883. // at all) in error.(*googleapi.Error).Header. Use
  12884. // googleapi.IsNotModified to check whether the returned error was
  12885. // because http.StatusNotModified was returned.
  12886. func (c *LiveBroadcastsControlCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  12887. gensupport.SetOptions(c.urlParams_, opts...)
  12888. res, err := c.doRequest("json")
  12889. if res != nil && res.StatusCode == http.StatusNotModified {
  12890. if res.Body != nil {
  12891. res.Body.Close()
  12892. }
  12893. return nil, &googleapi.Error{
  12894. Code: res.StatusCode,
  12895. Header: res.Header,
  12896. }
  12897. }
  12898. if err != nil {
  12899. return nil, err
  12900. }
  12901. defer googleapi.CloseBody(res)
  12902. if err := googleapi.CheckResponse(res); err != nil {
  12903. return nil, err
  12904. }
  12905. ret := &LiveBroadcast{
  12906. ServerResponse: googleapi.ServerResponse{
  12907. Header: res.Header,
  12908. HTTPStatusCode: res.StatusCode,
  12909. },
  12910. }
  12911. target := &ret
  12912. if err := gensupport.DecodeResponse(target, res); err != nil {
  12913. return nil, err
  12914. }
  12915. return ret, nil
  12916. // {
  12917. // "description": "Controls the settings for a slate that can be displayed in the broadcast stream.",
  12918. // "httpMethod": "POST",
  12919. // "id": "youtube.liveBroadcasts.control",
  12920. // "parameterOrder": [
  12921. // "id",
  12922. // "part"
  12923. // ],
  12924. // "parameters": {
  12925. // "displaySlate": {
  12926. // "description": "The displaySlate parameter specifies whether the slate is being enabled or disabled.",
  12927. // "location": "query",
  12928. // "type": "boolean"
  12929. // },
  12930. // "id": {
  12931. // "description": "The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated.",
  12932. // "location": "query",
  12933. // "required": true,
  12934. // "type": "string"
  12935. // },
  12936. // "offsetTimeMs": {
  12937. // "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.",
  12938. // "format": "uint64",
  12939. // "location": "query",
  12940. // "type": "string"
  12941. // },
  12942. // "onBehalfOfContentOwner": {
  12943. // "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.",
  12944. // "location": "query",
  12945. // "type": "string"
  12946. // },
  12947. // "onBehalfOfContentOwnerChannel": {
  12948. // "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.",
  12949. // "location": "query",
  12950. // "type": "string"
  12951. // },
  12952. // "part": {
  12953. // "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.",
  12954. // "location": "query",
  12955. // "required": true,
  12956. // "type": "string"
  12957. // },
  12958. // "walltime": {
  12959. // "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.",
  12960. // "format": "date-time",
  12961. // "location": "query",
  12962. // "type": "string"
  12963. // }
  12964. // },
  12965. // "path": "liveBroadcasts/control",
  12966. // "response": {
  12967. // "$ref": "LiveBroadcast"
  12968. // },
  12969. // "scopes": [
  12970. // "https://www.googleapis.com/auth/youtube",
  12971. // "https://www.googleapis.com/auth/youtube.force-ssl"
  12972. // ]
  12973. // }
  12974. }
  12975. // method id "youtube.liveBroadcasts.delete":
  12976. type LiveBroadcastsDeleteCall struct {
  12977. s *Service
  12978. urlParams_ gensupport.URLParams
  12979. ctx_ context.Context
  12980. header_ http.Header
  12981. }
  12982. // Delete: Deletes a broadcast.
  12983. func (r *LiveBroadcastsService) Delete(id string) *LiveBroadcastsDeleteCall {
  12984. c := &LiveBroadcastsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12985. c.urlParams_.Set("id", id)
  12986. return c
  12987. }
  12988. // OnBehalfOfContentOwner sets the optional parameter
  12989. // "onBehalfOfContentOwner": Note: This parameter is intended
  12990. // exclusively for YouTube content partners.
  12991. //
  12992. // The onBehalfOfContentOwner parameter indicates that the request's
  12993. // authorization credentials identify a YouTube CMS user who is acting
  12994. // on behalf of the content owner specified in the parameter value. This
  12995. // parameter is intended for YouTube content partners that own and
  12996. // manage many different YouTube channels. It allows content owners to
  12997. // authenticate once and get access to all their video and channel data,
  12998. // without having to provide authentication credentials for each
  12999. // individual channel. The CMS account that the user authenticates with
  13000. // must be linked to the specified YouTube content owner.
  13001. func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsDeleteCall {
  13002. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13003. return c
  13004. }
  13005. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13006. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13007. // properly authorized request. Note: This parameter is intended
  13008. // exclusively for YouTube content partners.
  13009. //
  13010. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13011. // channel ID of the channel to which a video is being added. This
  13012. // parameter is required when a request specifies a value for the
  13013. // onBehalfOfContentOwner parameter, and it can only be used in
  13014. // conjunction with that parameter. In addition, the request must be
  13015. // authorized using a CMS account that is linked to the content owner
  13016. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13017. // channel that the onBehalfOfContentOwnerChannel parameter value
  13018. // specifies must be linked to the content owner that the
  13019. // onBehalfOfContentOwner parameter specifies.
  13020. //
  13021. // This parameter is intended for YouTube content partners that own and
  13022. // manage many different YouTube channels. It allows content owners to
  13023. // authenticate once and perform actions on behalf of the channel
  13024. // specified in the parameter value, without having to provide
  13025. // authentication credentials for each separate channel.
  13026. func (c *LiveBroadcastsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsDeleteCall {
  13027. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13028. return c
  13029. }
  13030. // Fields allows partial responses to be retrieved. See
  13031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13032. // for more information.
  13033. func (c *LiveBroadcastsDeleteCall) Fields(s ...googleapi.Field) *LiveBroadcastsDeleteCall {
  13034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13035. return c
  13036. }
  13037. // Context sets the context to be used in this call's Do method. Any
  13038. // pending HTTP request will be aborted if the provided context is
  13039. // canceled.
  13040. func (c *LiveBroadcastsDeleteCall) Context(ctx context.Context) *LiveBroadcastsDeleteCall {
  13041. c.ctx_ = ctx
  13042. return c
  13043. }
  13044. // Header returns an http.Header that can be modified by the caller to
  13045. // add HTTP headers to the request.
  13046. func (c *LiveBroadcastsDeleteCall) Header() http.Header {
  13047. if c.header_ == nil {
  13048. c.header_ = make(http.Header)
  13049. }
  13050. return c.header_
  13051. }
  13052. func (c *LiveBroadcastsDeleteCall) doRequest(alt string) (*http.Response, error) {
  13053. reqHeaders := make(http.Header)
  13054. for k, v := range c.header_ {
  13055. reqHeaders[k] = v
  13056. }
  13057. reqHeaders.Set("User-Agent", c.s.userAgent())
  13058. var body io.Reader = nil
  13059. c.urlParams_.Set("alt", alt)
  13060. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13061. urls += "?" + c.urlParams_.Encode()
  13062. req, _ := http.NewRequest("DELETE", urls, body)
  13063. req.Header = reqHeaders
  13064. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13065. }
  13066. // Do executes the "youtube.liveBroadcasts.delete" call.
  13067. func (c *LiveBroadcastsDeleteCall) Do(opts ...googleapi.CallOption) error {
  13068. gensupport.SetOptions(c.urlParams_, opts...)
  13069. res, err := c.doRequest("json")
  13070. if err != nil {
  13071. return err
  13072. }
  13073. defer googleapi.CloseBody(res)
  13074. if err := googleapi.CheckResponse(res); err != nil {
  13075. return err
  13076. }
  13077. return nil
  13078. // {
  13079. // "description": "Deletes a broadcast.",
  13080. // "httpMethod": "DELETE",
  13081. // "id": "youtube.liveBroadcasts.delete",
  13082. // "parameterOrder": [
  13083. // "id"
  13084. // ],
  13085. // "parameters": {
  13086. // "id": {
  13087. // "description": "The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.",
  13088. // "location": "query",
  13089. // "required": true,
  13090. // "type": "string"
  13091. // },
  13092. // "onBehalfOfContentOwner": {
  13093. // "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.",
  13094. // "location": "query",
  13095. // "type": "string"
  13096. // },
  13097. // "onBehalfOfContentOwnerChannel": {
  13098. // "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.",
  13099. // "location": "query",
  13100. // "type": "string"
  13101. // }
  13102. // },
  13103. // "path": "liveBroadcasts",
  13104. // "scopes": [
  13105. // "https://www.googleapis.com/auth/youtube",
  13106. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13107. // ]
  13108. // }
  13109. }
  13110. // method id "youtube.liveBroadcasts.insert":
  13111. type LiveBroadcastsInsertCall struct {
  13112. s *Service
  13113. livebroadcast *LiveBroadcast
  13114. urlParams_ gensupport.URLParams
  13115. ctx_ context.Context
  13116. header_ http.Header
  13117. }
  13118. // Insert: Creates a broadcast.
  13119. func (r *LiveBroadcastsService) Insert(part string, livebroadcast *LiveBroadcast) *LiveBroadcastsInsertCall {
  13120. c := &LiveBroadcastsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13121. c.urlParams_.Set("part", part)
  13122. c.livebroadcast = livebroadcast
  13123. return c
  13124. }
  13125. // OnBehalfOfContentOwner sets the optional parameter
  13126. // "onBehalfOfContentOwner": Note: This parameter is intended
  13127. // exclusively for YouTube content partners.
  13128. //
  13129. // The onBehalfOfContentOwner parameter indicates that the request's
  13130. // authorization credentials identify a YouTube CMS user who is acting
  13131. // on behalf of the content owner specified in the parameter value. This
  13132. // parameter is intended for YouTube content partners that own and
  13133. // manage many different YouTube channels. It allows content owners to
  13134. // authenticate once and get access to all their video and channel data,
  13135. // without having to provide authentication credentials for each
  13136. // individual channel. The CMS account that the user authenticates with
  13137. // must be linked to the specified YouTube content owner.
  13138. func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsInsertCall {
  13139. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13140. return c
  13141. }
  13142. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13143. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13144. // properly authorized request. Note: This parameter is intended
  13145. // exclusively for YouTube content partners.
  13146. //
  13147. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13148. // channel ID of the channel to which a video is being added. This
  13149. // parameter is required when a request specifies a value for the
  13150. // onBehalfOfContentOwner parameter, and it can only be used in
  13151. // conjunction with that parameter. In addition, the request must be
  13152. // authorized using a CMS account that is linked to the content owner
  13153. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13154. // channel that the onBehalfOfContentOwnerChannel parameter value
  13155. // specifies must be linked to the content owner that the
  13156. // onBehalfOfContentOwner parameter specifies.
  13157. //
  13158. // This parameter is intended for YouTube content partners that own and
  13159. // manage many different YouTube channels. It allows content owners to
  13160. // authenticate once and perform actions on behalf of the channel
  13161. // specified in the parameter value, without having to provide
  13162. // authentication credentials for each separate channel.
  13163. func (c *LiveBroadcastsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsInsertCall {
  13164. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13165. return c
  13166. }
  13167. // Fields allows partial responses to be retrieved. See
  13168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13169. // for more information.
  13170. func (c *LiveBroadcastsInsertCall) Fields(s ...googleapi.Field) *LiveBroadcastsInsertCall {
  13171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13172. return c
  13173. }
  13174. // Context sets the context to be used in this call's Do method. Any
  13175. // pending HTTP request will be aborted if the provided context is
  13176. // canceled.
  13177. func (c *LiveBroadcastsInsertCall) Context(ctx context.Context) *LiveBroadcastsInsertCall {
  13178. c.ctx_ = ctx
  13179. return c
  13180. }
  13181. // Header returns an http.Header that can be modified by the caller to
  13182. // add HTTP headers to the request.
  13183. func (c *LiveBroadcastsInsertCall) Header() http.Header {
  13184. if c.header_ == nil {
  13185. c.header_ = make(http.Header)
  13186. }
  13187. return c.header_
  13188. }
  13189. func (c *LiveBroadcastsInsertCall) doRequest(alt string) (*http.Response, error) {
  13190. reqHeaders := make(http.Header)
  13191. for k, v := range c.header_ {
  13192. reqHeaders[k] = v
  13193. }
  13194. reqHeaders.Set("User-Agent", c.s.userAgent())
  13195. var body io.Reader = nil
  13196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast)
  13197. if err != nil {
  13198. return nil, err
  13199. }
  13200. reqHeaders.Set("Content-Type", "application/json")
  13201. c.urlParams_.Set("alt", alt)
  13202. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13203. urls += "?" + c.urlParams_.Encode()
  13204. req, _ := http.NewRequest("POST", urls, body)
  13205. req.Header = reqHeaders
  13206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13207. }
  13208. // Do executes the "youtube.liveBroadcasts.insert" call.
  13209. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  13210. // status code is an error. Response headers are in either
  13211. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  13212. // at all) in error.(*googleapi.Error).Header. Use
  13213. // googleapi.IsNotModified to check whether the returned error was
  13214. // because http.StatusNotModified was returned.
  13215. func (c *LiveBroadcastsInsertCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  13216. gensupport.SetOptions(c.urlParams_, opts...)
  13217. res, err := c.doRequest("json")
  13218. if res != nil && res.StatusCode == http.StatusNotModified {
  13219. if res.Body != nil {
  13220. res.Body.Close()
  13221. }
  13222. return nil, &googleapi.Error{
  13223. Code: res.StatusCode,
  13224. Header: res.Header,
  13225. }
  13226. }
  13227. if err != nil {
  13228. return nil, err
  13229. }
  13230. defer googleapi.CloseBody(res)
  13231. if err := googleapi.CheckResponse(res); err != nil {
  13232. return nil, err
  13233. }
  13234. ret := &LiveBroadcast{
  13235. ServerResponse: googleapi.ServerResponse{
  13236. Header: res.Header,
  13237. HTTPStatusCode: res.StatusCode,
  13238. },
  13239. }
  13240. target := &ret
  13241. if err := gensupport.DecodeResponse(target, res); err != nil {
  13242. return nil, err
  13243. }
  13244. return ret, nil
  13245. // {
  13246. // "description": "Creates a broadcast.",
  13247. // "httpMethod": "POST",
  13248. // "id": "youtube.liveBroadcasts.insert",
  13249. // "parameterOrder": [
  13250. // "part"
  13251. // ],
  13252. // "parameters": {
  13253. // "onBehalfOfContentOwner": {
  13254. // "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.",
  13255. // "location": "query",
  13256. // "type": "string"
  13257. // },
  13258. // "onBehalfOfContentOwnerChannel": {
  13259. // "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.",
  13260. // "location": "query",
  13261. // "type": "string"
  13262. // },
  13263. // "part": {
  13264. // "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.",
  13265. // "location": "query",
  13266. // "required": true,
  13267. // "type": "string"
  13268. // }
  13269. // },
  13270. // "path": "liveBroadcasts",
  13271. // "request": {
  13272. // "$ref": "LiveBroadcast"
  13273. // },
  13274. // "response": {
  13275. // "$ref": "LiveBroadcast"
  13276. // },
  13277. // "scopes": [
  13278. // "https://www.googleapis.com/auth/youtube",
  13279. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13280. // ]
  13281. // }
  13282. }
  13283. // method id "youtube.liveBroadcasts.list":
  13284. type LiveBroadcastsListCall struct {
  13285. s *Service
  13286. urlParams_ gensupport.URLParams
  13287. ifNoneMatch_ string
  13288. ctx_ context.Context
  13289. header_ http.Header
  13290. }
  13291. // List: Returns a list of YouTube broadcasts that match the API request
  13292. // parameters.
  13293. func (r *LiveBroadcastsService) List(part string) *LiveBroadcastsListCall {
  13294. c := &LiveBroadcastsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13295. c.urlParams_.Set("part", part)
  13296. return c
  13297. }
  13298. // BroadcastStatus sets the optional parameter "broadcastStatus": The
  13299. // broadcastStatus parameter filters the API response to only include
  13300. // broadcasts with the specified status.
  13301. //
  13302. // Possible values:
  13303. // "active" - Return current live broadcasts.
  13304. // "all" - Return all broadcasts.
  13305. // "completed" - Return broadcasts that have already ended.
  13306. // "upcoming" - Return broadcasts that have not yet started.
  13307. func (c *LiveBroadcastsListCall) BroadcastStatus(broadcastStatus string) *LiveBroadcastsListCall {
  13308. c.urlParams_.Set("broadcastStatus", broadcastStatus)
  13309. return c
  13310. }
  13311. // BroadcastType sets the optional parameter "broadcastType": The
  13312. // broadcastType parameter filters the API response to only include
  13313. // broadcasts with the specified type. This is only compatible with the
  13314. // mine filter for now.
  13315. //
  13316. // Possible values:
  13317. // "all" - Return all broadcasts.
  13318. // "event" - Return only scheduled event broadcasts.
  13319. // "persistent" - Return only persistent broadcasts.
  13320. func (c *LiveBroadcastsListCall) BroadcastType(broadcastType string) *LiveBroadcastsListCall {
  13321. c.urlParams_.Set("broadcastType", broadcastType)
  13322. return c
  13323. }
  13324. // Id sets the optional parameter "id": The id parameter specifies a
  13325. // comma-separated list of YouTube broadcast IDs that identify the
  13326. // broadcasts being retrieved. In a liveBroadcast resource, the id
  13327. // property specifies the broadcast's ID.
  13328. func (c *LiveBroadcastsListCall) Id(id string) *LiveBroadcastsListCall {
  13329. c.urlParams_.Set("id", id)
  13330. return c
  13331. }
  13332. // MaxResults sets the optional parameter "maxResults": The maxResults
  13333. // parameter specifies the maximum number of items that should be
  13334. // returned in the result set.
  13335. func (c *LiveBroadcastsListCall) MaxResults(maxResults int64) *LiveBroadcastsListCall {
  13336. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13337. return c
  13338. }
  13339. // Mine sets the optional parameter "mine": The mine parameter can be
  13340. // used to instruct the API to only return broadcasts owned by the
  13341. // authenticated user. Set the parameter value to true to only retrieve
  13342. // your own broadcasts.
  13343. func (c *LiveBroadcastsListCall) Mine(mine bool) *LiveBroadcastsListCall {
  13344. c.urlParams_.Set("mine", fmt.Sprint(mine))
  13345. return c
  13346. }
  13347. // OnBehalfOfContentOwner sets the optional parameter
  13348. // "onBehalfOfContentOwner": Note: This parameter is intended
  13349. // exclusively for YouTube content partners.
  13350. //
  13351. // The onBehalfOfContentOwner parameter indicates that the request's
  13352. // authorization credentials identify a YouTube CMS user who is acting
  13353. // on behalf of the content owner specified in the parameter value. This
  13354. // parameter is intended for YouTube content partners that own and
  13355. // manage many different YouTube channels. It allows content owners to
  13356. // authenticate once and get access to all their video and channel data,
  13357. // without having to provide authentication credentials for each
  13358. // individual channel. The CMS account that the user authenticates with
  13359. // must be linked to the specified YouTube content owner.
  13360. func (c *LiveBroadcastsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsListCall {
  13361. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13362. return c
  13363. }
  13364. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13365. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13366. // properly authorized request. Note: This parameter is intended
  13367. // exclusively for YouTube content partners.
  13368. //
  13369. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13370. // channel ID of the channel to which a video is being added. This
  13371. // parameter is required when a request specifies a value for the
  13372. // onBehalfOfContentOwner parameter, and it can only be used in
  13373. // conjunction with that parameter. In addition, the request must be
  13374. // authorized using a CMS account that is linked to the content owner
  13375. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13376. // channel that the onBehalfOfContentOwnerChannel parameter value
  13377. // specifies must be linked to the content owner that the
  13378. // onBehalfOfContentOwner parameter specifies.
  13379. //
  13380. // This parameter is intended for YouTube content partners that own and
  13381. // manage many different YouTube channels. It allows content owners to
  13382. // authenticate once and perform actions on behalf of the channel
  13383. // specified in the parameter value, without having to provide
  13384. // authentication credentials for each separate channel.
  13385. func (c *LiveBroadcastsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsListCall {
  13386. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13387. return c
  13388. }
  13389. // PageToken sets the optional parameter "pageToken": The pageToken
  13390. // parameter identifies a specific page in the result set that should be
  13391. // returned. In an API response, the nextPageToken and prevPageToken
  13392. // properties identify other pages that could be retrieved.
  13393. func (c *LiveBroadcastsListCall) PageToken(pageToken string) *LiveBroadcastsListCall {
  13394. c.urlParams_.Set("pageToken", pageToken)
  13395. return c
  13396. }
  13397. // Fields allows partial responses to be retrieved. See
  13398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13399. // for more information.
  13400. func (c *LiveBroadcastsListCall) Fields(s ...googleapi.Field) *LiveBroadcastsListCall {
  13401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13402. return c
  13403. }
  13404. // IfNoneMatch sets the optional parameter which makes the operation
  13405. // fail if the object's ETag matches the given value. This is useful for
  13406. // getting updates only after the object has changed since the last
  13407. // request. Use googleapi.IsNotModified to check whether the response
  13408. // error from Do is the result of In-None-Match.
  13409. func (c *LiveBroadcastsListCall) IfNoneMatch(entityTag string) *LiveBroadcastsListCall {
  13410. c.ifNoneMatch_ = entityTag
  13411. return c
  13412. }
  13413. // Context sets the context to be used in this call's Do method. Any
  13414. // pending HTTP request will be aborted if the provided context is
  13415. // canceled.
  13416. func (c *LiveBroadcastsListCall) Context(ctx context.Context) *LiveBroadcastsListCall {
  13417. c.ctx_ = ctx
  13418. return c
  13419. }
  13420. // Header returns an http.Header that can be modified by the caller to
  13421. // add HTTP headers to the request.
  13422. func (c *LiveBroadcastsListCall) Header() http.Header {
  13423. if c.header_ == nil {
  13424. c.header_ = make(http.Header)
  13425. }
  13426. return c.header_
  13427. }
  13428. func (c *LiveBroadcastsListCall) doRequest(alt string) (*http.Response, error) {
  13429. reqHeaders := make(http.Header)
  13430. for k, v := range c.header_ {
  13431. reqHeaders[k] = v
  13432. }
  13433. reqHeaders.Set("User-Agent", c.s.userAgent())
  13434. if c.ifNoneMatch_ != "" {
  13435. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13436. }
  13437. var body io.Reader = nil
  13438. c.urlParams_.Set("alt", alt)
  13439. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13440. urls += "?" + c.urlParams_.Encode()
  13441. req, _ := http.NewRequest("GET", urls, body)
  13442. req.Header = reqHeaders
  13443. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13444. }
  13445. // Do executes the "youtube.liveBroadcasts.list" call.
  13446. // Exactly one of *LiveBroadcastListResponse or error will be non-nil.
  13447. // Any non-2xx status code is an error. Response headers are in either
  13448. // *LiveBroadcastListResponse.ServerResponse.Header or (if a response
  13449. // was returned at all) in error.(*googleapi.Error).Header. Use
  13450. // googleapi.IsNotModified to check whether the returned error was
  13451. // because http.StatusNotModified was returned.
  13452. func (c *LiveBroadcastsListCall) Do(opts ...googleapi.CallOption) (*LiveBroadcastListResponse, error) {
  13453. gensupport.SetOptions(c.urlParams_, opts...)
  13454. res, err := c.doRequest("json")
  13455. if res != nil && res.StatusCode == http.StatusNotModified {
  13456. if res.Body != nil {
  13457. res.Body.Close()
  13458. }
  13459. return nil, &googleapi.Error{
  13460. Code: res.StatusCode,
  13461. Header: res.Header,
  13462. }
  13463. }
  13464. if err != nil {
  13465. return nil, err
  13466. }
  13467. defer googleapi.CloseBody(res)
  13468. if err := googleapi.CheckResponse(res); err != nil {
  13469. return nil, err
  13470. }
  13471. ret := &LiveBroadcastListResponse{
  13472. ServerResponse: googleapi.ServerResponse{
  13473. Header: res.Header,
  13474. HTTPStatusCode: res.StatusCode,
  13475. },
  13476. }
  13477. target := &ret
  13478. if err := gensupport.DecodeResponse(target, res); err != nil {
  13479. return nil, err
  13480. }
  13481. return ret, nil
  13482. // {
  13483. // "description": "Returns a list of YouTube broadcasts that match the API request parameters.",
  13484. // "httpMethod": "GET",
  13485. // "id": "youtube.liveBroadcasts.list",
  13486. // "parameterOrder": [
  13487. // "part"
  13488. // ],
  13489. // "parameters": {
  13490. // "broadcastStatus": {
  13491. // "description": "The broadcastStatus parameter filters the API response to only include broadcasts with the specified status.",
  13492. // "enum": [
  13493. // "active",
  13494. // "all",
  13495. // "completed",
  13496. // "upcoming"
  13497. // ],
  13498. // "enumDescriptions": [
  13499. // "Return current live broadcasts.",
  13500. // "Return all broadcasts.",
  13501. // "Return broadcasts that have already ended.",
  13502. // "Return broadcasts that have not yet started."
  13503. // ],
  13504. // "location": "query",
  13505. // "type": "string"
  13506. // },
  13507. // "broadcastType": {
  13508. // "default": "BROADCAST_TYPE_FILTER_EVENT",
  13509. // "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.",
  13510. // "enum": [
  13511. // "all",
  13512. // "event",
  13513. // "persistent"
  13514. // ],
  13515. // "enumDescriptions": [
  13516. // "Return all broadcasts.",
  13517. // "Return only scheduled event broadcasts.",
  13518. // "Return only persistent broadcasts."
  13519. // ],
  13520. // "location": "query",
  13521. // "type": "string"
  13522. // },
  13523. // "id": {
  13524. // "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.",
  13525. // "location": "query",
  13526. // "type": "string"
  13527. // },
  13528. // "maxResults": {
  13529. // "default": "5",
  13530. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  13531. // "format": "uint32",
  13532. // "location": "query",
  13533. // "maximum": "50",
  13534. // "minimum": "0",
  13535. // "type": "integer"
  13536. // },
  13537. // "mine": {
  13538. // "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.",
  13539. // "location": "query",
  13540. // "type": "boolean"
  13541. // },
  13542. // "onBehalfOfContentOwner": {
  13543. // "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.",
  13544. // "location": "query",
  13545. // "type": "string"
  13546. // },
  13547. // "onBehalfOfContentOwnerChannel": {
  13548. // "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.",
  13549. // "location": "query",
  13550. // "type": "string"
  13551. // },
  13552. // "pageToken": {
  13553. // "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.",
  13554. // "location": "query",
  13555. // "type": "string"
  13556. // },
  13557. // "part": {
  13558. // "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.",
  13559. // "location": "query",
  13560. // "required": true,
  13561. // "type": "string"
  13562. // }
  13563. // },
  13564. // "path": "liveBroadcasts",
  13565. // "response": {
  13566. // "$ref": "LiveBroadcastListResponse"
  13567. // },
  13568. // "scopes": [
  13569. // "https://www.googleapis.com/auth/youtube",
  13570. // "https://www.googleapis.com/auth/youtube.force-ssl",
  13571. // "https://www.googleapis.com/auth/youtube.readonly"
  13572. // ]
  13573. // }
  13574. }
  13575. // Pages invokes f for each page of results.
  13576. // A non-nil error returned from f will halt the iteration.
  13577. // The provided context supersedes any context provided to the Context method.
  13578. func (c *LiveBroadcastsListCall) Pages(ctx context.Context, f func(*LiveBroadcastListResponse) error) error {
  13579. c.ctx_ = ctx
  13580. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13581. for {
  13582. x, err := c.Do()
  13583. if err != nil {
  13584. return err
  13585. }
  13586. if err := f(x); err != nil {
  13587. return err
  13588. }
  13589. if x.NextPageToken == "" {
  13590. return nil
  13591. }
  13592. c.PageToken(x.NextPageToken)
  13593. }
  13594. }
  13595. // method id "youtube.liveBroadcasts.transition":
  13596. type LiveBroadcastsTransitionCall struct {
  13597. s *Service
  13598. urlParams_ gensupport.URLParams
  13599. ctx_ context.Context
  13600. header_ http.Header
  13601. }
  13602. // Transition: Changes the status of a YouTube live broadcast and
  13603. // initiates any processes associated with the new status. For example,
  13604. // when you transition a broadcast's status to testing, YouTube starts
  13605. // to transmit video to that broadcast's monitor stream. Before calling
  13606. // this method, you should confirm that the value of the
  13607. // status.streamStatus property for the stream bound to your broadcast
  13608. // is active.
  13609. func (r *LiveBroadcastsService) Transition(broadcastStatus string, id string, part string) *LiveBroadcastsTransitionCall {
  13610. c := &LiveBroadcastsTransitionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13611. c.urlParams_.Set("broadcastStatus", broadcastStatus)
  13612. c.urlParams_.Set("id", id)
  13613. c.urlParams_.Set("part", part)
  13614. return c
  13615. }
  13616. // OnBehalfOfContentOwner sets the optional parameter
  13617. // "onBehalfOfContentOwner": Note: This parameter is intended
  13618. // exclusively for YouTube content partners.
  13619. //
  13620. // The onBehalfOfContentOwner parameter indicates that the request's
  13621. // authorization credentials identify a YouTube CMS user who is acting
  13622. // on behalf of the content owner specified in the parameter value. This
  13623. // parameter is intended for YouTube content partners that own and
  13624. // manage many different YouTube channels. It allows content owners to
  13625. // authenticate once and get access to all their video and channel data,
  13626. // without having to provide authentication credentials for each
  13627. // individual channel. The CMS account that the user authenticates with
  13628. // must be linked to the specified YouTube content owner.
  13629. func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsTransitionCall {
  13630. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13631. return c
  13632. }
  13633. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13634. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13635. // properly authorized request. Note: This parameter is intended
  13636. // exclusively for YouTube content partners.
  13637. //
  13638. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13639. // channel ID of the channel to which a video is being added. This
  13640. // parameter is required when a request specifies a value for the
  13641. // onBehalfOfContentOwner parameter, and it can only be used in
  13642. // conjunction with that parameter. In addition, the request must be
  13643. // authorized using a CMS account that is linked to the content owner
  13644. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13645. // channel that the onBehalfOfContentOwnerChannel parameter value
  13646. // specifies must be linked to the content owner that the
  13647. // onBehalfOfContentOwner parameter specifies.
  13648. //
  13649. // This parameter is intended for YouTube content partners that own and
  13650. // manage many different YouTube channels. It allows content owners to
  13651. // authenticate once and perform actions on behalf of the channel
  13652. // specified in the parameter value, without having to provide
  13653. // authentication credentials for each separate channel.
  13654. func (c *LiveBroadcastsTransitionCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsTransitionCall {
  13655. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13656. return c
  13657. }
  13658. // Fields allows partial responses to be retrieved. See
  13659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13660. // for more information.
  13661. func (c *LiveBroadcastsTransitionCall) Fields(s ...googleapi.Field) *LiveBroadcastsTransitionCall {
  13662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13663. return c
  13664. }
  13665. // Context sets the context to be used in this call's Do method. Any
  13666. // pending HTTP request will be aborted if the provided context is
  13667. // canceled.
  13668. func (c *LiveBroadcastsTransitionCall) Context(ctx context.Context) *LiveBroadcastsTransitionCall {
  13669. c.ctx_ = ctx
  13670. return c
  13671. }
  13672. // Header returns an http.Header that can be modified by the caller to
  13673. // add HTTP headers to the request.
  13674. func (c *LiveBroadcastsTransitionCall) Header() http.Header {
  13675. if c.header_ == nil {
  13676. c.header_ = make(http.Header)
  13677. }
  13678. return c.header_
  13679. }
  13680. func (c *LiveBroadcastsTransitionCall) doRequest(alt string) (*http.Response, error) {
  13681. reqHeaders := make(http.Header)
  13682. for k, v := range c.header_ {
  13683. reqHeaders[k] = v
  13684. }
  13685. reqHeaders.Set("User-Agent", c.s.userAgent())
  13686. var body io.Reader = nil
  13687. c.urlParams_.Set("alt", alt)
  13688. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts/transition")
  13689. urls += "?" + c.urlParams_.Encode()
  13690. req, _ := http.NewRequest("POST", urls, body)
  13691. req.Header = reqHeaders
  13692. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13693. }
  13694. // Do executes the "youtube.liveBroadcasts.transition" call.
  13695. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  13696. // status code is an error. Response headers are in either
  13697. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  13698. // at all) in error.(*googleapi.Error).Header. Use
  13699. // googleapi.IsNotModified to check whether the returned error was
  13700. // because http.StatusNotModified was returned.
  13701. func (c *LiveBroadcastsTransitionCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  13702. gensupport.SetOptions(c.urlParams_, opts...)
  13703. res, err := c.doRequest("json")
  13704. if res != nil && res.StatusCode == http.StatusNotModified {
  13705. if res.Body != nil {
  13706. res.Body.Close()
  13707. }
  13708. return nil, &googleapi.Error{
  13709. Code: res.StatusCode,
  13710. Header: res.Header,
  13711. }
  13712. }
  13713. if err != nil {
  13714. return nil, err
  13715. }
  13716. defer googleapi.CloseBody(res)
  13717. if err := googleapi.CheckResponse(res); err != nil {
  13718. return nil, err
  13719. }
  13720. ret := &LiveBroadcast{
  13721. ServerResponse: googleapi.ServerResponse{
  13722. Header: res.Header,
  13723. HTTPStatusCode: res.StatusCode,
  13724. },
  13725. }
  13726. target := &ret
  13727. if err := gensupport.DecodeResponse(target, res); err != nil {
  13728. return nil, err
  13729. }
  13730. return ret, nil
  13731. // {
  13732. // "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.",
  13733. // "httpMethod": "POST",
  13734. // "id": "youtube.liveBroadcasts.transition",
  13735. // "parameterOrder": [
  13736. // "broadcastStatus",
  13737. // "id",
  13738. // "part"
  13739. // ],
  13740. // "parameters": {
  13741. // "broadcastStatus": {
  13742. // "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.",
  13743. // "enum": [
  13744. // "complete",
  13745. // "live",
  13746. // "testing"
  13747. // ],
  13748. // "enumDescriptions": [
  13749. // "The broadcast is over. YouTube stops transmitting video.",
  13750. // "The broadcast is visible to its audience. YouTube transmits video to the broadcast's monitor stream and its broadcast stream.",
  13751. // "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."
  13752. // ],
  13753. // "location": "query",
  13754. // "required": true,
  13755. // "type": "string"
  13756. // },
  13757. // "id": {
  13758. // "description": "The id parameter specifies the unique ID of the broadcast that is transitioning to another status.",
  13759. // "location": "query",
  13760. // "required": true,
  13761. // "type": "string"
  13762. // },
  13763. // "onBehalfOfContentOwner": {
  13764. // "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.",
  13765. // "location": "query",
  13766. // "type": "string"
  13767. // },
  13768. // "onBehalfOfContentOwnerChannel": {
  13769. // "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.",
  13770. // "location": "query",
  13771. // "type": "string"
  13772. // },
  13773. // "part": {
  13774. // "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.",
  13775. // "location": "query",
  13776. // "required": true,
  13777. // "type": "string"
  13778. // }
  13779. // },
  13780. // "path": "liveBroadcasts/transition",
  13781. // "response": {
  13782. // "$ref": "LiveBroadcast"
  13783. // },
  13784. // "scopes": [
  13785. // "https://www.googleapis.com/auth/youtube",
  13786. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13787. // ]
  13788. // }
  13789. }
  13790. // method id "youtube.liveBroadcasts.update":
  13791. type LiveBroadcastsUpdateCall struct {
  13792. s *Service
  13793. livebroadcast *LiveBroadcast
  13794. urlParams_ gensupport.URLParams
  13795. ctx_ context.Context
  13796. header_ http.Header
  13797. }
  13798. // Update: Updates a broadcast. For example, you could modify the
  13799. // broadcast settings defined in the liveBroadcast resource's
  13800. // contentDetails object.
  13801. func (r *LiveBroadcastsService) Update(part string, livebroadcast *LiveBroadcast) *LiveBroadcastsUpdateCall {
  13802. c := &LiveBroadcastsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13803. c.urlParams_.Set("part", part)
  13804. c.livebroadcast = livebroadcast
  13805. return c
  13806. }
  13807. // OnBehalfOfContentOwner sets the optional parameter
  13808. // "onBehalfOfContentOwner": Note: This parameter is intended
  13809. // exclusively for YouTube content partners.
  13810. //
  13811. // The onBehalfOfContentOwner parameter indicates that the request's
  13812. // authorization credentials identify a YouTube CMS user who is acting
  13813. // on behalf of the content owner specified in the parameter value. This
  13814. // parameter is intended for YouTube content partners that own and
  13815. // manage many different YouTube channels. It allows content owners to
  13816. // authenticate once and get access to all their video and channel data,
  13817. // without having to provide authentication credentials for each
  13818. // individual channel. The CMS account that the user authenticates with
  13819. // must be linked to the specified YouTube content owner.
  13820. func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveBroadcastsUpdateCall {
  13821. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  13822. return c
  13823. }
  13824. // OnBehalfOfContentOwnerChannel sets the optional parameter
  13825. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  13826. // properly authorized request. Note: This parameter is intended
  13827. // exclusively for YouTube content partners.
  13828. //
  13829. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  13830. // channel ID of the channel to which a video is being added. This
  13831. // parameter is required when a request specifies a value for the
  13832. // onBehalfOfContentOwner parameter, and it can only be used in
  13833. // conjunction with that parameter. In addition, the request must be
  13834. // authorized using a CMS account that is linked to the content owner
  13835. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  13836. // channel that the onBehalfOfContentOwnerChannel parameter value
  13837. // specifies must be linked to the content owner that the
  13838. // onBehalfOfContentOwner parameter specifies.
  13839. //
  13840. // This parameter is intended for YouTube content partners that own and
  13841. // manage many different YouTube channels. It allows content owners to
  13842. // authenticate once and perform actions on behalf of the channel
  13843. // specified in the parameter value, without having to provide
  13844. // authentication credentials for each separate channel.
  13845. func (c *LiveBroadcastsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveBroadcastsUpdateCall {
  13846. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  13847. return c
  13848. }
  13849. // Fields allows partial responses to be retrieved. See
  13850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13851. // for more information.
  13852. func (c *LiveBroadcastsUpdateCall) Fields(s ...googleapi.Field) *LiveBroadcastsUpdateCall {
  13853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13854. return c
  13855. }
  13856. // Context sets the context to be used in this call's Do method. Any
  13857. // pending HTTP request will be aborted if the provided context is
  13858. // canceled.
  13859. func (c *LiveBroadcastsUpdateCall) Context(ctx context.Context) *LiveBroadcastsUpdateCall {
  13860. c.ctx_ = ctx
  13861. return c
  13862. }
  13863. // Header returns an http.Header that can be modified by the caller to
  13864. // add HTTP headers to the request.
  13865. func (c *LiveBroadcastsUpdateCall) Header() http.Header {
  13866. if c.header_ == nil {
  13867. c.header_ = make(http.Header)
  13868. }
  13869. return c.header_
  13870. }
  13871. func (c *LiveBroadcastsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13872. reqHeaders := make(http.Header)
  13873. for k, v := range c.header_ {
  13874. reqHeaders[k] = v
  13875. }
  13876. reqHeaders.Set("User-Agent", c.s.userAgent())
  13877. var body io.Reader = nil
  13878. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livebroadcast)
  13879. if err != nil {
  13880. return nil, err
  13881. }
  13882. reqHeaders.Set("Content-Type", "application/json")
  13883. c.urlParams_.Set("alt", alt)
  13884. urls := googleapi.ResolveRelative(c.s.BasePath, "liveBroadcasts")
  13885. urls += "?" + c.urlParams_.Encode()
  13886. req, _ := http.NewRequest("PUT", urls, body)
  13887. req.Header = reqHeaders
  13888. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13889. }
  13890. // Do executes the "youtube.liveBroadcasts.update" call.
  13891. // Exactly one of *LiveBroadcast or error will be non-nil. Any non-2xx
  13892. // status code is an error. Response headers are in either
  13893. // *LiveBroadcast.ServerResponse.Header or (if a response was returned
  13894. // at all) in error.(*googleapi.Error).Header. Use
  13895. // googleapi.IsNotModified to check whether the returned error was
  13896. // because http.StatusNotModified was returned.
  13897. func (c *LiveBroadcastsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveBroadcast, error) {
  13898. gensupport.SetOptions(c.urlParams_, opts...)
  13899. res, err := c.doRequest("json")
  13900. if res != nil && res.StatusCode == http.StatusNotModified {
  13901. if res.Body != nil {
  13902. res.Body.Close()
  13903. }
  13904. return nil, &googleapi.Error{
  13905. Code: res.StatusCode,
  13906. Header: res.Header,
  13907. }
  13908. }
  13909. if err != nil {
  13910. return nil, err
  13911. }
  13912. defer googleapi.CloseBody(res)
  13913. if err := googleapi.CheckResponse(res); err != nil {
  13914. return nil, err
  13915. }
  13916. ret := &LiveBroadcast{
  13917. ServerResponse: googleapi.ServerResponse{
  13918. Header: res.Header,
  13919. HTTPStatusCode: res.StatusCode,
  13920. },
  13921. }
  13922. target := &ret
  13923. if err := gensupport.DecodeResponse(target, res); err != nil {
  13924. return nil, err
  13925. }
  13926. return ret, nil
  13927. // {
  13928. // "description": "Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object.",
  13929. // "httpMethod": "PUT",
  13930. // "id": "youtube.liveBroadcasts.update",
  13931. // "parameterOrder": [
  13932. // "part"
  13933. // ],
  13934. // "parameters": {
  13935. // "onBehalfOfContentOwner": {
  13936. // "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.",
  13937. // "location": "query",
  13938. // "type": "string"
  13939. // },
  13940. // "onBehalfOfContentOwnerChannel": {
  13941. // "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.",
  13942. // "location": "query",
  13943. // "type": "string"
  13944. // },
  13945. // "part": {
  13946. // "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.",
  13947. // "location": "query",
  13948. // "required": true,
  13949. // "type": "string"
  13950. // }
  13951. // },
  13952. // "path": "liveBroadcasts",
  13953. // "request": {
  13954. // "$ref": "LiveBroadcast"
  13955. // },
  13956. // "response": {
  13957. // "$ref": "LiveBroadcast"
  13958. // },
  13959. // "scopes": [
  13960. // "https://www.googleapis.com/auth/youtube",
  13961. // "https://www.googleapis.com/auth/youtube.force-ssl"
  13962. // ]
  13963. // }
  13964. }
  13965. // method id "youtube.liveChatBans.delete":
  13966. type LiveChatBansDeleteCall struct {
  13967. s *Service
  13968. urlParams_ gensupport.URLParams
  13969. ctx_ context.Context
  13970. header_ http.Header
  13971. }
  13972. // Delete: Removes a chat ban.
  13973. func (r *LiveChatBansService) Delete(id string) *LiveChatBansDeleteCall {
  13974. c := &LiveChatBansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13975. c.urlParams_.Set("id", id)
  13976. return c
  13977. }
  13978. // Fields allows partial responses to be retrieved. See
  13979. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13980. // for more information.
  13981. func (c *LiveChatBansDeleteCall) Fields(s ...googleapi.Field) *LiveChatBansDeleteCall {
  13982. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13983. return c
  13984. }
  13985. // Context sets the context to be used in this call's Do method. Any
  13986. // pending HTTP request will be aborted if the provided context is
  13987. // canceled.
  13988. func (c *LiveChatBansDeleteCall) Context(ctx context.Context) *LiveChatBansDeleteCall {
  13989. c.ctx_ = ctx
  13990. return c
  13991. }
  13992. // Header returns an http.Header that can be modified by the caller to
  13993. // add HTTP headers to the request.
  13994. func (c *LiveChatBansDeleteCall) Header() http.Header {
  13995. if c.header_ == nil {
  13996. c.header_ = make(http.Header)
  13997. }
  13998. return c.header_
  13999. }
  14000. func (c *LiveChatBansDeleteCall) doRequest(alt string) (*http.Response, error) {
  14001. reqHeaders := make(http.Header)
  14002. for k, v := range c.header_ {
  14003. reqHeaders[k] = v
  14004. }
  14005. reqHeaders.Set("User-Agent", c.s.userAgent())
  14006. var body io.Reader = nil
  14007. c.urlParams_.Set("alt", alt)
  14008. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/bans")
  14009. urls += "?" + c.urlParams_.Encode()
  14010. req, _ := http.NewRequest("DELETE", urls, body)
  14011. req.Header = reqHeaders
  14012. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14013. }
  14014. // Do executes the "youtube.liveChatBans.delete" call.
  14015. func (c *LiveChatBansDeleteCall) Do(opts ...googleapi.CallOption) error {
  14016. gensupport.SetOptions(c.urlParams_, opts...)
  14017. res, err := c.doRequest("json")
  14018. if err != nil {
  14019. return err
  14020. }
  14021. defer googleapi.CloseBody(res)
  14022. if err := googleapi.CheckResponse(res); err != nil {
  14023. return err
  14024. }
  14025. return nil
  14026. // {
  14027. // "description": "Removes a chat ban.",
  14028. // "httpMethod": "DELETE",
  14029. // "id": "youtube.liveChatBans.delete",
  14030. // "parameterOrder": [
  14031. // "id"
  14032. // ],
  14033. // "parameters": {
  14034. // "id": {
  14035. // "description": "The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat.",
  14036. // "location": "query",
  14037. // "required": true,
  14038. // "type": "string"
  14039. // }
  14040. // },
  14041. // "path": "liveChat/bans",
  14042. // "scopes": [
  14043. // "https://www.googleapis.com/auth/youtube",
  14044. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14045. // ]
  14046. // }
  14047. }
  14048. // method id "youtube.liveChatBans.insert":
  14049. type LiveChatBansInsertCall struct {
  14050. s *Service
  14051. livechatban *LiveChatBan
  14052. urlParams_ gensupport.URLParams
  14053. ctx_ context.Context
  14054. header_ http.Header
  14055. }
  14056. // Insert: Adds a new ban to the chat.
  14057. func (r *LiveChatBansService) Insert(part string, livechatban *LiveChatBan) *LiveChatBansInsertCall {
  14058. c := &LiveChatBansInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14059. c.urlParams_.Set("part", part)
  14060. c.livechatban = livechatban
  14061. return c
  14062. }
  14063. // Fields allows partial responses to be retrieved. See
  14064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14065. // for more information.
  14066. func (c *LiveChatBansInsertCall) Fields(s ...googleapi.Field) *LiveChatBansInsertCall {
  14067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14068. return c
  14069. }
  14070. // Context sets the context to be used in this call's Do method. Any
  14071. // pending HTTP request will be aborted if the provided context is
  14072. // canceled.
  14073. func (c *LiveChatBansInsertCall) Context(ctx context.Context) *LiveChatBansInsertCall {
  14074. c.ctx_ = ctx
  14075. return c
  14076. }
  14077. // Header returns an http.Header that can be modified by the caller to
  14078. // add HTTP headers to the request.
  14079. func (c *LiveChatBansInsertCall) Header() http.Header {
  14080. if c.header_ == nil {
  14081. c.header_ = make(http.Header)
  14082. }
  14083. return c.header_
  14084. }
  14085. func (c *LiveChatBansInsertCall) doRequest(alt string) (*http.Response, error) {
  14086. reqHeaders := make(http.Header)
  14087. for k, v := range c.header_ {
  14088. reqHeaders[k] = v
  14089. }
  14090. reqHeaders.Set("User-Agent", c.s.userAgent())
  14091. var body io.Reader = nil
  14092. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatban)
  14093. if err != nil {
  14094. return nil, err
  14095. }
  14096. reqHeaders.Set("Content-Type", "application/json")
  14097. c.urlParams_.Set("alt", alt)
  14098. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/bans")
  14099. urls += "?" + c.urlParams_.Encode()
  14100. req, _ := http.NewRequest("POST", urls, body)
  14101. req.Header = reqHeaders
  14102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14103. }
  14104. // Do executes the "youtube.liveChatBans.insert" call.
  14105. // Exactly one of *LiveChatBan or error will be non-nil. Any non-2xx
  14106. // status code is an error. Response headers are in either
  14107. // *LiveChatBan.ServerResponse.Header or (if a response was returned at
  14108. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  14109. // to check whether the returned error was because
  14110. // http.StatusNotModified was returned.
  14111. func (c *LiveChatBansInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatBan, error) {
  14112. gensupport.SetOptions(c.urlParams_, opts...)
  14113. res, err := c.doRequest("json")
  14114. if res != nil && res.StatusCode == http.StatusNotModified {
  14115. if res.Body != nil {
  14116. res.Body.Close()
  14117. }
  14118. return nil, &googleapi.Error{
  14119. Code: res.StatusCode,
  14120. Header: res.Header,
  14121. }
  14122. }
  14123. if err != nil {
  14124. return nil, err
  14125. }
  14126. defer googleapi.CloseBody(res)
  14127. if err := googleapi.CheckResponse(res); err != nil {
  14128. return nil, err
  14129. }
  14130. ret := &LiveChatBan{
  14131. ServerResponse: googleapi.ServerResponse{
  14132. Header: res.Header,
  14133. HTTPStatusCode: res.StatusCode,
  14134. },
  14135. }
  14136. target := &ret
  14137. if err := gensupport.DecodeResponse(target, res); err != nil {
  14138. return nil, err
  14139. }
  14140. return ret, nil
  14141. // {
  14142. // "description": "Adds a new ban to the chat.",
  14143. // "httpMethod": "POST",
  14144. // "id": "youtube.liveChatBans.insert",
  14145. // "parameterOrder": [
  14146. // "part"
  14147. // ],
  14148. // "parameters": {
  14149. // "part": {
  14150. // "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.",
  14151. // "location": "query",
  14152. // "required": true,
  14153. // "type": "string"
  14154. // }
  14155. // },
  14156. // "path": "liveChat/bans",
  14157. // "request": {
  14158. // "$ref": "LiveChatBan"
  14159. // },
  14160. // "response": {
  14161. // "$ref": "LiveChatBan"
  14162. // },
  14163. // "scopes": [
  14164. // "https://www.googleapis.com/auth/youtube",
  14165. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14166. // ]
  14167. // }
  14168. }
  14169. // method id "youtube.liveChatMessages.delete":
  14170. type LiveChatMessagesDeleteCall struct {
  14171. s *Service
  14172. urlParams_ gensupport.URLParams
  14173. ctx_ context.Context
  14174. header_ http.Header
  14175. }
  14176. // Delete: Deletes a chat message.
  14177. func (r *LiveChatMessagesService) Delete(id string) *LiveChatMessagesDeleteCall {
  14178. c := &LiveChatMessagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14179. c.urlParams_.Set("id", id)
  14180. return c
  14181. }
  14182. // Fields allows partial responses to be retrieved. See
  14183. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14184. // for more information.
  14185. func (c *LiveChatMessagesDeleteCall) Fields(s ...googleapi.Field) *LiveChatMessagesDeleteCall {
  14186. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14187. return c
  14188. }
  14189. // Context sets the context to be used in this call's Do method. Any
  14190. // pending HTTP request will be aborted if the provided context is
  14191. // canceled.
  14192. func (c *LiveChatMessagesDeleteCall) Context(ctx context.Context) *LiveChatMessagesDeleteCall {
  14193. c.ctx_ = ctx
  14194. return c
  14195. }
  14196. // Header returns an http.Header that can be modified by the caller to
  14197. // add HTTP headers to the request.
  14198. func (c *LiveChatMessagesDeleteCall) Header() http.Header {
  14199. if c.header_ == nil {
  14200. c.header_ = make(http.Header)
  14201. }
  14202. return c.header_
  14203. }
  14204. func (c *LiveChatMessagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  14205. reqHeaders := make(http.Header)
  14206. for k, v := range c.header_ {
  14207. reqHeaders[k] = v
  14208. }
  14209. reqHeaders.Set("User-Agent", c.s.userAgent())
  14210. var body io.Reader = nil
  14211. c.urlParams_.Set("alt", alt)
  14212. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  14213. urls += "?" + c.urlParams_.Encode()
  14214. req, _ := http.NewRequest("DELETE", urls, body)
  14215. req.Header = reqHeaders
  14216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14217. }
  14218. // Do executes the "youtube.liveChatMessages.delete" call.
  14219. func (c *LiveChatMessagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  14220. gensupport.SetOptions(c.urlParams_, opts...)
  14221. res, err := c.doRequest("json")
  14222. if err != nil {
  14223. return err
  14224. }
  14225. defer googleapi.CloseBody(res)
  14226. if err := googleapi.CheckResponse(res); err != nil {
  14227. return err
  14228. }
  14229. return nil
  14230. // {
  14231. // "description": "Deletes a chat message.",
  14232. // "httpMethod": "DELETE",
  14233. // "id": "youtube.liveChatMessages.delete",
  14234. // "parameterOrder": [
  14235. // "id"
  14236. // ],
  14237. // "parameters": {
  14238. // "id": {
  14239. // "description": "The id parameter specifies the YouTube chat message ID of the resource that is being deleted.",
  14240. // "location": "query",
  14241. // "required": true,
  14242. // "type": "string"
  14243. // }
  14244. // },
  14245. // "path": "liveChat/messages",
  14246. // "scopes": [
  14247. // "https://www.googleapis.com/auth/youtube",
  14248. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14249. // ]
  14250. // }
  14251. }
  14252. // method id "youtube.liveChatMessages.insert":
  14253. type LiveChatMessagesInsertCall struct {
  14254. s *Service
  14255. livechatmessage *LiveChatMessage
  14256. urlParams_ gensupport.URLParams
  14257. ctx_ context.Context
  14258. header_ http.Header
  14259. }
  14260. // Insert: Adds a message to a live chat.
  14261. func (r *LiveChatMessagesService) Insert(part string, livechatmessage *LiveChatMessage) *LiveChatMessagesInsertCall {
  14262. c := &LiveChatMessagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14263. c.urlParams_.Set("part", part)
  14264. c.livechatmessage = livechatmessage
  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 *LiveChatMessagesInsertCall) Fields(s ...googleapi.Field) *LiveChatMessagesInsertCall {
  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 *LiveChatMessagesInsertCall) Context(ctx context.Context) *LiveChatMessagesInsertCall {
  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 *LiveChatMessagesInsertCall) Header() http.Header {
  14284. if c.header_ == nil {
  14285. c.header_ = make(http.Header)
  14286. }
  14287. return c.header_
  14288. }
  14289. func (c *LiveChatMessagesInsertCall) 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. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmessage)
  14297. if err != nil {
  14298. return nil, err
  14299. }
  14300. reqHeaders.Set("Content-Type", "application/json")
  14301. c.urlParams_.Set("alt", alt)
  14302. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  14303. urls += "?" + c.urlParams_.Encode()
  14304. req, _ := http.NewRequest("POST", urls, body)
  14305. req.Header = reqHeaders
  14306. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14307. }
  14308. // Do executes the "youtube.liveChatMessages.insert" call.
  14309. // Exactly one of *LiveChatMessage or error will be non-nil. Any non-2xx
  14310. // status code is an error. Response headers are in either
  14311. // *LiveChatMessage.ServerResponse.Header or (if a response was returned
  14312. // at all) in error.(*googleapi.Error).Header. Use
  14313. // googleapi.IsNotModified to check whether the returned error was
  14314. // because http.StatusNotModified was returned.
  14315. func (c *LiveChatMessagesInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatMessage, error) {
  14316. gensupport.SetOptions(c.urlParams_, opts...)
  14317. res, err := c.doRequest("json")
  14318. if res != nil && res.StatusCode == http.StatusNotModified {
  14319. if res.Body != nil {
  14320. res.Body.Close()
  14321. }
  14322. return nil, &googleapi.Error{
  14323. Code: res.StatusCode,
  14324. Header: res.Header,
  14325. }
  14326. }
  14327. if err != nil {
  14328. return nil, err
  14329. }
  14330. defer googleapi.CloseBody(res)
  14331. if err := googleapi.CheckResponse(res); err != nil {
  14332. return nil, err
  14333. }
  14334. ret := &LiveChatMessage{
  14335. ServerResponse: googleapi.ServerResponse{
  14336. Header: res.Header,
  14337. HTTPStatusCode: res.StatusCode,
  14338. },
  14339. }
  14340. target := &ret
  14341. if err := gensupport.DecodeResponse(target, res); err != nil {
  14342. return nil, err
  14343. }
  14344. return ret, nil
  14345. // {
  14346. // "description": "Adds a message to a live chat.",
  14347. // "httpMethod": "POST",
  14348. // "id": "youtube.liveChatMessages.insert",
  14349. // "parameterOrder": [
  14350. // "part"
  14351. // ],
  14352. // "parameters": {
  14353. // "part": {
  14354. // "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.",
  14355. // "location": "query",
  14356. // "required": true,
  14357. // "type": "string"
  14358. // }
  14359. // },
  14360. // "path": "liveChat/messages",
  14361. // "request": {
  14362. // "$ref": "LiveChatMessage"
  14363. // },
  14364. // "response": {
  14365. // "$ref": "LiveChatMessage"
  14366. // },
  14367. // "scopes": [
  14368. // "https://www.googleapis.com/auth/youtube",
  14369. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14370. // ]
  14371. // }
  14372. }
  14373. // method id "youtube.liveChatMessages.list":
  14374. type LiveChatMessagesListCall struct {
  14375. s *Service
  14376. urlParams_ gensupport.URLParams
  14377. ifNoneMatch_ string
  14378. ctx_ context.Context
  14379. header_ http.Header
  14380. }
  14381. // List: Lists live chat messages for a specific chat.
  14382. func (r *LiveChatMessagesService) List(liveChatId string, part string) *LiveChatMessagesListCall {
  14383. c := &LiveChatMessagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14384. c.urlParams_.Set("liveChatId", liveChatId)
  14385. c.urlParams_.Set("part", part)
  14386. return c
  14387. }
  14388. // Hl sets the optional parameter "hl": The hl parameter instructs the
  14389. // API to retrieve localized resource metadata for a specific
  14390. // application language that the YouTube website supports. The parameter
  14391. // value must be a language code included in the list returned by the
  14392. // i18nLanguages.list method.
  14393. //
  14394. // If localized resource details are available in that language, the
  14395. // resource's snippet.localized object will contain the localized
  14396. // values. However, if localized details are not available, the
  14397. // snippet.localized object will contain resource details in the
  14398. // resource's default language.
  14399. func (c *LiveChatMessagesListCall) Hl(hl string) *LiveChatMessagesListCall {
  14400. c.urlParams_.Set("hl", hl)
  14401. return c
  14402. }
  14403. // MaxResults sets the optional parameter "maxResults": The maxResults
  14404. // parameter specifies the maximum number of messages that should be
  14405. // returned in the result set.
  14406. func (c *LiveChatMessagesListCall) MaxResults(maxResults int64) *LiveChatMessagesListCall {
  14407. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14408. return c
  14409. }
  14410. // PageToken sets the optional parameter "pageToken": The pageToken
  14411. // parameter identifies a specific page in the result set that should be
  14412. // returned. In an API response, the nextPageToken property identify
  14413. // other pages that could be retrieved.
  14414. func (c *LiveChatMessagesListCall) PageToken(pageToken string) *LiveChatMessagesListCall {
  14415. c.urlParams_.Set("pageToken", pageToken)
  14416. return c
  14417. }
  14418. // ProfileImageSize sets the optional parameter "profileImageSize": The
  14419. // profileImageSize parameter specifies the size of the user profile
  14420. // pictures that should be returned in the result set. Default: 88.
  14421. func (c *LiveChatMessagesListCall) ProfileImageSize(profileImageSize int64) *LiveChatMessagesListCall {
  14422. c.urlParams_.Set("profileImageSize", fmt.Sprint(profileImageSize))
  14423. return c
  14424. }
  14425. // Fields allows partial responses to be retrieved. See
  14426. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14427. // for more information.
  14428. func (c *LiveChatMessagesListCall) Fields(s ...googleapi.Field) *LiveChatMessagesListCall {
  14429. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14430. return c
  14431. }
  14432. // IfNoneMatch sets the optional parameter which makes the operation
  14433. // fail if the object's ETag matches the given value. This is useful for
  14434. // getting updates only after the object has changed since the last
  14435. // request. Use googleapi.IsNotModified to check whether the response
  14436. // error from Do is the result of In-None-Match.
  14437. func (c *LiveChatMessagesListCall) IfNoneMatch(entityTag string) *LiveChatMessagesListCall {
  14438. c.ifNoneMatch_ = entityTag
  14439. return c
  14440. }
  14441. // Context sets the context to be used in this call's Do method. Any
  14442. // pending HTTP request will be aborted if the provided context is
  14443. // canceled.
  14444. func (c *LiveChatMessagesListCall) Context(ctx context.Context) *LiveChatMessagesListCall {
  14445. c.ctx_ = ctx
  14446. return c
  14447. }
  14448. // Header returns an http.Header that can be modified by the caller to
  14449. // add HTTP headers to the request.
  14450. func (c *LiveChatMessagesListCall) Header() http.Header {
  14451. if c.header_ == nil {
  14452. c.header_ = make(http.Header)
  14453. }
  14454. return c.header_
  14455. }
  14456. func (c *LiveChatMessagesListCall) doRequest(alt string) (*http.Response, error) {
  14457. reqHeaders := make(http.Header)
  14458. for k, v := range c.header_ {
  14459. reqHeaders[k] = v
  14460. }
  14461. reqHeaders.Set("User-Agent", c.s.userAgent())
  14462. if c.ifNoneMatch_ != "" {
  14463. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14464. }
  14465. var body io.Reader = nil
  14466. c.urlParams_.Set("alt", alt)
  14467. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/messages")
  14468. urls += "?" + c.urlParams_.Encode()
  14469. req, _ := http.NewRequest("GET", urls, body)
  14470. req.Header = reqHeaders
  14471. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14472. }
  14473. // Do executes the "youtube.liveChatMessages.list" call.
  14474. // Exactly one of *LiveChatMessageListResponse or error will be non-nil.
  14475. // Any non-2xx status code is an error. Response headers are in either
  14476. // *LiveChatMessageListResponse.ServerResponse.Header or (if a response
  14477. // was returned at all) in error.(*googleapi.Error).Header. Use
  14478. // googleapi.IsNotModified to check whether the returned error was
  14479. // because http.StatusNotModified was returned.
  14480. func (c *LiveChatMessagesListCall) Do(opts ...googleapi.CallOption) (*LiveChatMessageListResponse, error) {
  14481. gensupport.SetOptions(c.urlParams_, opts...)
  14482. res, err := c.doRequest("json")
  14483. if res != nil && res.StatusCode == http.StatusNotModified {
  14484. if res.Body != nil {
  14485. res.Body.Close()
  14486. }
  14487. return nil, &googleapi.Error{
  14488. Code: res.StatusCode,
  14489. Header: res.Header,
  14490. }
  14491. }
  14492. if err != nil {
  14493. return nil, err
  14494. }
  14495. defer googleapi.CloseBody(res)
  14496. if err := googleapi.CheckResponse(res); err != nil {
  14497. return nil, err
  14498. }
  14499. ret := &LiveChatMessageListResponse{
  14500. ServerResponse: googleapi.ServerResponse{
  14501. Header: res.Header,
  14502. HTTPStatusCode: res.StatusCode,
  14503. },
  14504. }
  14505. target := &ret
  14506. if err := gensupport.DecodeResponse(target, res); err != nil {
  14507. return nil, err
  14508. }
  14509. return ret, nil
  14510. // {
  14511. // "description": "Lists live chat messages for a specific chat.",
  14512. // "httpMethod": "GET",
  14513. // "id": "youtube.liveChatMessages.list",
  14514. // "parameterOrder": [
  14515. // "liveChatId",
  14516. // "part"
  14517. // ],
  14518. // "parameters": {
  14519. // "hl": {
  14520. // "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.",
  14521. // "location": "query",
  14522. // "type": "string"
  14523. // },
  14524. // "liveChatId": {
  14525. // "description": "The liveChatId parameter specifies the ID of the chat whose messages will be returned.",
  14526. // "location": "query",
  14527. // "required": true,
  14528. // "type": "string"
  14529. // },
  14530. // "maxResults": {
  14531. // "default": "500",
  14532. // "description": "The maxResults parameter specifies the maximum number of messages that should be returned in the result set.",
  14533. // "format": "uint32",
  14534. // "location": "query",
  14535. // "maximum": "2000",
  14536. // "minimum": "200",
  14537. // "type": "integer"
  14538. // },
  14539. // "pageToken": {
  14540. // "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.",
  14541. // "location": "query",
  14542. // "type": "string"
  14543. // },
  14544. // "part": {
  14545. // "description": "The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet.",
  14546. // "location": "query",
  14547. // "required": true,
  14548. // "type": "string"
  14549. // },
  14550. // "profileImageSize": {
  14551. // "description": "The profileImageSize parameter specifies the size of the user profile pictures that should be returned in the result set. Default: 88.",
  14552. // "format": "uint32",
  14553. // "location": "query",
  14554. // "maximum": "720",
  14555. // "minimum": "16",
  14556. // "type": "integer"
  14557. // }
  14558. // },
  14559. // "path": "liveChat/messages",
  14560. // "response": {
  14561. // "$ref": "LiveChatMessageListResponse"
  14562. // },
  14563. // "scopes": [
  14564. // "https://www.googleapis.com/auth/youtube",
  14565. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14566. // "https://www.googleapis.com/auth/youtube.readonly"
  14567. // ]
  14568. // }
  14569. }
  14570. // Pages invokes f for each page of results.
  14571. // A non-nil error returned from f will halt the iteration.
  14572. // The provided context supersedes any context provided to the Context method.
  14573. func (c *LiveChatMessagesListCall) Pages(ctx context.Context, f func(*LiveChatMessageListResponse) error) error {
  14574. c.ctx_ = ctx
  14575. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14576. for {
  14577. x, err := c.Do()
  14578. if err != nil {
  14579. return err
  14580. }
  14581. if err := f(x); err != nil {
  14582. return err
  14583. }
  14584. if x.NextPageToken == "" {
  14585. return nil
  14586. }
  14587. c.PageToken(x.NextPageToken)
  14588. }
  14589. }
  14590. // method id "youtube.liveChatModerators.delete":
  14591. type LiveChatModeratorsDeleteCall struct {
  14592. s *Service
  14593. urlParams_ gensupport.URLParams
  14594. ctx_ context.Context
  14595. header_ http.Header
  14596. }
  14597. // Delete: Removes a chat moderator.
  14598. func (r *LiveChatModeratorsService) Delete(id string) *LiveChatModeratorsDeleteCall {
  14599. c := &LiveChatModeratorsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14600. c.urlParams_.Set("id", id)
  14601. return c
  14602. }
  14603. // Fields allows partial responses to be retrieved. See
  14604. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14605. // for more information.
  14606. func (c *LiveChatModeratorsDeleteCall) Fields(s ...googleapi.Field) *LiveChatModeratorsDeleteCall {
  14607. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14608. return c
  14609. }
  14610. // Context sets the context to be used in this call's Do method. Any
  14611. // pending HTTP request will be aborted if the provided context is
  14612. // canceled.
  14613. func (c *LiveChatModeratorsDeleteCall) Context(ctx context.Context) *LiveChatModeratorsDeleteCall {
  14614. c.ctx_ = ctx
  14615. return c
  14616. }
  14617. // Header returns an http.Header that can be modified by the caller to
  14618. // add HTTP headers to the request.
  14619. func (c *LiveChatModeratorsDeleteCall) Header() http.Header {
  14620. if c.header_ == nil {
  14621. c.header_ = make(http.Header)
  14622. }
  14623. return c.header_
  14624. }
  14625. func (c *LiveChatModeratorsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14626. reqHeaders := make(http.Header)
  14627. for k, v := range c.header_ {
  14628. reqHeaders[k] = v
  14629. }
  14630. reqHeaders.Set("User-Agent", c.s.userAgent())
  14631. var body io.Reader = nil
  14632. c.urlParams_.Set("alt", alt)
  14633. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  14634. urls += "?" + c.urlParams_.Encode()
  14635. req, _ := http.NewRequest("DELETE", urls, body)
  14636. req.Header = reqHeaders
  14637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14638. }
  14639. // Do executes the "youtube.liveChatModerators.delete" call.
  14640. func (c *LiveChatModeratorsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14641. gensupport.SetOptions(c.urlParams_, opts...)
  14642. res, err := c.doRequest("json")
  14643. if err != nil {
  14644. return err
  14645. }
  14646. defer googleapi.CloseBody(res)
  14647. if err := googleapi.CheckResponse(res); err != nil {
  14648. return err
  14649. }
  14650. return nil
  14651. // {
  14652. // "description": "Removes a chat moderator.",
  14653. // "httpMethod": "DELETE",
  14654. // "id": "youtube.liveChatModerators.delete",
  14655. // "parameterOrder": [
  14656. // "id"
  14657. // ],
  14658. // "parameters": {
  14659. // "id": {
  14660. // "description": "The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat.",
  14661. // "location": "query",
  14662. // "required": true,
  14663. // "type": "string"
  14664. // }
  14665. // },
  14666. // "path": "liveChat/moderators",
  14667. // "scopes": [
  14668. // "https://www.googleapis.com/auth/youtube",
  14669. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14670. // ]
  14671. // }
  14672. }
  14673. // method id "youtube.liveChatModerators.insert":
  14674. type LiveChatModeratorsInsertCall struct {
  14675. s *Service
  14676. livechatmoderator *LiveChatModerator
  14677. urlParams_ gensupport.URLParams
  14678. ctx_ context.Context
  14679. header_ http.Header
  14680. }
  14681. // Insert: Adds a new moderator for the chat.
  14682. func (r *LiveChatModeratorsService) Insert(part string, livechatmoderator *LiveChatModerator) *LiveChatModeratorsInsertCall {
  14683. c := &LiveChatModeratorsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14684. c.urlParams_.Set("part", part)
  14685. c.livechatmoderator = livechatmoderator
  14686. return c
  14687. }
  14688. // Fields allows partial responses to be retrieved. See
  14689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14690. // for more information.
  14691. func (c *LiveChatModeratorsInsertCall) Fields(s ...googleapi.Field) *LiveChatModeratorsInsertCall {
  14692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14693. return c
  14694. }
  14695. // Context sets the context to be used in this call's Do method. Any
  14696. // pending HTTP request will be aborted if the provided context is
  14697. // canceled.
  14698. func (c *LiveChatModeratorsInsertCall) Context(ctx context.Context) *LiveChatModeratorsInsertCall {
  14699. c.ctx_ = ctx
  14700. return c
  14701. }
  14702. // Header returns an http.Header that can be modified by the caller to
  14703. // add HTTP headers to the request.
  14704. func (c *LiveChatModeratorsInsertCall) Header() http.Header {
  14705. if c.header_ == nil {
  14706. c.header_ = make(http.Header)
  14707. }
  14708. return c.header_
  14709. }
  14710. func (c *LiveChatModeratorsInsertCall) doRequest(alt string) (*http.Response, error) {
  14711. reqHeaders := make(http.Header)
  14712. for k, v := range c.header_ {
  14713. reqHeaders[k] = v
  14714. }
  14715. reqHeaders.Set("User-Agent", c.s.userAgent())
  14716. var body io.Reader = nil
  14717. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livechatmoderator)
  14718. if err != nil {
  14719. return nil, err
  14720. }
  14721. reqHeaders.Set("Content-Type", "application/json")
  14722. c.urlParams_.Set("alt", alt)
  14723. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  14724. urls += "?" + c.urlParams_.Encode()
  14725. req, _ := http.NewRequest("POST", urls, body)
  14726. req.Header = reqHeaders
  14727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14728. }
  14729. // Do executes the "youtube.liveChatModerators.insert" call.
  14730. // Exactly one of *LiveChatModerator or error will be non-nil. Any
  14731. // non-2xx status code is an error. Response headers are in either
  14732. // *LiveChatModerator.ServerResponse.Header or (if a response was
  14733. // returned at all) in error.(*googleapi.Error).Header. Use
  14734. // googleapi.IsNotModified to check whether the returned error was
  14735. // because http.StatusNotModified was returned.
  14736. func (c *LiveChatModeratorsInsertCall) Do(opts ...googleapi.CallOption) (*LiveChatModerator, error) {
  14737. gensupport.SetOptions(c.urlParams_, opts...)
  14738. res, err := c.doRequest("json")
  14739. if res != nil && res.StatusCode == http.StatusNotModified {
  14740. if res.Body != nil {
  14741. res.Body.Close()
  14742. }
  14743. return nil, &googleapi.Error{
  14744. Code: res.StatusCode,
  14745. Header: res.Header,
  14746. }
  14747. }
  14748. if err != nil {
  14749. return nil, err
  14750. }
  14751. defer googleapi.CloseBody(res)
  14752. if err := googleapi.CheckResponse(res); err != nil {
  14753. return nil, err
  14754. }
  14755. ret := &LiveChatModerator{
  14756. ServerResponse: googleapi.ServerResponse{
  14757. Header: res.Header,
  14758. HTTPStatusCode: res.StatusCode,
  14759. },
  14760. }
  14761. target := &ret
  14762. if err := gensupport.DecodeResponse(target, res); err != nil {
  14763. return nil, err
  14764. }
  14765. return ret, nil
  14766. // {
  14767. // "description": "Adds a new moderator for the chat.",
  14768. // "httpMethod": "POST",
  14769. // "id": "youtube.liveChatModerators.insert",
  14770. // "parameterOrder": [
  14771. // "part"
  14772. // ],
  14773. // "parameters": {
  14774. // "part": {
  14775. // "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.",
  14776. // "location": "query",
  14777. // "required": true,
  14778. // "type": "string"
  14779. // }
  14780. // },
  14781. // "path": "liveChat/moderators",
  14782. // "request": {
  14783. // "$ref": "LiveChatModerator"
  14784. // },
  14785. // "response": {
  14786. // "$ref": "LiveChatModerator"
  14787. // },
  14788. // "scopes": [
  14789. // "https://www.googleapis.com/auth/youtube",
  14790. // "https://www.googleapis.com/auth/youtube.force-ssl"
  14791. // ]
  14792. // }
  14793. }
  14794. // method id "youtube.liveChatModerators.list":
  14795. type LiveChatModeratorsListCall struct {
  14796. s *Service
  14797. urlParams_ gensupport.URLParams
  14798. ifNoneMatch_ string
  14799. ctx_ context.Context
  14800. header_ http.Header
  14801. }
  14802. // List: Lists moderators for a live chat.
  14803. func (r *LiveChatModeratorsService) List(liveChatId string, part string) *LiveChatModeratorsListCall {
  14804. c := &LiveChatModeratorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14805. c.urlParams_.Set("liveChatId", liveChatId)
  14806. c.urlParams_.Set("part", part)
  14807. return c
  14808. }
  14809. // MaxResults sets the optional parameter "maxResults": The maxResults
  14810. // parameter specifies the maximum number of items that should be
  14811. // returned in the result set.
  14812. func (c *LiveChatModeratorsListCall) MaxResults(maxResults int64) *LiveChatModeratorsListCall {
  14813. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14814. return c
  14815. }
  14816. // PageToken sets the optional parameter "pageToken": The pageToken
  14817. // parameter identifies a specific page in the result set that should be
  14818. // returned. In an API response, the nextPageToken and prevPageToken
  14819. // properties identify other pages that could be retrieved.
  14820. func (c *LiveChatModeratorsListCall) PageToken(pageToken string) *LiveChatModeratorsListCall {
  14821. c.urlParams_.Set("pageToken", pageToken)
  14822. return c
  14823. }
  14824. // Fields allows partial responses to be retrieved. See
  14825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14826. // for more information.
  14827. func (c *LiveChatModeratorsListCall) Fields(s ...googleapi.Field) *LiveChatModeratorsListCall {
  14828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14829. return c
  14830. }
  14831. // IfNoneMatch sets the optional parameter which makes the operation
  14832. // fail if the object's ETag matches the given value. This is useful for
  14833. // getting updates only after the object has changed since the last
  14834. // request. Use googleapi.IsNotModified to check whether the response
  14835. // error from Do is the result of In-None-Match.
  14836. func (c *LiveChatModeratorsListCall) IfNoneMatch(entityTag string) *LiveChatModeratorsListCall {
  14837. c.ifNoneMatch_ = entityTag
  14838. return c
  14839. }
  14840. // Context sets the context to be used in this call's Do method. Any
  14841. // pending HTTP request will be aborted if the provided context is
  14842. // canceled.
  14843. func (c *LiveChatModeratorsListCall) Context(ctx context.Context) *LiveChatModeratorsListCall {
  14844. c.ctx_ = ctx
  14845. return c
  14846. }
  14847. // Header returns an http.Header that can be modified by the caller to
  14848. // add HTTP headers to the request.
  14849. func (c *LiveChatModeratorsListCall) Header() http.Header {
  14850. if c.header_ == nil {
  14851. c.header_ = make(http.Header)
  14852. }
  14853. return c.header_
  14854. }
  14855. func (c *LiveChatModeratorsListCall) doRequest(alt string) (*http.Response, error) {
  14856. reqHeaders := make(http.Header)
  14857. for k, v := range c.header_ {
  14858. reqHeaders[k] = v
  14859. }
  14860. reqHeaders.Set("User-Agent", c.s.userAgent())
  14861. if c.ifNoneMatch_ != "" {
  14862. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14863. }
  14864. var body io.Reader = nil
  14865. c.urlParams_.Set("alt", alt)
  14866. urls := googleapi.ResolveRelative(c.s.BasePath, "liveChat/moderators")
  14867. urls += "?" + c.urlParams_.Encode()
  14868. req, _ := http.NewRequest("GET", urls, body)
  14869. req.Header = reqHeaders
  14870. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14871. }
  14872. // Do executes the "youtube.liveChatModerators.list" call.
  14873. // Exactly one of *LiveChatModeratorListResponse or error will be
  14874. // non-nil. Any non-2xx status code is an error. Response headers are in
  14875. // either *LiveChatModeratorListResponse.ServerResponse.Header or (if a
  14876. // response was returned at all) in error.(*googleapi.Error).Header. Use
  14877. // googleapi.IsNotModified to check whether the returned error was
  14878. // because http.StatusNotModified was returned.
  14879. func (c *LiveChatModeratorsListCall) Do(opts ...googleapi.CallOption) (*LiveChatModeratorListResponse, error) {
  14880. gensupport.SetOptions(c.urlParams_, opts...)
  14881. res, err := c.doRequest("json")
  14882. if res != nil && res.StatusCode == http.StatusNotModified {
  14883. if res.Body != nil {
  14884. res.Body.Close()
  14885. }
  14886. return nil, &googleapi.Error{
  14887. Code: res.StatusCode,
  14888. Header: res.Header,
  14889. }
  14890. }
  14891. if err != nil {
  14892. return nil, err
  14893. }
  14894. defer googleapi.CloseBody(res)
  14895. if err := googleapi.CheckResponse(res); err != nil {
  14896. return nil, err
  14897. }
  14898. ret := &LiveChatModeratorListResponse{
  14899. ServerResponse: googleapi.ServerResponse{
  14900. Header: res.Header,
  14901. HTTPStatusCode: res.StatusCode,
  14902. },
  14903. }
  14904. target := &ret
  14905. if err := gensupport.DecodeResponse(target, res); err != nil {
  14906. return nil, err
  14907. }
  14908. return ret, nil
  14909. // {
  14910. // "description": "Lists moderators for a live chat.",
  14911. // "httpMethod": "GET",
  14912. // "id": "youtube.liveChatModerators.list",
  14913. // "parameterOrder": [
  14914. // "liveChatId",
  14915. // "part"
  14916. // ],
  14917. // "parameters": {
  14918. // "liveChatId": {
  14919. // "description": "The liveChatId parameter specifies the YouTube live chat for which the API should return moderators.",
  14920. // "location": "query",
  14921. // "required": true,
  14922. // "type": "string"
  14923. // },
  14924. // "maxResults": {
  14925. // "default": "5",
  14926. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  14927. // "format": "uint32",
  14928. // "location": "query",
  14929. // "maximum": "50",
  14930. // "minimum": "0",
  14931. // "type": "integer"
  14932. // },
  14933. // "pageToken": {
  14934. // "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.",
  14935. // "location": "query",
  14936. // "type": "string"
  14937. // },
  14938. // "part": {
  14939. // "description": "The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet.",
  14940. // "location": "query",
  14941. // "required": true,
  14942. // "type": "string"
  14943. // }
  14944. // },
  14945. // "path": "liveChat/moderators",
  14946. // "response": {
  14947. // "$ref": "LiveChatModeratorListResponse"
  14948. // },
  14949. // "scopes": [
  14950. // "https://www.googleapis.com/auth/youtube",
  14951. // "https://www.googleapis.com/auth/youtube.force-ssl",
  14952. // "https://www.googleapis.com/auth/youtube.readonly"
  14953. // ]
  14954. // }
  14955. }
  14956. // Pages invokes f for each page of results.
  14957. // A non-nil error returned from f will halt the iteration.
  14958. // The provided context supersedes any context provided to the Context method.
  14959. func (c *LiveChatModeratorsListCall) Pages(ctx context.Context, f func(*LiveChatModeratorListResponse) error) error {
  14960. c.ctx_ = ctx
  14961. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14962. for {
  14963. x, err := c.Do()
  14964. if err != nil {
  14965. return err
  14966. }
  14967. if err := f(x); err != nil {
  14968. return err
  14969. }
  14970. if x.NextPageToken == "" {
  14971. return nil
  14972. }
  14973. c.PageToken(x.NextPageToken)
  14974. }
  14975. }
  14976. // method id "youtube.liveStreams.delete":
  14977. type LiveStreamsDeleteCall struct {
  14978. s *Service
  14979. urlParams_ gensupport.URLParams
  14980. ctx_ context.Context
  14981. header_ http.Header
  14982. }
  14983. // Delete: Deletes a video stream.
  14984. func (r *LiveStreamsService) Delete(id string) *LiveStreamsDeleteCall {
  14985. c := &LiveStreamsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14986. c.urlParams_.Set("id", id)
  14987. return c
  14988. }
  14989. // OnBehalfOfContentOwner sets the optional parameter
  14990. // "onBehalfOfContentOwner": Note: This parameter is intended
  14991. // exclusively for YouTube content partners.
  14992. //
  14993. // The onBehalfOfContentOwner parameter indicates that the request's
  14994. // authorization credentials identify a YouTube CMS user who is acting
  14995. // on behalf of the content owner specified in the parameter value. This
  14996. // parameter is intended for YouTube content partners that own and
  14997. // manage many different YouTube channels. It allows content owners to
  14998. // authenticate once and get access to all their video and channel data,
  14999. // without having to provide authentication credentials for each
  15000. // individual channel. The CMS account that the user authenticates with
  15001. // must be linked to the specified YouTube content owner.
  15002. func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsDeleteCall {
  15003. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15004. return c
  15005. }
  15006. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15007. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15008. // properly authorized request. Note: This parameter is intended
  15009. // exclusively for YouTube content partners.
  15010. //
  15011. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15012. // channel ID of the channel to which a video is being added. This
  15013. // parameter is required when a request specifies a value for the
  15014. // onBehalfOfContentOwner parameter, and it can only be used in
  15015. // conjunction with that parameter. In addition, the request must be
  15016. // authorized using a CMS account that is linked to the content owner
  15017. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15018. // channel that the onBehalfOfContentOwnerChannel parameter value
  15019. // specifies must be linked to the content owner that the
  15020. // onBehalfOfContentOwner parameter specifies.
  15021. //
  15022. // This parameter is intended for YouTube content partners that own and
  15023. // manage many different YouTube channels. It allows content owners to
  15024. // authenticate once and perform actions on behalf of the channel
  15025. // specified in the parameter value, without having to provide
  15026. // authentication credentials for each separate channel.
  15027. func (c *LiveStreamsDeleteCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsDeleteCall {
  15028. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15029. return c
  15030. }
  15031. // Fields allows partial responses to be retrieved. See
  15032. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15033. // for more information.
  15034. func (c *LiveStreamsDeleteCall) Fields(s ...googleapi.Field) *LiveStreamsDeleteCall {
  15035. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15036. return c
  15037. }
  15038. // Context sets the context to be used in this call's Do method. Any
  15039. // pending HTTP request will be aborted if the provided context is
  15040. // canceled.
  15041. func (c *LiveStreamsDeleteCall) Context(ctx context.Context) *LiveStreamsDeleteCall {
  15042. c.ctx_ = ctx
  15043. return c
  15044. }
  15045. // Header returns an http.Header that can be modified by the caller to
  15046. // add HTTP headers to the request.
  15047. func (c *LiveStreamsDeleteCall) Header() http.Header {
  15048. if c.header_ == nil {
  15049. c.header_ = make(http.Header)
  15050. }
  15051. return c.header_
  15052. }
  15053. func (c *LiveStreamsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15054. reqHeaders := make(http.Header)
  15055. for k, v := range c.header_ {
  15056. reqHeaders[k] = v
  15057. }
  15058. reqHeaders.Set("User-Agent", c.s.userAgent())
  15059. var body io.Reader = nil
  15060. c.urlParams_.Set("alt", alt)
  15061. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15062. urls += "?" + c.urlParams_.Encode()
  15063. req, _ := http.NewRequest("DELETE", urls, body)
  15064. req.Header = reqHeaders
  15065. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15066. }
  15067. // Do executes the "youtube.liveStreams.delete" call.
  15068. func (c *LiveStreamsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15069. gensupport.SetOptions(c.urlParams_, opts...)
  15070. res, err := c.doRequest("json")
  15071. if err != nil {
  15072. return err
  15073. }
  15074. defer googleapi.CloseBody(res)
  15075. if err := googleapi.CheckResponse(res); err != nil {
  15076. return err
  15077. }
  15078. return nil
  15079. // {
  15080. // "description": "Deletes a video stream.",
  15081. // "httpMethod": "DELETE",
  15082. // "id": "youtube.liveStreams.delete",
  15083. // "parameterOrder": [
  15084. // "id"
  15085. // ],
  15086. // "parameters": {
  15087. // "id": {
  15088. // "description": "The id parameter specifies the YouTube live stream ID for the resource that is being deleted.",
  15089. // "location": "query",
  15090. // "required": true,
  15091. // "type": "string"
  15092. // },
  15093. // "onBehalfOfContentOwner": {
  15094. // "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.",
  15095. // "location": "query",
  15096. // "type": "string"
  15097. // },
  15098. // "onBehalfOfContentOwnerChannel": {
  15099. // "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.",
  15100. // "location": "query",
  15101. // "type": "string"
  15102. // }
  15103. // },
  15104. // "path": "liveStreams",
  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.liveStreams.insert":
  15112. type LiveStreamsInsertCall struct {
  15113. s *Service
  15114. livestream *LiveStream
  15115. urlParams_ gensupport.URLParams
  15116. ctx_ context.Context
  15117. header_ http.Header
  15118. }
  15119. // Insert: Creates a video stream. The stream enables you to send your
  15120. // video to YouTube, which can then broadcast the video to your
  15121. // audience.
  15122. func (r *LiveStreamsService) Insert(part string, livestream *LiveStream) *LiveStreamsInsertCall {
  15123. c := &LiveStreamsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15124. c.urlParams_.Set("part", part)
  15125. c.livestream = livestream
  15126. return c
  15127. }
  15128. // OnBehalfOfContentOwner sets the optional parameter
  15129. // "onBehalfOfContentOwner": Note: This parameter is intended
  15130. // exclusively for YouTube content partners.
  15131. //
  15132. // The onBehalfOfContentOwner parameter indicates that the request's
  15133. // authorization credentials identify a YouTube CMS user who is acting
  15134. // on behalf of the content owner specified in the parameter value. This
  15135. // parameter is intended for YouTube content partners that own and
  15136. // manage many different YouTube channels. It allows content owners to
  15137. // authenticate once and get access to all their video and channel data,
  15138. // without having to provide authentication credentials for each
  15139. // individual channel. The CMS account that the user authenticates with
  15140. // must be linked to the specified YouTube content owner.
  15141. func (c *LiveStreamsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsInsertCall {
  15142. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15143. return c
  15144. }
  15145. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15146. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15147. // properly authorized request. Note: This parameter is intended
  15148. // exclusively for YouTube content partners.
  15149. //
  15150. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15151. // channel ID of the channel to which a video is being added. This
  15152. // parameter is required when a request specifies a value for the
  15153. // onBehalfOfContentOwner parameter, and it can only be used in
  15154. // conjunction with that parameter. In addition, the request must be
  15155. // authorized using a CMS account that is linked to the content owner
  15156. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15157. // channel that the onBehalfOfContentOwnerChannel parameter value
  15158. // specifies must be linked to the content owner that the
  15159. // onBehalfOfContentOwner parameter specifies.
  15160. //
  15161. // This parameter is intended for YouTube content partners that own and
  15162. // manage many different YouTube channels. It allows content owners to
  15163. // authenticate once and perform actions on behalf of the channel
  15164. // specified in the parameter value, without having to provide
  15165. // authentication credentials for each separate channel.
  15166. func (c *LiveStreamsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsInsertCall {
  15167. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15168. return c
  15169. }
  15170. // Fields allows partial responses to be retrieved. See
  15171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15172. // for more information.
  15173. func (c *LiveStreamsInsertCall) Fields(s ...googleapi.Field) *LiveStreamsInsertCall {
  15174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15175. return c
  15176. }
  15177. // Context sets the context to be used in this call's Do method. Any
  15178. // pending HTTP request will be aborted if the provided context is
  15179. // canceled.
  15180. func (c *LiveStreamsInsertCall) Context(ctx context.Context) *LiveStreamsInsertCall {
  15181. c.ctx_ = ctx
  15182. return c
  15183. }
  15184. // Header returns an http.Header that can be modified by the caller to
  15185. // add HTTP headers to the request.
  15186. func (c *LiveStreamsInsertCall) Header() http.Header {
  15187. if c.header_ == nil {
  15188. c.header_ = make(http.Header)
  15189. }
  15190. return c.header_
  15191. }
  15192. func (c *LiveStreamsInsertCall) doRequest(alt string) (*http.Response, error) {
  15193. reqHeaders := make(http.Header)
  15194. for k, v := range c.header_ {
  15195. reqHeaders[k] = v
  15196. }
  15197. reqHeaders.Set("User-Agent", c.s.userAgent())
  15198. var body io.Reader = nil
  15199. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream)
  15200. if err != nil {
  15201. return nil, err
  15202. }
  15203. reqHeaders.Set("Content-Type", "application/json")
  15204. c.urlParams_.Set("alt", alt)
  15205. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15206. urls += "?" + c.urlParams_.Encode()
  15207. req, _ := http.NewRequest("POST", urls, body)
  15208. req.Header = reqHeaders
  15209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15210. }
  15211. // Do executes the "youtube.liveStreams.insert" call.
  15212. // Exactly one of *LiveStream or error will be non-nil. Any non-2xx
  15213. // status code is an error. Response headers are in either
  15214. // *LiveStream.ServerResponse.Header or (if a response was returned at
  15215. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15216. // to check whether the returned error was because
  15217. // http.StatusNotModified was returned.
  15218. func (c *LiveStreamsInsertCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
  15219. gensupport.SetOptions(c.urlParams_, opts...)
  15220. res, err := c.doRequest("json")
  15221. if res != nil && res.StatusCode == http.StatusNotModified {
  15222. if res.Body != nil {
  15223. res.Body.Close()
  15224. }
  15225. return nil, &googleapi.Error{
  15226. Code: res.StatusCode,
  15227. Header: res.Header,
  15228. }
  15229. }
  15230. if err != nil {
  15231. return nil, err
  15232. }
  15233. defer googleapi.CloseBody(res)
  15234. if err := googleapi.CheckResponse(res); err != nil {
  15235. return nil, err
  15236. }
  15237. ret := &LiveStream{
  15238. ServerResponse: googleapi.ServerResponse{
  15239. Header: res.Header,
  15240. HTTPStatusCode: res.StatusCode,
  15241. },
  15242. }
  15243. target := &ret
  15244. if err := gensupport.DecodeResponse(target, res); err != nil {
  15245. return nil, err
  15246. }
  15247. return ret, nil
  15248. // {
  15249. // "description": "Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience.",
  15250. // "httpMethod": "POST",
  15251. // "id": "youtube.liveStreams.insert",
  15252. // "parameterOrder": [
  15253. // "part"
  15254. // ],
  15255. // "parameters": {
  15256. // "onBehalfOfContentOwner": {
  15257. // "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.",
  15258. // "location": "query",
  15259. // "type": "string"
  15260. // },
  15261. // "onBehalfOfContentOwnerChannel": {
  15262. // "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.",
  15263. // "location": "query",
  15264. // "type": "string"
  15265. // },
  15266. // "part": {
  15267. // "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.",
  15268. // "location": "query",
  15269. // "required": true,
  15270. // "type": "string"
  15271. // }
  15272. // },
  15273. // "path": "liveStreams",
  15274. // "request": {
  15275. // "$ref": "LiveStream"
  15276. // },
  15277. // "response": {
  15278. // "$ref": "LiveStream"
  15279. // },
  15280. // "scopes": [
  15281. // "https://www.googleapis.com/auth/youtube",
  15282. // "https://www.googleapis.com/auth/youtube.force-ssl"
  15283. // ]
  15284. // }
  15285. }
  15286. // method id "youtube.liveStreams.list":
  15287. type LiveStreamsListCall struct {
  15288. s *Service
  15289. urlParams_ gensupport.URLParams
  15290. ifNoneMatch_ string
  15291. ctx_ context.Context
  15292. header_ http.Header
  15293. }
  15294. // List: Returns a list of video streams that match the API request
  15295. // parameters.
  15296. func (r *LiveStreamsService) List(part string) *LiveStreamsListCall {
  15297. c := &LiveStreamsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15298. c.urlParams_.Set("part", part)
  15299. return c
  15300. }
  15301. // Id sets the optional parameter "id": The id parameter specifies a
  15302. // comma-separated list of YouTube stream IDs that identify the streams
  15303. // being retrieved. In a liveStream resource, the id property specifies
  15304. // the stream's ID.
  15305. func (c *LiveStreamsListCall) Id(id string) *LiveStreamsListCall {
  15306. c.urlParams_.Set("id", id)
  15307. return c
  15308. }
  15309. // MaxResults sets the optional parameter "maxResults": The maxResults
  15310. // parameter specifies the maximum number of items that should be
  15311. // returned in the result set.
  15312. func (c *LiveStreamsListCall) MaxResults(maxResults int64) *LiveStreamsListCall {
  15313. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15314. return c
  15315. }
  15316. // Mine sets the optional parameter "mine": The mine parameter can be
  15317. // used to instruct the API to only return streams owned by the
  15318. // authenticated user. Set the parameter value to true to only retrieve
  15319. // your own streams.
  15320. func (c *LiveStreamsListCall) Mine(mine bool) *LiveStreamsListCall {
  15321. c.urlParams_.Set("mine", fmt.Sprint(mine))
  15322. return c
  15323. }
  15324. // OnBehalfOfContentOwner sets the optional parameter
  15325. // "onBehalfOfContentOwner": Note: This parameter is intended
  15326. // exclusively for YouTube content partners.
  15327. //
  15328. // The onBehalfOfContentOwner parameter indicates that the request's
  15329. // authorization credentials identify a YouTube CMS user who is acting
  15330. // on behalf of the content owner specified in the parameter value. This
  15331. // parameter is intended for YouTube content partners that own and
  15332. // manage many different YouTube channels. It allows content owners to
  15333. // authenticate once and get access to all their video and channel data,
  15334. // without having to provide authentication credentials for each
  15335. // individual channel. The CMS account that the user authenticates with
  15336. // must be linked to the specified YouTube content owner.
  15337. func (c *LiveStreamsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsListCall {
  15338. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15339. return c
  15340. }
  15341. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15342. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15343. // properly authorized request. Note: This parameter is intended
  15344. // exclusively for YouTube content partners.
  15345. //
  15346. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15347. // channel ID of the channel to which a video is being added. This
  15348. // parameter is required when a request specifies a value for the
  15349. // onBehalfOfContentOwner parameter, and it can only be used in
  15350. // conjunction with that parameter. In addition, the request must be
  15351. // authorized using a CMS account that is linked to the content owner
  15352. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15353. // channel that the onBehalfOfContentOwnerChannel parameter value
  15354. // specifies must be linked to the content owner that the
  15355. // onBehalfOfContentOwner parameter specifies.
  15356. //
  15357. // This parameter is intended for YouTube content partners that own and
  15358. // manage many different YouTube channels. It allows content owners to
  15359. // authenticate once and perform actions on behalf of the channel
  15360. // specified in the parameter value, without having to provide
  15361. // authentication credentials for each separate channel.
  15362. func (c *LiveStreamsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsListCall {
  15363. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15364. return c
  15365. }
  15366. // PageToken sets the optional parameter "pageToken": The pageToken
  15367. // parameter identifies a specific page in the result set that should be
  15368. // returned. In an API response, the nextPageToken and prevPageToken
  15369. // properties identify other pages that could be retrieved.
  15370. func (c *LiveStreamsListCall) PageToken(pageToken string) *LiveStreamsListCall {
  15371. c.urlParams_.Set("pageToken", pageToken)
  15372. return c
  15373. }
  15374. // Fields allows partial responses to be retrieved. See
  15375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15376. // for more information.
  15377. func (c *LiveStreamsListCall) Fields(s ...googleapi.Field) *LiveStreamsListCall {
  15378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15379. return c
  15380. }
  15381. // IfNoneMatch sets the optional parameter which makes the operation
  15382. // fail if the object's ETag matches the given value. This is useful for
  15383. // getting updates only after the object has changed since the last
  15384. // request. Use googleapi.IsNotModified to check whether the response
  15385. // error from Do is the result of In-None-Match.
  15386. func (c *LiveStreamsListCall) IfNoneMatch(entityTag string) *LiveStreamsListCall {
  15387. c.ifNoneMatch_ = entityTag
  15388. return c
  15389. }
  15390. // Context sets the context to be used in this call's Do method. Any
  15391. // pending HTTP request will be aborted if the provided context is
  15392. // canceled.
  15393. func (c *LiveStreamsListCall) Context(ctx context.Context) *LiveStreamsListCall {
  15394. c.ctx_ = ctx
  15395. return c
  15396. }
  15397. // Header returns an http.Header that can be modified by the caller to
  15398. // add HTTP headers to the request.
  15399. func (c *LiveStreamsListCall) Header() http.Header {
  15400. if c.header_ == nil {
  15401. c.header_ = make(http.Header)
  15402. }
  15403. return c.header_
  15404. }
  15405. func (c *LiveStreamsListCall) doRequest(alt string) (*http.Response, error) {
  15406. reqHeaders := make(http.Header)
  15407. for k, v := range c.header_ {
  15408. reqHeaders[k] = v
  15409. }
  15410. reqHeaders.Set("User-Agent", c.s.userAgent())
  15411. if c.ifNoneMatch_ != "" {
  15412. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15413. }
  15414. var body io.Reader = nil
  15415. c.urlParams_.Set("alt", alt)
  15416. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15417. urls += "?" + c.urlParams_.Encode()
  15418. req, _ := http.NewRequest("GET", urls, body)
  15419. req.Header = reqHeaders
  15420. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15421. }
  15422. // Do executes the "youtube.liveStreams.list" call.
  15423. // Exactly one of *LiveStreamListResponse or error will be non-nil. Any
  15424. // non-2xx status code is an error. Response headers are in either
  15425. // *LiveStreamListResponse.ServerResponse.Header or (if a response was
  15426. // returned at all) in error.(*googleapi.Error).Header. Use
  15427. // googleapi.IsNotModified to check whether the returned error was
  15428. // because http.StatusNotModified was returned.
  15429. func (c *LiveStreamsListCall) Do(opts ...googleapi.CallOption) (*LiveStreamListResponse, error) {
  15430. gensupport.SetOptions(c.urlParams_, opts...)
  15431. res, err := c.doRequest("json")
  15432. if res != nil && res.StatusCode == http.StatusNotModified {
  15433. if res.Body != nil {
  15434. res.Body.Close()
  15435. }
  15436. return nil, &googleapi.Error{
  15437. Code: res.StatusCode,
  15438. Header: res.Header,
  15439. }
  15440. }
  15441. if err != nil {
  15442. return nil, err
  15443. }
  15444. defer googleapi.CloseBody(res)
  15445. if err := googleapi.CheckResponse(res); err != nil {
  15446. return nil, err
  15447. }
  15448. ret := &LiveStreamListResponse{
  15449. ServerResponse: googleapi.ServerResponse{
  15450. Header: res.Header,
  15451. HTTPStatusCode: res.StatusCode,
  15452. },
  15453. }
  15454. target := &ret
  15455. if err := gensupport.DecodeResponse(target, res); err != nil {
  15456. return nil, err
  15457. }
  15458. return ret, nil
  15459. // {
  15460. // "description": "Returns a list of video streams that match the API request parameters.",
  15461. // "httpMethod": "GET",
  15462. // "id": "youtube.liveStreams.list",
  15463. // "parameterOrder": [
  15464. // "part"
  15465. // ],
  15466. // "parameters": {
  15467. // "id": {
  15468. // "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.",
  15469. // "location": "query",
  15470. // "type": "string"
  15471. // },
  15472. // "maxResults": {
  15473. // "default": "5",
  15474. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  15475. // "format": "uint32",
  15476. // "location": "query",
  15477. // "maximum": "50",
  15478. // "minimum": "0",
  15479. // "type": "integer"
  15480. // },
  15481. // "mine": {
  15482. // "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.",
  15483. // "location": "query",
  15484. // "type": "boolean"
  15485. // },
  15486. // "onBehalfOfContentOwner": {
  15487. // "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.",
  15488. // "location": "query",
  15489. // "type": "string"
  15490. // },
  15491. // "onBehalfOfContentOwnerChannel": {
  15492. // "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.",
  15493. // "location": "query",
  15494. // "type": "string"
  15495. // },
  15496. // "pageToken": {
  15497. // "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.",
  15498. // "location": "query",
  15499. // "type": "string"
  15500. // },
  15501. // "part": {
  15502. // "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.",
  15503. // "location": "query",
  15504. // "required": true,
  15505. // "type": "string"
  15506. // }
  15507. // },
  15508. // "path": "liveStreams",
  15509. // "response": {
  15510. // "$ref": "LiveStreamListResponse"
  15511. // },
  15512. // "scopes": [
  15513. // "https://www.googleapis.com/auth/youtube",
  15514. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15515. // "https://www.googleapis.com/auth/youtube.readonly"
  15516. // ]
  15517. // }
  15518. }
  15519. // Pages invokes f for each page of results.
  15520. // A non-nil error returned from f will halt the iteration.
  15521. // The provided context supersedes any context provided to the Context method.
  15522. func (c *LiveStreamsListCall) Pages(ctx context.Context, f func(*LiveStreamListResponse) error) error {
  15523. c.ctx_ = ctx
  15524. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15525. for {
  15526. x, err := c.Do()
  15527. if err != nil {
  15528. return err
  15529. }
  15530. if err := f(x); err != nil {
  15531. return err
  15532. }
  15533. if x.NextPageToken == "" {
  15534. return nil
  15535. }
  15536. c.PageToken(x.NextPageToken)
  15537. }
  15538. }
  15539. // method id "youtube.liveStreams.update":
  15540. type LiveStreamsUpdateCall struct {
  15541. s *Service
  15542. livestream *LiveStream
  15543. urlParams_ gensupport.URLParams
  15544. ctx_ context.Context
  15545. header_ http.Header
  15546. }
  15547. // Update: Updates a video stream. If the properties that you want to
  15548. // change cannot be updated, then you need to create a new stream with
  15549. // the proper settings.
  15550. func (r *LiveStreamsService) Update(part string, livestream *LiveStream) *LiveStreamsUpdateCall {
  15551. c := &LiveStreamsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15552. c.urlParams_.Set("part", part)
  15553. c.livestream = livestream
  15554. return c
  15555. }
  15556. // OnBehalfOfContentOwner sets the optional parameter
  15557. // "onBehalfOfContentOwner": Note: This parameter is intended
  15558. // exclusively for YouTube content partners.
  15559. //
  15560. // The onBehalfOfContentOwner parameter indicates that the request's
  15561. // authorization credentials identify a YouTube CMS user who is acting
  15562. // on behalf of the content owner specified in the parameter value. This
  15563. // parameter is intended for YouTube content partners that own and
  15564. // manage many different YouTube channels. It allows content owners to
  15565. // authenticate once and get access to all their video and channel data,
  15566. // without having to provide authentication credentials for each
  15567. // individual channel. The CMS account that the user authenticates with
  15568. // must be linked to the specified YouTube content owner.
  15569. func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *LiveStreamsUpdateCall {
  15570. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15571. return c
  15572. }
  15573. // OnBehalfOfContentOwnerChannel sets the optional parameter
  15574. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  15575. // properly authorized request. Note: This parameter is intended
  15576. // exclusively for YouTube content partners.
  15577. //
  15578. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  15579. // channel ID of the channel to which a video is being added. This
  15580. // parameter is required when a request specifies a value for the
  15581. // onBehalfOfContentOwner parameter, and it can only be used in
  15582. // conjunction with that parameter. In addition, the request must be
  15583. // authorized using a CMS account that is linked to the content owner
  15584. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  15585. // channel that the onBehalfOfContentOwnerChannel parameter value
  15586. // specifies must be linked to the content owner that the
  15587. // onBehalfOfContentOwner parameter specifies.
  15588. //
  15589. // This parameter is intended for YouTube content partners that own and
  15590. // manage many different YouTube channels. It allows content owners to
  15591. // authenticate once and perform actions on behalf of the channel
  15592. // specified in the parameter value, without having to provide
  15593. // authentication credentials for each separate channel.
  15594. func (c *LiveStreamsUpdateCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *LiveStreamsUpdateCall {
  15595. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  15596. return c
  15597. }
  15598. // Fields allows partial responses to be retrieved. See
  15599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15600. // for more information.
  15601. func (c *LiveStreamsUpdateCall) Fields(s ...googleapi.Field) *LiveStreamsUpdateCall {
  15602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15603. return c
  15604. }
  15605. // Context sets the context to be used in this call's Do method. Any
  15606. // pending HTTP request will be aborted if the provided context is
  15607. // canceled.
  15608. func (c *LiveStreamsUpdateCall) Context(ctx context.Context) *LiveStreamsUpdateCall {
  15609. c.ctx_ = ctx
  15610. return c
  15611. }
  15612. // Header returns an http.Header that can be modified by the caller to
  15613. // add HTTP headers to the request.
  15614. func (c *LiveStreamsUpdateCall) Header() http.Header {
  15615. if c.header_ == nil {
  15616. c.header_ = make(http.Header)
  15617. }
  15618. return c.header_
  15619. }
  15620. func (c *LiveStreamsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15621. reqHeaders := make(http.Header)
  15622. for k, v := range c.header_ {
  15623. reqHeaders[k] = v
  15624. }
  15625. reqHeaders.Set("User-Agent", c.s.userAgent())
  15626. var body io.Reader = nil
  15627. body, err := googleapi.WithoutDataWrapper.JSONReader(c.livestream)
  15628. if err != nil {
  15629. return nil, err
  15630. }
  15631. reqHeaders.Set("Content-Type", "application/json")
  15632. c.urlParams_.Set("alt", alt)
  15633. urls := googleapi.ResolveRelative(c.s.BasePath, "liveStreams")
  15634. urls += "?" + c.urlParams_.Encode()
  15635. req, _ := http.NewRequest("PUT", urls, body)
  15636. req.Header = reqHeaders
  15637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15638. }
  15639. // Do executes the "youtube.liveStreams.update" call.
  15640. // Exactly one of *LiveStream or error will be non-nil. Any non-2xx
  15641. // status code is an error. Response headers are in either
  15642. // *LiveStream.ServerResponse.Header or (if a response was returned at
  15643. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15644. // to check whether the returned error was because
  15645. // http.StatusNotModified was returned.
  15646. func (c *LiveStreamsUpdateCall) Do(opts ...googleapi.CallOption) (*LiveStream, error) {
  15647. gensupport.SetOptions(c.urlParams_, opts...)
  15648. res, err := c.doRequest("json")
  15649. if res != nil && res.StatusCode == http.StatusNotModified {
  15650. if res.Body != nil {
  15651. res.Body.Close()
  15652. }
  15653. return nil, &googleapi.Error{
  15654. Code: res.StatusCode,
  15655. Header: res.Header,
  15656. }
  15657. }
  15658. if err != nil {
  15659. return nil, err
  15660. }
  15661. defer googleapi.CloseBody(res)
  15662. if err := googleapi.CheckResponse(res); err != nil {
  15663. return nil, err
  15664. }
  15665. ret := &LiveStream{
  15666. ServerResponse: googleapi.ServerResponse{
  15667. Header: res.Header,
  15668. HTTPStatusCode: res.StatusCode,
  15669. },
  15670. }
  15671. target := &ret
  15672. if err := gensupport.DecodeResponse(target, res); err != nil {
  15673. return nil, err
  15674. }
  15675. return ret, nil
  15676. // {
  15677. // "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.",
  15678. // "httpMethod": "PUT",
  15679. // "id": "youtube.liveStreams.update",
  15680. // "parameterOrder": [
  15681. // "part"
  15682. // ],
  15683. // "parameters": {
  15684. // "onBehalfOfContentOwner": {
  15685. // "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.",
  15686. // "location": "query",
  15687. // "type": "string"
  15688. // },
  15689. // "onBehalfOfContentOwnerChannel": {
  15690. // "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.",
  15691. // "location": "query",
  15692. // "type": "string"
  15693. // },
  15694. // "part": {
  15695. // "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.",
  15696. // "location": "query",
  15697. // "required": true,
  15698. // "type": "string"
  15699. // }
  15700. // },
  15701. // "path": "liveStreams",
  15702. // "request": {
  15703. // "$ref": "LiveStream"
  15704. // },
  15705. // "response": {
  15706. // "$ref": "LiveStream"
  15707. // },
  15708. // "scopes": [
  15709. // "https://www.googleapis.com/auth/youtube",
  15710. // "https://www.googleapis.com/auth/youtube.force-ssl"
  15711. // ]
  15712. // }
  15713. }
  15714. // method id "youtube.playlistItems.delete":
  15715. type PlaylistItemsDeleteCall struct {
  15716. s *Service
  15717. urlParams_ gensupport.URLParams
  15718. ctx_ context.Context
  15719. header_ http.Header
  15720. }
  15721. // Delete: Deletes a playlist item.
  15722. func (r *PlaylistItemsService) Delete(id string) *PlaylistItemsDeleteCall {
  15723. c := &PlaylistItemsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15724. c.urlParams_.Set("id", id)
  15725. return c
  15726. }
  15727. // OnBehalfOfContentOwner sets the optional parameter
  15728. // "onBehalfOfContentOwner": Note: This parameter is intended
  15729. // exclusively for YouTube content partners.
  15730. //
  15731. // The onBehalfOfContentOwner parameter indicates that the request's
  15732. // authorization credentials identify a YouTube CMS user who is acting
  15733. // on behalf of the content owner specified in the parameter value. This
  15734. // parameter is intended for YouTube content partners that own and
  15735. // manage many different YouTube channels. It allows content owners to
  15736. // authenticate once and get access to all their video and channel data,
  15737. // without having to provide authentication credentials for each
  15738. // individual channel. The CMS account that the user authenticates with
  15739. // must be linked to the specified YouTube content owner.
  15740. func (c *PlaylistItemsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsDeleteCall {
  15741. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15742. return c
  15743. }
  15744. // Fields allows partial responses to be retrieved. See
  15745. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15746. // for more information.
  15747. func (c *PlaylistItemsDeleteCall) Fields(s ...googleapi.Field) *PlaylistItemsDeleteCall {
  15748. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15749. return c
  15750. }
  15751. // Context sets the context to be used in this call's Do method. Any
  15752. // pending HTTP request will be aborted if the provided context is
  15753. // canceled.
  15754. func (c *PlaylistItemsDeleteCall) Context(ctx context.Context) *PlaylistItemsDeleteCall {
  15755. c.ctx_ = ctx
  15756. return c
  15757. }
  15758. // Header returns an http.Header that can be modified by the caller to
  15759. // add HTTP headers to the request.
  15760. func (c *PlaylistItemsDeleteCall) Header() http.Header {
  15761. if c.header_ == nil {
  15762. c.header_ = make(http.Header)
  15763. }
  15764. return c.header_
  15765. }
  15766. func (c *PlaylistItemsDeleteCall) doRequest(alt string) (*http.Response, error) {
  15767. reqHeaders := make(http.Header)
  15768. for k, v := range c.header_ {
  15769. reqHeaders[k] = v
  15770. }
  15771. reqHeaders.Set("User-Agent", c.s.userAgent())
  15772. var body io.Reader = nil
  15773. c.urlParams_.Set("alt", alt)
  15774. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  15775. urls += "?" + c.urlParams_.Encode()
  15776. req, _ := http.NewRequest("DELETE", urls, body)
  15777. req.Header = reqHeaders
  15778. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15779. }
  15780. // Do executes the "youtube.playlistItems.delete" call.
  15781. func (c *PlaylistItemsDeleteCall) Do(opts ...googleapi.CallOption) error {
  15782. gensupport.SetOptions(c.urlParams_, opts...)
  15783. res, err := c.doRequest("json")
  15784. if err != nil {
  15785. return err
  15786. }
  15787. defer googleapi.CloseBody(res)
  15788. if err := googleapi.CheckResponse(res); err != nil {
  15789. return err
  15790. }
  15791. return nil
  15792. // {
  15793. // "description": "Deletes a playlist item.",
  15794. // "httpMethod": "DELETE",
  15795. // "id": "youtube.playlistItems.delete",
  15796. // "parameterOrder": [
  15797. // "id"
  15798. // ],
  15799. // "parameters": {
  15800. // "id": {
  15801. // "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.",
  15802. // "location": "query",
  15803. // "required": true,
  15804. // "type": "string"
  15805. // },
  15806. // "onBehalfOfContentOwner": {
  15807. // "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.",
  15808. // "location": "query",
  15809. // "type": "string"
  15810. // }
  15811. // },
  15812. // "path": "playlistItems",
  15813. // "scopes": [
  15814. // "https://www.googleapis.com/auth/youtube",
  15815. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15816. // "https://www.googleapis.com/auth/youtubepartner"
  15817. // ]
  15818. // }
  15819. }
  15820. // method id "youtube.playlistItems.insert":
  15821. type PlaylistItemsInsertCall struct {
  15822. s *Service
  15823. playlistitem *PlaylistItem
  15824. urlParams_ gensupport.URLParams
  15825. ctx_ context.Context
  15826. header_ http.Header
  15827. }
  15828. // Insert: Adds a resource to a playlist.
  15829. func (r *PlaylistItemsService) Insert(part string, playlistitem *PlaylistItem) *PlaylistItemsInsertCall {
  15830. c := &PlaylistItemsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15831. c.urlParams_.Set("part", part)
  15832. c.playlistitem = playlistitem
  15833. return c
  15834. }
  15835. // OnBehalfOfContentOwner sets the optional parameter
  15836. // "onBehalfOfContentOwner": Note: This parameter is intended
  15837. // exclusively for YouTube content partners.
  15838. //
  15839. // The onBehalfOfContentOwner parameter indicates that the request's
  15840. // authorization credentials identify a YouTube CMS user who is acting
  15841. // on behalf of the content owner specified in the parameter value. This
  15842. // parameter is intended for YouTube content partners that own and
  15843. // manage many different YouTube channels. It allows content owners to
  15844. // authenticate once and get access to all their video and channel data,
  15845. // without having to provide authentication credentials for each
  15846. // individual channel. The CMS account that the user authenticates with
  15847. // must be linked to the specified YouTube content owner.
  15848. func (c *PlaylistItemsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsInsertCall {
  15849. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  15850. return c
  15851. }
  15852. // Fields allows partial responses to be retrieved. See
  15853. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15854. // for more information.
  15855. func (c *PlaylistItemsInsertCall) Fields(s ...googleapi.Field) *PlaylistItemsInsertCall {
  15856. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15857. return c
  15858. }
  15859. // Context sets the context to be used in this call's Do method. Any
  15860. // pending HTTP request will be aborted if the provided context is
  15861. // canceled.
  15862. func (c *PlaylistItemsInsertCall) Context(ctx context.Context) *PlaylistItemsInsertCall {
  15863. c.ctx_ = ctx
  15864. return c
  15865. }
  15866. // Header returns an http.Header that can be modified by the caller to
  15867. // add HTTP headers to the request.
  15868. func (c *PlaylistItemsInsertCall) Header() http.Header {
  15869. if c.header_ == nil {
  15870. c.header_ = make(http.Header)
  15871. }
  15872. return c.header_
  15873. }
  15874. func (c *PlaylistItemsInsertCall) doRequest(alt string) (*http.Response, error) {
  15875. reqHeaders := make(http.Header)
  15876. for k, v := range c.header_ {
  15877. reqHeaders[k] = v
  15878. }
  15879. reqHeaders.Set("User-Agent", c.s.userAgent())
  15880. var body io.Reader = nil
  15881. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem)
  15882. if err != nil {
  15883. return nil, err
  15884. }
  15885. reqHeaders.Set("Content-Type", "application/json")
  15886. c.urlParams_.Set("alt", alt)
  15887. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  15888. urls += "?" + c.urlParams_.Encode()
  15889. req, _ := http.NewRequest("POST", urls, body)
  15890. req.Header = reqHeaders
  15891. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15892. }
  15893. // Do executes the "youtube.playlistItems.insert" call.
  15894. // Exactly one of *PlaylistItem or error will be non-nil. Any non-2xx
  15895. // status code is an error. Response headers are in either
  15896. // *PlaylistItem.ServerResponse.Header or (if a response was returned at
  15897. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15898. // to check whether the returned error was because
  15899. // http.StatusNotModified was returned.
  15900. func (c *PlaylistItemsInsertCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
  15901. gensupport.SetOptions(c.urlParams_, opts...)
  15902. res, err := c.doRequest("json")
  15903. if res != nil && res.StatusCode == http.StatusNotModified {
  15904. if res.Body != nil {
  15905. res.Body.Close()
  15906. }
  15907. return nil, &googleapi.Error{
  15908. Code: res.StatusCode,
  15909. Header: res.Header,
  15910. }
  15911. }
  15912. if err != nil {
  15913. return nil, err
  15914. }
  15915. defer googleapi.CloseBody(res)
  15916. if err := googleapi.CheckResponse(res); err != nil {
  15917. return nil, err
  15918. }
  15919. ret := &PlaylistItem{
  15920. ServerResponse: googleapi.ServerResponse{
  15921. Header: res.Header,
  15922. HTTPStatusCode: res.StatusCode,
  15923. },
  15924. }
  15925. target := &ret
  15926. if err := gensupport.DecodeResponse(target, res); err != nil {
  15927. return nil, err
  15928. }
  15929. return ret, nil
  15930. // {
  15931. // "description": "Adds a resource to a playlist.",
  15932. // "httpMethod": "POST",
  15933. // "id": "youtube.playlistItems.insert",
  15934. // "parameterOrder": [
  15935. // "part"
  15936. // ],
  15937. // "parameters": {
  15938. // "onBehalfOfContentOwner": {
  15939. // "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.",
  15940. // "location": "query",
  15941. // "type": "string"
  15942. // },
  15943. // "part": {
  15944. // "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.",
  15945. // "location": "query",
  15946. // "required": true,
  15947. // "type": "string"
  15948. // }
  15949. // },
  15950. // "path": "playlistItems",
  15951. // "request": {
  15952. // "$ref": "PlaylistItem"
  15953. // },
  15954. // "response": {
  15955. // "$ref": "PlaylistItem"
  15956. // },
  15957. // "scopes": [
  15958. // "https://www.googleapis.com/auth/youtube",
  15959. // "https://www.googleapis.com/auth/youtube.force-ssl",
  15960. // "https://www.googleapis.com/auth/youtubepartner"
  15961. // ]
  15962. // }
  15963. }
  15964. // method id "youtube.playlistItems.list":
  15965. type PlaylistItemsListCall struct {
  15966. s *Service
  15967. urlParams_ gensupport.URLParams
  15968. ifNoneMatch_ string
  15969. ctx_ context.Context
  15970. header_ http.Header
  15971. }
  15972. // List: Returns a collection of playlist items that match the API
  15973. // request parameters. You can retrieve all of the playlist items in a
  15974. // specified playlist or retrieve one or more playlist items by their
  15975. // unique IDs.
  15976. func (r *PlaylistItemsService) List(part string) *PlaylistItemsListCall {
  15977. c := &PlaylistItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15978. c.urlParams_.Set("part", part)
  15979. return c
  15980. }
  15981. // Id sets the optional parameter "id": The id parameter specifies a
  15982. // comma-separated list of one or more unique playlist item IDs.
  15983. func (c *PlaylistItemsListCall) Id(id string) *PlaylistItemsListCall {
  15984. c.urlParams_.Set("id", id)
  15985. return c
  15986. }
  15987. // MaxResults sets the optional parameter "maxResults": The maxResults
  15988. // parameter specifies the maximum number of items that should be
  15989. // returned in the result set.
  15990. func (c *PlaylistItemsListCall) MaxResults(maxResults int64) *PlaylistItemsListCall {
  15991. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15992. return c
  15993. }
  15994. // OnBehalfOfContentOwner sets the optional parameter
  15995. // "onBehalfOfContentOwner": Note: This parameter is intended
  15996. // exclusively for YouTube content partners.
  15997. //
  15998. // The onBehalfOfContentOwner parameter indicates that the request's
  15999. // authorization credentials identify a YouTube CMS user who is acting
  16000. // on behalf of the content owner specified in the parameter value. This
  16001. // parameter is intended for YouTube content partners that own and
  16002. // manage many different YouTube channels. It allows content owners to
  16003. // authenticate once and get access to all their video and channel data,
  16004. // without having to provide authentication credentials for each
  16005. // individual channel. The CMS account that the user authenticates with
  16006. // must be linked to the specified YouTube content owner.
  16007. func (c *PlaylistItemsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsListCall {
  16008. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16009. return c
  16010. }
  16011. // PageToken sets the optional parameter "pageToken": The pageToken
  16012. // parameter identifies a specific page in the result set that should be
  16013. // returned. In an API response, the nextPageToken and prevPageToken
  16014. // properties identify other pages that could be retrieved.
  16015. func (c *PlaylistItemsListCall) PageToken(pageToken string) *PlaylistItemsListCall {
  16016. c.urlParams_.Set("pageToken", pageToken)
  16017. return c
  16018. }
  16019. // PlaylistId sets the optional parameter "playlistId": The playlistId
  16020. // parameter specifies the unique ID of the playlist for which you want
  16021. // to retrieve playlist items. Note that even though this is an optional
  16022. // parameter, every request to retrieve playlist items must specify a
  16023. // value for either the id parameter or the playlistId parameter.
  16024. func (c *PlaylistItemsListCall) PlaylistId(playlistId string) *PlaylistItemsListCall {
  16025. c.urlParams_.Set("playlistId", playlistId)
  16026. return c
  16027. }
  16028. // VideoId sets the optional parameter "videoId": The videoId parameter
  16029. // specifies that the request should return only the playlist items that
  16030. // contain the specified video.
  16031. func (c *PlaylistItemsListCall) VideoId(videoId string) *PlaylistItemsListCall {
  16032. c.urlParams_.Set("videoId", videoId)
  16033. return c
  16034. }
  16035. // Fields allows partial responses to be retrieved. See
  16036. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16037. // for more information.
  16038. func (c *PlaylistItemsListCall) Fields(s ...googleapi.Field) *PlaylistItemsListCall {
  16039. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16040. return c
  16041. }
  16042. // IfNoneMatch sets the optional parameter which makes the operation
  16043. // fail if the object's ETag matches the given value. This is useful for
  16044. // getting updates only after the object has changed since the last
  16045. // request. Use googleapi.IsNotModified to check whether the response
  16046. // error from Do is the result of In-None-Match.
  16047. func (c *PlaylistItemsListCall) IfNoneMatch(entityTag string) *PlaylistItemsListCall {
  16048. c.ifNoneMatch_ = entityTag
  16049. return c
  16050. }
  16051. // Context sets the context to be used in this call's Do method. Any
  16052. // pending HTTP request will be aborted if the provided context is
  16053. // canceled.
  16054. func (c *PlaylistItemsListCall) Context(ctx context.Context) *PlaylistItemsListCall {
  16055. c.ctx_ = ctx
  16056. return c
  16057. }
  16058. // Header returns an http.Header that can be modified by the caller to
  16059. // add HTTP headers to the request.
  16060. func (c *PlaylistItemsListCall) Header() http.Header {
  16061. if c.header_ == nil {
  16062. c.header_ = make(http.Header)
  16063. }
  16064. return c.header_
  16065. }
  16066. func (c *PlaylistItemsListCall) doRequest(alt string) (*http.Response, error) {
  16067. reqHeaders := make(http.Header)
  16068. for k, v := range c.header_ {
  16069. reqHeaders[k] = v
  16070. }
  16071. reqHeaders.Set("User-Agent", c.s.userAgent())
  16072. if c.ifNoneMatch_ != "" {
  16073. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16074. }
  16075. var body io.Reader = nil
  16076. c.urlParams_.Set("alt", alt)
  16077. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  16078. urls += "?" + c.urlParams_.Encode()
  16079. req, _ := http.NewRequest("GET", urls, body)
  16080. req.Header = reqHeaders
  16081. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16082. }
  16083. // Do executes the "youtube.playlistItems.list" call.
  16084. // Exactly one of *PlaylistItemListResponse or error will be non-nil.
  16085. // Any non-2xx status code is an error. Response headers are in either
  16086. // *PlaylistItemListResponse.ServerResponse.Header or (if a response was
  16087. // returned at all) in error.(*googleapi.Error).Header. Use
  16088. // googleapi.IsNotModified to check whether the returned error was
  16089. // because http.StatusNotModified was returned.
  16090. func (c *PlaylistItemsListCall) Do(opts ...googleapi.CallOption) (*PlaylistItemListResponse, error) {
  16091. gensupport.SetOptions(c.urlParams_, opts...)
  16092. res, err := c.doRequest("json")
  16093. if res != nil && res.StatusCode == http.StatusNotModified {
  16094. if res.Body != nil {
  16095. res.Body.Close()
  16096. }
  16097. return nil, &googleapi.Error{
  16098. Code: res.StatusCode,
  16099. Header: res.Header,
  16100. }
  16101. }
  16102. if err != nil {
  16103. return nil, err
  16104. }
  16105. defer googleapi.CloseBody(res)
  16106. if err := googleapi.CheckResponse(res); err != nil {
  16107. return nil, err
  16108. }
  16109. ret := &PlaylistItemListResponse{
  16110. ServerResponse: googleapi.ServerResponse{
  16111. Header: res.Header,
  16112. HTTPStatusCode: res.StatusCode,
  16113. },
  16114. }
  16115. target := &ret
  16116. if err := gensupport.DecodeResponse(target, res); err != nil {
  16117. return nil, err
  16118. }
  16119. return ret, nil
  16120. // {
  16121. // "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.",
  16122. // "httpMethod": "GET",
  16123. // "id": "youtube.playlistItems.list",
  16124. // "parameterOrder": [
  16125. // "part"
  16126. // ],
  16127. // "parameters": {
  16128. // "id": {
  16129. // "description": "The id parameter specifies a comma-separated list of one or more unique playlist item IDs.",
  16130. // "location": "query",
  16131. // "type": "string"
  16132. // },
  16133. // "maxResults": {
  16134. // "default": "5",
  16135. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  16136. // "format": "uint32",
  16137. // "location": "query",
  16138. // "maximum": "50",
  16139. // "minimum": "0",
  16140. // "type": "integer"
  16141. // },
  16142. // "onBehalfOfContentOwner": {
  16143. // "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.",
  16144. // "location": "query",
  16145. // "type": "string"
  16146. // },
  16147. // "pageToken": {
  16148. // "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.",
  16149. // "location": "query",
  16150. // "type": "string"
  16151. // },
  16152. // "part": {
  16153. // "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.",
  16154. // "location": "query",
  16155. // "required": true,
  16156. // "type": "string"
  16157. // },
  16158. // "playlistId": {
  16159. // "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.",
  16160. // "location": "query",
  16161. // "type": "string"
  16162. // },
  16163. // "videoId": {
  16164. // "description": "The videoId parameter specifies that the request should return only the playlist items that contain the specified video.",
  16165. // "location": "query",
  16166. // "type": "string"
  16167. // }
  16168. // },
  16169. // "path": "playlistItems",
  16170. // "response": {
  16171. // "$ref": "PlaylistItemListResponse"
  16172. // },
  16173. // "scopes": [
  16174. // "https://www.googleapis.com/auth/youtube",
  16175. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16176. // "https://www.googleapis.com/auth/youtube.readonly",
  16177. // "https://www.googleapis.com/auth/youtubepartner"
  16178. // ],
  16179. // "supportsSubscription": true
  16180. // }
  16181. }
  16182. // Pages invokes f for each page of results.
  16183. // A non-nil error returned from f will halt the iteration.
  16184. // The provided context supersedes any context provided to the Context method.
  16185. func (c *PlaylistItemsListCall) Pages(ctx context.Context, f func(*PlaylistItemListResponse) error) error {
  16186. c.ctx_ = ctx
  16187. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16188. for {
  16189. x, err := c.Do()
  16190. if err != nil {
  16191. return err
  16192. }
  16193. if err := f(x); err != nil {
  16194. return err
  16195. }
  16196. if x.NextPageToken == "" {
  16197. return nil
  16198. }
  16199. c.PageToken(x.NextPageToken)
  16200. }
  16201. }
  16202. // method id "youtube.playlistItems.update":
  16203. type PlaylistItemsUpdateCall struct {
  16204. s *Service
  16205. playlistitem *PlaylistItem
  16206. urlParams_ gensupport.URLParams
  16207. ctx_ context.Context
  16208. header_ http.Header
  16209. }
  16210. // Update: Modifies a playlist item. For example, you could update the
  16211. // item's position in the playlist.
  16212. func (r *PlaylistItemsService) Update(part string, playlistitem *PlaylistItem) *PlaylistItemsUpdateCall {
  16213. c := &PlaylistItemsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16214. c.urlParams_.Set("part", part)
  16215. c.playlistitem = playlistitem
  16216. return c
  16217. }
  16218. // OnBehalfOfContentOwner sets the optional parameter
  16219. // "onBehalfOfContentOwner": Note: This parameter is intended
  16220. // exclusively for YouTube content partners.
  16221. //
  16222. // The onBehalfOfContentOwner parameter indicates that the request's
  16223. // authorization credentials identify a YouTube CMS user who is acting
  16224. // on behalf of the content owner specified in the parameter value. This
  16225. // parameter is intended for YouTube content partners that own and
  16226. // manage many different YouTube channels. It allows content owners to
  16227. // authenticate once and get access to all their video and channel data,
  16228. // without having to provide authentication credentials for each
  16229. // individual channel. The CMS account that the user authenticates with
  16230. // must be linked to the specified YouTube content owner.
  16231. func (c *PlaylistItemsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistItemsUpdateCall {
  16232. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16233. return c
  16234. }
  16235. // Fields allows partial responses to be retrieved. See
  16236. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16237. // for more information.
  16238. func (c *PlaylistItemsUpdateCall) Fields(s ...googleapi.Field) *PlaylistItemsUpdateCall {
  16239. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16240. return c
  16241. }
  16242. // Context sets the context to be used in this call's Do method. Any
  16243. // pending HTTP request will be aborted if the provided context is
  16244. // canceled.
  16245. func (c *PlaylistItemsUpdateCall) Context(ctx context.Context) *PlaylistItemsUpdateCall {
  16246. c.ctx_ = ctx
  16247. return c
  16248. }
  16249. // Header returns an http.Header that can be modified by the caller to
  16250. // add HTTP headers to the request.
  16251. func (c *PlaylistItemsUpdateCall) Header() http.Header {
  16252. if c.header_ == nil {
  16253. c.header_ = make(http.Header)
  16254. }
  16255. return c.header_
  16256. }
  16257. func (c *PlaylistItemsUpdateCall) doRequest(alt string) (*http.Response, error) {
  16258. reqHeaders := make(http.Header)
  16259. for k, v := range c.header_ {
  16260. reqHeaders[k] = v
  16261. }
  16262. reqHeaders.Set("User-Agent", c.s.userAgent())
  16263. var body io.Reader = nil
  16264. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlistitem)
  16265. if err != nil {
  16266. return nil, err
  16267. }
  16268. reqHeaders.Set("Content-Type", "application/json")
  16269. c.urlParams_.Set("alt", alt)
  16270. urls := googleapi.ResolveRelative(c.s.BasePath, "playlistItems")
  16271. urls += "?" + c.urlParams_.Encode()
  16272. req, _ := http.NewRequest("PUT", urls, body)
  16273. req.Header = reqHeaders
  16274. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16275. }
  16276. // Do executes the "youtube.playlistItems.update" call.
  16277. // Exactly one of *PlaylistItem or error will be non-nil. Any non-2xx
  16278. // status code is an error. Response headers are in either
  16279. // *PlaylistItem.ServerResponse.Header or (if a response was returned at
  16280. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16281. // to check whether the returned error was because
  16282. // http.StatusNotModified was returned.
  16283. func (c *PlaylistItemsUpdateCall) Do(opts ...googleapi.CallOption) (*PlaylistItem, error) {
  16284. gensupport.SetOptions(c.urlParams_, opts...)
  16285. res, err := c.doRequest("json")
  16286. if res != nil && res.StatusCode == http.StatusNotModified {
  16287. if res.Body != nil {
  16288. res.Body.Close()
  16289. }
  16290. return nil, &googleapi.Error{
  16291. Code: res.StatusCode,
  16292. Header: res.Header,
  16293. }
  16294. }
  16295. if err != nil {
  16296. return nil, err
  16297. }
  16298. defer googleapi.CloseBody(res)
  16299. if err := googleapi.CheckResponse(res); err != nil {
  16300. return nil, err
  16301. }
  16302. ret := &PlaylistItem{
  16303. ServerResponse: googleapi.ServerResponse{
  16304. Header: res.Header,
  16305. HTTPStatusCode: res.StatusCode,
  16306. },
  16307. }
  16308. target := &ret
  16309. if err := gensupport.DecodeResponse(target, res); err != nil {
  16310. return nil, err
  16311. }
  16312. return ret, nil
  16313. // {
  16314. // "description": "Modifies a playlist item. For example, you could update the item's position in the playlist.",
  16315. // "httpMethod": "PUT",
  16316. // "id": "youtube.playlistItems.update",
  16317. // "parameterOrder": [
  16318. // "part"
  16319. // ],
  16320. // "parameters": {
  16321. // "onBehalfOfContentOwner": {
  16322. // "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.",
  16323. // "location": "query",
  16324. // "type": "string"
  16325. // },
  16326. // "part": {
  16327. // "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.",
  16328. // "location": "query",
  16329. // "required": true,
  16330. // "type": "string"
  16331. // }
  16332. // },
  16333. // "path": "playlistItems",
  16334. // "request": {
  16335. // "$ref": "PlaylistItem"
  16336. // },
  16337. // "response": {
  16338. // "$ref": "PlaylistItem"
  16339. // },
  16340. // "scopes": [
  16341. // "https://www.googleapis.com/auth/youtube",
  16342. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16343. // "https://www.googleapis.com/auth/youtubepartner"
  16344. // ]
  16345. // }
  16346. }
  16347. // method id "youtube.playlists.delete":
  16348. type PlaylistsDeleteCall struct {
  16349. s *Service
  16350. urlParams_ gensupport.URLParams
  16351. ctx_ context.Context
  16352. header_ http.Header
  16353. }
  16354. // Delete: Deletes a playlist.
  16355. func (r *PlaylistsService) Delete(id string) *PlaylistsDeleteCall {
  16356. c := &PlaylistsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16357. c.urlParams_.Set("id", id)
  16358. return c
  16359. }
  16360. // OnBehalfOfContentOwner sets the optional parameter
  16361. // "onBehalfOfContentOwner": Note: This parameter is intended
  16362. // exclusively for YouTube content partners.
  16363. //
  16364. // The onBehalfOfContentOwner parameter indicates that the request's
  16365. // authorization credentials identify a YouTube CMS user who is acting
  16366. // on behalf of the content owner specified in the parameter value. This
  16367. // parameter is intended for YouTube content partners that own and
  16368. // manage many different YouTube channels. It allows content owners to
  16369. // authenticate once and get access to all their video and channel data,
  16370. // without having to provide authentication credentials for each
  16371. // individual channel. The CMS account that the user authenticates with
  16372. // must be linked to the specified YouTube content owner.
  16373. func (c *PlaylistsDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsDeleteCall {
  16374. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16375. return c
  16376. }
  16377. // Fields allows partial responses to be retrieved. See
  16378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16379. // for more information.
  16380. func (c *PlaylistsDeleteCall) Fields(s ...googleapi.Field) *PlaylistsDeleteCall {
  16381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16382. return c
  16383. }
  16384. // Context sets the context to be used in this call's Do method. Any
  16385. // pending HTTP request will be aborted if the provided context is
  16386. // canceled.
  16387. func (c *PlaylistsDeleteCall) Context(ctx context.Context) *PlaylistsDeleteCall {
  16388. c.ctx_ = ctx
  16389. return c
  16390. }
  16391. // Header returns an http.Header that can be modified by the caller to
  16392. // add HTTP headers to the request.
  16393. func (c *PlaylistsDeleteCall) Header() http.Header {
  16394. if c.header_ == nil {
  16395. c.header_ = make(http.Header)
  16396. }
  16397. return c.header_
  16398. }
  16399. func (c *PlaylistsDeleteCall) doRequest(alt string) (*http.Response, error) {
  16400. reqHeaders := make(http.Header)
  16401. for k, v := range c.header_ {
  16402. reqHeaders[k] = v
  16403. }
  16404. reqHeaders.Set("User-Agent", c.s.userAgent())
  16405. var body io.Reader = nil
  16406. c.urlParams_.Set("alt", alt)
  16407. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  16408. urls += "?" + c.urlParams_.Encode()
  16409. req, _ := http.NewRequest("DELETE", urls, body)
  16410. req.Header = reqHeaders
  16411. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16412. }
  16413. // Do executes the "youtube.playlists.delete" call.
  16414. func (c *PlaylistsDeleteCall) Do(opts ...googleapi.CallOption) error {
  16415. gensupport.SetOptions(c.urlParams_, opts...)
  16416. res, err := c.doRequest("json")
  16417. if err != nil {
  16418. return err
  16419. }
  16420. defer googleapi.CloseBody(res)
  16421. if err := googleapi.CheckResponse(res); err != nil {
  16422. return err
  16423. }
  16424. return nil
  16425. // {
  16426. // "description": "Deletes a playlist.",
  16427. // "httpMethod": "DELETE",
  16428. // "id": "youtube.playlists.delete",
  16429. // "parameterOrder": [
  16430. // "id"
  16431. // ],
  16432. // "parameters": {
  16433. // "id": {
  16434. // "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.",
  16435. // "location": "query",
  16436. // "required": true,
  16437. // "type": "string"
  16438. // },
  16439. // "onBehalfOfContentOwner": {
  16440. // "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.",
  16441. // "location": "query",
  16442. // "type": "string"
  16443. // }
  16444. // },
  16445. // "path": "playlists",
  16446. // "scopes": [
  16447. // "https://www.googleapis.com/auth/youtube",
  16448. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16449. // "https://www.googleapis.com/auth/youtubepartner"
  16450. // ]
  16451. // }
  16452. }
  16453. // method id "youtube.playlists.insert":
  16454. type PlaylistsInsertCall struct {
  16455. s *Service
  16456. playlist *Playlist
  16457. urlParams_ gensupport.URLParams
  16458. ctx_ context.Context
  16459. header_ http.Header
  16460. }
  16461. // Insert: Creates a playlist.
  16462. func (r *PlaylistsService) Insert(part string, playlist *Playlist) *PlaylistsInsertCall {
  16463. c := &PlaylistsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16464. c.urlParams_.Set("part", part)
  16465. c.playlist = playlist
  16466. return c
  16467. }
  16468. // OnBehalfOfContentOwner sets the optional parameter
  16469. // "onBehalfOfContentOwner": Note: This parameter is intended
  16470. // exclusively for YouTube content partners.
  16471. //
  16472. // The onBehalfOfContentOwner parameter indicates that the request's
  16473. // authorization credentials identify a YouTube CMS user who is acting
  16474. // on behalf of the content owner specified in the parameter value. This
  16475. // parameter is intended for YouTube content partners that own and
  16476. // manage many different YouTube channels. It allows content owners to
  16477. // authenticate once and get access to all their video and channel data,
  16478. // without having to provide authentication credentials for each
  16479. // individual channel. The CMS account that the user authenticates with
  16480. // must be linked to the specified YouTube content owner.
  16481. func (c *PlaylistsInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsInsertCall {
  16482. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16483. return c
  16484. }
  16485. // OnBehalfOfContentOwnerChannel sets the optional parameter
  16486. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  16487. // properly authorized request. Note: This parameter is intended
  16488. // exclusively for YouTube content partners.
  16489. //
  16490. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  16491. // channel ID of the channel to which a video is being added. This
  16492. // parameter is required when a request specifies a value for the
  16493. // onBehalfOfContentOwner parameter, and it can only be used in
  16494. // conjunction with that parameter. In addition, the request must be
  16495. // authorized using a CMS account that is linked to the content owner
  16496. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  16497. // channel that the onBehalfOfContentOwnerChannel parameter value
  16498. // specifies must be linked to the content owner that the
  16499. // onBehalfOfContentOwner parameter specifies.
  16500. //
  16501. // This parameter is intended for YouTube content partners that own and
  16502. // manage many different YouTube channels. It allows content owners to
  16503. // authenticate once and perform actions on behalf of the channel
  16504. // specified in the parameter value, without having to provide
  16505. // authentication credentials for each separate channel.
  16506. func (c *PlaylistsInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsInsertCall {
  16507. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  16508. return c
  16509. }
  16510. // Fields allows partial responses to be retrieved. See
  16511. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16512. // for more information.
  16513. func (c *PlaylistsInsertCall) Fields(s ...googleapi.Field) *PlaylistsInsertCall {
  16514. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16515. return c
  16516. }
  16517. // Context sets the context to be used in this call's Do method. Any
  16518. // pending HTTP request will be aborted if the provided context is
  16519. // canceled.
  16520. func (c *PlaylistsInsertCall) Context(ctx context.Context) *PlaylistsInsertCall {
  16521. c.ctx_ = ctx
  16522. return c
  16523. }
  16524. // Header returns an http.Header that can be modified by the caller to
  16525. // add HTTP headers to the request.
  16526. func (c *PlaylistsInsertCall) Header() http.Header {
  16527. if c.header_ == nil {
  16528. c.header_ = make(http.Header)
  16529. }
  16530. return c.header_
  16531. }
  16532. func (c *PlaylistsInsertCall) doRequest(alt string) (*http.Response, error) {
  16533. reqHeaders := make(http.Header)
  16534. for k, v := range c.header_ {
  16535. reqHeaders[k] = v
  16536. }
  16537. reqHeaders.Set("User-Agent", c.s.userAgent())
  16538. var body io.Reader = nil
  16539. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist)
  16540. if err != nil {
  16541. return nil, err
  16542. }
  16543. reqHeaders.Set("Content-Type", "application/json")
  16544. c.urlParams_.Set("alt", alt)
  16545. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  16546. urls += "?" + c.urlParams_.Encode()
  16547. req, _ := http.NewRequest("POST", urls, body)
  16548. req.Header = reqHeaders
  16549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16550. }
  16551. // Do executes the "youtube.playlists.insert" call.
  16552. // Exactly one of *Playlist or error will be non-nil. Any non-2xx status
  16553. // code is an error. Response headers are in either
  16554. // *Playlist.ServerResponse.Header or (if a response was returned at
  16555. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16556. // to check whether the returned error was because
  16557. // http.StatusNotModified was returned.
  16558. func (c *PlaylistsInsertCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
  16559. gensupport.SetOptions(c.urlParams_, opts...)
  16560. res, err := c.doRequest("json")
  16561. if res != nil && res.StatusCode == http.StatusNotModified {
  16562. if res.Body != nil {
  16563. res.Body.Close()
  16564. }
  16565. return nil, &googleapi.Error{
  16566. Code: res.StatusCode,
  16567. Header: res.Header,
  16568. }
  16569. }
  16570. if err != nil {
  16571. return nil, err
  16572. }
  16573. defer googleapi.CloseBody(res)
  16574. if err := googleapi.CheckResponse(res); err != nil {
  16575. return nil, err
  16576. }
  16577. ret := &Playlist{
  16578. ServerResponse: googleapi.ServerResponse{
  16579. Header: res.Header,
  16580. HTTPStatusCode: res.StatusCode,
  16581. },
  16582. }
  16583. target := &ret
  16584. if err := gensupport.DecodeResponse(target, res); err != nil {
  16585. return nil, err
  16586. }
  16587. return ret, nil
  16588. // {
  16589. // "description": "Creates a playlist.",
  16590. // "httpMethod": "POST",
  16591. // "id": "youtube.playlists.insert",
  16592. // "parameterOrder": [
  16593. // "part"
  16594. // ],
  16595. // "parameters": {
  16596. // "onBehalfOfContentOwner": {
  16597. // "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.",
  16598. // "location": "query",
  16599. // "type": "string"
  16600. // },
  16601. // "onBehalfOfContentOwnerChannel": {
  16602. // "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.",
  16603. // "location": "query",
  16604. // "type": "string"
  16605. // },
  16606. // "part": {
  16607. // "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.",
  16608. // "location": "query",
  16609. // "required": true,
  16610. // "type": "string"
  16611. // }
  16612. // },
  16613. // "path": "playlists",
  16614. // "request": {
  16615. // "$ref": "Playlist"
  16616. // },
  16617. // "response": {
  16618. // "$ref": "Playlist"
  16619. // },
  16620. // "scopes": [
  16621. // "https://www.googleapis.com/auth/youtube",
  16622. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16623. // "https://www.googleapis.com/auth/youtubepartner"
  16624. // ]
  16625. // }
  16626. }
  16627. // method id "youtube.playlists.list":
  16628. type PlaylistsListCall struct {
  16629. s *Service
  16630. urlParams_ gensupport.URLParams
  16631. ifNoneMatch_ string
  16632. ctx_ context.Context
  16633. header_ http.Header
  16634. }
  16635. // List: Returns a collection of playlists that match the API request
  16636. // parameters. For example, you can retrieve all playlists that the
  16637. // authenticated user owns, or you can retrieve one or more playlists by
  16638. // their unique IDs.
  16639. func (r *PlaylistsService) List(part string) *PlaylistsListCall {
  16640. c := &PlaylistsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16641. c.urlParams_.Set("part", part)
  16642. return c
  16643. }
  16644. // ChannelId sets the optional parameter "channelId": This value
  16645. // indicates that the API should only return the specified channel's
  16646. // playlists.
  16647. func (c *PlaylistsListCall) ChannelId(channelId string) *PlaylistsListCall {
  16648. c.urlParams_.Set("channelId", channelId)
  16649. return c
  16650. }
  16651. // Hl sets the optional parameter "hl": The hl parameter should be used
  16652. // for filter out the properties that are not in the given language.
  16653. // Used for the snippet part.
  16654. func (c *PlaylistsListCall) Hl(hl string) *PlaylistsListCall {
  16655. c.urlParams_.Set("hl", hl)
  16656. return c
  16657. }
  16658. // Id sets the optional parameter "id": The id parameter specifies a
  16659. // comma-separated list of the YouTube playlist ID(s) for the
  16660. // resource(s) that are being retrieved. In a playlist resource, the id
  16661. // property specifies the playlist's YouTube playlist ID.
  16662. func (c *PlaylistsListCall) Id(id string) *PlaylistsListCall {
  16663. c.urlParams_.Set("id", id)
  16664. return c
  16665. }
  16666. // MaxResults sets the optional parameter "maxResults": The maxResults
  16667. // parameter specifies the maximum number of items that should be
  16668. // returned in the result set.
  16669. func (c *PlaylistsListCall) MaxResults(maxResults int64) *PlaylistsListCall {
  16670. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16671. return c
  16672. }
  16673. // Mine sets the optional parameter "mine": Set this parameter's value
  16674. // to true to instruct the API to only return playlists owned by the
  16675. // authenticated user.
  16676. func (c *PlaylistsListCall) Mine(mine bool) *PlaylistsListCall {
  16677. c.urlParams_.Set("mine", fmt.Sprint(mine))
  16678. return c
  16679. }
  16680. // OnBehalfOfContentOwner sets the optional parameter
  16681. // "onBehalfOfContentOwner": Note: This parameter is intended
  16682. // exclusively for YouTube content partners.
  16683. //
  16684. // The onBehalfOfContentOwner parameter indicates that the request's
  16685. // authorization credentials identify a YouTube CMS user who is acting
  16686. // on behalf of the content owner specified in the parameter value. This
  16687. // parameter is intended for YouTube content partners that own and
  16688. // manage many different YouTube channels. It allows content owners to
  16689. // authenticate once and get access to all their video and channel data,
  16690. // without having to provide authentication credentials for each
  16691. // individual channel. The CMS account that the user authenticates with
  16692. // must be linked to the specified YouTube content owner.
  16693. func (c *PlaylistsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsListCall {
  16694. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16695. return c
  16696. }
  16697. // OnBehalfOfContentOwnerChannel sets the optional parameter
  16698. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  16699. // properly authorized request. Note: This parameter is intended
  16700. // exclusively for YouTube content partners.
  16701. //
  16702. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  16703. // channel ID of the channel to which a video is being added. This
  16704. // parameter is required when a request specifies a value for the
  16705. // onBehalfOfContentOwner parameter, and it can only be used in
  16706. // conjunction with that parameter. In addition, the request must be
  16707. // authorized using a CMS account that is linked to the content owner
  16708. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  16709. // channel that the onBehalfOfContentOwnerChannel parameter value
  16710. // specifies must be linked to the content owner that the
  16711. // onBehalfOfContentOwner parameter specifies.
  16712. //
  16713. // This parameter is intended for YouTube content partners that own and
  16714. // manage many different YouTube channels. It allows content owners to
  16715. // authenticate once and perform actions on behalf of the channel
  16716. // specified in the parameter value, without having to provide
  16717. // authentication credentials for each separate channel.
  16718. func (c *PlaylistsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *PlaylistsListCall {
  16719. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  16720. return c
  16721. }
  16722. // PageToken sets the optional parameter "pageToken": The pageToken
  16723. // parameter identifies a specific page in the result set that should be
  16724. // returned. In an API response, the nextPageToken and prevPageToken
  16725. // properties identify other pages that could be retrieved.
  16726. func (c *PlaylistsListCall) PageToken(pageToken string) *PlaylistsListCall {
  16727. c.urlParams_.Set("pageToken", pageToken)
  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 *PlaylistsListCall) Fields(s ...googleapi.Field) *PlaylistsListCall {
  16734. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16735. return c
  16736. }
  16737. // IfNoneMatch sets the optional parameter which makes the operation
  16738. // fail if the object's ETag matches the given value. This is useful for
  16739. // getting updates only after the object has changed since the last
  16740. // request. Use googleapi.IsNotModified to check whether the response
  16741. // error from Do is the result of In-None-Match.
  16742. func (c *PlaylistsListCall) IfNoneMatch(entityTag string) *PlaylistsListCall {
  16743. c.ifNoneMatch_ = entityTag
  16744. return c
  16745. }
  16746. // Context sets the context to be used in this call's Do method. Any
  16747. // pending HTTP request will be aborted if the provided context is
  16748. // canceled.
  16749. func (c *PlaylistsListCall) Context(ctx context.Context) *PlaylistsListCall {
  16750. c.ctx_ = ctx
  16751. return c
  16752. }
  16753. // Header returns an http.Header that can be modified by the caller to
  16754. // add HTTP headers to the request.
  16755. func (c *PlaylistsListCall) Header() http.Header {
  16756. if c.header_ == nil {
  16757. c.header_ = make(http.Header)
  16758. }
  16759. return c.header_
  16760. }
  16761. func (c *PlaylistsListCall) doRequest(alt string) (*http.Response, error) {
  16762. reqHeaders := make(http.Header)
  16763. for k, v := range c.header_ {
  16764. reqHeaders[k] = v
  16765. }
  16766. reqHeaders.Set("User-Agent", c.s.userAgent())
  16767. if c.ifNoneMatch_ != "" {
  16768. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16769. }
  16770. var body io.Reader = nil
  16771. c.urlParams_.Set("alt", alt)
  16772. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  16773. urls += "?" + c.urlParams_.Encode()
  16774. req, _ := http.NewRequest("GET", urls, body)
  16775. req.Header = reqHeaders
  16776. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16777. }
  16778. // Do executes the "youtube.playlists.list" call.
  16779. // Exactly one of *PlaylistListResponse or error will be non-nil. Any
  16780. // non-2xx status code is an error. Response headers are in either
  16781. // *PlaylistListResponse.ServerResponse.Header or (if a response was
  16782. // returned at all) in error.(*googleapi.Error).Header. Use
  16783. // googleapi.IsNotModified to check whether the returned error was
  16784. // because http.StatusNotModified was returned.
  16785. func (c *PlaylistsListCall) Do(opts ...googleapi.CallOption) (*PlaylistListResponse, error) {
  16786. gensupport.SetOptions(c.urlParams_, opts...)
  16787. res, err := c.doRequest("json")
  16788. if res != nil && res.StatusCode == http.StatusNotModified {
  16789. if res.Body != nil {
  16790. res.Body.Close()
  16791. }
  16792. return nil, &googleapi.Error{
  16793. Code: res.StatusCode,
  16794. Header: res.Header,
  16795. }
  16796. }
  16797. if err != nil {
  16798. return nil, err
  16799. }
  16800. defer googleapi.CloseBody(res)
  16801. if err := googleapi.CheckResponse(res); err != nil {
  16802. return nil, err
  16803. }
  16804. ret := &PlaylistListResponse{
  16805. ServerResponse: googleapi.ServerResponse{
  16806. Header: res.Header,
  16807. HTTPStatusCode: res.StatusCode,
  16808. },
  16809. }
  16810. target := &ret
  16811. if err := gensupport.DecodeResponse(target, res); err != nil {
  16812. return nil, err
  16813. }
  16814. return ret, nil
  16815. // {
  16816. // "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.",
  16817. // "httpMethod": "GET",
  16818. // "id": "youtube.playlists.list",
  16819. // "parameterOrder": [
  16820. // "part"
  16821. // ],
  16822. // "parameters": {
  16823. // "channelId": {
  16824. // "description": "This value indicates that the API should only return the specified channel's playlists.",
  16825. // "location": "query",
  16826. // "type": "string"
  16827. // },
  16828. // "hl": {
  16829. // "description": "The hl parameter should be used for filter out the properties that are not in the given language. Used for the snippet part.",
  16830. // "location": "query",
  16831. // "type": "string"
  16832. // },
  16833. // "id": {
  16834. // "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.",
  16835. // "location": "query",
  16836. // "type": "string"
  16837. // },
  16838. // "maxResults": {
  16839. // "default": "5",
  16840. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  16841. // "format": "uint32",
  16842. // "location": "query",
  16843. // "maximum": "50",
  16844. // "minimum": "0",
  16845. // "type": "integer"
  16846. // },
  16847. // "mine": {
  16848. // "description": "Set this parameter's value to true to instruct the API to only return playlists owned by the authenticated user.",
  16849. // "location": "query",
  16850. // "type": "boolean"
  16851. // },
  16852. // "onBehalfOfContentOwner": {
  16853. // "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.",
  16854. // "location": "query",
  16855. // "type": "string"
  16856. // },
  16857. // "onBehalfOfContentOwnerChannel": {
  16858. // "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.",
  16859. // "location": "query",
  16860. // "type": "string"
  16861. // },
  16862. // "pageToken": {
  16863. // "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.",
  16864. // "location": "query",
  16865. // "type": "string"
  16866. // },
  16867. // "part": {
  16868. // "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.",
  16869. // "location": "query",
  16870. // "required": true,
  16871. // "type": "string"
  16872. // }
  16873. // },
  16874. // "path": "playlists",
  16875. // "response": {
  16876. // "$ref": "PlaylistListResponse"
  16877. // },
  16878. // "scopes": [
  16879. // "https://www.googleapis.com/auth/youtube",
  16880. // "https://www.googleapis.com/auth/youtube.force-ssl",
  16881. // "https://www.googleapis.com/auth/youtube.readonly",
  16882. // "https://www.googleapis.com/auth/youtubepartner"
  16883. // ]
  16884. // }
  16885. }
  16886. // Pages invokes f for each page of results.
  16887. // A non-nil error returned from f will halt the iteration.
  16888. // The provided context supersedes any context provided to the Context method.
  16889. func (c *PlaylistsListCall) Pages(ctx context.Context, f func(*PlaylistListResponse) error) error {
  16890. c.ctx_ = ctx
  16891. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16892. for {
  16893. x, err := c.Do()
  16894. if err != nil {
  16895. return err
  16896. }
  16897. if err := f(x); err != nil {
  16898. return err
  16899. }
  16900. if x.NextPageToken == "" {
  16901. return nil
  16902. }
  16903. c.PageToken(x.NextPageToken)
  16904. }
  16905. }
  16906. // method id "youtube.playlists.update":
  16907. type PlaylistsUpdateCall struct {
  16908. s *Service
  16909. playlist *Playlist
  16910. urlParams_ gensupport.URLParams
  16911. ctx_ context.Context
  16912. header_ http.Header
  16913. }
  16914. // Update: Modifies a playlist. For example, you could change a
  16915. // playlist's title, description, or privacy status.
  16916. func (r *PlaylistsService) Update(part string, playlist *Playlist) *PlaylistsUpdateCall {
  16917. c := &PlaylistsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16918. c.urlParams_.Set("part", part)
  16919. c.playlist = playlist
  16920. return c
  16921. }
  16922. // OnBehalfOfContentOwner sets the optional parameter
  16923. // "onBehalfOfContentOwner": Note: This parameter is intended
  16924. // exclusively for YouTube content partners.
  16925. //
  16926. // The onBehalfOfContentOwner parameter indicates that the request's
  16927. // authorization credentials identify a YouTube CMS user who is acting
  16928. // on behalf of the content owner specified in the parameter value. This
  16929. // parameter is intended for YouTube content partners that own and
  16930. // manage many different YouTube channels. It allows content owners to
  16931. // authenticate once and get access to all their video and channel data,
  16932. // without having to provide authentication credentials for each
  16933. // individual channel. The CMS account that the user authenticates with
  16934. // must be linked to the specified YouTube content owner.
  16935. func (c *PlaylistsUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *PlaylistsUpdateCall {
  16936. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  16937. return c
  16938. }
  16939. // Fields allows partial responses to be retrieved. See
  16940. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16941. // for more information.
  16942. func (c *PlaylistsUpdateCall) Fields(s ...googleapi.Field) *PlaylistsUpdateCall {
  16943. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16944. return c
  16945. }
  16946. // Context sets the context to be used in this call's Do method. Any
  16947. // pending HTTP request will be aborted if the provided context is
  16948. // canceled.
  16949. func (c *PlaylistsUpdateCall) Context(ctx context.Context) *PlaylistsUpdateCall {
  16950. c.ctx_ = ctx
  16951. return c
  16952. }
  16953. // Header returns an http.Header that can be modified by the caller to
  16954. // add HTTP headers to the request.
  16955. func (c *PlaylistsUpdateCall) Header() http.Header {
  16956. if c.header_ == nil {
  16957. c.header_ = make(http.Header)
  16958. }
  16959. return c.header_
  16960. }
  16961. func (c *PlaylistsUpdateCall) doRequest(alt string) (*http.Response, error) {
  16962. reqHeaders := make(http.Header)
  16963. for k, v := range c.header_ {
  16964. reqHeaders[k] = v
  16965. }
  16966. reqHeaders.Set("User-Agent", c.s.userAgent())
  16967. var body io.Reader = nil
  16968. body, err := googleapi.WithoutDataWrapper.JSONReader(c.playlist)
  16969. if err != nil {
  16970. return nil, err
  16971. }
  16972. reqHeaders.Set("Content-Type", "application/json")
  16973. c.urlParams_.Set("alt", alt)
  16974. urls := googleapi.ResolveRelative(c.s.BasePath, "playlists")
  16975. urls += "?" + c.urlParams_.Encode()
  16976. req, _ := http.NewRequest("PUT", urls, body)
  16977. req.Header = reqHeaders
  16978. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16979. }
  16980. // Do executes the "youtube.playlists.update" call.
  16981. // Exactly one of *Playlist or error will be non-nil. Any non-2xx status
  16982. // code is an error. Response headers are in either
  16983. // *Playlist.ServerResponse.Header or (if a response was returned at
  16984. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16985. // to check whether the returned error was because
  16986. // http.StatusNotModified was returned.
  16987. func (c *PlaylistsUpdateCall) Do(opts ...googleapi.CallOption) (*Playlist, error) {
  16988. gensupport.SetOptions(c.urlParams_, opts...)
  16989. res, err := c.doRequest("json")
  16990. if res != nil && res.StatusCode == http.StatusNotModified {
  16991. if res.Body != nil {
  16992. res.Body.Close()
  16993. }
  16994. return nil, &googleapi.Error{
  16995. Code: res.StatusCode,
  16996. Header: res.Header,
  16997. }
  16998. }
  16999. if err != nil {
  17000. return nil, err
  17001. }
  17002. defer googleapi.CloseBody(res)
  17003. if err := googleapi.CheckResponse(res); err != nil {
  17004. return nil, err
  17005. }
  17006. ret := &Playlist{
  17007. ServerResponse: googleapi.ServerResponse{
  17008. Header: res.Header,
  17009. HTTPStatusCode: res.StatusCode,
  17010. },
  17011. }
  17012. target := &ret
  17013. if err := gensupport.DecodeResponse(target, res); err != nil {
  17014. return nil, err
  17015. }
  17016. return ret, nil
  17017. // {
  17018. // "description": "Modifies a playlist. For example, you could change a playlist's title, description, or privacy status.",
  17019. // "httpMethod": "PUT",
  17020. // "id": "youtube.playlists.update",
  17021. // "parameterOrder": [
  17022. // "part"
  17023. // ],
  17024. // "parameters": {
  17025. // "onBehalfOfContentOwner": {
  17026. // "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.",
  17027. // "location": "query",
  17028. // "type": "string"
  17029. // },
  17030. // "part": {
  17031. // "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.",
  17032. // "location": "query",
  17033. // "required": true,
  17034. // "type": "string"
  17035. // }
  17036. // },
  17037. // "path": "playlists",
  17038. // "request": {
  17039. // "$ref": "Playlist"
  17040. // },
  17041. // "response": {
  17042. // "$ref": "Playlist"
  17043. // },
  17044. // "scopes": [
  17045. // "https://www.googleapis.com/auth/youtube",
  17046. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17047. // "https://www.googleapis.com/auth/youtubepartner"
  17048. // ]
  17049. // }
  17050. }
  17051. // method id "youtube.search.list":
  17052. type SearchListCall struct {
  17053. s *Service
  17054. urlParams_ gensupport.URLParams
  17055. ifNoneMatch_ string
  17056. ctx_ context.Context
  17057. header_ http.Header
  17058. }
  17059. // List: Returns a collection of search results that match the query
  17060. // parameters specified in the API request. By default, a search result
  17061. // set identifies matching video, channel, and playlist resources, but
  17062. // you can also configure queries to only retrieve a specific type of
  17063. // resource.
  17064. func (r *SearchService) List(part string) *SearchListCall {
  17065. c := &SearchListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17066. c.urlParams_.Set("part", part)
  17067. return c
  17068. }
  17069. // ChannelId sets the optional parameter "channelId": The channelId
  17070. // parameter indicates that the API response should only contain
  17071. // resources created by the channel
  17072. func (c *SearchListCall) ChannelId(channelId string) *SearchListCall {
  17073. c.urlParams_.Set("channelId", channelId)
  17074. return c
  17075. }
  17076. // ChannelType sets the optional parameter "channelType": The
  17077. // channelType parameter lets you restrict a search to a particular type
  17078. // of channel.
  17079. //
  17080. // Possible values:
  17081. // "any" - Return all channels.
  17082. // "show" - Only retrieve shows.
  17083. func (c *SearchListCall) ChannelType(channelType string) *SearchListCall {
  17084. c.urlParams_.Set("channelType", channelType)
  17085. return c
  17086. }
  17087. // EventType sets the optional parameter "eventType": The eventType
  17088. // parameter restricts a search to broadcast events. If you specify a
  17089. // value for this parameter, you must also set the type parameter's
  17090. // value to video.
  17091. //
  17092. // Possible values:
  17093. // "completed" - Only include completed broadcasts.
  17094. // "live" - Only include active broadcasts.
  17095. // "upcoming" - Only include upcoming broadcasts.
  17096. func (c *SearchListCall) EventType(eventType string) *SearchListCall {
  17097. c.urlParams_.Set("eventType", eventType)
  17098. return c
  17099. }
  17100. // ForContentOwner sets the optional parameter "forContentOwner": Note:
  17101. // This parameter is intended exclusively for YouTube content
  17102. // partners.
  17103. //
  17104. // The forContentOwner parameter restricts the search to only retrieve
  17105. // resources owned by the content owner specified by the
  17106. // onBehalfOfContentOwner parameter. The user must be authenticated
  17107. // using a CMS account linked to the specified content owner and
  17108. // onBehalfOfContentOwner must be provided.
  17109. func (c *SearchListCall) ForContentOwner(forContentOwner bool) *SearchListCall {
  17110. c.urlParams_.Set("forContentOwner", fmt.Sprint(forContentOwner))
  17111. return c
  17112. }
  17113. // ForDeveloper sets the optional parameter "forDeveloper": The
  17114. // forDeveloper parameter restricts the search to only retrieve videos
  17115. // uploaded via the developer's application or website. The API server
  17116. // uses the request's authorization credentials to identify the
  17117. // developer. Therefore, a developer can restrict results to videos
  17118. // uploaded through the developer's own app or website but not to videos
  17119. // uploaded through other apps or sites.
  17120. func (c *SearchListCall) ForDeveloper(forDeveloper bool) *SearchListCall {
  17121. c.urlParams_.Set("forDeveloper", fmt.Sprint(forDeveloper))
  17122. return c
  17123. }
  17124. // ForMine sets the optional parameter "forMine": The forMine parameter
  17125. // restricts the search to only retrieve videos owned by the
  17126. // authenticated user. If you set this parameter to true, then the type
  17127. // parameter's value must also be set to video.
  17128. func (c *SearchListCall) ForMine(forMine bool) *SearchListCall {
  17129. c.urlParams_.Set("forMine", fmt.Sprint(forMine))
  17130. return c
  17131. }
  17132. // Location sets the optional parameter "location": The location
  17133. // parameter, in conjunction with the locationRadius parameter, defines
  17134. // a circular geographic area and also restricts a search to videos that
  17135. // specify, in their metadata, a geographic location that falls within
  17136. // that area. The parameter value is a string that specifies
  17137. // latitude/longitude coordinates e.g. (37.42307,-122.08427).
  17138. //
  17139. //
  17140. // - The location parameter value identifies the point at the center of
  17141. // the area.
  17142. // - The locationRadius parameter specifies the maximum distance that
  17143. // the location associated with a video can be from that point for the
  17144. // video to still be included in the search results.The API returns an
  17145. // error if your request specifies a value for the location parameter
  17146. // but does not also specify a value for the locationRadius parameter.
  17147. func (c *SearchListCall) Location(location string) *SearchListCall {
  17148. c.urlParams_.Set("location", location)
  17149. return c
  17150. }
  17151. // LocationRadius sets the optional parameter "locationRadius": The
  17152. // locationRadius parameter, in conjunction with the location parameter,
  17153. // defines a circular geographic area.
  17154. //
  17155. // The parameter value must be a floating point number followed by a
  17156. // measurement unit. Valid measurement units are m, km, ft, and mi. For
  17157. // example, valid parameter values include 1500m, 5km, 10000ft, and
  17158. // 0.75mi. The API does not support locationRadius parameter values
  17159. // larger than 1000 kilometers.
  17160. //
  17161. // Note: See the definition of the location parameter for more
  17162. // information.
  17163. func (c *SearchListCall) LocationRadius(locationRadius string) *SearchListCall {
  17164. c.urlParams_.Set("locationRadius", locationRadius)
  17165. return c
  17166. }
  17167. // MaxResults sets the optional parameter "maxResults": The maxResults
  17168. // parameter specifies the maximum number of items that should be
  17169. // returned in the result set.
  17170. func (c *SearchListCall) MaxResults(maxResults int64) *SearchListCall {
  17171. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17172. return c
  17173. }
  17174. // OnBehalfOfContentOwner sets the optional parameter
  17175. // "onBehalfOfContentOwner": Note: This parameter is intended
  17176. // exclusively for YouTube content partners.
  17177. //
  17178. // The onBehalfOfContentOwner parameter indicates that the request's
  17179. // authorization credentials identify a YouTube CMS user who is acting
  17180. // on behalf of the content owner specified in the parameter value. This
  17181. // parameter is intended for YouTube content partners that own and
  17182. // manage many different YouTube channels. It allows content owners to
  17183. // authenticate once and get access to all their video and channel data,
  17184. // without having to provide authentication credentials for each
  17185. // individual channel. The CMS account that the user authenticates with
  17186. // must be linked to the specified YouTube content owner.
  17187. func (c *SearchListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SearchListCall {
  17188. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  17189. return c
  17190. }
  17191. // Order sets the optional parameter "order": The order parameter
  17192. // specifies the method that will be used to order resources in the API
  17193. // response.
  17194. //
  17195. // Possible values:
  17196. // "date" - Resources are sorted in reverse chronological order based
  17197. // on the date they were created.
  17198. // "rating" - Resources are sorted from highest to lowest rating.
  17199. // "relevance" - Resources are sorted based on their relevance to the
  17200. // search query. This is the default value for this parameter.
  17201. // "title" - Resources are sorted alphabetically by title.
  17202. // "videoCount" - Channels are sorted in descending order of their
  17203. // number of uploaded videos.
  17204. // "viewCount" - Resources are sorted from highest to lowest number of
  17205. // views.
  17206. func (c *SearchListCall) Order(order string) *SearchListCall {
  17207. c.urlParams_.Set("order", order)
  17208. return c
  17209. }
  17210. // PageToken sets the optional parameter "pageToken": The pageToken
  17211. // parameter identifies a specific page in the result set that should be
  17212. // returned. In an API response, the nextPageToken and prevPageToken
  17213. // properties identify other pages that could be retrieved.
  17214. func (c *SearchListCall) PageToken(pageToken string) *SearchListCall {
  17215. c.urlParams_.Set("pageToken", pageToken)
  17216. return c
  17217. }
  17218. // PublishedAfter sets the optional parameter "publishedAfter": The
  17219. // publishedAfter parameter indicates that the API response should only
  17220. // contain resources created after the specified time. The value is an
  17221. // RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  17222. func (c *SearchListCall) PublishedAfter(publishedAfter string) *SearchListCall {
  17223. c.urlParams_.Set("publishedAfter", publishedAfter)
  17224. return c
  17225. }
  17226. // PublishedBefore sets the optional parameter "publishedBefore": The
  17227. // publishedBefore parameter indicates that the API response should only
  17228. // contain resources created before the specified time. The value is an
  17229. // RFC 3339 formatted date-time value (1970-01-01T00:00:00Z).
  17230. func (c *SearchListCall) PublishedBefore(publishedBefore string) *SearchListCall {
  17231. c.urlParams_.Set("publishedBefore", publishedBefore)
  17232. return c
  17233. }
  17234. // Q sets the optional parameter "q": The q parameter specifies the
  17235. // query term to search for.
  17236. //
  17237. // Your request can also use the Boolean NOT (-) and OR (|) operators to
  17238. // exclude videos or to find videos that are associated with one of
  17239. // several search terms. For example, to search for videos matching
  17240. // either "boating" or "sailing", set the q parameter value to
  17241. // boating|sailing. Similarly, to search for videos matching either
  17242. // "boating" or "sailing" but not "fishing", set the q parameter value
  17243. // to boating|sailing -fishing. Note that the pipe character must be
  17244. // URL-escaped when it is sent in your API request. The URL-escaped
  17245. // value for the pipe character is %7C.
  17246. func (c *SearchListCall) Q(q string) *SearchListCall {
  17247. c.urlParams_.Set("q", q)
  17248. return c
  17249. }
  17250. // RegionCode sets the optional parameter "regionCode": The regionCode
  17251. // parameter instructs the API to return search results for the
  17252. // specified country. The parameter value is an ISO 3166-1 alpha-2
  17253. // country code.
  17254. func (c *SearchListCall) RegionCode(regionCode string) *SearchListCall {
  17255. c.urlParams_.Set("regionCode", regionCode)
  17256. return c
  17257. }
  17258. // RelatedToVideoId sets the optional parameter "relatedToVideoId": The
  17259. // relatedToVideoId parameter retrieves a list of videos that are
  17260. // related to the video that the parameter value identifies. The
  17261. // parameter value must be set to a YouTube video ID and, if you are
  17262. // using this parameter, the type parameter must be set to video.
  17263. func (c *SearchListCall) RelatedToVideoId(relatedToVideoId string) *SearchListCall {
  17264. c.urlParams_.Set("relatedToVideoId", relatedToVideoId)
  17265. return c
  17266. }
  17267. // RelevanceLanguage sets the optional parameter "relevanceLanguage":
  17268. // The relevanceLanguage parameter instructs the API to return search
  17269. // results that are most relevant to the specified language. The
  17270. // parameter value is typically an ISO 639-1 two-letter language code.
  17271. // However, you should use the values zh-Hans for simplified Chinese and
  17272. // zh-Hant for traditional Chinese. Please note that results in other
  17273. // languages will still be returned if they are highly relevant to the
  17274. // search query term.
  17275. func (c *SearchListCall) RelevanceLanguage(relevanceLanguage string) *SearchListCall {
  17276. c.urlParams_.Set("relevanceLanguage", relevanceLanguage)
  17277. return c
  17278. }
  17279. // SafeSearch sets the optional parameter "safeSearch": The safeSearch
  17280. // parameter indicates whether the search results should include
  17281. // restricted content as well as standard content.
  17282. //
  17283. // Possible values:
  17284. // "moderate" - YouTube will filter some content from search results
  17285. // and, at the least, will filter content that is restricted in your
  17286. // locale. Based on their content, search results could be removed from
  17287. // search results or demoted in search results. This is the default
  17288. // parameter value.
  17289. // "none" - YouTube will not filter the search result set.
  17290. // "strict" - YouTube will try to exclude all restricted content from
  17291. // the search result set. Based on their content, search results could
  17292. // be removed from search results or demoted in search results.
  17293. func (c *SearchListCall) SafeSearch(safeSearch string) *SearchListCall {
  17294. c.urlParams_.Set("safeSearch", safeSearch)
  17295. return c
  17296. }
  17297. // TopicId sets the optional parameter "topicId": The topicId parameter
  17298. // indicates that the API response should only contain resources
  17299. // associated with the specified topic. The value identifies a Freebase
  17300. // topic ID.
  17301. func (c *SearchListCall) TopicId(topicId string) *SearchListCall {
  17302. c.urlParams_.Set("topicId", topicId)
  17303. return c
  17304. }
  17305. // Type sets the optional parameter "type": The type parameter restricts
  17306. // a search query to only retrieve a particular type of resource. The
  17307. // value is a comma-separated list of resource types.
  17308. func (c *SearchListCall) Type(type_ string) *SearchListCall {
  17309. c.urlParams_.Set("type", type_)
  17310. return c
  17311. }
  17312. // VideoCaption sets the optional parameter "videoCaption": The
  17313. // videoCaption parameter indicates whether the API should filter video
  17314. // search results based on whether they have captions. If you specify a
  17315. // value for this parameter, you must also set the type parameter's
  17316. // value to video.
  17317. //
  17318. // Possible values:
  17319. // "any" - Do not filter results based on caption availability.
  17320. // "closedCaption" - Only include videos that have captions.
  17321. // "none" - Only include videos that do not have captions.
  17322. func (c *SearchListCall) VideoCaption(videoCaption string) *SearchListCall {
  17323. c.urlParams_.Set("videoCaption", videoCaption)
  17324. return c
  17325. }
  17326. // VideoCategoryId sets the optional parameter "videoCategoryId": The
  17327. // videoCategoryId parameter filters video search results based on their
  17328. // category. If you specify a value for this parameter, you must also
  17329. // set the type parameter's value to video.
  17330. func (c *SearchListCall) VideoCategoryId(videoCategoryId string) *SearchListCall {
  17331. c.urlParams_.Set("videoCategoryId", videoCategoryId)
  17332. return c
  17333. }
  17334. // VideoDefinition sets the optional parameter "videoDefinition": The
  17335. // videoDefinition parameter lets you restrict a search to only include
  17336. // either high definition (HD) or standard definition (SD) videos. HD
  17337. // videos are available for playback in at least 720p, though higher
  17338. // resolutions, like 1080p, might also be available. If you specify a
  17339. // value for this parameter, you must also set the type parameter's
  17340. // value to video.
  17341. //
  17342. // Possible values:
  17343. // "any" - Return all videos, regardless of their resolution.
  17344. // "high" - Only retrieve HD videos.
  17345. // "standard" - Only retrieve videos in standard definition.
  17346. func (c *SearchListCall) VideoDefinition(videoDefinition string) *SearchListCall {
  17347. c.urlParams_.Set("videoDefinition", videoDefinition)
  17348. return c
  17349. }
  17350. // VideoDimension sets the optional parameter "videoDimension": The
  17351. // videoDimension parameter lets you restrict a search to only retrieve
  17352. // 2D or 3D videos. If you specify a value for this parameter, you must
  17353. // also set the type parameter's value to video.
  17354. //
  17355. // Possible values:
  17356. // "2d" - Restrict search results to exclude 3D videos.
  17357. // "3d" - Restrict search results to only include 3D videos.
  17358. // "any" - Include both 3D and non-3D videos in returned results. This
  17359. // is the default value.
  17360. func (c *SearchListCall) VideoDimension(videoDimension string) *SearchListCall {
  17361. c.urlParams_.Set("videoDimension", videoDimension)
  17362. return c
  17363. }
  17364. // VideoDuration sets the optional parameter "videoDuration": The
  17365. // videoDuration parameter filters video search results based on their
  17366. // duration. If you specify a value for this parameter, you must also
  17367. // set the type parameter's value to video.
  17368. //
  17369. // Possible values:
  17370. // "any" - Do not filter video search results based on their duration.
  17371. // This is the default value.
  17372. // "long" - Only include videos longer than 20 minutes.
  17373. // "medium" - Only include videos that are between four and 20 minutes
  17374. // long (inclusive).
  17375. // "short" - Only include videos that are less than four minutes long.
  17376. func (c *SearchListCall) VideoDuration(videoDuration string) *SearchListCall {
  17377. c.urlParams_.Set("videoDuration", videoDuration)
  17378. return c
  17379. }
  17380. // VideoEmbeddable sets the optional parameter "videoEmbeddable": The
  17381. // videoEmbeddable parameter lets you to restrict a search to only
  17382. // videos that can be embedded into a webpage. If you specify a value
  17383. // for this parameter, you must also set the type parameter's value to
  17384. // video.
  17385. //
  17386. // Possible values:
  17387. // "any" - Return all videos, embeddable or not.
  17388. // "true" - Only retrieve embeddable videos.
  17389. func (c *SearchListCall) VideoEmbeddable(videoEmbeddable string) *SearchListCall {
  17390. c.urlParams_.Set("videoEmbeddable", videoEmbeddable)
  17391. return c
  17392. }
  17393. // VideoLicense sets the optional parameter "videoLicense": The
  17394. // videoLicense parameter filters search results to only include videos
  17395. // with a particular license. YouTube lets video uploaders choose to
  17396. // attach either the Creative Commons license or the standard YouTube
  17397. // license to each of their videos. If you specify a value for this
  17398. // parameter, you must also set the type parameter's value to video.
  17399. //
  17400. // Possible values:
  17401. // "any" - Return all videos, regardless of which license they have,
  17402. // that match the query parameters.
  17403. // "creativeCommon" - Only return videos that have a Creative Commons
  17404. // license. Users can reuse videos with this license in other videos
  17405. // that they create. Learn more.
  17406. // "youtube" - Only return videos that have the standard YouTube
  17407. // license.
  17408. func (c *SearchListCall) VideoLicense(videoLicense string) *SearchListCall {
  17409. c.urlParams_.Set("videoLicense", videoLicense)
  17410. return c
  17411. }
  17412. // VideoSyndicated sets the optional parameter "videoSyndicated": The
  17413. // videoSyndicated parameter lets you to restrict a search to only
  17414. // videos that can be played outside youtube.com. If you specify a value
  17415. // for this parameter, you must also set the type parameter's value to
  17416. // video.
  17417. //
  17418. // Possible values:
  17419. // "any" - Return all videos, syndicated or not.
  17420. // "true" - Only retrieve syndicated videos.
  17421. func (c *SearchListCall) VideoSyndicated(videoSyndicated string) *SearchListCall {
  17422. c.urlParams_.Set("videoSyndicated", videoSyndicated)
  17423. return c
  17424. }
  17425. // VideoType sets the optional parameter "videoType": The videoType
  17426. // parameter lets you restrict a search to a particular type of videos.
  17427. // If you specify a value for this parameter, you must also set the type
  17428. // parameter's value to video.
  17429. //
  17430. // Possible values:
  17431. // "any" - Return all videos.
  17432. // "episode" - Only retrieve episodes of shows.
  17433. // "movie" - Only retrieve movies.
  17434. func (c *SearchListCall) VideoType(videoType string) *SearchListCall {
  17435. c.urlParams_.Set("videoType", videoType)
  17436. return c
  17437. }
  17438. // Fields allows partial responses to be retrieved. See
  17439. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17440. // for more information.
  17441. func (c *SearchListCall) Fields(s ...googleapi.Field) *SearchListCall {
  17442. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17443. return c
  17444. }
  17445. // IfNoneMatch sets the optional parameter which makes the operation
  17446. // fail if the object's ETag matches the given value. This is useful for
  17447. // getting updates only after the object has changed since the last
  17448. // request. Use googleapi.IsNotModified to check whether the response
  17449. // error from Do is the result of In-None-Match.
  17450. func (c *SearchListCall) IfNoneMatch(entityTag string) *SearchListCall {
  17451. c.ifNoneMatch_ = entityTag
  17452. return c
  17453. }
  17454. // Context sets the context to be used in this call's Do method. Any
  17455. // pending HTTP request will be aborted if the provided context is
  17456. // canceled.
  17457. func (c *SearchListCall) Context(ctx context.Context) *SearchListCall {
  17458. c.ctx_ = ctx
  17459. return c
  17460. }
  17461. // Header returns an http.Header that can be modified by the caller to
  17462. // add HTTP headers to the request.
  17463. func (c *SearchListCall) Header() http.Header {
  17464. if c.header_ == nil {
  17465. c.header_ = make(http.Header)
  17466. }
  17467. return c.header_
  17468. }
  17469. func (c *SearchListCall) doRequest(alt string) (*http.Response, error) {
  17470. reqHeaders := make(http.Header)
  17471. for k, v := range c.header_ {
  17472. reqHeaders[k] = v
  17473. }
  17474. reqHeaders.Set("User-Agent", c.s.userAgent())
  17475. if c.ifNoneMatch_ != "" {
  17476. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17477. }
  17478. var body io.Reader = nil
  17479. c.urlParams_.Set("alt", alt)
  17480. urls := googleapi.ResolveRelative(c.s.BasePath, "search")
  17481. urls += "?" + c.urlParams_.Encode()
  17482. req, _ := http.NewRequest("GET", urls, body)
  17483. req.Header = reqHeaders
  17484. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17485. }
  17486. // Do executes the "youtube.search.list" call.
  17487. // Exactly one of *SearchListResponse or error will be non-nil. Any
  17488. // non-2xx status code is an error. Response headers are in either
  17489. // *SearchListResponse.ServerResponse.Header or (if a response was
  17490. // returned at all) in error.(*googleapi.Error).Header. Use
  17491. // googleapi.IsNotModified to check whether the returned error was
  17492. // because http.StatusNotModified was returned.
  17493. func (c *SearchListCall) Do(opts ...googleapi.CallOption) (*SearchListResponse, error) {
  17494. gensupport.SetOptions(c.urlParams_, opts...)
  17495. res, err := c.doRequest("json")
  17496. if res != nil && res.StatusCode == http.StatusNotModified {
  17497. if res.Body != nil {
  17498. res.Body.Close()
  17499. }
  17500. return nil, &googleapi.Error{
  17501. Code: res.StatusCode,
  17502. Header: res.Header,
  17503. }
  17504. }
  17505. if err != nil {
  17506. return nil, err
  17507. }
  17508. defer googleapi.CloseBody(res)
  17509. if err := googleapi.CheckResponse(res); err != nil {
  17510. return nil, err
  17511. }
  17512. ret := &SearchListResponse{
  17513. ServerResponse: googleapi.ServerResponse{
  17514. Header: res.Header,
  17515. HTTPStatusCode: res.StatusCode,
  17516. },
  17517. }
  17518. target := &ret
  17519. if err := gensupport.DecodeResponse(target, res); err != nil {
  17520. return nil, err
  17521. }
  17522. return ret, nil
  17523. // {
  17524. // "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.",
  17525. // "httpMethod": "GET",
  17526. // "id": "youtube.search.list",
  17527. // "parameterOrder": [
  17528. // "part"
  17529. // ],
  17530. // "parameters": {
  17531. // "channelId": {
  17532. // "description": "The channelId parameter indicates that the API response should only contain resources created by the channel",
  17533. // "location": "query",
  17534. // "type": "string"
  17535. // },
  17536. // "channelType": {
  17537. // "description": "The channelType parameter lets you restrict a search to a particular type of channel.",
  17538. // "enum": [
  17539. // "any",
  17540. // "show"
  17541. // ],
  17542. // "enumDescriptions": [
  17543. // "Return all channels.",
  17544. // "Only retrieve shows."
  17545. // ],
  17546. // "location": "query",
  17547. // "type": "string"
  17548. // },
  17549. // "eventType": {
  17550. // "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.",
  17551. // "enum": [
  17552. // "completed",
  17553. // "live",
  17554. // "upcoming"
  17555. // ],
  17556. // "enumDescriptions": [
  17557. // "Only include completed broadcasts.",
  17558. // "Only include active broadcasts.",
  17559. // "Only include upcoming broadcasts."
  17560. // ],
  17561. // "location": "query",
  17562. // "type": "string"
  17563. // },
  17564. // "forContentOwner": {
  17565. // "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.",
  17566. // "location": "query",
  17567. // "type": "boolean"
  17568. // },
  17569. // "forDeveloper": {
  17570. // "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.",
  17571. // "location": "query",
  17572. // "type": "boolean"
  17573. // },
  17574. // "forMine": {
  17575. // "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.",
  17576. // "location": "query",
  17577. // "type": "boolean"
  17578. // },
  17579. // "location": {
  17580. // "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.",
  17581. // "location": "query",
  17582. // "type": "string"
  17583. // },
  17584. // "locationRadius": {
  17585. // "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.",
  17586. // "location": "query",
  17587. // "type": "string"
  17588. // },
  17589. // "maxResults": {
  17590. // "default": "5",
  17591. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  17592. // "format": "uint32",
  17593. // "location": "query",
  17594. // "maximum": "50",
  17595. // "minimum": "0",
  17596. // "type": "integer"
  17597. // },
  17598. // "onBehalfOfContentOwner": {
  17599. // "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.",
  17600. // "location": "query",
  17601. // "type": "string"
  17602. // },
  17603. // "order": {
  17604. // "default": "SEARCH_SORT_RELEVANCE",
  17605. // "description": "The order parameter specifies the method that will be used to order resources in the API response.",
  17606. // "enum": [
  17607. // "date",
  17608. // "rating",
  17609. // "relevance",
  17610. // "title",
  17611. // "videoCount",
  17612. // "viewCount"
  17613. // ],
  17614. // "enumDescriptions": [
  17615. // "Resources are sorted in reverse chronological order based on the date they were created.",
  17616. // "Resources are sorted from highest to lowest rating.",
  17617. // "Resources are sorted based on their relevance to the search query. This is the default value for this parameter.",
  17618. // "Resources are sorted alphabetically by title.",
  17619. // "Channels are sorted in descending order of their number of uploaded videos.",
  17620. // "Resources are sorted from highest to lowest number of views."
  17621. // ],
  17622. // "location": "query",
  17623. // "type": "string"
  17624. // },
  17625. // "pageToken": {
  17626. // "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.",
  17627. // "location": "query",
  17628. // "type": "string"
  17629. // },
  17630. // "part": {
  17631. // "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.",
  17632. // "location": "query",
  17633. // "required": true,
  17634. // "type": "string"
  17635. // },
  17636. // "publishedAfter": {
  17637. // "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).",
  17638. // "format": "date-time",
  17639. // "location": "query",
  17640. // "type": "string"
  17641. // },
  17642. // "publishedBefore": {
  17643. // "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).",
  17644. // "format": "date-time",
  17645. // "location": "query",
  17646. // "type": "string"
  17647. // },
  17648. // "q": {
  17649. // "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.",
  17650. // "location": "query",
  17651. // "type": "string"
  17652. // },
  17653. // "regionCode": {
  17654. // "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.",
  17655. // "location": "query",
  17656. // "type": "string"
  17657. // },
  17658. // "relatedToVideoId": {
  17659. // "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.",
  17660. // "location": "query",
  17661. // "type": "string"
  17662. // },
  17663. // "relevanceLanguage": {
  17664. // "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.",
  17665. // "location": "query",
  17666. // "type": "string"
  17667. // },
  17668. // "safeSearch": {
  17669. // "description": "The safeSearch parameter indicates whether the search results should include restricted content as well as standard content.",
  17670. // "enum": [
  17671. // "moderate",
  17672. // "none",
  17673. // "strict"
  17674. // ],
  17675. // "enumDescriptions": [
  17676. // "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.",
  17677. // "YouTube will not filter the search result set.",
  17678. // "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."
  17679. // ],
  17680. // "location": "query",
  17681. // "type": "string"
  17682. // },
  17683. // "topicId": {
  17684. // "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.",
  17685. // "location": "query",
  17686. // "type": "string"
  17687. // },
  17688. // "type": {
  17689. // "default": "video,channel,playlist",
  17690. // "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.",
  17691. // "location": "query",
  17692. // "type": "string"
  17693. // },
  17694. // "videoCaption": {
  17695. // "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.",
  17696. // "enum": [
  17697. // "any",
  17698. // "closedCaption",
  17699. // "none"
  17700. // ],
  17701. // "enumDescriptions": [
  17702. // "Do not filter results based on caption availability.",
  17703. // "Only include videos that have captions.",
  17704. // "Only include videos that do not have captions."
  17705. // ],
  17706. // "location": "query",
  17707. // "type": "string"
  17708. // },
  17709. // "videoCategoryId": {
  17710. // "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.",
  17711. // "location": "query",
  17712. // "type": "string"
  17713. // },
  17714. // "videoDefinition": {
  17715. // "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.",
  17716. // "enum": [
  17717. // "any",
  17718. // "high",
  17719. // "standard"
  17720. // ],
  17721. // "enumDescriptions": [
  17722. // "Return all videos, regardless of their resolution.",
  17723. // "Only retrieve HD videos.",
  17724. // "Only retrieve videos in standard definition."
  17725. // ],
  17726. // "location": "query",
  17727. // "type": "string"
  17728. // },
  17729. // "videoDimension": {
  17730. // "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.",
  17731. // "enum": [
  17732. // "2d",
  17733. // "3d",
  17734. // "any"
  17735. // ],
  17736. // "enumDescriptions": [
  17737. // "Restrict search results to exclude 3D videos.",
  17738. // "Restrict search results to only include 3D videos.",
  17739. // "Include both 3D and non-3D videos in returned results. This is the default value."
  17740. // ],
  17741. // "location": "query",
  17742. // "type": "string"
  17743. // },
  17744. // "videoDuration": {
  17745. // "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.",
  17746. // "enum": [
  17747. // "any",
  17748. // "long",
  17749. // "medium",
  17750. // "short"
  17751. // ],
  17752. // "enumDescriptions": [
  17753. // "Do not filter video search results based on their duration. This is the default value.",
  17754. // "Only include videos longer than 20 minutes.",
  17755. // "Only include videos that are between four and 20 minutes long (inclusive).",
  17756. // "Only include videos that are less than four minutes long."
  17757. // ],
  17758. // "location": "query",
  17759. // "type": "string"
  17760. // },
  17761. // "videoEmbeddable": {
  17762. // "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.",
  17763. // "enum": [
  17764. // "any",
  17765. // "true"
  17766. // ],
  17767. // "enumDescriptions": [
  17768. // "Return all videos, embeddable or not.",
  17769. // "Only retrieve embeddable videos."
  17770. // ],
  17771. // "location": "query",
  17772. // "type": "string"
  17773. // },
  17774. // "videoLicense": {
  17775. // "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.",
  17776. // "enum": [
  17777. // "any",
  17778. // "creativeCommon",
  17779. // "youtube"
  17780. // ],
  17781. // "enumDescriptions": [
  17782. // "Return all videos, regardless of which license they have, that match the query parameters.",
  17783. // "Only return videos that have a Creative Commons license. Users can reuse videos with this license in other videos that they create. Learn more.",
  17784. // "Only return videos that have the standard YouTube license."
  17785. // ],
  17786. // "location": "query",
  17787. // "type": "string"
  17788. // },
  17789. // "videoSyndicated": {
  17790. // "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.",
  17791. // "enum": [
  17792. // "any",
  17793. // "true"
  17794. // ],
  17795. // "enumDescriptions": [
  17796. // "Return all videos, syndicated or not.",
  17797. // "Only retrieve syndicated videos."
  17798. // ],
  17799. // "location": "query",
  17800. // "type": "string"
  17801. // },
  17802. // "videoType": {
  17803. // "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.",
  17804. // "enum": [
  17805. // "any",
  17806. // "episode",
  17807. // "movie"
  17808. // ],
  17809. // "enumDescriptions": [
  17810. // "Return all videos.",
  17811. // "Only retrieve episodes of shows.",
  17812. // "Only retrieve movies."
  17813. // ],
  17814. // "location": "query",
  17815. // "type": "string"
  17816. // }
  17817. // },
  17818. // "path": "search",
  17819. // "response": {
  17820. // "$ref": "SearchListResponse"
  17821. // },
  17822. // "scopes": [
  17823. // "https://www.googleapis.com/auth/youtube",
  17824. // "https://www.googleapis.com/auth/youtube.force-ssl",
  17825. // "https://www.googleapis.com/auth/youtube.readonly",
  17826. // "https://www.googleapis.com/auth/youtubepartner"
  17827. // ]
  17828. // }
  17829. }
  17830. // Pages invokes f for each page of results.
  17831. // A non-nil error returned from f will halt the iteration.
  17832. // The provided context supersedes any context provided to the Context method.
  17833. func (c *SearchListCall) Pages(ctx context.Context, f func(*SearchListResponse) error) error {
  17834. c.ctx_ = ctx
  17835. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17836. for {
  17837. x, err := c.Do()
  17838. if err != nil {
  17839. return err
  17840. }
  17841. if err := f(x); err != nil {
  17842. return err
  17843. }
  17844. if x.NextPageToken == "" {
  17845. return nil
  17846. }
  17847. c.PageToken(x.NextPageToken)
  17848. }
  17849. }
  17850. // method id "youtube.sponsors.list":
  17851. type SponsorsListCall struct {
  17852. s *Service
  17853. urlParams_ gensupport.URLParams
  17854. ifNoneMatch_ string
  17855. ctx_ context.Context
  17856. header_ http.Header
  17857. }
  17858. // List: Lists sponsors for a channel.
  17859. func (r *SponsorsService) List(part string) *SponsorsListCall {
  17860. c := &SponsorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17861. c.urlParams_.Set("part", part)
  17862. return c
  17863. }
  17864. // Filter sets the optional parameter "filter": The filter parameter
  17865. // specifies which channel sponsors to return.
  17866. //
  17867. // Possible values:
  17868. // "all" - Return all sponsors, from newest to oldest.
  17869. // "newest" - Return the most recent sponsors, from newest to oldest.
  17870. func (c *SponsorsListCall) Filter(filter string) *SponsorsListCall {
  17871. c.urlParams_.Set("filter", filter)
  17872. return c
  17873. }
  17874. // MaxResults sets the optional parameter "maxResults": The maxResults
  17875. // parameter specifies the maximum number of items that should be
  17876. // returned in the result set.
  17877. func (c *SponsorsListCall) MaxResults(maxResults int64) *SponsorsListCall {
  17878. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17879. return c
  17880. }
  17881. // PageToken sets the optional parameter "pageToken": The pageToken
  17882. // parameter identifies a specific page in the result set that should be
  17883. // returned. In an API response, the nextPageToken and prevPageToken
  17884. // properties identify other pages that could be retrieved.
  17885. func (c *SponsorsListCall) PageToken(pageToken string) *SponsorsListCall {
  17886. c.urlParams_.Set("pageToken", pageToken)
  17887. return c
  17888. }
  17889. // Fields allows partial responses to be retrieved. See
  17890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17891. // for more information.
  17892. func (c *SponsorsListCall) Fields(s ...googleapi.Field) *SponsorsListCall {
  17893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17894. return c
  17895. }
  17896. // IfNoneMatch sets the optional parameter which makes the operation
  17897. // fail if the object's ETag matches the given value. This is useful for
  17898. // getting updates only after the object has changed since the last
  17899. // request. Use googleapi.IsNotModified to check whether the response
  17900. // error from Do is the result of In-None-Match.
  17901. func (c *SponsorsListCall) IfNoneMatch(entityTag string) *SponsorsListCall {
  17902. c.ifNoneMatch_ = entityTag
  17903. return c
  17904. }
  17905. // Context sets the context to be used in this call's Do method. Any
  17906. // pending HTTP request will be aborted if the provided context is
  17907. // canceled.
  17908. func (c *SponsorsListCall) Context(ctx context.Context) *SponsorsListCall {
  17909. c.ctx_ = ctx
  17910. return c
  17911. }
  17912. // Header returns an http.Header that can be modified by the caller to
  17913. // add HTTP headers to the request.
  17914. func (c *SponsorsListCall) Header() http.Header {
  17915. if c.header_ == nil {
  17916. c.header_ = make(http.Header)
  17917. }
  17918. return c.header_
  17919. }
  17920. func (c *SponsorsListCall) doRequest(alt string) (*http.Response, error) {
  17921. reqHeaders := make(http.Header)
  17922. for k, v := range c.header_ {
  17923. reqHeaders[k] = v
  17924. }
  17925. reqHeaders.Set("User-Agent", c.s.userAgent())
  17926. if c.ifNoneMatch_ != "" {
  17927. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17928. }
  17929. var body io.Reader = nil
  17930. c.urlParams_.Set("alt", alt)
  17931. urls := googleapi.ResolveRelative(c.s.BasePath, "sponsors")
  17932. urls += "?" + c.urlParams_.Encode()
  17933. req, _ := http.NewRequest("GET", urls, body)
  17934. req.Header = reqHeaders
  17935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17936. }
  17937. // Do executes the "youtube.sponsors.list" call.
  17938. // Exactly one of *SponsorListResponse or error will be non-nil. Any
  17939. // non-2xx status code is an error. Response headers are in either
  17940. // *SponsorListResponse.ServerResponse.Header or (if a response was
  17941. // returned at all) in error.(*googleapi.Error).Header. Use
  17942. // googleapi.IsNotModified to check whether the returned error was
  17943. // because http.StatusNotModified was returned.
  17944. func (c *SponsorsListCall) Do(opts ...googleapi.CallOption) (*SponsorListResponse, error) {
  17945. gensupport.SetOptions(c.urlParams_, opts...)
  17946. res, err := c.doRequest("json")
  17947. if res != nil && res.StatusCode == http.StatusNotModified {
  17948. if res.Body != nil {
  17949. res.Body.Close()
  17950. }
  17951. return nil, &googleapi.Error{
  17952. Code: res.StatusCode,
  17953. Header: res.Header,
  17954. }
  17955. }
  17956. if err != nil {
  17957. return nil, err
  17958. }
  17959. defer googleapi.CloseBody(res)
  17960. if err := googleapi.CheckResponse(res); err != nil {
  17961. return nil, err
  17962. }
  17963. ret := &SponsorListResponse{
  17964. ServerResponse: googleapi.ServerResponse{
  17965. Header: res.Header,
  17966. HTTPStatusCode: res.StatusCode,
  17967. },
  17968. }
  17969. target := &ret
  17970. if err := gensupport.DecodeResponse(target, res); err != nil {
  17971. return nil, err
  17972. }
  17973. return ret, nil
  17974. // {
  17975. // "description": "Lists sponsors for a channel.",
  17976. // "httpMethod": "GET",
  17977. // "id": "youtube.sponsors.list",
  17978. // "parameterOrder": [
  17979. // "part"
  17980. // ],
  17981. // "parameters": {
  17982. // "filter": {
  17983. // "default": "POLL_NEWEST",
  17984. // "description": "The filter parameter specifies which channel sponsors to return.",
  17985. // "enum": [
  17986. // "all",
  17987. // "newest"
  17988. // ],
  17989. // "enumDescriptions": [
  17990. // "Return all sponsors, from newest to oldest.",
  17991. // "Return the most recent sponsors, from newest to oldest."
  17992. // ],
  17993. // "location": "query",
  17994. // "type": "string"
  17995. // },
  17996. // "maxResults": {
  17997. // "default": "5",
  17998. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  17999. // "format": "uint32",
  18000. // "location": "query",
  18001. // "maximum": "50",
  18002. // "minimum": "0",
  18003. // "type": "integer"
  18004. // },
  18005. // "pageToken": {
  18006. // "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.",
  18007. // "location": "query",
  18008. // "type": "string"
  18009. // },
  18010. // "part": {
  18011. // "description": "The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet.",
  18012. // "location": "query",
  18013. // "required": true,
  18014. // "type": "string"
  18015. // }
  18016. // },
  18017. // "path": "sponsors",
  18018. // "response": {
  18019. // "$ref": "SponsorListResponse"
  18020. // },
  18021. // "scopes": [
  18022. // "https://www.googleapis.com/auth/youtube",
  18023. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18024. // "https://www.googleapis.com/auth/youtube.readonly"
  18025. // ]
  18026. // }
  18027. }
  18028. // Pages invokes f for each page of results.
  18029. // A non-nil error returned from f will halt the iteration.
  18030. // The provided context supersedes any context provided to the Context method.
  18031. func (c *SponsorsListCall) Pages(ctx context.Context, f func(*SponsorListResponse) error) error {
  18032. c.ctx_ = ctx
  18033. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18034. for {
  18035. x, err := c.Do()
  18036. if err != nil {
  18037. return err
  18038. }
  18039. if err := f(x); err != nil {
  18040. return err
  18041. }
  18042. if x.NextPageToken == "" {
  18043. return nil
  18044. }
  18045. c.PageToken(x.NextPageToken)
  18046. }
  18047. }
  18048. // method id "youtube.subscriptions.delete":
  18049. type SubscriptionsDeleteCall struct {
  18050. s *Service
  18051. urlParams_ gensupport.URLParams
  18052. ctx_ context.Context
  18053. header_ http.Header
  18054. }
  18055. // Delete: Deletes a subscription.
  18056. func (r *SubscriptionsService) Delete(id string) *SubscriptionsDeleteCall {
  18057. c := &SubscriptionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18058. c.urlParams_.Set("id", id)
  18059. return c
  18060. }
  18061. // Fields allows partial responses to be retrieved. See
  18062. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18063. // for more information.
  18064. func (c *SubscriptionsDeleteCall) Fields(s ...googleapi.Field) *SubscriptionsDeleteCall {
  18065. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18066. return c
  18067. }
  18068. // Context sets the context to be used in this call's Do method. Any
  18069. // pending HTTP request will be aborted if the provided context is
  18070. // canceled.
  18071. func (c *SubscriptionsDeleteCall) Context(ctx context.Context) *SubscriptionsDeleteCall {
  18072. c.ctx_ = ctx
  18073. return c
  18074. }
  18075. // Header returns an http.Header that can be modified by the caller to
  18076. // add HTTP headers to the request.
  18077. func (c *SubscriptionsDeleteCall) Header() http.Header {
  18078. if c.header_ == nil {
  18079. c.header_ = make(http.Header)
  18080. }
  18081. return c.header_
  18082. }
  18083. func (c *SubscriptionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  18084. reqHeaders := make(http.Header)
  18085. for k, v := range c.header_ {
  18086. reqHeaders[k] = v
  18087. }
  18088. reqHeaders.Set("User-Agent", c.s.userAgent())
  18089. var body io.Reader = nil
  18090. c.urlParams_.Set("alt", alt)
  18091. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  18092. urls += "?" + c.urlParams_.Encode()
  18093. req, _ := http.NewRequest("DELETE", urls, body)
  18094. req.Header = reqHeaders
  18095. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18096. }
  18097. // Do executes the "youtube.subscriptions.delete" call.
  18098. func (c *SubscriptionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  18099. gensupport.SetOptions(c.urlParams_, opts...)
  18100. res, err := c.doRequest("json")
  18101. if err != nil {
  18102. return err
  18103. }
  18104. defer googleapi.CloseBody(res)
  18105. if err := googleapi.CheckResponse(res); err != nil {
  18106. return err
  18107. }
  18108. return nil
  18109. // {
  18110. // "description": "Deletes a subscription.",
  18111. // "httpMethod": "DELETE",
  18112. // "id": "youtube.subscriptions.delete",
  18113. // "parameterOrder": [
  18114. // "id"
  18115. // ],
  18116. // "parameters": {
  18117. // "id": {
  18118. // "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.",
  18119. // "location": "query",
  18120. // "required": true,
  18121. // "type": "string"
  18122. // }
  18123. // },
  18124. // "path": "subscriptions",
  18125. // "scopes": [
  18126. // "https://www.googleapis.com/auth/youtube",
  18127. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18128. // "https://www.googleapis.com/auth/youtubepartner"
  18129. // ]
  18130. // }
  18131. }
  18132. // method id "youtube.subscriptions.insert":
  18133. type SubscriptionsInsertCall struct {
  18134. s *Service
  18135. subscription *Subscription
  18136. urlParams_ gensupport.URLParams
  18137. ctx_ context.Context
  18138. header_ http.Header
  18139. }
  18140. // Insert: Adds a subscription for the authenticated user's channel.
  18141. func (r *SubscriptionsService) Insert(part string, subscription *Subscription) *SubscriptionsInsertCall {
  18142. c := &SubscriptionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18143. c.urlParams_.Set("part", part)
  18144. c.subscription = subscription
  18145. return c
  18146. }
  18147. // Fields allows partial responses to be retrieved. See
  18148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18149. // for more information.
  18150. func (c *SubscriptionsInsertCall) Fields(s ...googleapi.Field) *SubscriptionsInsertCall {
  18151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18152. return c
  18153. }
  18154. // Context sets the context to be used in this call's Do method. Any
  18155. // pending HTTP request will be aborted if the provided context is
  18156. // canceled.
  18157. func (c *SubscriptionsInsertCall) Context(ctx context.Context) *SubscriptionsInsertCall {
  18158. c.ctx_ = ctx
  18159. return c
  18160. }
  18161. // Header returns an http.Header that can be modified by the caller to
  18162. // add HTTP headers to the request.
  18163. func (c *SubscriptionsInsertCall) Header() http.Header {
  18164. if c.header_ == nil {
  18165. c.header_ = make(http.Header)
  18166. }
  18167. return c.header_
  18168. }
  18169. func (c *SubscriptionsInsertCall) doRequest(alt string) (*http.Response, error) {
  18170. reqHeaders := make(http.Header)
  18171. for k, v := range c.header_ {
  18172. reqHeaders[k] = v
  18173. }
  18174. reqHeaders.Set("User-Agent", c.s.userAgent())
  18175. var body io.Reader = nil
  18176. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subscription)
  18177. if err != nil {
  18178. return nil, err
  18179. }
  18180. reqHeaders.Set("Content-Type", "application/json")
  18181. c.urlParams_.Set("alt", alt)
  18182. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  18183. urls += "?" + c.urlParams_.Encode()
  18184. req, _ := http.NewRequest("POST", urls, body)
  18185. req.Header = reqHeaders
  18186. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18187. }
  18188. // Do executes the "youtube.subscriptions.insert" call.
  18189. // Exactly one of *Subscription or error will be non-nil. Any non-2xx
  18190. // status code is an error. Response headers are in either
  18191. // *Subscription.ServerResponse.Header or (if a response was returned at
  18192. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18193. // to check whether the returned error was because
  18194. // http.StatusNotModified was returned.
  18195. func (c *SubscriptionsInsertCall) Do(opts ...googleapi.CallOption) (*Subscription, error) {
  18196. gensupport.SetOptions(c.urlParams_, opts...)
  18197. res, err := c.doRequest("json")
  18198. if res != nil && res.StatusCode == http.StatusNotModified {
  18199. if res.Body != nil {
  18200. res.Body.Close()
  18201. }
  18202. return nil, &googleapi.Error{
  18203. Code: res.StatusCode,
  18204. Header: res.Header,
  18205. }
  18206. }
  18207. if err != nil {
  18208. return nil, err
  18209. }
  18210. defer googleapi.CloseBody(res)
  18211. if err := googleapi.CheckResponse(res); err != nil {
  18212. return nil, err
  18213. }
  18214. ret := &Subscription{
  18215. ServerResponse: googleapi.ServerResponse{
  18216. Header: res.Header,
  18217. HTTPStatusCode: res.StatusCode,
  18218. },
  18219. }
  18220. target := &ret
  18221. if err := gensupport.DecodeResponse(target, res); err != nil {
  18222. return nil, err
  18223. }
  18224. return ret, nil
  18225. // {
  18226. // "description": "Adds a subscription for the authenticated user's channel.",
  18227. // "httpMethod": "POST",
  18228. // "id": "youtube.subscriptions.insert",
  18229. // "parameterOrder": [
  18230. // "part"
  18231. // ],
  18232. // "parameters": {
  18233. // "part": {
  18234. // "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.",
  18235. // "location": "query",
  18236. // "required": true,
  18237. // "type": "string"
  18238. // }
  18239. // },
  18240. // "path": "subscriptions",
  18241. // "request": {
  18242. // "$ref": "Subscription"
  18243. // },
  18244. // "response": {
  18245. // "$ref": "Subscription"
  18246. // },
  18247. // "scopes": [
  18248. // "https://www.googleapis.com/auth/youtube",
  18249. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18250. // "https://www.googleapis.com/auth/youtubepartner"
  18251. // ]
  18252. // }
  18253. }
  18254. // method id "youtube.subscriptions.list":
  18255. type SubscriptionsListCall struct {
  18256. s *Service
  18257. urlParams_ gensupport.URLParams
  18258. ifNoneMatch_ string
  18259. ctx_ context.Context
  18260. header_ http.Header
  18261. }
  18262. // List: Returns subscription resources that match the API request
  18263. // criteria.
  18264. func (r *SubscriptionsService) List(part string) *SubscriptionsListCall {
  18265. c := &SubscriptionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18266. c.urlParams_.Set("part", part)
  18267. return c
  18268. }
  18269. // ChannelId sets the optional parameter "channelId": The channelId
  18270. // parameter specifies a YouTube channel ID. The API will only return
  18271. // that channel's subscriptions.
  18272. func (c *SubscriptionsListCall) ChannelId(channelId string) *SubscriptionsListCall {
  18273. c.urlParams_.Set("channelId", channelId)
  18274. return c
  18275. }
  18276. // ForChannelId sets the optional parameter "forChannelId": The
  18277. // forChannelId parameter specifies a comma-separated list of channel
  18278. // IDs. The API response will then only contain subscriptions matching
  18279. // those channels.
  18280. func (c *SubscriptionsListCall) ForChannelId(forChannelId string) *SubscriptionsListCall {
  18281. c.urlParams_.Set("forChannelId", forChannelId)
  18282. return c
  18283. }
  18284. // Id sets the optional parameter "id": The id parameter specifies a
  18285. // comma-separated list of the YouTube subscription ID(s) for the
  18286. // resource(s) that are being retrieved. In a subscription resource, the
  18287. // id property specifies the YouTube subscription ID.
  18288. func (c *SubscriptionsListCall) Id(id string) *SubscriptionsListCall {
  18289. c.urlParams_.Set("id", id)
  18290. return c
  18291. }
  18292. // MaxResults sets the optional parameter "maxResults": The maxResults
  18293. // parameter specifies the maximum number of items that should be
  18294. // returned in the result set.
  18295. func (c *SubscriptionsListCall) MaxResults(maxResults int64) *SubscriptionsListCall {
  18296. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18297. return c
  18298. }
  18299. // Mine sets the optional parameter "mine": Set this parameter's value
  18300. // to true to retrieve a feed of the authenticated user's subscriptions.
  18301. func (c *SubscriptionsListCall) Mine(mine bool) *SubscriptionsListCall {
  18302. c.urlParams_.Set("mine", fmt.Sprint(mine))
  18303. return c
  18304. }
  18305. // MyRecentSubscribers sets the optional parameter
  18306. // "myRecentSubscribers": Set this parameter's value to true to retrieve
  18307. // a feed of the subscribers of the authenticated user in reverse
  18308. // chronological order (newest first).
  18309. func (c *SubscriptionsListCall) MyRecentSubscribers(myRecentSubscribers bool) *SubscriptionsListCall {
  18310. c.urlParams_.Set("myRecentSubscribers", fmt.Sprint(myRecentSubscribers))
  18311. return c
  18312. }
  18313. // MySubscribers sets the optional parameter "mySubscribers": Set this
  18314. // parameter's value to true to retrieve a feed of the subscribers of
  18315. // the authenticated user in no particular order.
  18316. func (c *SubscriptionsListCall) MySubscribers(mySubscribers bool) *SubscriptionsListCall {
  18317. c.urlParams_.Set("mySubscribers", fmt.Sprint(mySubscribers))
  18318. return c
  18319. }
  18320. // OnBehalfOfContentOwner sets the optional parameter
  18321. // "onBehalfOfContentOwner": Note: This parameter is intended
  18322. // exclusively for YouTube content partners.
  18323. //
  18324. // The onBehalfOfContentOwner parameter indicates that the request's
  18325. // authorization credentials identify a YouTube CMS user who is acting
  18326. // on behalf of the content owner specified in the parameter value. This
  18327. // parameter is intended for YouTube content partners that own and
  18328. // manage many different YouTube channels. It allows content owners to
  18329. // authenticate once and get access to all their video and channel data,
  18330. // without having to provide authentication credentials for each
  18331. // individual channel. The CMS account that the user authenticates with
  18332. // must be linked to the specified YouTube content owner.
  18333. func (c *SubscriptionsListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *SubscriptionsListCall {
  18334. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18335. return c
  18336. }
  18337. // OnBehalfOfContentOwnerChannel sets the optional parameter
  18338. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  18339. // properly authorized request. Note: This parameter is intended
  18340. // exclusively for YouTube content partners.
  18341. //
  18342. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  18343. // channel ID of the channel to which a video is being added. This
  18344. // parameter is required when a request specifies a value for the
  18345. // onBehalfOfContentOwner parameter, and it can only be used in
  18346. // conjunction with that parameter. In addition, the request must be
  18347. // authorized using a CMS account that is linked to the content owner
  18348. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  18349. // channel that the onBehalfOfContentOwnerChannel parameter value
  18350. // specifies must be linked to the content owner that the
  18351. // onBehalfOfContentOwner parameter specifies.
  18352. //
  18353. // This parameter is intended for YouTube content partners that own and
  18354. // manage many different YouTube channels. It allows content owners to
  18355. // authenticate once and perform actions on behalf of the channel
  18356. // specified in the parameter value, without having to provide
  18357. // authentication credentials for each separate channel.
  18358. func (c *SubscriptionsListCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *SubscriptionsListCall {
  18359. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  18360. return c
  18361. }
  18362. // Order sets the optional parameter "order": The order parameter
  18363. // specifies the method that will be used to sort resources in the API
  18364. // response.
  18365. //
  18366. // Possible values:
  18367. // "alphabetical" - Sort alphabetically.
  18368. // "relevance" - Sort by relevance.
  18369. // "unread" - Sort by order of activity.
  18370. func (c *SubscriptionsListCall) Order(order string) *SubscriptionsListCall {
  18371. c.urlParams_.Set("order", order)
  18372. return c
  18373. }
  18374. // PageToken sets the optional parameter "pageToken": The pageToken
  18375. // parameter identifies a specific page in the result set that should be
  18376. // returned. In an API response, the nextPageToken and prevPageToken
  18377. // properties identify other pages that could be retrieved.
  18378. func (c *SubscriptionsListCall) PageToken(pageToken string) *SubscriptionsListCall {
  18379. c.urlParams_.Set("pageToken", pageToken)
  18380. return c
  18381. }
  18382. // Fields allows partial responses to be retrieved. See
  18383. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18384. // for more information.
  18385. func (c *SubscriptionsListCall) Fields(s ...googleapi.Field) *SubscriptionsListCall {
  18386. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18387. return c
  18388. }
  18389. // IfNoneMatch sets the optional parameter which makes the operation
  18390. // fail if the object's ETag matches the given value. This is useful for
  18391. // getting updates only after the object has changed since the last
  18392. // request. Use googleapi.IsNotModified to check whether the response
  18393. // error from Do is the result of In-None-Match.
  18394. func (c *SubscriptionsListCall) IfNoneMatch(entityTag string) *SubscriptionsListCall {
  18395. c.ifNoneMatch_ = entityTag
  18396. return c
  18397. }
  18398. // Context sets the context to be used in this call's Do method. Any
  18399. // pending HTTP request will be aborted if the provided context is
  18400. // canceled.
  18401. func (c *SubscriptionsListCall) Context(ctx context.Context) *SubscriptionsListCall {
  18402. c.ctx_ = ctx
  18403. return c
  18404. }
  18405. // Header returns an http.Header that can be modified by the caller to
  18406. // add HTTP headers to the request.
  18407. func (c *SubscriptionsListCall) Header() http.Header {
  18408. if c.header_ == nil {
  18409. c.header_ = make(http.Header)
  18410. }
  18411. return c.header_
  18412. }
  18413. func (c *SubscriptionsListCall) doRequest(alt string) (*http.Response, error) {
  18414. reqHeaders := make(http.Header)
  18415. for k, v := range c.header_ {
  18416. reqHeaders[k] = v
  18417. }
  18418. reqHeaders.Set("User-Agent", c.s.userAgent())
  18419. if c.ifNoneMatch_ != "" {
  18420. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18421. }
  18422. var body io.Reader = nil
  18423. c.urlParams_.Set("alt", alt)
  18424. urls := googleapi.ResolveRelative(c.s.BasePath, "subscriptions")
  18425. urls += "?" + c.urlParams_.Encode()
  18426. req, _ := http.NewRequest("GET", urls, body)
  18427. req.Header = reqHeaders
  18428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18429. }
  18430. // Do executes the "youtube.subscriptions.list" call.
  18431. // Exactly one of *SubscriptionListResponse or error will be non-nil.
  18432. // Any non-2xx status code is an error. Response headers are in either
  18433. // *SubscriptionListResponse.ServerResponse.Header or (if a response was
  18434. // returned at all) in error.(*googleapi.Error).Header. Use
  18435. // googleapi.IsNotModified to check whether the returned error was
  18436. // because http.StatusNotModified was returned.
  18437. func (c *SubscriptionsListCall) Do(opts ...googleapi.CallOption) (*SubscriptionListResponse, error) {
  18438. gensupport.SetOptions(c.urlParams_, opts...)
  18439. res, err := c.doRequest("json")
  18440. if res != nil && res.StatusCode == http.StatusNotModified {
  18441. if res.Body != nil {
  18442. res.Body.Close()
  18443. }
  18444. return nil, &googleapi.Error{
  18445. Code: res.StatusCode,
  18446. Header: res.Header,
  18447. }
  18448. }
  18449. if err != nil {
  18450. return nil, err
  18451. }
  18452. defer googleapi.CloseBody(res)
  18453. if err := googleapi.CheckResponse(res); err != nil {
  18454. return nil, err
  18455. }
  18456. ret := &SubscriptionListResponse{
  18457. ServerResponse: googleapi.ServerResponse{
  18458. Header: res.Header,
  18459. HTTPStatusCode: res.StatusCode,
  18460. },
  18461. }
  18462. target := &ret
  18463. if err := gensupport.DecodeResponse(target, res); err != nil {
  18464. return nil, err
  18465. }
  18466. return ret, nil
  18467. // {
  18468. // "description": "Returns subscription resources that match the API request criteria.",
  18469. // "httpMethod": "GET",
  18470. // "id": "youtube.subscriptions.list",
  18471. // "parameterOrder": [
  18472. // "part"
  18473. // ],
  18474. // "parameters": {
  18475. // "channelId": {
  18476. // "description": "The channelId parameter specifies a YouTube channel ID. The API will only return that channel's subscriptions.",
  18477. // "location": "query",
  18478. // "type": "string"
  18479. // },
  18480. // "forChannelId": {
  18481. // "description": "The forChannelId parameter specifies a comma-separated list of channel IDs. The API response will then only contain subscriptions matching those channels.",
  18482. // "location": "query",
  18483. // "type": "string"
  18484. // },
  18485. // "id": {
  18486. // "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.",
  18487. // "location": "query",
  18488. // "type": "string"
  18489. // },
  18490. // "maxResults": {
  18491. // "default": "5",
  18492. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  18493. // "format": "uint32",
  18494. // "location": "query",
  18495. // "maximum": "50",
  18496. // "minimum": "0",
  18497. // "type": "integer"
  18498. // },
  18499. // "mine": {
  18500. // "description": "Set this parameter's value to true to retrieve a feed of the authenticated user's subscriptions.",
  18501. // "location": "query",
  18502. // "type": "boolean"
  18503. // },
  18504. // "myRecentSubscribers": {
  18505. // "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).",
  18506. // "location": "query",
  18507. // "type": "boolean"
  18508. // },
  18509. // "mySubscribers": {
  18510. // "description": "Set this parameter's value to true to retrieve a feed of the subscribers of the authenticated user in no particular order.",
  18511. // "location": "query",
  18512. // "type": "boolean"
  18513. // },
  18514. // "onBehalfOfContentOwner": {
  18515. // "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.",
  18516. // "location": "query",
  18517. // "type": "string"
  18518. // },
  18519. // "onBehalfOfContentOwnerChannel": {
  18520. // "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.",
  18521. // "location": "query",
  18522. // "type": "string"
  18523. // },
  18524. // "order": {
  18525. // "default": "SUBSCRIPTION_ORDER_RELEVANCE",
  18526. // "description": "The order parameter specifies the method that will be used to sort resources in the API response.",
  18527. // "enum": [
  18528. // "alphabetical",
  18529. // "relevance",
  18530. // "unread"
  18531. // ],
  18532. // "enumDescriptions": [
  18533. // "Sort alphabetically.",
  18534. // "Sort by relevance.",
  18535. // "Sort by order of activity."
  18536. // ],
  18537. // "location": "query",
  18538. // "type": "string"
  18539. // },
  18540. // "pageToken": {
  18541. // "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.",
  18542. // "location": "query",
  18543. // "type": "string"
  18544. // },
  18545. // "part": {
  18546. // "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.",
  18547. // "location": "query",
  18548. // "required": true,
  18549. // "type": "string"
  18550. // }
  18551. // },
  18552. // "path": "subscriptions",
  18553. // "response": {
  18554. // "$ref": "SubscriptionListResponse"
  18555. // },
  18556. // "scopes": [
  18557. // "https://www.googleapis.com/auth/youtube",
  18558. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18559. // "https://www.googleapis.com/auth/youtube.readonly",
  18560. // "https://www.googleapis.com/auth/youtubepartner"
  18561. // ]
  18562. // }
  18563. }
  18564. // Pages invokes f for each page of results.
  18565. // A non-nil error returned from f will halt the iteration.
  18566. // The provided context supersedes any context provided to the Context method.
  18567. func (c *SubscriptionsListCall) Pages(ctx context.Context, f func(*SubscriptionListResponse) error) error {
  18568. c.ctx_ = ctx
  18569. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18570. for {
  18571. x, err := c.Do()
  18572. if err != nil {
  18573. return err
  18574. }
  18575. if err := f(x); err != nil {
  18576. return err
  18577. }
  18578. if x.NextPageToken == "" {
  18579. return nil
  18580. }
  18581. c.PageToken(x.NextPageToken)
  18582. }
  18583. }
  18584. // method id "youtube.superChatEvents.list":
  18585. type SuperChatEventsListCall struct {
  18586. s *Service
  18587. urlParams_ gensupport.URLParams
  18588. ifNoneMatch_ string
  18589. ctx_ context.Context
  18590. header_ http.Header
  18591. }
  18592. // List: Lists Super Chat events for a channel.
  18593. func (r *SuperChatEventsService) List(part string) *SuperChatEventsListCall {
  18594. c := &SuperChatEventsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18595. c.urlParams_.Set("part", part)
  18596. return c
  18597. }
  18598. // Hl sets the optional parameter "hl": The hl parameter instructs the
  18599. // API to retrieve localized resource metadata for a specific
  18600. // application language that the YouTube website supports. The parameter
  18601. // value must be a language code included in the list returned by the
  18602. // i18nLanguages.list method.
  18603. //
  18604. // If localized resource details are available in that language, the
  18605. // resource's snippet.localized object will contain the localized
  18606. // values. However, if localized details are not available, the
  18607. // snippet.localized object will contain resource details in the
  18608. // resource's default language.
  18609. func (c *SuperChatEventsListCall) Hl(hl string) *SuperChatEventsListCall {
  18610. c.urlParams_.Set("hl", hl)
  18611. return c
  18612. }
  18613. // MaxResults sets the optional parameter "maxResults": The maxResults
  18614. // parameter specifies the maximum number of items that should be
  18615. // returned in the result set.
  18616. func (c *SuperChatEventsListCall) MaxResults(maxResults int64) *SuperChatEventsListCall {
  18617. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18618. return c
  18619. }
  18620. // PageToken sets the optional parameter "pageToken": The pageToken
  18621. // parameter identifies a specific page in the result set that should be
  18622. // returned. In an API response, the nextPageToken and prevPageToken
  18623. // properties identify other pages that could be retrieved.
  18624. func (c *SuperChatEventsListCall) PageToken(pageToken string) *SuperChatEventsListCall {
  18625. c.urlParams_.Set("pageToken", pageToken)
  18626. return c
  18627. }
  18628. // Fields allows partial responses to be retrieved. See
  18629. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18630. // for more information.
  18631. func (c *SuperChatEventsListCall) Fields(s ...googleapi.Field) *SuperChatEventsListCall {
  18632. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18633. return c
  18634. }
  18635. // IfNoneMatch sets the optional parameter which makes the operation
  18636. // fail if the object's ETag matches the given value. This is useful for
  18637. // getting updates only after the object has changed since the last
  18638. // request. Use googleapi.IsNotModified to check whether the response
  18639. // error from Do is the result of In-None-Match.
  18640. func (c *SuperChatEventsListCall) IfNoneMatch(entityTag string) *SuperChatEventsListCall {
  18641. c.ifNoneMatch_ = entityTag
  18642. return c
  18643. }
  18644. // Context sets the context to be used in this call's Do method. Any
  18645. // pending HTTP request will be aborted if the provided context is
  18646. // canceled.
  18647. func (c *SuperChatEventsListCall) Context(ctx context.Context) *SuperChatEventsListCall {
  18648. c.ctx_ = ctx
  18649. return c
  18650. }
  18651. // Header returns an http.Header that can be modified by the caller to
  18652. // add HTTP headers to the request.
  18653. func (c *SuperChatEventsListCall) Header() http.Header {
  18654. if c.header_ == nil {
  18655. c.header_ = make(http.Header)
  18656. }
  18657. return c.header_
  18658. }
  18659. func (c *SuperChatEventsListCall) doRequest(alt string) (*http.Response, error) {
  18660. reqHeaders := make(http.Header)
  18661. for k, v := range c.header_ {
  18662. reqHeaders[k] = v
  18663. }
  18664. reqHeaders.Set("User-Agent", c.s.userAgent())
  18665. if c.ifNoneMatch_ != "" {
  18666. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18667. }
  18668. var body io.Reader = nil
  18669. c.urlParams_.Set("alt", alt)
  18670. urls := googleapi.ResolveRelative(c.s.BasePath, "superChatEvents")
  18671. urls += "?" + c.urlParams_.Encode()
  18672. req, _ := http.NewRequest("GET", urls, body)
  18673. req.Header = reqHeaders
  18674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18675. }
  18676. // Do executes the "youtube.superChatEvents.list" call.
  18677. // Exactly one of *SuperChatEventListResponse or error will be non-nil.
  18678. // Any non-2xx status code is an error. Response headers are in either
  18679. // *SuperChatEventListResponse.ServerResponse.Header or (if a response
  18680. // was returned at all) in error.(*googleapi.Error).Header. Use
  18681. // googleapi.IsNotModified to check whether the returned error was
  18682. // because http.StatusNotModified was returned.
  18683. func (c *SuperChatEventsListCall) Do(opts ...googleapi.CallOption) (*SuperChatEventListResponse, error) {
  18684. gensupport.SetOptions(c.urlParams_, opts...)
  18685. res, err := c.doRequest("json")
  18686. if res != nil && res.StatusCode == http.StatusNotModified {
  18687. if res.Body != nil {
  18688. res.Body.Close()
  18689. }
  18690. return nil, &googleapi.Error{
  18691. Code: res.StatusCode,
  18692. Header: res.Header,
  18693. }
  18694. }
  18695. if err != nil {
  18696. return nil, err
  18697. }
  18698. defer googleapi.CloseBody(res)
  18699. if err := googleapi.CheckResponse(res); err != nil {
  18700. return nil, err
  18701. }
  18702. ret := &SuperChatEventListResponse{
  18703. ServerResponse: googleapi.ServerResponse{
  18704. Header: res.Header,
  18705. HTTPStatusCode: res.StatusCode,
  18706. },
  18707. }
  18708. target := &ret
  18709. if err := gensupport.DecodeResponse(target, res); err != nil {
  18710. return nil, err
  18711. }
  18712. return ret, nil
  18713. // {
  18714. // "description": "Lists Super Chat events for a channel.",
  18715. // "httpMethod": "GET",
  18716. // "id": "youtube.superChatEvents.list",
  18717. // "parameterOrder": [
  18718. // "part"
  18719. // ],
  18720. // "parameters": {
  18721. // "hl": {
  18722. // "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.",
  18723. // "location": "query",
  18724. // "type": "string"
  18725. // },
  18726. // "maxResults": {
  18727. // "default": "5",
  18728. // "description": "The maxResults parameter specifies the maximum number of items that should be returned in the result set.",
  18729. // "format": "uint32",
  18730. // "location": "query",
  18731. // "maximum": "50",
  18732. // "minimum": "1",
  18733. // "type": "integer"
  18734. // },
  18735. // "pageToken": {
  18736. // "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.",
  18737. // "location": "query",
  18738. // "type": "string"
  18739. // },
  18740. // "part": {
  18741. // "description": "The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet.",
  18742. // "location": "query",
  18743. // "required": true,
  18744. // "type": "string"
  18745. // }
  18746. // },
  18747. // "path": "superChatEvents",
  18748. // "response": {
  18749. // "$ref": "SuperChatEventListResponse"
  18750. // },
  18751. // "scopes": [
  18752. // "https://www.googleapis.com/auth/youtube",
  18753. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18754. // "https://www.googleapis.com/auth/youtube.readonly"
  18755. // ]
  18756. // }
  18757. }
  18758. // Pages invokes f for each page of results.
  18759. // A non-nil error returned from f will halt the iteration.
  18760. // The provided context supersedes any context provided to the Context method.
  18761. func (c *SuperChatEventsListCall) Pages(ctx context.Context, f func(*SuperChatEventListResponse) error) error {
  18762. c.ctx_ = ctx
  18763. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18764. for {
  18765. x, err := c.Do()
  18766. if err != nil {
  18767. return err
  18768. }
  18769. if err := f(x); err != nil {
  18770. return err
  18771. }
  18772. if x.NextPageToken == "" {
  18773. return nil
  18774. }
  18775. c.PageToken(x.NextPageToken)
  18776. }
  18777. }
  18778. // method id "youtube.thumbnails.set":
  18779. type ThumbnailsSetCall struct {
  18780. s *Service
  18781. urlParams_ gensupport.URLParams
  18782. mediaInfo_ *gensupport.MediaInfo
  18783. ctx_ context.Context
  18784. header_ http.Header
  18785. }
  18786. // Set: Uploads a custom video thumbnail to YouTube and sets it for a
  18787. // video.
  18788. func (r *ThumbnailsService) Set(videoId string) *ThumbnailsSetCall {
  18789. c := &ThumbnailsSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18790. c.urlParams_.Set("videoId", videoId)
  18791. return c
  18792. }
  18793. // OnBehalfOfContentOwner sets the optional parameter
  18794. // "onBehalfOfContentOwner": Note: This parameter is intended
  18795. // exclusively for YouTube content partners.
  18796. //
  18797. // The onBehalfOfContentOwner parameter indicates that the request's
  18798. // authorization credentials identify a YouTube CMS user who is acting
  18799. // on behalf of the content owner specified in the parameter value. This
  18800. // parameter is intended for YouTube content partners that own and
  18801. // manage many different YouTube channels. It allows content owners to
  18802. // authenticate once and get access to all their video and channel data,
  18803. // without having to provide authentication credentials for each
  18804. // individual channel. The actual CMS account that the user
  18805. // authenticates with must be linked to the specified YouTube content
  18806. // owner.
  18807. func (c *ThumbnailsSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *ThumbnailsSetCall {
  18808. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  18809. return c
  18810. }
  18811. // Media specifies the media to upload in one or more chunks. The chunk
  18812. // size may be controlled by supplying a MediaOption generated by
  18813. // googleapi.ChunkSize. The chunk size defaults to
  18814. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  18815. // upload request will be determined by sniffing the contents of r,
  18816. // unless a MediaOption generated by googleapi.ContentType is
  18817. // supplied.
  18818. // At most one of Media and ResumableMedia may be set.
  18819. func (c *ThumbnailsSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *ThumbnailsSetCall {
  18820. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  18821. return c
  18822. }
  18823. // ResumableMedia specifies the media to upload in chunks and can be
  18824. // canceled with ctx.
  18825. //
  18826. // Deprecated: use Media instead.
  18827. //
  18828. // At most one of Media and ResumableMedia may be set. mediaType
  18829. // identifies the MIME media type of the upload, such as "image/png". If
  18830. // mediaType is "", it will be auto-detected. The provided ctx will
  18831. // supersede any context previously provided to the Context method.
  18832. func (c *ThumbnailsSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ThumbnailsSetCall {
  18833. c.ctx_ = ctx
  18834. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  18835. return c
  18836. }
  18837. // ProgressUpdater provides a callback function that will be called
  18838. // after every chunk. It should be a low-latency function in order to
  18839. // not slow down the upload operation. This should only be called when
  18840. // using ResumableMedia (as opposed to Media).
  18841. func (c *ThumbnailsSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ThumbnailsSetCall {
  18842. c.mediaInfo_.SetProgressUpdater(pu)
  18843. return c
  18844. }
  18845. // Fields allows partial responses to be retrieved. See
  18846. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18847. // for more information.
  18848. func (c *ThumbnailsSetCall) Fields(s ...googleapi.Field) *ThumbnailsSetCall {
  18849. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18850. return c
  18851. }
  18852. // Context sets the context to be used in this call's Do method. Any
  18853. // pending HTTP request will be aborted if the provided context is
  18854. // canceled.
  18855. // This context will supersede any context previously provided to the
  18856. // ResumableMedia method.
  18857. func (c *ThumbnailsSetCall) Context(ctx context.Context) *ThumbnailsSetCall {
  18858. c.ctx_ = ctx
  18859. return c
  18860. }
  18861. // Header returns an http.Header that can be modified by the caller to
  18862. // add HTTP headers to the request.
  18863. func (c *ThumbnailsSetCall) Header() http.Header {
  18864. if c.header_ == nil {
  18865. c.header_ = make(http.Header)
  18866. }
  18867. return c.header_
  18868. }
  18869. func (c *ThumbnailsSetCall) doRequest(alt string) (*http.Response, error) {
  18870. reqHeaders := make(http.Header)
  18871. for k, v := range c.header_ {
  18872. reqHeaders[k] = v
  18873. }
  18874. reqHeaders.Set("User-Agent", c.s.userAgent())
  18875. var body io.Reader = nil
  18876. c.urlParams_.Set("alt", alt)
  18877. urls := googleapi.ResolveRelative(c.s.BasePath, "thumbnails/set")
  18878. if c.mediaInfo_ != nil {
  18879. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  18880. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  18881. }
  18882. if body == nil {
  18883. body = new(bytes.Buffer)
  18884. reqHeaders.Set("Content-Type", "application/json")
  18885. }
  18886. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  18887. defer cleanup()
  18888. urls += "?" + c.urlParams_.Encode()
  18889. req, _ := http.NewRequest("POST", urls, body)
  18890. req.Header = reqHeaders
  18891. gensupport.SetGetBody(req, getBody)
  18892. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18893. }
  18894. // Do executes the "youtube.thumbnails.set" call.
  18895. // Exactly one of *ThumbnailSetResponse or error will be non-nil. Any
  18896. // non-2xx status code is an error. Response headers are in either
  18897. // *ThumbnailSetResponse.ServerResponse.Header or (if a response was
  18898. // returned at all) in error.(*googleapi.Error).Header. Use
  18899. // googleapi.IsNotModified to check whether the returned error was
  18900. // because http.StatusNotModified was returned.
  18901. func (c *ThumbnailsSetCall) Do(opts ...googleapi.CallOption) (*ThumbnailSetResponse, error) {
  18902. gensupport.SetOptions(c.urlParams_, opts...)
  18903. res, err := c.doRequest("json")
  18904. if res != nil && res.StatusCode == http.StatusNotModified {
  18905. if res.Body != nil {
  18906. res.Body.Close()
  18907. }
  18908. return nil, &googleapi.Error{
  18909. Code: res.StatusCode,
  18910. Header: res.Header,
  18911. }
  18912. }
  18913. if err != nil {
  18914. return nil, err
  18915. }
  18916. defer googleapi.CloseBody(res)
  18917. if err := googleapi.CheckResponse(res); err != nil {
  18918. return nil, err
  18919. }
  18920. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  18921. if rx != nil {
  18922. rx.Client = c.s.client
  18923. rx.UserAgent = c.s.userAgent()
  18924. ctx := c.ctx_
  18925. if ctx == nil {
  18926. ctx = context.TODO()
  18927. }
  18928. res, err = rx.Upload(ctx)
  18929. if err != nil {
  18930. return nil, err
  18931. }
  18932. defer res.Body.Close()
  18933. if err := googleapi.CheckResponse(res); err != nil {
  18934. return nil, err
  18935. }
  18936. }
  18937. ret := &ThumbnailSetResponse{
  18938. ServerResponse: googleapi.ServerResponse{
  18939. Header: res.Header,
  18940. HTTPStatusCode: res.StatusCode,
  18941. },
  18942. }
  18943. target := &ret
  18944. if err := gensupport.DecodeResponse(target, res); err != nil {
  18945. return nil, err
  18946. }
  18947. return ret, nil
  18948. // {
  18949. // "description": "Uploads a custom video thumbnail to YouTube and sets it for a video.",
  18950. // "httpMethod": "POST",
  18951. // "id": "youtube.thumbnails.set",
  18952. // "mediaUpload": {
  18953. // "accept": [
  18954. // "application/octet-stream",
  18955. // "image/jpeg",
  18956. // "image/png"
  18957. // ],
  18958. // "maxSize": "2MB",
  18959. // "protocols": {
  18960. // "resumable": {
  18961. // "multipart": true,
  18962. // "path": "/resumable/upload/youtube/v3/thumbnails/set"
  18963. // },
  18964. // "simple": {
  18965. // "multipart": true,
  18966. // "path": "/upload/youtube/v3/thumbnails/set"
  18967. // }
  18968. // }
  18969. // },
  18970. // "parameterOrder": [
  18971. // "videoId"
  18972. // ],
  18973. // "parameters": {
  18974. // "onBehalfOfContentOwner": {
  18975. // "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.",
  18976. // "location": "query",
  18977. // "type": "string"
  18978. // },
  18979. // "videoId": {
  18980. // "description": "The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.",
  18981. // "location": "query",
  18982. // "required": true,
  18983. // "type": "string"
  18984. // }
  18985. // },
  18986. // "path": "thumbnails/set",
  18987. // "response": {
  18988. // "$ref": "ThumbnailSetResponse"
  18989. // },
  18990. // "scopes": [
  18991. // "https://www.googleapis.com/auth/youtube",
  18992. // "https://www.googleapis.com/auth/youtube.force-ssl",
  18993. // "https://www.googleapis.com/auth/youtube.upload",
  18994. // "https://www.googleapis.com/auth/youtubepartner"
  18995. // ],
  18996. // "supportsMediaUpload": true
  18997. // }
  18998. }
  18999. // method id "youtube.videoAbuseReportReasons.list":
  19000. type VideoAbuseReportReasonsListCall struct {
  19001. s *Service
  19002. urlParams_ gensupport.URLParams
  19003. ifNoneMatch_ string
  19004. ctx_ context.Context
  19005. header_ http.Header
  19006. }
  19007. // List: Returns a list of abuse reasons that can be used for reporting
  19008. // abusive videos.
  19009. func (r *VideoAbuseReportReasonsService) List(part string) *VideoAbuseReportReasonsListCall {
  19010. c := &VideoAbuseReportReasonsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19011. c.urlParams_.Set("part", part)
  19012. return c
  19013. }
  19014. // Hl sets the optional parameter "hl": The hl parameter specifies the
  19015. // language that should be used for text values in the API response.
  19016. func (c *VideoAbuseReportReasonsListCall) Hl(hl string) *VideoAbuseReportReasonsListCall {
  19017. c.urlParams_.Set("hl", hl)
  19018. return c
  19019. }
  19020. // Fields allows partial responses to be retrieved. See
  19021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19022. // for more information.
  19023. func (c *VideoAbuseReportReasonsListCall) Fields(s ...googleapi.Field) *VideoAbuseReportReasonsListCall {
  19024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19025. return c
  19026. }
  19027. // IfNoneMatch sets the optional parameter which makes the operation
  19028. // fail if the object's ETag matches the given value. This is useful for
  19029. // getting updates only after the object has changed since the last
  19030. // request. Use googleapi.IsNotModified to check whether the response
  19031. // error from Do is the result of In-None-Match.
  19032. func (c *VideoAbuseReportReasonsListCall) IfNoneMatch(entityTag string) *VideoAbuseReportReasonsListCall {
  19033. c.ifNoneMatch_ = entityTag
  19034. return c
  19035. }
  19036. // Context sets the context to be used in this call's Do method. Any
  19037. // pending HTTP request will be aborted if the provided context is
  19038. // canceled.
  19039. func (c *VideoAbuseReportReasonsListCall) Context(ctx context.Context) *VideoAbuseReportReasonsListCall {
  19040. c.ctx_ = ctx
  19041. return c
  19042. }
  19043. // Header returns an http.Header that can be modified by the caller to
  19044. // add HTTP headers to the request.
  19045. func (c *VideoAbuseReportReasonsListCall) Header() http.Header {
  19046. if c.header_ == nil {
  19047. c.header_ = make(http.Header)
  19048. }
  19049. return c.header_
  19050. }
  19051. func (c *VideoAbuseReportReasonsListCall) doRequest(alt string) (*http.Response, error) {
  19052. reqHeaders := make(http.Header)
  19053. for k, v := range c.header_ {
  19054. reqHeaders[k] = v
  19055. }
  19056. reqHeaders.Set("User-Agent", c.s.userAgent())
  19057. if c.ifNoneMatch_ != "" {
  19058. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19059. }
  19060. var body io.Reader = nil
  19061. c.urlParams_.Set("alt", alt)
  19062. urls := googleapi.ResolveRelative(c.s.BasePath, "videoAbuseReportReasons")
  19063. urls += "?" + c.urlParams_.Encode()
  19064. req, _ := http.NewRequest("GET", urls, body)
  19065. req.Header = reqHeaders
  19066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19067. }
  19068. // Do executes the "youtube.videoAbuseReportReasons.list" call.
  19069. // Exactly one of *VideoAbuseReportReasonListResponse or error will be
  19070. // non-nil. Any non-2xx status code is an error. Response headers are in
  19071. // either *VideoAbuseReportReasonListResponse.ServerResponse.Header or
  19072. // (if a response was returned at all) in
  19073. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  19074. // whether the returned error was because http.StatusNotModified was
  19075. // returned.
  19076. func (c *VideoAbuseReportReasonsListCall) Do(opts ...googleapi.CallOption) (*VideoAbuseReportReasonListResponse, 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 := &VideoAbuseReportReasonListResponse{
  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": "Returns a list of abuse reasons that can be used for reporting abusive videos.",
  19108. // "httpMethod": "GET",
  19109. // "id": "youtube.videoAbuseReportReasons.list",
  19110. // "parameterOrder": [
  19111. // "part"
  19112. // ],
  19113. // "parameters": {
  19114. // "hl": {
  19115. // "default": "en_US",
  19116. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  19117. // "location": "query",
  19118. // "type": "string"
  19119. // },
  19120. // "part": {
  19121. // "description": "The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.",
  19122. // "location": "query",
  19123. // "required": true,
  19124. // "type": "string"
  19125. // }
  19126. // },
  19127. // "path": "videoAbuseReportReasons",
  19128. // "response": {
  19129. // "$ref": "VideoAbuseReportReasonListResponse"
  19130. // },
  19131. // "scopes": [
  19132. // "https://www.googleapis.com/auth/youtube",
  19133. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19134. // "https://www.googleapis.com/auth/youtube.readonly"
  19135. // ]
  19136. // }
  19137. }
  19138. // method id "youtube.videoCategories.list":
  19139. type VideoCategoriesListCall struct {
  19140. s *Service
  19141. urlParams_ gensupport.URLParams
  19142. ifNoneMatch_ string
  19143. ctx_ context.Context
  19144. header_ http.Header
  19145. }
  19146. // List: Returns a list of categories that can be associated with
  19147. // YouTube videos.
  19148. func (r *VideoCategoriesService) List(part string) *VideoCategoriesListCall {
  19149. c := &VideoCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19150. c.urlParams_.Set("part", part)
  19151. return c
  19152. }
  19153. // Hl sets the optional parameter "hl": The hl parameter specifies the
  19154. // language that should be used for text values in the API response.
  19155. func (c *VideoCategoriesListCall) Hl(hl string) *VideoCategoriesListCall {
  19156. c.urlParams_.Set("hl", hl)
  19157. return c
  19158. }
  19159. // Id sets the optional parameter "id": The id parameter specifies a
  19160. // comma-separated list of video category IDs for the resources that you
  19161. // are retrieving.
  19162. func (c *VideoCategoriesListCall) Id(id string) *VideoCategoriesListCall {
  19163. c.urlParams_.Set("id", id)
  19164. return c
  19165. }
  19166. // RegionCode sets the optional parameter "regionCode": The regionCode
  19167. // parameter instructs the API to return the list of video categories
  19168. // available in the specified country. The parameter value is an ISO
  19169. // 3166-1 alpha-2 country code.
  19170. func (c *VideoCategoriesListCall) RegionCode(regionCode string) *VideoCategoriesListCall {
  19171. c.urlParams_.Set("regionCode", regionCode)
  19172. return c
  19173. }
  19174. // Fields allows partial responses to be retrieved. See
  19175. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19176. // for more information.
  19177. func (c *VideoCategoriesListCall) Fields(s ...googleapi.Field) *VideoCategoriesListCall {
  19178. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19179. return c
  19180. }
  19181. // IfNoneMatch sets the optional parameter which makes the operation
  19182. // fail if the object's ETag matches the given value. This is useful for
  19183. // getting updates only after the object has changed since the last
  19184. // request. Use googleapi.IsNotModified to check whether the response
  19185. // error from Do is the result of In-None-Match.
  19186. func (c *VideoCategoriesListCall) IfNoneMatch(entityTag string) *VideoCategoriesListCall {
  19187. c.ifNoneMatch_ = entityTag
  19188. return c
  19189. }
  19190. // Context sets the context to be used in this call's Do method. Any
  19191. // pending HTTP request will be aborted if the provided context is
  19192. // canceled.
  19193. func (c *VideoCategoriesListCall) Context(ctx context.Context) *VideoCategoriesListCall {
  19194. c.ctx_ = ctx
  19195. return c
  19196. }
  19197. // Header returns an http.Header that can be modified by the caller to
  19198. // add HTTP headers to the request.
  19199. func (c *VideoCategoriesListCall) Header() http.Header {
  19200. if c.header_ == nil {
  19201. c.header_ = make(http.Header)
  19202. }
  19203. return c.header_
  19204. }
  19205. func (c *VideoCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  19206. reqHeaders := make(http.Header)
  19207. for k, v := range c.header_ {
  19208. reqHeaders[k] = v
  19209. }
  19210. reqHeaders.Set("User-Agent", c.s.userAgent())
  19211. if c.ifNoneMatch_ != "" {
  19212. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19213. }
  19214. var body io.Reader = nil
  19215. c.urlParams_.Set("alt", alt)
  19216. urls := googleapi.ResolveRelative(c.s.BasePath, "videoCategories")
  19217. urls += "?" + c.urlParams_.Encode()
  19218. req, _ := http.NewRequest("GET", urls, body)
  19219. req.Header = reqHeaders
  19220. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19221. }
  19222. // Do executes the "youtube.videoCategories.list" call.
  19223. // Exactly one of *VideoCategoryListResponse or error will be non-nil.
  19224. // Any non-2xx status code is an error. Response headers are in either
  19225. // *VideoCategoryListResponse.ServerResponse.Header or (if a response
  19226. // was returned at all) in error.(*googleapi.Error).Header. Use
  19227. // googleapi.IsNotModified to check whether the returned error was
  19228. // because http.StatusNotModified was returned.
  19229. func (c *VideoCategoriesListCall) Do(opts ...googleapi.CallOption) (*VideoCategoryListResponse, error) {
  19230. gensupport.SetOptions(c.urlParams_, opts...)
  19231. res, err := c.doRequest("json")
  19232. if res != nil && res.StatusCode == http.StatusNotModified {
  19233. if res.Body != nil {
  19234. res.Body.Close()
  19235. }
  19236. return nil, &googleapi.Error{
  19237. Code: res.StatusCode,
  19238. Header: res.Header,
  19239. }
  19240. }
  19241. if err != nil {
  19242. return nil, err
  19243. }
  19244. defer googleapi.CloseBody(res)
  19245. if err := googleapi.CheckResponse(res); err != nil {
  19246. return nil, err
  19247. }
  19248. ret := &VideoCategoryListResponse{
  19249. ServerResponse: googleapi.ServerResponse{
  19250. Header: res.Header,
  19251. HTTPStatusCode: res.StatusCode,
  19252. },
  19253. }
  19254. target := &ret
  19255. if err := gensupport.DecodeResponse(target, res); err != nil {
  19256. return nil, err
  19257. }
  19258. return ret, nil
  19259. // {
  19260. // "description": "Returns a list of categories that can be associated with YouTube videos.",
  19261. // "httpMethod": "GET",
  19262. // "id": "youtube.videoCategories.list",
  19263. // "parameterOrder": [
  19264. // "part"
  19265. // ],
  19266. // "parameters": {
  19267. // "hl": {
  19268. // "default": "en_US",
  19269. // "description": "The hl parameter specifies the language that should be used for text values in the API response.",
  19270. // "location": "query",
  19271. // "type": "string"
  19272. // },
  19273. // "id": {
  19274. // "description": "The id parameter specifies a comma-separated list of video category IDs for the resources that you are retrieving.",
  19275. // "location": "query",
  19276. // "type": "string"
  19277. // },
  19278. // "part": {
  19279. // "description": "The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.",
  19280. // "location": "query",
  19281. // "required": true,
  19282. // "type": "string"
  19283. // },
  19284. // "regionCode": {
  19285. // "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.",
  19286. // "location": "query",
  19287. // "type": "string"
  19288. // }
  19289. // },
  19290. // "path": "videoCategories",
  19291. // "response": {
  19292. // "$ref": "VideoCategoryListResponse"
  19293. // },
  19294. // "scopes": [
  19295. // "https://www.googleapis.com/auth/youtube",
  19296. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19297. // "https://www.googleapis.com/auth/youtube.readonly",
  19298. // "https://www.googleapis.com/auth/youtubepartner"
  19299. // ]
  19300. // }
  19301. }
  19302. // method id "youtube.videos.delete":
  19303. type VideosDeleteCall struct {
  19304. s *Service
  19305. urlParams_ gensupport.URLParams
  19306. ctx_ context.Context
  19307. header_ http.Header
  19308. }
  19309. // Delete: Deletes a YouTube video.
  19310. func (r *VideosService) Delete(id string) *VideosDeleteCall {
  19311. c := &VideosDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19312. c.urlParams_.Set("id", id)
  19313. return c
  19314. }
  19315. // OnBehalfOfContentOwner sets the optional parameter
  19316. // "onBehalfOfContentOwner": Note: This parameter is intended
  19317. // exclusively for YouTube content partners.
  19318. //
  19319. // The onBehalfOfContentOwner parameter indicates that the request's
  19320. // authorization credentials identify a YouTube CMS user who is acting
  19321. // on behalf of the content owner specified in the parameter value. This
  19322. // parameter is intended for YouTube content partners that own and
  19323. // manage many different YouTube channels. It allows content owners to
  19324. // authenticate once and get access to all their video and channel data,
  19325. // without having to provide authentication credentials for each
  19326. // individual channel. The actual CMS account that the user
  19327. // authenticates with must be linked to the specified YouTube content
  19328. // owner.
  19329. func (c *VideosDeleteCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosDeleteCall {
  19330. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19331. return c
  19332. }
  19333. // Fields allows partial responses to be retrieved. See
  19334. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19335. // for more information.
  19336. func (c *VideosDeleteCall) Fields(s ...googleapi.Field) *VideosDeleteCall {
  19337. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19338. return c
  19339. }
  19340. // Context sets the context to be used in this call's Do method. Any
  19341. // pending HTTP request will be aborted if the provided context is
  19342. // canceled.
  19343. func (c *VideosDeleteCall) Context(ctx context.Context) *VideosDeleteCall {
  19344. c.ctx_ = ctx
  19345. return c
  19346. }
  19347. // Header returns an http.Header that can be modified by the caller to
  19348. // add HTTP headers to the request.
  19349. func (c *VideosDeleteCall) Header() http.Header {
  19350. if c.header_ == nil {
  19351. c.header_ = make(http.Header)
  19352. }
  19353. return c.header_
  19354. }
  19355. func (c *VideosDeleteCall) doRequest(alt string) (*http.Response, error) {
  19356. reqHeaders := make(http.Header)
  19357. for k, v := range c.header_ {
  19358. reqHeaders[k] = v
  19359. }
  19360. reqHeaders.Set("User-Agent", c.s.userAgent())
  19361. var body io.Reader = nil
  19362. c.urlParams_.Set("alt", alt)
  19363. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  19364. urls += "?" + c.urlParams_.Encode()
  19365. req, _ := http.NewRequest("DELETE", urls, body)
  19366. req.Header = reqHeaders
  19367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19368. }
  19369. // Do executes the "youtube.videos.delete" call.
  19370. func (c *VideosDeleteCall) Do(opts ...googleapi.CallOption) error {
  19371. gensupport.SetOptions(c.urlParams_, opts...)
  19372. res, err := c.doRequest("json")
  19373. if err != nil {
  19374. return err
  19375. }
  19376. defer googleapi.CloseBody(res)
  19377. if err := googleapi.CheckResponse(res); err != nil {
  19378. return err
  19379. }
  19380. return nil
  19381. // {
  19382. // "description": "Deletes a YouTube video.",
  19383. // "httpMethod": "DELETE",
  19384. // "id": "youtube.videos.delete",
  19385. // "parameterOrder": [
  19386. // "id"
  19387. // ],
  19388. // "parameters": {
  19389. // "id": {
  19390. // "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.",
  19391. // "location": "query",
  19392. // "required": true,
  19393. // "type": "string"
  19394. // },
  19395. // "onBehalfOfContentOwner": {
  19396. // "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.",
  19397. // "location": "query",
  19398. // "type": "string"
  19399. // }
  19400. // },
  19401. // "path": "videos",
  19402. // "scopes": [
  19403. // "https://www.googleapis.com/auth/youtube",
  19404. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19405. // "https://www.googleapis.com/auth/youtubepartner"
  19406. // ]
  19407. // }
  19408. }
  19409. // method id "youtube.videos.getRating":
  19410. type VideosGetRatingCall struct {
  19411. s *Service
  19412. urlParams_ gensupport.URLParams
  19413. ifNoneMatch_ string
  19414. ctx_ context.Context
  19415. header_ http.Header
  19416. }
  19417. // GetRating: Retrieves the ratings that the authorized user gave to a
  19418. // list of specified videos.
  19419. func (r *VideosService) GetRating(id string) *VideosGetRatingCall {
  19420. c := &VideosGetRatingCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19421. c.urlParams_.Set("id", id)
  19422. return c
  19423. }
  19424. // OnBehalfOfContentOwner sets the optional parameter
  19425. // "onBehalfOfContentOwner": Note: This parameter is intended
  19426. // exclusively for YouTube content partners.
  19427. //
  19428. // The onBehalfOfContentOwner parameter indicates that the request's
  19429. // authorization credentials identify a YouTube CMS user who is acting
  19430. // on behalf of the content owner specified in the parameter value. This
  19431. // parameter is intended for YouTube content partners that own and
  19432. // manage many different YouTube channels. It allows content owners to
  19433. // authenticate once and get access to all their video and channel data,
  19434. // without having to provide authentication credentials for each
  19435. // individual channel. The CMS account that the user authenticates with
  19436. // must be linked to the specified YouTube content owner.
  19437. func (c *VideosGetRatingCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosGetRatingCall {
  19438. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19439. return c
  19440. }
  19441. // Fields allows partial responses to be retrieved. See
  19442. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19443. // for more information.
  19444. func (c *VideosGetRatingCall) Fields(s ...googleapi.Field) *VideosGetRatingCall {
  19445. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19446. return c
  19447. }
  19448. // IfNoneMatch sets the optional parameter which makes the operation
  19449. // fail if the object's ETag matches the given value. This is useful for
  19450. // getting updates only after the object has changed since the last
  19451. // request. Use googleapi.IsNotModified to check whether the response
  19452. // error from Do is the result of In-None-Match.
  19453. func (c *VideosGetRatingCall) IfNoneMatch(entityTag string) *VideosGetRatingCall {
  19454. c.ifNoneMatch_ = entityTag
  19455. return c
  19456. }
  19457. // Context sets the context to be used in this call's Do method. Any
  19458. // pending HTTP request will be aborted if the provided context is
  19459. // canceled.
  19460. func (c *VideosGetRatingCall) Context(ctx context.Context) *VideosGetRatingCall {
  19461. c.ctx_ = ctx
  19462. return c
  19463. }
  19464. // Header returns an http.Header that can be modified by the caller to
  19465. // add HTTP headers to the request.
  19466. func (c *VideosGetRatingCall) Header() http.Header {
  19467. if c.header_ == nil {
  19468. c.header_ = make(http.Header)
  19469. }
  19470. return c.header_
  19471. }
  19472. func (c *VideosGetRatingCall) doRequest(alt string) (*http.Response, error) {
  19473. reqHeaders := make(http.Header)
  19474. for k, v := range c.header_ {
  19475. reqHeaders[k] = v
  19476. }
  19477. reqHeaders.Set("User-Agent", c.s.userAgent())
  19478. if c.ifNoneMatch_ != "" {
  19479. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19480. }
  19481. var body io.Reader = nil
  19482. c.urlParams_.Set("alt", alt)
  19483. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/getRating")
  19484. urls += "?" + c.urlParams_.Encode()
  19485. req, _ := http.NewRequest("GET", urls, body)
  19486. req.Header = reqHeaders
  19487. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19488. }
  19489. // Do executes the "youtube.videos.getRating" call.
  19490. // Exactly one of *VideoGetRatingResponse or error will be non-nil. Any
  19491. // non-2xx status code is an error. Response headers are in either
  19492. // *VideoGetRatingResponse.ServerResponse.Header or (if a response was
  19493. // returned at all) in error.(*googleapi.Error).Header. Use
  19494. // googleapi.IsNotModified to check whether the returned error was
  19495. // because http.StatusNotModified was returned.
  19496. func (c *VideosGetRatingCall) Do(opts ...googleapi.CallOption) (*VideoGetRatingResponse, error) {
  19497. gensupport.SetOptions(c.urlParams_, opts...)
  19498. res, err := c.doRequest("json")
  19499. if res != nil && res.StatusCode == http.StatusNotModified {
  19500. if res.Body != nil {
  19501. res.Body.Close()
  19502. }
  19503. return nil, &googleapi.Error{
  19504. Code: res.StatusCode,
  19505. Header: res.Header,
  19506. }
  19507. }
  19508. if err != nil {
  19509. return nil, err
  19510. }
  19511. defer googleapi.CloseBody(res)
  19512. if err := googleapi.CheckResponse(res); err != nil {
  19513. return nil, err
  19514. }
  19515. ret := &VideoGetRatingResponse{
  19516. ServerResponse: googleapi.ServerResponse{
  19517. Header: res.Header,
  19518. HTTPStatusCode: res.StatusCode,
  19519. },
  19520. }
  19521. target := &ret
  19522. if err := gensupport.DecodeResponse(target, res); err != nil {
  19523. return nil, err
  19524. }
  19525. return ret, nil
  19526. // {
  19527. // "description": "Retrieves the ratings that the authorized user gave to a list of specified videos.",
  19528. // "httpMethod": "GET",
  19529. // "id": "youtube.videos.getRating",
  19530. // "parameterOrder": [
  19531. // "id"
  19532. // ],
  19533. // "parameters": {
  19534. // "id": {
  19535. // "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.",
  19536. // "location": "query",
  19537. // "required": true,
  19538. // "type": "string"
  19539. // },
  19540. // "onBehalfOfContentOwner": {
  19541. // "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.",
  19542. // "location": "query",
  19543. // "type": "string"
  19544. // }
  19545. // },
  19546. // "path": "videos/getRating",
  19547. // "response": {
  19548. // "$ref": "VideoGetRatingResponse"
  19549. // },
  19550. // "scopes": [
  19551. // "https://www.googleapis.com/auth/youtube",
  19552. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19553. // "https://www.googleapis.com/auth/youtubepartner"
  19554. // ]
  19555. // }
  19556. }
  19557. // method id "youtube.videos.insert":
  19558. type VideosInsertCall struct {
  19559. s *Service
  19560. video *Video
  19561. urlParams_ gensupport.URLParams
  19562. mediaInfo_ *gensupport.MediaInfo
  19563. ctx_ context.Context
  19564. header_ http.Header
  19565. }
  19566. // Insert: Uploads a video to YouTube and optionally sets the video's
  19567. // metadata.
  19568. func (r *VideosService) Insert(part string, video *Video) *VideosInsertCall {
  19569. c := &VideosInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19570. c.urlParams_.Set("part", part)
  19571. c.video = video
  19572. return c
  19573. }
  19574. // AutoLevels sets the optional parameter "autoLevels": The autoLevels
  19575. // parameter indicates whether YouTube should automatically enhance the
  19576. // video's lighting and color.
  19577. func (c *VideosInsertCall) AutoLevels(autoLevels bool) *VideosInsertCall {
  19578. c.urlParams_.Set("autoLevels", fmt.Sprint(autoLevels))
  19579. return c
  19580. }
  19581. // NotifySubscribers sets the optional parameter "notifySubscribers":
  19582. // The notifySubscribers parameter indicates whether YouTube should send
  19583. // a notification about the new video to users who subscribe to the
  19584. // video's channel. A parameter value of True indicates that subscribers
  19585. // will be notified of newly uploaded videos. However, a channel owner
  19586. // who is uploading many videos might prefer to set the value to False
  19587. // to avoid sending a notification about each new video to the channel's
  19588. // subscribers.
  19589. func (c *VideosInsertCall) NotifySubscribers(notifySubscribers bool) *VideosInsertCall {
  19590. c.urlParams_.Set("notifySubscribers", fmt.Sprint(notifySubscribers))
  19591. return c
  19592. }
  19593. // OnBehalfOfContentOwner sets the optional parameter
  19594. // "onBehalfOfContentOwner": Note: This parameter is intended
  19595. // exclusively for YouTube content partners.
  19596. //
  19597. // The onBehalfOfContentOwner parameter indicates that the request's
  19598. // authorization credentials identify a YouTube CMS user who is acting
  19599. // on behalf of the content owner specified in the parameter value. This
  19600. // parameter is intended for YouTube content partners that own and
  19601. // manage many different YouTube channels. It allows content owners to
  19602. // authenticate once and get access to all their video and channel data,
  19603. // without having to provide authentication credentials for each
  19604. // individual channel. The CMS account that the user authenticates with
  19605. // must be linked to the specified YouTube content owner.
  19606. func (c *VideosInsertCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosInsertCall {
  19607. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19608. return c
  19609. }
  19610. // OnBehalfOfContentOwnerChannel sets the optional parameter
  19611. // "onBehalfOfContentOwnerChannel": This parameter can only be used in a
  19612. // properly authorized request. Note: This parameter is intended
  19613. // exclusively for YouTube content partners.
  19614. //
  19615. // The onBehalfOfContentOwnerChannel parameter specifies the YouTube
  19616. // channel ID of the channel to which a video is being added. This
  19617. // parameter is required when a request specifies a value for the
  19618. // onBehalfOfContentOwner parameter, and it can only be used in
  19619. // conjunction with that parameter. In addition, the request must be
  19620. // authorized using a CMS account that is linked to the content owner
  19621. // that the onBehalfOfContentOwner parameter specifies. Finally, the
  19622. // channel that the onBehalfOfContentOwnerChannel parameter value
  19623. // specifies must be linked to the content owner that the
  19624. // onBehalfOfContentOwner parameter specifies.
  19625. //
  19626. // This parameter is intended for YouTube content partners that own and
  19627. // manage many different YouTube channels. It allows content owners to
  19628. // authenticate once and perform actions on behalf of the channel
  19629. // specified in the parameter value, without having to provide
  19630. // authentication credentials for each separate channel.
  19631. func (c *VideosInsertCall) OnBehalfOfContentOwnerChannel(onBehalfOfContentOwnerChannel string) *VideosInsertCall {
  19632. c.urlParams_.Set("onBehalfOfContentOwnerChannel", onBehalfOfContentOwnerChannel)
  19633. return c
  19634. }
  19635. // Stabilize sets the optional parameter "stabilize": The stabilize
  19636. // parameter indicates whether YouTube should adjust the video to remove
  19637. // shaky camera motions.
  19638. func (c *VideosInsertCall) Stabilize(stabilize bool) *VideosInsertCall {
  19639. c.urlParams_.Set("stabilize", fmt.Sprint(stabilize))
  19640. return c
  19641. }
  19642. // Media specifies the media to upload in one or more chunks. The chunk
  19643. // size may be controlled by supplying a MediaOption generated by
  19644. // googleapi.ChunkSize. The chunk size defaults to
  19645. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  19646. // upload request will be determined by sniffing the contents of r,
  19647. // unless a MediaOption generated by googleapi.ContentType is
  19648. // supplied.
  19649. // At most one of Media and ResumableMedia may be set.
  19650. func (c *VideosInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *VideosInsertCall {
  19651. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  19652. return c
  19653. }
  19654. // ResumableMedia specifies the media to upload in chunks and can be
  19655. // canceled with ctx.
  19656. //
  19657. // Deprecated: use Media instead.
  19658. //
  19659. // At most one of Media and ResumableMedia may be set. mediaType
  19660. // identifies the MIME media type of the upload, such as "image/png". If
  19661. // mediaType is "", it will be auto-detected. The provided ctx will
  19662. // supersede any context previously provided to the Context method.
  19663. func (c *VideosInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *VideosInsertCall {
  19664. c.ctx_ = ctx
  19665. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  19666. return c
  19667. }
  19668. // ProgressUpdater provides a callback function that will be called
  19669. // after every chunk. It should be a low-latency function in order to
  19670. // not slow down the upload operation. This should only be called when
  19671. // using ResumableMedia (as opposed to Media).
  19672. func (c *VideosInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *VideosInsertCall {
  19673. c.mediaInfo_.SetProgressUpdater(pu)
  19674. return c
  19675. }
  19676. // Fields allows partial responses to be retrieved. See
  19677. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19678. // for more information.
  19679. func (c *VideosInsertCall) Fields(s ...googleapi.Field) *VideosInsertCall {
  19680. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19681. return c
  19682. }
  19683. // Context sets the context to be used in this call's Do method. Any
  19684. // pending HTTP request will be aborted if the provided context is
  19685. // canceled.
  19686. // This context will supersede any context previously provided to the
  19687. // ResumableMedia method.
  19688. func (c *VideosInsertCall) Context(ctx context.Context) *VideosInsertCall {
  19689. c.ctx_ = ctx
  19690. return c
  19691. }
  19692. // Header returns an http.Header that can be modified by the caller to
  19693. // add HTTP headers to the request.
  19694. func (c *VideosInsertCall) Header() http.Header {
  19695. if c.header_ == nil {
  19696. c.header_ = make(http.Header)
  19697. }
  19698. return c.header_
  19699. }
  19700. func (c *VideosInsertCall) doRequest(alt string) (*http.Response, error) {
  19701. reqHeaders := make(http.Header)
  19702. for k, v := range c.header_ {
  19703. reqHeaders[k] = v
  19704. }
  19705. reqHeaders.Set("User-Agent", c.s.userAgent())
  19706. var body io.Reader = nil
  19707. body, err := googleapi.WithoutDataWrapper.JSONReader(c.video)
  19708. if err != nil {
  19709. return nil, err
  19710. }
  19711. reqHeaders.Set("Content-Type", "application/json")
  19712. c.urlParams_.Set("alt", alt)
  19713. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  19714. if c.mediaInfo_ != nil {
  19715. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  19716. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  19717. }
  19718. if body == nil {
  19719. body = new(bytes.Buffer)
  19720. reqHeaders.Set("Content-Type", "application/json")
  19721. }
  19722. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  19723. defer cleanup()
  19724. urls += "?" + c.urlParams_.Encode()
  19725. req, _ := http.NewRequest("POST", urls, body)
  19726. req.Header = reqHeaders
  19727. gensupport.SetGetBody(req, getBody)
  19728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19729. }
  19730. // Do executes the "youtube.videos.insert" call.
  19731. // Exactly one of *Video or error will be non-nil. Any non-2xx status
  19732. // code is an error. Response headers are in either
  19733. // *Video.ServerResponse.Header or (if a response was returned at all)
  19734. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  19735. // check whether the returned error was because http.StatusNotModified
  19736. // was returned.
  19737. func (c *VideosInsertCall) Do(opts ...googleapi.CallOption) (*Video, error) {
  19738. gensupport.SetOptions(c.urlParams_, opts...)
  19739. res, err := c.doRequest("json")
  19740. if res != nil && res.StatusCode == http.StatusNotModified {
  19741. if res.Body != nil {
  19742. res.Body.Close()
  19743. }
  19744. return nil, &googleapi.Error{
  19745. Code: res.StatusCode,
  19746. Header: res.Header,
  19747. }
  19748. }
  19749. if err != nil {
  19750. return nil, err
  19751. }
  19752. defer googleapi.CloseBody(res)
  19753. if err := googleapi.CheckResponse(res); err != nil {
  19754. return nil, err
  19755. }
  19756. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  19757. if rx != nil {
  19758. rx.Client = c.s.client
  19759. rx.UserAgent = c.s.userAgent()
  19760. ctx := c.ctx_
  19761. if ctx == nil {
  19762. ctx = context.TODO()
  19763. }
  19764. res, err = rx.Upload(ctx)
  19765. if err != nil {
  19766. return nil, err
  19767. }
  19768. defer res.Body.Close()
  19769. if err := googleapi.CheckResponse(res); err != nil {
  19770. return nil, err
  19771. }
  19772. }
  19773. ret := &Video{
  19774. ServerResponse: googleapi.ServerResponse{
  19775. Header: res.Header,
  19776. HTTPStatusCode: res.StatusCode,
  19777. },
  19778. }
  19779. target := &ret
  19780. if err := gensupport.DecodeResponse(target, res); err != nil {
  19781. return nil, err
  19782. }
  19783. return ret, nil
  19784. // {
  19785. // "description": "Uploads a video to YouTube and optionally sets the video's metadata.",
  19786. // "httpMethod": "POST",
  19787. // "id": "youtube.videos.insert",
  19788. // "mediaUpload": {
  19789. // "accept": [
  19790. // "application/octet-stream",
  19791. // "video/*"
  19792. // ],
  19793. // "maxSize": "64GB",
  19794. // "protocols": {
  19795. // "resumable": {
  19796. // "multipart": true,
  19797. // "path": "/resumable/upload/youtube/v3/videos"
  19798. // },
  19799. // "simple": {
  19800. // "multipart": true,
  19801. // "path": "/upload/youtube/v3/videos"
  19802. // }
  19803. // }
  19804. // },
  19805. // "parameterOrder": [
  19806. // "part"
  19807. // ],
  19808. // "parameters": {
  19809. // "autoLevels": {
  19810. // "description": "The autoLevels parameter indicates whether YouTube should automatically enhance the video's lighting and color.",
  19811. // "location": "query",
  19812. // "type": "boolean"
  19813. // },
  19814. // "notifySubscribers": {
  19815. // "default": "true",
  19816. // "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.",
  19817. // "location": "query",
  19818. // "type": "boolean"
  19819. // },
  19820. // "onBehalfOfContentOwner": {
  19821. // "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.",
  19822. // "location": "query",
  19823. // "type": "string"
  19824. // },
  19825. // "onBehalfOfContentOwnerChannel": {
  19826. // "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.",
  19827. // "location": "query",
  19828. // "type": "string"
  19829. // },
  19830. // "part": {
  19831. // "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.",
  19832. // "location": "query",
  19833. // "required": true,
  19834. // "type": "string"
  19835. // },
  19836. // "stabilize": {
  19837. // "description": "The stabilize parameter indicates whether YouTube should adjust the video to remove shaky camera motions.",
  19838. // "location": "query",
  19839. // "type": "boolean"
  19840. // }
  19841. // },
  19842. // "path": "videos",
  19843. // "request": {
  19844. // "$ref": "Video"
  19845. // },
  19846. // "response": {
  19847. // "$ref": "Video"
  19848. // },
  19849. // "scopes": [
  19850. // "https://www.googleapis.com/auth/youtube",
  19851. // "https://www.googleapis.com/auth/youtube.force-ssl",
  19852. // "https://www.googleapis.com/auth/youtube.upload",
  19853. // "https://www.googleapis.com/auth/youtubepartner"
  19854. // ],
  19855. // "supportsMediaUpload": true
  19856. // }
  19857. }
  19858. // method id "youtube.videos.list":
  19859. type VideosListCall struct {
  19860. s *Service
  19861. urlParams_ gensupport.URLParams
  19862. ifNoneMatch_ string
  19863. ctx_ context.Context
  19864. header_ http.Header
  19865. }
  19866. // List: Returns a list of videos that match the API request parameters.
  19867. func (r *VideosService) List(part string) *VideosListCall {
  19868. c := &VideosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19869. c.urlParams_.Set("part", part)
  19870. return c
  19871. }
  19872. // Chart sets the optional parameter "chart": The chart parameter
  19873. // identifies the chart that you want to retrieve.
  19874. //
  19875. // Possible values:
  19876. // "mostPopular" - Return the most popular videos for the specified
  19877. // content region and video category.
  19878. func (c *VideosListCall) Chart(chart string) *VideosListCall {
  19879. c.urlParams_.Set("chart", chart)
  19880. return c
  19881. }
  19882. // Hl sets the optional parameter "hl": The hl parameter instructs the
  19883. // API to retrieve localized resource metadata for a specific
  19884. // application language that the YouTube website supports. The parameter
  19885. // value must be a language code included in the list returned by the
  19886. // i18nLanguages.list method.
  19887. //
  19888. // If localized resource details are available in that language, the
  19889. // resource's snippet.localized object will contain the localized
  19890. // values. However, if localized details are not available, the
  19891. // snippet.localized object will contain resource details in the
  19892. // resource's default language.
  19893. func (c *VideosListCall) Hl(hl string) *VideosListCall {
  19894. c.urlParams_.Set("hl", hl)
  19895. return c
  19896. }
  19897. // Id sets the optional parameter "id": The id parameter specifies a
  19898. // comma-separated list of the YouTube video ID(s) for the resource(s)
  19899. // that are being retrieved. In a video resource, the id property
  19900. // specifies the video's ID.
  19901. func (c *VideosListCall) Id(id string) *VideosListCall {
  19902. c.urlParams_.Set("id", id)
  19903. return c
  19904. }
  19905. // Locale sets the optional parameter "locale": DEPRECATED
  19906. func (c *VideosListCall) Locale(locale string) *VideosListCall {
  19907. c.urlParams_.Set("locale", locale)
  19908. return c
  19909. }
  19910. // MaxHeight sets the optional parameter "maxHeight": The maxHeight
  19911. // parameter specifies a maximum height of the embedded player. If
  19912. // maxWidth is provided, maxHeight may not be reached in order to not
  19913. // violate the width request.
  19914. func (c *VideosListCall) MaxHeight(maxHeight int64) *VideosListCall {
  19915. c.urlParams_.Set("maxHeight", fmt.Sprint(maxHeight))
  19916. return c
  19917. }
  19918. // MaxResults sets the optional parameter "maxResults": The maxResults
  19919. // parameter specifies the maximum number of items that should be
  19920. // returned in the result set.
  19921. //
  19922. // Note: This parameter is supported for use in conjunction with the
  19923. // myRating and chart parameters, but it is not supported for use in
  19924. // conjunction with the id parameter.
  19925. func (c *VideosListCall) MaxResults(maxResults int64) *VideosListCall {
  19926. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19927. return c
  19928. }
  19929. // MaxWidth sets the optional parameter "maxWidth": The maxWidth
  19930. // parameter specifies a maximum width of the embedded player. If
  19931. // maxHeight is provided, maxWidth may not be reached in order to not
  19932. // violate the height request.
  19933. func (c *VideosListCall) MaxWidth(maxWidth int64) *VideosListCall {
  19934. c.urlParams_.Set("maxWidth", fmt.Sprint(maxWidth))
  19935. return c
  19936. }
  19937. // MyRating sets the optional parameter "myRating": Set this parameter's
  19938. // value to like or dislike to instruct the API to only return videos
  19939. // liked or disliked by the authenticated user.
  19940. //
  19941. // Possible values:
  19942. // "dislike" - Returns only videos disliked by the authenticated user.
  19943. // "like" - Returns only video liked by the authenticated user.
  19944. func (c *VideosListCall) MyRating(myRating string) *VideosListCall {
  19945. c.urlParams_.Set("myRating", myRating)
  19946. return c
  19947. }
  19948. // OnBehalfOfContentOwner sets the optional parameter
  19949. // "onBehalfOfContentOwner": Note: This parameter is intended
  19950. // exclusively for YouTube content partners.
  19951. //
  19952. // The onBehalfOfContentOwner parameter indicates that the request's
  19953. // authorization credentials identify a YouTube CMS user who is acting
  19954. // on behalf of the content owner specified in the parameter value. This
  19955. // parameter is intended for YouTube content partners that own and
  19956. // manage many different YouTube channels. It allows content owners to
  19957. // authenticate once and get access to all their video and channel data,
  19958. // without having to provide authentication credentials for each
  19959. // individual channel. The CMS account that the user authenticates with
  19960. // must be linked to the specified YouTube content owner.
  19961. func (c *VideosListCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosListCall {
  19962. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  19963. return c
  19964. }
  19965. // PageToken sets the optional parameter "pageToken": The pageToken
  19966. // parameter identifies a specific page in the result set that should be
  19967. // returned. In an API response, the nextPageToken and prevPageToken
  19968. // properties identify other pages that could be retrieved.
  19969. //
  19970. // Note: This parameter is supported for use in conjunction with the
  19971. // myRating and chart parameters, but it is not supported for use in
  19972. // conjunction with the id parameter.
  19973. func (c *VideosListCall) PageToken(pageToken string) *VideosListCall {
  19974. c.urlParams_.Set("pageToken", pageToken)
  19975. return c
  19976. }
  19977. // RegionCode sets the optional parameter "regionCode": The regionCode
  19978. // parameter instructs the API to select a video chart available in the
  19979. // specified region. This parameter can only be used in conjunction with
  19980. // the chart parameter. The parameter value is an ISO 3166-1 alpha-2
  19981. // country code.
  19982. func (c *VideosListCall) RegionCode(regionCode string) *VideosListCall {
  19983. c.urlParams_.Set("regionCode", regionCode)
  19984. return c
  19985. }
  19986. // VideoCategoryId sets the optional parameter "videoCategoryId": The
  19987. // videoCategoryId parameter identifies the video category for which the
  19988. // chart should be retrieved. This parameter can only be used in
  19989. // conjunction with the chart parameter. By default, charts are not
  19990. // restricted to a particular category.
  19991. func (c *VideosListCall) VideoCategoryId(videoCategoryId string) *VideosListCall {
  19992. c.urlParams_.Set("videoCategoryId", videoCategoryId)
  19993. return c
  19994. }
  19995. // Fields allows partial responses to be retrieved. See
  19996. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19997. // for more information.
  19998. func (c *VideosListCall) Fields(s ...googleapi.Field) *VideosListCall {
  19999. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20000. return c
  20001. }
  20002. // IfNoneMatch sets the optional parameter which makes the operation
  20003. // fail if the object's ETag matches the given value. This is useful for
  20004. // getting updates only after the object has changed since the last
  20005. // request. Use googleapi.IsNotModified to check whether the response
  20006. // error from Do is the result of In-None-Match.
  20007. func (c *VideosListCall) IfNoneMatch(entityTag string) *VideosListCall {
  20008. c.ifNoneMatch_ = entityTag
  20009. return c
  20010. }
  20011. // Context sets the context to be used in this call's Do method. Any
  20012. // pending HTTP request will be aborted if the provided context is
  20013. // canceled.
  20014. func (c *VideosListCall) Context(ctx context.Context) *VideosListCall {
  20015. c.ctx_ = ctx
  20016. return c
  20017. }
  20018. // Header returns an http.Header that can be modified by the caller to
  20019. // add HTTP headers to the request.
  20020. func (c *VideosListCall) Header() http.Header {
  20021. if c.header_ == nil {
  20022. c.header_ = make(http.Header)
  20023. }
  20024. return c.header_
  20025. }
  20026. func (c *VideosListCall) doRequest(alt string) (*http.Response, error) {
  20027. reqHeaders := make(http.Header)
  20028. for k, v := range c.header_ {
  20029. reqHeaders[k] = v
  20030. }
  20031. reqHeaders.Set("User-Agent", c.s.userAgent())
  20032. if c.ifNoneMatch_ != "" {
  20033. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20034. }
  20035. var body io.Reader = nil
  20036. c.urlParams_.Set("alt", alt)
  20037. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  20038. urls += "?" + c.urlParams_.Encode()
  20039. req, _ := http.NewRequest("GET", urls, body)
  20040. req.Header = reqHeaders
  20041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20042. }
  20043. // Do executes the "youtube.videos.list" call.
  20044. // Exactly one of *VideoListResponse or error will be non-nil. Any
  20045. // non-2xx status code is an error. Response headers are in either
  20046. // *VideoListResponse.ServerResponse.Header or (if a response was
  20047. // returned at all) in error.(*googleapi.Error).Header. Use
  20048. // googleapi.IsNotModified to check whether the returned error was
  20049. // because http.StatusNotModified was returned.
  20050. func (c *VideosListCall) Do(opts ...googleapi.CallOption) (*VideoListResponse, error) {
  20051. gensupport.SetOptions(c.urlParams_, opts...)
  20052. res, err := c.doRequest("json")
  20053. if res != nil && res.StatusCode == http.StatusNotModified {
  20054. if res.Body != nil {
  20055. res.Body.Close()
  20056. }
  20057. return nil, &googleapi.Error{
  20058. Code: res.StatusCode,
  20059. Header: res.Header,
  20060. }
  20061. }
  20062. if err != nil {
  20063. return nil, err
  20064. }
  20065. defer googleapi.CloseBody(res)
  20066. if err := googleapi.CheckResponse(res); err != nil {
  20067. return nil, err
  20068. }
  20069. ret := &VideoListResponse{
  20070. ServerResponse: googleapi.ServerResponse{
  20071. Header: res.Header,
  20072. HTTPStatusCode: res.StatusCode,
  20073. },
  20074. }
  20075. target := &ret
  20076. if err := gensupport.DecodeResponse(target, res); err != nil {
  20077. return nil, err
  20078. }
  20079. return ret, nil
  20080. // {
  20081. // "description": "Returns a list of videos that match the API request parameters.",
  20082. // "httpMethod": "GET",
  20083. // "id": "youtube.videos.list",
  20084. // "parameterOrder": [
  20085. // "part"
  20086. // ],
  20087. // "parameters": {
  20088. // "chart": {
  20089. // "description": "The chart parameter identifies the chart that you want to retrieve.",
  20090. // "enum": [
  20091. // "mostPopular"
  20092. // ],
  20093. // "enumDescriptions": [
  20094. // "Return the most popular videos for the specified content region and video category."
  20095. // ],
  20096. // "location": "query",
  20097. // "type": "string"
  20098. // },
  20099. // "hl": {
  20100. // "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.",
  20101. // "location": "query",
  20102. // "type": "string"
  20103. // },
  20104. // "id": {
  20105. // "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.",
  20106. // "location": "query",
  20107. // "type": "string"
  20108. // },
  20109. // "locale": {
  20110. // "description": "DEPRECATED",
  20111. // "location": "query",
  20112. // "type": "string"
  20113. // },
  20114. // "maxHeight": {
  20115. // "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.",
  20116. // "format": "uint32",
  20117. // "location": "query",
  20118. // "maximum": "8192",
  20119. // "minimum": "72",
  20120. // "type": "integer"
  20121. // },
  20122. // "maxResults": {
  20123. // "default": "5",
  20124. // "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.",
  20125. // "format": "uint32",
  20126. // "location": "query",
  20127. // "maximum": "50",
  20128. // "minimum": "1",
  20129. // "type": "integer"
  20130. // },
  20131. // "maxWidth": {
  20132. // "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.",
  20133. // "format": "uint32",
  20134. // "location": "query",
  20135. // "maximum": "8192",
  20136. // "minimum": "72",
  20137. // "type": "integer"
  20138. // },
  20139. // "myRating": {
  20140. // "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.",
  20141. // "enum": [
  20142. // "dislike",
  20143. // "like"
  20144. // ],
  20145. // "enumDescriptions": [
  20146. // "Returns only videos disliked by the authenticated user.",
  20147. // "Returns only video liked by the authenticated user."
  20148. // ],
  20149. // "location": "query",
  20150. // "type": "string"
  20151. // },
  20152. // "onBehalfOfContentOwner": {
  20153. // "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.",
  20154. // "location": "query",
  20155. // "type": "string"
  20156. // },
  20157. // "pageToken": {
  20158. // "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.",
  20159. // "location": "query",
  20160. // "type": "string"
  20161. // },
  20162. // "part": {
  20163. // "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.",
  20164. // "location": "query",
  20165. // "required": true,
  20166. // "type": "string"
  20167. // },
  20168. // "regionCode": {
  20169. // "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.",
  20170. // "location": "query",
  20171. // "type": "string"
  20172. // },
  20173. // "videoCategoryId": {
  20174. // "default": "0",
  20175. // "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.",
  20176. // "location": "query",
  20177. // "type": "string"
  20178. // }
  20179. // },
  20180. // "path": "videos",
  20181. // "response": {
  20182. // "$ref": "VideoListResponse"
  20183. // },
  20184. // "scopes": [
  20185. // "https://www.googleapis.com/auth/youtube",
  20186. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20187. // "https://www.googleapis.com/auth/youtube.readonly",
  20188. // "https://www.googleapis.com/auth/youtubepartner"
  20189. // ]
  20190. // }
  20191. }
  20192. // Pages invokes f for each page of results.
  20193. // A non-nil error returned from f will halt the iteration.
  20194. // The provided context supersedes any context provided to the Context method.
  20195. func (c *VideosListCall) Pages(ctx context.Context, f func(*VideoListResponse) error) error {
  20196. c.ctx_ = ctx
  20197. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20198. for {
  20199. x, err := c.Do()
  20200. if err != nil {
  20201. return err
  20202. }
  20203. if err := f(x); err != nil {
  20204. return err
  20205. }
  20206. if x.NextPageToken == "" {
  20207. return nil
  20208. }
  20209. c.PageToken(x.NextPageToken)
  20210. }
  20211. }
  20212. // method id "youtube.videos.rate":
  20213. type VideosRateCall struct {
  20214. s *Service
  20215. urlParams_ gensupport.URLParams
  20216. ctx_ context.Context
  20217. header_ http.Header
  20218. }
  20219. // Rate: Add a like or dislike rating to a video or remove a rating from
  20220. // a video.
  20221. func (r *VideosService) Rate(id string, rating string) *VideosRateCall {
  20222. c := &VideosRateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20223. c.urlParams_.Set("id", id)
  20224. c.urlParams_.Set("rating", rating)
  20225. return c
  20226. }
  20227. // Fields allows partial responses to be retrieved. See
  20228. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20229. // for more information.
  20230. func (c *VideosRateCall) Fields(s ...googleapi.Field) *VideosRateCall {
  20231. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20232. return c
  20233. }
  20234. // Context sets the context to be used in this call's Do method. Any
  20235. // pending HTTP request will be aborted if the provided context is
  20236. // canceled.
  20237. func (c *VideosRateCall) Context(ctx context.Context) *VideosRateCall {
  20238. c.ctx_ = ctx
  20239. return c
  20240. }
  20241. // Header returns an http.Header that can be modified by the caller to
  20242. // add HTTP headers to the request.
  20243. func (c *VideosRateCall) Header() http.Header {
  20244. if c.header_ == nil {
  20245. c.header_ = make(http.Header)
  20246. }
  20247. return c.header_
  20248. }
  20249. func (c *VideosRateCall) doRequest(alt string) (*http.Response, error) {
  20250. reqHeaders := make(http.Header)
  20251. for k, v := range c.header_ {
  20252. reqHeaders[k] = v
  20253. }
  20254. reqHeaders.Set("User-Agent", c.s.userAgent())
  20255. var body io.Reader = nil
  20256. c.urlParams_.Set("alt", alt)
  20257. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/rate")
  20258. urls += "?" + c.urlParams_.Encode()
  20259. req, _ := http.NewRequest("POST", urls, body)
  20260. req.Header = reqHeaders
  20261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20262. }
  20263. // Do executes the "youtube.videos.rate" call.
  20264. func (c *VideosRateCall) Do(opts ...googleapi.CallOption) error {
  20265. gensupport.SetOptions(c.urlParams_, opts...)
  20266. res, err := c.doRequest("json")
  20267. if err != nil {
  20268. return err
  20269. }
  20270. defer googleapi.CloseBody(res)
  20271. if err := googleapi.CheckResponse(res); err != nil {
  20272. return err
  20273. }
  20274. return nil
  20275. // {
  20276. // "description": "Add a like or dislike rating to a video or remove a rating from a video.",
  20277. // "httpMethod": "POST",
  20278. // "id": "youtube.videos.rate",
  20279. // "parameterOrder": [
  20280. // "id",
  20281. // "rating"
  20282. // ],
  20283. // "parameters": {
  20284. // "id": {
  20285. // "description": "The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.",
  20286. // "location": "query",
  20287. // "required": true,
  20288. // "type": "string"
  20289. // },
  20290. // "rating": {
  20291. // "description": "Specifies the rating to record.",
  20292. // "enum": [
  20293. // "dislike",
  20294. // "like",
  20295. // "none"
  20296. // ],
  20297. // "enumDescriptions": [
  20298. // "Records that the authenticated user disliked the video.",
  20299. // "Records that the authenticated user liked the video.",
  20300. // "Removes any rating that the authenticated user had previously set for the video."
  20301. // ],
  20302. // "location": "query",
  20303. // "required": true,
  20304. // "type": "string"
  20305. // }
  20306. // },
  20307. // "path": "videos/rate",
  20308. // "scopes": [
  20309. // "https://www.googleapis.com/auth/youtube",
  20310. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20311. // "https://www.googleapis.com/auth/youtubepartner"
  20312. // ]
  20313. // }
  20314. }
  20315. // method id "youtube.videos.reportAbuse":
  20316. type VideosReportAbuseCall struct {
  20317. s *Service
  20318. videoabusereport *VideoAbuseReport
  20319. urlParams_ gensupport.URLParams
  20320. ctx_ context.Context
  20321. header_ http.Header
  20322. }
  20323. // ReportAbuse: Report abuse for a video.
  20324. func (r *VideosService) ReportAbuse(videoabusereport *VideoAbuseReport) *VideosReportAbuseCall {
  20325. c := &VideosReportAbuseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20326. c.videoabusereport = videoabusereport
  20327. return c
  20328. }
  20329. // OnBehalfOfContentOwner sets the optional parameter
  20330. // "onBehalfOfContentOwner": Note: This parameter is intended
  20331. // exclusively for YouTube content partners.
  20332. //
  20333. // The onBehalfOfContentOwner parameter indicates that the request's
  20334. // authorization credentials identify a YouTube CMS user who is acting
  20335. // on behalf of the content owner specified in the parameter value. This
  20336. // parameter is intended for YouTube content partners that own and
  20337. // manage many different YouTube channels. It allows content owners to
  20338. // authenticate once and get access to all their video and channel data,
  20339. // without having to provide authentication credentials for each
  20340. // individual channel. The CMS account that the user authenticates with
  20341. // must be linked to the specified YouTube content owner.
  20342. func (c *VideosReportAbuseCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosReportAbuseCall {
  20343. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20344. return c
  20345. }
  20346. // Fields allows partial responses to be retrieved. See
  20347. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20348. // for more information.
  20349. func (c *VideosReportAbuseCall) Fields(s ...googleapi.Field) *VideosReportAbuseCall {
  20350. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20351. return c
  20352. }
  20353. // Context sets the context to be used in this call's Do method. Any
  20354. // pending HTTP request will be aborted if the provided context is
  20355. // canceled.
  20356. func (c *VideosReportAbuseCall) Context(ctx context.Context) *VideosReportAbuseCall {
  20357. c.ctx_ = ctx
  20358. return c
  20359. }
  20360. // Header returns an http.Header that can be modified by the caller to
  20361. // add HTTP headers to the request.
  20362. func (c *VideosReportAbuseCall) Header() http.Header {
  20363. if c.header_ == nil {
  20364. c.header_ = make(http.Header)
  20365. }
  20366. return c.header_
  20367. }
  20368. func (c *VideosReportAbuseCall) doRequest(alt string) (*http.Response, error) {
  20369. reqHeaders := make(http.Header)
  20370. for k, v := range c.header_ {
  20371. reqHeaders[k] = v
  20372. }
  20373. reqHeaders.Set("User-Agent", c.s.userAgent())
  20374. var body io.Reader = nil
  20375. body, err := googleapi.WithoutDataWrapper.JSONReader(c.videoabusereport)
  20376. if err != nil {
  20377. return nil, err
  20378. }
  20379. reqHeaders.Set("Content-Type", "application/json")
  20380. c.urlParams_.Set("alt", alt)
  20381. urls := googleapi.ResolveRelative(c.s.BasePath, "videos/reportAbuse")
  20382. urls += "?" + c.urlParams_.Encode()
  20383. req, _ := http.NewRequest("POST", urls, body)
  20384. req.Header = reqHeaders
  20385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20386. }
  20387. // Do executes the "youtube.videos.reportAbuse" call.
  20388. func (c *VideosReportAbuseCall) Do(opts ...googleapi.CallOption) error {
  20389. gensupport.SetOptions(c.urlParams_, opts...)
  20390. res, err := c.doRequest("json")
  20391. if err != nil {
  20392. return err
  20393. }
  20394. defer googleapi.CloseBody(res)
  20395. if err := googleapi.CheckResponse(res); err != nil {
  20396. return err
  20397. }
  20398. return nil
  20399. // {
  20400. // "description": "Report abuse for a video.",
  20401. // "httpMethod": "POST",
  20402. // "id": "youtube.videos.reportAbuse",
  20403. // "parameters": {
  20404. // "onBehalfOfContentOwner": {
  20405. // "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.",
  20406. // "location": "query",
  20407. // "type": "string"
  20408. // }
  20409. // },
  20410. // "path": "videos/reportAbuse",
  20411. // "request": {
  20412. // "$ref": "VideoAbuseReport"
  20413. // },
  20414. // "scopes": [
  20415. // "https://www.googleapis.com/auth/youtube",
  20416. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20417. // "https://www.googleapis.com/auth/youtubepartner"
  20418. // ]
  20419. // }
  20420. }
  20421. // method id "youtube.videos.update":
  20422. type VideosUpdateCall struct {
  20423. s *Service
  20424. video *Video
  20425. urlParams_ gensupport.URLParams
  20426. ctx_ context.Context
  20427. header_ http.Header
  20428. }
  20429. // Update: Updates a video's metadata.
  20430. func (r *VideosService) Update(part string, video *Video) *VideosUpdateCall {
  20431. c := &VideosUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20432. c.urlParams_.Set("part", part)
  20433. c.video = video
  20434. return c
  20435. }
  20436. // OnBehalfOfContentOwner sets the optional parameter
  20437. // "onBehalfOfContentOwner": Note: This parameter is intended
  20438. // exclusively for YouTube content partners.
  20439. //
  20440. // The onBehalfOfContentOwner parameter indicates that the request's
  20441. // authorization credentials identify a YouTube CMS user who is acting
  20442. // on behalf of the content owner specified in the parameter value. This
  20443. // parameter is intended for YouTube content partners that own and
  20444. // manage many different YouTube channels. It allows content owners to
  20445. // authenticate once and get access to all their video and channel data,
  20446. // without having to provide authentication credentials for each
  20447. // individual channel. The actual CMS account that the user
  20448. // authenticates with must be linked to the specified YouTube content
  20449. // owner.
  20450. func (c *VideosUpdateCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *VideosUpdateCall {
  20451. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20452. return c
  20453. }
  20454. // Fields allows partial responses to be retrieved. See
  20455. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20456. // for more information.
  20457. func (c *VideosUpdateCall) Fields(s ...googleapi.Field) *VideosUpdateCall {
  20458. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20459. return c
  20460. }
  20461. // Context sets the context to be used in this call's Do method. Any
  20462. // pending HTTP request will be aborted if the provided context is
  20463. // canceled.
  20464. func (c *VideosUpdateCall) Context(ctx context.Context) *VideosUpdateCall {
  20465. c.ctx_ = ctx
  20466. return c
  20467. }
  20468. // Header returns an http.Header that can be modified by the caller to
  20469. // add HTTP headers to the request.
  20470. func (c *VideosUpdateCall) Header() http.Header {
  20471. if c.header_ == nil {
  20472. c.header_ = make(http.Header)
  20473. }
  20474. return c.header_
  20475. }
  20476. func (c *VideosUpdateCall) doRequest(alt string) (*http.Response, error) {
  20477. reqHeaders := make(http.Header)
  20478. for k, v := range c.header_ {
  20479. reqHeaders[k] = v
  20480. }
  20481. reqHeaders.Set("User-Agent", c.s.userAgent())
  20482. var body io.Reader = nil
  20483. body, err := googleapi.WithoutDataWrapper.JSONReader(c.video)
  20484. if err != nil {
  20485. return nil, err
  20486. }
  20487. reqHeaders.Set("Content-Type", "application/json")
  20488. c.urlParams_.Set("alt", alt)
  20489. urls := googleapi.ResolveRelative(c.s.BasePath, "videos")
  20490. urls += "?" + c.urlParams_.Encode()
  20491. req, _ := http.NewRequest("PUT", urls, body)
  20492. req.Header = reqHeaders
  20493. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20494. }
  20495. // Do executes the "youtube.videos.update" call.
  20496. // Exactly one of *Video or error will be non-nil. Any non-2xx status
  20497. // code is an error. Response headers are in either
  20498. // *Video.ServerResponse.Header or (if a response was returned at all)
  20499. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  20500. // check whether the returned error was because http.StatusNotModified
  20501. // was returned.
  20502. func (c *VideosUpdateCall) Do(opts ...googleapi.CallOption) (*Video, error) {
  20503. gensupport.SetOptions(c.urlParams_, opts...)
  20504. res, err := c.doRequest("json")
  20505. if res != nil && res.StatusCode == http.StatusNotModified {
  20506. if res.Body != nil {
  20507. res.Body.Close()
  20508. }
  20509. return nil, &googleapi.Error{
  20510. Code: res.StatusCode,
  20511. Header: res.Header,
  20512. }
  20513. }
  20514. if err != nil {
  20515. return nil, err
  20516. }
  20517. defer googleapi.CloseBody(res)
  20518. if err := googleapi.CheckResponse(res); err != nil {
  20519. return nil, err
  20520. }
  20521. ret := &Video{
  20522. ServerResponse: googleapi.ServerResponse{
  20523. Header: res.Header,
  20524. HTTPStatusCode: res.StatusCode,
  20525. },
  20526. }
  20527. target := &ret
  20528. if err := gensupport.DecodeResponse(target, res); err != nil {
  20529. return nil, err
  20530. }
  20531. return ret, nil
  20532. // {
  20533. // "description": "Updates a video's metadata.",
  20534. // "httpMethod": "PUT",
  20535. // "id": "youtube.videos.update",
  20536. // "parameterOrder": [
  20537. // "part"
  20538. // ],
  20539. // "parameters": {
  20540. // "onBehalfOfContentOwner": {
  20541. // "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.",
  20542. // "location": "query",
  20543. // "type": "string"
  20544. // },
  20545. // "part": {
  20546. // "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.",
  20547. // "location": "query",
  20548. // "required": true,
  20549. // "type": "string"
  20550. // }
  20551. // },
  20552. // "path": "videos",
  20553. // "request": {
  20554. // "$ref": "Video"
  20555. // },
  20556. // "response": {
  20557. // "$ref": "Video"
  20558. // },
  20559. // "scopes": [
  20560. // "https://www.googleapis.com/auth/youtube",
  20561. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20562. // "https://www.googleapis.com/auth/youtubepartner"
  20563. // ]
  20564. // }
  20565. }
  20566. // method id "youtube.watermarks.set":
  20567. type WatermarksSetCall struct {
  20568. s *Service
  20569. invideobranding *InvideoBranding
  20570. urlParams_ gensupport.URLParams
  20571. mediaInfo_ *gensupport.MediaInfo
  20572. ctx_ context.Context
  20573. header_ http.Header
  20574. }
  20575. // Set: Uploads a watermark image to YouTube and sets it for a channel.
  20576. func (r *WatermarksService) Set(channelId string, invideobranding *InvideoBranding) *WatermarksSetCall {
  20577. c := &WatermarksSetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20578. c.urlParams_.Set("channelId", channelId)
  20579. c.invideobranding = invideobranding
  20580. return c
  20581. }
  20582. // OnBehalfOfContentOwner sets the optional parameter
  20583. // "onBehalfOfContentOwner": Note: This parameter is intended
  20584. // exclusively for YouTube content partners.
  20585. //
  20586. // The onBehalfOfContentOwner parameter indicates that the request's
  20587. // authorization credentials identify a YouTube CMS user who is acting
  20588. // on behalf of the content owner specified in the parameter value. This
  20589. // parameter is intended for YouTube content partners that own and
  20590. // manage many different YouTube channels. It allows content owners to
  20591. // authenticate once and get access to all their video and channel data,
  20592. // without having to provide authentication credentials for each
  20593. // individual channel. The CMS account that the user authenticates with
  20594. // must be linked to the specified YouTube content owner.
  20595. func (c *WatermarksSetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksSetCall {
  20596. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20597. return c
  20598. }
  20599. // Media specifies the media to upload in one or more chunks. The chunk
  20600. // size may be controlled by supplying a MediaOption generated by
  20601. // googleapi.ChunkSize. The chunk size defaults to
  20602. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  20603. // upload request will be determined by sniffing the contents of r,
  20604. // unless a MediaOption generated by googleapi.ContentType is
  20605. // supplied.
  20606. // At most one of Media and ResumableMedia may be set.
  20607. func (c *WatermarksSetCall) Media(r io.Reader, options ...googleapi.MediaOption) *WatermarksSetCall {
  20608. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  20609. return c
  20610. }
  20611. // ResumableMedia specifies the media to upload in chunks and can be
  20612. // canceled with ctx.
  20613. //
  20614. // Deprecated: use Media instead.
  20615. //
  20616. // At most one of Media and ResumableMedia may be set. mediaType
  20617. // identifies the MIME media type of the upload, such as "image/png". If
  20618. // mediaType is "", it will be auto-detected. The provided ctx will
  20619. // supersede any context previously provided to the Context method.
  20620. func (c *WatermarksSetCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *WatermarksSetCall {
  20621. c.ctx_ = ctx
  20622. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  20623. return c
  20624. }
  20625. // ProgressUpdater provides a callback function that will be called
  20626. // after every chunk. It should be a low-latency function in order to
  20627. // not slow down the upload operation. This should only be called when
  20628. // using ResumableMedia (as opposed to Media).
  20629. func (c *WatermarksSetCall) ProgressUpdater(pu googleapi.ProgressUpdater) *WatermarksSetCall {
  20630. c.mediaInfo_.SetProgressUpdater(pu)
  20631. return c
  20632. }
  20633. // Fields allows partial responses to be retrieved. See
  20634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20635. // for more information.
  20636. func (c *WatermarksSetCall) Fields(s ...googleapi.Field) *WatermarksSetCall {
  20637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20638. return c
  20639. }
  20640. // Context sets the context to be used in this call's Do method. Any
  20641. // pending HTTP request will be aborted if the provided context is
  20642. // canceled.
  20643. // This context will supersede any context previously provided to the
  20644. // ResumableMedia method.
  20645. func (c *WatermarksSetCall) Context(ctx context.Context) *WatermarksSetCall {
  20646. c.ctx_ = ctx
  20647. return c
  20648. }
  20649. // Header returns an http.Header that can be modified by the caller to
  20650. // add HTTP headers to the request.
  20651. func (c *WatermarksSetCall) Header() http.Header {
  20652. if c.header_ == nil {
  20653. c.header_ = make(http.Header)
  20654. }
  20655. return c.header_
  20656. }
  20657. func (c *WatermarksSetCall) doRequest(alt string) (*http.Response, error) {
  20658. reqHeaders := make(http.Header)
  20659. for k, v := range c.header_ {
  20660. reqHeaders[k] = v
  20661. }
  20662. reqHeaders.Set("User-Agent", c.s.userAgent())
  20663. var body io.Reader = nil
  20664. body, err := googleapi.WithoutDataWrapper.JSONReader(c.invideobranding)
  20665. if err != nil {
  20666. return nil, err
  20667. }
  20668. reqHeaders.Set("Content-Type", "application/json")
  20669. c.urlParams_.Set("alt", alt)
  20670. urls := googleapi.ResolveRelative(c.s.BasePath, "watermarks/set")
  20671. if c.mediaInfo_ != nil {
  20672. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  20673. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  20674. }
  20675. if body == nil {
  20676. body = new(bytes.Buffer)
  20677. reqHeaders.Set("Content-Type", "application/json")
  20678. }
  20679. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  20680. defer cleanup()
  20681. urls += "?" + c.urlParams_.Encode()
  20682. req, _ := http.NewRequest("POST", urls, body)
  20683. req.Header = reqHeaders
  20684. gensupport.SetGetBody(req, getBody)
  20685. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20686. }
  20687. // Do executes the "youtube.watermarks.set" call.
  20688. func (c *WatermarksSetCall) Do(opts ...googleapi.CallOption) error {
  20689. gensupport.SetOptions(c.urlParams_, opts...)
  20690. res, err := c.doRequest("json")
  20691. if err != nil {
  20692. return err
  20693. }
  20694. defer googleapi.CloseBody(res)
  20695. if err := googleapi.CheckResponse(res); err != nil {
  20696. return err
  20697. }
  20698. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  20699. if rx != nil {
  20700. rx.Client = c.s.client
  20701. rx.UserAgent = c.s.userAgent()
  20702. ctx := c.ctx_
  20703. if ctx == nil {
  20704. ctx = context.TODO()
  20705. }
  20706. res, err = rx.Upload(ctx)
  20707. if err != nil {
  20708. return err
  20709. }
  20710. defer res.Body.Close()
  20711. if err := googleapi.CheckResponse(res); err != nil {
  20712. return err
  20713. }
  20714. }
  20715. return nil
  20716. // {
  20717. // "description": "Uploads a watermark image to YouTube and sets it for a channel.",
  20718. // "httpMethod": "POST",
  20719. // "id": "youtube.watermarks.set",
  20720. // "mediaUpload": {
  20721. // "accept": [
  20722. // "application/octet-stream",
  20723. // "image/jpeg",
  20724. // "image/png"
  20725. // ],
  20726. // "maxSize": "10MB",
  20727. // "protocols": {
  20728. // "resumable": {
  20729. // "multipart": true,
  20730. // "path": "/resumable/upload/youtube/v3/watermarks/set"
  20731. // },
  20732. // "simple": {
  20733. // "multipart": true,
  20734. // "path": "/upload/youtube/v3/watermarks/set"
  20735. // }
  20736. // }
  20737. // },
  20738. // "parameterOrder": [
  20739. // "channelId"
  20740. // ],
  20741. // "parameters": {
  20742. // "channelId": {
  20743. // "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being provided.",
  20744. // "location": "query",
  20745. // "required": true,
  20746. // "type": "string"
  20747. // },
  20748. // "onBehalfOfContentOwner": {
  20749. // "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.",
  20750. // "location": "query",
  20751. // "type": "string"
  20752. // }
  20753. // },
  20754. // "path": "watermarks/set",
  20755. // "request": {
  20756. // "$ref": "InvideoBranding"
  20757. // },
  20758. // "scopes": [
  20759. // "https://www.googleapis.com/auth/youtube",
  20760. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20761. // "https://www.googleapis.com/auth/youtube.upload",
  20762. // "https://www.googleapis.com/auth/youtubepartner"
  20763. // ],
  20764. // "supportsMediaUpload": true
  20765. // }
  20766. }
  20767. // method id "youtube.watermarks.unset":
  20768. type WatermarksUnsetCall struct {
  20769. s *Service
  20770. urlParams_ gensupport.URLParams
  20771. ctx_ context.Context
  20772. header_ http.Header
  20773. }
  20774. // Unset: Deletes a channel's watermark image.
  20775. func (r *WatermarksService) Unset(channelId string) *WatermarksUnsetCall {
  20776. c := &WatermarksUnsetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20777. c.urlParams_.Set("channelId", channelId)
  20778. return c
  20779. }
  20780. // OnBehalfOfContentOwner sets the optional parameter
  20781. // "onBehalfOfContentOwner": Note: This parameter is intended
  20782. // exclusively for YouTube content partners.
  20783. //
  20784. // The onBehalfOfContentOwner parameter indicates that the request's
  20785. // authorization credentials identify a YouTube CMS user who is acting
  20786. // on behalf of the content owner specified in the parameter value. This
  20787. // parameter is intended for YouTube content partners that own and
  20788. // manage many different YouTube channels. It allows content owners to
  20789. // authenticate once and get access to all their video and channel data,
  20790. // without having to provide authentication credentials for each
  20791. // individual channel. The CMS account that the user authenticates with
  20792. // must be linked to the specified YouTube content owner.
  20793. func (c *WatermarksUnsetCall) OnBehalfOfContentOwner(onBehalfOfContentOwner string) *WatermarksUnsetCall {
  20794. c.urlParams_.Set("onBehalfOfContentOwner", onBehalfOfContentOwner)
  20795. return c
  20796. }
  20797. // Fields allows partial responses to be retrieved. See
  20798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20799. // for more information.
  20800. func (c *WatermarksUnsetCall) Fields(s ...googleapi.Field) *WatermarksUnsetCall {
  20801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20802. return c
  20803. }
  20804. // Context sets the context to be used in this call's Do method. Any
  20805. // pending HTTP request will be aborted if the provided context is
  20806. // canceled.
  20807. func (c *WatermarksUnsetCall) Context(ctx context.Context) *WatermarksUnsetCall {
  20808. c.ctx_ = ctx
  20809. return c
  20810. }
  20811. // Header returns an http.Header that can be modified by the caller to
  20812. // add HTTP headers to the request.
  20813. func (c *WatermarksUnsetCall) Header() http.Header {
  20814. if c.header_ == nil {
  20815. c.header_ = make(http.Header)
  20816. }
  20817. return c.header_
  20818. }
  20819. func (c *WatermarksUnsetCall) doRequest(alt string) (*http.Response, error) {
  20820. reqHeaders := make(http.Header)
  20821. for k, v := range c.header_ {
  20822. reqHeaders[k] = v
  20823. }
  20824. reqHeaders.Set("User-Agent", c.s.userAgent())
  20825. var body io.Reader = nil
  20826. c.urlParams_.Set("alt", alt)
  20827. urls := googleapi.ResolveRelative(c.s.BasePath, "watermarks/unset")
  20828. urls += "?" + c.urlParams_.Encode()
  20829. req, _ := http.NewRequest("POST", urls, body)
  20830. req.Header = reqHeaders
  20831. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20832. }
  20833. // Do executes the "youtube.watermarks.unset" call.
  20834. func (c *WatermarksUnsetCall) Do(opts ...googleapi.CallOption) error {
  20835. gensupport.SetOptions(c.urlParams_, opts...)
  20836. res, err := c.doRequest("json")
  20837. if err != nil {
  20838. return err
  20839. }
  20840. defer googleapi.CloseBody(res)
  20841. if err := googleapi.CheckResponse(res); err != nil {
  20842. return err
  20843. }
  20844. return nil
  20845. // {
  20846. // "description": "Deletes a channel's watermark image.",
  20847. // "httpMethod": "POST",
  20848. // "id": "youtube.watermarks.unset",
  20849. // "parameterOrder": [
  20850. // "channelId"
  20851. // ],
  20852. // "parameters": {
  20853. // "channelId": {
  20854. // "description": "The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.",
  20855. // "location": "query",
  20856. // "required": true,
  20857. // "type": "string"
  20858. // },
  20859. // "onBehalfOfContentOwner": {
  20860. // "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.",
  20861. // "location": "query",
  20862. // "type": "string"
  20863. // }
  20864. // },
  20865. // "path": "watermarks/unset",
  20866. // "scopes": [
  20867. // "https://www.googleapis.com/auth/youtube",
  20868. // "https://www.googleapis.com/auth/youtube.force-ssl",
  20869. // "https://www.googleapis.com/auth/youtubepartner"
  20870. // ]
  20871. // }
  20872. }