APIv4: GET /files/{file_id}/info (#5591)

Этот коммит содержится в:
Saturnino Abril
2017-03-14 05:34:43 +09:00
коммит произвёл Joram Wilander
родитель 8b59a2a291
Коммит 3cbe05e0f4
3 изменённых файлов: 99 добавлений и 0 удалений

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

@@ -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 {