Debian Codegraph @

clouddms/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 clouddms
18
19 import (
20 "context"
21 "time"
22
23 clouddmspb "cloud.google.com/go/clouddms/apiv1/clouddmspb"
24 "cloud.google.com/go/longrunning"
25 longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
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 // ApplyConversionWorkspaceOperation manages a long-running operation from ApplyConversionWorkspace.
32 type ApplyConversionWorkspaceOperation struct {
33 lro *longrunning.Operation
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 *ApplyConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
40 var resp clouddmspb.ConversionWorkspace
41 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
42 return nil, err
43 }
44 return &resp, nil
45 }
46
47 // Poll fetches the latest state of the long-running operation.
48 //
49 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
50 //
51 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
52 // the operation has completed with failure, the error is returned and op.Done will return true.
53 // If Poll succeeds and the operation has completed successfully,
54 // op.Done will return true, and the response of the operation is returned.
55 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
56 func (op *ApplyConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
57 var resp clouddmspb.ConversionWorkspace
58 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
59 return nil, err
60 }
61 if !op.Done() {
62 return nil, nil
63 }
64 return &resp, nil
65 }
66
67 // Metadata returns metadata associated with the long-running operation.
68 // Metadata itself does not contact the server, but Poll does.
69 // To get the latest metadata, call this method after a successful call to Poll.
70 // If the metadata is not available, the returned metadata and error are both nil.
71 func (op *ApplyConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
72 var meta clouddmspb.OperationMetadata
73 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
74 return nil, nil
75 } else if err != nil {
76 return nil, err
77 }
78 return &meta, nil
79 }
80
81 // Done reports whether the long-running operation has completed.
82 func (op *ApplyConversionWorkspaceOperation) Done() bool {
83 return op.lro.Done()
84 }
85
86 // Name returns the name of the long-running operation.
87 // The name is assigned by the server and is unique within the service from which the operation is created.
88 func (op *ApplyConversionWorkspaceOperation) Name() string {
89 return op.lro.Name()
90 }
91
92 // CommitConversionWorkspaceOperation manages a long-running operation from CommitConversionWorkspace.
93 type CommitConversionWorkspaceOperation struct {
94 lro *longrunning.Operation
95 }
96
97 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
98 //
99 // See documentation of Poll for error-handling information.
100 func (op *CommitConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
101 var resp clouddmspb.ConversionWorkspace
102 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
103 return nil, err
104 }
105 return &resp, nil
106 }
107
108 // Poll fetches the latest state of the long-running operation.
109 //
110 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
111 //
112 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
113 // the operation has completed with failure, the error is returned and op.Done will return true.
114 // If Poll succeeds and the operation has completed successfully,
115 // op.Done will return true, and the response of the operation is returned.
116 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
117 func (op *CommitConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
118 var resp clouddmspb.ConversionWorkspace
119 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
120 return nil, err
121 }
122 if !op.Done() {
123 return nil, nil
124 }
125 return &resp, nil
126 }
127
128 // Metadata returns metadata associated with the long-running operation.
129 // Metadata itself does not contact the server, but Poll does.
130 // To get the latest metadata, call this method after a successful call to Poll.
131 // If the metadata is not available, the returned metadata and error are both nil.
132 func (op *CommitConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
133 var meta clouddmspb.OperationMetadata
134 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
135 return nil, nil
136 } else if err != nil {
137 return nil, err
138 }
139 return &meta, nil
140 }
141
142 // Done reports whether the long-running operation has completed.
143 func (op *CommitConversionWorkspaceOperation) Done() bool {
144 return op.lro.Done()
145 }
146
147 // Name returns the name of the long-running operation.
148 // The name is assigned by the server and is unique within the service from which the operation is created.
149 func (op *CommitConversionWorkspaceOperation) Name() string {
150 return op.lro.Name()
151 }
152
153 // ConvertConversionWorkspaceOperation manages a long-running operation from ConvertConversionWorkspace.
154 type ConvertConversionWorkspaceOperation struct {
155 lro *longrunning.Operation
156 }
157
158 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
159 //
160 // See documentation of Poll for error-handling information.
161 func (op *ConvertConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
162 var resp clouddmspb.ConversionWorkspace
163 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
164 return nil, err
165 }
166 return &resp, nil
167 }
168
169 // Poll fetches the latest state of the long-running operation.
170 //
171 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
172 //
173 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
174 // the operation has completed with failure, the error is returned and op.Done will return true.
175 // If Poll succeeds and the operation has completed successfully,
176 // op.Done will return true, and the response of the operation is returned.
177 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
178 func (op *ConvertConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
179 var resp clouddmspb.ConversionWorkspace
180 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
181 return nil, err
182 }
183 if !op.Done() {
184 return nil, nil
185 }
186 return &resp, nil
187 }
188
189 // Metadata returns metadata associated with the long-running operation.
190 // Metadata itself does not contact the server, but Poll does.
191 // To get the latest metadata, call this method after a successful call to Poll.
192 // If the metadata is not available, the returned metadata and error are both nil.
193 func (op *ConvertConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
194 var meta clouddmspb.OperationMetadata
195 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
196 return nil, nil
197 } else if err != nil {
198 return nil, err
199 }
200 return &meta, nil
201 }
202
203 // Done reports whether the long-running operation has completed.
204 func (op *ConvertConversionWorkspaceOperation) Done() bool {
205 return op.lro.Done()
206 }
207
208 // Name returns the name of the long-running operation.
209 // The name is assigned by the server and is unique within the service from which the operation is created.
210 func (op *ConvertConversionWorkspaceOperation) Name() string {
211 return op.lro.Name()
212 }
213
214 // CreateConnectionProfileOperation manages a long-running operation from CreateConnectionProfile.
215 type CreateConnectionProfileOperation struct {
216 lro *longrunning.Operation
217 }
218
219 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
220 //
221 // See documentation of Poll for error-handling information.
222 func (op *CreateConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConnectionProfile, error) {
223 var resp clouddmspb.ConnectionProfile
224 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
225 return nil, err
226 }
227 return &resp, nil
228 }
229
230 // Poll fetches the latest state of the long-running operation.
231 //
232 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
233 //
234 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
235 // the operation has completed with failure, the error is returned and op.Done will return true.
236 // If Poll succeeds and the operation has completed successfully,
237 // op.Done will return true, and the response of the operation is returned.
238 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
239 func (op *CreateConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConnectionProfile, error) {
240 var resp clouddmspb.ConnectionProfile
241 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
242 return nil, err
243 }
244 if !op.Done() {
245 return nil, nil
246 }
247 return &resp, nil
248 }
249
250 // Metadata returns metadata associated with the long-running operation.
251 // Metadata itself does not contact the server, but Poll does.
252 // To get the latest metadata, call this method after a successful call to Poll.
253 // If the metadata is not available, the returned metadata and error are both nil.
254 func (op *CreateConnectionProfileOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
255 var meta clouddmspb.OperationMetadata
256 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
257 return nil, nil
258 } else if err != nil {
259 return nil, err
260 }
261 return &meta, nil
262 }
263
264 // Done reports whether the long-running operation has completed.
265 func (op *CreateConnectionProfileOperation) Done() bool {
266 return op.lro.Done()
267 }
268
269 // Name returns the name of the long-running operation.
270 // The name is assigned by the server and is unique within the service from which the operation is created.
271 func (op *CreateConnectionProfileOperation) Name() string {
272 return op.lro.Name()
273 }
274
275 // CreateConversionWorkspaceOperation manages a long-running operation from CreateConversionWorkspace.
276 type CreateConversionWorkspaceOperation struct {
277 lro *longrunning.Operation
278 }
279
280 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
281 //
282 // See documentation of Poll for error-handling information.
283 func (op *CreateConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
284 var resp clouddmspb.ConversionWorkspace
285 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
286 return nil, err
287 }
288 return &resp, nil
289 }
290
291 // Poll fetches the latest state of the long-running operation.
292 //
293 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
294 //
295 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
296 // the operation has completed with failure, the error is returned and op.Done will return true.
297 // If Poll succeeds and the operation has completed successfully,
298 // op.Done will return true, and the response of the operation is returned.
299 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
300 func (op *CreateConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
301 var resp clouddmspb.ConversionWorkspace
302 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
303 return nil, err
304 }
305 if !op.Done() {
306 return nil, nil
307 }
308 return &resp, nil
309 }
310
311 // Metadata returns metadata associated with the long-running operation.
312 // Metadata itself does not contact the server, but Poll does.
313 // To get the latest metadata, call this method after a successful call to Poll.
314 // If the metadata is not available, the returned metadata and error are both nil.
315 func (op *CreateConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
316 var meta clouddmspb.OperationMetadata
317 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
318 return nil, nil
319 } else if err != nil {
320 return nil, err
321 }
322 return &meta, nil
323 }
324
325 // Done reports whether the long-running operation has completed.
326 func (op *CreateConversionWorkspaceOperation) Done() bool {
327 return op.lro.Done()
328 }
329
330 // Name returns the name of the long-running operation.
331 // The name is assigned by the server and is unique within the service from which the operation is created.
332 func (op *CreateConversionWorkspaceOperation) Name() string {
333 return op.lro.Name()
334 }
335
336 // CreateMigrationJobOperation manages a long-running operation from CreateMigrationJob.
337 type CreateMigrationJobOperation struct {
338 lro *longrunning.Operation
339 }
340
341 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
342 //
343 // See documentation of Poll for error-handling information.
344 func (op *CreateMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
345 var resp clouddmspb.MigrationJob
346 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
347 return nil, err
348 }
349 return &resp, nil
350 }
351
352 // Poll fetches the latest state of the long-running operation.
353 //
354 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
355 //
356 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
357 // the operation has completed with failure, the error is returned and op.Done will return true.
358 // If Poll succeeds and the operation has completed successfully,
359 // op.Done will return true, and the response of the operation is returned.
360 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
361 func (op *CreateMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
362 var resp clouddmspb.MigrationJob
363 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
364 return nil, err
365 }
366 if !op.Done() {
367 return nil, nil
368 }
369 return &resp, nil
370 }
371
372 // Metadata returns metadata associated with the long-running operation.
373 // Metadata itself does not contact the server, but Poll does.
374 // To get the latest metadata, call this method after a successful call to Poll.
375 // If the metadata is not available, the returned metadata and error are both nil.
376 func (op *CreateMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
377 var meta clouddmspb.OperationMetadata
378 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
379 return nil, nil
380 } else if err != nil {
381 return nil, err
382 }
383 return &meta, nil
384 }
385
386 // Done reports whether the long-running operation has completed.
387 func (op *CreateMigrationJobOperation) Done() bool {
388 return op.lro.Done()
389 }
390
391 // Name returns the name of the long-running operation.
392 // The name is assigned by the server and is unique within the service from which the operation is created.
393 func (op *CreateMigrationJobOperation) Name() string {
394 return op.lro.Name()
395 }
396
397 // CreatePrivateConnectionOperation manages a long-running operation from CreatePrivateConnection.
398 type CreatePrivateConnectionOperation struct {
399 lro *longrunning.Operation
400 }
401
402 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
403 //
404 // See documentation of Poll for error-handling information.
405 func (op *CreatePrivateConnectionOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.PrivateConnection, error) {
406 var resp clouddmspb.PrivateConnection
407 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
408 return nil, err
409 }
410 return &resp, nil
411 }
412
413 // Poll fetches the latest state of the long-running operation.
414 //
415 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
416 //
417 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
418 // the operation has completed with failure, the error is returned and op.Done will return true.
419 // If Poll succeeds and the operation has completed successfully,
420 // op.Done will return true, and the response of the operation is returned.
421 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
422 func (op *CreatePrivateConnectionOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.PrivateConnection, error) {
423 var resp clouddmspb.PrivateConnection
424 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
425 return nil, err
426 }
427 if !op.Done() {
428 return nil, nil
429 }
430 return &resp, nil
431 }
432
433 // Metadata returns metadata associated with the long-running operation.
434 // Metadata itself does not contact the server, but Poll does.
435 // To get the latest metadata, call this method after a successful call to Poll.
436 // If the metadata is not available, the returned metadata and error are both nil.
437 func (op *CreatePrivateConnectionOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
438 var meta clouddmspb.OperationMetadata
439 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
440 return nil, nil
441 } else if err != nil {
442 return nil, err
443 }
444 return &meta, nil
445 }
446
447 // Done reports whether the long-running operation has completed.
448 func (op *CreatePrivateConnectionOperation) Done() bool {
449 return op.lro.Done()
450 }
451
452 // Name returns the name of the long-running operation.
453 // The name is assigned by the server and is unique within the service from which the operation is created.
454 func (op *CreatePrivateConnectionOperation) Name() string {
455 return op.lro.Name()
456 }
457
458 // DeleteConnectionProfileOperation manages a long-running operation from DeleteConnectionProfile.
459 type DeleteConnectionProfileOperation struct {
460 lro *longrunning.Operation
461 }
462
463 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
464 //
465 // See documentation of Poll for error-handling information.
466 func (op *DeleteConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
467 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
468 }
469
470 // Poll fetches the latest state of the long-running operation.
471 //
472 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
473 //
474 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
475 // the operation has completed with failure, the error is returned and op.Done will return true.
476 // If Poll succeeds and the operation has completed successfully,
477 // op.Done will return true, and the response of the operation is returned.
478 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
479 func (op *DeleteConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
480 return op.lro.Poll(ctx, nil, opts...)
481 }
482
483 // Metadata returns metadata associated with the long-running operation.
484 // Metadata itself does not contact the server, but Poll does.
485 // To get the latest metadata, call this method after a successful call to Poll.
486 // If the metadata is not available, the returned metadata and error are both nil.
487 func (op *DeleteConnectionProfileOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
488 var meta clouddmspb.OperationMetadata
489 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
490 return nil, nil
491 } else if err != nil {
492 return nil, err
493 }
494 return &meta, nil
495 }
496
497 // Done reports whether the long-running operation has completed.
498 func (op *DeleteConnectionProfileOperation) Done() bool {
499 return op.lro.Done()
500 }
501
502 // Name returns the name of the long-running operation.
503 // The name is assigned by the server and is unique within the service from which the operation is created.
504 func (op *DeleteConnectionProfileOperation) Name() string {
505 return op.lro.Name()
506 }
507
508 // DeleteConversionWorkspaceOperation manages a long-running operation from DeleteConversionWorkspace.
509 type DeleteConversionWorkspaceOperation struct {
510 lro *longrunning.Operation
511 }
512
513 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
514 //
515 // See documentation of Poll for error-handling information.
516 func (op *DeleteConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
517 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
518 }
519
520 // Poll fetches the latest state of the long-running operation.
521 //
522 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
523 //
524 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
525 // the operation has completed with failure, the error is returned and op.Done will return true.
526 // If Poll succeeds and the operation has completed successfully,
527 // op.Done will return true, and the response of the operation is returned.
528 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
529 func (op *DeleteConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
530 return op.lro.Poll(ctx, nil, opts...)
531 }
532
533 // Metadata returns metadata associated with the long-running operation.
534 // Metadata itself does not contact the server, but Poll does.
535 // To get the latest metadata, call this method after a successful call to Poll.
536 // If the metadata is not available, the returned metadata and error are both nil.
537 func (op *DeleteConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
538 var meta clouddmspb.OperationMetadata
539 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
540 return nil, nil
541 } else if err != nil {
542 return nil, err
543 }
544 return &meta, nil
545 }
546
547 // Done reports whether the long-running operation has completed.
548 func (op *DeleteConversionWorkspaceOperation) Done() bool {
549 return op.lro.Done()
550 }
551
552 // Name returns the name of the long-running operation.
553 // The name is assigned by the server and is unique within the service from which the operation is created.
554 func (op *DeleteConversionWorkspaceOperation) Name() string {
555 return op.lro.Name()
556 }
557
558 // DeleteMigrationJobOperation manages a long-running operation from DeleteMigrationJob.
559 type DeleteMigrationJobOperation struct {
560 lro *longrunning.Operation
561 }
562
563 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
564 //
565 // See documentation of Poll for error-handling information.
566 func (op *DeleteMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
567 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
568 }
569
570 // Poll fetches the latest state of the long-running operation.
571 //
572 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
573 //
574 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
575 // the operation has completed with failure, the error is returned and op.Done will return true.
576 // If Poll succeeds and the operation has completed successfully,
577 // op.Done will return true, and the response of the operation is returned.
578 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
579 func (op *DeleteMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
580 return op.lro.Poll(ctx, nil, opts...)
581 }
582
583 // Metadata returns metadata associated with the long-running operation.
584 // Metadata itself does not contact the server, but Poll does.
585 // To get the latest metadata, call this method after a successful call to Poll.
586 // If the metadata is not available, the returned metadata and error are both nil.
587 func (op *DeleteMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
588 var meta clouddmspb.OperationMetadata
589 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
590 return nil, nil
591 } else if err != nil {
592 return nil, err
593 }
594 return &meta, nil
595 }
596
597 // Done reports whether the long-running operation has completed.
598 func (op *DeleteMigrationJobOperation) Done() bool {
599 return op.lro.Done()
600 }
601
602 // Name returns the name of the long-running operation.
603 // The name is assigned by the server and is unique within the service from which the operation is created.
604 func (op *DeleteMigrationJobOperation) Name() string {
605 return op.lro.Name()
606 }
607
608 // DeletePrivateConnectionOperation manages a long-running operation from DeletePrivateConnection.
609 type DeletePrivateConnectionOperation struct {
610 lro *longrunning.Operation
611 }
612
613 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
614 //
615 // See documentation of Poll for error-handling information.
616 func (op *DeletePrivateConnectionOperation) Wait(ctx context.Context, opts ...gax.CallOption) error {
617 return op.lro.WaitWithInterval(ctx, nil, time.Minute, opts...)
618 }
619
620 // Poll fetches the latest state of the long-running operation.
621 //
622 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
623 //
624 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
625 // the operation has completed with failure, the error is returned and op.Done will return true.
626 // If Poll succeeds and the operation has completed successfully,
627 // op.Done will return true, and the response of the operation is returned.
628 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
629 func (op *DeletePrivateConnectionOperation) Poll(ctx context.Context, opts ...gax.CallOption) error {
630 return op.lro.Poll(ctx, nil, opts...)
631 }
632
633 // Metadata returns metadata associated with the long-running operation.
634 // Metadata itself does not contact the server, but Poll does.
635 // To get the latest metadata, call this method after a successful call to Poll.
636 // If the metadata is not available, the returned metadata and error are both nil.
637 func (op *DeletePrivateConnectionOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
638 var meta clouddmspb.OperationMetadata
639 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
640 return nil, nil
641 } else if err != nil {
642 return nil, err
643 }
644 return &meta, nil
645 }
646
647 // Done reports whether the long-running operation has completed.
648 func (op *DeletePrivateConnectionOperation) Done() bool {
649 return op.lro.Done()
650 }
651
652 // Name returns the name of the long-running operation.
653 // The name is assigned by the server and is unique within the service from which the operation is created.
654 func (op *DeletePrivateConnectionOperation) Name() string {
655 return op.lro.Name()
656 }
657
658 // ImportMappingRulesOperation manages a long-running operation from ImportMappingRules.
659 type ImportMappingRulesOperation struct {
660 lro *longrunning.Operation
661 }
662
663 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
664 //
665 // See documentation of Poll for error-handling information.
666 func (op *ImportMappingRulesOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
667 var resp clouddmspb.ConversionWorkspace
668 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
669 return nil, err
670 }
671 return &resp, nil
672 }
673
674 // Poll fetches the latest state of the long-running operation.
675 //
676 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
677 //
678 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
679 // the operation has completed with failure, the error is returned and op.Done will return true.
680 // If Poll succeeds and the operation has completed successfully,
681 // op.Done will return true, and the response of the operation is returned.
682 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
683 func (op *ImportMappingRulesOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
684 var resp clouddmspb.ConversionWorkspace
685 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
686 return nil, err
687 }
688 if !op.Done() {
689 return nil, nil
690 }
691 return &resp, nil
692 }
693
694 // Metadata returns metadata associated with the long-running operation.
695 // Metadata itself does not contact the server, but Poll does.
696 // To get the latest metadata, call this method after a successful call to Poll.
697 // If the metadata is not available, the returned metadata and error are both nil.
698 func (op *ImportMappingRulesOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
699 var meta clouddmspb.OperationMetadata
700 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
701 return nil, nil
702 } else if err != nil {
703 return nil, err
704 }
705 return &meta, nil
706 }
707
708 // Done reports whether the long-running operation has completed.
709 func (op *ImportMappingRulesOperation) Done() bool {
710 return op.lro.Done()
711 }
712
713 // Name returns the name of the long-running operation.
714 // The name is assigned by the server and is unique within the service from which the operation is created.
715 func (op *ImportMappingRulesOperation) Name() string {
716 return op.lro.Name()
717 }
718
719 // PromoteMigrationJobOperation manages a long-running operation from PromoteMigrationJob.
720 type PromoteMigrationJobOperation struct {
721 lro *longrunning.Operation
722 }
723
724 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
725 //
726 // See documentation of Poll for error-handling information.
727 func (op *PromoteMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
728 var resp clouddmspb.MigrationJob
729 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
730 return nil, err
731 }
732 return &resp, nil
733 }
734
735 // Poll fetches the latest state of the long-running operation.
736 //
737 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
738 //
739 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
740 // the operation has completed with failure, the error is returned and op.Done will return true.
741 // If Poll succeeds and the operation has completed successfully,
742 // op.Done will return true, and the response of the operation is returned.
743 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
744 func (op *PromoteMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
745 var resp clouddmspb.MigrationJob
746 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
747 return nil, err
748 }
749 if !op.Done() {
750 return nil, nil
751 }
752 return &resp, nil
753 }
754
755 // Metadata returns metadata associated with the long-running operation.
756 // Metadata itself does not contact the server, but Poll does.
757 // To get the latest metadata, call this method after a successful call to Poll.
758 // If the metadata is not available, the returned metadata and error are both nil.
759 func (op *PromoteMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
760 var meta clouddmspb.OperationMetadata
761 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
762 return nil, nil
763 } else if err != nil {
764 return nil, err
765 }
766 return &meta, nil
767 }
768
769 // Done reports whether the long-running operation has completed.
770 func (op *PromoteMigrationJobOperation) Done() bool {
771 return op.lro.Done()
772 }
773
774 // Name returns the name of the long-running operation.
775 // The name is assigned by the server and is unique within the service from which the operation is created.
776 func (op *PromoteMigrationJobOperation) Name() string {
777 return op.lro.Name()
778 }
779
780 // RestartMigrationJobOperation manages a long-running operation from RestartMigrationJob.
781 type RestartMigrationJobOperation struct {
782 lro *longrunning.Operation
783 }
784
785 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
786 //
787 // See documentation of Poll for error-handling information.
788 func (op *RestartMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
789 var resp clouddmspb.MigrationJob
790 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
791 return nil, err
792 }
793 return &resp, nil
794 }
795
796 // Poll fetches the latest state of the long-running operation.
797 //
798 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
799 //
800 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
801 // the operation has completed with failure, the error is returned and op.Done will return true.
802 // If Poll succeeds and the operation has completed successfully,
803 // op.Done will return true, and the response of the operation is returned.
804 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
805 func (op *RestartMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
806 var resp clouddmspb.MigrationJob
807 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
808 return nil, err
809 }
810 if !op.Done() {
811 return nil, nil
812 }
813 return &resp, nil
814 }
815
816 // Metadata returns metadata associated with the long-running operation.
817 // Metadata itself does not contact the server, but Poll does.
818 // To get the latest metadata, call this method after a successful call to Poll.
819 // If the metadata is not available, the returned metadata and error are both nil.
820 func (op *RestartMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
821 var meta clouddmspb.OperationMetadata
822 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
823 return nil, nil
824 } else if err != nil {
825 return nil, err
826 }
827 return &meta, nil
828 }
829
830 // Done reports whether the long-running operation has completed.
831 func (op *RestartMigrationJobOperation) Done() bool {
832 return op.lro.Done()
833 }
834
835 // Name returns the name of the long-running operation.
836 // The name is assigned by the server and is unique within the service from which the operation is created.
837 func (op *RestartMigrationJobOperation) Name() string {
838 return op.lro.Name()
839 }
840
841 // ResumeMigrationJobOperation manages a long-running operation from ResumeMigrationJob.
842 type ResumeMigrationJobOperation struct {
843 lro *longrunning.Operation
844 }
845
846 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
847 //
848 // See documentation of Poll for error-handling information.
849 func (op *ResumeMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
850 var resp clouddmspb.MigrationJob
851 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
852 return nil, err
853 }
854 return &resp, nil
855 }
856
857 // Poll fetches the latest state of the long-running operation.
858 //
859 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
860 //
861 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
862 // the operation has completed with failure, the error is returned and op.Done will return true.
863 // If Poll succeeds and the operation has completed successfully,
864 // op.Done will return true, and the response of the operation is returned.
865 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
866 func (op *ResumeMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
867 var resp clouddmspb.MigrationJob
868 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
869 return nil, err
870 }
871 if !op.Done() {
872 return nil, nil
873 }
874 return &resp, nil
875 }
876
877 // Metadata returns metadata associated with the long-running operation.
878 // Metadata itself does not contact the server, but Poll does.
879 // To get the latest metadata, call this method after a successful call to Poll.
880 // If the metadata is not available, the returned metadata and error are both nil.
881 func (op *ResumeMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
882 var meta clouddmspb.OperationMetadata
883 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
884 return nil, nil
885 } else if err != nil {
886 return nil, err
887 }
888 return &meta, nil
889 }
890
891 // Done reports whether the long-running operation has completed.
892 func (op *ResumeMigrationJobOperation) Done() bool {
893 return op.lro.Done()
894 }
895
896 // Name returns the name of the long-running operation.
897 // The name is assigned by the server and is unique within the service from which the operation is created.
898 func (op *ResumeMigrationJobOperation) Name() string {
899 return op.lro.Name()
900 }
901
902 // RollbackConversionWorkspaceOperation manages a long-running operation from RollbackConversionWorkspace.
903 type RollbackConversionWorkspaceOperation struct {
904 lro *longrunning.Operation
905 }
906
907 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
908 //
909 // See documentation of Poll for error-handling information.
910 func (op *RollbackConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
911 var resp clouddmspb.ConversionWorkspace
912 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
913 return nil, err
914 }
915 return &resp, nil
916 }
917
918 // Poll fetches the latest state of the long-running operation.
919 //
920 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
921 //
922 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
923 // the operation has completed with failure, the error is returned and op.Done will return true.
924 // If Poll succeeds and the operation has completed successfully,
925 // op.Done will return true, and the response of the operation is returned.
926 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
927 func (op *RollbackConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
928 var resp clouddmspb.ConversionWorkspace
929 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
930 return nil, err
931 }
932 if !op.Done() {
933 return nil, nil
934 }
935 return &resp, nil
936 }
937
938 // Metadata returns metadata associated with the long-running operation.
939 // Metadata itself does not contact the server, but Poll does.
940 // To get the latest metadata, call this method after a successful call to Poll.
941 // If the metadata is not available, the returned metadata and error are both nil.
942 func (op *RollbackConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
943 var meta clouddmspb.OperationMetadata
944 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
945 return nil, nil
946 } else if err != nil {
947 return nil, err
948 }
949 return &meta, nil
950 }
951
952 // Done reports whether the long-running operation has completed.
953 func (op *RollbackConversionWorkspaceOperation) Done() bool {
954 return op.lro.Done()
955 }
956
957 // Name returns the name of the long-running operation.
958 // The name is assigned by the server and is unique within the service from which the operation is created.
959 func (op *RollbackConversionWorkspaceOperation) Name() string {
960 return op.lro.Name()
961 }
962
963 // SeedConversionWorkspaceOperation manages a long-running operation from SeedConversionWorkspace.
964 type SeedConversionWorkspaceOperation struct {
965 lro *longrunning.Operation
966 }
967
968 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
969 //
970 // See documentation of Poll for error-handling information.
971 func (op *SeedConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
972 var resp clouddmspb.ConversionWorkspace
973 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
974 return nil, err
975 }
976 return &resp, nil
977 }
978
979 // Poll fetches the latest state of the long-running operation.
980 //
981 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
982 //
983 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
984 // the operation has completed with failure, the error is returned and op.Done will return true.
985 // If Poll succeeds and the operation has completed successfully,
986 // op.Done will return true, and the response of the operation is returned.
987 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
988 func (op *SeedConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
989 var resp clouddmspb.ConversionWorkspace
990 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
991 return nil, err
992 }
993 if !op.Done() {
994 return nil, nil
995 }
996 return &resp, nil
997 }
998
999 // Metadata returns metadata associated with the long-running operation.
1000 // Metadata itself does not contact the server, but Poll does.
1001 // To get the latest metadata, call this method after a successful call to Poll.
1002 // If the metadata is not available, the returned metadata and error are both nil.
1003 func (op *SeedConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1004 var meta clouddmspb.OperationMetadata
1005 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1006 return nil, nil
1007 } else if err != nil {
1008 return nil, err
1009 }
1010 return &meta, nil
1011 }
1012
1013 // Done reports whether the long-running operation has completed.
1014 func (op *SeedConversionWorkspaceOperation) Done() bool {
1015 return op.lro.Done()
1016 }
1017
1018 // Name returns the name of the long-running operation.
1019 // The name is assigned by the server and is unique within the service from which the operation is created.
1020 func (op *SeedConversionWorkspaceOperation) Name() string {
1021 return op.lro.Name()
1022 }
1023
1024 // StartMigrationJobOperation manages a long-running operation from StartMigrationJob.
1025 type StartMigrationJobOperation struct {
1026 lro *longrunning.Operation
1027 }
1028
1029 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1030 //
1031 // See documentation of Poll for error-handling information.
1032 func (op *StartMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1033 var resp clouddmspb.MigrationJob
1034 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1035 return nil, err
1036 }
1037 return &resp, nil
1038 }
1039
1040 // Poll fetches the latest state of the long-running operation.
1041 //
1042 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1043 //
1044 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1045 // the operation has completed with failure, the error is returned and op.Done will return true.
1046 // If Poll succeeds and the operation has completed successfully,
1047 // op.Done will return true, and the response of the operation is returned.
1048 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1049 func (op *StartMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1050 var resp clouddmspb.MigrationJob
1051 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1052 return nil, err
1053 }
1054 if !op.Done() {
1055 return nil, nil
1056 }
1057 return &resp, nil
1058 }
1059
1060 // Metadata returns metadata associated with the long-running operation.
1061 // Metadata itself does not contact the server, but Poll does.
1062 // To get the latest metadata, call this method after a successful call to Poll.
1063 // If the metadata is not available, the returned metadata and error are both nil.
1064 func (op *StartMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1065 var meta clouddmspb.OperationMetadata
1066 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1067 return nil, nil
1068 } else if err != nil {
1069 return nil, err
1070 }
1071 return &meta, nil
1072 }
1073
1074 // Done reports whether the long-running operation has completed.
1075 func (op *StartMigrationJobOperation) Done() bool {
1076 return op.lro.Done()
1077 }
1078
1079 // Name returns the name of the long-running operation.
1080 // The name is assigned by the server and is unique within the service from which the operation is created.
1081 func (op *StartMigrationJobOperation) Name() string {
1082 return op.lro.Name()
1083 }
1084
1085 // StopMigrationJobOperation manages a long-running operation from StopMigrationJob.
1086 type StopMigrationJobOperation struct {
1087 lro *longrunning.Operation
1088 }
1089
1090 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1091 //
1092 // See documentation of Poll for error-handling information.
1093 func (op *StopMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1094 var resp clouddmspb.MigrationJob
1095 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1096 return nil, err
1097 }
1098 return &resp, nil
1099 }
1100
1101 // Poll fetches the latest state of the long-running operation.
1102 //
1103 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1104 //
1105 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1106 // the operation has completed with failure, the error is returned and op.Done will return true.
1107 // If Poll succeeds and the operation has completed successfully,
1108 // op.Done will return true, and the response of the operation is returned.
1109 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1110 func (op *StopMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1111 var resp clouddmspb.MigrationJob
1112 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1113 return nil, err
1114 }
1115 if !op.Done() {
1116 return nil, nil
1117 }
1118 return &resp, nil
1119 }
1120
1121 // Metadata returns metadata associated with the long-running operation.
1122 // Metadata itself does not contact the server, but Poll does.
1123 // To get the latest metadata, call this method after a successful call to Poll.
1124 // If the metadata is not available, the returned metadata and error are both nil.
1125 func (op *StopMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1126 var meta clouddmspb.OperationMetadata
1127 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1128 return nil, nil
1129 } else if err != nil {
1130 return nil, err
1131 }
1132 return &meta, nil
1133 }
1134
1135 // Done reports whether the long-running operation has completed.
1136 func (op *StopMigrationJobOperation) Done() bool {
1137 return op.lro.Done()
1138 }
1139
1140 // Name returns the name of the long-running operation.
1141 // The name is assigned by the server and is unique within the service from which the operation is created.
1142 func (op *StopMigrationJobOperation) Name() string {
1143 return op.lro.Name()
1144 }
1145
1146 // UpdateConnectionProfileOperation manages a long-running operation from UpdateConnectionProfile.
1147 type UpdateConnectionProfileOperation struct {
1148 lro *longrunning.Operation
1149 }
1150
1151 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1152 //
1153 // See documentation of Poll for error-handling information.
1154 func (op *UpdateConnectionProfileOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConnectionProfile, error) {
1155 var resp clouddmspb.ConnectionProfile
1156 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1157 return nil, err
1158 }
1159 return &resp, nil
1160 }
1161
1162 // Poll fetches the latest state of the long-running operation.
1163 //
1164 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1165 //
1166 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1167 // the operation has completed with failure, the error is returned and op.Done will return true.
1168 // If Poll succeeds and the operation has completed successfully,
1169 // op.Done will return true, and the response of the operation is returned.
1170 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1171 func (op *UpdateConnectionProfileOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConnectionProfile, error) {
1172 var resp clouddmspb.ConnectionProfile
1173 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1174 return nil, err
1175 }
1176 if !op.Done() {
1177 return nil, nil
1178 }
1179 return &resp, nil
1180 }
1181
1182 // Metadata returns metadata associated with the long-running operation.
1183 // Metadata itself does not contact the server, but Poll does.
1184 // To get the latest metadata, call this method after a successful call to Poll.
1185 // If the metadata is not available, the returned metadata and error are both nil.
1186 func (op *UpdateConnectionProfileOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1187 var meta clouddmspb.OperationMetadata
1188 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1189 return nil, nil
1190 } else if err != nil {
1191 return nil, err
1192 }
1193 return &meta, nil
1194 }
1195
1196 // Done reports whether the long-running operation has completed.
1197 func (op *UpdateConnectionProfileOperation) Done() bool {
1198 return op.lro.Done()
1199 }
1200
1201 // Name returns the name of the long-running operation.
1202 // The name is assigned by the server and is unique within the service from which the operation is created.
1203 func (op *UpdateConnectionProfileOperation) Name() string {
1204 return op.lro.Name()
1205 }
1206
1207 // UpdateConversionWorkspaceOperation manages a long-running operation from UpdateConversionWorkspace.
1208 type UpdateConversionWorkspaceOperation struct {
1209 lro *longrunning.Operation
1210 }
1211
1212 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1213 //
1214 // See documentation of Poll for error-handling information.
1215 func (op *UpdateConversionWorkspaceOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
1216 var resp clouddmspb.ConversionWorkspace
1217 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1218 return nil, err
1219 }
1220 return &resp, nil
1221 }
1222
1223 // Poll fetches the latest state of the long-running operation.
1224 //
1225 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1226 //
1227 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1228 // the operation has completed with failure, the error is returned and op.Done will return true.
1229 // If Poll succeeds and the operation has completed successfully,
1230 // op.Done will return true, and the response of the operation is returned.
1231 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1232 func (op *UpdateConversionWorkspaceOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.ConversionWorkspace, error) {
1233 var resp clouddmspb.ConversionWorkspace
1234 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1235 return nil, err
1236 }
1237 if !op.Done() {
1238 return nil, nil
1239 }
1240 return &resp, nil
1241 }
1242
1243 // Metadata returns metadata associated with the long-running operation.
1244 // Metadata itself does not contact the server, but Poll does.
1245 // To get the latest metadata, call this method after a successful call to Poll.
1246 // If the metadata is not available, the returned metadata and error are both nil.
1247 func (op *UpdateConversionWorkspaceOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1248 var meta clouddmspb.OperationMetadata
1249 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1250 return nil, nil
1251 } else if err != nil {
1252 return nil, err
1253 }
1254 return &meta, nil
1255 }
1256
1257 // Done reports whether the long-running operation has completed.
1258 func (op *UpdateConversionWorkspaceOperation) Done() bool {
1259 return op.lro.Done()
1260 }
1261
1262 // Name returns the name of the long-running operation.
1263 // The name is assigned by the server and is unique within the service from which the operation is created.
1264 func (op *UpdateConversionWorkspaceOperation) Name() string {
1265 return op.lro.Name()
1266 }
1267
1268 // UpdateMigrationJobOperation manages a long-running operation from UpdateMigrationJob.
1269 type UpdateMigrationJobOperation struct {
1270 lro *longrunning.Operation
1271 }
1272
1273 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1274 //
1275 // See documentation of Poll for error-handling information.
1276 func (op *UpdateMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1277 var resp clouddmspb.MigrationJob
1278 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1279 return nil, err
1280 }
1281 return &resp, nil
1282 }
1283
1284 // Poll fetches the latest state of the long-running operation.
1285 //
1286 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1287 //
1288 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1289 // the operation has completed with failure, the error is returned and op.Done will return true.
1290 // If Poll succeeds and the operation has completed successfully,
1291 // op.Done will return true, and the response of the operation is returned.
1292 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1293 func (op *UpdateMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1294 var resp clouddmspb.MigrationJob
1295 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1296 return nil, err
1297 }
1298 if !op.Done() {
1299 return nil, nil
1300 }
1301 return &resp, nil
1302 }
1303
1304 // Metadata returns metadata associated with the long-running operation.
1305 // Metadata itself does not contact the server, but Poll does.
1306 // To get the latest metadata, call this method after a successful call to Poll.
1307 // If the metadata is not available, the returned metadata and error are both nil.
1308 func (op *UpdateMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1309 var meta clouddmspb.OperationMetadata
1310 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1311 return nil, nil
1312 } else if err != nil {
1313 return nil, err
1314 }
1315 return &meta, nil
1316 }
1317
1318 // Done reports whether the long-running operation has completed.
1319 func (op *UpdateMigrationJobOperation) Done() bool {
1320 return op.lro.Done()
1321 }
1322
1323 // Name returns the name of the long-running operation.
1324 // The name is assigned by the server and is unique within the service from which the operation is created.
1325 func (op *UpdateMigrationJobOperation) Name() string {
1326 return op.lro.Name()
1327 }
1328
1329 // VerifyMigrationJobOperation manages a long-running operation from VerifyMigrationJob.
1330 type VerifyMigrationJobOperation struct {
1331 lro *longrunning.Operation
1332 }
1333
1334 // Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
1335 //
1336 // See documentation of Poll for error-handling information.
1337 func (op *VerifyMigrationJobOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1338 var resp clouddmspb.MigrationJob
1339 if err := op.lro.WaitWithInterval(ctx, &resp, time.Minute, opts...); err != nil {
1340 return nil, err
1341 }
1342 return &resp, nil
1343 }
1344
1345 // Poll fetches the latest state of the long-running operation.
1346 //
1347 // Poll also fetches the latest metadata, which can be retrieved by Metadata.
1348 //
1349 // If Poll fails, the error is returned and op is unmodified. If Poll succeeds and
1350 // the operation has completed with failure, the error is returned and op.Done will return true.
1351 // If Poll succeeds and the operation has completed successfully,
1352 // op.Done will return true, and the response of the operation is returned.
1353 // If Poll succeeds and the operation has not completed, the returned response and error are both nil.
1354 func (op *VerifyMigrationJobOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*clouddmspb.MigrationJob, error) {
1355 var resp clouddmspb.MigrationJob
1356 if err := op.lro.Poll(ctx, &resp, opts...); err != nil {
1357 return nil, err
1358 }
1359 if !op.Done() {
1360 return nil, nil
1361 }
1362 return &resp, nil
1363 }
1364
1365 // Metadata returns metadata associated with the long-running operation.
1366 // Metadata itself does not contact the server, but Poll does.
1367 // To get the latest metadata, call this method after a successful call to Poll.
1368 // If the metadata is not available, the returned metadata and error are both nil.
1369 func (op *VerifyMigrationJobOperation) Metadata() (*clouddmspb.OperationMetadata, error) {
1370 var meta clouddmspb.OperationMetadata
1371 if err := op.lro.Metadata(&meta); err == longrunning.ErrNoMetadata {
1372 return nil, nil
1373 } else if err != nil {
1374 return nil, err
1375 }
1376 return &meta, nil
1377 }
1378
1379 // Done reports whether the long-running operation has completed.
1380 func (op *VerifyMigrationJobOperation) Done() bool {
1381 return op.lro.Done()
1382 }
1383
1384 // Name returns the name of the long-running operation.
1385 // The name is assigned by the server and is unique within the service from which the operation is created.
1386 func (op *VerifyMigrationJobOperation) Name() string {
1387 return op.lro.Name()
1388 }
1389
1390 // ConnectionProfileIterator manages a stream of *clouddmspb.ConnectionProfile.
1391 type ConnectionProfileIterator struct {
1392 items []*clouddmspb.ConnectionProfile
1393 pageInfo *iterator.PageInfo
1394 nextFunc func() error
1395
1396 // Response is the raw response for the current page.
1397 // It must be cast to the RPC response type.
1398 // Calling Next() or InternalFetch() updates this value.
1399 Response interface{}
1400
1401 // InternalFetch is for use by the Google Cloud Libraries only.
1402 // It is not part of the stable interface of this package.
1403 //
1404 // InternalFetch returns results from a single call to the underlying RPC.
1405 // The number of results is no greater than pageSize.
1406 // If there are no more results, nextPageToken is empty and err is nil.
1407 InternalFetch func(pageSize int, pageToken string) (results []*clouddmspb.ConnectionProfile, nextPageToken string, err error)
1408 }
1409
1410 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1411 func (it *ConnectionProfileIterator) PageInfo() *iterator.PageInfo {
1412 return it.pageInfo
1413 }
1414
1415 // Next returns the next result. Its second return value is iterator.Done if there are no more
1416 // results. Once Next returns Done, all subsequent calls will return Done.
1417 func (it *ConnectionProfileIterator) Next() (*clouddmspb.ConnectionProfile, error) {
1418 var item *clouddmspb.ConnectionProfile
1419 if err := it.nextFunc(); err != nil {
1420 return item, err
1421 }
1422 item = it.items[0]
1423 it.items = it.items[1:]
1424 return item, nil
1425 }
1426
1427 func (it *ConnectionProfileIterator) bufLen() int {
1428 return len(it.items)
1429 }
1430
1431 func (it *ConnectionProfileIterator) takeBuf() interface{} {
1432 b := it.items
1433 it.items = nil
1434 return b
1435 }
1436
1437 // ConversionWorkspaceIterator manages a stream of *clouddmspb.ConversionWorkspace.
1438 type ConversionWorkspaceIterator struct {
1439 items []*clouddmspb.ConversionWorkspace
1440 pageInfo *iterator.PageInfo
1441 nextFunc func() error
1442
1443 // Response is the raw response for the current page.
1444 // It must be cast to the RPC response type.
1445 // Calling Next() or InternalFetch() updates this value.
1446 Response interface{}
1447
1448 // InternalFetch is for use by the Google Cloud Libraries only.
1449 // It is not part of the stable interface of this package.
1450 //
1451 // InternalFetch returns results from a single call to the underlying RPC.
1452 // The number of results is no greater than pageSize.
1453 // If there are no more results, nextPageToken is empty and err is nil.
1454 InternalFetch func(pageSize int, pageToken string) (results []*clouddmspb.ConversionWorkspace, nextPageToken string, err error)
1455 }
1456
1457 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1458 func (it *ConversionWorkspaceIterator) PageInfo() *iterator.PageInfo {
1459 return it.pageInfo
1460 }
1461
1462 // Next returns the next result. Its second return value is iterator.Done if there are no more
1463 // results. Once Next returns Done, all subsequent calls will return Done.
1464 func (it *ConversionWorkspaceIterator) Next() (*clouddmspb.ConversionWorkspace, error) {
1465 var item *clouddmspb.ConversionWorkspace
1466 if err := it.nextFunc(); err != nil {
1467 return item, err
1468 }
1469 item = it.items[0]
1470 it.items = it.items[1:]
1471 return item, nil
1472 }
1473
1474 func (it *ConversionWorkspaceIterator) bufLen() int {
1475 return len(it.items)
1476 }
1477
1478 func (it *ConversionWorkspaceIterator) takeBuf() interface{} {
1479 b := it.items
1480 it.items = nil
1481 return b
1482 }
1483
1484 // DatabaseEntityIterator manages a stream of *clouddmspb.DatabaseEntity.
1485 type DatabaseEntityIterator struct {
1486 items []*clouddmspb.DatabaseEntity
1487 pageInfo *iterator.PageInfo
1488 nextFunc func() error
1489
1490 // Response is the raw response for the current page.
1491 // It must be cast to the RPC response type.
1492 // Calling Next() or InternalFetch() updates this value.
1493 Response interface{}
1494
1495 // InternalFetch is for use by the Google Cloud Libraries only.
1496 // It is not part of the stable interface of this package.
1497 //
1498 // InternalFetch returns results from a single call to the underlying RPC.
1499 // The number of results is no greater than pageSize.
1500 // If there are no more results, nextPageToken is empty and err is nil.
1501 InternalFetch func(pageSize int, pageToken string) (results []*clouddmspb.DatabaseEntity, nextPageToken string, err error)
1502 }
1503
1504 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1505 func (it *DatabaseEntityIterator) PageInfo() *iterator.PageInfo {
1506 return it.pageInfo
1507 }
1508
1509 // Next returns the next result. Its second return value is iterator.Done if there are no more
1510 // results. Once Next returns Done, all subsequent calls will return Done.
1511 func (it *DatabaseEntityIterator) Next() (*clouddmspb.DatabaseEntity, error) {
1512 var item *clouddmspb.DatabaseEntity
1513 if err := it.nextFunc(); err != nil {
1514 return item, err
1515 }
1516 item = it.items[0]
1517 it.items = it.items[1:]
1518 return item, nil
1519 }
1520
1521 func (it *DatabaseEntityIterator) bufLen() int {
1522 return len(it.items)
1523 }
1524
1525 func (it *DatabaseEntityIterator) takeBuf() interface{} {
1526 b := it.items
1527 it.items = nil
1528 return b
1529 }
1530
1531 // LocationIterator manages a stream of *locationpb.Location.
1532 type LocationIterator struct {
1533 items []*locationpb.Location
1534 pageInfo *iterator.PageInfo
1535 nextFunc func() error
1536
1537 // Response is the raw response for the current page.
1538 // It must be cast to the RPC response type.
1539 // Calling Next() or InternalFetch() updates this value.
1540 Response interface{}
1541
1542 // InternalFetch is for use by the Google Cloud Libraries only.
1543 // It is not part of the stable interface of this package.
1544 //
1545 // InternalFetch returns results from a single call to the underlying RPC.
1546 // The number of results is no greater than pageSize.
1547 // If there are no more results, nextPageToken is empty and err is nil.
1548 InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error)
1549 }
1550
1551 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1552 func (it *LocationIterator) PageInfo() *iterator.PageInfo {
1553 return it.pageInfo
1554 }
1555
1556 // Next returns the next result. Its second return value is iterator.Done if there are no more
1557 // results. Once Next returns Done, all subsequent calls will return Done.
1558 func (it *LocationIterator) Next() (*locationpb.Location, error) {
1559 var item *locationpb.Location
1560 if err := it.nextFunc(); err != nil {
1561 return item, err
1562 }
1563 item = it.items[0]
1564 it.items = it.items[1:]
1565 return item, nil
1566 }
1567
1568 func (it *LocationIterator) bufLen() int {
1569 return len(it.items)
1570 }
1571
1572 func (it *LocationIterator) takeBuf() interface{} {
1573 b := it.items
1574 it.items = nil
1575 return b
1576 }
1577
1578 // MappingRuleIterator manages a stream of *clouddmspb.MappingRule.
1579 type MappingRuleIterator struct {
1580 items []*clouddmspb.MappingRule
1581 pageInfo *iterator.PageInfo
1582 nextFunc func() error
1583
1584 // Response is the raw response for the current page.
1585 // It must be cast to the RPC response type.
1586 // Calling Next() or InternalFetch() updates this value.
1587 Response interface{}
1588
1589 // InternalFetch is for use by the Google Cloud Libraries only.
1590 // It is not part of the stable interface of this package.
1591 //
1592 // InternalFetch returns results from a single call to the underlying RPC.
1593 // The number of results is no greater than pageSize.
1594 // If there are no more results, nextPageToken is empty and err is nil.
1595 InternalFetch func(pageSize int, pageToken string) (results []*clouddmspb.MappingRule, nextPageToken string, err error)
1596 }
1597
1598 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1599 func (it *MappingRuleIterator) PageInfo() *iterator.PageInfo {
1600 return it.pageInfo
1601 }
1602
1603 // Next returns the next result. Its second return value is iterator.Done if there are no more
1604 // results. Once Next returns Done, all subsequent calls will return Done.
1605 func (it *MappingRuleIterator) Next() (*clouddmspb.MappingRule, error) {
1606 var item *clouddmspb.MappingRule
1607 if err := it.nextFunc(); err != nil {
1608 return item, err
1609 }
1610 item = it.items[0]
1611 it.items = it.items[1:]
1612 return item, nil
1613 }
1614
1615 func (it *MappingRuleIterator) bufLen() int {
1616 return len(it.items)
1617 }
1618
1619 func (it *MappingRuleIterator) takeBuf() interface{} {
1620 b := it.items
1621 it.items = nil
1622 return b
1623 }
1624
1625 // MigrationJobIterator manages a stream of *clouddmspb.MigrationJob.
1626 type MigrationJobIterator struct {
1627 items []*clouddmspb.MigrationJob
1628 pageInfo *iterator.PageInfo
1629 nextFunc func() error
1630
1631 // Response is the raw response for the current page.
1632 // It must be cast to the RPC response type.
1633 // Calling Next() or InternalFetch() updates this value.
1634 Response interface{}
1635
1636 // InternalFetch is for use by the Google Cloud Libraries only.
1637 // It is not part of the stable interface of this package.
1638 //
1639 // InternalFetch returns results from a single call to the underlying RPC.
1640 // The number of results is no greater than pageSize.
1641 // If there are no more results, nextPageToken is empty and err is nil.
1642 InternalFetch func(pageSize int, pageToken string) (results []*clouddmspb.MigrationJob, nextPageToken string, err error)
1643 }
1644
1645 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1646 func (it *MigrationJobIterator) PageInfo() *iterator.PageInfo {
1647 return it.pageInfo
1648 }
1649
1650 // Next returns the next result. Its second return value is iterator.Done if there are no more
1651 // results. Once Next returns Done, all subsequent calls will return Done.
1652 func (it *MigrationJobIterator) Next() (*clouddmspb.MigrationJob, error) {
1653 var item *clouddmspb.MigrationJob
1654 if err := it.nextFunc(); err != nil {
1655 return item, err
1656 }
1657 item = it.items[0]
1658 it.items = it.items[1:]
1659 return item, nil
1660 }
1661
1662 func (it *MigrationJobIterator) bufLen() int {
1663 return len(it.items)
1664 }
1665
1666 func (it *MigrationJobIterator) takeBuf() interface{} {
1667 b := it.items
1668 it.items = nil
1669 return b
1670 }
1671
1672 // OperationIterator manages a stream of *longrunningpb.Operation.
1673 type OperationIterator struct {
1674 items []*longrunningpb.Operation
1675 pageInfo *iterator.PageInfo
1676 nextFunc func() error
1677
1678 // Response is the raw response for the current page.
1679 // It must be cast to the RPC response type.
1680 // Calling Next() or InternalFetch() updates this value.
1681 Response interface{}
1682
1683 // InternalFetch is for use by the Google Cloud Libraries only.
1684 // It is not part of the stable interface of this package.
1685 //
1686 // InternalFetch returns results from a single call to the underlying RPC.
1687 // The number of results is no greater than pageSize.
1688 // If there are no more results, nextPageToken is empty and err is nil.
1689 InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error)
1690 }
1691
1692 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1693 func (it *OperationIterator) PageInfo() *iterator.PageInfo {
1694 return it.pageInfo
1695 }
1696
1697 // Next returns the next result. Its second return value is iterator.Done if there are no more
1698 // results. Once Next returns Done, all subsequent calls will return Done.
1699 func (it *OperationIterator) Next() (*longrunningpb.Operation, error) {
1700 var item *longrunningpb.Operation
1701 if err := it.nextFunc(); err != nil {
1702 return item, err
1703 }
1704 item = it.items[0]
1705 it.items = it.items[1:]
1706 return item, nil
1707 }
1708
1709 func (it *OperationIterator) bufLen() int {
1710 return len(it.items)
1711 }
1712
1713 func (it *OperationIterator) takeBuf() interface{} {
1714 b := it.items
1715 it.items = nil
1716 return b
1717 }
1718
1719 // PrivateConnectionIterator manages a stream of *clouddmspb.PrivateConnection.
1720 type PrivateConnectionIterator struct {
1721 items []*clouddmspb.PrivateConnection
1722 pageInfo *iterator.PageInfo
1723 nextFunc func() error
1724
1725 // Response is the raw response for the current page.
1726 // It must be cast to the RPC response type.
1727 // Calling Next() or InternalFetch() updates this value.
1728 Response interface{}
1729
1730 // InternalFetch is for use by the Google Cloud Libraries only.
1731 // It is not part of the stable interface of this package.
1732 //
1733 // InternalFetch returns results from a single call to the underlying RPC.
1734 // The number of results is no greater than pageSize.
1735 // If there are no more results, nextPageToken is empty and err is nil.
1736 InternalFetch func(pageSize int, pageToken string) (results []*clouddmspb.PrivateConnection, nextPageToken string, err error)
1737 }
1738
1739 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1740 func (it *PrivateConnectionIterator) PageInfo() *iterator.PageInfo {
1741 return it.pageInfo
1742 }
1743
1744 // Next returns the next result. Its second return value is iterator.Done if there are no more
1745 // results. Once Next returns Done, all subsequent calls will return Done.
1746 func (it *PrivateConnectionIterator) Next() (*clouddmspb.PrivateConnection, error) {
1747 var item *clouddmspb.PrivateConnection
1748 if err := it.nextFunc(); err != nil {
1749 return item, err
1750 }
1751 item = it.items[0]
1752 it.items = it.items[1:]
1753 return item, nil
1754 }
1755
1756 func (it *PrivateConnectionIterator) bufLen() int {
1757 return len(it.items)
1758 }
1759
1760 func (it *PrivateConnectionIterator) takeBuf() interface{} {
1761 b := it.items
1762 it.items = nil
1763 return b
1764 }
1765
1766 // StringIterator manages a stream of string.
1767 type StringIterator struct {
1768 items []string
1769 pageInfo *iterator.PageInfo
1770 nextFunc func() error
1771
1772 // Response is the raw response for the current page.
1773 // It must be cast to the RPC response type.
1774 // Calling Next() or InternalFetch() updates this value.
1775 Response interface{}
1776
1777 // InternalFetch is for use by the Google Cloud Libraries only.
1778 // It is not part of the stable interface of this package.
1779 //
1780 // InternalFetch returns results from a single call to the underlying RPC.
1781 // The number of results is no greater than pageSize.
1782 // If there are no more results, nextPageToken is empty and err is nil.
1783 InternalFetch func(pageSize int, pageToken string) (results []string, nextPageToken string, err error)
1784 }
1785
1786 // PageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
1787 func (it *StringIterator) PageInfo() *iterator.PageInfo {
1788 return it.pageInfo
1789 }
1790
1791 // Next returns the next result. Its second return value is iterator.Done if there are no more
1792 // results. Once Next returns Done, all subsequent calls will return Done.
1793 func (it *StringIterator) Next() (string, error) {
1794 var item string
1795 if err := it.nextFunc(); err != nil {
1796 return item, err
1797 }
1798 item = it.items[0]
1799 it.items = it.items[1:]
1800 return item, nil
1801 }
1802
1803 func (it *StringIterator) bufLen() int {
1804 return len(it.items)
1805 }
1806
1807 func (it *StringIterator) takeBuf() interface{} {
1808 b := it.items
1809 it.items = nil
1810 return b
1811 }