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_ContainerRequestList(ctx context.Context, options arvados.ListOptions) (arvados.ContainerRequestList, error) {
63 var merged arvados.ContainerRequestList
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.ContainerRequestList(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.ContainerRequest{}
102 func (conn *Conn) generated_GroupList(ctx context.Context, options arvados.ListOptions) (arvados.GroupList, error) {
104 var merged arvados.GroupList
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.GroupList(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.Group{}
143 func (conn *Conn) generated_SpecimenList(ctx context.Context, options arvados.ListOptions) (arvados.SpecimenList, error) {
145 var merged arvados.SpecimenList
146 var needSort atomic.Value
147 needSort.Store(false)
148 err := conn.splitListRequest(ctx, options, func(ctx context.Context, _ string, backend arvados.API, options arvados.ListOptions) ([]string, error) {
149 options.ForwardedFor = conn.cluster.ClusterID + "-" + options.ForwardedFor
150 cl, err := backend.SpecimenList(ctx, options)
156 if len(merged.Items) == 0 {
158 } else if len(cl.Items) > 0 {
159 merged.Items = append(merged.Items, cl.Items...)
162 uuids := make([]string, 0, len(cl.Items))
163 for _, item := range cl.Items {
164 uuids = append(uuids, item.UUID)
168 if needSort.Load().(bool) {
169 // Apply the default/implied order, "modified_at desc"
170 sort.Slice(merged.Items, func(i, j int) bool {
171 mi, mj := merged.Items[i].ModifiedAt, merged.Items[j].ModifiedAt
175 if merged.Items == nil {
176 // Return empty results as [], not null
177 // (https://github.com/golang/go/issues/27589 might be
178 // a better solution in the future)
179 merged.Items = []arvados.Specimen{}
184 func (conn *Conn) generated_UserList(ctx context.Context, options arvados.ListOptions) (arvados.UserList, error) {
186 var merged arvados.UserList
187 var needSort atomic.Value
188 needSort.Store(false)
189 err := conn.splitListRequest(ctx, options, func(ctx context.Context, _ string, backend arvados.API, options arvados.ListOptions) ([]string, error) {
190 options.ForwardedFor = conn.cluster.ClusterID + "-" + options.ForwardedFor
191 cl, err := backend.UserList(ctx, options)
197 if len(merged.Items) == 0 {
199 } else if len(cl.Items) > 0 {
200 merged.Items = append(merged.Items, cl.Items...)
203 uuids := make([]string, 0, len(cl.Items))
204 for _, item := range cl.Items {
205 uuids = append(uuids, item.UUID)
209 if needSort.Load().(bool) {
210 // Apply the default/implied order, "modified_at desc"
211 sort.Slice(merged.Items, func(i, j int) bool {
212 mi, mj := merged.Items[i].ModifiedAt, merged.Items[j].ModifiedAt
216 if merged.Items == nil {
217 // Return empty results as [], not null
218 // (https://github.com/golang/go/issues/27589 might be
219 // a better solution in the future)
220 merged.Items = []arvados.User{}