export type DeleteApiV1CustomersCustomerIdDocumentsDocumentIdArgs = {customer_id: string, document_id: string}; export type DeleteApiV1CustomersCustomerIdDocumentsDocumentIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unlink a document from a customer. * * DELETE /v1/customers/{customer_id}/documents/{document_id} */ export const deleteApiV1CustomersCustomerIdDocumentsDocumentId = async (args: DeleteApiV1CustomersCustomerIdDocumentsDocumentIdArgs, options?: DeleteApiV1CustomersCustomerIdDocumentsDocumentIdOptions) => { const {baseUrl = "https://auth-sandbox.fuse.me", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v1/customers/${encodeURIComponent(String(args.customer_id))}/documents/${encodeURIComponent(String(args.document_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 };