export type DtosEligibilityEditable = {name?: string | undefined, policy_number?: string | undefined, subgroup_number?: string | undefined, scheduled_hours?: string | undefined, waiting_period_amount?: number | undefined, waiting_period_type?: ('Days' | 'Months' | '') | undefined, entry_date?: ('First of the Month' | 'First of the Month Next Following' | 'Immediate' | 'Semi-Annual' | 'Quarterly' | '15th of the Month' | 'First of the Month (Coinciding)') | undefined, term_date?: ('End of the Month' | 'End of Second Month' | 'Immediate' | '15th of the Month') | undefined, rate_type?: string | undefined, rate_age_band_type?: string | undefined, tax?: ('Pre-Tax' | 'Post-Tax') | undefined, is_spouse_eligible?: boolean | undefined, is_different_gender_partner_eligible?: boolean | undefined, is_same_gender_partner_eligible?: boolean | undefined, is_child_eligible?: boolean | undefined}; export type PatchApiVVersionEligibilitiesIdArgs = {id: string, version: string, body: DtosEligibilityEditable}; export type PatchApiVVersionEligibilitiesIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * eligibility * * PATCH /v{version}/eligibilities/{id} */ export const patchApiVVersionEligibilitiesId = async (args: PatchApiVVersionEligibilitiesIdArgs, options: PatchApiVVersionEligibilitiesIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v${encodeURIComponent(String(args.version))}/eligibilities/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };