/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { captionsCreate } from "../funcs/captionsCreate.js"; import { captionsCreateMultipart } from "../funcs/captionsCreateMultipart.js"; import { captionsDelete } from "../funcs/captionsDelete.js"; import { captionsGet, GetAcceptEnum } from "../funcs/captionsGet.js"; import { captionsGetCaptions } from "../funcs/captionsGetCaptions.js"; import { captionsList } from "../funcs/captionsList.js"; import { captionsPurchase } from "../funcs/captionsPurchase.js"; import { captionsUpdate } from "../funcs/captionsUpdate.js"; import { captionsUpdateMultipart } from "../funcs/captionsUpdateMultipart.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export { GetAcceptEnum } from "../funcs/captionsGet.js"; export class Captions extends ClientSDK { /** * List Captions by Media * * @remarks * Lists captions belonging to a specific media. * * ## Requires api token with one of the following permissions * ``` * Read all folder and media data * ``` */ async list( request: operations.GetMediasMediaHashedIdCaptionsRequest, options?: RequestOptions, ): Promise> { return unwrapAsync(captionsList( this, request, options, )); } /** * Create Captions * * @remarks * Adds captions to a specified media by providing an SRT file or its contents directly. * * ## Requires api token with one of the following permissions * ``` * Read, update & delete anything * ``` */ async create( request: operations.PostMediasMediaHashedIdCaptionsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(captionsCreate( this, request, options, )); } /** * Create Captions * * @remarks * Adds captions to a specified media by providing an SRT file or its contents directly. * * ## Requires api token with one of the following permissions * ``` * Read, update & delete anything * ``` */ async createMultipart( request: operations.PostMediasMediaHashedIdCaptionsMultipartRequest, options?: RequestOptions, ): Promise { return unwrapAsync(captionsCreateMultipart( this, request, options, )); } /** * List Captions * * @remarks * Lists captions belonging to the account. This endpoint can also narrow down results * to those belonging to a specific media. * * ## Requires api token with one of the following permissions * ``` * Read all folder and media data * ``` */ async getCaptions( request?: operations.GetCaptionsRequest | undefined, options?: RequestOptions, ): Promise> { return unwrapAsync(captionsGetCaptions( this, request, options, )); } /** * Purchase Captions * * @remarks * This method is for purchasing English captions for a media. The request will charge the credit card on the account if successful. A saved credit card is required to use this endpoint. * * > 🚫 Alert * > * > The `automated` parameter defaults to `false`, which orders **paid human-generated captions**. To order computer-generated captions, you must explicitly set `automated` to `true`. * * ## Requires api token with one of the following permissions * ``` * Read, update & delete anything * ``` */ async purchase( request: operations.PostMediasMediaHashedIdCaptionsPurchaseRequest, options?: RequestOptions, ): Promise { return unwrapAsync(captionsPurchase( this, request, options, )); } /** * Show Captions * * @remarks * Returns a video's captions in the specified language. * Supports multiple formats: JSON (default), SRT, VTT, and TXT. * Use file extensions (.srt, .vtt, .txt) or Accept headers to specify format. * * ## Requires api token with one of the following permissions * ``` * Read all folder and media data * ``` */ async get( request: operations.GetMediasMediaHashedIdCaptionsLanguageCodeRequest, options?: RequestOptions & { acceptHeaderOverride?: GetAcceptEnum }, ): Promise { return unwrapAsync(captionsGet( this, request, options, )); } /** * Update Captions * * @remarks * This method is for replacing the captions on a video for the specified language. * * ## Requires api token with one of the following permissions * ``` * Read, update & delete anything * ``` */ async update( request: operations.PutMediasMediaHashedIdCaptionsLanguageCodeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(captionsUpdate( this, request, options, )); } /** * Update Captions * * @remarks * This method is for replacing the captions on a video for the specified language. * * ## Requires api token with one of the following permissions * ``` * Read, update & delete anything * ``` */ async updateMultipart( request: operations.PutMediasMediaHashedIdCaptionsLanguageCodeMultipartRequest, options?: RequestOptions, ): Promise { return unwrapAsync(captionsUpdateMultipart( this, request, options, )); } /** * Delete Captions * * @remarks * Removes the captions file from a media for the specified language. * * ## Requires api token with one of the following permissions * ``` * Read, update & delete anything * ``` */ async delete( request: operations.DeleteMediasMediaHashedIdCaptionsLanguageCodeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(captionsDelete( this, request, options, )); } }