// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class BaseAudioTracks extends APIResource { static override readonly _key: readonly ['stream', 'audioTracks'] = Object.freeze([ 'stream', 'audioTracks', ] as const); /** * Deletes additional audio tracks on a video. Deleting a default audio track is * not allowed. You must assign another audio track as default prior to deletion. * * @example * ```ts * const audioTrack = await client.stream.audioTracks.delete( * 'ea95132c15732412d22c1476fa83f27a', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * identifier: 'ea95132c15732412d22c1476fa83f27a', * }, * ); * ``` */ delete( audioIdentifier: string, params: AudioTrackDeleteParams, options?: RequestOptions, ): APIPromise { const { account_id, identifier } = params; return ( this._client.delete( path`/accounts/${account_id}/stream/${identifier}/audio/${audioIdentifier}`, options, ) as APIPromise<{ result: AudioTrackDeleteResponse }> )._thenUnwrap((obj) => obj.result); } /** * Adds an additional audio track to a video using the provided audio track URL. * * @example * ```ts * const audio = await client.stream.audioTracks.copy( * 'ea95132c15732412d22c1476fa83f27a', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * label: 'director commentary', * }, * ); * ``` */ copy(identifier: string, params: AudioTrackCopyParams, options?: RequestOptions): APIPromise