export type DeleteApiOrdersOrderIdInternalDocumentsDocumentIdArgs = {orderId: number, documentId: number}; export type DeleteApiOrdersOrderIdInternalDocumentsDocumentIdOptions = {baseUrl?: string | undefined, accessToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete internal document * * DELETE /orders/{orderId}/internal-documents/{documentId} */ export const deleteApiOrdersOrderIdInternalDocumentsDocumentId = async (args: DeleteApiOrdersOrderIdInternalDocumentsDocumentIdArgs, options?: DeleteApiOrdersOrderIdInternalDocumentsDocumentIdOptions) => { const {baseUrl = "https://api.findmydocument.net", fetch: fetchFn = fetch, accessToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (accessToken !== undefined) headers.set('authorization', `Bearer ${accessToken}`) const url = `${baseUrl.replace(/\/+$/, '')}/orders/${encodeURIComponent(String(args.orderId))}/internal-documents/${encodeURIComponent(String(args.documentId))}${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 };