UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

51 lines • 1.95 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Captions = exports.BaseCaptions = void 0; const tslib_1 = require("../../../internal/tslib.js"); // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const LanguageAPI = tslib_1.__importStar(require("./language/language.js")); const language_1 = require("./language/language.js"); const pagination_1 = require("../../../core/pagination.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseCaptions = /* @__PURE__ */ (() => { class BaseCaptions extends resource_1.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((0, path_1.path) `/accounts/${account_id}/stream/${identifier}/captions`, (pagination_1.SinglePage), options); } } BaseCaptions._key = Object.freeze([ 'stream', 'captions', ]); return BaseCaptions; })(); exports.BaseCaptions = BaseCaptions; var Captions = /* @__PURE__ */ (() => { class Captions extends BaseCaptions { constructor() { super(...arguments); this.language = new LanguageAPI.Language(this._client); } } Captions.Language = language_1.Language; Captions.BaseLanguage = language_1.BaseLanguage; return Captions; })(); exports.Captions = Captions; //# sourceMappingURL=captions.js.map