5 // ResourceListParams expresses which results are requested in a
7 type ResourceListParams struct {
8 Select []string `json:"select,omitempty"`
9 Filters []Filter `json:"filters,omitempty"`
10 IncludeTrash bool `json:"include_trash,omitempty"`
11 Limit *int `json:"limit,omitempty"`
12 Offset int `json:"offset,omitempty"`
13 Order string `json:"order,omitempty"`
14 Distinct bool `json:"distinct,omitempty"`
15 Count string `json:"count,omitempty"`
18 // A Filter restricts the set of records returned by a list/index API.
25 // MarshalJSON encodes a Filter in the form expected by the API.
26 func (f *Filter) MarshalJSON() ([]byte, error) {
27 return json.Marshal([]interface{}{f.Attr, f.Operator, f.Operand})