//native
/**
* Delete enrollment settings from an employee in a 401k plan
* Delete enrollment settings from an employee in a 401k plan
**Token scopes**: `benefits:write`
*/
export async function main(
auth: RT.Deel,
id: string,
contract_id: string,
plan_id: string,
body: Body
) {
const url = new URL(
`https://api.letsdeel.com/rest/v2/benefits/legal-entities/${id}/contracts/${contract_id}/plans/${plan_id}`
)
const response = await fetch(url, {
method: 'DELETE',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + auth.apiKey
},
body: JSON.stringify(body)
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
/* eslint-disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
/**
* Schema for the 401K Guideline Plan request body.
*/
export interface Body {
/**
* Type of the contribution for 401k.
*/
type: 'ROTH' | 'TRAD' | 'NEC' | 'LOAN'
[k: string]: unknown
}
Submitted by hugo697 235 days ago