import { APIResource } from '../resource'; import { APIPromise } from '../api-promise'; import type { RequestOptions } from '../internal/request-options'; export declare class SubtitleUpload extends APIResource { /** * Upload `.srt` or `.vtt` file to the video asset. The response of this API call gives `upload_url` for each language specified. You need to send a `PUT` request of the subtitle files to those URLs. Once that's done, you need to call the subtitle upload complete API. Only after that, Gumlet will add subtitles to asset. * * @param {string} assetID - An asset id for the previously created asset. * @param {SubtitleUploadUploadParams} [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 subtitleUpload = await client.subtitleUpload.upload('assetId'); * ``` */ upload(assetID: string, body?: SubtitleUploadUploadParams | null | undefined, options?: RequestOptions): APIPromise; /** * This API must be called after adding subtitles; the add subtitle call gives you URLs to upload, and you complete a `PUT` request to those URLs. * Once that is done, calling this initiates the process to actually add the subtitle to the video. * * @param {string} assetID - An asset id for the previously created asset. * @param {SubtitleUploadCompleteParams} [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 subtitleUpload = await client.subtitleUpload.complete('assetId'); * ``` */ complete(assetID: string, body?: SubtitleUploadCompleteParams | null | undefined, options?: RequestOptions): APIPromise; } export interface SubtitleUploadUploadParams { /** * List of language codes to upload subtitle file (use ISO 639-1 Language Codes) */ language_codes?: Array; } export interface SubtitleUploadUploadResponse { /** * Asset ID of Gumlet */ asset_id: string; /** * List of objects with signed URLs for each language */ signed_urls: Array; } export declare namespace SubtitleUploadUploadResponse { interface SignedURL { /** * Language code */ language_code: string; /** * Upload URL on which PUT request should be fired to upload the subtitle */ upload_url: string; } } export interface SubtitleUploadCompleteParams { /** * Array of objects of uploaded languages */ upload_responses?: Array; } export declare namespace SubtitleUploadCompleteParams { interface UploadResponse { /** * Language code for uploaded .srt or .vtt file. */ language_code?: string; /** * Status of language uploaded .srt or .vtt file. (If status code was 200, You can mark true else false) */ uploaded?: boolean; } } export type SubtitleUploadCompleteResponse = Record; export declare namespace SubtitleUpload { export { type SubtitleUploadUploadResponse as SubtitleUploadUploadResponse, type SubtitleUploadCompleteResponse as SubtitleUploadCompleteResponse, type SubtitleUploadUploadParams as SubtitleUploadUploadParams, type SubtitleUploadCompleteParams as SubtitleUploadCompleteParams, }; } //# sourceMappingURL=subtitle-upload.d.ts.map