//native
type Box = {
token: string;
};
/**
* Get metadata cascade policy
* Retrieve a specific metadata cascade policy assigned to a folder.
*/
export async function main(auth: Box, metadata_cascade_policy_id: string) {
const url = new URL(
`https://api.box.com/2.0/metadata_cascade_policies/${metadata_cascade_policy_id}`,
);
const response = await fetch(url, {
method: "GET",
headers: {
Authorization: "Bearer " + auth.token,
},
body: undefined,
});
if (!response.ok) {
const text = await response.text();
throw new Error(`${response.status} ${text}`);
}
return await response.json();
}
Submitted by hugo697 235 days ago