File

public class File : BoxModel

File objects in Box, with attributes like who created the file, when it was last modified, and other information.

Properties

  • Declaration

    Swift

    public private(set) var rawData: [String : Any] { get }
  • Box item type

    Declaration

    Swift

    public var type: String
  • id

    Identifier

    Declaration

    Swift

    public let id: String
  • The version information of the file.

    Declaration

    Swift

    public let fileVersion: FileVersion?
  • A unique ID for use with the events.

    Declaration

    Swift

    public let sequenceId: String?
  • The entity tag of this file object.

    Declaration

    Swift

    public let etag: String?
  • The SHA-1 hash of this file.

    Declaration

    Swift

    public let sha1: String?
  • The name of this file.

    Declaration

    Swift

    public let name: String?
  • Indicates the suffix, when available, on the file. By default, set to an empty string. The suffix usually indicates the encoding (file format) of the file contents or usage.

    Declaration

    Swift

    public let `extension`: String?
  • The description of this file.

    Declaration

    Swift

    public let description: String?
  • Size of this file in bytes.

    Declaration

    Swift

    public let size: Int?
  • The path of folders to this item, starting at the root.

    Declaration

    Swift

    public let pathCollection: PathCollection?
  • Description

    Declaration

    Swift

    public let commentCount: Int?
  • The number of comments on this file.

    Declaration

    Swift

    public let createdAt: Date?
  • When this file was last updated on the Box servers.

    Declaration

    Swift

    public let modifiedAt: Date?
  • When this file was moved to the trash.

    Declaration

    Swift

    public let trashedAt: Date?
  • When this file will be permanently deleted.

    Declaration

    Swift

    public let purgedAt: Date?
  • When the content of this file was created.

    Declaration

    Swift

    public let contentCreatedAt: Date?
  • When the content of this file was last modified.

    Declaration

    Swift

    public let contentModifiedAt: Date?
  • Whether the file is a package. Used for Mac Packages used by iWorks.

    Declaration

    Swift

    public let isPackage: Bool?
  • User’s name at the time of upload

    Declaration

    Swift

    public let uploaderDisplayName: String?
  • The user who first created this file.

    Declaration

    Swift

    public let createdBy: User?
  • The user who last updated this file.

    Declaration

    Swift

    public let modifiedBy: User?
  • The user who owns this file.

    Declaration

    Swift

    public let ownedBy: User?
  • The shared link object for this file.

    Declaration

    Swift

    public let sharedLink: SharedLink?
  • The folder containing this file.

    Declaration

    Swift

    public let parent: Folder?
  • Whether this item is deleted or not. Values include active, trashed if the file has been moved to the trash, and deleted if the file has been permanently deleted.

    Declaration

    Swift

    public let itemStatus: ItemStatus?
  • The version number of this file.

    Declaration

    Swift

    public let versionNumber: String?
  • When the file will automatically be deleted, i.e. expired.

    Declaration

    Swift

    public let expiresAt: Date?
  • Permissions that the current user has on this file.

    Declaration

    Swift

    public let permissions: Permissions?
  • An expiring URL for an embedded preview session in an iframe. This URL will expire after 60 seconds and the session will expire after 60 minutes.

    Declaration

    Swift

    public let expiringEmbedLink: ExpiringEmbedLink?
  • The collections that the file belongs to

    Declaration

    Swift

    public let collections: [[String : String]]?
  • The lock held on this file. If there is no lock, this can either be null or have a timestamp in the past.

    Declaration

    Swift

    public let lock: Lock?
  • All tags applied to this file

    Declaration

    Swift

    public let tags: [String]?
  • Whether this file has any collaborators.

    Declaration

    Swift

    public let hasCollaborations: Bool?
  • Whether this file is owned by a user outside of the enterprise.

    Declaration

    Swift

    public let isExternallyOwned: Bool?
  • File collaboration roles allowed by the enterprise administrator.

    Declaration

    Swift

    public let allowedInviteeRoles: [CollaborationRole]?
  • Digital assets created for this file.

    Declaration

    Swift

    public let representations: EntryContainerInnerModel<FileRepresentation>?
  • Details about the classification applied to a Box file

    Declaration

    Swift

    public let classification: Classification?
  • The retention expiration timestamp for the given file

    Declaration

    Swift

    public let dispositionAt: Date?
  • Initializer.

    Throws

    Decoding error.

    Declaration

    Swift

    public required init(json: [String : Any]) throws

    Parameters

    json

    JSON dictionary.