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
idPolicy id.
completionReturns either standard RetentionPolicy object or an error.
-
create(name:type: length: dispositionAction: canOwnerExtendRetention: areOwnersNotified: customNotificationRecipients: 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, completion: @escaping Callback<RetentionPolicy> )Parameters
nameName of retention policy to be created.
typeType of retention policy.
lengthThe retention_length is the amount of time, in days, to apply the retention policy to the selected content in days. Do not specify for
indefinitepolicies. Required forfinitepolicies.dispositionActionIf creating a finite policy, the disposition action can be
permanently_deleteorremove_retention. Forindefinitepolicies, disposition action must beremove_retention.canOwnerExtendRetentionThe Owner of a file will be allowed to extend the retention.
areOwnersNotifiedThe Owner or Co-owner will get notified when a file is nearing expiration.
customNotificationRecipientsNotified users.
completionReturns 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, completion: @escaping Callback<RetentionPolicy> )Parameters
idRetention policy id.
nameUpdated name of retention policy.
dispositionActionIf updating a
finitepolicy, the disposition action can bepermanently_deleteorremove_retention. For indefinite policies, disposition action must be remove_retention.statusUsed to
retirea retention policy if status is set toretired. If not retiring a policy, do not include or set to null.completionReturns 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
nameA name to filter the retention policies by. A trailing partial match search is performed.
typeA policy type to filter the retention policies by.
createdByUserIdA user id to filter the retention policies by.
markerThe position marker at which to begin the response. See marker-based paging for details.
limitThe 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
idRetention policy assignment ID.
completionEither 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
idThe id of the retention policy to assign this content to.
assignedContentIdThe id of the content to assign the retention policy to. If assigning to an enterprise, no id should be provided.
assignContentTypeThe type of item policy is assigned to. The type can only be one of three attributes: enterprise, folder, or metadata_template.
filterFieldsThe array of metadata field filters
completionReturns either new assignment upon success or an error.
-
Returns a list of all retention policy assignments associated with a specified retention policy.
Declaration
Swift
public func listAssignments( policyId id: String, type: RetentionPolicyType? = nil, marker: String? = nil, limit: Int? = nil ) -> PagingIterator<RetentionPolicyAssignment>Parameters
idRetention policy id.
typeThe type of the retention policy assignment to retrieve.
markerThe position marker at which to begin the response. See marker-based paging for details.
limitThe maximum number of items to return. The default is 100.
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
retentionPolicyAssignmentIdThe id of the retention policy assignment.
limitThe maximum number of items to return in a page.
markerThe 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
retentionPolicyAssignmentIdThe id of the retention policy assignment.
limitThe maximum number of items to return in a page.
markerThe 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 .
RetentionPoliciesModule Class Reference