Debian Codegraph @

artifactregistry/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 artifactregistry
18
19 import (
20 "context"
21 "time"
22
23 artifactregistrypb "cloud.google.com/go/artifactregistry/apiv1/artifactregistrypb"
24 "cloud.google.com/go/longrunning"
25 gax "github.com/googleapis/gax-go/v2"
26 "google.golang.org/api/iterator"
27 locationpb "google.golang.org/genproto/googleapis/cloud/location"
28 )
29
30 // BatchDeleteVersionsOperation manages a long-running operation from BatchDeleteVersions.
31 type BatchDeleteVersionsOperation struct {
32 lro *longrunning.Operation
33 pollPath string
34 }
35
36 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
37 //
38 // See documentation of Poll for error-handling information.
39 func (op *BatchDeleteVersionsOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
40 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
41 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
42 }
43
44 // Poll fetches the latest state of the long-running operation.
45 //
46 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
47 //
48 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
49 // the operation has completed with failure, the error is returned and op.Done will return true.
50 // If Poll succeeds and the operation has completed successfully,
51 // op.Done will return true, and the response of the operation is returned.
52 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
53 func (op *BatchDeleteVersionsOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
54 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
55 return op.lro.Poll(ctx, nil, opts...)
56 }
57
58 // Metadata returns metadata associated with the long-running operation.
59 // Metadata itself does not contact the server, but Poll does.
60 // To get the latest metadata, call this method after a successful call to Poll.
61 // If the metadata is not available, the returned metadata and error are both nil.
62 func (op *BatchDeleteVersionsOperation) Metadata() (*artifactregistrypb.BatchDeleteVersionsMetadata, error) {
63 var meta artifactregistrypb.BatchDeleteVersionsMetadata
64 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
65 return nil, nil
66 } else if err != nil {
67 return nil, err
68 }
69 return &meta, nil
70 }
71
72 // Done reports whether the long-running operation has completed.
73 func (op *BatchDeleteVersionsOperation) Done() bool {
74 return op.lro.Done()
75 }
76
77 // Name returns the name of the long-running operation.
78 // The name is assigned by the server and is unique within the service from which the operation is created.
79 func (op *BatchDeleteVersionsOperation) Name() string {
80 return op.lro.Name()
81 }
82
83 // CreateAttachmentOperation manages a long-running operation from CreateAttachment.
84 type CreateAttachmentOperation struct {
85 lro *longrunning.Operation
86 pollPath string
87 }
88
89 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
90 //
91 // See documentation of Poll for error-handling information.
92 func (op *CreateAttachmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.Attachment, error) {
93 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
94 var resp artifactregistrypb.Attachment
95 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
96 return nil, err
97 }
98 return &resp, nil
99 }
100
101 // Poll fetches the latest state of the long-running operation.
102 //
103 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
104 //
105 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
106 // the operation has completed with failure, the error is returned and op.Done will return true.
107 // If Poll succeeds and the operation has completed successfully,
108 // op.Done will return true, and the response of the operation is returned.
109 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
110 func (op *CreateAttachmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.Attachment, error) {
111 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
112 var resp artifactregistrypb.Attachment
113 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
114 return nil, err
115 }
116 if !op.Done() {
117 return nil, nil
118 }
119 return &resp, nil
120 }
121
122 // Metadata returns metadata associated with the long-running operation.
123 // Metadata itself does not contact the server, but Poll does.
124 // To get the latest metadata, call this method after a successful call to Poll.
125 // If the metadata is not available, the returned metadata and error are both nil.
126 func (op *CreateAttachmentOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
127 var meta artifactregistrypb.OperationMetadata
128 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
129 return nil, nil
130 } else if err != nil {
131 return nil, err
132 }
133 return &meta, nil
134 }
135
136 // Done reports whether the long-running operation has completed.
137 func (op *CreateAttachmentOperation) Done() bool {
138 return op.lro.Done()
139 }
140
141 // Name returns the name of the long-running operation.
142 // The name is assigned by the server and is unique within the service from which the operation is created.
143 func (op *CreateAttachmentOperation) Name() string {
144 return op.lro.Name()
145 }
146
147 // CreateRepositoryOperation manages a long-running operation from CreateRepository.
148 type CreateRepositoryOperation struct {
149 lro *longrunning.Operation
150 pollPath string
151 }
152
153 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
154 //
155 // See documentation of Poll for error-handling information.
156 func (op *CreateRepositoryOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.Repository, error) {
157 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
158 var resp artifactregistrypb.Repository
159 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
160 return nil, err
161 }
162 return &resp, nil
163 }
164
165 // Poll fetches the latest state of the long-running operation.
166 //
167 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
168 //
169 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
170 // the operation has completed with failure, the error is returned and op.Done will return true.
171 // If Poll succeeds and the operation has completed successfully,
172 // op.Done will return true, and the response of the operation is returned.
173 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
174 func (op *CreateRepositoryOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.Repository, error) {
175 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
176 var resp artifactregistrypb.Repository
177 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
178 return nil, err
179 }
180 if !op.Done() {
181 return nil, nil
182 }
183 return &resp, nil
184 }
185
186 // Metadata returns metadata associated with the long-running operation.
187 // Metadata itself does not contact the server, but Poll does.
188 // To get the latest metadata, call this method after a successful call to Poll.
189 // If the metadata is not available, the returned metadata and error are both nil.
190 func (op *CreateRepositoryOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
191 var meta artifactregistrypb.OperationMetadata
192 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
193 return nil, nil
194 } else if err != nil {
195 return nil, err
196 }
197 return &meta, nil
198 }
199
200 // Done reports whether the long-running operation has completed.
201 func (op *CreateRepositoryOperation) Done() bool {
202 return op.lro.Done()
203 }
204
205 // Name returns the name of the long-running operation.
206 // The name is assigned by the server and is unique within the service from which the operation is created.
207 func (op *CreateRepositoryOperation) Name() string {
208 return op.lro.Name()
209 }
210
211 // DeleteAttachmentOperation manages a long-running operation from DeleteAttachment.
212 type DeleteAttachmentOperation struct {
213 lro *longrunning.Operation
214 pollPath string
215 }
216
217 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
218 //
219 // See documentation of Poll for error-handling information.
220 func (op *DeleteAttachmentOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
221 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
222 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
223 }
224
225 // Poll fetches the latest state of the long-running operation.
226 //
227 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
228 //
229 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
230 // the operation has completed with failure, the error is returned and op.Done will return true.
231 // If Poll succeeds and the operation has completed successfully,
232 // op.Done will return true, and the response of the operation is returned.
233 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
234 func (op *DeleteAttachmentOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
235 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
236 return op.lro.Poll(ctx, nil, opts...)
237 }
238
239 // Metadata returns metadata associated with the long-running operation.
240 // Metadata itself does not contact the server, but Poll does.
241 // To get the latest metadata, call this method after a successful call to Poll.
242 // If the metadata is not available, the returned metadata and error are both nil.
243 func (op *DeleteAttachmentOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
244 var meta artifactregistrypb.OperationMetadata
245 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
246 return nil, nil
247 } else if err != nil {
248 return nil, err
249 }
250 return &meta, nil
251 }
252
253 // Done reports whether the long-running operation has completed.
254 func (op *DeleteAttachmentOperation) Done() bool {
255 return op.lro.Done()
256 }
257
258 // Name returns the name of the long-running operation.
259 // The name is assigned by the server and is unique within the service from which the operation is created.
260 func (op *DeleteAttachmentOperation) Name() string {
261 return op.lro.Name()
262 }
263
264 // DeleteFileOperation manages a long-running operation from DeleteFile.
265 type DeleteFileOperation struct {
266 lro *longrunning.Operation
267 pollPath string
268 }
269
270 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
271 //
272 // See documentation of Poll for error-handling information.
273 func (op *DeleteFileOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
274 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
275 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
276 }
277
278 // Poll fetches the latest state of the long-running operation.
279 //
280 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
281 //
282 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
283 // the operation has completed with failure, the error is returned and op.Done will return true.
284 // If Poll succeeds and the operation has completed successfully,
285 // op.Done will return true, and the response of the operation is returned.
286 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
287 func (op *DeleteFileOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
288 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
289 return op.lro.Poll(ctx, nil, opts...)
290 }
291
292 // Metadata returns metadata associated with the long-running operation.
293 // Metadata itself does not contact the server, but Poll does.
294 // To get the latest metadata, call this method after a successful call to Poll.
295 // If the metadata is not available, the returned metadata and error are both nil.
296 func (op *DeleteFileOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
297 var meta artifactregistrypb.OperationMetadata
298 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
299 return nil, nil
300 } else if err != nil {
301 return nil, err
302 }
303 return &meta, nil
304 }
305
306 // Done reports whether the long-running operation has completed.
307 func (op *DeleteFileOperation) Done() bool {
308 return op.lro.Done()
309 }
310
311 // Name returns the name of the long-running operation.
312 // The name is assigned by the server and is unique within the service from which the operation is created.
313 func (op *DeleteFileOperation) Name() string {
314 return op.lro.Name()
315 }
316
317 // DeletePackageOperation manages a long-running operation from DeletePackage.
318 type DeletePackageOperation struct {
319 lro *longrunning.Operation
320 pollPath string
321 }
322
323 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
324 //
325 // See documentation of Poll for error-handling information.
326 func (op *DeletePackageOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
327 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
328 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
329 }
330
331 // Poll fetches the latest state of the long-running operation.
332 //
333 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
334 //
335 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
336 // the operation has completed with failure, the error is returned and op.Done will return true.
337 // If Poll succeeds and the operation has completed successfully,
338 // op.Done will return true, and the response of the operation is returned.
339 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
340 func (op *DeletePackageOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
341 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
342 return op.lro.Poll(ctx, nil, opts...)
343 }
344
345 // Metadata returns metadata associated with the long-running operation.
346 // Metadata itself does not contact the server, but Poll does.
347 // To get the latest metadata, call this method after a successful call to Poll.
348 // If the metadata is not available, the returned metadata and error are both nil.
349 func (op *DeletePackageOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
350 var meta artifactregistrypb.OperationMetadata
351 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
352 return nil, nil
353 } else if err != nil {
354 return nil, err
355 }
356 return &meta, nil
357 }
358
359 // Done reports whether the long-running operation has completed.
360 func (op *DeletePackageOperation) Done() bool {
361 return op.lro.Done()
362 }
363
364 // Name returns the name of the long-running operation.
365 // The name is assigned by the server and is unique within the service from which the operation is created.
366 func (op *DeletePackageOperation) Name() string {
367 return op.lro.Name()
368 }
369
370 // DeleteRepositoryOperation manages a long-running operation from DeleteRepository.
371 type DeleteRepositoryOperation struct {
372 lro *longrunning.Operation
373 pollPath string
374 }
375
376 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
377 //
378 // See documentation of Poll for error-handling information.
379 func (op *DeleteRepositoryOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
380 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
381 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
382 }
383
384 // Poll fetches the latest state of the long-running operation.
385 //
386 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
387 //
388 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
389 // the operation has completed with failure, the error is returned and op.Done will return true.
390 // If Poll succeeds and the operation has completed successfully,
391 // op.Done will return true, and the response of the operation is returned.
392 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
393 func (op *DeleteRepositoryOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
394 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
395 return op.lro.Poll(ctx, nil, opts...)
396 }
397
398 // Metadata returns metadata associated with the long-running operation.
399 // Metadata itself does not contact the server, but Poll does.
400 // To get the latest metadata, call this method after a successful call to Poll.
401 // If the metadata is not available, the returned metadata and error are both nil.
402 func (op *DeleteRepositoryOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
403 var meta artifactregistrypb.OperationMetadata
404 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
405 return nil, nil
406 } else if err != nil {
407 return nil, err
408 }
409 return &meta, nil
410 }
411
412 // Done reports whether the long-running operation has completed.
413 func (op *DeleteRepositoryOperation) Done() bool {
414 return op.lro.Done()
415 }
416
417 // Name returns the name of the long-running operation.
418 // The name is assigned by the server and is unique within the service from which the operation is created.
419 func (op *DeleteRepositoryOperation) Name() string {
420 return op.lro.Name()
421 }
422
423 // DeleteVersionOperation manages a long-running operation from DeleteVersion.
424 type DeleteVersionOperation struct {
425 lro *longrunning.Operation
426 pollPath string
427 }
428
429 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
430 //
431 // See documentation of Poll for error-handling information.
432 func (op *DeleteVersionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
433 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
434 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
435 }
436
437 // Poll fetches the latest state of the long-running operation.
438 //
439 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
440 //
441 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
442 // the operation has completed with failure, the error is returned and op.Done will return true.
443 // If Poll succeeds and the operation has completed successfully,
444 // op.Done will return true, and the response of the operation is returned.
445 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
446 func (op *DeleteVersionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
447 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
448 return op.lro.Poll(ctx, nil, opts...)
449 }
450
451 // Metadata returns metadata associated with the long-running operation.
452 // Metadata itself does not contact the server, but Poll does.
453 // To get the latest metadata, call this method after a successful call to Poll.
454 // If the metadata is not available, the returned metadata and error are both nil.
455 func (op *DeleteVersionOperation) Metadata() (*artifactregistrypb.OperationMetadata, error) {
456 var meta artifactregistrypb.OperationMetadata
457 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
458 return nil, nil
459 } else if err != nil {
460 return nil, err
461 }
462 return &meta, nil
463 }
464
465 // Done reports whether the long-running operation has completed.
466 func (op *DeleteVersionOperation) Done() bool {
467 return op.lro.Done()
468 }
469
470 // Name returns the name of the long-running operation.
471 // The name is assigned by the server and is unique within the service from which the operation is created.
472 func (op *DeleteVersionOperation) Name() string {
473 return op.lro.Name()
474 }
475
476 // ImportAptArtifactsOperation manages a long-running operation from ImportAptArtifacts.
477 type ImportAptArtifactsOperation struct {
478 lro *longrunning.Operation
479 pollPath string
480 }
481
482 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
483 //
484 // See documentation of Poll for error-handling information.
485 func (op *ImportAptArtifactsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.ImportAptArtifactsResponse, error) {
486 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
487 var resp artifactregistrypb.ImportAptArtifactsResponse
488 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
489 return nil, err
490 }
491 return &resp, nil
492 }
493
494 // Poll fetches the latest state of the long-running operation.
495 //
496 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
497 //
498 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
499 // the operation has completed with failure, the error is returned and op.Done will return true.
500 // If Poll succeeds and the operation has completed successfully,
501 // op.Done will return true, and the response of the operation is returned.
502 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
503 func (op *ImportAptArtifactsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.ImportAptArtifactsResponse, error) {
504 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
505 var resp artifactregistrypb.ImportAptArtifactsResponse
506 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
507 return nil, err
508 }
509 if !op.Done() {
510 return nil, nil
511 }
512 return &resp, nil
513 }
514
515 // Metadata returns metadata associated with the long-running operation.
516 // Metadata itself does not contact the server, but Poll does.
517 // To get the latest metadata, call this method after a successful call to Poll.
518 // If the metadata is not available, the returned metadata and error are both nil.
519 func (op *ImportAptArtifactsOperation) Metadata() (*artifactregistrypb.ImportAptArtifactsMetadata, error) {
520 var meta artifactregistrypb.ImportAptArtifactsMetadata
521 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
522 return nil, nil
523 } else if err != nil {
524 return nil, err
525 }
526 return &meta, nil
527 }
528
529 // Done reports whether the long-running operation has completed.
530 func (op *ImportAptArtifactsOperation) Done() bool {
531 return op.lro.Done()
532 }
533
534 // Name returns the name of the long-running operation.
535 // The name is assigned by the server and is unique within the service from which the operation is created.
536 func (op *ImportAptArtifactsOperation) Name() string {
537 return op.lro.Name()
538 }
539
540 // ImportYumArtifactsOperation manages a long-running operation from ImportYumArtifacts.
541 type ImportYumArtifactsOperation struct {
542 lro *longrunning.Operation
543 pollPath string
544 }
545
546 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
547 //
548 // See documentation of Poll for error-handling information.
549 func (op *ImportYumArtifactsOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.ImportYumArtifactsResponse, error) {
550 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
551 var resp artifactregistrypb.ImportYumArtifactsResponse
552 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
553 return nil, err
554 }
555 return &resp, nil
556 }
557
558 // Poll fetches the latest state of the long-running operation.
559 //
560 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
561 //
562 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
563 // the operation has completed with failure, the error is returned and op.Done will return true.
564 // If Poll succeeds and the operation has completed successfully,
565 // op.Done will return true, and the response of the operation is returned.
566 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
567 func (op *ImportYumArtifactsOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*artifactregistrypb.ImportYumArtifactsResponse, error) {
568 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
569 var resp artifactregistrypb.ImportYumArtifactsResponse
570 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
571 return nil, err
572 }
573 if !op.Done() {
574 return nil, nil
575 }
576 return &resp, nil
577 }
578
579 // Metadata returns metadata associated with the long-running operation.
580 // Metadata itself does not contact the server, but Poll does.
581 // To get the latest metadata, call this method after a successful call to Poll.
582 // If the metadata is not available, the returned metadata and error are both nil.
583 func (op *ImportYumArtifactsOperation) Metadata() (*artifactregistrypb.ImportYumArtifactsMetadata, error) {
584 var meta artifactregistrypb.ImportYumArtifactsMetadata
585 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
586 return nil, nil
587 } else if err != nil {
588 return nil, err
589 }
590 return &meta, nil
591 }
592
593 // Done reports whether the long-running operation has completed.
594 func (op *ImportYumArtifactsOperation) Done() bool {
595 return op.lro.Done()
596 }
597
598 // Name returns the name of the long-running operation.
599 // The name is assigned by the server and is unique within the service from which the operation is created.
600 func (op *ImportYumArtifactsOperation) Name() string {
601 return op.lro.Name()
602 }
603
604 // AttachmentIterator manages a stream of *artifactregistrypb.Attachment.
605 type AttachmentIterator struct {
606 items []*artifactregistrypb.Attachment
607 pageInfo *iterator.PageInfo
608 nextFunc func() error
609
610 // Response is the raw response for the current page.
611 // It must be cast to the RPC response type.
612 // Calling Next() or InternalFetch() updates this value.
613 Response interface{}
614
615 // InternalFetch is for use by the Google Cloud Libraries only.
616 // It is not part of the stable interface of this package.
617 //
618 // InternalFetch returns results from a single call to the underlying RPC.
619 // The number of results is no greater than pageSize.
620 // If there are no more results, nextPageToken is empty and err is nil.
621 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.Attachment, nextPageToken string, err error)
622 }
623
624 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
625 func (it *AttachmentIterator) PageInfo() *iterator.PageInfo {
626 return it.pageInfo
627 }
628
629 // Next returns the next result. Its second return value is iterator.Done if there are no more
630 // results. Once Next returns Done, all subsequent calls will return Done.
631 func (it *AttachmentIterator) Next() (*artifactregistrypb.Attachment, error) {
632 var item *artifactregistrypb.Attachment
633 if err := it.nextFunc(); err != nil {
634 return item, err
635 }
636 item = it.items[0]
637 it.items = it.items[1:]
638 return item, nil
639 }
640
641 func (it *AttachmentIterator) bufLen() int {
642 return len(it.items)
643 }
644
645 func (it *AttachmentIterator) takeBuf() interface{} {
646 b := it.items
647 it.items = nil
648 return b
649 }
650
651 // DockerImageIterator manages a stream of *artifactregistrypb.DockerImage.
652 type DockerImageIterator struct {
653 items []*artifactregistrypb.DockerImage
654 pageInfo *iterator.PageInfo
655 nextFunc func() error
656
657 // Response is the raw response for the current page.
658 // It must be cast to the RPC response type.
659 // Calling Next() or InternalFetch() updates this value.
660 Response interface{}
661
662 // InternalFetch is for use by the Google Cloud Libraries only.
663 // It is not part of the stable interface of this package.
664 //
665 // InternalFetch returns results from a single call to the underlying RPC.
666 // The number of results is no greater than pageSize.
667 // If there are no more results, nextPageToken is empty and err is nil.
668 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.DockerImage, nextPageToken string, err error)
669 }
670
671 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
672 func (it *DockerImageIterator) PageInfo() *iterator.PageInfo {
673 return it.pageInfo
674 }
675
676 // Next returns the next result. Its second return value is iterator.Done if there are no more
677 // results. Once Next returns Done, all subsequent calls will return Done.
678 func (it *DockerImageIterator) Next() (*artifactregistrypb.DockerImage, error) {
679 var item *artifactregistrypb.DockerImage
680 if err := it.nextFunc(); err != nil {
681 return item, err
682 }
683 item = it.items[0]
684 it.items = it.items[1:]
685 return item, nil
686 }
687
688 func (it *DockerImageIterator) bufLen() int {
689 return len(it.items)
690 }
691
692 func (it *DockerImageIterator) takeBuf() interface{} {
693 b := it.items
694 it.items = nil
695 return b
696 }
697
698 // FileIterator manages a stream of *artifactregistrypb.File.
699 type FileIterator struct {
700 items []*artifactregistrypb.File
701 pageInfo *iterator.PageInfo
702 nextFunc func() error
703
704 // Response is the raw response for the current page.
705 // It must be cast to the RPC response type.
706 // Calling Next() or InternalFetch() updates this value.
707 Response interface{}
708
709 // InternalFetch is for use by the Google Cloud Libraries only.
710 // It is not part of the stable interface of this package.
711 //
712 // InternalFetch returns results from a single call to the underlying RPC.
713 // The number of results is no greater than pageSize.
714 // If there are no more results, nextPageToken is empty and err is nil.
715 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.File, nextPageToken string, err error)
716 }
717
718 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
719 func (it *FileIterator) PageInfo() *iterator.PageInfo {
720 return it.pageInfo
721 }
722
723 // Next returns the next result. Its second return value is iterator.Done if there are no more
724 // results. Once Next returns Done, all subsequent calls will return Done.
725 func (it *FileIterator) Next() (*artifactregistrypb.File, error) {
726 var item *artifactregistrypb.File
727 if err := it.nextFunc(); err != nil {
728 return item, err
729 }
730 item = it.items[0]
731 it.items = it.items[1:]
732 return item, nil
733 }
734
735 func (it *FileIterator) bufLen() int {
736 return len(it.items)
737 }
738
739 func (it *FileIterator) takeBuf() interface{} {
740 b := it.items
741 it.items = nil
742 return b
743 }
744
745 // LocationIterator manages a stream of *locationpb.Location.
746 type LocationIterator struct {
747 items []*locationpb.Location
748 pageInfo *iterator.PageInfo
749 nextFunc func() error
750
751 // Response is the raw response for the current page.
752 // It must be cast to the RPC response type.
753 // Calling Next() or InternalFetch() updates this value.
754 Response interface{}
755
756 // InternalFetch is for use by the Google Cloud Libraries only.
757 // It is not part of the stable interface of this package.
758 //
759 // InternalFetch returns results from a single call to the underlying RPC.
760 // The number of results is no greater than pageSize.
761 // If there are no more results, nextPageToken is empty and err is nil.
762 InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
763 }
764
765 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
766 func (it *LocationIterator) PageInfo() *iterator.PageInfo {
767 return it.pageInfo
768 }
769
770 // Next returns the next result. Its second return value is iterator.Done if there are no more
771 // results. Once Next returns Done, all subsequent calls will return Done.
772 func (it *LocationIterator) Next() (*locationpb.Location, error) {
773 var item *locationpb.Location
774 if err := it.nextFunc(); err != nil {
775 return item, err
776 }
777 item = it.items[0]
778 it.items = it.items[1:]
779 return item, nil
780 }
781
782 func (it *LocationIterator) bufLen() int {
783 return len(it.items)
784 }
785
786 func (it *LocationIterator) takeBuf() interface{} {
787 b := it.items
788 it.items = nil
789 return b
790 }
791
792 // MavenArtifactIterator manages a stream of *artifactregistrypb.MavenArtifact.
793 type MavenArtifactIterator struct {
794 items []*artifactregistrypb.MavenArtifact
795 pageInfo *iterator.PageInfo
796 nextFunc func() error
797
798 // Response is the raw response for the current page.
799 // It must be cast to the RPC response type.
800 // Calling Next() or InternalFetch() updates this value.
801 Response interface{}
802
803 // InternalFetch is for use by the Google Cloud Libraries only.
804 // It is not part of the stable interface of this package.
805 //
806 // InternalFetch returns results from a single call to the underlying RPC.
807 // The number of results is no greater than pageSize.
808 // If there are no more results, nextPageToken is empty and err is nil.
809 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.MavenArtifact, nextPageToken string, err error)
810 }
811
812 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
813 func (it *MavenArtifactIterator) PageInfo() *iterator.PageInfo {
814 return it.pageInfo
815 }
816
817 // Next returns the next result. Its second return value is iterator.Done if there are no more
818 // results. Once Next returns Done, all subsequent calls will return Done.
819 func (it *MavenArtifactIterator) Next() (*artifactregistrypb.MavenArtifact, error) {
820 var item *artifactregistrypb.MavenArtifact
821 if err := it.nextFunc(); err != nil {
822 return item, err
823 }
824 item = it.items[0]
825 it.items = it.items[1:]
826 return item, nil
827 }
828
829 func (it *MavenArtifactIterator) bufLen() int {
830 return len(it.items)
831 }
832
833 func (it *MavenArtifactIterator) takeBuf() interface{} {
834 b := it.items
835 it.items = nil
836 return b
837 }
838
839 // NpmPackageIterator manages a stream of *artifactregistrypb.NpmPackage.
840 type NpmPackageIterator struct {
841 items []*artifactregistrypb.NpmPackage
842 pageInfo *iterator.PageInfo
843 nextFunc func() error
844
845 // Response is the raw response for the current page.
846 // It must be cast to the RPC response type.
847 // Calling Next() or InternalFetch() updates this value.
848 Response interface{}
849
850 // InternalFetch is for use by the Google Cloud Libraries only.
851 // It is not part of the stable interface of this package.
852 //
853 // InternalFetch returns results from a single call to the underlying RPC.
854 // The number of results is no greater than pageSize.
855 // If there are no more results, nextPageToken is empty and err is nil.
856 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.NpmPackage, nextPageToken string, err error)
857 }
858
859 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
860 func (it *NpmPackageIterator) PageInfo() *iterator.PageInfo {
861 return it.pageInfo
862 }
863
864 // Next returns the next result. Its second return value is iterator.Done if there are no more
865 // results. Once Next returns Done, all subsequent calls will return Done.
866 func (it *NpmPackageIterator) Next() (*artifactregistrypb.NpmPackage, error) {
867 var item *artifactregistrypb.NpmPackage
868 if err := it.nextFunc(); err != nil {
869 return item, err
870 }
871 item = it.items[0]
872 it.items = it.items[1:]
873 return item, nil
874 }
875
876 func (it *NpmPackageIterator) bufLen() int {
877 return len(it.items)
878 }
879
880 func (it *NpmPackageIterator) takeBuf() interface{} {
881 b := it.items
882 it.items = nil
883 return b
884 }
885
886 // PackageIterator manages a stream of *artifactregistrypb.Package.
887 type PackageIterator struct {
888 items []*artifactregistrypb.Package
889 pageInfo *iterator.PageInfo
890 nextFunc func() error
891
892 // Response is the raw response for the current page.
893 // It must be cast to the RPC response type.
894 // Calling Next() or InternalFetch() updates this value.
895 Response interface{}
896
897 // InternalFetch is for use by the Google Cloud Libraries only.
898 // It is not part of the stable interface of this package.
899 //
900 // InternalFetch returns results from a single call to the underlying RPC.
901 // The number of results is no greater than pageSize.
902 // If there are no more results, nextPageToken is empty and err is nil.
903 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.Package, nextPageToken string, err error)
904 }
905
906 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
907 func (it *PackageIterator) PageInfo() *iterator.PageInfo {
908 return it.pageInfo
909 }
910
911 // Next returns the next result. Its second return value is iterator.Done if there are no more
912 // results. Once Next returns Done, all subsequent calls will return Done.
913 func (it *PackageIterator) Next() (*artifactregistrypb.Package, error) {
914 var item *artifactregistrypb.Package
915 if err := it.nextFunc(); err != nil {
916 return item, err
917 }
918 item = it.items[0]
919 it.items = it.items[1:]
920 return item, nil
921 }
922
923 func (it *PackageIterator) bufLen() int {
924 return len(it.items)
925 }
926
927 func (it *PackageIterator) takeBuf() interface{} {
928 b := it.items
929 it.items = nil
930 return b
931 }
932
933 // PythonPackageIterator manages a stream of *artifactregistrypb.PythonPackage.
934 type PythonPackageIterator struct {
935 items []*artifactregistrypb.PythonPackage
936 pageInfo *iterator.PageInfo
937 nextFunc func() error
938
939 // Response is the raw response for the current page.
940 // It must be cast to the RPC response type.
941 // Calling Next() or InternalFetch() updates this value.
942 Response interface{}
943
944 // InternalFetch is for use by the Google Cloud Libraries only.
945 // It is not part of the stable interface of this package.
946 //
947 // InternalFetch returns results from a single call to the underlying RPC.
948 // The number of results is no greater than pageSize.
949 // If there are no more results, nextPageToken is empty and err is nil.
950 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.PythonPackage, nextPageToken string, err error)
951 }
952
953 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
954 func (it *PythonPackageIterator) PageInfo() *iterator.PageInfo {
955 return it.pageInfo
956 }
957
958 // Next returns the next result. Its second return value is iterator.Done if there are no more
959 // results. Once Next returns Done, all subsequent calls will return Done.
960 func (it *PythonPackageIterator) Next() (*artifactregistrypb.PythonPackage, error) {
961 var item *artifactregistrypb.PythonPackage
962 if err := it.nextFunc(); err != nil {
963 return item, err
964 }
965 item = it.items[0]
966 it.items = it.items[1:]
967 return item, nil
968 }
969
970 func (it *PythonPackageIterator) bufLen() int {
971 return len(it.items)
972 }
973
974 func (it *PythonPackageIterator) takeBuf() interface{} {
975 b := it.items
976 it.items = nil
977 return b
978 }
979
980 // RepositoryIterator manages a stream of *artifactregistrypb.Repository.
981 type RepositoryIterator struct {
982 items []*artifactregistrypb.Repository
983 pageInfo *iterator.PageInfo
984 nextFunc func() error
985
986 // Response is the raw response for the current page.
987 // It must be cast to the RPC response type.
988 // Calling Next() or InternalFetch() updates this value.
989 Response interface{}
990
991 // InternalFetch is for use by the Google Cloud Libraries only.
992 // It is not part of the stable interface of this package.
993 //
994 // InternalFetch returns results from a single call to the underlying RPC.
995 // The number of results is no greater than pageSize.
996 // If there are no more results, nextPageToken is empty and err is nil.
997 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.Repository, nextPageToken string, err error)
998 }
999
1000 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1001 func (it *RepositoryIterator) PageInfo() *iterator.PageInfo {
1002 return it.pageInfo
1003 }
1004
1005 // Next returns the next result. Its second return value is iterator.Done if there are no more
1006 // results. Once Next returns Done, all subsequent calls will return Done.
1007 func (it *RepositoryIterator) Next() (*artifactregistrypb.Repository, error) {
1008 var item *artifactregistrypb.Repository
1009 if err := it.nextFunc(); err != nil {
1010 return item, err
1011 }
1012 item = it.items[0]
1013 it.items = it.items[1:]
1014 return item, nil
1015 }
1016
1017 func (it *RepositoryIterator) bufLen() int {
1018 return len(it.items)
1019 }
1020
1021 func (it *RepositoryIterator) takeBuf() interface{} {
1022 b := it.items
1023 it.items = nil
1024 return b
1025 }
1026
1027 // RuleIterator manages a stream of *artifactregistrypb.Rule.
1028 type RuleIterator struct {
1029 items []*artifactregistrypb.Rule
1030 pageInfo *iterator.PageInfo
1031 nextFunc func() error
1032
1033 // Response is the raw response for the current page.
1034 // It must be cast to the RPC response type.
1035 // Calling Next() or InternalFetch() updates this value.
1036 Response interface{}
1037
1038 // InternalFetch is for use by the Google Cloud Libraries only.
1039 // It is not part of the stable interface of this package.
1040 //
1041 // InternalFetch returns results from a single call to the underlying RPC.
1042 // The number of results is no greater than pageSize.
1043 // If there are no more results, nextPageToken is empty and err is nil.
1044 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.Rule, nextPageToken string, err error)
1045 }
1046
1047 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1048 func (it *RuleIterator) PageInfo() *iterator.PageInfo {
1049 return it.pageInfo
1050 }
1051
1052 // Next returns the next result. Its second return value is iterator.Done if there are no more
1053 // results. Once Next returns Done, all subsequent calls will return Done.
1054 func (it *RuleIterator) Next() (*artifactregistrypb.Rule, error) {
1055 var item *artifactregistrypb.Rule
1056 if err := it.nextFunc(); err != nil {
1057 return item, err
1058 }
1059 item = it.items[0]
1060 it.items = it.items[1:]
1061 return item, nil
1062 }
1063
1064 func (it *RuleIterator) bufLen() int {
1065 return len(it.items)
1066 }
1067
1068 func (it *RuleIterator) takeBuf() interface{} {
1069 b := it.items
1070 it.items = nil
1071 return b
1072 }
1073
1074 // TagIterator manages a stream of *artifactregistrypb.Tag.
1075 type TagIterator struct {
1076 items []*artifactregistrypb.Tag
1077 pageInfo *iterator.PageInfo
1078 nextFunc func() error
1079
1080 // Response is the raw response for the current page.
1081 // It must be cast to the RPC response type.
1082 // Calling Next() or InternalFetch() updates this value.
1083 Response interface{}
1084
1085 // InternalFetch is for use by the Google Cloud Libraries only.
1086 // It is not part of the stable interface of this package.
1087 //
1088 // InternalFetch returns results from a single call to the underlying RPC.
1089 // The number of results is no greater than pageSize.
1090 // If there are no more results, nextPageToken is empty and err is nil.
1091 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.Tag, nextPageToken string, err error)
1092 }
1093
1094 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1095 func (it *TagIterator) PageInfo() *iterator.PageInfo {
1096 return it.pageInfo
1097 }
1098
1099 // Next returns the next result. Its second return value is iterator.Done if there are no more
1100 // results. Once Next returns Done, all subsequent calls will return Done.
1101 func (it *TagIterator) Next() (*artifactregistrypb.Tag, error) {
1102 var item *artifactregistrypb.Tag
1103 if err := it.nextFunc(); err != nil {
1104 return item, err
1105 }
1106 item = it.items[0]
1107 it.items = it.items[1:]
1108 return item, nil
1109 }
1110
1111 func (it *TagIterator) bufLen() int {
1112 return len(it.items)
1113 }
1114
1115 func (it *TagIterator) takeBuf() interface{} {
1116 b := it.items
1117 it.items = nil
1118 return b
1119 }
1120
1121 // VersionIterator manages a stream of *artifactregistrypb.Version.
1122 type VersionIterator struct {
1123 items []*artifactregistrypb.Version
1124 pageInfo *iterator.PageInfo
1125 nextFunc func() error
1126
1127 // Response is the raw response for the current page.
1128 // It must be cast to the RPC response type.
1129 // Calling Next() or InternalFetch() updates this value.
1130 Response interface{}
1131
1132 // InternalFetch is for use by the Google Cloud Libraries only.
1133 // It is not part of the stable interface of this package.
1134 //
1135 // InternalFetch returns results from a single call to the underlying RPC.
1136 // The number of results is no greater than pageSize.
1137 // If there are no more results, nextPageToken is empty and err is nil.
1138 InternalFetch func(pageSize int, pageToken string) (results []*artifactregistrypb.Version, nextPageToken string, err error)
1139 }
1140
1141 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1142 func (it *VersionIterator) PageInfo() *iterator.PageInfo {
1143 return it.pageInfo
1144 }
1145
1146 // Next returns the next result. Its second return value is iterator.Done if there are no more
1147 // results. Once Next returns Done, all subsequent calls will return Done.
1148 func (it *VersionIterator) Next() (*artifactregistrypb.Version, error) {
1149 var item *artifactregistrypb.Version
1150 if err := it.nextFunc(); err != nil {
1151 return item, err
1152 }
1153 item = it.items[0]
1154 it.items = it.items[1:]
1155 return item, nil
1156 }
1157
1158 func (it *VersionIterator) bufLen() int {
1159 return len(it.items)
1160 }
1161
1162 func (it *VersionIterator) takeBuf() interface{} {
1163 b := it.items
1164 it.items = nil
1165 return b
1166 }