export type DtosEligibilityContributions = {contribution_detail: 'Table' | 'Tier' | 'Custom' | 'Tier-Tobacco', contribution_type: 'Employee' | 'Employer' | 'Base Plan', base_plan_id?: string | undefined, dependents?: string | undefined, ee?: string | undefined, es?: string | undefined, e_s1c?: string | undefined, e_s2c?: string | undefined, e_s3c?: string | undefined, e1c?: string | undefined, e2c?: string | undefined, e3c?: string | undefined, ee_tobacco?: string | undefined, es_tobacco?: string | undefined, e_s1c_tobacco?: string | undefined, e_s2c_tobacco?: string | undefined, e_s3c_tobacco?: string | undefined, e1c_tobacco?: string | undefined, e2c_tobacco?: string | undefined, e3c_tobacco?: string | undefined, employee?: string | undefined, spouse?: string | undefined, children?: string | undefined, employee_tobacco?: string | undefined, spouse_tobacco?: string | undefined, child1?: string | undefined, child2?: string | undefined, child3?: string | undefined, family?: string | undefined, overall_max?: string | undefined, apply_base_plan_amount_to_employee_only?: boolean | undefined}; export type PatchApiVVersionEligibilitiesIdContributionsArgs = {id: string, version: string, body: DtosEligibilityContributions}; export type PatchApiVVersionEligibilitiesIdContributionsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * eligibility contributions * * PATCH /v{version}/eligibilities/{id}/contributions */ export const patchApiVVersionEligibilitiesIdContributions = async (args: PatchApiVVersionEligibilitiesIdContributionsArgs, options: PatchApiVVersionEligibilitiesIdContributionsOptions) => { 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))}/contributions${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 };