Show / Hide Table of Contents

Class VideosResource

The "videos" collection of methods.

Inheritance
System.Object
VideosResource
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Google.Apis.YouTube.v3
Assembly: Google.Apis.YouTube.v3.dll
Syntax
public class VideosResource

Constructors

VideosResource(IClientService)

Constructs a new resource.

Declaration
public VideosResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Delete(String)

Deletes a YouTube video.

Declaration
public virtual VideosResource.DeleteRequest Delete(string id)
Parameters
Type Name Description
System.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.

Returns
Type Description
VideosResource.DeleteRequest

GetRating(String)

Retrieves the ratings that the authorized user gave to a list of specified videos.

Declaration
public virtual VideosResource.GetRatingRequest GetRating(string id)
Parameters
Type Name Description
System.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.

Returns
Type Description
VideosResource.GetRatingRequest

Insert(Video, String)

Uploads a video to YouTube and optionally sets the video's metadata.

Declaration
public virtual VideosResource.InsertRequest Insert(Video body, string part)
Parameters
Type Name Description
Video body

The body of the request.

System.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.

Returns
Type Description
VideosResource.InsertRequest

Insert(Video, String, Stream, String)

Uploads a video to YouTube and optionally sets the video's metadata.

Declaration
public virtual VideosResource.InsertMediaUpload Insert(Video body, string part, Stream stream, string contentType)
Parameters
Type Name Description
Video body

The body of the request.

System.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.

System.IO.Stream stream

The stream to upload.

System.String contentType

The content type of the stream to upload.

Returns
Type Description
VideosResource.InsertMediaUpload

List(String)

Returns a list of videos that match the API request parameters.

Declaration
public virtual VideosResource.ListRequest List(string part)
Parameters
Type Name Description
System.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.

Returns
Type Description
VideosResource.ListRequest

Rate(String, VideosResource.RateRequest.RatingEnum)

Add a like or dislike rating to a video or remove a rating from a video.

Declaration
public virtual VideosResource.RateRequest Rate(string id, VideosResource.RateRequest.RatingEnum rating)
Parameters
Type Name Description
System.String id

The id parameter specifies the YouTube video ID of the video that is being rated or having its rating removed.

VideosResource.RateRequest.RatingEnum rating

Specifies the rating to record.

Returns
Type Description
VideosResource.RateRequest

ReportAbuse(VideoAbuseReport)

Report abuse for a video.

Declaration
public virtual VideosResource.ReportAbuseRequest ReportAbuse(VideoAbuseReport body)
Parameters
Type Name Description
VideoAbuseReport body

The body of the request.

Returns
Type Description
VideosResource.ReportAbuseRequest

Update(Video, String)

Updates a video's metadata.

Declaration
public virtual VideosResource.UpdateRequest Update(Video body, string part)
Parameters
Type Name Description
Video body

The body of the request.

System.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.

Returns
Type Description
VideosResource.UpdateRequest
Back to top