/** * @api.video/nodejs-client * api.video is an API that encodes on the go to facilitate immediate playback, enhancing viewer streaming experiences across multiple devices and platforms. You can stream live or on-demand online videos within minutes. * * The version of the OpenAPI document: 1 * * * NOTE: This class is auto generated. * Do not edit the class manually. */ import HttpClient, { ApiResponseHeaders } from '../HttpClient'; import Caption from '../model/Caption'; import CaptionsListResponse from '../model/CaptionsListResponse'; import CaptionsUpdatePayload from '../model/CaptionsUpdatePayload'; import { Readable } from 'stream'; /** * no description */ export default class CaptionsApi { private httpClient; constructor(httpClient: HttpClient); /** * Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions) * Upload a caption * @param videoId The unique identifier for the video you want to add a caption to. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). * @param file The video text track (VTT) you want to upload. */ upload(videoId: string, language: string, file: string | Readable | Buffer): Promise; /** * Upload a VTT file to add captions to your video. More information can be found [here](https://docs.api.video/vod/add-captions) * Upload a caption * @param videoId The unique identifier for the video you want to add a caption to. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). * @param file The video text track (VTT) you want to upload. */ uploadWithResponseHeaders(videoId: string, language: string, file: string | Readable | Buffer): Promise<{ headers: ApiResponseHeaders; body: Caption; }>; /** * Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found. Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions). * Retrieve a caption * @param videoId The unique identifier for the video you want captions for. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). */ get(videoId: string, language: string): Promise; /** * Retrieve a caption for a video in a specific language. If the language is available, the caption is returned. Otherwise, you will get a error indicating the caption was not found. Tutorials that use the [captions endpoint](https://api.video/blog/endpoints/captions). * Retrieve a caption * @param videoId The unique identifier for the video you want captions for. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). */ getWithResponseHeaders(videoId: string, language: string): Promise<{ headers: ApiResponseHeaders; body: Caption; }>; /** * To have the captions on automatically, use this method to set default: true. * Update a caption * @param videoId The unique identifier for the video you want to have automatic captions for. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). * @param captionsUpdatePayload */ update(videoId: string, language: string, captionsUpdatePayload?: CaptionsUpdatePayload): Promise; /** * To have the captions on automatically, use this method to set default: true. * Update a caption * @param videoId The unique identifier for the video you want to have automatic captions for. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). * @param captionsUpdatePayload */ updateWithResponseHeaders(videoId: string, language: string, captionsUpdatePayload?: CaptionsUpdatePayload): Promise<{ headers: ApiResponseHeaders; body: Caption; }>; /** * Delete a caption in a specific language by by video id. * Delete a caption * @param videoId The unique identifier for the video you want to delete a caption from. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). */ delete(videoId: string, language: string): Promise; /** * Delete a caption in a specific language by by video id. * Delete a caption * @param videoId The unique identifier for the video you want to delete a caption from. * @param language A valid language identifier using IETF language tags. You can use primary subtags like `en` (English), extended subtags like `fr-CA` (French, Canada), or region subtags like `zh-Hans-CN` (Simplified Chinese used in the PRC). - This parameter **only accepts dashes for separators**, for example `fr-CA`. If you use a different separator in your request, the API returns an error. - When the value in your request does not match any covered language, the API returns an error. - You can find the list of supported tags [here](https://docs.api.video/vod/add-captions#supported-caption-language-tags). */ deleteWithResponseHeaders(videoId: string, language: string): Promise<{ headers: ApiResponseHeaders; body: void; }>; /** * Retrieve a list of available captions by video id. * List video captions * @param {Object} searchParams * @param { string } searchParams.videoId The unique identifier for the video you want to retrieve a list of captions for. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ list(args: { videoId: string; currentPage?: number; pageSize?: number; }): Promise; /** * Retrieve a list of available captions by video id. * List video captions * @param {Object} searchParams * @param { string } searchParams.videoId The unique identifier for the video you want to retrieve a list of captions for. * @param { number } searchParams.currentPage Choose the number of search results to return per page. Minimum value: 1 * @param { number } searchParams.pageSize Results per page. Allowed values 1-100, default is 25. */ listWithResponseHeaders({ videoId, currentPage, pageSize, }: { videoId: string; currentPage?: number; pageSize?: number; }): Promise<{ headers: ApiResponseHeaders; body: CaptionsListResponse; }>; }