ChannelSection
popyt / Library Exports / ChannelSection
Class: ChannelSection
Defined in: entities/channel-section.ts:8
A YouTube Channel section.
Constructors
Constructor
new ChannelSection(
youtube,data,full?):ChannelSection
Defined in: entities/channel-section.ts:91
Parameters
youtube
data
Schema$ChannelSection
full?
boolean = true
Returns
ChannelSection
Properties
channelId
channelId:
string
Defined in: entities/channel-section.ts:52
The ID of the channel that created this channel section.
channelIds?
optionalchannelIds?:string[]
Defined in: entities/channel-section.ts:67
The IDs of the channels in this channel section. Undefined if there aren't any.
channels?
optionalchannels?:Channel[]
Defined in: entities/channel-section.ts:77
The channels in the channel section. Only available after calling ChannelSection.fetchChannels.
data
data:
any
Defined in: entities/channel-section.ts:37
The raw data of this channel section.
full
full:
boolean=true
Defined in: entities/channel-section.ts:32
Whether or not this a full channel section object.
id
id:
string
Defined in: entities/channel-section.ts:89
The ID of this channel section.
name
name:
string
Defined in: entities/channel-section.ts:42
The name of this channel section.
playlistIds?
optionalplaylistIds?:string[]
Defined in: entities/channel-section.ts:62
The IDs of the playlists in this channel section. Undefined if there aren't any.
playlists?
optionalplaylists?:Playlist[]
Defined in: entities/channel-section.ts:72
The playlists in the channel section. Only available after calling ChannelSection.fetchPlaylists.
position
position:
number
Defined in: entities/channel-section.ts:57
The zero-based position of this channel section on the channel page.
subscriptions?
optionalsubscriptions?:PaginatedResponse<Subscription>
Defined in: entities/channel-section.ts:84
The subscriptions in the channel section.
Only valid if ChannelSection.type is subscriptions.
Only available after calling ChannelSection.fetchChannels().
type
type:
"subscriptions"|"likes"|"allplaylists"|"completedevents"|"likedplaylists"|"liveevents"|"multiplechannels"|"multipleplaylists"|"popularuploads"|"postedplaylists"|"postedvideos"|"recentactivity"|"recentposts"|"recentuploads"|"singleplaylist"|"upcomingevents"
Defined in: entities/channel-section.ts:47
The type of this channel section.
youtube
youtube:
YouTube
Defined in: entities/channel-section.ts:27
The YouTube object that created this channel section object.
endpoint
staticendpoint:string='channelSections'
Defined in: entities/channel-section.ts:12
The name of the endpoint used for this entity.
fields
staticfields:string='items(kind,id,contentDetails,snippet)'
Defined in: entities/channel-section.ts:22
The fields to request for this entity.
part
staticpart:string='contentDetails,snippet'
Defined in: entities/channel-section.ts:17
The parts to request for this entity.
Methods
fetch()
fetch(
parts?):Promise<ChannelSection>
Defined in: entities/channel-section.ts:125
Fetches this channel section from the API and reassigns this object to the new channel section object.
Only useful if this.full is false, or if you want updated channel section info.
Parameters
parts?
Returns
Promise<ChannelSection>
fetchChannels()
fetchChannels(
parts?):Promise<Channel[]>
Defined in: entities/channel-section.ts:150
Fetches the channel section's channels from the API and assigns them to the ChannelSection.channels property.
Parameters
parts?
Returns
Promise<Channel[]>
fetchPlaylists()
fetchPlaylists(
pageOptions?,parts?):Promise<Playlist[]>
Defined in: entities/channel-section.ts:133
Fetches the channel section's playlists from the API and assigns them to the ChannelSection.playlists property.
Parameters
pageOptions?
parts?
Returns
Promise<Playlist[]>
fetchSubscriptions()
fetchSubscriptions(
pageOptions?,parts?):Promise<PaginatedResponse<Subscription>>
Defined in: entities/channel-section.ts:165
Parameters
pageOptions?
parts?
Returns
Promise<PaginatedResponse<Subscription>>