Skip to content

Instantly share code, notes, and snippets.

@mhawksey
Last active September 15, 2022 16:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mhawksey/42625e5ea3dcd4cb85cc63eb421f06db to your computer and use it in GitHub Desktop.
Save mhawksey/42625e5ea3dcd4cb85cc63eb421f06db to your computer and use it in GitHub Desktop.
YouTube API for Google Apps Script
/**
* Google Apps Script Library for the youtube API
*
* Documentation can be found:
* https://developers.google.com/youtube/v3
*
* OAuth2 Scopes
* https://www.googleapis.com/auth/youtube
* https://www.googleapis.com/auth/youtube.force-ssl
* https://www.googleapis.com/auth/youtube.readonly
* https://www.googleapis.com/auth/youtube.upload
* https://www.googleapis.com/auth/youtubepartner
* https://www.googleapis.com/auth/youtubepartner-channel-audit
*/
var BASEURL_="https://www.googleapis.com/youtube/v3/";
var tokenService_;
/*
* Stores the function passed that is invoked to get a OAuth2 token;
* @param {function} service The function used to get the OAuth2 token;
*
*/
function setTokenService(service){
tokenService_ = service;
}
/*
* Returns an OAuth2 token from your TokenService as a test
* @return {string} An OAuth2 token
*
*/
function testTokenService(){
return tokenService_();
}
/**
* Performs a Fetch
* @param {string} url The endpoint for the URL with parameters
* @param {Object.<string, string>} options Options to override default fetch options
* @returns {Object.<string,string>} the fetch results
* @private
*/
function CALL_(path,options){
var fetchOptions = {method:"",muteHttpExceptions:true, contentType:"application/json", headers:{Authorization:"Bearer "+tokenService_()}}
var url = BASEURL_ + path;
for(option in options){
fetchOptions[option] = options[option];
}
var response = UrlFetchApp.fetch(url, fetchOptions)
if(response.getResponseCode() != 200){
throw new Error(response.getContentText())
}else{
return JSON.parse(response.getContentText());
}
}
/**
* Performs a Fetch and accumulation using pageToken parameter of the returned results
* @param {string} url The endpoint for the URL with parameters
* @param {Object.<string, string>} options Options to override default fetch options
* @param {string} returnParamPath The path of the parameter to be accumulated
* @returns {Array.Object.<string,string>} An array of objects
* @private
*/
function CALLPAGE_(path,options, returnParamPath){
var fetchOptions = {method:"",muteHttpExceptions:true, contentType:"application/json", headers:{Authorization:"Bearer "+tokenService_()}}
for(option in options){
fetchOptions[option] = options[option];
}
var url = BASEURL_ + path;
var returnArray = [];
var nextPageToken;
do{
if(nextPageToken){
url += "?pageToken=" + nextPageToken;
}
var results = UrlFetchApp.fetch(url, fetchOptions);
if(results.getResponseCode() != 200){
throw new Error(results.getContentText());
}else{
var resp = JSON.parse(results.getContentText())
nextPageToken = resp.nextPageToken;
returnArray = returnArray.concat(resp[returnParamPath])
}
}while(nextPageToken);
return returnArray;
}
/**
* Builds a complete URL from a base URL and a map of URL parameters. Written by Eric Koleda in the OAuth2 library
* @param {string} url The base URL.
* @param {Object.<string, string>} params The URL parameters and values.
* @returns {string} The complete URL.
* @private
*/
function buildUrl_(url, params) {
var params = params || {}; //allow for NULL options
var paramString = Object.keys(params).map(function(key) {
return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]);
}).join('&');
return url + (url.indexOf('?') >= 0 ? '&' : '?') + paramString;
}
/**
* Posts a bulletin for a specific channel. (The user submitting the request must be authorized to act on the channel's behalf.)
Note: 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.
*
* @param {string} part 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.
* @param {object} ActivityResource An object containing the ActivityResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ActivityResource object
*/
function activitiesInsert(part,ActivityResource,options){
var path = buildUrl_("activities",options);
var callOptions = {method:"POST",payload:JSON.stringify(ActivityResource)};
var ActivityResource = CALL_(path,callOptions);
return ActivityResource;
}
/**
* 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.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more activity resource properties that the API response will include.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ActivityListResponseResource object
*/
function activitiesList(part,options){
var path = buildUrl_("activities",options);
var callOptions = {method:"GET"};
var ActivityListResponseItems = CALLPAGE_(path,callOptions,"items");
return ActivityListResponseItems;
}
/**
* Deletes a specified caption track.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function captionsDelete(id,options){
var path = buildUrl_("captions",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* 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.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function captionsDownload(id,options){
var path = buildUrl_("captions/"+id,options);
var callOptions = {method:"GET"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Uploads a caption track.
*
* @param {string} part The part parameter specifies the caption resource parts that the API response will include. Set the parameter value to snippet.
* @param {object} CaptionResource An object containing the CaptionResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CaptionResource object
*/
function captionsInsert(part,CaptionResource,options){
var path = buildUrl_("captions",options);
var callOptions = {method:"POST",payload:JSON.stringify(CaptionResource)};
var CaptionResource = CALL_(path,callOptions);
return CaptionResource;
}
/**
* 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.
*
* @param {string} part 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.
* @param {string} videoId The videoId parameter specifies the YouTube video ID of the video for which the API should return caption tracks.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CaptionListResponseResource object
*/
function captionsList(part,videoId,options){
var path = buildUrl_("captions",options);
var callOptions = {method:"GET"};
var CaptionListResponseResource = CALL_(path,callOptions);
return CaptionListResponseResource;
}
/**
* 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.
*
* @param {string} part 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.
* @param {object} CaptionResource An object containing the CaptionResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CaptionResource object
*/
function captionsUpdate(part,CaptionResource,options){
var path = buildUrl_("captions",options);
var callOptions = {method:"PUT",payload:JSON.stringify(CaptionResource)};
var CaptionResource = CALL_(path,callOptions);
return CaptionResource;
}
/**
* 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:
- 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.
- Extract the url property's value from the response that the API returns for step 1.
- 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.
*
* @param {object} ChannelBannerResourceResource An object containing the ChannelBannerResourceResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ChannelBannerResourceResource object
*/
function channelBannersInsert(ChannelBannerResourceResource,options){
var path = buildUrl_("channelBanners/insert",options);
var callOptions = {method:"POST",payload:JSON.stringify(ChannelBannerResourceResource)};
var ChannelBannerResourceResource = CALL_(path,callOptions);
return ChannelBannerResourceResource;
}
/**
* Deletes a channelSection.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function channelSectionsDelete(id,options){
var path = buildUrl_("channelSections",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Adds a channelSection for the authenticated user's channel.
*
* @param {string} part 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.
The part names that you can include in the parameter value are snippet and contentDetails.
* @param {object} ChannelSectionResource An object containing the ChannelSectionResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ChannelSectionResource object
*/
function channelSectionsInsert(part,ChannelSectionResource,options){
var path = buildUrl_("channelSections",options);
var callOptions = {method:"POST",payload:JSON.stringify(ChannelSectionResource)};
var ChannelSectionResource = CALL_(path,callOptions);
return ChannelSectionResource;
}
/**
* Returns channelSection resources that match the API request criteria.
*
* @param {string} part 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.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ChannelSectionListResponseResource object
*/
function channelSectionsList(part,options){
var path = buildUrl_("channelSections",options);
var callOptions = {method:"GET"};
var ChannelSectionListResponseResource = CALL_(path,callOptions);
return ChannelSectionListResponseResource;
}
/**
* Update a channelSection.
*
* @param {string} part 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.
The part names that you can include in the parameter value are snippet and contentDetails.
* @param {object} ChannelSectionResource An object containing the ChannelSectionResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ChannelSectionResource object
*/
function channelSectionsUpdate(part,ChannelSectionResource,options){
var path = buildUrl_("channelSections",options);
var callOptions = {method:"PUT",payload:JSON.stringify(ChannelSectionResource)};
var ChannelSectionResource = CALL_(path,callOptions);
return ChannelSectionResource;
}
/**
* Returns a collection of zero or more channel resources that match the request criteria.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more channel resource properties that the API response will include.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ChannelListResponseResource object
*/
function channelsList(part,options){
var path = buildUrl_("channels",options);
var callOptions = {method:"GET"};
var ChannelListResponseItems = CALLPAGE_(path,callOptions,"items");
return ChannelListResponseItems;
}
/**
* 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.
*
* @param {string} part 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.
The 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.)
Note that this method overrides the existing values for all of the mutable properties that are contained in any parts that the parameter value specifies.
* @param {object} ChannelResource An object containing the ChannelResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ChannelResource object
*/
function channelsUpdate(part,ChannelResource,options){
var path = buildUrl_("channels",options);
var callOptions = {method:"PUT",payload:JSON.stringify(ChannelResource)};
var ChannelResource = CALL_(path,callOptions);
return ChannelResource;
}
/**
* Creates a new top-level comment. To add a reply to an existing comment, use the comments.insert method instead.
*
* @param {string} part 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.
* @param {object} CommentThreadResource An object containing the CommentThreadResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CommentThreadResource object
*/
function commentThreadsInsert(part,CommentThreadResource,options){
var path = buildUrl_("commentThreads",options);
var callOptions = {method:"POST",payload:JSON.stringify(CommentThreadResource)};
var CommentThreadResource = CALL_(path,callOptions);
return CommentThreadResource;
}
/**
* Returns a list of comment threads that match the API request parameters.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more commentThread resource properties that the API response will include.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CommentThreadListResponseResource object
*/
function commentThreadsList(part,options){
var path = buildUrl_("commentThreads",options);
var callOptions = {method:"GET"};
var CommentThreadListResponseItems = CALLPAGE_(path,callOptions,"items");
return CommentThreadListResponseItems;
}
/**
* Modifies the top-level comment in a comment thread.
*
* @param {string} part 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.
* @param {object} CommentThreadResource An object containing the CommentThreadResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CommentThreadResource object
*/
function commentThreadsUpdate(part,CommentThreadResource,options){
var path = buildUrl_("commentThreads",options);
var callOptions = {method:"PUT",payload:JSON.stringify(CommentThreadResource)};
var CommentThreadResource = CALL_(path,callOptions);
return CommentThreadResource;
}
/**
* Deletes a comment.
*
* @param {string} id The id parameter specifies the comment ID for the resource that is being deleted.
* @param {object} options Keypair of all optional parameters for this call
*/
function commentsDelete(id,options){
var path = buildUrl_("comments",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Creates a reply to an existing comment. Note: To create a top-level comment, use the commentThreads.insert method.
*
* @param {string} part 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.
* @param {object} CommentResource An object containing the CommentResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CommentResource object
*/
function commentsInsert(part,CommentResource,options){
var path = buildUrl_("comments",options);
var callOptions = {method:"POST",payload:JSON.stringify(CommentResource)};
var CommentResource = CALL_(path,callOptions);
return CommentResource;
}
/**
* Returns a list of comments that match the API request parameters.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CommentListResponseResource object
*/
function commentsList(part,options){
var path = buildUrl_("comments",options);
var callOptions = {method:"GET"};
var CommentListResponseItems = CALLPAGE_(path,callOptions,"items");
return CommentListResponseItems;
}
/**
* Expresses the caller's opinion that one or more comments should be flagged as spam.
*
* @param {string} id The id parameter specifies a comma-separated list of IDs of comments that the caller believes should be classified as spam.
* @param {object} options Keypair of all optional parameters for this call
*/
function commentsMarkAsSpam(id,options){
var path = buildUrl_("comments/markAsSpam",options);
var callOptions = {method:"POST"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* 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.
*
* @param {string} id The id parameter specifies a comma-separated list of IDs that identify the comments for which you are updating the moderation status.
* @param {string} moderationStatus Identifies the new moderation status of the specified comments.
* @param {object} options Keypair of all optional parameters for this call
*/
function commentsSetModerationStatus(id,moderationStatus,options){
var path = buildUrl_("comments/setModerationStatus",options);
var callOptions = {method:"POST"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Modifies a comment.
*
* @param {string} part 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.
* @param {object} CommentResource An object containing the CommentResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned CommentResource object
*/
function commentsUpdate(part,CommentResource,options){
var path = buildUrl_("comments",options);
var callOptions = {method:"PUT",payload:JSON.stringify(CommentResource)};
var CommentResource = CALL_(path,callOptions);
return CommentResource;
}
/**
* Lists fan funding events for a channel.
*
* @param {string} part The part parameter specifies the fanFundingEvent resource parts that the API response will include. Supported values are id and snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned FanFundingEventListResponseResource object
*/
function fanFundingEventsList(part,options){
var path = buildUrl_("fanFundingEvents",options);
var callOptions = {method:"GET"};
var FanFundingEventListResponseItems = CALLPAGE_(path,callOptions,"items");
return FanFundingEventListResponseItems;
}
/**
* Returns a list of categories that can be associated with YouTube channels.
*
* @param {string} part The part parameter specifies the guideCategory resource properties that the API response will include. Set the parameter value to snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned GuideCategoryListResponseResource object
*/
function guideCategoriesList(part,options){
var path = buildUrl_("guideCategories",options);
var callOptions = {method:"GET"};
var GuideCategoryListResponseResource = CALL_(path,callOptions);
return GuideCategoryListResponseResource;
}
/**
* Returns a list of application languages that the YouTube website supports.
*
* @param {string} part The part parameter specifies the i18nLanguage resource properties that the API response will include. Set the parameter value to snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned I18nLanguageListResponseResource object
*/
function i18nLanguagesList(part,options){
var path = buildUrl_("i18nLanguages",options);
var callOptions = {method:"GET"};
var I18nLanguageListResponseResource = CALL_(path,callOptions);
return I18nLanguageListResponseResource;
}
/**
* Returns a list of content regions that the YouTube website supports.
*
* @param {string} part The part parameter specifies the i18nRegion resource properties that the API response will include. Set the parameter value to snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned I18nRegionListResponseResource object
*/
function i18nRegionsList(part,options){
var path = buildUrl_("i18nRegions",options);
var callOptions = {method:"GET"};
var I18nRegionListResponseResource = CALL_(path,callOptions);
return I18nRegionListResponseResource;
}
/**
* 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.
*
* @param {string} id The id parameter specifies the unique ID of the broadcast that is being bound to a video stream.
* @param {string} part 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveBroadcastResource object
*/
function liveBroadcastsBind(id,part,options){
var path = buildUrl_("liveBroadcasts/bind",options);
var callOptions = {method:"POST"};
var LiveBroadcastResource = CALL_(path,callOptions);
return LiveBroadcastResource;
}
/**
* Controls the settings for a slate that can be displayed in the broadcast stream.
*
* @param {string} id The id parameter specifies the YouTube live broadcast ID that uniquely identifies the broadcast in which the slate is being updated.
* @param {string} part 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveBroadcastResource object
*/
function liveBroadcastsControl(id,part,options){
var path = buildUrl_("liveBroadcasts/control",options);
var callOptions = {method:"POST"};
var LiveBroadcastResource = CALL_(path,callOptions);
return LiveBroadcastResource;
}
/**
* Deletes a broadcast.
*
* @param {string} id The id parameter specifies the YouTube live broadcast ID for the resource that is being deleted.
* @param {object} options Keypair of all optional parameters for this call
*/
function liveBroadcastsDelete(id,options){
var path = buildUrl_("liveBroadcasts",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Creates a broadcast.
*
* @param {string} part 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.
The part properties that you can include in the parameter value are id, snippet, contentDetails, and status.
* @param {object} LiveBroadcastResource An object containing the LiveBroadcastResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveBroadcastResource object
*/
function liveBroadcastsInsert(part,LiveBroadcastResource,options){
var path = buildUrl_("liveBroadcasts",options);
var callOptions = {method:"POST",payload:JSON.stringify(LiveBroadcastResource)};
var LiveBroadcastResource = CALL_(path,callOptions);
return LiveBroadcastResource;
}
/**
* Returns a list of YouTube broadcasts that match the API request parameters.
*
* @param {string} part 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveBroadcastListResponseResource object
*/
function liveBroadcastsList(part,options){
var path = buildUrl_("liveBroadcasts",options);
var callOptions = {method:"GET"};
var LiveBroadcastListResponseItems = CALLPAGE_(path,callOptions,"items");
return LiveBroadcastListResponseItems;
}
/**
* 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.
*
* @param {string} broadcastStatus 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.
* @param {string} id The id parameter specifies the unique ID of the broadcast that is transitioning to another status.
* @param {string} part 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveBroadcastResource object
*/
function liveBroadcastsTransition(broadcastStatus,id,part,options){
var path = buildUrl_("liveBroadcasts/transition",options);
var callOptions = {method:"POST"};
var LiveBroadcastResource = CALL_(path,callOptions);
return LiveBroadcastResource;
}
/**
* Updates a broadcast. For example, you could modify the broadcast settings defined in the liveBroadcast resource's contentDetails object.
*
* @param {string} part 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.
The part properties that you can include in the parameter value are id, snippet, contentDetails, and status.
Note 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.
* @param {object} LiveBroadcastResource An object containing the LiveBroadcastResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveBroadcastResource object
*/
function liveBroadcastsUpdate(part,LiveBroadcastResource,options){
var path = buildUrl_("liveBroadcasts",options);
var callOptions = {method:"PUT",payload:JSON.stringify(LiveBroadcastResource)};
var LiveBroadcastResource = CALL_(path,callOptions);
return LiveBroadcastResource;
}
/**
* Removes a chat ban.
*
* @param {string} id The id parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat.
* @param {object} options Keypair of all optional parameters for this call
*/
function liveChatBansDelete(id,options){
var path = buildUrl_("liveChat/bans",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Adds a new ban to the chat.
*
* @param {string} part 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.
* @param {object} LiveChatBanResource An object containing the LiveChatBanResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveChatBanResource object
*/
function liveChatBansInsert(part,LiveChatBanResource,options){
var path = buildUrl_("liveChat/bans",options);
var callOptions = {method:"POST",payload:JSON.stringify(LiveChatBanResource)};
var LiveChatBanResource = CALL_(path,callOptions);
return LiveChatBanResource;
}
/**
* Deletes a chat message.
*
* @param {string} id The id parameter specifies the YouTube chat message ID of the resource that is being deleted.
* @param {object} options Keypair of all optional parameters for this call
*/
function liveChatMessagesDelete(id,options){
var path = buildUrl_("liveChat/messages",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Adds a message to a live chat.
*
* @param {string} part 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.
* @param {object} LiveChatMessageResource An object containing the LiveChatMessageResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveChatMessageResource object
*/
function liveChatMessagesInsert(part,LiveChatMessageResource,options){
var path = buildUrl_("liveChat/messages",options);
var callOptions = {method:"POST",payload:JSON.stringify(LiveChatMessageResource)};
var LiveChatMessageResource = CALL_(path,callOptions);
return LiveChatMessageResource;
}
/**
* Lists live chat messages for a specific chat.
*
* @param {string} liveChatId The liveChatId parameter specifies the ID of the chat whose messages will be returned.
* @param {string} part The part parameter specifies the liveChatComment resource parts that the API response will include. Supported values are id and snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveChatMessageListResponseResource object
*/
function liveChatMessagesList(liveChatId,part,options){
var path = buildUrl_("liveChat/messages",options);
var callOptions = {method:"GET"};
var LiveChatMessageListResponseItems = CALLPAGE_(path,callOptions,"items");
return LiveChatMessageListResponseItems;
}
/**
* Removes a chat moderator.
*
* @param {string} id The id parameter identifies the chat moderator to remove. The value uniquely identifies both the moderator and the chat.
* @param {object} options Keypair of all optional parameters for this call
*/
function liveChatModeratorsDelete(id,options){
var path = buildUrl_("liveChat/moderators",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Adds a new moderator for the chat.
*
* @param {string} part 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.
* @param {object} LiveChatModeratorResource An object containing the LiveChatModeratorResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveChatModeratorResource object
*/
function liveChatModeratorsInsert(part,LiveChatModeratorResource,options){
var path = buildUrl_("liveChat/moderators",options);
var callOptions = {method:"POST",payload:JSON.stringify(LiveChatModeratorResource)};
var LiveChatModeratorResource = CALL_(path,callOptions);
return LiveChatModeratorResource;
}
/**
* Lists moderators for a live chat.
*
* @param {string} liveChatId The liveChatId parameter specifies the YouTube live chat for which the API should return moderators.
* @param {string} part The part parameter specifies the liveChatModerator resource parts that the API response will include. Supported values are id and snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveChatModeratorListResponseResource object
*/
function liveChatModeratorsList(liveChatId,part,options){
var path = buildUrl_("liveChat/moderators",options);
var callOptions = {method:"GET"};
var LiveChatModeratorListResponseItems = CALLPAGE_(path,callOptions,"items");
return LiveChatModeratorListResponseItems;
}
/**
* Deletes a video stream.
*
* @param {string} id The id parameter specifies the YouTube live stream ID for the resource that is being deleted.
* @param {object} options Keypair of all optional parameters for this call
*/
function liveStreamsDelete(id,options){
var path = buildUrl_("liveStreams",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Creates a video stream. The stream enables you to send your video to YouTube, which can then broadcast the video to your audience.
*
* @param {string} part 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.
The part properties that you can include in the parameter value are id, snippet, cdn, and status.
* @param {object} LiveStreamResource An object containing the LiveStreamResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveStreamResource object
*/
function liveStreamsInsert(part,LiveStreamResource,options){
var path = buildUrl_("liveStreams",options);
var callOptions = {method:"POST",payload:JSON.stringify(LiveStreamResource)};
var LiveStreamResource = CALL_(path,callOptions);
return LiveStreamResource;
}
/**
* Returns a list of video streams that match the API request parameters.
*
* @param {string} part 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveStreamListResponseResource object
*/
function liveStreamsList(part,options){
var path = buildUrl_("liveStreams",options);
var callOptions = {method:"GET"};
var LiveStreamListResponseItems = CALLPAGE_(path,callOptions,"items");
return LiveStreamListResponseItems;
}
/**
* 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.
*
* @param {string} part 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.
The part properties that you can include in the parameter value are id, snippet, cdn, and status.
Note 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.
* @param {object} LiveStreamResource An object containing the LiveStreamResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned LiveStreamResource object
*/
function liveStreamsUpdate(part,LiveStreamResource,options){
var path = buildUrl_("liveStreams",options);
var callOptions = {method:"PUT",payload:JSON.stringify(LiveStreamResource)};
var LiveStreamResource = CALL_(path,callOptions);
return LiveStreamResource;
}
/**
* Deletes a playlist item.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function playlistItemsDelete(id,options){
var path = buildUrl_("playlistItems",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Adds a resource to a playlist.
*
* @param {string} part 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.
* @param {object} PlaylistItemResource An object containing the PlaylistItemResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned PlaylistItemResource object
*/
function playlistItemsInsert(part,PlaylistItemResource,options){
var path = buildUrl_("playlistItems",options);
var callOptions = {method:"POST",payload:JSON.stringify(PlaylistItemResource)};
var PlaylistItemResource = CALL_(path,callOptions);
return PlaylistItemResource;
}
/**
* 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.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more playlistItem resource properties that the API response will include.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned PlaylistItemListResponseResource object
*/
function playlistItemsList(part,options){
var path = buildUrl_("playlistItems",options);
var callOptions = {method:"GET"};
var PlaylistItemListResponseItems = CALLPAGE_(path,callOptions,"items");
return PlaylistItemListResponseItems;
}
/**
* Modifies a playlist item. For example, you could update the item's position in the playlist.
*
* @param {string} part 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.
Note 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.
* @param {object} PlaylistItemResource An object containing the PlaylistItemResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned PlaylistItemResource object
*/
function playlistItemsUpdate(part,PlaylistItemResource,options){
var path = buildUrl_("playlistItems",options);
var callOptions = {method:"PUT",payload:JSON.stringify(PlaylistItemResource)};
var PlaylistItemResource = CALL_(path,callOptions);
return PlaylistItemResource;
}
/**
* Deletes a playlist.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function playlistsDelete(id,options){
var path = buildUrl_("playlists",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Creates a playlist.
*
* @param {string} part 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.
* @param {object} PlaylistResource An object containing the PlaylistResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned PlaylistResource object
*/
function playlistsInsert(part,PlaylistResource,options){
var path = buildUrl_("playlists",options);
var callOptions = {method:"POST",payload:JSON.stringify(PlaylistResource)};
var PlaylistResource = CALL_(path,callOptions);
return PlaylistResource;
}
/**
* 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.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more playlist resource properties that the API response will include.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned PlaylistListResponseResource object
*/
function playlistsList(part,options){
var path = buildUrl_("playlists",options);
var callOptions = {method:"GET"};
var PlaylistListResponseItems = CALLPAGE_(path,callOptions,"items");
return PlaylistListResponseItems;
}
/**
* Modifies a playlist. For example, you could change a playlist's title, description, or privacy status.
*
* @param {string} part 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.
Note 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.
* @param {object} PlaylistResource An object containing the PlaylistResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned PlaylistResource object
*/
function playlistsUpdate(part,PlaylistResource,options){
var path = buildUrl_("playlists",options);
var callOptions = {method:"PUT",payload:JSON.stringify(PlaylistResource)};
var PlaylistResource = CALL_(path,callOptions);
return PlaylistResource;
}
/**
* 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.
*
* @param {string} part 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned SearchListResponseResource object
*/
function searchList(part,options){
var path = buildUrl_("search",options);
var callOptions = {method:"GET"};
var SearchListResponseItems = CALLPAGE_(path,callOptions,"items");
return SearchListResponseItems;
}
/**
* Lists sponsors for a channel.
*
* @param {string} part The part parameter specifies the sponsor resource parts that the API response will include. Supported values are id and snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned SponsorListResponseResource object
*/
function sponsorsList(part,options){
var path = buildUrl_("sponsors",options);
var callOptions = {method:"GET"};
var SponsorListResponseItems = CALLPAGE_(path,callOptions,"items");
return SponsorListResponseItems;
}
/**
* Deletes a subscription.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function subscriptionsDelete(id,options){
var path = buildUrl_("subscriptions",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Adds a subscription for the authenticated user's channel.
*
* @param {string} part 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.
* @param {object} SubscriptionResource An object containing the SubscriptionResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned SubscriptionResource object
*/
function subscriptionsInsert(part,SubscriptionResource,options){
var path = buildUrl_("subscriptions",options);
var callOptions = {method:"POST",payload:JSON.stringify(SubscriptionResource)};
var SubscriptionResource = CALL_(path,callOptions);
return SubscriptionResource;
}
/**
* Returns subscription resources that match the API request criteria.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more subscription resource properties that the API response will include.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned SubscriptionListResponseResource object
*/
function subscriptionsList(part,options){
var path = buildUrl_("subscriptions",options);
var callOptions = {method:"GET"};
var SubscriptionListResponseItems = CALLPAGE_(path,callOptions,"items");
return SubscriptionListResponseItems;
}
/**
* Lists Super Chat events for a channel.
*
* @param {string} part The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned SuperChatEventListResponseResource object
*/
function superChatEventsList(part,options){
var path = buildUrl_("superChatEvents",options);
var callOptions = {method:"GET"};
var SuperChatEventListResponseItems = CALLPAGE_(path,callOptions,"items");
return SuperChatEventListResponseItems;
}
/**
* Uploads a custom video thumbnail to YouTube and sets it for a video.
*
* @param {string} videoId The videoId parameter specifies a YouTube video ID for which the custom video thumbnail is being provided.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned ThumbnailSetResponseResource object
*/
function thumbnailsSet(videoId,options){
var path = buildUrl_("thumbnails/set",options);
var callOptions = {method:"POST"};
var ThumbnailSetResponseResource = CALL_(path,callOptions);
return ThumbnailSetResponseResource;
}
/**
* Returns a list of abuse reasons that can be used for reporting abusive videos.
*
* @param {string} part The part parameter specifies the videoCategory resource parts that the API response will include. Supported values are id and snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned VideoAbuseReportReasonListResponseResource object
*/
function videoAbuseReportReasonsList(part,options){
var path = buildUrl_("videoAbuseReportReasons",options);
var callOptions = {method:"GET"};
var VideoAbuseReportReasonListResponseResource = CALL_(path,callOptions);
return VideoAbuseReportReasonListResponseResource;
}
/**
* Returns a list of categories that can be associated with YouTube videos.
*
* @param {string} part The part parameter specifies the videoCategory resource properties that the API response will include. Set the parameter value to snippet.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned VideoCategoryListResponseResource object
*/
function videoCategoriesList(part,options){
var path = buildUrl_("videoCategories",options);
var callOptions = {method:"GET"};
var VideoCategoryListResponseResource = CALL_(path,callOptions);
return VideoCategoryListResponseResource;
}
/**
* Deletes a YouTube video.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
*/
function videosDelete(id,options){
var path = buildUrl_("videos",options);
var callOptions = {method:"DELETE"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Retrieves the ratings that the authorized user gave to a list of specified videos.
*
* @param {string} id 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned VideoGetRatingResponseResource object
*/
function videosGetRating(id,options){
var path = buildUrl_("videos/getRating",options);
var callOptions = {method:"GET"};
var VideoGetRatingResponseResource = CALL_(path,callOptions);
return VideoGetRatingResponseResource;
}
/**
* Uploads a video to YouTube and optionally sets the video's metadata.
*
* @param {string} part 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.
Note 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.
* @param {object} VideoResource An object containing the VideoResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned VideoResource object
*/
function videosInsert(part,VideoResource,options){
var path = buildUrl_("videos",options);
var callOptions = {method:"POST",payload:JSON.stringify(VideoResource)};
var VideoResource = CALL_(path,callOptions);
return VideoResource;
}
/**
* Returns a list of videos that match the API request parameters.
*
* @param {string} part The part parameter specifies a comma-separated list of one or more video resource properties that the API response will include.
If 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.
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned VideoListResponseResource object
*/
function videosList(part,options){
var path = buildUrl_("videos",options);
var callOptions = {method:"GET"};
var VideoListResponseItems = CALLPAGE_(path,callOptions,"items");
return VideoListResponseItems;
}
/**
* Add a like or dislike rating to a video or remove a rating from a video.
*
* @param {string} id The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.
* @param {string} rating Specifies the rating to record.
* @param {object} options Keypair of all optional parameters for this call
*/
function videosRate(id,rating,options){
var path = buildUrl_("videos/rate",options);
var callOptions = {method:"POST"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Report abuse for a video.
*
* @param {object} VideoAbuseReportResource An object containing the VideoAbuseReportResource for this method
* @param {object} options Keypair of all optional parameters for this call
*/
function videosReportAbuse(VideoAbuseReportResource,options){
var path = buildUrl_("videos/reportAbuse",options);
var callOptions = {method:"POST",payload:JSON.stringify(VideoAbuseReportResource)};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Updates a video's metadata.
*
* @param {string} part 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.
Note 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.
In 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.
* @param {object} VideoResource An object containing the VideoResource for this method
* @param {object} options Keypair of all optional parameters for this call
* @return {object} The returned VideoResource object
*/
function videosUpdate(part,VideoResource,options){
var path = buildUrl_("videos",options);
var callOptions = {method:"PUT",payload:JSON.stringify(VideoResource)};
var VideoResource = CALL_(path,callOptions);
return VideoResource;
}
/**
* Uploads a watermark image to YouTube and sets it for a channel.
*
* @param {string} channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being provided.
* @param {object} InvideoBrandingResource An object containing the InvideoBrandingResource for this method
* @param {object} options Keypair of all optional parameters for this call
*/
function watermarksSet(channelId,InvideoBrandingResource,options){
var path = buildUrl_("watermarks/set",options);
var callOptions = {method:"POST",payload:JSON.stringify(InvideoBrandingResource)};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
/**
* Deletes a channel's watermark image.
*
* @param {string} channelId The channelId parameter specifies the YouTube channel ID for which the watermark is being unset.
* @param {object} options Keypair of all optional parameters for this call
*/
function watermarksUnset(channelId,options){
var path = buildUrl_("watermarks/unset",options);
var callOptions = {method:"POST"};
var removeResource = CALL_(path,callOptions);
return removeResource;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment