export type DeleteApiPlatformV1CustomersDocumentsDocumentReferenceArgs = {documentReference: string}; export type DeleteApiPlatformV1CustomersDocumentsDocumentReferenceOptions = {baseUrl?: string | undefined, Hawk?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove a document * * DELETE /platform/v1/customers/documents/{documentReference} */ export const deleteApiPlatformV1CustomersDocumentsDocumentReference = async (args: DeleteApiPlatformV1CustomersDocumentsDocumentReferenceArgs, options?: DeleteApiPlatformV1CustomersDocumentsDocumentReferenceOptions) => { const {baseUrl = "https://api.sandbox.bvnk.com", fetch: fetchFn = fetch, Hawk} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Hawk !== undefined) headers.set("Authorization", Hawk) const url = `${baseUrl.replace(/\/+$/, '')}/platform/v1/customers/documents/${encodeURIComponent(String(args.documentReference))}${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 };