export type DeleteApiV1AssetsAssetIdFormatsFormatIdArgs = {'App-ID': string, 'Auth-Token': string, asset_id: string, format_id: string, immediately?: boolean | undefined, ignore_reindexing?: boolean | undefined}; export type DeleteApiV1AssetsAssetIdFormatsFormatIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete asset's format * * DELETE /v1/assets/{asset_id}/formats/{format_id}/ */ export const deleteApiV1AssetsAssetIdFormatsFormatId = async (args: DeleteApiV1AssetsAssetIdFormatsFormatIdArgs, options: DeleteApiV1AssetsAssetIdFormatsFormatIdOptions) => { 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.immediately != null) query.append("immediately", String(args.immediately)) if (args.ignore_reindexing != null) query.append("ignore_reindexing", String(args.ignore_reindexing)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets/${encodeURIComponent(String(args.asset_id))}/formats/${encodeURIComponent(String(args.format_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 };