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 IncludeOldVersions bool `json:"include_old_versions,omitempty"`
16 Limit *int `json:"limit,omitempty"`
17 Offset int `json:"offset,omitempty"`
18 Order string `json:"order,omitempty"`
19 Distinct bool `json:"distinct,omitempty"`
20 Count string `json:"count,omitempty"`
23 // A Filter restricts the set of records returned by a list/index API.
30 // MarshalJSON encodes a Filter in the form expected by the API.
31 func (f *Filter) MarshalJSON() ([]byte, error) {
32 return json.Marshal([]interface{}{f.Attr, f.Operator, f.Operand})