import { APIResource } from '../resource'; import { APIPromise } from '../api-promise'; import type { RequestOptions } from '../internal/request-options'; export declare class VideoPlaylists extends APIResource { /** * Create new playlist inside video wprkspace * * @param {VideoPlaylistCreateParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.create({ * title: 'Playlist-Title', * description: 'This is description for playlist.', * collection_id: '{{video-source-id}}', * workspace_id: '{{video-source-id}}', * }); * ``` */ create(body: VideoPlaylistCreateParams, options?: RequestOptions): APIPromise; /** * Get all playlists for given workspace * * @param {VideoPlaylistListAllParams} [query] - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.listAll(); * ``` */ listAll(query?: VideoPlaylistListAllParams | null | undefined, options?: RequestOptions): APIPromise; /** * This operation adds a single asset or a list of assets to a playlist. * * @param {string} playlistID - Playlist ID in which the asset needs to be added. * @param {VideoPlaylistCreateAssetParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.createAsset('playlistId', { * asset_list: [ * { asset_id: '6508790283e4d60611846790' }, * { position: 1, asset_id: '650878f883e4d6061184677d' }, * { asset_id: '650878de83e4d6061184676a' }, * { position: 2, asset_id: '650878d883e4d60611846757' }, * { position: 3, asset_id: '65578dd87eebc22dcdd549a2' }, * ], * }); * ``` */ createAsset(playlistID: string, body: VideoPlaylistCreateAssetParams, options?: RequestOptions): APIPromise; /** * Removed an asset or list of assets from a given playlist. * * @param {string} playlistID - Playlist ID that is to be deleted. * @param {VideoPlaylistDeleteAssetParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.deleteAsset('playlistId', { * delete_list: ['6508790783e4d606118467a3'], * }); * ``` */ deleteAsset(playlistID: string, body: VideoPlaylistDeleteAssetParams, options?: RequestOptions): APIPromise; /** * This endpoint allows you to update playlist name, channel visibility, or playlist order on a channel page. * * @param {string} playlistID - ID for the playlist to update. * @param {VideoPlaylistUpdateParams} [body] - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.update('playlistId'); * ``` */ update(playlistID: string, body?: VideoPlaylistUpdateParams | null | undefined, options?: RequestOptions): APIPromise; /** * Deletes a playlist by plalist ID. * * @param {string} playlistID - Playlist ID that is to be deleted. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * * @example * ```ts * await client.videoPlaylists.delete('playlistId'); * ``` */ delete(playlistID: string, options?: RequestOptions): APIPromise; /** * Get a list of all assets inside playlist. You can choose in which order are assets returned. * * @param {string} playlistID - ID of playlist in which you need to list assets. * @param {VideoPlaylistListAssetsParams} [query] - The parameters to send with the request. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.listAssets('playlistId', { * sort_order: 1, * page_number: 1, * page_size: '10', * }); * ``` */ listAssets(playlistID: string, query?: VideoPlaylistListAssetsParams | null | undefined, options?: RequestOptions): APIPromise; /** * Reorder videos inside a playlist either by moving a single asset to a position or by sorting the playlist by title or created date. * * @param {string} playlistID - Playlist id. * @param {VideoPlaylistReorderAssetParams} body - The request body to send. * @param {RequestOptions} [options] - Options to apply to the request, such as headers and an abort signal. * @returns {APIPromise} 200 * * @example * ```ts * const videoPlaylist = await client.videoPlaylists.reorderAsset('playlistId', { * asset_id: '6e82bf783e88be000ab45ed2', * page_number: 1, * page_size: 10, * asset_position: 0, * }); * ``` */ reorderAsset(playlistID: string, body: VideoPlaylistReorderAssetParams, options?: RequestOptions): APIPromise; } export interface VideoPlaylistCreateParams { /** * Playlist title */ title: string; /** * Gumlet video workspace ID. Preferred over deprecated `collection_id` / `source_id` (same ID). */ workspace_id: string; /** * Deprecated. Use `workspace_id` instead. Still accepted for backwards compatibility. * @deprecated */ collection_id?: string; /** * Playlist description */ description?: string; } export interface VideoPlaylistCreateResponse { /** * Playlist ID */ id: string; /** * Deprecated. Use `workspace_id` instead. Still accepted for backwards compatibility. * @deprecated */ collection_id?: string; /** * Playlist title */ title?: string; /** * Playlist description */ description?: string; /** * Player config for assets in the playlist */ player_config?: VideoPlaylistCreateResponse.PlayerConfig; /** * Workspace ID */ workspace_id?: string; } export declare namespace VideoPlaylistCreateResponse { interface PlayerConfig { /** * @default true */ preload?: boolean; /** * @default true */ autoplay?: boolean; /** * @default true */ disable_seek?: boolean; /** * @default true */ disable_player_controls?: boolean; /** * @default true */ powered_by_gumlet_overlay?: boolean; /** * @default true */ allow_drm_protected_videos?: boolean; /** * @default true */ loop?: boolean; player_color?: string; /** * @default true */ include_seo?: boolean; /** * @default true */ subtitle_enabled?: boolean; pixel_tags?: Record; /** * @default 0 */ logo_width?: number; /** * @default 0 */ logo_height?: number; /** * @default true */ dynamic_watermark?: boolean; /** * @default 0 */ watermark_font_size?: number; watermark_font_color?: string; watermark_bg_color?: string; /** * @default 0 */ watermark_interval?: number; } } export interface VideoPlaylistListAllParams { /** * Gumlet video workspace ID. Preferred. Provide one of `workspace_id` or the deprecated aliases below (same ID). */ workspace_id?: string; /** * Deprecated. Use `workspace_id` instead. Still accepted for backwards compatibility. */ collection_id?: string; } export type VideoPlaylistListAllResponse = Array; export declare namespace VideoPlaylistListAllResponse { interface VideoPlaylistListAllResponseItem { /** * Playlist ID */ id: string; /** * Deprecated. Use `workspace_id` instead. Still accepted for backwards compatibility. * @deprecated */ collection_id?: string; /** * Title of the playlist */ title?: string; /** * Description of the playlist */ description?: string; /** * Player configuration for the playlist */ player_config?: Record; /** * Workspace ID */ workspace_id?: string; } } export interface VideoPlaylistCreateAssetParams { asset_list: Array; } export declare namespace VideoPlaylistCreateAssetParams { interface AssetList { /** * Asset ID */ asset_id?: string; /** * Optional, if not provided asset will added at the back/last of playlist * @format int32 */ position?: number; } } export interface VideoPlaylistCreateAssetResponse { /** * @default true */ success?: boolean; } export interface VideoPlaylistDeleteAssetParams { /** * Array of video asset ids to delete */ delete_list: Array; } export interface VideoPlaylistDeleteAssetResponse { /** * @default true */ success?: boolean; } export interface VideoPlaylistUpdateParams { /** * Playlist title */ title?: string; /** * Playlist description */ description?: string; /** * Playlists have order in which they will be shown on the channel page. * @format int32 */ position?: number; /** * Configure player settings for this playlist, it overrides the setting set on collection. */ player_config?: VideoPlaylistUpdateParams.PlayerConfig; /** * If true then playlist will be visible on channel page. * @default false */ channel_visibility?: boolean; } export declare namespace VideoPlaylistUpdateParams { interface PlayerConfig { preload?: boolean; autoplay?: boolean; disable_seek?: boolean; disable_player_controls?: boolean; powered_by_gumlet_overlay?: boolean; allow_drm_protected_videos?: boolean; loop?: boolean; player_color?: string; include_seo?: boolean; subtitle_enabled?: boolean; pixel_tags?: Record; /** * @format int32 */ logo_width?: number; /** * @format int32 */ logo_height?: number; dynamic_watermark?: boolean; /** * @format int32 */ watermark_font_size?: number; watermark_font_color?: string; watermark_bg_color?: string; /** * @format int32 */ watermark_interval?: number; } } export interface VideoPlaylistUpdateResponse { /** * Playlist ID */ id: string; /** * Deprecated. Use `workspace_id` instead. Still accepted for backwards compatibility. * @deprecated */ collection_id?: string; /** * Updated playlist title */ title?: string; /** * Updated playlist description */ description?: string; player_config?: VideoPlaylistUpdateResponse.PlayerConfig; /** * Workspace ID */ workspace_id?: string; } export declare namespace VideoPlaylistUpdateResponse { interface PlayerConfig { /** * @default true */ preload?: boolean; /** * @default true */ autoplay?: boolean; /** * @default true */ disable_seek?: boolean; /** * @default true */ disable_player_controls?: boolean; /** * @default true */ powered_by_gumlet_overlay?: boolean; /** * @default true */ allow_drm_protected_videos?: boolean; /** * @default true */ loop?: boolean; player_color?: string; /** * @default true */ include_seo?: boolean; /** * @default true */ subtitle_enabled?: boolean; pixel_tags?: Record; /** * @default 0 */ logo_width?: number; /** * @default 0 */ logo_height?: number; /** * @default true */ dynamic_watermark?: boolean; /** * @default 0 */ watermark_font_size?: number; watermark_font_color?: string; watermark_bg_color?: string; /** * @default 0 */ watermark_interval?: number; } } export interface VideoPlaylistListAssetsParams { /** * Optional, if sort_by is set to asset_title it will sorted by title name. Otherwise order in which user added the assets in playlist. */ sort_by?: string; /** * -1 or 1 * @default 1 * @format int32 */ sort_order?: number; /** * Optional. Minimum: 1 * @default 1 * @format int32 */ page_number?: number; /** * Optional. Minimum: 10 * @default 10 */ page_size?: string; } export interface VideoPlaylistListAssetsResponse { /** * List of assets inside playlist */ asset_list?: Array; /** * @default true */ has_next_page?: boolean; /** * @default 0 */ next_page?: number; } export declare namespace VideoPlaylistListAssetsResponse { interface AssetList { /** * Asset ID */ id?: string; /** * Asset title */ title?: string; /** * Asset description */ description?: string; /** * Status */ status?: string; created_at?: string; /** * Asset duration * @default 0 */ duration?: number; } } export type VideoPlaylistReorderAssetParams = VideoPlaylistReorderAssetParams.Variant0 | VideoPlaylistReorderAssetParams.Variant1; export declare namespace VideoPlaylistReorderAssetParams { interface Variant0 { /** * Asset id to move. */ asset_id: string; /** * Current playlist page number. * @minimum 1 */ page_number: number; /** * Playlist page size used by the caller. * @minimum 1 * @maximum 200 */ page_size: number; /** * Zero-based position inside the provided page. * @minimum 0 */ asset_position: number; } interface Variant1 { sort_by: 'title' | 'created_at'; sort_order: 'asc' | 'desc'; } } export interface VideoPlaylistReorderAssetResponse { /** * @default true */ success?: boolean; asset_list?: Array; } export declare namespace VideoPlaylists { export { type VideoPlaylistCreateResponse as VideoPlaylistCreateResponse, type VideoPlaylistListAllResponse as VideoPlaylistListAllResponse, type VideoPlaylistCreateAssetResponse as VideoPlaylistCreateAssetResponse, type VideoPlaylistDeleteAssetResponse as VideoPlaylistDeleteAssetResponse, type VideoPlaylistUpdateResponse as VideoPlaylistUpdateResponse, type VideoPlaylistListAssetsResponse as VideoPlaylistListAssetsResponse, type VideoPlaylistReorderAssetResponse as VideoPlaylistReorderAssetResponse, type VideoPlaylistCreateParams as VideoPlaylistCreateParams, type VideoPlaylistListAllParams as VideoPlaylistListAllParams, type VideoPlaylistCreateAssetParams as VideoPlaylistCreateAssetParams, type VideoPlaylistDeleteAssetParams as VideoPlaylistDeleteAssetParams, type VideoPlaylistUpdateParams as VideoPlaylistUpdateParams, type VideoPlaylistListAssetsParams as VideoPlaylistListAssetsParams, type VideoPlaylistReorderAssetParams as VideoPlaylistReorderAssetParams, }; } //# sourceMappingURL=video-playlists.d.ts.map