Debian Codegraph @

automl/apiv1beta1/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 automl
18
19 import (
20 "context"
21 "time"
22
23 automlpb "cloud.google.com/go/automl/apiv1beta1/automlpb"
24 "cloud.google.com/go/longrunning"
25 gax "github.com/googleapis/gax-go/v2"
26 "google.golang.org/api/iterator"
27 )
28
29 // BatchPredictOperation manages a long-running operation from BatchPredict.
30 type BatchPredictOperation struct {
31 lro *longrunning.Operation
32 pollPath string
33 }
34
35 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
36 //
37 // See documentation of Poll for error-handling information.
38 func (op *BatchPredictOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.BatchPredictResult, error) {
39 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
40 var resp automlpb.BatchPredictResult
41 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
42 return nil, err
43 }
44 return &resp, nil
45 }
46
47 // Poll fetches the latest state of the long-running operation.
48 //
49 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
50 //
51 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
52 // the operation has completed with failure, the error is returned and op.Done will return true.
53 // If Poll succeeds and the operation has completed successfully,
54 // op.Done will return true, and the response of the operation is returned.
55 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
56 func (op *BatchPredictOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*automlpb.BatchPredictResult, error) {
57 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
58 var resp automlpb.BatchPredictResult
59 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
60 return nil, err
61 }
62 if !op.Done() {
63 return nil, nil
64 }
65 return &resp, nil
66 }
67
68 // Metadata returns metadata associated with the long-running operation.
69 // Metadata itself does not contact the server, but Poll does.
70 // To get the latest metadata, call this method after a successful call to Poll.
71 // If the metadata is not available, the returned metadata and error are both nil.
72 func (op *BatchPredictOperation) Metadata() (*automlpb.OperationMetadata, error) {
73 var meta automlpb.OperationMetadata
74 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
75 return nil, nil
76 } else if err != nil {
77 return nil, err
78 }
79 return &meta, nil
80 }
81
82 // Done reports whether the long-running operation has completed.
83 func (op *BatchPredictOperation) Done() bool {
84 return op.lro.Done()
85 }
86
87 // Name returns the name of the long-running operation.
88 // The name is assigned by the server and is unique within the service from which the operation is created.
89 func (op *BatchPredictOperation) Name() string {
90 return op.lro.Name()
91 }
92
93 // CreateModelOperation manages a long-running operation from CreateModel.
94 type CreateModelOperation struct {
95 lro *longrunning.Operation
96 pollPath string
97 }
98
99 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
100 //
101 // See documentation of Poll for error-handling information.
102 func (op *CreateModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*automlpb.Model, error) {
103 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
104 var resp automlpb.Model
105 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
106 return nil, err
107 }
108 return &resp, nil
109 }
110
111 // Poll fetches the latest state of the long-running operation.
112 //
113 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
114 //
115 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
116 // the operation has completed with failure, the error is returned and op.Done will return true.
117 // If Poll succeeds and the operation has completed successfully,
118 // op.Done will return true, and the response of the operation is returned.
119 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
120 func (op *CreateModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*automlpb.Model, error) {
121 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
122 var resp automlpb.Model
123 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
124 return nil, err
125 }
126 if !op.Done() {
127 return nil, nil
128 }
129 return &resp, nil
130 }
131
132 // Metadata returns metadata associated with the long-running operation.
133 // Metadata itself does not contact the server, but Poll does.
134 // To get the latest metadata, call this method after a successful call to Poll.
135 // If the metadata is not available, the returned metadata and error are both nil.
136 func (op *CreateModelOperation) Metadata() (*automlpb.OperationMetadata, error) {
137 var meta automlpb.OperationMetadata
138 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
139 return nil, nil
140 } else if err != nil {
141 return nil, err
142 }
143 return &meta, nil
144 }
145
146 // Done reports whether the long-running operation has completed.
147 func (op *CreateModelOperation) Done() bool {
148 return op.lro.Done()
149 }
150
151 // Name returns the name of the long-running operation.
152 // The name is assigned by the server and is unique within the service from which the operation is created.
153 func (op *CreateModelOperation) Name() string {
154 return op.lro.Name()
155 }
156
157 // DeleteDatasetOperation manages a long-running operation from DeleteDataset.
158 type DeleteDatasetOperation struct {
159 lro *longrunning.Operation
160 pollPath string
161 }
162
163 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
164 //
165 // See documentation of Poll for error-handling information.
166 func (op *DeleteDatasetOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
167 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
168 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
169 }
170
171 // Poll fetches the latest state of the long-running operation.
172 //
173 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
174 //
175 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
176 // the operation has completed with failure, the error is returned and op.Done will return true.
177 // If Poll succeeds and the operation has completed successfully,
178 // op.Done will return true, and the response of the operation is returned.
179 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
180 func (op *DeleteDatasetOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
181 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
182 return op.lro.Poll(ctx, nil, opts...)
183 }
184
185 // Metadata returns metadata associated with the long-running operation.
186 // Metadata itself does not contact the server, but Poll does.
187 // To get the latest metadata, call this method after a successful call to Poll.
188 // If the metadata is not available, the returned metadata and error are both nil.
189 func (op *DeleteDatasetOperation) Metadata() (*automlpb.OperationMetadata, error) {
190 var meta automlpb.OperationMetadata
191 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
192 return nil, nil
193 } else if err != nil {
194 return nil, err
195 }
196 return &meta, nil
197 }
198
199 // Done reports whether the long-running operation has completed.
200 func (op *DeleteDatasetOperation) Done() bool {
201 return op.lro.Done()
202 }
203
204 // Name returns the name of the long-running operation.
205 // The name is assigned by the server and is unique within the service from which the operation is created.
206 func (op *DeleteDatasetOperation) Name() string {
207 return op.lro.Name()
208 }
209
210 // DeleteModelOperation manages a long-running operation from DeleteModel.
211 type DeleteModelOperation struct {
212 lro *longrunning.Operation
213 pollPath string
214 }
215
216 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
217 //
218 // See documentation of Poll for error-handling information.
219 func (op *DeleteModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
220 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
221 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
222 }
223
224 // Poll fetches the latest state of the long-running operation.
225 //
226 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
227 //
228 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
229 // the operation has completed with failure, the error is returned and op.Done will return true.
230 // If Poll succeeds and the operation has completed successfully,
231 // op.Done will return true, and the response of the operation is returned.
232 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
233 func (op *DeleteModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
234 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
235 return op.lro.Poll(ctx, nil, opts...)
236 }
237
238 // Metadata returns metadata associated with the long-running operation.
239 // Metadata itself does not contact the server, but Poll does.
240 // To get the latest metadata, call this method after a successful call to Poll.
241 // If the metadata is not available, the returned metadata and error are both nil.
242 func (op *DeleteModelOperation) Metadata() (*automlpb.OperationMetadata, error) {
243 var meta automlpb.OperationMetadata
244 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
245 return nil, nil
246 } else if err != nil {
247 return nil, err
248 }
249 return &meta, nil
250 }
251
252 // Done reports whether the long-running operation has completed.
253 func (op *DeleteModelOperation) Done() bool {
254 return op.lro.Done()
255 }
256
257 // Name returns the name of the long-running operation.
258 // The name is assigned by the server and is unique within the service from which the operation is created.
259 func (op *DeleteModelOperation) Name() string {
260 return op.lro.Name()
261 }
262
263 // DeployModelOperation manages a long-running operation from DeployModel.
264 type DeployModelOperation struct {
265 lro *longrunning.Operation
266 pollPath string
267 }
268
269 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
270 //
271 // See documentation of Poll for error-handling information.
272 func (op *DeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
273 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
274 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
275 }
276
277 // Poll fetches the latest state of the long-running operation.
278 //
279 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
280 //
281 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
282 // the operation has completed with failure, the error is returned and op.Done will return true.
283 // If Poll succeeds and the operation has completed successfully,
284 // op.Done will return true, and the response of the operation is returned.
285 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
286 func (op *DeployModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
287 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
288 return op.lro.Poll(ctx, nil, opts...)
289 }
290
291 // Metadata returns metadata associated with the long-running operation.
292 // Metadata itself does not contact the server, but Poll does.
293 // To get the latest metadata, call this method after a successful call to Poll.
294 // If the metadata is not available, the returned metadata and error are both nil.
295 func (op *DeployModelOperation) Metadata() (*automlpb.OperationMetadata, error) {
296 var meta automlpb.OperationMetadata
297 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
298 return nil, nil
299 } else if err != nil {
300 return nil, err
301 }
302 return &meta, nil
303 }
304
305 // Done reports whether the long-running operation has completed.
306 func (op *DeployModelOperation) Done() bool {
307 return op.lro.Done()
308 }
309
310 // Name returns the name of the long-running operation.
311 // The name is assigned by the server and is unique within the service from which the operation is created.
312 func (op *DeployModelOperation) Name() string {
313 return op.lro.Name()
314 }
315
316 // ExportDataOperation manages a long-running operation from ExportData.
317 type ExportDataOperation struct {
318 lro *longrunning.Operation
319 pollPath string
320 }
321
322 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
323 //
324 // See documentation of Poll for error-handling information.
325 func (op *ExportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
326 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
327 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
328 }
329
330 // Poll fetches the latest state of the long-running operation.
331 //
332 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
333 //
334 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
335 // the operation has completed with failure, the error is returned and op.Done will return true.
336 // If Poll succeeds and the operation has completed successfully,
337 // op.Done will return true, and the response of the operation is returned.
338 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
339 func (op *ExportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
340 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
341 return op.lro.Poll(ctx, nil, opts...)
342 }
343
344 // Metadata returns metadata associated with the long-running operation.
345 // Metadata itself does not contact the server, but Poll does.
346 // To get the latest metadata, call this method after a successful call to Poll.
347 // If the metadata is not available, the returned metadata and error are both nil.
348 func (op *ExportDataOperation) Metadata() (*automlpb.OperationMetadata, error) {
349 var meta automlpb.OperationMetadata
350 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
351 return nil, nil
352 } else if err != nil {
353 return nil, err
354 }
355 return &meta, nil
356 }
357
358 // Done reports whether the long-running operation has completed.
359 func (op *ExportDataOperation) Done() bool {
360 return op.lro.Done()
361 }
362
363 // Name returns the name of the long-running operation.
364 // The name is assigned by the server and is unique within the service from which the operation is created.
365 func (op *ExportDataOperation) Name() string {
366 return op.lro.Name()
367 }
368
369 // ExportEvaluatedExamplesOperation manages a long-running operation from ExportEvaluatedExamples.
370 type ExportEvaluatedExamplesOperation struct {
371 lro *longrunning.Operation
372 pollPath string
373 }
374
375 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
376 //
377 // See documentation of Poll for error-handling information.
378 func (op *ExportEvaluatedExamplesOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
379 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
380 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
381 }
382
383 // Poll fetches the latest state of the long-running operation.
384 //
385 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
386 //
387 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
388 // the operation has completed with failure, the error is returned and op.Done will return true.
389 // If Poll succeeds and the operation has completed successfully,
390 // op.Done will return true, and the response of the operation is returned.
391 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
392 func (op *ExportEvaluatedExamplesOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
393 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
394 return op.lro.Poll(ctx, nil, opts...)
395 }
396
397 // Metadata returns metadata associated with the long-running operation.
398 // Metadata itself does not contact the server, but Poll does.
399 // To get the latest metadata, call this method after a successful call to Poll.
400 // If the metadata is not available, the returned metadata and error are both nil.
401 func (op *ExportEvaluatedExamplesOperation) Metadata() (*automlpb.OperationMetadata, error) {
402 var meta automlpb.OperationMetadata
403 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
404 return nil, nil
405 } else if err != nil {
406 return nil, err
407 }
408 return &meta, nil
409 }
410
411 // Done reports whether the long-running operation has completed.
412 func (op *ExportEvaluatedExamplesOperation) Done() bool {
413 return op.lro.Done()
414 }
415
416 // Name returns the name of the long-running operation.
417 // The name is assigned by the server and is unique within the service from which the operation is created.
418 func (op *ExportEvaluatedExamplesOperation) Name() string {
419 return op.lro.Name()
420 }
421
422 // ExportModelOperation manages a long-running operation from ExportModel.
423 type ExportModelOperation struct {
424 lro *longrunning.Operation
425 pollPath string
426 }
427
428 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
429 //
430 // See documentation of Poll for error-handling information.
431 func (op *ExportModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
432 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
433 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
434 }
435
436 // Poll fetches the latest state of the long-running operation.
437 //
438 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
439 //
440 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
441 // the operation has completed with failure, the error is returned and op.Done will return true.
442 // If Poll succeeds and the operation has completed successfully,
443 // op.Done will return true, and the response of the operation is returned.
444 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
445 func (op *ExportModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
446 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
447 return op.lro.Poll(ctx, nil, opts...)
448 }
449
450 // Metadata returns metadata associated with the long-running operation.
451 // Metadata itself does not contact the server, but Poll does.
452 // To get the latest metadata, call this method after a successful call to Poll.
453 // If the metadata is not available, the returned metadata and error are both nil.
454 func (op *ExportModelOperation) Metadata() (*automlpb.OperationMetadata, error) {
455 var meta automlpb.OperationMetadata
456 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
457 return nil, nil
458 } else if err != nil {
459 return nil, err
460 }
461 return &meta, nil
462 }
463
464 // Done reports whether the long-running operation has completed.
465 func (op *ExportModelOperation) Done() bool {
466 return op.lro.Done()
467 }
468
469 // Name returns the name of the long-running operation.
470 // The name is assigned by the server and is unique within the service from which the operation is created.
471 func (op *ExportModelOperation) Name() string {
472 return op.lro.Name()
473 }
474
475 // ImportDataOperation manages a long-running operation from ImportData.
476 type ImportDataOperation struct {
477 lro *longrunning.Operation
478 pollPath string
479 }
480
481 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
482 //
483 // See documentation of Poll for error-handling information.
484 func (op *ImportDataOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
485 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
486 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
487 }
488
489 // Poll fetches the latest state of the long-running operation.
490 //
491 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
492 //
493 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
494 // the operation has completed with failure, the error is returned and op.Done will return true.
495 // If Poll succeeds and the operation has completed successfully,
496 // op.Done will return true, and the response of the operation is returned.
497 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
498 func (op *ImportDataOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
499 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
500 return op.lro.Poll(ctx, nil, opts...)
501 }
502
503 // Metadata returns metadata associated with the long-running operation.
504 // Metadata itself does not contact the server, but Poll does.
505 // To get the latest metadata, call this method after a successful call to Poll.
506 // If the metadata is not available, the returned metadata and error are both nil.
507 func (op *ImportDataOperation) Metadata() (*automlpb.OperationMetadata, error) {
508 var meta automlpb.OperationMetadata
509 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
510 return nil, nil
511 } else if err != nil {
512 return nil, err
513 }
514 return &meta, nil
515 }
516
517 // Done reports whether the long-running operation has completed.
518 func (op *ImportDataOperation) Done() bool {
519 return op.lro.Done()
520 }
521
522 // Name returns the name of the long-running operation.
523 // The name is assigned by the server and is unique within the service from which the operation is created.
524 func (op *ImportDataOperation) Name() string {
525 return op.lro.Name()
526 }
527
528 // UndeployModelOperation manages a long-running operation from UndeployModel.
529 type UndeployModelOperation struct {
530 lro *longrunning.Operation
531 pollPath string
532 }
533
534 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
535 //
536 // See documentation of Poll for error-handling information.
537 func (op *UndeployModelOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
538 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
539 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
540 }
541
542 // Poll fetches the latest state of the long-running operation.
543 //
544 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
545 //
546 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
547 // the operation has completed with failure, the error is returned and op.Done will return true.
548 // If Poll succeeds and the operation has completed successfully,
549 // op.Done will return true, and the response of the operation is returned.
550 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
551 func (op *UndeployModelOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
552 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
553 return op.lro.Poll(ctx, nil, opts...)
554 }
555
556 // Metadata returns metadata associated with the long-running operation.
557 // Metadata itself does not contact the server, but Poll does.
558 // To get the latest metadata, call this method after a successful call to Poll.
559 // If the metadata is not available, the returned metadata and error are both nil.
560 func (op *UndeployModelOperation) Metadata() (*automlpb.OperationMetadata, error) {
561 var meta automlpb.OperationMetadata
562 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
563 return nil, nil
564 } else if err != nil {
565 return nil, err
566 }
567 return &meta, nil
568 }
569
570 // Done reports whether the long-running operation has completed.
571 func (op *UndeployModelOperation) Done() bool {
572 return op.lro.Done()
573 }
574
575 // Name returns the name of the long-running operation.
576 // The name is assigned by the server and is unique within the service from which the operation is created.
577 func (op *UndeployModelOperation) Name() string {
578 return op.lro.Name()
579 }
580
581 // ColumnSpecIterator manages a stream of *automlpb.ColumnSpec.
582 type ColumnSpecIterator struct {
583 items []*automlpb.ColumnSpec
584 pageInfo *iterator.PageInfo
585 nextFunc func() error
586
587 // Response is the raw response for the current page.
588 // It must be cast to the RPC response type.
589 // Calling Next() or InternalFetch() updates this value.
590 Response interface{}
591
592 // InternalFetch is for use by the Google Cloud Libraries only.
593 // It is not part of the stable interface of this package.
594 //
595 // InternalFetch returns results from a single call to the underlying RPC.
596 // The number of results is no greater than pageSize.
597 // If there are no more results, nextPageToken is empty and err is nil.
598 InternalFetch func(pageSize int, pageToken string) (results []*automlpb.ColumnSpec, nextPageToken string, err error)
599 }
600
601 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
602 func (it *ColumnSpecIterator) PageInfo() *iterator.PageInfo {
603 return it.pageInfo
604 }
605
606 // Next returns the next result. Its second return value is iterator.Done if there are no more
607 // results. Once Next returns Done, all subsequent calls will return Done.
608 func (it *ColumnSpecIterator) Next() (*automlpb.ColumnSpec, error) {
609 var item *automlpb.ColumnSpec
610 if err := it.nextFunc(); err != nil {
611 return item, err
612 }
613 item = it.items[0]
614 it.items = it.items[1:]
615 return item, nil
616 }
617
618 func (it *ColumnSpecIterator) bufLen() int {
619 return len(it.items)
620 }
621
622 func (it *ColumnSpecIterator) takeBuf() interface{} {
623 b := it.items
624 it.items = nil
625 return b
626 }
627
628 // DatasetIterator manages a stream of *automlpb.Dataset.
629 type DatasetIterator struct {
630 items []*automlpb.Dataset
631 pageInfo *iterator.PageInfo
632 nextFunc func() error
633
634 // Response is the raw response for the current page.
635 // It must be cast to the RPC response type.
636 // Calling Next() or InternalFetch() updates this value.
637 Response interface{}
638
639 // InternalFetch is for use by the Google Cloud Libraries only.
640 // It is not part of the stable interface of this package.
641 //
642 // InternalFetch returns results from a single call to the underlying RPC.
643 // The number of results is no greater than pageSize.
644 // If there are no more results, nextPageToken is empty and err is nil.
645 InternalFetch func(pageSize int, pageToken string) (results []*automlpb.Dataset, nextPageToken string, err error)
646 }
647
648 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
649 func (it *DatasetIterator) PageInfo() *iterator.PageInfo {
650 return it.pageInfo
651 }
652
653 // Next returns the next result. Its second return value is iterator.Done if there are no more
654 // results. Once Next returns Done, all subsequent calls will return Done.
655 func (it *DatasetIterator) Next() (*automlpb.Dataset, error) {
656 var item *automlpb.Dataset
657 if err := it.nextFunc(); err != nil {
658 return item, err
659 }
660 item = it.items[0]
661 it.items = it.items[1:]
662 return item, nil
663 }
664
665 func (it *DatasetIterator) bufLen() int {
666 return len(it.items)
667 }
668
669 func (it *DatasetIterator) takeBuf() interface{} {
670 b := it.items
671 it.items = nil
672 return b
673 }
674
675 // ModelEvaluationIterator manages a stream of *automlpb.ModelEvaluation.
676 type ModelEvaluationIterator struct {
677 items []*automlpb.ModelEvaluation
678 pageInfo *iterator.PageInfo
679 nextFunc func() error
680
681 // Response is the raw response for the current page.
682 // It must be cast to the RPC response type.
683 // Calling Next() or InternalFetch() updates this value.
684 Response interface{}
685
686 // InternalFetch is for use by the Google Cloud Libraries only.
687 // It is not part of the stable interface of this package.
688 //
689 // InternalFetch returns results from a single call to the underlying RPC.
690 // The number of results is no greater than pageSize.
691 // If there are no more results, nextPageToken is empty and err is nil.
692 InternalFetch func(pageSize int, pageToken string) (results []*automlpb.ModelEvaluation, nextPageToken string, err error)
693 }
694
695 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
696 func (it *ModelEvaluationIterator) PageInfo() *iterator.PageInfo {
697 return it.pageInfo
698 }
699
700 // Next returns the next result. Its second return value is iterator.Done if there are no more
701 // results. Once Next returns Done, all subsequent calls will return Done.
702 func (it *ModelEvaluationIterator) Next() (*automlpb.ModelEvaluation, error) {
703 var item *automlpb.ModelEvaluation
704 if err := it.nextFunc(); err != nil {
705 return item, err
706 }
707 item = it.items[0]
708 it.items = it.items[1:]
709 return item, nil
710 }
711
712 func (it *ModelEvaluationIterator) bufLen() int {
713 return len(it.items)
714 }
715
716 func (it *ModelEvaluationIterator) takeBuf() interface{} {
717 b := it.items
718 it.items = nil
719 return b
720 }
721
722 // ModelIterator manages a stream of *automlpb.Model.
723 type ModelIterator struct {
724 items []*automlpb.Model
725 pageInfo *iterator.PageInfo
726 nextFunc func() error
727
728 // Response is the raw response for the current page.
729 // It must be cast to the RPC response type.
730 // Calling Next() or InternalFetch() updates this value.
731 Response interface{}
732
733 // InternalFetch is for use by the Google Cloud Libraries only.
734 // It is not part of the stable interface of this package.
735 //
736 // InternalFetch returns results from a single call to the underlying RPC.
737 // The number of results is no greater than pageSize.
738 // If there are no more results, nextPageToken is empty and err is nil.
739 InternalFetch func(pageSize int, pageToken string) (results []*automlpb.Model, nextPageToken string, err error)
740 }
741
742 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
743 func (it *ModelIterator) PageInfo() *iterator.PageInfo {
744 return it.pageInfo
745 }
746
747 // Next returns the next result. Its second return value is iterator.Done if there are no more
748 // results. Once Next returns Done, all subsequent calls will return Done.
749 func (it *ModelIterator) Next() (*automlpb.Model, error) {
750 var item *automlpb.Model
751 if err := it.nextFunc(); err != nil {
752 return item, err
753 }
754 item = it.items[0]
755 it.items = it.items[1:]
756 return item, nil
757 }
758
759 func (it *ModelIterator) bufLen() int {
760 return len(it.items)
761 }
762
763 func (it *ModelIterator) takeBuf() interface{} {
764 b := it.items
765 it.items = nil
766 return b
767 }
768
769 // TableSpecIterator manages a stream of *automlpb.TableSpec.
770 type TableSpecIterator struct {
771 items []*automlpb.TableSpec
772 pageInfo *iterator.PageInfo
773 nextFunc func() error
774
775 // Response is the raw response for the current page.
776 // It must be cast to the RPC response type.
777 // Calling Next() or InternalFetch() updates this value.
778 Response interface{}
779
780 // InternalFetch is for use by the Google Cloud Libraries only.
781 // It is not part of the stable interface of this package.
782 //
783 // InternalFetch returns results from a single call to the underlying RPC.
784 // The number of results is no greater than pageSize.
785 // If there are no more results, nextPageToken is empty and err is nil.
786 InternalFetch func(pageSize int, pageToken string) (results []*automlpb.TableSpec, nextPageToken string, err error)
787 }
788
789 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
790 func (it *TableSpecIterator) PageInfo() *iterator.PageInfo {
791 return it.pageInfo
792 }
793
794 // Next returns the next result. Its second return value is iterator.Done if there are no more
795 // results. Once Next returns Done, all subsequent calls will return Done.
796 func (it *TableSpecIterator) Next() (*automlpb.TableSpec, error) {
797 var item *automlpb.TableSpec
798 if err := it.nextFunc(); err != nil {
799 return item, err
800 }
801 item = it.items[0]
802 it.items = it.items[1:]
803 return item, nil
804 }
805
806 func (it *TableSpecIterator) bufLen() int {
807 return len(it.items)
808 }
809
810 func (it *TableSpecIterator) takeBuf() interface{} {
811 b := it.items
812 it.items = nil
813 return b
814 }