Skip to main content

OAuthChannels

popyt


popyt / OAuth / OAuthChannels

Class: OAuthChannels

Defined in: oauth/channels.ts:11

Constructors

Constructor

new OAuthChannels(oauth, request, upload): OAuthChannels

Defined in: oauth/channels.ts:15

Parameters

oauth

OAuth

request

Request

upload

Request

Returns

OAuthChannels

Properties

oauth

oauth: OAuth

Defined in: oauth/channels.ts:15

Methods

addChannelSection()

addChannelSection(type, name?, position?, playlistsResolvable?, channelsResolvable?): Promise<ChannelSection>

Defined in: oauth/channels.ts:166

Adds a ChannelSection to the authorized user's Channel.

Parameters

type

ChannelSectionType

The type of channel section.

name?

string

The name of the channel section.

position?

number

The position of the channel section on the channel homepage.

playlistsResolvable?

PlaylistResolvable[]

Any playlists in the channel section.

channelsResolvable?

ChannelResolvable[]

Any channels in the channel section.

Returns

Promise<ChannelSection>


deleteChannelSection()

deleteChannelSection(id): Promise<ChannelSection>

Defined in: oauth/channels.ts:253

Deletes a ChannelSection.

Parameters

id

string

The ID of the channel section.

Returns

Promise<ChannelSection>


setChannelMadeForKids()

setChannelMadeForKids(channelResolvable, madeForKids): Promise<Channel>

Defined in: oauth/channels.ts:76

Sets a channel as made for kids or not made for kids.

Parameters

channelResolvable

ChannelResolvable

The channel to update.

madeForKids

boolean

Whether or not the channel is made for kids.

Returns

Promise<Channel>


setChannelWatermark()

setChannelWatermark(channelResolvable, type, offset, duration, image): Promise<void>

Defined in: oauth/channels.ts:103

Sets a channel's watermark.

Parameters

channelResolvable

ChannelResolvable

The channel to set the watermark for.

type

"fromStart" | "fromEnd"

The timing type of the watermark.

offset

number

The offset, in milliseconds, from the start/end of the video to display the watermark from.

duration

number

The duration, in millseconds, to display the watermark for.

image

Image

The watermark image.

Returns

Promise<void>


subscribeToChannel()

subscribeToChannel(channelResolvable): Promise<Subscription>

Defined in: oauth/channels.ts:266

Subscribe to a Channel.

Parameters

channelResolvable

ChannelResolvable

The channel to subscribe to.

Returns

Promise<Subscription>

A partial subscription object.


unsetChannelWatermark()

unsetChannelWatermark(channelResolvable): Promise<void>

Defined in: oauth/channels.ts:131

Unsets a channel's watermark.

Parameters

channelResolvable

ChannelResolvable

The channel to unset the watermark from.

Returns

Promise<void>


unsubscribeFromChannel()

unsubscribeFromChannel(subscriptionId): Promise<void>

Defined in: oauth/channels.ts:286

Unsubscribe from a Channel.

Parameters

subscriptionId

string

The subscription to unsubscribe from.

Returns

Promise<void>


updateChannelBranding()

updateChannelBranding(channelResolvable, brandingSettings): Promise<Channel>

Defined in: oauth/channels.ts:27

Updates a channel's branding settings. If your request does not specify a value for a property that already has a value, the property's existing value will be deleted.

Parameters

channelResolvable

ChannelResolvable

The channel to update the branding settings of.

brandingSettings

ChannelBrandingSettings

The new branding settings.

Returns

Promise<Channel>


updateChannelLocalizations()

updateChannelLocalizations(channelResolvable, localizations): Promise<Channel>

Defined in: oauth/channels.ts:52

Updates a channel's localizations. CURRENTLY BROKEN in the API If your request does not specify a value for a property that already has a value, the property's existing value will be deleted.

Parameters

channelResolvable

ChannelResolvable

The channel to update the localizations of.

localizations

The new localizations.

Returns

Promise<Channel>


updateChannelSection()

updateChannelSection(id, type, name?, position?, playlistsResolvable?, channelsResolvable?): Promise<ChannelSection>

Defined in: oauth/channels.ts:218

Updates a ChannelSection. If your request does not specify a value for a property that already has a value, the property's existing value will be deleted.

Parameters

id

string

The ID of the channel section.

type

ChannelSectionType

The type of channel section.

name?

string

The name of the channel section.

position?

number

The position of the channel section on the channel homepage.

playlistsResolvable?

PlaylistResolvable[]

Any playlists in the channel section.

channelsResolvable?

ChannelResolvable[]

Any channels in the channel section.

Returns

Promise<ChannelSection>


uploadChannelBanner()

uploadChannelBanner(image): Promise<string>

Defined in: oauth/channels.ts:148

Uploads a channel banner.

Parameters

image

Image

The channel banner to upload.

Returns

Promise<string>

The URL of the uploaded banner, used as BrandingSettings.image.bannerExternalUrl in OAuth.updateChannelBranding()