import { APIResource } from '../resource'; import { APIPromise } from '../api-promise'; import type { RequestOptions } from '../internal/request-options'; export declare class Folders extends APIResource { /** * Create a folder inside a video workspace. Optionally provide `parent_id` to create a nested folder. * * @param {string} workspaceID - Video workspace id. * @param {FolderCreateParams} 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 folder = await client.folders.create('workspaceId', { name: 'Course Assets', parent_id: null }); * ``` */ create(workspaceID: string, body: FolderCreateParams, options?: RequestOptions): APIPromise; /** * List folders for a video workspace. Use `parent_id` to list only folders inside a specific parent folder. * * @param {string} workspaceID - Video workspace id. * @param {FolderListParams} [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 folder = await client.folders.list('workspaceId'); * ``` */ list(workspaceID: string, query?: FolderListParams | null | undefined, options?: RequestOptions): APIPromise; /** * Get a single folder by id. * * @param {string} folderID - Folder id. * @param {FolderRetrieveParams} params - 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 folder = await client.folders.retrieve('folderId', { * workspace_id: 'workspaceId', * }); * ``` */ retrieve(folderID: string, params: FolderRetrieveParams, options?: RequestOptions): APIPromise; /** * Rename a folder, move it to another parent folder, or move assets into the folder by sending `asset_ids`. * * @param {string} folderID - Folder id. * @param {FolderUpdateParams} params - 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 folder = await client.folders.update('folderId', { * workspace_id: 'workspaceId', * }); * ``` */ update(folderID: string, params: FolderUpdateParams, options?: RequestOptions): APIPromise; /** * Delete a folder. Descendant folders and assets inside them are deleted by the backend workflow. * * @param {string} folderID - Folder id. * @param {FolderDeleteParams} params - 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 folder = await client.folders.delete('folderId', { * workspace_id: 'workspaceId', * }); * ``` */ delete(folderID: string, params: FolderDeleteParams, options?: RequestOptions): APIPromise; /** * Remove one or more assets from their current folder assignment inside the workspace. * * @param {string} workspaceID - Video workspace id. * @param {FolderRemoveAssetsParams} 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 folder = await client.folders.removeAssets('workspaceId', { * asset_ids: ['67e4f2b4403562dbea654301', '67e4f2bb403562dbea654302'], * }); * ``` */ removeAssets(workspaceID: string, body: FolderRemoveAssetsParams, options?: RequestOptions): APIPromise; } export interface FolderCreateParams { /** * Folder name. */ name: string; /** * Parent folder id. Send `null` or omit it to create a root-level folder. */ parent_id?: string | null; } export interface FolderCreateResponse { /** * Folder ID */ id?: string; /** * Folder name */ name?: string; /** * Deprecated. Use `workspace_id` instead. Still returned for backwards compatibility. * @deprecated */ video_source_id?: string; /** * Parent folder ID */ parent_id?: string | null; /** * Path details */ path?: Array; path_names?: Array; /** * Depth of this folder from root * @default 0 */ depth?: number; /** * Number of subfolders inside this folder * @default 0 */ subdirectory_count?: number; /** * Number of assets inside this folder * @default 0 */ asset_count?: number; /** * Folder creation time in ISO 8601 format * @format date-time */ created_at?: string; /** * Folder update time in ISO 8601 format * @format date-time */ updated_at?: string; /** * Workspace ID */ workspace_id?: string; } export interface FolderListParams { /** * Parent folder id. Send `null` to list root folders. */ parent_id?: string; } export type FolderListResponse = Array; export declare namespace FolderListResponse { interface FolderListResponseItem { /** * Folder ID */ id?: string; /** * Folder name */ name?: string; /** * Deprecated. Use `workspace_id` instead. Still returned for backwards compatibility. * @deprecated */ video_source_id?: string; /** * Parent folder ID */ parent_id?: string | null; /** * Path of the folder */ path?: Array; path_names?: Array; /** * Depth from root folder * @default 0 */ depth?: number; /** * Number of child folders * @default 0 */ subdirectory_count?: number; /** * Number of assets inside this folder * @default 0 */ asset_count?: number; /** * Folder creation time in ISO 8601 format * @format date-time */ created_at?: string; /** * Folder update time in ISO 8601 format * @format date-time */ updated_at?: string; /** * Workspace ID */ workspace_id?: string; } } export interface FolderRetrieveParams { /** * Video workspace id. */ workspace_id: string; } export interface FolderRetrieveResponse { /** * Folder ID */ id?: string; /** * Folder name */ name?: string; /** * Deprecated. Use `workspace_id` instead. Still returned for backwards compatibility. * @deprecated */ video_source_id?: string; /** * Parent folder ID */ parent_id?: string | null; /** * Path for this folder */ path?: Array; path_names?: Array; /** * Depth of this folder from the root * @default 0 */ depth?: number; /** * Number of folders inside this folder * @default 0 */ subdirectory_count?: number; /** * Number of assets in this folder * @default 0 */ asset_count?: number; /** * Folder creation time in ISO 8601 format * @format date-time */ created_at?: string; /** * Folder update time in ISO 8601 format * @format date-time */ updated_at?: string; /** * Workspace ID */ workspace_id?: string; } export interface FolderUpdateParams { /** * Path param: Video workspace id. */ workspace_id: string; /** * Body param */ body?: FolderUpdateParams.Name | FolderUpdateParams.AssetIDs; } export declare namespace FolderUpdateParams { interface Name { /** * New folder name. */ name: string; /** * New parent folder id. Send `null` to move the folder to the root level. */ parent_id?: string | null; /** * Asset ids to move into this folder. */ asset_ids?: Array; } interface AssetIDs { asset_ids: Array; /** * New folder name. */ name?: string; /** * Parent folder id in which we need to move assets. */ parent_id?: string; } } export type FolderUpdateResponse = FolderUpdateResponse.FolderUpdateResponseItem | FolderUpdateResponse.FolderUpdateResponseItem2; export declare namespace FolderUpdateResponse { interface FolderUpdateResponseItem { id?: string; name?: string; /** * Deprecated. Use `workspace_id` instead. Still returned for backwards compatibility. * @deprecated */ video_source_id?: string; parent_id?: string | null; path?: Array; path_names?: Array; /** * @default 0 */ depth?: number; /** * @default 0 */ subdirectory_count?: number; /** * @default 0 */ asset_count?: number; /** * ISO Timestamp */ created_at?: string; /** * ISO Timestamp */ updated_at?: string; /** * Workspace ID */ workspace_id?: string; } interface FolderUpdateResponseItem2 { message?: string; /** * @default 0 */ movedCount?: number; } } export interface FolderDeleteParams { /** * Video workspace id. */ workspace_id: string; } export interface FolderDeleteResponse { message?: string; } export interface FolderRemoveAssetsParams { asset_ids: Array; } export interface FolderRemoveAssetsResponse { message?: string; /** * @default 0 */ removedCount?: number; } export declare namespace Folders { export { type FolderCreateResponse as FolderCreateResponse, type FolderListResponse as FolderListResponse, type FolderRetrieveResponse as FolderRetrieveResponse, type FolderUpdateResponse as FolderUpdateResponse, type FolderDeleteResponse as FolderDeleteResponse, type FolderRemoveAssetsResponse as FolderRemoveAssetsResponse, type FolderCreateParams as FolderCreateParams, type FolderListParams as FolderListParams, type FolderRetrieveParams as FolderRetrieveParams, type FolderUpdateParams as FolderUpdateParams, type FolderDeleteParams as FolderDeleteParams, type FolderRemoveAssetsParams as FolderRemoveAssetsParams, }; } //# sourceMappingURL=folders.d.ts.map