export type DeleteApiV1NameAnswersDeleteArgs = {name: string}; export type DeleteApiV1NameAnswersDeleteOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes the answer written by the current user to a question. * * DELETE /v1/{+name}/answers:delete */ export const deleteApiV1NameAnswersDelete = async (args: DeleteApiV1NameAnswersDeleteArgs, options?: DeleteApiV1NameAnswersDeleteOptions) => { const {baseUrl = "https://mybusinessqanda.googleapis.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/v1/${encodeURIComponent(String(args['+name']))}/answers:delete${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 res.blob() };