1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
13 "git.arvados.org/arvados.git/sdk/go/arvados"
17 // -- this file is auto-generated -- do not edit -- edit list.go and run "go generate" instead --
20 func (conn *Conn) generated_ContainerList(ctx context.Context, options arvados.ListOptions) (arvados.ContainerList, error) {
22 var merged arvados.ContainerList
23 var needSort atomic.Value
25 err := conn.splitListRequest(ctx, options, func(ctx context.Context, _ string, backend arvados.API, options arvados.ListOptions) ([]string, error) {
26 options.ForwardedFor = conn.cluster.ClusterID + "-" + options.ForwardedFor
27 cl, err := backend.ContainerList(ctx, options)
33 if len(merged.Items) == 0 {
35 } else if len(cl.Items) > 0 {
36 merged.Items = append(merged.Items, cl.Items...)
39 uuids := make([]string, 0, len(cl.Items))
40 for _, item := range cl.Items {
41 uuids = append(uuids, item.UUID)
45 if needSort.Load().(bool) {
46 // Apply the default/implied order, "modified_at desc"
47 sort.Slice(merged.Items, func(i, j int) bool {
48 mi, mj := merged.Items[i].ModifiedAt, merged.Items[j].ModifiedAt
52 if merged.Items == nil {
53 // Return empty results as [], not null
54 // (https://github.com/golang/go/issues/27589 might be
55 // a better solution in the future)
56 merged.Items = []arvados.Container{}
61 func (conn *Conn) generated_SpecimenList(ctx context.Context, options arvados.ListOptions) (arvados.SpecimenList, error) {
63 var merged arvados.SpecimenList
64 var needSort atomic.Value
66 err := conn.splitListRequest(ctx, options, func(ctx context.Context, _ string, backend arvados.API, options arvados.ListOptions) ([]string, error) {
67 options.ForwardedFor = conn.cluster.ClusterID + "-" + options.ForwardedFor
68 cl, err := backend.SpecimenList(ctx, options)
74 if len(merged.Items) == 0 {
76 } else if len(cl.Items) > 0 {
77 merged.Items = append(merged.Items, cl.Items...)
80 uuids := make([]string, 0, len(cl.Items))
81 for _, item := range cl.Items {
82 uuids = append(uuids, item.UUID)
86 if needSort.Load().(bool) {
87 // Apply the default/implied order, "modified_at desc"
88 sort.Slice(merged.Items, func(i, j int) bool {
89 mi, mj := merged.Items[i].ModifiedAt, merged.Items[j].ModifiedAt
93 if merged.Items == nil {
94 // Return empty results as [], not null
95 // (https://github.com/golang/go/issues/27589 might be
96 // a better solution in the future)
97 merged.Items = []arvados.Specimen{}
102 func (conn *Conn) generated_UserList(ctx context.Context, options arvados.ListOptions) (arvados.UserList, error) {
104 var merged arvados.UserList
105 var needSort atomic.Value
106 needSort.Store(false)
107 err := conn.splitListRequest(ctx, options, func(ctx context.Context, _ string, backend arvados.API, options arvados.ListOptions) ([]string, error) {
108 options.ForwardedFor = conn.cluster.ClusterID + "-" + options.ForwardedFor
109 cl, err := backend.UserList(ctx, options)
115 if len(merged.Items) == 0 {
117 } else if len(cl.Items) > 0 {
118 merged.Items = append(merged.Items, cl.Items...)
121 uuids := make([]string, 0, len(cl.Items))
122 for _, item := range cl.Items {
123 uuids = append(uuids, item.UUID)
127 if needSort.Load().(bool) {
128 // Apply the default/implied order, "modified_at desc"
129 sort.Slice(merged.Items, func(i, j int) bool {
130 mi, mj := merged.Items[i].ModifiedAt, merged.Items[j].ModifiedAt
134 if merged.Items == nil {
135 // Return empty results as [], not null
136 // (https://github.com/golang/go/issues/27589 might be
137 // a better solution in the future)
138 merged.Items = []arvados.User{}