RetentionPoliciesModule
public class RetentionPoliciesModule
Provides RetentionPolicy management.
-
Retrieves information about a retention policy
Declaration
Swift
public func get( policyId id: String, completion: @escaping Callback<RetentionPolicy> )
Parameters
id
Policy id.
completion
Returns either standard RetentionPolicy object or an error.
-
create(name:
type: length: dispositionAction: canOwnerExtendRetention: areOwnersNotified: customNotificationRecipients: retentionType: completion: ) Creates a new retention policy.
Declaration
Swift
public func create( name: String, type: RetentionPolicyType, length: Int? = nil, dispositionAction: DispositionAction, canOwnerExtendRetention: Bool? = nil, areOwnersNotified: Bool? = nil, customNotificationRecipients: [User]? = nil, retentionType: RetentionType? = nil, completion: @escaping Callback<RetentionPolicy> )
Parameters
name
Name of retention policy to be created.
type
Type of retention policy.
length
The retention_length is the amount of time, in days, to apply the retention policy to the selected content in days. Do not specify for
indefinite
policies. Required forfinite
policies.dispositionAction
If creating a finite policy, the disposition action can be
permanently_delete
orremove_retention
. Forindefinite
policies, disposition action must beremove_retention
.canOwnerExtendRetention
The Owner of a file will be allowed to extend the retention.
areOwnersNotified
The Owner or Co-owner will get notified when a file is nearing expiration.
customNotificationRecipients
Notified users.
retentionType
Specifies the retention type which can be
modifiable
ornon-modifiable
.completion
Returns either standard RetentionPolicy object or an error.
-
Updates existing retention policy.
Declaration
Swift
public func update( policyId id: String, name: String? = nil, dispositionAction: DispositionAction? = nil, status: RetentionPolicyStatus? = nil, setRetentionTypeToNonModifiable: Bool = false, length: Int? = nil, completion: @escaping Callback<RetentionPolicy> )
Parameters
id
Retention policy id.
name
Updated name of retention policy.
dispositionAction
If updating a
finite
policy, the disposition action can bepermanently_delete
orremove_retention
. For indefinite policies, disposition action must beremove_retention
.status
Used to
retire
a retention policy if status is set toretired
. If not retiring a policy, do not include or set to null.setRetentionTypeToNonModifiable
If value is
false
retention type is not changed. If value is true retention type is changed tonon_modifiable
.length
The retention_length is the amount of time, in days, to apply the retention policy to the selected content in days. Do not specify for
indefinite
policies. Required forfinite
policies.completion
Returns either updated retention policy object or an error.
-
Retrieves all of the retention policies for the given enterprise.
Declaration
Swift
public func list( name: String? = nil, type: RetentionPolicyType? = nil, createdByUserId: String? = nil, marker: String? = nil, limit: Int? = nil ) -> PagingIterator<RetentionPolicyEntry>
Parameters
name
A name to filter the retention policies by. A trailing partial match search is performed.
type
A policy type to filter the retention policies by.
createdByUserId
A user id to filter the retention policies by.
marker
The position marker at which to begin the response. See marker-based paging for details.
limit
The maximum number of items to return.
Return Value
Returns pagination iterator to fetch items. Returns the list of all retention policies for the enterprise. If query parameters are given, only the retention policies that match the query parameters are returned.
-
Retrieves information about a retention policy assignment.
Declaration
Swift
public func getAssignment( assignmentId id: String, completion: @escaping Callback<RetentionPolicyAssignment> )
Parameters
id
Retention policy assignment ID.
completion
Either the specified retention policy assignment will be returned upon success or an error.
-
Creates new retention policy assignment to a content.
Declaration
Swift
public func assign( policyId id: String, assignedContentId: String?, assignContentType: RetentionPolicyAssignmentItemType, filterFields: [MetadataFieldFilter]? = nil, completion: @escaping Callback<RetentionPolicyAssignment> )
Parameters
id
The id of the retention policy to assign this content to.
assignedContentId
The id of the content to assign the retention policy to. If assigning to an enterprise set this to nil.
assignContentType
The type of item policy is assigned to. The type can only be one of three attributes: enterprise, folder, or metadata_template.
filterFields
The array of metadata field filters
completion
Returns either new assignment upon success or an error.
-
Remove retention policy assignment
Declaration
Swift
public func deleteAssignment( assignmentId id: String, completion: @escaping Callback<Void> )
Parameters
id
Retention policy assignment ID.
completion
An empty response will be returned upon successful deletion or error if assignment cannot be deleted.
-
Returns a list of all retention policy assignments associated with a specified retention policy.
Declaration
Swift
public func listAssignments( policyId id: String, type: RetentionPolicyAssignmentItemType? = nil, marker: String? = nil, limit: Int? = nil, fields: [String]? = nil ) -> PagingIterator<RetentionPolicyAssignment>
Parameters
id
Retention policy id.
type
The type of the retention policy assignment to retrieve.
marker
The position marker at which to begin the response. See marker-based paging for details.
limit
The maximum number of items to return. The default is 100.
fields
Comma-separated list of fields to include in the response.
Return Value
Returns a pagination iterator to fetch a list of the retention policy assignments associated with the specified retention policy.
-
Retrieves all files under retention for a retention policy assignment.
Declaration
Swift
public func listFilesUnderRetentionForAssignment( retentionPolicyAssignmentId id: String, limit: Int? = nil, marker: String? = nil ) -> PagingIterator<File>
Parameters
retentionPolicyAssignmentId
The id of the retention policy assignment.
limit
The maximum number of items to return in a page.
marker
The position marker at which to begin the response. See marker-based paging for details.
Return Value
Returns a pagination iterator to fetch all files under retention.
-
Retrieves all file versions under retention placed in the file objects for a retention policy assignment .
Declaration
Swift
public func listFileVersionsUnderRetentionForAssignment( retentionPolicyAssignmentId id: String, limit: Int? = nil, marker: String? = nil ) -> PagingIterator<File>
Parameters
retentionPolicyAssignmentId
The id of the retention policy assignment.
limit
The maximum number of items to return in a page.
marker
The position marker at which to begin the response. See marker-based paging for details.
Return Value
Returns a pagination iterator to fetch all file versions under retention .