From 55eb966d46ed3b59786ad2c977e2cd160704cef7 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 14 Feb 2015 14:35:36 -0800 Subject: [PATCH] Add support to read modifier data in metadata --- dropbox.go | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/dropbox.go b/dropbox.go index 27fd92b..b684e01 100644 --- a/dropbox.go +++ b/dropbox.go @@ -157,22 +157,29 @@ func (dbt DBTime) MarshalJSON() ([]byte, error) { return json.Marshal(time.Time(dbt).Format(DateFormat)) } +// Represents the user who made a change on a particular file +type Modifier struct { + Uid int64 `json:"uid"` + DisplayName string `json:"display_name"` +} + // Entry represents the metadata of a file or folder. type Entry struct { - Bytes int `json:"bytes,omitempty"` // Size of the file in bytes. - ClientMtime DBTime `json:"client_mtime,omitempty"` // Modification time set by the client when added. - Contents []Entry `json:"contents,omitempty"` // List of children for a directory. - Hash string `json:"hash,omitempty"` // Hash of this entry. - Icon string `json:"icon,omitempty"` // Name of the icon displayed for this entry. - IsDeleted bool `json:"is_deleted,omitempty"` // true if this entry was deleted. - IsDir bool `json:"is_dir,omitempty"` // true if this entry is a directory. - MimeType string `json:"mime_type,omitempty"` // MimeType of this entry. - Modified DBTime `json:"modified,omitempty"` // Date of last modification. - Path string `json:"path,omitempty"` // Absolute path of this entry. - Revision string `json:"rev,omitempty"` // Unique ID for this file revision. - Root string `json:"root,omitempty"` // dropbox or sandbox. - Size string `json:"size,omitempty"` // Size of the file humanized/localized. - ThumbExists bool `json:"thumb_exists,omitempty"` // true if a thumbnail is available for this entry. + Bytes int `json:"bytes,omitempty"` // Size of the file in bytes. + ClientMtime DBTime `json:"client_mtime,omitempty"` // Modification time set by the client when added. + Contents []Entry `json:"contents,omitempty"` // List of children for a directory. + Hash string `json:"hash,omitempty"` // Hash of this entry. + Icon string `json:"icon,omitempty"` // Name of the icon displayed for this entry. + IsDeleted bool `json:"is_deleted,omitempty"` // true if this entry was deleted. + IsDir bool `json:"is_dir,omitempty"` // true if this entry is a directory. + MimeType string `json:"mime_type,omitempty"` // MimeType of this entry. + Modified DBTime `json:"modified,omitempty"` // Date of last modification. + Path string `json:"path,omitempty"` // Absolute path of this entry. + Revision string `json:"rev,omitempty"` // Unique ID for this file revision. + Root string `json:"root,omitempty"` // dropbox or sandbox. + Size string `json:"size,omitempty"` // Size of the file humanized/localized. + ThumbExists bool `json:"thumb_exists,omitempty"` // true if a thumbnail is available for this entry. + Modifier *Modifier `json:"modifier"` // last user to edit the file if in a shared folder } // Link for sharing a file.