export type DeleteApiV1PlaylistsPlaylistIdKeyframesKeyframeIdArgs = {'App-ID': string, 'Auth-Token': string, playlist_id: string, keyframe_id: string, regenerate_keyframes?: boolean | undefined, update_playlist?: boolean | undefined}; export type DeleteApiV1PlaylistsPlaylistIdKeyframesKeyframeIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete playlist's keyframe * * DELETE /v1/playlists/{playlist_id}/keyframes/{keyframe_id}/ */ export const deleteApiV1PlaylistsPlaylistIdKeyframesKeyframeId = async (args: DeleteApiV1PlaylistsPlaylistIdKeyframesKeyframeIdArgs, options: DeleteApiV1PlaylistsPlaylistIdKeyframesKeyframeIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args.regenerate_keyframes != null) query.append("regenerate_keyframes", String(args.regenerate_keyframes)) if (args.update_playlist != null) query.append("update_playlist", String(args.update_playlist)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/playlists/${encodeURIComponent(String(args.playlist_id))}/keyframes/${encodeURIComponent(String(args.keyframe_id))}/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };