1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
9 // ResourceListParams expresses which results are requested in a
11 type ResourceListParams struct {
12 Select []string `json:"select,omitempty"`
13 Filters []Filter `json:"filters,omitempty"`
14 IncludeTrash bool `json:"include_trash,omitempty"`
15 Limit *int `json:"limit,omitempty"`
16 Offset int `json:"offset,omitempty"`
17 Order string `json:"order,omitempty"`
18 Distinct bool `json:"distinct,omitempty"`
19 Count string `json:"count,omitempty"`
22 // A Filter restricts the set of records returned by a list/index API.
29 // MarshalJSON encodes a Filter in the form expected by the API.
30 func (f *Filter) MarshalJSON() ([]byte, error) {
31 return json.Marshal([]interface{}{f.Attr, f.Operator, f.Operand})