1 | |
2 | |
3 | * Update an existing HRIS Org Structure |
4 | * Update an existing HRIS Org Structure |
5 | **Token scopes**: `organizations:write` |
6 | */ |
7 | export async function main(auth: RT.Deel, hrisOrgStr_id: string, body: Body) { |
8 | const url = new URL( |
9 | `https://api.letsdeel.com/rest/v2/hris/organization_structures/${hrisOrgStr_id}` |
10 | ) |
11 |
|
12 | const response = await fetch(url, { |
13 | method: 'PATCH', |
14 | headers: { |
15 | 'Content-Type': 'application/json', |
16 | Authorization: 'Bearer ' + auth.apiKey |
17 | }, |
18 | body: JSON.stringify(body) |
19 | }) |
20 | if (!response.ok) { |
21 | const text = await response.text() |
22 | throw new Error(`${response.status} ${text}`) |
23 | } |
24 | return await response.json() |
25 | } |
26 |
|
27 | |
28 | |
29 | * This file was automatically generated by json-schema-to-typescript. |
30 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
31 | * and run json-schema-to-typescript to regenerate this file. |
32 | */ |
33 |
|
34 | export interface Body { |
35 | data?: { |
36 | |
37 | * Name of the Org Structure |
38 | */ |
39 | name?: string |
40 | teams: { |
41 | [k: string]: unknown |
42 | }[] |
43 | |
44 | * External ID of the Org Structure |
45 | */ |
46 | external_id?: string |
47 | |
48 | * Enable roles for the Org Structure |
49 | */ |
50 | enable_roles?: boolean |
51 | |
52 | * Enable multiselect for the Org Structure |
53 | */ |
54 | is_multiselect?: boolean |
55 | [k: string]: unknown |
56 | } |
57 | [k: string]: unknown |
58 | } |
59 |
|