Implement GET /posts/{post_id}/files/info endpoint for APIv4 (#5519)

Этот коммит содержится в:
Joram Wilander
2017-02-24 06:15:13 -05:00
коммит произвёл George Goldberg
родитель 80273d0234
Коммит ace228c4e5
3 изменённых файлов: 94 добавлений и 0 удалений

Просмотреть файл

@@ -783,6 +783,16 @@ func (c *Client4) GetFile(fileId string) ([]byte, *Response) {
}
}
// 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 {
return nil, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return FileInfosFromJson(r.Body), BuildResponse(r)
}
}
// General Section
// GetPing will ping the server and to see if it is up and running.