UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

45 lines • 1.65 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../../core/resource.mjs"; import * as LanguageAPI from "./language/language.mjs"; import { BaseLanguage, Language, } from "./language/language.mjs"; import { SinglePage } from "../../../core/pagination.mjs"; import { path } from "../../../internal/utils/path.mjs"; export var BaseCaptions = /* @__PURE__ */ (() => { class BaseCaptions extends APIResource { /** * Lists the available captions or subtitles for a specific video. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const caption of client.stream.captions.get( * 'ea95132c15732412d22c1476fa83f27a', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ get(identifier, params, options) { const { account_id } = params; return this._client.getAPIList(path `/accounts/${account_id}/stream/${identifier}/captions`, (SinglePage), options); } } BaseCaptions._key = Object.freeze([ 'stream', 'captions', ]); return BaseCaptions; })(); export var Captions = /* @__PURE__ */ (() => { class Captions extends BaseCaptions { constructor() { super(...arguments); this.language = new LanguageAPI.Language(this._client); } } Captions.Language = Language; Captions.BaseLanguage = BaseLanguage; return Captions; })(); //# sourceMappingURL=captions.mjs.map