export type DeleteApiV1CollectionsCollectionIdKeyframesKeyframeIdArgs = {'App-ID': string, 'Auth-Token': string, collection_id: string, keyframe_id: string, regenerate_keyframes?: boolean | undefined, update_collection?: boolean | undefined}; export type DeleteApiV1CollectionsCollectionIdKeyframesKeyframeIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete collection's keyframe * * DELETE /v1/collections/{collection_id}/keyframes/{keyframe_id}/ */ export const deleteApiV1CollectionsCollectionIdKeyframesKeyframeId = async (args: DeleteApiV1CollectionsCollectionIdKeyframesKeyframeIdArgs, options: DeleteApiV1CollectionsCollectionIdKeyframesKeyframeIdOptions) => { 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_collection != null) query.append("update_collection", String(args.update_collection)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/collections/${encodeURIComponent(String(args.collection_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 };