export type DeleteApiApiV1LogsSubjectLogIdStayLinkArgs = {subject: 'voice' | 'text' | 'email' | 'booking', log_id: string}; export type DeleteApiApiV1LogsSubjectLogIdStayLinkOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Clear Linked Stay * * DELETE /api/v1/logs/{subject}/{log_id}/stay-link */ export const deleteApiApiV1LogsSubjectLogIdStayLink = async (args: DeleteApiApiV1LogsSubjectLogIdStayLinkArgs, options: DeleteApiApiV1LogsSubjectLogIdStayLinkOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/logs/${encodeURIComponent(String(args.subject))}/${encodeURIComponent(String(args.log_id))}/stay-link${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 };