UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

34 lines • 1.29 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from "../../core/resource.mjs"; import { buildHeaders } from "../../internal/headers.mjs"; import { path } from "../../internal/utils/path.mjs"; export var BaseCopy = /* @__PURE__ */ (() => { class BaseCopy extends APIResource { /** * Uploads a video to Stream from a provided URL. * * @example * ```ts * const video = await client.stream.copy.create({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ create(params, options) { const { account_id, 'Upload-Creator': uploadCreator, ...body } = params; return this._client.post(path `/accounts/${account_id}/stream/copy`, { body, ...options, headers: buildHeaders([ { ...(uploadCreator != null ? { 'Upload-Creator': uploadCreator } : undefined) }, options?.headers, ]), })._thenUnwrap((obj) => obj.result); } } BaseCopy._key = Object.freeze(['stream', 'copy']); return BaseCopy; })(); export class Copy extends BaseCopy { } //# sourceMappingURL=copy.mjs.map