export type DtosEligibilityRates = {rate_type: 'Table' | 'Tier-Table' | 'Tier', plan_type?: string | undefined, rate_basis?: string | undefined, rate_adjustment_factor?: string | undefined, per_unit?: number | undefined, tier_employee?: string | undefined, tier_spouse?: string | undefined, tier_children?: string | undefined, tier_dependents?: string | undefined, tier_ee?: string | undefined, tier_es?: string | undefined, tier_e_s1c?: string | undefined, tier_e_s2c?: string | undefined, tier_e_s3c?: string | undefined, tier_e1c?: string | undefined, tier_e2c?: string | undefined, tier_e3c?: string | undefined, tier_rates_tobacco?: Array | undefined, tier_table_rates_ee_only?: Array | undefined, tier_table_rates_eesp?: Array | undefined, tier_table_rates_e_e1ch?: Array | undefined, tier_table_rates_eech?: Array | undefined, tier_table_rates_family?: Array | undefined, tier_table_rates_ee_only_tobacco?: Array | undefined, tier_table_rates_eesp_tobacco?: Array | undefined, tier_table_rates_e_e1ch_tobacco?: Array | undefined, tier_table_rates_eech_tobacco?: Array | undefined, tier_table_rates_family_tobacco?: Array | undefined, tier_table_rates_ee_only_male?: Array | undefined, tier_table_rates_eesp_male?: Array | undefined, tier_table_rates_e_e1ch_male?: Array | undefined, tier_table_rates_eech_male?: Array | undefined, tier_table_rates_family_male?: Array | undefined, tier_table_rates_ee_only_female?: Array | undefined, tier_table_rates_eesp_female?: Array | undefined, tier_table_rates_e_e1ch_female?: Array | undefined, tier_table_rates_eech_female?: Array | undefined, tier_table_rates_family_female?: Array | undefined, table_columns?: ('Rates' | 'Employee & Spouse Rates' | 'Gender Rates' | 'Tobacco Rates' | 'Gender & Tobacco Rates' | 'Employee & Spouse & Tobacco Rates' | 'Employee & Spouse & Child Rates') | undefined, tier_table_columns?: ('Rates' | 'Gender Rates' | 'Tobacco Rates') | undefined, table_rates?: Array | undefined, table_employee?: Array | undefined, table_spouse?: Array | undefined, table_employee_tobacco?: Array | undefined, table_spouse_tobacco?: Array | undefined, table_child?: Array | undefined, table_male?: Array | undefined, table_female?: Array | undefined, table_tobacco?: Array | undefined, table_male_tobacco?: Array | undefined, table_female_tobacco?: Array | undefined, table_child1?: string | undefined, table_child2?: string | undefined, table_child3?: string | undefined, age_band_type?: ('All Ages (starting with 0-17)' | 'All Ages' | '5 Year Age Bands' | '10 Year Age Bands') | undefined, base_spouse_age_off_employee?: boolean | undefined, base_spouse_tobacco_off_employee?: boolean | undefined, base_adult_children_off_age?: boolean | undefined, rate_library_plan_id?: string | undefined, rate_library_name?: string | undefined}; export type PatchApiVVersionEligibilitiesIdRatesArgs = {id: string, version: string, body: DtosEligibilityRates}; export type PatchApiVVersionEligibilitiesIdRatesOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * eligibility rates * * PATCH /v{version}/eligibilities/{id}/rates */ export const patchApiVVersionEligibilitiesIdRates = async (args: PatchApiVVersionEligibilitiesIdRatesArgs, options: PatchApiVVersionEligibilitiesIdRatesOptions) => { 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))}/rates${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 };