export type DeleteApiV2NotesNoteIdAmendmentsAmendmentIdArgs = {note_id: number, amendment_id: number}; export type DeleteApiV2NotesNoteIdAmendmentsAmendmentIdOptions = {baseUrl?: string | undefined, RequireAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Note Amendment By Id V2 * * DELETE /v2/notes/{note_id}/amendments/{amendment_id} * * Also accepts auth: RequirePracticeAuthorization */ export const deleteApiV2NotesNoteIdAmendmentsAmendmentId = async (args: DeleteApiV2NotesNoteIdAmendmentsAmendmentIdArgs, options?: DeleteApiV2NotesNoteIdAmendmentsAmendmentIdOptions) => { const {baseUrl = "https://sandbox.elationemr.com/api/2.0", fetch: fetchFn = fetch, RequireAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (RequireAuthentication !== undefined) headers.set('authorization', `Bearer ${RequireAuthentication}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/notes/${encodeURIComponent(String(args.note_id))}/amendments/${encodeURIComponent(String(args.amendment_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 };