export type DeleteApiAccountsSelfContactsContactIdArgs = {contact_id: string}; export type DeleteApiAccountsSelfContactsContactIdOptions = {baseUrl?: string | undefined, personalAccessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a contact * * DELETE /accounts/self/contacts/{contact_id} * * Also accepts auth: oauth2 */ export const deleteApiAccountsSelfContactsContactId = async (args: DeleteApiAccountsSelfContactsContactIdArgs, options?: DeleteApiAccountsSelfContactsContactIdOptions) => { const {baseUrl = "https://restapi.fax.plus/v3", fetch: fetchFn = fetch, personalAccessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (personalAccessToken !== undefined) headers.set('authorization', `Bearer ${personalAccessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/self/contacts/${encodeURIComponent(String(args.contact_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 (await res.json()) as unknown };