summaryrefslogtreecommitdiffstats
path: root/model/client4.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/client4.go')
-rw-r--r--model/client4.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go
index c45c94be0..16e8bf7d3 100644
--- a/model/client4.go
+++ b/model/client4.go
@@ -1066,6 +1066,16 @@ func (c *Client4) GetFilePreview(fileId string) ([]byte, *Response) {
}
}
+// GetFileInfo gets all the file info objects.
+func (c *Client4) GetFileInfo(fileId string) (*FileInfo, *Response) {
+ if r, err := c.DoApiGet(c.GetFileRoute(fileId)+"/info", ""); err != nil {
+ return nil, &Response{StatusCode: r.StatusCode, Error: err}
+ } else {
+ defer closeBody(r)
+ return FileInfoFromJson(r.Body), BuildResponse(r)
+ }
+}
+
// GetFileInfosForPost gets all the file info objects attached to a post.
func (c *Client4) GetFileInfosForPost(postId string, etag string) ([]*FileInfo, *Response) {
if r, err := c.DoApiGet(c.GetPostRoute(postId)+"/files/info", etag); err != nil {