@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 |
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.
|
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.
|
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 URLTemplate ASSIGNMENTS_URL_TEMPLATE
public static final URLTemplate RETENTION_POLICY_ASSIGNMENT_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 BoxRetentionPolicyAssignment.Info getInfo(String... fields)
fields
- the fields to retrieve.