Debian Codegraph @

oracledatabase/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 oracledatabase
18
19 import (
20 "context"
21 "time"
22
23 "cloud.google.com/go/longrunning"
24 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
25 oracledatabasepb "cloud.google.com/go/oracledatabase/apiv1/oracledatabasepb"
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 // CreateAutonomousDatabaseOperation manages a long-running operation from CreateAutonomousDatabase.
32 type CreateAutonomousDatabaseOperation 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 *CreateAutonomousDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
41 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
42 var resp oracledatabasepb.AutonomousDatabase
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 *CreateAutonomousDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
59 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
60 var resp oracledatabasepb.AutonomousDatabase
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 *CreateAutonomousDatabaseOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
75 var meta oracledatabasepb.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 *CreateAutonomousDatabaseOperation) 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 *CreateAutonomousDatabaseOperation) Name() string {
92 return op.lro.Name()
93 }
94
95 // CreateCloudExadataInfrastructureOperation manages a long-running operation from CreateCloudExadataInfrastructure.
96 type CreateCloudExadataInfrastructureOperation 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 *CreateCloudExadataInfrastructureOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.CloudExadataInfrastructure, error) {
105 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
106 var resp oracledatabasepb.CloudExadataInfrastructure
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 *CreateCloudExadataInfrastructureOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.CloudExadataInfrastructure, error) {
123 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
124 var resp oracledatabasepb.CloudExadataInfrastructure
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 *CreateCloudExadataInfrastructureOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
139 var meta oracledatabasepb.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 *CreateCloudExadataInfrastructureOperation) 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 *CreateCloudExadataInfrastructureOperation) Name() string {
156 return op.lro.Name()
157 }
158
159 // CreateCloudVmClusterOperation manages a long-running operation from CreateCloudVmCluster.
160 type CreateCloudVmClusterOperation 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 *CreateCloudVmClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.CloudVmCluster, error) {
169 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
170 var resp oracledatabasepb.CloudVmCluster
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 *CreateCloudVmClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.CloudVmCluster, error) {
187 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
188 var resp oracledatabasepb.CloudVmCluster
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 *CreateCloudVmClusterOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
203 var meta oracledatabasepb.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 *CreateCloudVmClusterOperation) 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 *CreateCloudVmClusterOperation) Name() string {
220 return op.lro.Name()
221 }
222
223 // DeleteAutonomousDatabaseOperation manages a long-running operation from DeleteAutonomousDatabase.
224 type DeleteAutonomousDatabaseOperation 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 *DeleteAutonomousDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
233 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
234 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
235 }
236
237 // Poll fetches the latest state of the long-running operation.
238 //
239 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
240 //
241 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
242 // the operation has completed with failure, the error is returned and op.Done will return true.
243 // If Poll succeeds and the operation has completed successfully,
244 // op.Done will return true, and the response of the operation is returned.
245 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
246 func (op *DeleteAutonomousDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
247 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
248 return op.lro.Poll(ctx, nil, opts...)
249 }
250
251 // Metadata returns metadata associated with the long-running operation.
252 // Metadata itself does not contact the server, but Poll does.
253 // To get the latest metadata, call this method after a successful call to Poll.
254 // If the metadata is not available, the returned metadata and error are both nil.
255 func (op *DeleteAutonomousDatabaseOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
256 var meta oracledatabasepb.OperationMetadata
257 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
258 return nil, nil
259 } else if err != nil {
260 return nil, err
261 }
262 return &meta, nil
263 }
264
265 // Done reports whether the long-running operation has completed.
266 func (op *DeleteAutonomousDatabaseOperation) Done() bool {
267 return op.lro.Done()
268 }
269
270 // Name returns the name of the long-running operation.
271 // The name is assigned by the server and is unique within the service from which the operation is created.
272 func (op *DeleteAutonomousDatabaseOperation) Name() string {
273 return op.lro.Name()
274 }
275
276 // DeleteCloudExadataInfrastructureOperation manages a long-running operation from DeleteCloudExadataInfrastructure.
277 type DeleteCloudExadataInfrastructureOperation struct {
278 lro *longrunning.Operation
279 pollPath string
280 }
281
282 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
283 //
284 // See documentation of Poll for error-handling information.
285 func (op *DeleteCloudExadataInfrastructureOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
286 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
287 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
288 }
289
290 // Poll fetches the latest state of the long-running operation.
291 //
292 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
293 //
294 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
295 // the operation has completed with failure, the error is returned and op.Done will return true.
296 // If Poll succeeds and the operation has completed successfully,
297 // op.Done will return true, and the response of the operation is returned.
298 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
299 func (op *DeleteCloudExadataInfrastructureOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
300 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
301 return op.lro.Poll(ctx, nil, opts...)
302 }
303
304 // Metadata returns metadata associated with the long-running operation.
305 // Metadata itself does not contact the server, but Poll does.
306 // To get the latest metadata, call this method after a successful call to Poll.
307 // If the metadata is not available, the returned metadata and error are both nil.
308 func (op *DeleteCloudExadataInfrastructureOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
309 var meta oracledatabasepb.OperationMetadata
310 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
311 return nil, nil
312 } else if err != nil {
313 return nil, err
314 }
315 return &meta, nil
316 }
317
318 // Done reports whether the long-running operation has completed.
319 func (op *DeleteCloudExadataInfrastructureOperation) Done() bool {
320 return op.lro.Done()
321 }
322
323 // Name returns the name of the long-running operation.
324 // The name is assigned by the server and is unique within the service from which the operation is created.
325 func (op *DeleteCloudExadataInfrastructureOperation) Name() string {
326 return op.lro.Name()
327 }
328
329 // DeleteCloudVmClusterOperation manages a long-running operation from DeleteCloudVmCluster.
330 type DeleteCloudVmClusterOperation struct {
331 lro *longrunning.Operation
332 pollPath string
333 }
334
335 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
336 //
337 // See documentation of Poll for error-handling information.
338 func (op *DeleteCloudVmClusterOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
339 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
340 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
341 }
342
343 // Poll fetches the latest state of the long-running operation.
344 //
345 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
346 //
347 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
348 // the operation has completed with failure, the error is returned and op.Done will return true.
349 // If Poll succeeds and the operation has completed successfully,
350 // op.Done will return true, and the response of the operation is returned.
351 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
352 func (op *DeleteCloudVmClusterOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
353 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
354 return op.lro.Poll(ctx, nil, opts...)
355 }
356
357 // Metadata returns metadata associated with the long-running operation.
358 // Metadata itself does not contact the server, but Poll does.
359 // To get the latest metadata, call this method after a successful call to Poll.
360 // If the metadata is not available, the returned metadata and error are both nil.
361 func (op *DeleteCloudVmClusterOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
362 var meta oracledatabasepb.OperationMetadata
363 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
364 return nil, nil
365 } else if err != nil {
366 return nil, err
367 }
368 return &meta, nil
369 }
370
371 // Done reports whether the long-running operation has completed.
372 func (op *DeleteCloudVmClusterOperation) Done() bool {
373 return op.lro.Done()
374 }
375
376 // Name returns the name of the long-running operation.
377 // The name is assigned by the server and is unique within the service from which the operation is created.
378 func (op *DeleteCloudVmClusterOperation) Name() string {
379 return op.lro.Name()
380 }
381
382 // RestartAutonomousDatabaseOperation manages a long-running operation from RestartAutonomousDatabase.
383 type RestartAutonomousDatabaseOperation struct {
384 lro *longrunning.Operation
385 pollPath string
386 }
387
388 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
389 //
390 // See documentation of Poll for error-handling information.
391 func (op *RestartAutonomousDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
392 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
393 var resp oracledatabasepb.AutonomousDatabase
394 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
395 return nil, err
396 }
397 return &resp, nil
398 }
399
400 // Poll fetches the latest state of the long-running operation.
401 //
402 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
403 //
404 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
405 // the operation has completed with failure, the error is returned and op.Done will return true.
406 // If Poll succeeds and the operation has completed successfully,
407 // op.Done will return true, and the response of the operation is returned.
408 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
409 func (op *RestartAutonomousDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
410 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
411 var resp oracledatabasepb.AutonomousDatabase
412 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
413 return nil, err
414 }
415 if !op.Done() {
416 return nil, nil
417 }
418 return &resp, nil
419 }
420
421 // Metadata returns metadata associated with the long-running operation.
422 // Metadata itself does not contact the server, but Poll does.
423 // To get the latest metadata, call this method after a successful call to Poll.
424 // If the metadata is not available, the returned metadata and error are both nil.
425 func (op *RestartAutonomousDatabaseOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
426 var meta oracledatabasepb.OperationMetadata
427 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
428 return nil, nil
429 } else if err != nil {
430 return nil, err
431 }
432 return &meta, nil
433 }
434
435 // Done reports whether the long-running operation has completed.
436 func (op *RestartAutonomousDatabaseOperation) Done() bool {
437 return op.lro.Done()
438 }
439
440 // Name returns the name of the long-running operation.
441 // The name is assigned by the server and is unique within the service from which the operation is created.
442 func (op *RestartAutonomousDatabaseOperation) Name() string {
443 return op.lro.Name()
444 }
445
446 // RestoreAutonomousDatabaseOperation manages a long-running operation from RestoreAutonomousDatabase.
447 type RestoreAutonomousDatabaseOperation struct {
448 lro *longrunning.Operation
449 pollPath string
450 }
451
452 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
453 //
454 // See documentation of Poll for error-handling information.
455 func (op *RestoreAutonomousDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
456 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
457 var resp oracledatabasepb.AutonomousDatabase
458 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
459 return nil, err
460 }
461 return &resp, nil
462 }
463
464 // Poll fetches the latest state of the long-running operation.
465 //
466 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
467 //
468 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
469 // the operation has completed with failure, the error is returned and op.Done will return true.
470 // If Poll succeeds and the operation has completed successfully,
471 // op.Done will return true, and the response of the operation is returned.
472 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
473 func (op *RestoreAutonomousDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
474 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
475 var resp oracledatabasepb.AutonomousDatabase
476 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
477 return nil, err
478 }
479 if !op.Done() {
480 return nil, nil
481 }
482 return &resp, nil
483 }
484
485 // Metadata returns metadata associated with the long-running operation.
486 // Metadata itself does not contact the server, but Poll does.
487 // To get the latest metadata, call this method after a successful call to Poll.
488 // If the metadata is not available, the returned metadata and error are both nil.
489 func (op *RestoreAutonomousDatabaseOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
490 var meta oracledatabasepb.OperationMetadata
491 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
492 return nil, nil
493 } else if err != nil {
494 return nil, err
495 }
496 return &meta, nil
497 }
498
499 // Done reports whether the long-running operation has completed.
500 func (op *RestoreAutonomousDatabaseOperation) Done() bool {
501 return op.lro.Done()
502 }
503
504 // Name returns the name of the long-running operation.
505 // The name is assigned by the server and is unique within the service from which the operation is created.
506 func (op *RestoreAutonomousDatabaseOperation) Name() string {
507 return op.lro.Name()
508 }
509
510 // StartAutonomousDatabaseOperation manages a long-running operation from StartAutonomousDatabase.
511 type StartAutonomousDatabaseOperation struct {
512 lro *longrunning.Operation
513 pollPath string
514 }
515
516 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
517 //
518 // See documentation of Poll for error-handling information.
519 func (op *StartAutonomousDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
520 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
521 var resp oracledatabasepb.AutonomousDatabase
522 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
523 return nil, err
524 }
525 return &resp, nil
526 }
527
528 // Poll fetches the latest state of the long-running operation.
529 //
530 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
531 //
532 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
533 // the operation has completed with failure, the error is returned and op.Done will return true.
534 // If Poll succeeds and the operation has completed successfully,
535 // op.Done will return true, and the response of the operation is returned.
536 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
537 func (op *StartAutonomousDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
538 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
539 var resp oracledatabasepb.AutonomousDatabase
540 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
541 return nil, err
542 }
543 if !op.Done() {
544 return nil, nil
545 }
546 return &resp, nil
547 }
548
549 // Metadata returns metadata associated with the long-running operation.
550 // Metadata itself does not contact the server, but Poll does.
551 // To get the latest metadata, call this method after a successful call to Poll.
552 // If the metadata is not available, the returned metadata and error are both nil.
553 func (op *StartAutonomousDatabaseOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
554 var meta oracledatabasepb.OperationMetadata
555 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
556 return nil, nil
557 } else if err != nil {
558 return nil, err
559 }
560 return &meta, nil
561 }
562
563 // Done reports whether the long-running operation has completed.
564 func (op *StartAutonomousDatabaseOperation) Done() bool {
565 return op.lro.Done()
566 }
567
568 // Name returns the name of the long-running operation.
569 // The name is assigned by the server and is unique within the service from which the operation is created.
570 func (op *StartAutonomousDatabaseOperation) Name() string {
571 return op.lro.Name()
572 }
573
574 // StopAutonomousDatabaseOperation manages a long-running operation from StopAutonomousDatabase.
575 type StopAutonomousDatabaseOperation struct {
576 lro *longrunning.Operation
577 pollPath string
578 }
579
580 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
581 //
582 // See documentation of Poll for error-handling information.
583 func (op *StopAutonomousDatabaseOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
584 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
585 var resp oracledatabasepb.AutonomousDatabase
586 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
587 return nil, err
588 }
589 return &resp, nil
590 }
591
592 // Poll fetches the latest state of the long-running operation.
593 //
594 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
595 //
596 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
597 // the operation has completed with failure, the error is returned and op.Done will return true.
598 // If Poll succeeds and the operation has completed successfully,
599 // op.Done will return true, and the response of the operation is returned.
600 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
601 func (op *StopAutonomousDatabaseOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*oracledatabasepb.AutonomousDatabase, error) {
602 opts = append([]gax.CallOption{gax.WithPath(op.pollPath)}, opts...)
603 var resp oracledatabasepb.AutonomousDatabase
604 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
605 return nil, err
606 }
607 if !op.Done() {
608 return nil, nil
609 }
610 return &resp, nil
611 }
612
613 // Metadata returns metadata associated with the long-running operation.
614 // Metadata itself does not contact the server, but Poll does.
615 // To get the latest metadata, call this method after a successful call to Poll.
616 // If the metadata is not available, the returned metadata and error are both nil.
617 func (op *StopAutonomousDatabaseOperation) Metadata() (*oracledatabasepb.OperationMetadata, error) {
618 var meta oracledatabasepb.OperationMetadata
619 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
620 return nil, nil
621 } else if err != nil {
622 return nil, err
623 }
624 return &meta, nil
625 }
626
627 // Done reports whether the long-running operation has completed.
628 func (op *StopAutonomousDatabaseOperation) Done() bool {
629 return op.lro.Done()
630 }
631
632 // Name returns the name of the long-running operation.
633 // The name is assigned by the server and is unique within the service from which the operation is created.
634 func (op *StopAutonomousDatabaseOperation) Name() string {
635 return op.lro.Name()
636 }
637
638 // AutonomousDatabaseBackupIterator manages a stream of *oracledatabasepb.AutonomousDatabaseBackup.
639 type AutonomousDatabaseBackupIterator struct {
640 items []*oracledatabasepb.AutonomousDatabaseBackup
641 pageInfo *iterator.PageInfo
642 nextFunc func() error
643
644 // Response is the raw response for the current page.
645 // It must be cast to the RPC response type.
646 // Calling Next() or InternalFetch() updates this value.
647 Response interface{}
648
649 // InternalFetch is for use by the Google Cloud Libraries only.
650 // It is not part of the stable interface of this package.
651 //
652 // InternalFetch returns results from a single call to the underlying RPC.
653 // The number of results is no greater than pageSize.
654 // If there are no more results, nextPageToken is empty and err is nil.
655 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.AutonomousDatabaseBackup, nextPageToken string, err error)
656 }
657
658 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
659 func (it *AutonomousDatabaseBackupIterator) PageInfo() *iterator.PageInfo {
660 return it.pageInfo
661 }
662
663 // Next returns the next result. Its second return value is iterator.Done if there are no more
664 // results. Once Next returns Done, all subsequent calls will return Done.
665 func (it *AutonomousDatabaseBackupIterator) Next() (*oracledatabasepb.AutonomousDatabaseBackup, error) {
666 var item *oracledatabasepb.AutonomousDatabaseBackup
667 if err := it.nextFunc(); err != nil {
668 return item, err
669 }
670 item = it.items[0]
671 it.items = it.items[1:]
672 return item, nil
673 }
674
675 func (it *AutonomousDatabaseBackupIterator) bufLen() int {
676 return len(it.items)
677 }
678
679 func (it *AutonomousDatabaseBackupIterator) takeBuf() interface{} {
680 b := it.items
681 it.items = nil
682 return b
683 }
684
685 // AutonomousDatabaseCharacterSetIterator manages a stream of *oracledatabasepb.AutonomousDatabaseCharacterSet.
686 type AutonomousDatabaseCharacterSetIterator struct {
687 items []*oracledatabasepb.AutonomousDatabaseCharacterSet
688 pageInfo *iterator.PageInfo
689 nextFunc func() error
690
691 // Response is the raw response for the current page.
692 // It must be cast to the RPC response type.
693 // Calling Next() or InternalFetch() updates this value.
694 Response interface{}
695
696 // InternalFetch is for use by the Google Cloud Libraries only.
697 // It is not part of the stable interface of this package.
698 //
699 // InternalFetch returns results from a single call to the underlying RPC.
700 // The number of results is no greater than pageSize.
701 // If there are no more results, nextPageToken is empty and err is nil.
702 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.AutonomousDatabaseCharacterSet, nextPageToken string, err error)
703 }
704
705 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
706 func (it *AutonomousDatabaseCharacterSetIterator) PageInfo() *iterator.PageInfo {
707 return it.pageInfo
708 }
709
710 // Next returns the next result. Its second return value is iterator.Done if there are no more
711 // results. Once Next returns Done, all subsequent calls will return Done.
712 func (it *AutonomousDatabaseCharacterSetIterator) Next() (*oracledatabasepb.AutonomousDatabaseCharacterSet, error) {
713 var item *oracledatabasepb.AutonomousDatabaseCharacterSet
714 if err := it.nextFunc(); err != nil {
715 return item, err
716 }
717 item = it.items[0]
718 it.items = it.items[1:]
719 return item, nil
720 }
721
722 func (it *AutonomousDatabaseCharacterSetIterator) bufLen() int {
723 return len(it.items)
724 }
725
726 func (it *AutonomousDatabaseCharacterSetIterator) takeBuf() interface{} {
727 b := it.items
728 it.items = nil
729 return b
730 }
731
732 // AutonomousDatabaseIterator manages a stream of *oracledatabasepb.AutonomousDatabase.
733 type AutonomousDatabaseIterator struct {
734 items []*oracledatabasepb.AutonomousDatabase
735 pageInfo *iterator.PageInfo
736 nextFunc func() error
737
738 // Response is the raw response for the current page.
739 // It must be cast to the RPC response type.
740 // Calling Next() or InternalFetch() updates this value.
741 Response interface{}
742
743 // InternalFetch is for use by the Google Cloud Libraries only.
744 // It is not part of the stable interface of this package.
745 //
746 // InternalFetch returns results from a single call to the underlying RPC.
747 // The number of results is no greater than pageSize.
748 // If there are no more results, nextPageToken is empty and err is nil.
749 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.AutonomousDatabase, nextPageToken string, err error)
750 }
751
752 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
753 func (it *AutonomousDatabaseIterator) PageInfo() *iterator.PageInfo {
754 return it.pageInfo
755 }
756
757 // Next returns the next result. Its second return value is iterator.Done if there are no more
758 // results. Once Next returns Done, all subsequent calls will return Done.
759 func (it *AutonomousDatabaseIterator) Next() (*oracledatabasepb.AutonomousDatabase, error) {
760 var item *oracledatabasepb.AutonomousDatabase
761 if err := it.nextFunc(); err != nil {
762 return item, err
763 }
764 item = it.items[0]
765 it.items = it.items[1:]
766 return item, nil
767 }
768
769 func (it *AutonomousDatabaseIterator) bufLen() int {
770 return len(it.items)
771 }
772
773 func (it *AutonomousDatabaseIterator) takeBuf() interface{} {
774 b := it.items
775 it.items = nil
776 return b
777 }
778
779 // AutonomousDbVersionIterator manages a stream of *oracledatabasepb.AutonomousDbVersion.
780 type AutonomousDbVersionIterator struct {
781 items []*oracledatabasepb.AutonomousDbVersion
782 pageInfo *iterator.PageInfo
783 nextFunc func() error
784
785 // Response is the raw response for the current page.
786 // It must be cast to the RPC response type.
787 // Calling Next() or InternalFetch() updates this value.
788 Response interface{}
789
790 // InternalFetch is for use by the Google Cloud Libraries only.
791 // It is not part of the stable interface of this package.
792 //
793 // InternalFetch returns results from a single call to the underlying RPC.
794 // The number of results is no greater than pageSize.
795 // If there are no more results, nextPageToken is empty and err is nil.
796 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.AutonomousDbVersion, nextPageToken string, err error)
797 }
798
799 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
800 func (it *AutonomousDbVersionIterator) PageInfo() *iterator.PageInfo {
801 return it.pageInfo
802 }
803
804 // Next returns the next result. Its second return value is iterator.Done if there are no more
805 // results. Once Next returns Done, all subsequent calls will return Done.
806 func (it *AutonomousDbVersionIterator) Next() (*oracledatabasepb.AutonomousDbVersion, error) {
807 var item *oracledatabasepb.AutonomousDbVersion
808 if err := it.nextFunc(); err != nil {
809 return item, err
810 }
811 item = it.items[0]
812 it.items = it.items[1:]
813 return item, nil
814 }
815
816 func (it *AutonomousDbVersionIterator) bufLen() int {
817 return len(it.items)
818 }
819
820 func (it *AutonomousDbVersionIterator) takeBuf() interface{} {
821 b := it.items
822 it.items = nil
823 return b
824 }
825
826 // CloudExadataInfrastructureIterator manages a stream of *oracledatabasepb.CloudExadataInfrastructure.
827 type CloudExadataInfrastructureIterator struct {
828 items []*oracledatabasepb.CloudExadataInfrastructure
829 pageInfo *iterator.PageInfo
830 nextFunc func() error
831
832 // Response is the raw response for the current page.
833 // It must be cast to the RPC response type.
834 // Calling Next() or InternalFetch() updates this value.
835 Response interface{}
836
837 // InternalFetch is for use by the Google Cloud Libraries only.
838 // It is not part of the stable interface of this package.
839 //
840 // InternalFetch returns results from a single call to the underlying RPC.
841 // The number of results is no greater than pageSize.
842 // If there are no more results, nextPageToken is empty and err is nil.
843 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.CloudExadataInfrastructure, nextPageToken string, err error)
844 }
845
846 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
847 func (it *CloudExadataInfrastructureIterator) PageInfo() *iterator.PageInfo {
848 return it.pageInfo
849 }
850
851 // Next returns the next result. Its second return value is iterator.Done if there are no more
852 // results. Once Next returns Done, all subsequent calls will return Done.
853 func (it *CloudExadataInfrastructureIterator) Next() (*oracledatabasepb.CloudExadataInfrastructure, error) {
854 var item *oracledatabasepb.CloudExadataInfrastructure
855 if err := it.nextFunc(); err != nil {
856 return item, err
857 }
858 item = it.items[0]
859 it.items = it.items[1:]
860 return item, nil
861 }
862
863 func (it *CloudExadataInfrastructureIterator) bufLen() int {
864 return len(it.items)
865 }
866
867 func (it *CloudExadataInfrastructureIterator) takeBuf() interface{} {
868 b := it.items
869 it.items = nil
870 return b
871 }
872
873 // CloudVmClusterIterator manages a stream of *oracledatabasepb.CloudVmCluster.
874 type CloudVmClusterIterator struct {
875 items []*oracledatabasepb.CloudVmCluster
876 pageInfo *iterator.PageInfo
877 nextFunc func() error
878
879 // Response is the raw response for the current page.
880 // It must be cast to the RPC response type.
881 // Calling Next() or InternalFetch() updates this value.
882 Response interface{}
883
884 // InternalFetch is for use by the Google Cloud Libraries only.
885 // It is not part of the stable interface of this package.
886 //
887 // InternalFetch returns results from a single call to the underlying RPC.
888 // The number of results is no greater than pageSize.
889 // If there are no more results, nextPageToken is empty and err is nil.
890 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.CloudVmCluster, nextPageToken string, err error)
891 }
892
893 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
894 func (it *CloudVmClusterIterator) PageInfo() *iterator.PageInfo {
895 return it.pageInfo
896 }
897
898 // Next returns the next result. Its second return value is iterator.Done if there are no more
899 // results. Once Next returns Done, all subsequent calls will return Done.
900 func (it *CloudVmClusterIterator) Next() (*oracledatabasepb.CloudVmCluster, error) {
901 var item *oracledatabasepb.CloudVmCluster
902 if err := it.nextFunc(); err != nil {
903 return item, err
904 }
905 item = it.items[0]
906 it.items = it.items[1:]
907 return item, nil
908 }
909
910 func (it *CloudVmClusterIterator) bufLen() int {
911 return len(it.items)
912 }
913
914 func (it *CloudVmClusterIterator) takeBuf() interface{} {
915 b := it.items
916 it.items = nil
917 return b
918 }
919
920 // DbNodeIterator manages a stream of *oracledatabasepb.DbNode.
921 type DbNodeIterator struct {
922 items []*oracledatabasepb.DbNode
923 pageInfo *iterator.PageInfo
924 nextFunc func() error
925
926 // Response is the raw response for the current page.
927 // It must be cast to the RPC response type.
928 // Calling Next() or InternalFetch() updates this value.
929 Response interface{}
930
931 // InternalFetch is for use by the Google Cloud Libraries only.
932 // It is not part of the stable interface of this package.
933 //
934 // InternalFetch returns results from a single call to the underlying RPC.
935 // The number of results is no greater than pageSize.
936 // If there are no more results, nextPageToken is empty and err is nil.
937 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.DbNode, nextPageToken string, err error)
938 }
939
940 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
941 func (it *DbNodeIterator) PageInfo() *iterator.PageInfo {
942 return it.pageInfo
943 }
944
945 // Next returns the next result. Its second return value is iterator.Done if there are no more
946 // results. Once Next returns Done, all subsequent calls will return Done.
947 func (it *DbNodeIterator) Next() (*oracledatabasepb.DbNode, error) {
948 var item *oracledatabasepb.DbNode
949 if err := it.nextFunc(); err != nil {
950 return item, err
951 }
952 item = it.items[0]
953 it.items = it.items[1:]
954 return item, nil
955 }
956
957 func (it *DbNodeIterator) bufLen() int {
958 return len(it.items)
959 }
960
961 func (it *DbNodeIterator) takeBuf() interface{} {
962 b := it.items
963 it.items = nil
964 return b
965 }
966
967 // DbServerIterator manages a stream of *oracledatabasepb.DbServer.
968 type DbServerIterator struct {
969 items []*oracledatabasepb.DbServer
970 pageInfo *iterator.PageInfo
971 nextFunc func() error
972
973 // Response is the raw response for the current page.
974 // It must be cast to the RPC response type.
975 // Calling Next() or InternalFetch() updates this value.
976 Response interface{}
977
978 // InternalFetch is for use by the Google Cloud Libraries only.
979 // It is not part of the stable interface of this package.
980 //
981 // InternalFetch returns results from a single call to the underlying RPC.
982 // The number of results is no greater than pageSize.
983 // If there are no more results, nextPageToken is empty and err is nil.
984 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.DbServer, nextPageToken string, err error)
985 }
986
987 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
988 func (it *DbServerIterator) PageInfo() *iterator.PageInfo {
989 return it.pageInfo
990 }
991
992 // Next returns the next result. Its second return value is iterator.Done if there are no more
993 // results. Once Next returns Done, all subsequent calls will return Done.
994 func (it *DbServerIterator) Next() (*oracledatabasepb.DbServer, error) {
995 var item *oracledatabasepb.DbServer
996 if err := it.nextFunc(); err != nil {
997 return item, err
998 }
999 item = it.items[0]
1000 it.items = it.items[1:]
1001 return item, nil
1002 }
1003
1004 func (it *DbServerIterator) bufLen() int {
1005 return len(it.items)
1006 }
1007
1008 func (it *DbServerIterator) takeBuf() interface{} {
1009 b := it.items
1010 it.items = nil
1011 return b
1012 }
1013
1014 // DbSystemShapeIterator manages a stream of *oracledatabasepb.DbSystemShape.
1015 type DbSystemShapeIterator struct {
1016 items []*oracledatabasepb.DbSystemShape
1017 pageInfo *iterator.PageInfo
1018 nextFunc func() error
1019
1020 // Response is the raw response for the current page.
1021 // It must be cast to the RPC response type.
1022 // Calling Next() or InternalFetch() updates this value.
1023 Response interface{}
1024
1025 // InternalFetch is for use by the Google Cloud Libraries only.
1026 // It is not part of the stable interface of this package.
1027 //
1028 // InternalFetch returns results from a single call to the underlying RPC.
1029 // The number of results is no greater than pageSize.
1030 // If there are no more results, nextPageToken is empty and err is nil.
1031 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.DbSystemShape, nextPageToken string, err error)
1032 }
1033
1034 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1035 func (it *DbSystemShapeIterator) PageInfo() *iterator.PageInfo {
1036 return it.pageInfo
1037 }
1038
1039 // Next returns the next result. Its second return value is iterator.Done if there are no more
1040 // results. Once Next returns Done, all subsequent calls will return Done.
1041 func (it *DbSystemShapeIterator) Next() (*oracledatabasepb.DbSystemShape, error) {
1042 var item *oracledatabasepb.DbSystemShape
1043 if err := it.nextFunc(); err != nil {
1044 return item, err
1045 }
1046 item = it.items[0]
1047 it.items = it.items[1:]
1048 return item, nil
1049 }
1050
1051 func (it *DbSystemShapeIterator) bufLen() int {
1052 return len(it.items)
1053 }
1054
1055 func (it *DbSystemShapeIterator) takeBuf() interface{} {
1056 b := it.items
1057 it.items = nil
1058 return b
1059 }
1060
1061 // EntitlementIterator manages a stream of *oracledatabasepb.Entitlement.
1062 type EntitlementIterator struct {
1063 items []*oracledatabasepb.Entitlement
1064 pageInfo *iterator.PageInfo
1065 nextFunc func() error
1066
1067 // Response is the raw response for the current page.
1068 // It must be cast to the RPC response type.
1069 // Calling Next() or InternalFetch() updates this value.
1070 Response interface{}
1071
1072 // InternalFetch is for use by the Google Cloud Libraries only.
1073 // It is not part of the stable interface of this package.
1074 //
1075 // InternalFetch returns results from a single call to the underlying RPC.
1076 // The number of results is no greater than pageSize.
1077 // If there are no more results, nextPageToken is empty and err is nil.
1078 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.Entitlement, nextPageToken string, err error)
1079 }
1080
1081 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1082 func (it *EntitlementIterator) PageInfo() *iterator.PageInfo {
1083 return it.pageInfo
1084 }
1085
1086 // Next returns the next result. Its second return value is iterator.Done if there are no more
1087 // results. Once Next returns Done, all subsequent calls will return Done.
1088 func (it *EntitlementIterator) Next() (*oracledatabasepb.Entitlement, error) {
1089 var item *oracledatabasepb.Entitlement
1090 if err := it.nextFunc(); err != nil {
1091 return item, err
1092 }
1093 item = it.items[0]
1094 it.items = it.items[1:]
1095 return item, nil
1096 }
1097
1098 func (it *EntitlementIterator) bufLen() int {
1099 return len(it.items)
1100 }
1101
1102 func (it *EntitlementIterator) takeBuf() interface{} {
1103 b := it.items
1104 it.items = nil
1105 return b
1106 }
1107
1108 // GiVersionIterator manages a stream of *oracledatabasepb.GiVersion.
1109 type GiVersionIterator struct {
1110 items []*oracledatabasepb.GiVersion
1111 pageInfo *iterator.PageInfo
1112 nextFunc func() error
1113
1114 // Response is the raw response for the current page.
1115 // It must be cast to the RPC response type.
1116 // Calling Next() or InternalFetch() updates this value.
1117 Response interface{}
1118
1119 // InternalFetch is for use by the Google Cloud Libraries only.
1120 // It is not part of the stable interface of this package.
1121 //
1122 // InternalFetch returns results from a single call to the underlying RPC.
1123 // The number of results is no greater than pageSize.
1124 // If there are no more results, nextPageToken is empty and err is nil.
1125 InternalFetch func(pageSize int, pageToken string) (results []*oracledatabasepb.GiVersion, nextPageToken string, err error)
1126 }
1127
1128 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1129 func (it *GiVersionIterator) PageInfo() *iterator.PageInfo {
1130 return it.pageInfo
1131 }
1132
1133 // Next returns the next result. Its second return value is iterator.Done if there are no more
1134 // results. Once Next returns Done, all subsequent calls will return Done.
1135 func (it *GiVersionIterator) Next() (*oracledatabasepb.GiVersion, error) {
1136 var item *oracledatabasepb.GiVersion
1137 if err := it.nextFunc(); err != nil {
1138 return item, err
1139 }
1140 item = it.items[0]
1141 it.items = it.items[1:]
1142 return item, nil
1143 }
1144
1145 func (it *GiVersionIterator) bufLen() int {
1146 return len(it.items)
1147 }
1148
1149 func (it *GiVersionIterator) takeBuf() interface{} {
1150 b := it.items
1151 it.items = nil
1152 return b
1153 }
1154
1155 // LocationIterator manages a stream of *locationpb.Location.
1156 type LocationIterator struct {
1157 items []*locationpb.Location
1158 pageInfo *iterator.PageInfo
1159 nextFunc func() error
1160
1161 // Response is the raw response for the current page.
1162 // It must be cast to the RPC response type.
1163 // Calling Next() or InternalFetch() updates this value.
1164 Response interface{}
1165
1166 // InternalFetch is for use by the Google Cloud Libraries only.
1167 // It is not part of the stable interface of this package.
1168 //
1169 // InternalFetch returns results from a single call to the underlying RPC.
1170 // The number of results is no greater than pageSize.
1171 // If there are no more results, nextPageToken is empty and err is nil.
1172 InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
1173 }
1174
1175 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1176 func (it *LocationIterator) PageInfo() *iterator.PageInfo {
1177 return it.pageInfo
1178 }
1179
1180 // Next returns the next result. Its second return value is iterator.Done if there are no more
1181 // results. Once Next returns Done, all subsequent calls will return Done.
1182 func (it *LocationIterator) Next() (*locationpb.Location, error) {
1183 var item *locationpb.Location
1184 if err := it.nextFunc(); err != nil {
1185 return item, err
1186 }
1187 item = it.items[0]
1188 it.items = it.items[1:]
1189 return item, nil
1190 }
1191
1192 func (it *LocationIterator) bufLen() int {
1193 return len(it.items)
1194 }
1195
1196 func (it *LocationIterator) takeBuf() interface{} {
1197 b := it.items
1198 it.items = nil
1199 return b
1200 }
1201
1202 // OperationIterator manages a stream of *longrunningpb.Operation.
1203 type OperationIterator struct {
1204 items []*longrunningpb.Operation
1205 pageInfo *iterator.PageInfo
1206 nextFunc func() error
1207
1208 // Response is the raw response for the current page.
1209 // It must be cast to the RPC response type.
1210 // Calling Next() or InternalFetch() updates this value.
1211 Response interface{}
1212
1213 // InternalFetch is for use by the Google Cloud Libraries only.
1214 // It is not part of the stable interface of this package.
1215 //
1216 // InternalFetch returns results from a single call to the underlying RPC.
1217 // The number of results is no greater than pageSize.
1218 // If there are no more results, nextPageToken is empty and err is nil.
1219 InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
1220 }
1221
1222 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1223 func (it *OperationIterator) PageInfo() *iterator.PageInfo {
1224 return it.pageInfo
1225 }
1226
1227 // Next returns the next result. Its second return value is iterator.Done if there are no more
1228 // results. Once Next returns Done, all subsequent calls will return Done.
1229 func (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
1230 var item *longrunningpb.Operation
1231 if err := it.nextFunc(); err != nil {
1232 return item, err
1233 }
1234 item = it.items[0]
1235 it.items = it.items[1:]
1236 return item, nil
1237 }
1238
1239 func (it *OperationIterator) bufLen() int {
1240 return len(it.items)
1241 }
1242
1243 func (it *OperationIterator) takeBuf() interface{} {
1244 b := it.items
1245 it.items = nil
1246 return b
1247 }