TrashModule

public class TrashModule

Module for trash management

  • Gets the files, folders and web links that are in the user’s trash.

    Declaration

    Swift

    public func listItems(
        offset: Int? = nil,
        limit: Int? = nil,
        fields: [String]? = nil
    ) -> PagingIterator<FolderItem>

    Parameters

    offset

    The offset of the item at which to begin the response. See offset-based paging for details.

    limit

    The maximum number of items to return. The default is 100 and the maximum is 1,000.

    fields

    String array of fields to include in the response.

    completion

    Returns an iterator of items or a BoxSDKError

  • Get a file that has been moved to the trash.

    Declaration

    Swift

    public func getFile(
        id: String,
        fields: [String]? = nil,
        completion: @escaping Callback<File>
    )

    Parameters

    id

    The identifier of file

    fields

    String array of fields to include in the response.

    completion

    Returns a file response object if successful otherwise a BoxSDKError.

  • Get a folder that has been moved to the trash.

    Declaration

    Swift

    public func getFolder(
        id: String,
        fields: [String]? = nil,
        completion: @escaping Callback<Folder>
    )

    Parameters

    id

    The identifier of folder

    fields

    String array of fields to include in the response.

    completion

    Returns a folder response object if successful otherwise a BoxSDKError.

  • Get a web link that has been moved to the trash.

    Declaration

    Swift

    public func getWebLink(
        id: String,
        fields: [String]? = nil,
        completion: @escaping Callback<WebLink>
    )

    Parameters

    id

    The identifier of web link

    fields

    String array of fields to include in the response.

    completion

    Returns a web link response object if successful otherwise a BoxSDKError.

  • Restores a file that has been moved to the trash.

    Declaration

    Swift

    public func restoreFile(
        id: String,
        name: String? = nil,
        parentFolderId: String? = nil,
        fields: [String]? = nil,
        completion: @escaping Callback<File>
    )

    Parameters

    id

    The identifier of file

    name

    The new name for this file. Only used if file can’t be restored with its previous name due to a conflict.

    parentFolderId

    The ID of the new parent folder. Only used if the previous parent folder no longer exists or the user doesn’t have permission to restore the file there.

    fields

    String array of fields to include in the response.

    completion

    Returns a file response object if successful otherwise a BoxSDKError.

  • Restores a folder that has been moved to the trash.

    Declaration

    Swift

    public func restoreFolder(
        id: String,
        name: String? = nil,
        parentFolderId: String? = nil,
        fields: [String]? = nil,
        completion: @escaping Callback<Folder>
    )

    Parameters

    id

    The identifier of folder

    name

    The new name for this folder. Only used if folder can’t be restored with its previous name due to a conflict.

    parentFolderId

    The ID of the new parent folder. Only used if the previous parent folder no longer exists or the user doesn’t have permission to restore the folder there.

    fields

    String array of fields to include in the response.

    completion

    Returns a folder response object if successful otherwise a BoxSDKError.

  • Restores a web link that has been moved to the trash.

    Declaration

    Swift

    public func restoreWebLink(
        id: String,
        name: String? = nil,
        parentFolderId: String? = nil,
        fields: [String]? = nil,
        completion: @escaping Callback<WebLink>
    )

    Parameters

    id

    The identifier of web link

    name

    The new name for this web link. Only used if the web link can’t be restored with its previous name due to a conflict.

    parentFolderId

    The ID of the new parent folder. Only used if the previous parent folder no longer exists or the user doesn’t have permission to restore the web link there.

    fields

    String array of fields to include in the response.

    completion

    Returns a web link response object if successful otherwise a BoxSDKError.

  • Permanently delete a file that is in the trash. The file will no longer exist in Box. This action cannot be undone.

    Declaration

    Swift

    public func permanentlyDeleteFile(
        id: String,
        completion: @escaping Callback<Void>
    )

    Parameters

    id

    The identifier of file

    completion

    Returns a success or a BoxSDKError.

  • Permanently delete a folder that is in the trash. The folder will no longer exist in Box. This action cannot be undone.

    Declaration

    Swift

    public func permanentlyDeleteFolder(
        id: String,
        completion: @escaping Callback<Void>
    )

    Parameters

    id

    The identifier of folder

    completion

    Returns a success or a BoxSDKError.

  • Permanently delete a web link that is in the trash. The web link will no longer exist in Box. This action cannot be undone.

    Declaration

    Swift

    public func permanentlyDeleteWebLink(
        id: String,
        completion: @escaping Callback<Void>
    )

    Parameters

    id

    The identifier of web link

    completion

    Returns a success or a BoxSDKError.