summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorSaturnino Abril <saturnino.abril@gmail.com>2017-03-14 05:34:43 +0900
committerJoram Wilander <jwawilander@gmail.com>2017-03-13 16:34:43 -0400
commit3cbe05e0f48673adf0306cc1fcb97eb224c375ac (patch)
treec8953e75037452a78d75bbe832cf0f3b467d3470 /model
parent8b59a2a2914d7ac0b9f318e6d3208e31fa9dd88e (diff)
downloadchat-3cbe05e0f48673adf0306cc1fcb97eb224c375ac.tar.gz
chat-3cbe05e0f48673adf0306cc1fcb97eb224c375ac.tar.bz2
chat-3cbe05e0f48673adf0306cc1fcb97eb224c375ac.zip
APIv4: GET /files/{file_id}/info (#5591)
Diffstat (limited to 'model')
-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 {