Files
fnx_web/pixelapi/list.go

32 lines
867 B
Go
Raw Normal View History

2017-12-12 23:33:41 +01:00
package pixelapi
2018-09-10 22:55:31 +02:00
import "time"
2018-01-30 10:29:45 +01:00
// API error constants
const (
ListNotFoundError = "list_not_found"
2017-12-12 23:33:41 +01:00
)
// List information object from the pixeldrain API
type List struct {
2018-10-04 23:36:34 +02:00
Success bool `json:"success"`
ID string `json:"id"`
Title string `json:"title"`
DateCreated time.Time `json:"date_created"`
FileCount int `json:"file_count"`
2020-01-28 12:51:21 +01:00
Files []ListFile `json:"files"`
2017-12-12 23:33:41 +01:00
}
// ListFile information object from the pixeldrain API
type ListFile struct {
2020-01-20 19:55:51 +01:00
DetailHREF string `json:"detail_href"`
Description string `json:"description"`
FileInfo `json:""`
2017-12-12 23:33:41 +01:00
}
2018-01-30 10:29:45 +01:00
// GetList get a List from the pixeldrain API. Errors will be available through
// List.Error. Standard error checks apply.
2020-01-28 12:51:21 +01:00
func (p *PixelAPI) GetList(id string) (resp List, err error) {
return resp, p.jsonRequest("GET", p.apiEndpoint+"/list/"+id, &resp)
2017-12-12 23:33:41 +01:00
}