@BoxResourceType(value="retention_policy_assignment") public class BoxRetentionPolicyAssignment extends BoxResource
Unless otherwise noted, the methods in this class can throw an unchecked BoxAPIException
(unchecked
meaning that the compiler won't force you to handle it) if an error occurs. If you wish to implement custom error
handling for errors related to the Box REST API, you should capture this exception explicitly.
Modifier and Type | Class and Description |
---|---|
class |
BoxRetentionPolicyAssignment.Info
Contains information about the retention policy.
|
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
ASSIGNMENTS_URL_TEMPLATE
The URL template used for operation with retention policy assignments.
|
static URLTemplate |
FILE_VERSIONS_UNDER_RETENTION_URL_TEMPLATE
The URL template used for operation with file versions under retention with given retention policy assignment ID.
|
static URLTemplate |
FILES_UNDER_RETENTION_URL_TEMPLATE
The URL template used for operation with files under retention with given retention policy assignment ID.
|
static URLTemplate |
RETENTION_POLICY_ASSIGNMENT_URL_TEMPLATE
The URL template used for operation with retention policy assignment with given ID.
|
static String |
TYPE_ENTERPRISE
Type for enterprise policy assignment.
|
static String |
TYPE_FOLDER
Type for folder policy assignment.
|
static String |
TYPE_METADATA
Type for metadata policy assignment.
|
Constructor and Description |
---|
BoxRetentionPolicyAssignment(BoxAPIConnection api,
String id)
Constructs a BoxResource for a resource with a given ID.
|
Modifier and Type | Method and Description |
---|---|
static BoxRetentionPolicyAssignment.Info |
createAssignmentToEnterprise(BoxAPIConnection api,
String policyID)
Assigns retention policy with givenID to the enterprise.
|
static BoxRetentionPolicyAssignment.Info |
createAssignmentToFolder(BoxAPIConnection api,
String policyID,
String folderID)
Assigns retention policy with givenID to the folder.
|
static BoxRetentionPolicyAssignment.Info |
createAssignmentToMetadata(BoxAPIConnection api,
String policyID,
String templateID,
MetadataFieldFilter... filter)
Assigns a retention policy to all items with a given metadata template, optionally matching on fields.
|
static BoxRetentionPolicyAssignment.Info |
createAssignmentToMetadata(BoxAPIConnection api,
String policyID,
String templateID,
String startDateField,
MetadataFieldFilter... filter)
Assigns a retention policy to all items with a given metadata template, optionally matching on fields.
|
void |
delete()
Deletes retention policy assignment.
|
Iterable<BoxFile.Info> |
getFilesUnderRetention(int limit,
String... fields)
Retrieves all files under retention for assignment as Iterable.
|
Iterable<BoxFile.Info> |
getFilesUnderRetention(String... fields)
Retrieves all files under retention for assignment as Iterable.
|
Iterable<BoxFile.Info> |
getFileVersionsUnderRetention(int limit,
String... fields)
Retrieves all file version under retention for assignment as Iterable.
|
Iterable<BoxFile.Info> |
getFileVersionsUnderRetention(String... fields)
Retrieves all file version under retention for assignment as Iterable.
|
BoxRetentionPolicyAssignment.Info |
getInfo(String... fields) |
equals, getAPI, getID, getResourceType, hashCode
public static final String TYPE_FOLDER
public static final String TYPE_ENTERPRISE
public static final String TYPE_METADATA
public static final URLTemplate ASSIGNMENTS_URL_TEMPLATE
public static final URLTemplate RETENTION_POLICY_ASSIGNMENT_URL_TEMPLATE
public static final URLTemplate FILES_UNDER_RETENTION_URL_TEMPLATE
public static final URLTemplate FILE_VERSIONS_UNDER_RETENTION_URL_TEMPLATE
public BoxRetentionPolicyAssignment(BoxAPIConnection api, String id)
api
- the API connection to be used by the resource.id
- the ID of the resource.public static BoxRetentionPolicyAssignment.Info createAssignmentToEnterprise(BoxAPIConnection api, String policyID)
api
- the API connection to be used by the created assignment.policyID
- id of the assigned retention policy.public static BoxRetentionPolicyAssignment.Info createAssignmentToFolder(BoxAPIConnection api, String policyID, String folderID)
api
- the API connection to be used by the created assignment.policyID
- id of the assigned retention policy.folderID
- id of the folder to assign policy to.public static BoxRetentionPolicyAssignment.Info createAssignmentToMetadata(BoxAPIConnection api, String policyID, String templateID, MetadataFieldFilter... filter)
api
- the API connection to be used by the created assignment.policyID
- id of the assigned retention policy.templateID
- the ID of the metadata template to assign the policy to.filter
- optional fields to match against in the metadata template.public static BoxRetentionPolicyAssignment.Info createAssignmentToMetadata(BoxAPIConnection api, String policyID, String templateID, String startDateField, MetadataFieldFilter... filter)
api
- the API connection to be used by the created assignment.policyID
- id of the assigned retention policy.templateID
- the ID of the metadata template to assign the policy to.startDateField
- The date the retention policy assignment begins. This field can be a date field's metadata attribute key id.filter
- optional fields to match against in the metadata template.public BoxRetentionPolicyAssignment.Info getInfo(String... fields)
fields
- the fields to retrieve.public Iterable<BoxFile.Info> getFilesUnderRetention(String... fields)
fields
- the fields to retrieve.public Iterable<BoxFile.Info> getFilesUnderRetention(int limit, String... fields)
limit
- the limit of retrieved entries per page.fields
- the fields to retrieve.public Iterable<BoxFile.Info> getFileVersionsUnderRetention(String... fields)
fields
- the fields to retrieve.public Iterable<BoxFile.Info> getFileVersionsUnderRetention(int limit, String... fields)
limit
- the limit of retrieved entries per page.fields
- the fields to retrieve.public void delete()