A contents model.

interface IModel {
    chunk?: number;
    content: any;
    created: string;
    format: FileFormat;
    hash?: string;
    hash_algorithm?: string;
    indices?: null | readonly number[];
    last_modified: string;
    mimetype: string;
    name: string;
    path: string;
    serverPath?: string;
    size?: number;
    type: string;
    writable: boolean;
}

Properties

chunk?: number

The chunk of the file upload.

content: any

The optional file content.

created: string

File creation timestamp.

format: FileFormat

The format of the file content.

Notes

Only relevant for type: 'file'

hash?: string

The hexdigest hash string of content, if requested (otherwise null). It cannot be null if hash_algorithm is defined.

hash_algorithm?: string

The algorithm used to compute hash value. It cannot be null if hash is defined.

indices?: null | readonly number[]

The indices of the matched characters in the name.

last_modified: string

Last modified timestamp.

mimetype: string

Specify the mime-type of file contents.

Notes

Only non-null when content is present and type is "file".

name: string

Name of the contents file.

Notes

Equivalent to the last part of the path field.

path: string

The full file path.

Notes

It will not start with /, and it will be /-delimited.

serverPath?: string

The path as returned by the server contents API.

Notes

Differently to path it does not include IDrive API prefix.

size?: number

The size of then file in bytes.

type: string

The type of file.

writable: boolean

Whether the requester has permission to edit the file.