export type DeleteApiV1ContactListsContactListIdArgs = {contact_list_id: string}; export type DeleteApiV1ContactListsContactListIdOptions = {baseUrl?: string | undefined, BearerApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Contact List * * DELETE /v1/contact-lists/{contact_list_id} */ export const deleteApiV1ContactListsContactListId = async (args: DeleteApiV1ContactListsContactListIdArgs, options?: DeleteApiV1ContactListsContactListIdOptions) => { 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/contact-lists/${encodeURIComponent(String(args.contact_list_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 };