Debian Codegraph @

rapidmigrationassessment/apiv1/auxiliary.go

raw
1 // Copyright 2025 Google LLC
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 // Code generated by protoc-gen-go_gapic. DO NOT EDIT.
16
17 package rapidmigrationassessment
18
19 import (
20 "context"
21 "time"
22
23 "cloud.google.com/go/longrunning"
24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
25 rapidmigrationassessmentpb "cloud.google.com/go/rapidmigrationassessment/apiv1/rapidmigrationassessmentpb"
26 gax "github.com/googleapis/gax-go/v2"
27 "google.golang.org/api/iterator"
28 locationpb "google.golang.org/genproto/googleapis/cloud/location"
29 )
30
31 // CreateAnnotationOperation manages a long-running operation from CreateAnnotation.
32 type CreateAnnotationOperation struct {
33 lro *longrunning.Operation
34 pollPath string
35 }
36
37 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
38 //
39 // See documentation of Poll for error-handling information.
40 func (op *CreateAnnotationOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Annotation, error) {
41 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
42 var resp rapidmigrationassessmentpb.Annotation
43 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
44 return nil, err
45 }
46 return &resp, nil
47 }
48
49 // Poll fetches the latest state of the long-running operation.
50 //
51 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
52 //
53 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
54 // the operation has completed with failure, the error is returned and op.Done will return true.
55 // If Poll succeeds and the operation has completed successfully,
56 // op.Done will return true, and the response of the operation is returned.
57 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
58 func (op *CreateAnnotationOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Annotation, error) {
59 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
60 var resp rapidmigrationassessmentpb.Annotation
61 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
62 return nil, err
63 }
64 if !op.Done() {
65 return nil, nil
66 }
67 return &resp, nil
68 }
69
70 // Metadata returns metadata associated with the long-running operation.
71 // Metadata itself does not contact the server, but Poll does.
72 // To get the latest metadata, call this method after a successful call to Poll.
73 // If the metadata is not available, the returned metadata and error are both nil.
74 func (op *CreateAnnotationOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
75 var meta rapidmigrationassessmentpb.OperationMetadata
76 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
77 return nil, nil
78 } else if err != nil {
79 return nil, err
80 }
81 return &meta, nil
82 }
83
84 // Done reports whether the long-running operation has completed.
85 func (op *CreateAnnotationOperation) Done() bool {
86 return op.lro.Done()
87 }
88
89 // Name returns the name of the long-running operation.
90 // The name is assigned by the server and is unique within the service from which the operation is created.
91 func (op *CreateAnnotationOperation) Name() string {
92 return op.lro.Name()
93 }
94
95 // CreateCollectorOperation manages a long-running operation from CreateCollector.
96 type CreateCollectorOperation struct {
97 lro *longrunning.Operation
98 pollPath string
99 }
100
101 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
102 //
103 // See documentation of Poll for error-handling information.
104 func (op *CreateCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
105 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
106 var resp rapidmigrationassessmentpb.Collector
107 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
108 return nil, err
109 }
110 return &resp, nil
111 }
112
113 // Poll fetches the latest state of the long-running operation.
114 //
115 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
116 //
117 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
118 // the operation has completed with failure, the error is returned and op.Done will return true.
119 // If Poll succeeds and the operation has completed successfully,
120 // op.Done will return true, and the response of the operation is returned.
121 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
122 func (op *CreateCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
123 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
124 var resp rapidmigrationassessmentpb.Collector
125 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
126 return nil, err
127 }
128 if !op.Done() {
129 return nil, nil
130 }
131 return &resp, nil
132 }
133
134 // Metadata returns metadata associated with the long-running operation.
135 // Metadata itself does not contact the server, but Poll does.
136 // To get the latest metadata, call this method after a successful call to Poll.
137 // If the metadata is not available, the returned metadata and error are both nil.
138 func (op *CreateCollectorOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
139 var meta rapidmigrationassessmentpb.OperationMetadata
140 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
141 return nil, nil
142 } else if err != nil {
143 return nil, err
144 }
145 return &meta, nil
146 }
147
148 // Done reports whether the long-running operation has completed.
149 func (op *CreateCollectorOperation) Done() bool {
150 return op.lro.Done()
151 }
152
153 // Name returns the name of the long-running operation.
154 // The name is assigned by the server and is unique within the service from which the operation is created.
155 func (op *CreateCollectorOperation) Name() string {
156 return op.lro.Name()
157 }
158
159 // DeleteCollectorOperation manages a long-running operation from DeleteCollector.
160 type DeleteCollectorOperation struct {
161 lro *longrunning.Operation
162 pollPath string
163 }
164
165 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
166 //
167 // See documentation of Poll for error-handling information.
168 func (op *DeleteCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
169 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
170 var resp rapidmigrationassessmentpb.Collector
171 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
172 return nil, err
173 }
174 return &resp, nil
175 }
176
177 // Poll fetches the latest state of the long-running operation.
178 //
179 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
180 //
181 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
182 // the operation has completed with failure, the error is returned and op.Done will return true.
183 // If Poll succeeds and the operation has completed successfully,
184 // op.Done will return true, and the response of the operation is returned.
185 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
186 func (op *DeleteCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
187 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
188 var resp rapidmigrationassessmentpb.Collector
189 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
190 return nil, err
191 }
192 if !op.Done() {
193 return nil, nil
194 }
195 return &resp, nil
196 }
197
198 // Metadata returns metadata associated with the long-running operation.
199 // Metadata itself does not contact the server, but Poll does.
200 // To get the latest metadata, call this method after a successful call to Poll.
201 // If the metadata is not available, the returned metadata and error are both nil.
202 func (op *DeleteCollectorOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
203 var meta rapidmigrationassessmentpb.OperationMetadata
204 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
205 return nil, nil
206 } else if err != nil {
207 return nil, err
208 }
209 return &meta, nil
210 }
211
212 // Done reports whether the long-running operation has completed.
213 func (op *DeleteCollectorOperation) Done() bool {
214 return op.lro.Done()
215 }
216
217 // Name returns the name of the long-running operation.
218 // The name is assigned by the server and is unique within the service from which the operation is created.
219 func (op *DeleteCollectorOperation) Name() string {
220 return op.lro.Name()
221 }
222
223 // PauseCollectorOperation manages a long-running operation from PauseCollector.
224 type PauseCollectorOperation struct {
225 lro *longrunning.Operation
226 pollPath string
227 }
228
229 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
230 //
231 // See documentation of Poll for error-handling information.
232 func (op *PauseCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
233 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
234 var resp rapidmigrationassessmentpb.Collector
235 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
236 return nil, err
237 }
238 return &resp, nil
239 }
240
241 // Poll fetches the latest state of the long-running operation.
242 //
243 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
244 //
245 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
246 // the operation has completed with failure, the error is returned and op.Done will return true.
247 // If Poll succeeds and the operation has completed successfully,
248 // op.Done will return true, and the response of the operation is returned.
249 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
250 func (op *PauseCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
251 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
252 var resp rapidmigrationassessmentpb.Collector
253 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
254 return nil, err
255 }
256 if !op.Done() {
257 return nil, nil
258 }
259 return &resp, nil
260 }
261
262 // Metadata returns metadata associated with the long-running operation.
263 // Metadata itself does not contact the server, but Poll does.
264 // To get the latest metadata, call this method after a successful call to Poll.
265 // If the metadata is not available, the returned metadata and error are both nil.
266 func (op *PauseCollectorOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
267 var meta rapidmigrationassessmentpb.OperationMetadata
268 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
269 return nil, nil
270 } else if err != nil {
271 return nil, err
272 }
273 return &meta, nil
274 }
275
276 // Done reports whether the long-running operation has completed.
277 func (op *PauseCollectorOperation) Done() bool {
278 return op.lro.Done()
279 }
280
281 // Name returns the name of the long-running operation.
282 // The name is assigned by the server and is unique within the service from which the operation is created.
283 func (op *PauseCollectorOperation) Name() string {
284 return op.lro.Name()
285 }
286
287 // RegisterCollectorOperation manages a long-running operation from RegisterCollector.
288 type RegisterCollectorOperation struct {
289 lro *longrunning.Operation
290 pollPath string
291 }
292
293 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
294 //
295 // See documentation of Poll for error-handling information.
296 func (op *RegisterCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
297 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
298 var resp rapidmigrationassessmentpb.Collector
299 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
300 return nil, err
301 }
302 return &resp, nil
303 }
304
305 // Poll fetches the latest state of the long-running operation.
306 //
307 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
308 //
309 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
310 // the operation has completed with failure, the error is returned and op.Done will return true.
311 // If Poll succeeds and the operation has completed successfully,
312 // op.Done will return true, and the response of the operation is returned.
313 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
314 func (op *RegisterCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
315 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
316 var resp rapidmigrationassessmentpb.Collector
317 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
318 return nil, err
319 }
320 if !op.Done() {
321 return nil, nil
322 }
323 return &resp, nil
324 }
325
326 // Metadata returns metadata associated with the long-running operation.
327 // Metadata itself does not contact the server, but Poll does.
328 // To get the latest metadata, call this method after a successful call to Poll.
329 // If the metadata is not available, the returned metadata and error are both nil.
330 func (op *RegisterCollectorOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
331 var meta rapidmigrationassessmentpb.OperationMetadata
332 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
333 return nil, nil
334 } else if err != nil {
335 return nil, err
336 }
337 return &meta, nil
338 }
339
340 // Done reports whether the long-running operation has completed.
341 func (op *RegisterCollectorOperation) Done() bool {
342 return op.lro.Done()
343 }
344
345 // Name returns the name of the long-running operation.
346 // The name is assigned by the server and is unique within the service from which the operation is created.
347 func (op *RegisterCollectorOperation) Name() string {
348 return op.lro.Name()
349 }
350
351 // ResumeCollectorOperation manages a long-running operation from ResumeCollector.
352 type ResumeCollectorOperation struct {
353 lro *longrunning.Operation
354 pollPath string
355 }
356
357 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
358 //
359 // See documentation of Poll for error-handling information.
360 func (op *ResumeCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
361 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
362 var resp rapidmigrationassessmentpb.Collector
363 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
364 return nil, err
365 }
366 return &resp, nil
367 }
368
369 // Poll fetches the latest state of the long-running operation.
370 //
371 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
372 //
373 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
374 // the operation has completed with failure, the error is returned and op.Done will return true.
375 // If Poll succeeds and the operation has completed successfully,
376 // op.Done will return true, and the response of the operation is returned.
377 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
378 func (op *ResumeCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
379 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
380 var resp rapidmigrationassessmentpb.Collector
381 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
382 return nil, err
383 }
384 if !op.Done() {
385 return nil, nil
386 }
387 return &resp, nil
388 }
389
390 // Metadata returns metadata associated with the long-running operation.
391 // Metadata itself does not contact the server, but Poll does.
392 // To get the latest metadata, call this method after a successful call to Poll.
393 // If the metadata is not available, the returned metadata and error are both nil.
394 func (op *ResumeCollectorOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
395 var meta rapidmigrationassessmentpb.OperationMetadata
396 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
397 return nil, nil
398 } else if err != nil {
399 return nil, err
400 }
401 return &meta, nil
402 }
403
404 // Done reports whether the long-running operation has completed.
405 func (op *ResumeCollectorOperation) Done() bool {
406 return op.lro.Done()
407 }
408
409 // Name returns the name of the long-running operation.
410 // The name is assigned by the server and is unique within the service from which the operation is created.
411 func (op *ResumeCollectorOperation) Name() string {
412 return op.lro.Name()
413 }
414
415 // UpdateCollectorOperation manages a long-running operation from UpdateCollector.
416 type UpdateCollectorOperation struct {
417 lro *longrunning.Operation
418 pollPath string
419 }
420
421 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
422 //
423 // See documentation of Poll for error-handling information.
424 func (op *UpdateCollectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
425 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
426 var resp rapidmigrationassessmentpb.Collector
427 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
428 return nil, err
429 }
430 return &resp, nil
431 }
432
433 // Poll fetches the latest state of the long-running operation.
434 //
435 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
436 //
437 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
438 // the operation has completed with failure, the error is returned and op.Done will return true.
439 // If Poll succeeds and the operation has completed successfully,
440 // op.Done will return true, and the response of the operation is returned.
441 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
442 func (op *UpdateCollectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*rapidmigrationassessmentpb.Collector, error) {
443 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
444 var resp rapidmigrationassessmentpb.Collector
445 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
446 return nil, err
447 }
448 if !op.Done() {
449 return nil, nil
450 }
451 return &resp, nil
452 }
453
454 // Metadata returns metadata associated with the long-running operation.
455 // Metadata itself does not contact the server, but Poll does.
456 // To get the latest metadata, call this method after a successful call to Poll.
457 // If the metadata is not available, the returned metadata and error are both nil.
458 func (op *UpdateCollectorOperation) Metadata() (*rapidmigrationassessmentpb.OperationMetadata, error) {
459 var meta rapidmigrationassessmentpb.OperationMetadata
460 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
461 return nil, nil
462 } else if err != nil {
463 return nil, err
464 }
465 return &meta, nil
466 }
467
468 // Done reports whether the long-running operation has completed.
469 func (op *UpdateCollectorOperation) Done() bool {
470 return op.lro.Done()
471 }
472
473 // Name returns the name of the long-running operation.
474 // The name is assigned by the server and is unique within the service from which the operation is created.
475 func (op *UpdateCollectorOperation) Name() string {
476 return op.lro.Name()
477 }
478
479 // CollectorIterator manages a stream of *rapidmigrationassessmentpb.Collector.
480 type CollectorIterator struct {
481 items []*rapidmigrationassessmentpb.Collector
482 pageInfo *iterator.PageInfo
483 nextFunc func() error
484
485 // Response is the raw response for the current page.
486 // It must be cast to the RPC response type.
487 // Calling Next() or InternalFetch() updates this value.
488 Response interface{}
489
490 // InternalFetch is for use by the Google Cloud Libraries only.
491 // It is not part of the stable interface of this package.
492 //
493 // InternalFetch returns results from a single call to the underlying RPC.
494 // The number of results is no greater than pageSize.
495 // If there are no more results, nextPageToken is empty and err is nil.
496 InternalFetch func(pageSize int, pageToken string) (results []*rapidmigrationassessmentpb.Collector, nextPageToken string, err error)
497 }
498
499 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
500 func (it *CollectorIterator) PageInfo() *iterator.PageInfo {
501 return it.pageInfo
502 }
503
504 // Next returns the next result. Its second return value is iterator.Done if there are no more
505 // results. Once Next returns Done, all subsequent calls will return Done.
506 func (it *CollectorIterator) Next() (*rapidmigrationassessmentpb.Collector, error) {
507 var item *rapidmigrationassessmentpb.Collector
508 if err := it.nextFunc(); err != nil {
509 return item, err
510 }
511 item = it.items[0]
512 it.items = it.items[1:]
513 return item, nil
514 }
515
516 func (it *CollectorIterator) bufLen() int {
517 return len(it.items)
518 }
519
520 func (it *CollectorIterator) takeBuf() interface{} {
521 b := it.items
522 it.items = nil
523 return b
524 }
525
526 // LocationIterator manages a stream of *locationpb.Location.
527 type LocationIterator struct {
528 items []*locationpb.Location
529 pageInfo *iterator.PageInfo
530 nextFunc func() error
531
532 // Response is the raw response for the current page.
533 // It must be cast to the RPC response type.
534 // Calling Next() or InternalFetch() updates this value.
535 Response interface{}
536
537 // InternalFetch is for use by the Google Cloud Libraries only.
538 // It is not part of the stable interface of this package.
539 //
540 // InternalFetch returns results from a single call to the underlying RPC.
541 // The number of results is no greater than pageSize.
542 // If there are no more results, nextPageToken is empty and err is nil.
543 InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
544 }
545
546 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
547 func (it *LocationIterator) PageInfo() *iterator.PageInfo {
548 return it.pageInfo
549 }
550
551 // Next returns the next result. Its second return value is iterator.Done if there are no more
552 // results. Once Next returns Done, all subsequent calls will return Done.
553 func (it *LocationIterator) Next() (*locationpb.Location, error) {
554 var item *locationpb.Location
555 if err := it.nextFunc(); err != nil {
556 return item, err
557 }
558 item = it.items[0]
559 it.items = it.items[1:]
560 return item, nil
561 }
562
563 func (it *LocationIterator) bufLen() int {
564 return len(it.items)
565 }
566
567 func (it *LocationIterator) takeBuf() interface{} {
568 b := it.items
569 it.items = nil
570 return b
571 }
572
573 // OperationIterator manages a stream of *longrunningpb.Operation.
574 type OperationIterator struct {
575 items []*longrunningpb.Operation
576 pageInfo *iterator.PageInfo
577 nextFunc func() error
578
579 // Response is the raw response for the current page.
580 // It must be cast to the RPC response type.
581 // Calling Next() or InternalFetch() updates this value.
582 Response interface{}
583
584 // InternalFetch is for use by the Google Cloud Libraries only.
585 // It is not part of the stable interface of this package.
586 //
587 // InternalFetch returns results from a single call to the underlying RPC.
588 // The number of results is no greater than pageSize.
589 // If there are no more results, nextPageToken is empty and err is nil.
590 InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
591 }
592
593 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
594 func (it *OperationIterator) PageInfo() *iterator.PageInfo {
595 return it.pageInfo
596 }
597
598 // Next returns the next result. Its second return value is iterator.Done if there are no more
599 // results. Once Next returns Done, all subsequent calls will return Done.
600 func (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
601 var item *longrunningpb.Operation
602 if err := it.nextFunc(); err != nil {
603 return item, err
604 }
605 item = it.items[0]
606 it.items = it.items[1:]
607 return item, nil
608 }
609
610 func (it *OperationIterator) bufLen() int {
611 return len(it.items)
612 }
613
614 func (it *OperationIterator) takeBuf() interface{} {
615 b := it.items
616 it.items = nil
617 return b
618 }