PlaylistItemsApi
extends AbstractApi
in package
This file is generated from spec/discovery.json (YouTube Data API v3, revision 20260924) by tools/generate.php. Do not edit it by hand - run `composer spec:build` instead.
The videos in playlists.
Reach it as $youtube->playlistItems. Every method takes the parameters Google
documents, by the same names: use named arguments for the optional ones.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- delete() : PromiseInterface<string|int, null>
- Deletes a resource.
- insert() : PromiseInterface<string|int, PlaylistItem>
- Inserts a new resource into this collection.
- list() : PromiseInterface<string|int, PlaylistItemListResponse>
- Retrieves a list of resources, possibly filtered.
- update() : PromiseInterface<string|int, PlaylistItem>
- Updates an existing resource.
- call() : PromiseInterface<string|int, mixed>
- streamed() : PromiseInterface<string|int, ResponseStream>
- Opens a server-streamed call and reads its body as it arrives.
Properties
$youtube read-only
protected
YouTube
$youtube
Methods
__construct()
public
__construct(YouTube $youtube) : mixed
Parameters
- $youtube : YouTube
delete()
Deletes a resource.
public
delete(string $id[, string|null $onBehalfOfContentOwner = null ]) : PromiseInterface<string|int, null>
Costs 50 units of quota.
Parameters
- $id : string
- $onBehalfOfContentOwner : string|null = null
-
Note: This parameter is intended exclusively for YouTube content partners. The 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.
Tags
Return values
PromiseInterface<string|int, null>insert()
Inserts a new resource into this collection.
public
insert(array<int, string>|string $part, PlaylistItem|array<string, mixed> $body[, string|null $onBehalfOfContentOwner = null ]) : PromiseInterface<string|int, PlaylistItem>
Costs 50 units of quota.
Parameters
- $part : array<int, string>|string
-
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.
- $body : PlaylistItem|array<string, mixed>
-
The PlaylistItem to send.
- $onBehalfOfContentOwner : string|null = null
-
Note: This parameter is intended exclusively for YouTube content partners. The 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.
Tags
Return values
PromiseInterface<string|int, PlaylistItem>list()
Retrieves a list of resources, possibly filtered.
public
list(array<int, string>|string $part[, array<int, string>|string|null $id = null ][, int|null $maxResults = null ][, string|null $onBehalfOfContentOwner = null ][, string|null $pageToken = null ][, string|null $playlistId = null ][, string|null $videoId = null ]) : PromiseInterface<string|int, PlaylistItemListResponse>
Costs 1 unit of quota.
Parameters
- $part : array<int, string>|string
-
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.
- $id : array<int, string>|string|null = null
- $maxResults : int|null = null
-
The maxResults parameter specifies the maximum number of items that should be returned in the result set. From 0 to 50. YouTube assumes
5when it is left out. - $onBehalfOfContentOwner : string|null = null
-
Note: This parameter is intended exclusively for YouTube content partners. The 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.
- $pageToken : string|null = null
-
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.
- $playlistId : string|null = null
-
Return the playlist items within the given playlist.
- $videoId : string|null = null
-
Return the playlist items associated with the given video ID.
Tags
Return values
PromiseInterface<string|int, PlaylistItemListResponse>update()
Updates an existing resource.
public
update(array<int, string>|string $part, PlaylistItem|array<string, mixed> $body[, string|null $onBehalfOfContentOwner = null ]) : PromiseInterface<string|int, PlaylistItem>
Costs 50 units of quota.
Parameters
- $part : array<int, string>|string
-
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.
- $body : PlaylistItem|array<string, mixed>
-
The PlaylistItem to send.
- $onBehalfOfContentOwner : string|null = null
-
Note: This parameter is intended exclusively for YouTube content partners. The 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.
Tags
Return values
PromiseInterface<string|int, PlaylistItem>call()
protected
call(string $endpoint, string $method, string $path[, array<string, mixed> $query = [] ][, array<string, mixed>|JsonSerializable|null $body = null ][, string|null $returns = null ][, ?Media $media = null ][, ?string $uploadPath = null ][, bool $download = false ]) : PromiseInterface<string|int, mixed>
Parameters
- $endpoint : string
-
The API method, e.g.
liveChatMessages.list. - $method : string
- $path : string
- $query : array<string, mixed> = []
- $body : array<string, mixed>|JsonSerializable|null = null
- $returns : string|null = null
-
The type token the result hydrates as; null leaves it raw.
- $media : ?Media = null
- $uploadPath : ?string = null
- $download : bool = false
Return values
PromiseInterface<string|int, mixed>streamed()
Opens a server-streamed call and reads its body as it arrives.
protected
streamed(string $endpoint, string $path, array<string, mixed> $query, string $returns) : PromiseInterface<string|int, ResponseStream>
Parameters
- $endpoint : string
- $path : string
- $query : array<string, mixed>
- $returns : string
-
The type token each element hydrates as.