export type DeleteApiApiV1NewHirePacketsIdArgs = {id: number}; export type DeleteApiApiV1NewHirePacketsIdOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete new hire packet * * DELETE /api/v1/new-hire-packets/{id} */ export const deleteApiApiV1NewHirePacketsId = async (args: DeleteApiApiV1NewHirePacketsIdArgs, options?: DeleteApiApiV1NewHirePacketsIdOptions) => { const {baseUrl = "https://companySubDomain.bamboohr.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/new-hire-packets/${encodeURIComponent(String(args.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 };