class Comments extends Resource (View source)

The "comments" collection of methods.

Typical usage is:

 $youtubeService = new Google\Service\YouTube(...);
 $comments = $youtubeService->comments;

Methods

delete(string $id, array $optParams = [])

Deletes a resource. (comments.delete)

insert(string|array $part, Comment $postBody, array $optParams = [])

Inserts a new resource into this collection. (comments.insert)

listComments(string|array $part, array $optParams = [])

Retrieves a list of resources, possibly filtered. (comments.listComments)

markAsSpam(string|array $id, array $optParams = [])

Expresses the caller's opinion that one or more comments should be flagged as spam. (comments.markAsSpam)

setModerationStatus(string|array $id, string $moderationStatus, array $optParams = [])

Sets the moderation status of one or more comments.

update(string|array $part, Comment $postBody, array $optParams = [])

Updates an existing resource. (comments.update)

Details

delete(string $id, array $optParams = [])

Deletes a resource. (comments.delete)

Parameters

string $id
array $optParams

Optional parameters.

Exceptions

Exception

Comment insert(string|array $part, Comment $postBody, array $optParams = [])

Inserts a new resource into this collection. (comments.insert)

Parameters

string|array $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.

Comment $postBody
array $optParams

Optional parameters.

Return Value

Comment

Exceptions

Exception

CommentListResponse listComments(string|array $part, array $optParams = [])

Retrieves a list of resources, possibly filtered. (comments.listComments)

Parameters

string|array $part

The part parameter specifies a comma-separated list of one or more comment resource properties that the API response will include.

array $optParams

Optional parameters.

Return Value

CommentListResponse

Exceptions

Exception

markAsSpam(string|array $id, array $optParams = [])

Expresses the caller's opinion that one or more comments should be flagged as spam. (comments.markAsSpam)

Parameters

string|array $id

Flags the comments with the given IDs as spam in the caller's opinion.

array $optParams

Optional parameters.

Exceptions

Exception

setModerationStatus(string|array $id, string $moderationStatus, array $optParams = [])

Sets the moderation status of one or more comments.

(comments.setModerationStatus)

Parameters

string|array $id

Modifies the moderation status of the comments with the given IDs

string $moderationStatus

Specifies the requested moderation status. Note, comments can be in statuses, which are not available through this call. For example, this call does not allow to mark a comment as 'likely spam'. Valid values: 'heldForReview', 'published' or 'rejected'.

array $optParams

Optional parameters.

Exceptions

Exception

Comment update(string|array $part, Comment $postBody, array $optParams = [])

Updates an existing resource. (comments.update)

Parameters

string|array $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.

Comment $postBody
array $optParams

Optional parameters.

Return Value

Comment

Exceptions

Exception