export type DeleteApiV1AccountExclusionsExclusionIdArgs = {exclusion_id: string}; export type DeleteApiV1AccountExclusionsExclusionIdOptions = {baseUrl?: string | undefined, BearerApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Account Exclusion * * DELETE /v1/account-exclusions/{exclusion_id} */ export const deleteApiV1AccountExclusionsExclusionId = async (args: DeleteApiV1AccountExclusionsExclusionIdArgs, options?: DeleteApiV1AccountExclusionsExclusionIdOptions) => { const {baseUrl = "https://api.topo.io", fetch: fetchFn = fetch, BearerApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerApiKey !== undefined) headers.set('authorization', `Bearer ${BearerApiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/account-exclusions/${encodeURIComponent(String(args.exclusion_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 };