export type DeleteApiAuthoringV1AssetsIdArgs = {id: string, 'If-Match'?: string | undefined}; export type DeleteApiAuthoringV1AssetsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete an existing asset. * * DELETE /authoring/v1/assets/{id} */ export const deleteApiAuthoringV1AssetsId = async (args: DeleteApiAuthoringV1AssetsIdArgs, options: DeleteApiAuthoringV1AssetsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['If-Match'] != null) headers.set("If-Match", String(args['If-Match'])) const url = `${baseUrl.replace(/\/+$/, '')}/authoring/v1/assets/${encodeURIComponent(String(args.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 };