// File generated from our OpenAPI spec by Stainless.
import { APIResource } from 'cloudflare/resource';
import * as AudioTracksAPI from 'cloudflare/resources/stream/audio-tracks';
import * as CaptionsAPI from 'cloudflare/resources/stream/captions';
import * as ClipsAPI from 'cloudflare/resources/stream/clips';
import * as CopiesAPI from 'cloudflare/resources/stream/copies';
import * as DirectUploadsAPI from 'cloudflare/resources/stream/direct-uploads';
import * as DownloadsAPI from 'cloudflare/resources/stream/downloads';
import * as EmbedsAPI from 'cloudflare/resources/stream/embeds';
import * as KeysAPI from 'cloudflare/resources/stream/keys';
import * as TokensAPI from 'cloudflare/resources/stream/tokens';
import * as VideosAPI from 'cloudflare/resources/stream/videos';
import * as WatermarksAPI from 'cloudflare/resources/stream/watermarks';
import * as WebhooksAPI from 'cloudflare/resources/stream/webhooks';
import * as LiveInputsAPI from 'cloudflare/resources/stream/live-inputs/live-inputs';
export class Stream extends APIResource {
    constructor() {
        super(...arguments);
        this.audioTracks = new AudioTracksAPI.AudioTracks(this._client);
        this.videos = new VideosAPI.Videos(this._client);
        this.clips = new ClipsAPI.Clips(this._client);
        this.copies = new CopiesAPI.Copies(this._client);
        this.directUploads = new DirectUploadsAPI.DirectUploads(this._client);
        this.keys = new KeysAPI.Keys(this._client);
        this.liveInputs = new LiveInputsAPI.LiveInputs(this._client);
        this.watermarks = new WatermarksAPI.Watermarks(this._client);
        this.webhooks = new WebhooksAPI.Webhooks(this._client);
        this.captions = new CaptionsAPI.Captions(this._client);
        this.downloads = new DownloadsAPI.Downloads(this._client);
        this.embeds = new EmbedsAPI.Embeds(this._client);
        this.tokens = new TokensAPI.Tokens(this._client);
    }
    /**
     * Initiates a video upload using the TUS protocol. On success, the server responds
     * with a status code 201 (created) and includes a `location` header to indicate
     * where the content should be uploaded. Refer to https://tus.io for protocol
     * details.
     */
    create(params, options) {
        const { account_id, 'Tus-Resumable': tusResumable, 'Upload-Length': uploadLength, 'Upload-Creator': uploadCreator, 'Upload-Metadata': uploadMetadata, } = params;
        return this._client.post(`/accounts/${account_id}/stream`, {
            ...options,
            headers: {
                Accept: '*/*',
                'Tus-Resumable': tusResumable.toString(),
                'Upload-Length': uploadLength.toString(),
                'Upload-Creator': uploadCreator || '',
                'Upload-Metadata': uploadMetadata || '',
                ...options?.headers,
            },
        });
    }
    /**
     * Lists up to 1000 videos from a single request. For a specific range, refer to
     * the optional parameters.
     */
    list(params, options) {
        const { account_id, ...query } = params;
        return this._client.get(`/accounts/${account_id}/stream`, { query, ...options })._thenUnwrap((obj) => obj.result);
    }
    /**
     * Deletes a video and its copies from Cloudflare Stream.
     */
    delete(identifier, params, options) {
        const { account_id } = params;
        return this._client.delete(`/accounts/${account_id}/stream/${identifier}`, {
            ...options,
            headers: { Accept: '*/*', ...options?.headers },
        });
    }
    /**
     * Fetches details for a single video.
     */
    get(identifier, params, options) {
        const { account_id } = params;
        return this._client.get(`/accounts/${account_id}/stream/${identifier}`, options)._thenUnwrap((obj) => obj.result);
    }
}
(function (Stream) {
    Stream.AudioTracks = AudioTracksAPI.AudioTracks;
    Stream.Videos = VideosAPI.Videos;
    Stream.Clips = ClipsAPI.Clips;
    Stream.Copies = CopiesAPI.Copies;
    Stream.DirectUploads = DirectUploadsAPI.DirectUploads;
    Stream.Keys = KeysAPI.Keys;
    Stream.LiveInputs = LiveInputsAPI.LiveInputs;
    Stream.Watermarks = WatermarksAPI.Watermarks;
    Stream.Webhooks = WebhooksAPI.Webhooks;
    Stream.Captions = CaptionsAPI.Captions;
    Stream.Downloads = DownloadsAPI.Downloads;
    Stream.Embeds = EmbedsAPI.Embeds;
    Stream.Tokens = TokensAPI.Tokens;
})(Stream || (Stream = {}));
//# sourceMappingURL=stream.mjs.map