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.

  • 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

    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 for finite policies.

    dispositionAction

    If creating a finite policy, the disposition action can be permanently_delete or remove_retention. For indefinite policies, disposition action must be remove_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.

    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,
        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 be permanently_delete or remove_retention. For indefinite policies, disposition action must be remove_retention.

    status

    Used to retire a retention policy if status is set to retired. If not retiring a policy, do not include or set to null.

    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, no id should be provided.

    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.

  • 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

    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.

    Return Value

    Returns either a list of the retention policy assignments associated with the specified retention policy or an error.