export type DeleteApiV1InterviewsInterviewIdContactsContactIdArgs = {interview_id: string, contact_id: string, 'X-API-Key'?: (string | null) | undefined}; export type DeleteApiV1InterviewsInterviewIdContactsContactIdOptions = {baseUrl: string, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Contact * * DELETE /v1/interviews/{interview_id}/contacts/{contact_id} */ export const deleteApiV1InterviewsInterviewIdContactsContactId = async (args: DeleteApiV1InterviewsInterviewIdContactsContactIdArgs, options: DeleteApiV1InterviewsInterviewIdContactsContactIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-API-Key'] != null) headers.set("X-API-Key", String(args['X-API-Key'])) if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/interviews/${encodeURIComponent(String(args.interview_id))}/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 undefined };