box-node-sdk

RetentionPolicyAssignmentsManager

List retention policy assignments

Returns a list of all retention policy assignments associated with a specified retention policy.

This operation is performed by calling function getRetentionPolicyAssignments.

See the endpoint docs at API Reference.

await client.retentionPolicyAssignments.getRetentionPolicyAssignments(
  retentionPolicy.id,
);

Arguments

Returns

This function returns a value of type RetentionPolicyAssignments.

Returns a list of the retention policy assignments associated with the specified retention policy.

Assign retention policy

Assigns a retention policy to an item.

This operation is performed by calling function createRetentionPolicyAssignment.

See the endpoint docs at API Reference.

await client.retentionPolicyAssignments.createRetentionPolicyAssignment({
  policyId: retentionPolicy.id,
  assignTo: {
    type: 'folder' as CreateRetentionPolicyAssignmentRequestBodyAssignToTypeField,
    id: folder.id,
  } satisfies CreateRetentionPolicyAssignmentRequestBodyAssignToField,
} satisfies CreateRetentionPolicyAssignmentRequestBody);

Arguments

Returns

This function returns a value of type RetentionPolicyAssignment.

Returns a new retention policy assignment object.

Get retention policy assignment

Retrieves a retention policy assignment.

This operation is performed by calling function getRetentionPolicyAssignmentById.

See the endpoint docs at API Reference.

await client.retentionPolicyAssignments.getRetentionPolicyAssignmentById(
  retentionPolicyAssignment.id,
);

Arguments

Returns

This function returns a value of type RetentionPolicyAssignment.

Returns the retention policy assignment object.

Remove retention policy assignment

Removes a retention policy assignment applied to content.

This operation is performed by calling function deleteRetentionPolicyAssignmentById.

See the endpoint docs at API Reference.

await client.retentionPolicyAssignments.deleteRetentionPolicyAssignmentById(
  retentionPolicyAssignment.id,
);

Arguments

Returns

This function returns a value of type undefined.

Returns an empty response when the policy assignment is successfully deleted.

Get files under retention

Returns a list of files under retention for a retention policy assignment.

This operation is performed by calling function getFilesUnderRetentionPolicyAssignment.

See the endpoint docs at API Reference.

await client.retentionPolicyAssignments.getFilesUnderRetentionPolicyAssignment(
  retentionPolicyAssignment.id,
);

Arguments

Returns

This function returns a value of type FilesUnderRetention.

Returns a list of files under retention that are associated with the specified retention policy assignment.