//native
type Box = {
token: string;
};
/**
* Update legal hold policy
* Update legal hold policy.
*/
export async function main(
auth: Box,
legal_hold_policy_id: string,
body: { policy_name?: string; description?: string; release_notes?: string },
) {
const url = new URL(
`https://api.box.com/2.0/legal_hold_policies/${legal_hold_policy_id}`,
);
const response = await fetch(url, {
method: "PUT",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer " + auth.token,
},
body: JSON.stringify(body),
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago