export type DeleteApiV1StoragesStorageIdTranscodersTranscoderIdArgs = {'App-ID': string, 'Auth-Token': string, storage_id: string, transcoder_id: string}; export type DeleteApiV1StoragesStorageIdTranscodersTranscoderIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete a transcoder from storage * * DELETE /v1/storages/{storage_id}/transcoders/{transcoder_id}/ */ export const deleteApiV1StoragesStorageIdTranscodersTranscoderId = async (args: DeleteApiV1StoragesStorageIdTranscodersTranscoderIdArgs, options: DeleteApiV1StoragesStorageIdTranscodersTranscoderIdOptions) => { 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'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/storages/${encodeURIComponent(String(args.storage_id))}/transcoders/${encodeURIComponent(String(args.transcoder_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 };