@BoxResourceType(value="legal_hold") public class BoxLegalHoldPolicy extends BoxResource
Unless otherwise noted, the methods in this class can throw an unchecked {@link 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 |
BoxLegalHoldPolicy.Info
Contains information about the legal hold policy.
|
Modifier and Type | Field and Description |
---|---|
static URLTemplate |
ALL_LEGAL_HOLD_URL_TEMPLATE
All Legal Hold URL Template.
|
static URLTemplate |
LEGAL_HOLD_ASSIGNMENTS_URL_TEMPLATE
Legal Hold Assignments URL Template.
|
static URLTemplate |
LEGAL_HOLD_URL_TEMPLATE
Legal Hold URL Template.
|
static URLTemplate |
LIST_OF_FILE_VERSION_HOLDS_URL_TEMPLATE
List of File Version Holds URL Template.
|
Constructor and Description |
---|
BoxLegalHoldPolicy(BoxAPIConnection api,
String id)
Constructs a BoxLegalHoldPolicy for a resource with a given ID.
|
Modifier and Type | Method and Description |
---|---|
BoxLegalHoldAssignment.Info |
assignTo(BoxResource resource)
Assigns this legal holds policy to the given box resource.
|
static BoxLegalHoldPolicy.Info |
create(BoxAPIConnection api,
String name)
Creates a new Legal Hold Policy.
|
static BoxLegalHoldPolicy.Info |
create(BoxAPIConnection api,
String name,
String description,
Date filterStartedAt,
Date filterEndedAt)
Creates a new Legal Hold Policy.
|
static BoxLegalHoldPolicy.Info |
createOngoing(BoxAPIConnection api,
String name,
String description)
Creates a new ongoing Legal Hold Policy.
|
void |
delete()
Deletes the legal hold policy.
|
static Iterable<BoxLegalHoldPolicy.Info> |
getAll(BoxAPIConnection api)
Retrieves a list of Legal Hold Policies that belong to your Enterprise as an Iterable.
|
static Iterable<BoxLegalHoldPolicy.Info> |
getAll(BoxAPIConnection api,
String policyName,
int limit,
String... fields)
Retrieves a list of Legal Hold Policies that belong to your Enterprise as an Iterable.
|
Iterable<BoxLegalHoldAssignment.Info> |
getAssignments(String... fields)
Returns iterable containing assignments for this single legal hold policy.
|
Iterable<BoxLegalHoldAssignment.Info> |
getAssignments(String type,
String id,
int limit,
String... fields)
Returns iterable containing assignments for this single legal hold policy.
|
Iterable<BoxFileVersionLegalHold.Info> |
getFileVersionHolds(int limit,
String... fields)
Returns iterable with all non-deleted file version legal holds for this legal hold policy.
|
Iterable<BoxFileVersionLegalHold.Info> |
getFileVersionHolds(String... fields)
Returns iterable with all non-deleted file version legal holds for this legal hold policy.
|
BoxLegalHoldPolicy.Info |
getInfo(String... fields)
Gets information about the Legal Hold.
|
void |
updateInfo(BoxLegalHoldPolicy.Info info)
Updates the information about this retention policy with modified locally info.
|
equals, getAPI, getID, getResourceType, hashCode
public static final URLTemplate LEGAL_HOLD_URL_TEMPLATE
public static final URLTemplate ALL_LEGAL_HOLD_URL_TEMPLATE
public static final URLTemplate LEGAL_HOLD_ASSIGNMENTS_URL_TEMPLATE
public static final URLTemplate LIST_OF_FILE_VERSION_HOLDS_URL_TEMPLATE
public BoxLegalHoldPolicy(BoxAPIConnection api, String id)
api
- the API connection to be used by the resource.id
- the ID of the resource.public static BoxLegalHoldPolicy.Info create(BoxAPIConnection api, String name)
api
- the API connection to be used by the resource.name
- the name of Legal Hold Policy.public static BoxLegalHoldPolicy.Info create(BoxAPIConnection api, String name, String description, Date filterStartedAt, Date filterEndedAt)
api
- the API connection to be used by the resource.name
- the name of Legal Hold Policy.description
- the description of Legal Hold Policy.filterStartedAt
- optional date filter applies to Custodian assignments only.filterEndedAt
- optional date filter applies to Custodian assignments only.public static BoxLegalHoldPolicy.Info createOngoing(BoxAPIConnection api, String name, String description)
api
- the API connection to be used by the resource.name
- the name of Legal Hold Policy.description
- the description of Legal Hold Policy.public static Iterable<BoxLegalHoldPolicy.Info> getAll(BoxAPIConnection api)
api
- api the API connection to be used by the resource.public static Iterable<BoxLegalHoldPolicy.Info> getAll(BoxAPIConnection api, String policyName, int limit, String... fields)
api
- api the API connection to be used by the resource.policyName
- case insensitive prefix-match filter on Policy name.limit
- the limit of retrieved entries per page.fields
- the optional fields to retrieve.public BoxLegalHoldPolicy.Info getInfo(String... fields)
fields
- the fields to retrieve.public void delete()
public void updateInfo(BoxLegalHoldPolicy.Info info)
info
- the updated info.public BoxLegalHoldAssignment.Info assignTo(BoxResource resource)
BoxFile
, BoxFileVersion
, BoxFolder
and BoxUser
are supported.resource
- the box resource to assign legal hold policy to.public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String... fields)
fields
- the fields to retrieve.public Iterable<BoxLegalHoldAssignment.Info> getAssignments(String type, String id, int limit, String... fields)
type
- filter assignments of this type only.
Can be "file_version", "file", "folder", "user" or null if no type filter is necessary.id
- filter assignments to this ID only. Can be null if no id filter is necessary.limit
- the limit of entries per page. Default limit is 100.fields
- the fields to retrieve.public Iterable<BoxFileVersionLegalHold.Info> getFileVersionHolds(String... fields)
fields
- the fields to retrieve.public Iterable<BoxFileVersionLegalHold.Info> getFileVersionHolds(int limit, String... fields)
limit
- the limit of entries per response. The default value is 100.fields
- the fields to retrieve.